mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 12:59:04 +00:00
std.http: fix the http.Client.wait() hanging when there is 1 more byte left
This commit is contained in:
parent
30ea714274
commit
8dcb4a3dc4
@ -581,7 +581,7 @@ pub const HeadersParser = struct {
|
||||
const nread = @min(conn.peek().len, data_avail);
|
||||
conn.drop(@intCast(u16, nread));
|
||||
r.next_chunk_length -= nread;
|
||||
} else {
|
||||
} else if (out_avail > 0) {
|
||||
const can_read = @intCast(usize, @min(data_avail, out_avail));
|
||||
const nread = try conn.read(buffer[out_index..][0..can_read]);
|
||||
r.next_chunk_length -= nread;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user