diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2010-08-30 22:12:45 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2010-08-30 22:12:45 +0200 |
commit | 651ebc75e6dae751bdebffe018701618afcc49df (patch) | |
tree | f707d3b3f47f2800f19744c87cf68de100cfe027 /servers.c | |
parent | a15c8f6e8a20d60d1097ede16a63b7f350af052c (diff) |
Added separate http and command ports in server struct.
Diffstat (limited to 'servers.c')
-rw-r--r-- | servers.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -5,7 +5,8 @@ GSList *servers = NULL; -gboolean server_add(const gchar *host, const guint16 port) { +gboolean server_add(const gchar *host, const guint16 http_port, + const guint16 command_port) { struct server *server = g_new0(struct server, 1); if(server == NULL) { @@ -14,7 +15,8 @@ gboolean server_add(const gchar *host, const guint16 port) { } server->host = g_strdup(host); - server->port = port; + server->http_port = http_port; + server->command_port = command_port; servers = g_slist_prepend(servers, server); @@ -37,8 +39,13 @@ void servers_init() { gsize length; gchar **s = conf_get_string_list("audist", "servers", &length); for(int i = 0; i < length; i++) { - server_add(s[i], 7681); - g_debug(" server %d: %s", i, s[i]); + gchar *section = g_strdup_printf("server/%s", s[i]); + guint16 http_port = conf_get_int(section, "http_port"); + guint16 command_port = conf_get_int(section, "command_port"); + g_free(section); + + server_add(s[i], http_port, command_port); + g_debug(" server %d: %s (%d, %d)", i, s[i], http_port, command_port); } } |