we need to close at some point

This commit is contained in:
Ciro Spaciari
2025-09-04 15:21:00 -07:00
parent e2767b970d
commit fbdde3a89c

View File

@@ -1069,6 +1069,11 @@ pub fn writeToStream(this: *HTTPClient, comptime is_ssl: bool, socket: NewHTTPCo
this.state.request_stage = .done;
stream_buffer.release();
stream.detach();
if (this.flags.upgrade_state == .upgraded) {
this.state.flags.received_last_chunk = true;
// upgraded connection will end when the body is done (no half-open connections)
this.progressUpdate(is_ssl, if (is_ssl) &http_thread.https_context else &http_thread.http_context, socket);
}
} else {
// only report drain if we send everything and previous we had something to send
if (!wasEmpty) {