authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-12-29 18:56:51-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-01-02 16:57:16-07:00
log05fee3b22b593c6b0829499b53f26f5750df3645
tree7932bddde29fead3aae19c7ea5f078be2d70f3e0
parent22e2aaa283646858502ac1075c9657383366005d

std.crypto.tls.Client: fix eof logic

Before this, it incorrectly returned true when there was still cleartext to be read.

1 files changed, 3 insertions(+), 1 deletions(-)

lib/std/crypto/tls/Client.zig+3-1
......@@ -754,7 +754,9 @@ pub fn writeAll(c: *Client, stream: net.Stream, bytes: []const u8) !void {
754754}
755755
756756pub fn eof(c: Client) bool {
757 return c.received_close_notify and c.partial_ciphertext_idx >= c.partial_ciphertext_end;
757 return c.received_close_notify and
758 c.partial_cleartext_idx >= c.partial_ciphertext_idx and
759 c.partial_ciphertext_idx >= c.partial_ciphertext_end;
758760}
759761
760762/// Returns the number of bytes read, calling the underlying read function the