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 <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
Christophe Fergeau 2017-04-28 12:59:35 +02:00
parent 68a4eaedf1
commit 2eb491cb6b

View File

@ -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)) {