summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2010-11-07 12:23:59 +0200
committerAlon Levy <alevy@redhat.com>2010-12-07 21:32:34 +0200
commit1540a64030cc82556e6a98230656b17c2ccf4dae (patch)
tree1eb5d6fe36583e3b70b69c84b8f6df7b3ca0f271
parent045be6b03ac114d53996df56a69f36fd7601edd3 (diff)
downloadspice-1540a64030cc82556e6a98230656b17c2ccf4dae.tar.gz
spice-1540a64030cc82556e6a98230656b17c2ccf4dae.tar.xz
spice-1540a64030cc82556e6a98230656b17c2ccf4dae.zip
server/red_channel: add red_channel_is_connected
-rw-r--r--server/red_channel.c5
-rw-r--r--server/red_channel.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/server/red_channel.c b/server/red_channel.c
index be861fdd..cab56a0d 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 24f969b9..30adfc66 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);