summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@redhat.com>2015-01-27 13:26:02 -0600
committerFabiano FidĂȘncio <fidencio@redhat.com>2015-02-23 23:00:45 +0100
commit8435989b66fb3c5fc0b8176ed924906423434950 (patch)
tree928e73fefee734e2d88d163d9125c9fcaceeb88d
parentb16be2a90641f8fe48fb521253c4f15a0b19ec6d (diff)
downloadspice-8435989b66fb3c5fc0b8176ed924906423434950.tar.gz
spice-8435989b66fb3c5fc0b8176ed924906423434950.tar.xz
spice-8435989b66fb3c5fc0b8176ed924906423434950.zip
Move spice_secure_port to RedsState struct
removing more global variables
-rw-r--r--server/reds-private.h1
-rw-r--r--server/reds.c8
2 files changed, 5 insertions, 4 deletions
diff --git a/server/reds-private.h b/server/reds-private.h
index ca3c40b8..cae4d70c 100644
--- a/server/reds-private.h
+++ b/server/reds-private.h
@@ -183,6 +183,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 5cea11ab..27132ce6 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -91,7 +91,6 @@ SpiceCoreInterface *core = NULL;
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;
@@ -2456,8 +2455,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;
@@ -3324,6 +3323,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;
}
@@ -3526,7 +3526,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,