Skip to content

Commit 1714c76

Browse files
author
Embedthis Software
committed
UPGRADE: paks
1 parent 04e6e9c commit 1714c76

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

paks/http/dist/httpLib.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6153,6 +6153,10 @@ PUBLIC void httpIO(HttpConn *conn, int eventMask)
61536153
/* Connection has been destroyed */
61546154
return;
61556155
}
6156+
if (conn->state < HTTP_STATE_PARSED && mprShouldDenyNewRequests()) {
6157+
httpDestroyConn(conn);
6158+
return;
6159+
}
61566160
assert(conn->tx);
61576161
assert(conn->rx);
61586162

@@ -8272,9 +8276,6 @@ static void errorRedirect(HttpConn *conn, cchar *uri)
82728276
{
82738277
HttpTx *tx;
82748278

8275-
/*
8276-
If the response has started or it is an external redirect ... do a redirect
8277-
*/
82788279
tx = conn->tx;
82798280
if (sstarts(uri, "http") || tx->flags & HTTP_TX_HEADERS_CREATED) {
82808281
httpRedirect(conn, HTTP_CODE_MOVED_PERMANENTLY, uri);
@@ -8283,7 +8284,7 @@ static void errorRedirect(HttpConn *conn, cchar *uri)
82838284
No response started and it is an internal redirect, so we can rerun the request.
82848285
Set finalized to "cap" any output. processCompletion() in rx.c will rerun the request using the errorDocument.
82858286
*/
8286-
tx->errorDocument = httpLink(conn, uri);
8287+
tx->errorDocument = httpLinkAbs(conn, uri);
82878288
tx->finalized = tx->finalizedOutput = tx->finalizedConnector = 1;
82888289
}
82898290
}

src/http/httpLib.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6153,6 +6153,10 @@ PUBLIC void httpIO(HttpConn *conn, int eventMask)
61536153
/* Connection has been destroyed */
61546154
return;
61556155
}
6156+
if (conn->state < HTTP_STATE_PARSED && mprShouldDenyNewRequests()) {
6157+
httpDestroyConn(conn);
6158+
return;
6159+
}
61566160
assert(conn->tx);
61576161
assert(conn->rx);
61586162

@@ -8272,9 +8276,6 @@ static void errorRedirect(HttpConn *conn, cchar *uri)
82728276
{
82738277
HttpTx *tx;
82748278

8275-
/*
8276-
If the response has started or it is an external redirect ... do a redirect
8277-
*/
82788279
tx = conn->tx;
82798280
if (sstarts(uri, "http") || tx->flags & HTTP_TX_HEADERS_CREATED) {
82808281
httpRedirect(conn, HTTP_CODE_MOVED_PERMANENTLY, uri);
@@ -8283,7 +8284,7 @@ static void errorRedirect(HttpConn *conn, cchar *uri)
82838284
No response started and it is an internal redirect, so we can rerun the request.
82848285
Set finalized to "cap" any output. processCompletion() in rx.c will rerun the request using the errorDocument.
82858286
*/
8286-
tx->errorDocument = httpLink(conn, uri);
8287+
tx->errorDocument = httpLinkAbs(conn, uri);
82878288
tx->finalized = tx->finalizedOutput = tx->finalizedConnector = 1;
82888289
}
82898290
}

0 commit comments

Comments
 (0)