summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--httpd.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/httpd.c b/httpd.c
index 6e95730..1733139 100644
--- a/httpd.c
+++ b/httpd.c
@@ -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);