commit 1abd14d4b9c9643ef9b14423e8cb633fc9d07c19
parent ea9c4ec19991b887a8c1d97fa1837f09394afd02
Author: Christian Grothoff <christian@grothoff.org>
Date: Mon, 3 Aug 2026 21:04:19 +0200
fix early-response handling in reverse proxy
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/backend/paivana-httpd_reverse.c b/src/backend/paivana-httpd_reverse.c
@@ -705,14 +705,15 @@ curl_download_cb (void *cls,
header->value));
}
if ( (REQUEST_STATE_PROXY_DOWNLOAD_STARTED == hr->state) ||
- ( (REQUEST_STATE_PROXY_UPLOAD_STARTED == hr->state) &&
- (0 == hr->io_len) ) )
+ (REQUEST_STATE_PROXY_UPLOAD_STARTED == hr->state) )
{
/* Either the request body was empty (CURLOPT_POSTFIELDSIZE = 0,
so libcurl never called our read callback) or the upload
already drained but we have not yet entered upload_cb to
flip the state — either way, the upload is complete and we
can move straight on to consuming the response. */
+ hr->io_len = 0; /* drains upload if it was not yet due to
+ early response from server */
hr->state = REQUEST_STATE_PROXY_DOWNLOAD_DONE;
}
}