Zig 0.15.2 TLS Client Timeout behavior

Hello all!

I’ve got this problem with commonly used websocket library: Inconsistent behaviour TLS vs. non-TLS client connection on timeout. · Issue #97 · karlseguin/websocket.zig · GitHub

Internally, when websocket.zig tries to fetch next chunk of data from established TLS client connection, it in the end hits this line of code:
https://codeberg.org/ziglang/zig/src/commit/e4cbd752c8c05f131051f8c873cff7823177d7d3/lib/std/crypto/tls/Client.zig#L1109

And in the case, there is no data, it fires error.ReadError from here (as I observed in debugger): https://codeberg.org/ziglang/zig/src/commit/e4cbd752c8c05f131051f8c873cff7823177d7d3/lib/std/crypto/tls/Client.zig#L1121

Client.input.peek seems to be blocking. And after timeout, which I set up for ws library, it inevitably returns error.ReadError instead of error.WouldBlock, which ws lib expects in such case (by the way, non-TLS connection behaves exactly as expected).

I wonder, is this expected behavior of tls client, and I missing some connection setup options or I can not expect that implementation of TLS in zig 0.15 can timeout at all?

fixed quick fix for https://github.com/karlseguin/websocket.zig/issues/97 by ssilnicki-dev · Pull Request #98 · karlseguin/websocket.zig · GitHub