diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2010-08-20 20:45:46 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2010-08-20 20:45:46 +0200 |
commit | f3c887f589b17bea91467ed69b4f5c11521c5d66 (patch) | |
tree | d2cfc8b13ec4581409bf0781e10deef4ee612cb1 | |
parent | 0291837ddd2133cca130a35582273594994f9ba9 (diff) |
Read httpd port from config.
-rw-r--r-- | httpd.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1,5 +1,6 @@ #include "httpd.h" #include "httpd_commands.h" +#include "conf.h" #include <gio/gio.h> #include <string.h> @@ -79,9 +80,15 @@ static gboolean service_incoming(GSocketService *service, } gboolean httpd_start() { + gint port = conf_get_int("audist", "httpd_port"); + if(port <= 0) { + g_warning("invalid httpd port"); + return FALSE; + } + ss = g_threaded_socket_service_new(10); - g_socket_listener_add_inet_port((GSocketListener*)ss, 8000, NULL, NULL); + g_socket_listener_add_inet_port((GSocketListener*)ss, port, NULL, NULL); g_signal_connect(ss, "incoming", (GCallback)service_incoming, NULL); g_socket_service_start(ss); |