diff --git a/http.c b/http.c index 76174752..58782b11 100644 --- a/http.c +++ b/http.c @@ -410,9 +410,9 @@ http_tcp_callback(tcpevent_t event, void *tcpsession) */ void -http_start(void) +http_start(int port) { - tcp_create_server(9980, sizeof(http_connection_t), "http", + tcp_create_server(port, sizeof(http_connection_t), "http", http_tcp_callback); } diff --git a/http.h b/http.h index b3d15189..033c0154 100644 --- a/http.h +++ b/http.h @@ -73,7 +73,7 @@ typedef struct http_connection { -void http_start(void); +void http_start(int port); void http_arg_flush(struct http_arg_list *list); diff --git a/main.c b/main.c index 9ab9fd33..ce63436f 100644 --- a/main.c +++ b/main.c @@ -51,6 +51,7 @@ #include "rtsp.h" #include "http.h" #include "buffer.h" +#include "htmlui.h" int running; int xmltvreload; @@ -107,10 +108,11 @@ main(int argc, char **argv) char *cfgfile = NULL; int logfacility = LOG_DAEMON; int disable_dvb = 0; + int http_port = 0; signal(SIGPIPE, handle_sigpipe); - while((c = getopt(argc, argv, "c:fu:g:d")) != -1) { + while((c = getopt(argc, argv, "c:fu:g:dh:")) != -1) { switch(c) { case 'd': disable_dvb = 1; @@ -127,6 +129,9 @@ main(int argc, char **argv) case 'g': groupnam = optarg; break; + case 'h': + http_port = atoi(optarg); + break; } } @@ -187,6 +192,8 @@ main(int argc, char **argv) subscriptions_init(); + htmlui_start(); + running = 1; while(running) { @@ -197,7 +204,9 @@ main(int argc, char **argv) output_multicast_setup(); client_start(); - http_start(); + if(http_port) + http_start(http_port); + } dispatcher(); }