]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Added in webui_port and htsp_port for parameters to listen on different ports. Fixes...
authorAndy Brown <andy@thebmwz3.co.uk>
Fri, 24 Aug 2012 14:54:24 +0000 (15:54 +0100)
committerAdam Sutton <dev@adamsutton.me.uk>
Sat, 25 Aug 2012 20:56:16 +0000 (21:56 +0100)
src/avahi.c
src/htsp.c
src/http.c
src/main.c
src/tvheadend.h

index 4dc14f32b09fb9459e8d78e552f58fa378065ccb..af66db26c87106375c17921c6a9e254a93f28d61 100644 (file)
@@ -133,7 +133,7 @@ create_services(AvahiClient *c)
     /* Add the service for HTSP */
     if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, 
                                             AVAHI_PROTO_UNSPEC, 0, name, 
-                                            "_htsp._tcp", NULL, NULL, 9982,
+                                            "_htsp._tcp", NULL, NULL,htsp_port,
                                             NULL)) < 0) {
 
       if (ret == AVAHI_ERR_COLLISION)
@@ -149,7 +149,7 @@ create_services(AvahiClient *c)
     /* Add the service for HTTP */
     if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, 
                                             AVAHI_PROTO_UNSPEC, 0, name, 
-                                            "_http._tcp", NULL, NULL, 9981,
+                                            "_http._tcp", NULL, NULL, webui_port,
                                             "path=/",
                                             NULL)) < 0) {
 
index 9948bbbf4f5165597e8c79521615f248d2d73803..7edce4a678a11bbad57b901e444374bf059fe982 100644 (file)
@@ -1384,7 +1384,7 @@ htsp_serve(int fd, void *opaque, struct sockaddr_in *source,
 void
 htsp_init(void)
 {
-  htsp_server = tcp_server_create(9982, htsp_serve, NULL);
+  htsp_server = tcp_server_create(htsp_port, htsp_serve, NULL);
 }
 
 /**
index f56f5f22f6149a55dc7fa7e10077689b6b6a499e..6a39f3b47a20cab1185bd760dfc02d167d0a61bc 100644 (file)
@@ -809,5 +809,5 @@ http_serve(int fd, void *opaque, struct sockaddr_in *peer,
 void
 http_server_init(void)
 {
-  http_server = tcp_server_create(9981, http_serve, NULL);
+  http_server = tcp_server_create(webui_port, http_serve, NULL);
 }
index 102cd0d0782126665ed91ee80873f21e3fe664ae..66d863fc39fad4c6ab0780c2c0c65eae59a232ca 100644 (file)
@@ -73,6 +73,8 @@ static int log_decorate;
 int log_debug_to_syslog;
 int log_debug_to_console;
 
+int webui_port;
+int htsp_port;
 char *tvheadend_cwd;
 
 static void
@@ -184,6 +186,8 @@ usage(const char *argv0)
         "                 to your Tvheadend installation until you edit\n"
         "                 the access-control from within the Tvheadend UI\n");
   printf(" -s              Log debug to syslog\n");
+  printf(" -w <portnumber> WebUI access port [default 9981]\n");
+  printf(" -e <portnumber> HTSP access port [default 9982]\n");
   printf("\n");
   printf("Development options\n");
   printf("\n");
@@ -262,6 +266,8 @@ main(int argc, char **argv)
   char *p, *endp;
   uint32_t adapter_mask = 0xffffffff;
   int crash = 0;
+  webui_port = 9981;
+  htsp_port = 9982;
 
   /* Get current directory */
   tvheadend_cwd = dirname(dirname(strdup(argv[0])));
@@ -272,7 +278,7 @@ main(int argc, char **argv)
   // make sure the timezone is set
   tzset();
 
-  while((c = getopt(argc, argv, "Aa:fp:u:g:c:Chdr:j:s")) != -1) {
+  while((c = getopt(argc, argv, "Aa:fp:u:g:c:Chdr:j:sw:e:")) != -1) {
     switch(c) {
     case 'a':
       adapter_mask = 0x0;
@@ -303,6 +309,12 @@ main(int argc, char **argv)
     case 'p':
       pidpath = optarg;
       break;
+    case 'w':
+      webui_port = atoi(optarg);
+      break;
+    case 'e':
+      htsp_port = atoi(optarg);
+      break;
     case 'u':
       usernam = optarg;
       break;
index f1abf7781e7192ab8580582888b77f112fcaef96..8d86ba51e29233f80a9473296cfe84a55a57decf 100644 (file)
@@ -43,6 +43,9 @@ extern pthread_mutex_t global_lock;
 extern pthread_mutex_t ffmpeg_lock;
 extern pthread_mutex_t fork_lock;
 
+extern int webui_port;
+extern int htsp_port;
+
 typedef struct source_info {
   char *si_device;
   char *si_adapter;