mirror of
https://github.com/ziglang/zig.git
synced 2025-12-16 11:13:08 +00:00
std.crypto.tls.Client: fix eof logic
Before this, it incorrectly returned true when there was still cleartext to be read.
This commit is contained in:
parent
22e2aaa283
commit
05fee3b22b
@ -754,7 +754,9 @@ pub fn writeAll(c: *Client, stream: net.Stream, bytes: []const u8) !void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn eof(c: Client) bool {
|
pub fn eof(c: Client) bool {
|
||||||
return c.received_close_notify and c.partial_ciphertext_idx >= c.partial_ciphertext_end;
|
return c.received_close_notify and
|
||||||
|
c.partial_cleartext_idx >= c.partial_ciphertext_idx and
|
||||||
|
c.partial_ciphertext_idx >= c.partial_ciphertext_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the number of bytes read, calling the underlying read function the
|
/// Returns the number of bytes read, calling the underlying read function the
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user