aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/http_client_async.zig14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/http_client_async.zig b/src/http_client_async.zig
index 1e0ba7cc0..6c731acd5 100644
--- a/src/http_client_async.zig
+++ b/src/http_client_async.zig
@@ -1343,7 +1343,7 @@ pub const InternalState = struct {
return this.transfer_encoding == Encoding.chunked;
}
- pub fn reset(this: *InternalState, buffering: bool, allocator: std.mem.Allocator) void {
+ pub fn reset(this: *InternalState, allocator: std.mem.Allocator) void {
this.compressed_body.deinit();
this.response_message_buffer.deinit();
@@ -1354,12 +1354,6 @@ pub const InternalState = struct {
reader.deinit();
}
- if (!buffering) {
- // if we are holding a cloned_metadata we need to deinit it
- // this should never happen because we should always return the metadata to the user
- std.debug.assert(this.cloned_metadata == null);
- }
-
// just in case we check and free to avoid leaks
if (this.cloned_metadata != null) {
this.cloned_metadata.?.deinit(allocator);
@@ -2186,7 +2180,7 @@ pub fn doRedirect(this: *HTTPClient) void {
this.fail(error.TooManyRedirects);
return;
}
- this.state.reset(this.signals.isEmpty(), this.allocator);
+ this.state.reset(this.allocator);
// also reset proxy to redirect
this.proxy_tunneling = false;
if (this.proxy_tunnel != null) {
@@ -2907,7 +2901,7 @@ fn fail(this: *HTTPClient, err: anyerror) void {
_ = socket_async_http_abort_tracker.swapRemove(this.async_http_id);
}
- this.state.reset(this.signals.isEmpty(), this.allocator);
+ this.state.reset(this.allocator);
this.proxy_tunneling = false;
this.state.request_stage = .fail;
@@ -2993,7 +2987,7 @@ pub fn progressUpdate(this: *HTTPClient, comptime is_ssl: bool, ctx: *NewHTTPCon
socket.close(0, null);
}
- this.state.reset(this.signals.isEmpty(), this.allocator);
+ this.state.reset(this.allocator);
this.state.response_stage = .done;
this.state.request_stage = .done;
this.state.stage = .done;