From fbdde3a89c8b210feb46c332853299d30e103e90 Mon Sep 17 00:00:00 2001 From: Ciro Spaciari Date: Thu, 4 Sep 2025 15:21:00 -0700 Subject: [PATCH] we need to close at some point --- src/http.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/http.zig b/src/http.zig index 25d133bd44..a2d8661008 100644 --- a/src/http.zig +++ b/src/http.zig @@ -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) {