]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Add option to run HTSP on an additional port
authorAndreas Öman <andreas@lonelycoder.com>
Mon, 15 Oct 2012 12:04:09 +0000 (14:04 +0200)
committerAndreas Öman <andreas@lonelycoder.com>
Mon, 15 Oct 2012 12:04:36 +0000 (14:04 +0200)
src/htsp.c
src/main.c

index 789c036b4c066e4c63138e7a067079623563b1d4..5bca466151d1814f5f72ddb75e4ff4b833a8a195 100644 (file)
@@ -49,7 +49,7 @@
  * Datatypes and variables
  * *************************************************************************/
 
-static void *htsp_server;
+static void *htsp_server, *htsp_server_2;
 
 #define HTSP_PROTO_VERSION 6
 
@@ -1525,7 +1525,10 @@ htsp_serve(int fd, void *opaque, struct sockaddr_in *source,
 void
 htsp_init(void)
 {
+  extern int htsp_port_extra;
   htsp_server = tcp_server_create(htsp_port, htsp_serve, NULL);
+  if(htsp_port_extra)
+    htsp_server_2 = tcp_server_create(htsp_port_extra, htsp_serve, NULL);
 }
 
 /* **************************************************************************
index 66d863fc39fad4c6ab0780c2c0c65eae59a232ca..770d71f1b7e5cd876861a62700535cced222ee03 100644 (file)
@@ -75,6 +75,7 @@ int log_debug_to_console;
 
 int webui_port;
 int htsp_port;
+int htsp_port_extra;
 char *tvheadend_cwd;
 
 static void
@@ -278,7 +279,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:sw:e:")) != -1) {
+  while((c = getopt(argc, argv, "Aa:fp:u:g:c:Chdr:j:sw:e:E:")) != -1) {
     switch(c) {
     case 'a':
       adapter_mask = 0x0;
@@ -315,6 +316,9 @@ main(int argc, char **argv)
     case 'e':
       htsp_port = atoi(optarg);
       break;
+    case 'E':
+      htsp_port_extra = atoi(optarg);
+      break;
     case 'u':
       usernam = optarg;
       break;