diff options
-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); |