diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-12-13 20:15:41 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-01-02 16:57:15 -0700 |
| commit | d2f5d0b1990a160aa1d648531ea5b1df7b2acdce (patch) | |
| tree | ca92f3233708feb032d3fc3f667efcca7d4a296b /lib/std/http/Client.zig | |
| parent | ba44513c2fe363b55b2c534be98179286b832b7e (diff) | |
| download | zig-d2f5d0b1990a160aa1d648531ea5b1df7b2acdce.tar.gz zig-d2f5d0b1990a160aa1d648531ea5b1df7b2acdce.zip | |
std.crypto.Tls: parse the ServerHello handshake
Diffstat (limited to 'lib/std/http/Client.zig')
| -rw-r--r-- | lib/std/http/Client.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/http/Client.zig b/lib/std/http/Client.zig index 80904d765c..b10011a6b1 100644 --- a/lib/std/http/Client.zig +++ b/lib/std/http/Client.zig @@ -59,7 +59,7 @@ pub const Request = struct { pub fn deinit(client: *Client) void { assert(client.active_requests == 0); - client.headers.denit(client.allocator); + client.headers.deinit(client.allocator); client.* = undefined; } @@ -69,6 +69,7 @@ pub fn request(client: *Client, options: Request.Options) !Request { .stream = try net.tcpConnectToHost(client.allocator, options.host, options.port), .protocol = options.protocol, }; + client.active_requests += 1; errdefer req.deinit(); switch (options.protocol) { @@ -100,7 +101,6 @@ pub fn request(client: *Client, options: Request.Options) !Request { } req.headers.appendSliceAssumeCapacity(client.headers.items); - client.active_requests += 1; return req; } |
