From 2eb491cb6b72e17cdd1e92a67124307801f1712f Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Fri, 28 Apr 2017 12:59:35 +0200 Subject: [PATCH] Don't modify watch when network queue is full Since 5c460d, we need to watch for WATCH_EVENT_WRITE as long as there are items queued waiting to be sent, this does not need to be done only when the network queue is full. When red_channel_client_set_blocked() is called, as a message is being sent, WATCH_EVENT_WRITE will already be set, so it does not need to set it again. red_channel_client_msg_sent() removes WATCH_EVENT_WRITE, but this will be done later anyway by red_channel_client_push() if needed. Since it's redundant, we can remove this. Signed-off-by: Christophe Fergeau Acked-by: Frediano Ziglio --- server/red-channel-client.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/server/red-channel-client.c b/server/red-channel-client.c index 02dabdc4..b8ce6ef2 100644 --- a/server/red-channel-client.c +++ b/server/red-channel-client.c @@ -495,13 +495,7 @@ static int red_channel_client_prepare_out_msg(RedChannelClient *rcc, static void red_channel_client_set_blocked(RedChannelClient *rcc) { - SpiceCoreInterfaceInternal *core; - rcc->priv->send_data.blocked = TRUE; - core = red_channel_get_core_interface(rcc->priv->channel); - core->watch_update_mask(core, rcc->priv->stream->watch, - SPICE_WATCH_EVENT_READ | - SPICE_WATCH_EVENT_WRITE); } static inline int red_channel_client_urgent_marshaller_is_active(RedChannelClient *rcc) @@ -641,10 +635,7 @@ static void red_channel_client_msg_sent(RedChannelClient *rcc) red_channel_client_clear_sent_item(rcc); if (red_channel_client_is_blocked(rcc)) { - SpiceCoreInterfaceInternal *core = red_channel_get_core_interface(rcc->priv->channel); rcc->priv->send_data.blocked = FALSE; - core->watch_update_mask(core, rcc->priv->stream->watch, - SPICE_WATCH_EVENT_READ); } if (red_channel_client_urgent_marshaller_is_active(rcc)) {