summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2014-01-06 22:38:44 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2014-01-20 12:15:42 +0100
commit28fa3b1b3fbc554dbbaf8d2be0fe789846b7aa42 (patch)
tree3751f22655ad96aff601dec2ff3ce692997155e2
parent82511418a08a55fdea3348c788b3a71e179ecd0f (diff)
downloadspice-28fa3b1b3fbc554dbbaf8d2be0fe789846b7aa42.tar.gz
spice-28fa3b1b3fbc554dbbaf8d2be0fe789846b7aa42.tar.xz
spice-28fa3b1b3fbc554dbbaf8d2be0fe789846b7aa42.zip
Introduce reds_stream_set_channel()
-rw-r--r--server/reds.c6
-rw-r--r--server/reds_stream.c9
-rw-r--r--server/reds_stream.h2
3 files changed, 14 insertions, 3 deletions
diff --git a/server/reds.c b/server/reds.c
index 5bcad7ab..1f025539 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -1417,9 +1417,9 @@ static void reds_info_new_channel(RedLinkInfo *link, int connection_id)
if (reds_stream_is_ssl(link->stream)) {
reds_stream_set_info_flag(link->stream, SPICE_CHANNEL_EVENT_FLAG_TLS);
}
- link->stream->info->connection_id = connection_id;
- link->stream->info->type = link->link_mess->channel_type;
- link->stream->info->id = link->link_mess->channel_id;
+ reds_stream_set_channel(link->stream, connection_id,
+ link->link_mess->channel_type,
+ link->link_mess->channel_id);
reds_stream_push_channel_event(link->stream, SPICE_CHANNEL_EVENT_INITIALIZED);
}
diff --git a/server/reds_stream.c b/server/reds_stream.c
index d2c05d91..46f519e2 100644
--- a/server/reds_stream.c
+++ b/server/reds_stream.c
@@ -282,6 +282,15 @@ static void reds_stream_set_socket(RedsStream *stream, int socket)
&stream->info->plen_ext);
}
+
+void reds_stream_set_channel(RedsStream *stream, int connection_id,
+ int channel_type, int channel_id)
+{
+ stream->info->connection_id = connection_id;
+ stream->info->type = channel_type;
+ stream->info->id = channel_id;
+}
+
RedsStream *reds_stream_new(int socket)
{
RedsStream *stream;
diff --git a/server/reds_stream.h b/server/reds_stream.h
index add9b2e4..64657c2a 100644
--- a/server/reds_stream.h
+++ b/server/reds_stream.h
@@ -81,6 +81,8 @@ void reds_stream_free(RedsStream *s);
void reds_stream_push_channel_event(RedsStream *s, int event);
void reds_stream_remove_watch(RedsStream* s);
+void reds_stream_set_channel(RedsStream *stream, int connection_id,
+ int channel_type, int channel_id);
RedsStream *reds_stream_new(int socket);
bool reds_stream_is_ssl(RedsStream *stream);
RedsStreamSslStatus reds_stream_ssl_accept(RedsStream *stream);