]> git.sesse.net Git - vlc/commitdiff
* modules/control/http/http.c: Added a small hack, when multiple http
authorChristophe Massiot <massiot@videolan.org>
Fri, 2 Sep 2005 17:11:23 +0000 (17:11 +0000)
committerChristophe Massiot <massiot@videolan.org>
Fri, 2 Sep 2005 17:11:23 +0000 (17:11 +0000)
   control interfaces are specified, to automatically increment the port.

modules/control/http/http.c

index ed234728e061a9b5a6e7ef32f3e178e976978d12..f88114fa027b340853b6052f9cb41a41db440697 100644 (file)
@@ -120,6 +120,7 @@ static int Open( vlc_object_t *p_this )
                   *psz_crl = NULL;
     int           i_port       = 0;
     char          *psz_src;
+    char          psz_tmp[10];
 
     psz_address = config_GetPsz( p_intf, "http-host" );
     if( psz_address != NULL )
@@ -249,6 +250,10 @@ static int Open( vlc_object_t *p_this )
             i_port= 8080;
     }
 
+    /* Ugly hack to allow to run several HTTP servers on different ports. */
+    sprintf( psz_tmp, ":%d", i_port + 1 );
+    config_PutPsz( p_intf, "http-host", psz_tmp );
+
     msg_Dbg( p_intf, "base %s:%d", psz_address, i_port );
 
     p_sys->p_httpd_host = httpd_TLSHostNew( VLC_OBJECT(p_intf), psz_address,