[Spice-devel] [PATCH 10/13] server/red_channel: add red_channel_is_connected

Alon Levy alevy at redhat.com
Tue Dec 7 04:44:32 PST 2010


---
 server/red_channel.c |    5 +++++
 server/red_channel.h |    2 ++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/server/red_channel.c b/server/red_channel.c
index be861fd..cab56a0 100644
--- a/server/red_channel.c
+++ b/server/red_channel.c
@@ -571,6 +571,11 @@ static PipeItem *red_channel_pipe_get(RedChannel *channel)
     return item;
 }
 
+int red_channel_is_connected(RedChannel *channel)
+{
+    return !!channel->peer;
+}
+
 static void red_channel_pipe_clear(RedChannel *channel)
 {
     PipeItem *item;
diff --git a/server/red_channel.h b/server/red_channel.h
index 24f969b..30adfc6 100644
--- a/server/red_channel.h
+++ b/server/red_channel.h
@@ -182,6 +182,8 @@ RedChannel *red_channel_create_parser(int size, RedsStreamContext *peer,
                                channel_on_incoming_error_proc incoming_error,
                                channel_on_outgoing_error_proc outgoing_error);
 
+int red_channel_is_connected(RedChannel *channel);
+
 void red_channel_destroy(RedChannel *channel);
 
 void red_channel_shutdown(RedChannel *channel);
-- 
1.7.3.2



More information about the Spice-devel mailing list