On Mon, Aug 31, 2026 at 12:01:50PM +0200, Denis V. Lunev wrote:
> From: Denis V. Lunev <[email protected]>
> 
> qio_channel_websock_handshake_read() folds every negative return from
> qio_channel_read() into -1. QIO_CHANNEL_ERR_BLOCK leaves errp unset, so
> qio_channel_websock_handshake_io() then hands a NULL Error to
> error_get_pretty() and QEMU dies.
> 
> The master channel is non-blocking and, for a wss:// client, is a TLS
> channel. A G_IO_IN wakeup carrying only part of a TLS record makes
> gnutls report EAGAIN, which is all it takes to reach this before the
> client has authenticated.
> 
> ERR_BLOCK here means the headers are not complete yet, which is what a
> 0 return already tells the caller. Report it that way and keep waiting.
> The watch is level triggered, so an incomplete record sitting in the
> socket spins the main loop until the rest of it arrives. That is
> bounded by the round trip and is what every reader layered over TLS
> already does.
> 
> Fixes: 2d1d0e70cf3e ("io: add QIOChannelWebsock class")
> Cc: [email protected]
> Cc: Daniel P. Berrangé <[email protected]>
> Cc: Marc-André Lureau <[email protected]>
> Signed-off-by: Denis V. Lunev <[email protected]>
> ---
>  io/channel-websock.c | 3 +++
>  1 file changed, 3 insertions(+)

Reviewed-by: Daniel P. Berrangé <[email protected]>


With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|


Reply via email to