Commit 2eeb452b authored by jan.koester's avatar jan.koester
Browse files

test

parent 0c7d9977
Loading
Loading
Loading
Loading
+10 −1
Changes for src/http/HttpProxyServer.cpp: 10 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -660,7 +660,16 @@ void HttpProxyController::RequestEvent(libhttppp::HttpRequest &curreq, const int
                    // hasn't finished draining yet.
                    auto *ext = ensureExt(curreq);
                    ext->streaming.client = std::move(poolGuard.client);
                    ext->streaming.pool = poolGuard.pool;
                    // A Range response with no (or a zero) Content-Length is unexpected --
                    // neither blogi's nor bolli's own media routes ever send one -- and without
                    // a reliable byte count there's no safe way to know whether the body is
                    // actually empty or this connection still has an unknown-length body sitting
                    // unread on the wire. Leaving `pool` null here means ResponseEvent (which
                    // will consider produced(0)>=send_size(0) already "done" without reading
                    // anything) just lets the connection close instead of handing back
                    // something that might still have unread bytes queued -- closing an unused
                    // socket is always safe; pooling a possibly-desynced one is not.
                    ext->streaming.pool = (rangeContentLength > 0) ? poolGuard.pool : nullptr;
                    ext->streaming.origin = poolGuard.origin;
                    ext->streaming.send_size = rangeContentLength;
                    ext->streaming.produced = 0;