diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2014-01-06 22:38:26 +0100 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2014-01-20 12:15:42 +0100 |
commit | 82511418a08a55fdea3348c788b3a71e179ecd0f (patch) | |
tree | 941ec362ad5e57fce24a6c764f484ca1ca12b15f | |
parent | 25aca54f125a33c5c7f294a124a5aff1ca920b4c (diff) |
Introduce reds_stream_set_info_flag()
-rw-r--r-- | server/reds.c | 2 | ||||
-rw-r--r-- | server/reds_stream.c | 10 | ||||
-rw-r--r-- | server/reds_stream.h | 1 |
3 files changed, 12 insertions, 1 deletions
diff --git a/server/reds.c b/server/reds.c index 7fc48f1a..5bcad7ab 100644 --- a/server/reds.c +++ b/server/reds.c @@ -1415,7 +1415,7 @@ static void reds_info_new_channel(RedLinkInfo *link, int connection_id) reds_stream_is_ssl(link->stream) ? "Secure" : "Non Secure"); /* add info + send event */ if (reds_stream_is_ssl(link->stream)) { - link->stream->info->flags |= SPICE_CHANNEL_EVENT_FLAG_TLS; + 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; diff --git a/server/reds_stream.c b/server/reds_stream.c index 837d2cbb..d2c05d91 100644 --- a/server/reds_stream.c +++ b/server/reds_stream.c @@ -29,6 +29,8 @@ #include <unistd.h> #include <sys/socket.h> +#include <glib.h> + #include <openssl/err.h> extern SpiceCoreInterface *core; @@ -303,6 +305,14 @@ bool reds_stream_is_ssl(RedsStream *stream) return (stream->priv->ssl != NULL); } +void reds_stream_set_info_flag(RedsStream *stream, unsigned int flag) +{ + g_return_if_fail((flag == SPICE_CHANNEL_EVENT_FLAG_TLS) + || (flag == SPICE_CHANNEL_EVENT_FLAG_ADDR_EXT)); + + stream->info->flags |= flag; +} + void reds_stream_disable_writev(RedsStream *stream) { stream->priv->writev = NULL; diff --git a/server/reds_stream.h b/server/reds_stream.h index e2a6d613..add9b2e4 100644 --- a/server/reds_stream.h +++ b/server/reds_stream.h @@ -85,6 +85,7 @@ RedsStream *reds_stream_new(int socket); bool reds_stream_is_ssl(RedsStream *stream); RedsStreamSslStatus reds_stream_ssl_accept(RedsStream *stream); int reds_stream_enable_ssl(RedsStream *stream, SSL_CTX *ctx); +void reds_stream_set_info_flag(RedsStream *stream, unsigned int flag); typedef enum { REDS_SASL_ERROR_OK, |