From: Jonathon Jongsma <jjongsma@xxxxxxxxxx> removing more global variables --- server/reds-private.h | 1 + server/reds.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/server/reds-private.h b/server/reds-private.h index 91d0cd7..6ce02f9 100644 --- a/server/reds-private.h +++ b/server/reds-private.h @@ -199,6 +199,7 @@ struct RedsState { GArray *renderers; int spice_port; + int spice_secure_port; SpiceCharDeviceInstance *vdagent; SpiceMigrateInstance *migration_interface; }; diff --git a/server/reds.c b/server/reds.c index 20286c6..4857eb3 100644 --- a/server/reds.c +++ b/server/reds.c @@ -145,7 +145,6 @@ static SpiceCoreInterfaceInternal core_interface_adapter = { static TicketAuthentication taTicket; -static int spice_secure_port = -1; static int spice_listen_socket_fd = -1; static char spice_addr[256]; static int spice_family = PF_UNSPEC; @@ -2577,8 +2576,8 @@ static int reds_init_net(RedsState *reds) } } - if (spice_secure_port != -1) { - reds->secure_listen_socket = reds_init_socket(spice_addr, spice_secure_port, + if (reds->spice_secure_port != -1) { + reds->secure_listen_socket = reds_init_socket(spice_addr, reds->spice_secure_port, spice_family); if (-1 == reds->secure_listen_socket) { return -1; @@ -3443,6 +3442,7 @@ SPICE_GNUC_VISIBLE SpiceServer *spice_server_new(void) reds->default_renderer = "sw"; reds->renderers = g_array_sized_new(FALSE, TRUE, sizeof(uint32_t), RED_RENDERER_LAST); reds->spice_port = -1; + reds->spice_secure_port = -1; return reds; } @@ -3650,7 +3650,7 @@ SPICE_GNUC_VISIBLE int spice_server_set_tls(SpiceServer *s, int port, } memset(&ssl_parameters, 0, sizeof(ssl_parameters)); - spice_secure_port = port; + s->spice_secure_port = port; g_strlcpy(ssl_parameters.ca_certificate_file, ca_cert_file, sizeof(ssl_parameters.ca_certificate_file)); g_strlcpy(ssl_parameters.certs_file, certs_file, -- 2.4.3 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/spice-devel