Commit 6cf10f84 authored by jan.koester's avatar jan.koester
Browse files

http: clear ResponsePending after H1 Range branch's synchronous drain

libhttppp's send(..., -1) now marks ResponsePending unconditionally (see
markDeferredIfStreaming(), added to fix blogi's H1 getimage stream never
resuming) so _dispatchH1Request knows to call ResponseEvent again for a
genuinely deferred response. This branch already drains its whole body
synchronously and never uses ext->streaming for H1, so that follow-up call
would be a harmless no-op -- clear the flag anyway to skip it.

Co-Authored-By: default avatarClaude Sonnet 5 <noreply@anthropic.com>
parent 98456bd8
Loading
Loading
Loading
Loading
+7 −0
Changes for src/http/HttpProxyServer.cpp: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -679,6 +679,13 @@ void HttpProxyController::RequestEvent(libhttppp::HttpRequest &curreq, const int
                        // H1 offload has no equivalent, so relay the whole body synchronously,
                        // right here, instead.
                        curres.send(curreq, "", -1);
                        // send(..., -1) marks ResponsePending (see libhttppp's
                        // markDeferredIfStreaming(), added so _dispatchH1Request knows to keep
                        // calling ResponseEvent for a deferred response) -- harmless here since
                        // this branch already drains the whole body itself below and
                        // HttpProxyController::ResponseEvent no-ops with no ext->streaming set,
                        // but clearing it avoids that one pointless extra call+flush attempt.
                        curreq.slots[0].ResponsePending.store(false, std::memory_order_release);
                        if (!curreq.flushSendData()) {
                            // Client gave up reading -- nothing left to do; poolGuard below
                            // still closes rather than pools this connection since upstreamOk