From bb651789ba3c94888915224ffd6c5dacea3e789e Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Mon, 1 Jun 2026 12:44:32 +0200 Subject: [PATCH] proxy_handler: Fix return value of proxy_handler_2() --- src/lib/proxy.c | 2 +- src/worker/proxy_handler.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/proxy.c b/src/lib/proxy.c index f213328..6713ca1 100644 --- a/src/lib/proxy.c +++ b/src/lib/proxy.c @@ -410,7 +410,7 @@ int proxy_init(proxy_ctx_t **proxy_ptr, http_req *req, http_res *res, http_statu if (!retry) return -1; - // honor server timeout with one second buffer + // honor server timeout with one-second buffer if (!proxy->initialized || srv_error || (proxy->http_timeout > 0 && (clock_micros() - proxy->proxy.ts_last_send) >= proxy->http_timeout) || sock_has_pending(&proxy->proxy, SOCK_DONTWAIT)) diff --git a/src/worker/proxy_handler.c b/src/worker/proxy_handler.c index d7a8f49..51ea9b4 100644 --- a/src/worker/proxy_handler.c +++ b/src/worker/proxy_handler.c @@ -155,5 +155,5 @@ static int proxy_handler_2(client_ctx_t *ctx) { ctx->transferred_length += ret; } - return ret; + return ret >= 0 ? 0 : ret; }