[Spice-devel] [spice-server 3/3] Remove unneeded red_channel_client_is_blocked() call
Jonathon Jongsma
jjongsma at redhat.com
Tue Apr 11 16:45:15 UTC 2017
On Tue, 2017-04-11 at 11:58 +0200, Christophe Fergeau wrote:
> red_channel_client_msg_sent() always clears the
> rcc->priv->send_data.blocked flag. Hower, towards the end of it,
I think the description above is just a little bit misleading since it
sort of implies that after msg_sent() returns, the blocked flag will
always be cleared. However, if _urgent_marshaller_is_active() is true,
it will call _begin_send_message(), which can result in blocked being
set to true in some circumstances.
Of course, the check that you removed is in the 'else' clause of the
branch where the flag can be set, so within that black it should be
guaranteed to be false. So the patch itself seems fine.
Jonathon
> there
> is a if (!red_channel_client_is_blocked()) test, which will always be
> true, so it can be removed.
>
> This check was already redundant when it was introduced in
> 9a62a9a809eaf0
>
> Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
> ---
> server/red-channel-client.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/server/red-channel-client.c b/server/red-channel-
> client.c
> index 0b04c96..733ce18 100644
> --- a/server/red-channel-client.c
> +++ b/server/red-channel-client.c
> @@ -652,8 +652,7 @@ static void
> red_channel_client_msg_sent(RedChannelClient *rcc)
> spice_assert(rcc->priv->send_data.header.data != NULL);
> red_channel_client_begin_send_message(rcc);
> } else {
> - if (!red_channel_client_is_blocked(rcc)
> - && g_queue_is_empty(&rcc->priv->pipe)) {
> + if (g_queue_is_empty(&rcc->priv->pipe)) {
> /* It is possible that the socket will become idle, so
> we may be able to test latency */
> red_channel_client_restart_ping_timer(rcc);
> }
More information about the Spice-devel
mailing list