Commit bb286af5 authored by jan.koester's avatar jan.koester
Browse files

fixed

parent ca4e9863
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -742,8 +742,14 @@ void libhttppp::HttpEvent::_resumeH2Streams(HttpRequest &cureq,
                // advance and a permanently-stalled upstream spun forever.
                ++ss->emptyCount;
                if (ss->emptyCount > 500) {
                    // Genuine stall — send END_STREAM
                    out += h2BuildFrame(H2_FRAME_DATA, H2_FLAG_END_STREAM, sid, "");
                    // Genuine stall with the response short of the
                    // advertised Content-Length. Sending END_STREAM 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.
                    uint8_t rst[4] = {0, 0, 0, 0x02}; // INTERNAL_ERROR
                    out += h2BuildFrame(H2_FRAME_RST_STREAM, 0, sid,
                        std::string(reinterpret_cast<char*>(rst), 4));
                    cureq.h2state().peerStreamWindows.erase(sid);
                    streams.erase(it);
                } else {