[Spice-devel] [RFC v4 17/62] server/red_channel: ignore error if already shutdown

Alon Levy alevy at redhat.com
Tue Apr 26 03:54:42 PDT 2011


on red_channel_peer_on_incoming_error, if we are already shutdown, do not
call the channel's error handler. Since the channel has been shutdown, we
assume this is a second or later error, and handling has already occured.
---
 server/red_channel.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/server/red_channel.c b/server/red_channel.c
index abb6b4d..aff99ed 100644
--- a/server/red_channel.c
+++ b/server/red_channel.c
@@ -217,6 +217,9 @@ void red_channel_client_default_peer_on_error(RedChannelClient *rcc)
 
 static void red_channel_peer_on_incoming_error(RedChannelClient *rcc)
 {
+    if (rcc->stream->shutdown) {
+        return; // assume error has already been handled which caused the shutdown.
+    }
     rcc->channel->on_incoming_error(rcc);
 }
 
-- 
1.7.4.4



More information about the Spice-devel mailing list