From d3023786132e69025b2486efd9652b16399bc8c0 Mon Sep 17 00:00:00 2001 From: Jakub Adam Date: Fri, 22 Apr 2016 07:36:13 +0200 Subject: [PATCH] appshare: handle EOF from RDP channel unhandled end-of-file on RDP input channel might have been causing that rdp_channel_readable_cb() was called from the message loop over and over again, blocking Pidgin UI after exiting a desktop sharing session. --- src/core/sipe-appshare.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/core/sipe-appshare.c b/src/core/sipe-appshare.c index 8302dee6..3aba8293 100644 --- a/src/core/sipe-appshare.c +++ b/src/core/sipe-appshare.c @@ -121,7 +121,11 @@ rdp_channel_readable_cb(GIOChannel *channel, buffer = g_malloc(2048); while (sipe_media_stream_is_writable(appshare->stream)) { - g_io_channel_read_chars(channel, buffer, 2048, &bytes_read, &error); + GIOStatus status; + + status = g_io_channel_read_chars(channel, + buffer, 2048, + &bytes_read, &error); if (error) { struct sipe_media_call *call = appshare->stream->call; @@ -133,6 +137,14 @@ rdp_channel_readable_cb(GIOChannel *channel, return FALSE; } + if (status == G_IO_STATUS_EOF) { + struct sipe_media_call *call = appshare->stream->call; + + sipe_backend_media_hangup(call->backend_private, TRUE); + g_free(buffer); + return FALSE; + } + if (bytes_read == 0) { break; } -- 2.11.4.GIT