[Spice-commits] src/spice-channel.c
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed May 6 16:32:26 UTC 2020
src/spice-channel.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
New commits:
commit 80e9c852a406d93cad3fc7b845fe181d75356f11
Author: Gilmar Santos Jr <jgasjr at gmail.com>
Date: Wed May 6 12:58:51 2020 -0300
spice-channel: Read all available data from SASL buffer
When SASL is in use, its buffer may contain remaining data from previously
received messages. The spice_channel_iterate_read should use it, even if c->in
socket is not readable.
Fixes: https://gitlab.freedesktop.org/spice/spice-gtk/-/issues/126
Acked-by: Frediano Ziglio <fziglio at redhat.com>
diff --git a/src/spice-channel.c b/src/spice-channel.c
index 500db9f..2988296 100644
--- a/src/spice-channel.c
+++ b/src/spice-channel.c
@@ -2344,16 +2344,15 @@ static void spice_channel_iterate_read(SpiceChannel *channel)
/* treat all incoming data (block on message completion) */
while (!c->has_error &&
c->state != SPICE_CHANNEL_STATE_MIGRATING &&
- g_pollable_input_stream_is_readable(G_POLLABLE_INPUT_STREAM(c->in))
- ) { do
- spice_channel_recv_msg(channel,
- (handler_msg_in)SPICE_CHANNEL_GET_CLASS(channel)->handle_msg, NULL);
+ (g_pollable_input_stream_is_readable(G_POLLABLE_INPUT_STREAM(c->in))
#ifdef HAVE_SASL
/* flush the sasl buffer too */
- while (c->sasl_decoded != NULL);
-#else
- while (FALSE);
+ || c->sasl_decoded != NULL
#endif
+ )
+ ) {
+ spice_channel_recv_msg(channel,
+ (handler_msg_in)SPICE_CHANNEL_GET_CLASS(channel)->handle_msg, NULL);
}
}
More information about the Spice-commits
mailing list