[PATCH 16/17] Introduce reds_stream_set_channel()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 server/reds.c        | 6 +++---
 server/reds_stream.c | 9 +++++++++
 server/reds_stream.h | 2 ++
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/server/reds.c b/server/reds.c
index a993f2c..c6983d8 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -1416,9 +1416,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 d2c05d9..6af3cd1 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 = connection_id;
+    stream->info->id   = channel_type;
+}
+
 RedsStream *reds_stream_new(int socket)
 {
     RedsStream *stream;
diff --git a/server/reds_stream.h b/server/reds_stream.h
index add9b2e..64657c2 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);
-- 
1.8.4.2

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]