Loading src/http.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -969,6 +969,11 @@ libhttppp::HttpResponse libhttppp::HttpClient::GetStream(libhttppp::HttpRequest if (!got_any) { if (q->isStreamComplete(stream_id) && !q->hasStreamData(stream_id)) break; if (q->isStreamReset(stream_id)) { HTTPException ee; ee[HTTPException::Error] << "HTTP/3 stream aborted by peer"; throw ee; } if (std::chrono::steady_clock::now() >= h3_header_deadline) { HTTPException ee; ee[HTTPException::Error] << "HTTP/3 header timeout"; Loading Loading @@ -1898,6 +1903,16 @@ size_t libhttppp::HttpClient::readBodyChunk(char *buf, size_t bufsize) { _streamMode = STREAM_NONE; return 0; } if (q->isStreamReset(_streamH3Sid)) { // Upstream aborted mid-body (e.g. it stalled short of // the advertised Content-Length). Surface this as an // error rather than silently handing back a // truncated body (a partially-decoded image, etc). _streamMode = STREAM_NONE; HTTPException ee; ee[HTTPException::Error] << "HTTP/3 stream aborted by peer"; throw ee; } if (std::chrono::steady_clock::now() >= deadline) { HTTPException ee; ee[HTTPException::Error] << "HTTP/3 stream read timeout"; Loading src/httpd.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -1410,7 +1410,13 @@ void libhttppp::HttpEvent::Http3StreamEvent(netplus::socket *sock, } if (sent < content_length) { q->sendStreamData(stream_id, nullptr, 0, true); // Genuine stall with the response short of the // advertised Content-Length. Sending FIN here would make // the client accept a truncated body as complete (e.g. a // corrupted image). Abort the stream instead so the // client sees a failed transfer, mirroring the H2 stall // handling above. q->resetStream(stream_id, 0x0102); // H3_INTERNAL_ERROR } }).detach(); Loading Loading
src/http.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -969,6 +969,11 @@ libhttppp::HttpResponse libhttppp::HttpClient::GetStream(libhttppp::HttpRequest if (!got_any) { if (q->isStreamComplete(stream_id) && !q->hasStreamData(stream_id)) break; if (q->isStreamReset(stream_id)) { HTTPException ee; ee[HTTPException::Error] << "HTTP/3 stream aborted by peer"; throw ee; } if (std::chrono::steady_clock::now() >= h3_header_deadline) { HTTPException ee; ee[HTTPException::Error] << "HTTP/3 header timeout"; Loading Loading @@ -1898,6 +1903,16 @@ size_t libhttppp::HttpClient::readBodyChunk(char *buf, size_t bufsize) { _streamMode = STREAM_NONE; return 0; } if (q->isStreamReset(_streamH3Sid)) { // Upstream aborted mid-body (e.g. it stalled short of // the advertised Content-Length). Surface this as an // error rather than silently handing back a // truncated body (a partially-decoded image, etc). _streamMode = STREAM_NONE; HTTPException ee; ee[HTTPException::Error] << "HTTP/3 stream aborted by peer"; throw ee; } if (std::chrono::steady_clock::now() >= deadline) { HTTPException ee; ee[HTTPException::Error] << "HTTP/3 stream read timeout"; Loading
src/httpd.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -1410,7 +1410,13 @@ void libhttppp::HttpEvent::Http3StreamEvent(netplus::socket *sock, } if (sent < content_length) { q->sendStreamData(stream_id, nullptr, 0, true); // Genuine stall with the response short of the // advertised Content-Length. Sending FIN here would make // the client accept a truncated body as complete (e.g. a // corrupted image). Abort the stream instead so the // client sees a failed transfer, mirroring the H2 stall // handling above. q->resetStream(stream_id, 0x0102); // H3_INTERNAL_ERROR } }).detach(); Loading