[vlc-commits] Fix simulatenous HTTPd use of RTSP and HTTP
Rémi Denis-Courmont
git at videolan.org
Sun Sep 25 18:00:05 CEST 2011
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Sep 25 18:59:07 2011 +0300| [ca6f33467f8d1dc15ec83aae44674a4f6a80e286] | committer: Rémi Denis-Courmont
Fix simulatenous HTTPd use of RTSP and HTTP
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ca6f33467f8d1dc15ec83aae44674a4f6a80e286
---
src/network/httpd.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/network/httpd.c b/src/network/httpd.c
index 0014fca..4d2051f 100644
--- a/src/network/httpd.c
+++ b/src/network/httpd.c
@@ -79,6 +79,7 @@ struct httpd_host_t
/* address/port and socket for listening at connections */
int *fds;
unsigned nfd;
+ unsigned port;
vlc_thread_t thread;
vlc_mutex_t lock;
@@ -1033,6 +1034,7 @@ static httpd_host_t *httpd_HostCreate( vlc_object_t *p_this,
vlc_tls_creds_t *p_tls )
{
httpd_host_t *host;
+ unsigned port = var_InheritInteger( p_this->p_libvlc, portvar );
/* to be sure to avoid multiple creation */
vlc_mutex_lock( &httpd.mutex );
@@ -1043,7 +1045,8 @@ static httpd_host_t *httpd_HostCreate( vlc_object_t *p_this,
host = httpd.host[i];
/* cannot mix TLS and non-TLS hosts */
- if( ( host->p_tls != NULL ) != ( p_tls != NULL ) )
+ if( host->port != port
+ || (host->p_tls != NULL) != (p_tls != NULL) )
continue;
/* Increase existing matching host reference count.
@@ -1073,7 +1076,6 @@ static httpd_host_t *httpd_HostCreate( vlc_object_t *p_this,
host->i_ref = 1;
char *hostname = var_InheritString( p_this->p_libvlc, hostvar );
- int port = var_InheritInteger( p_this->p_libvlc, portvar );
host->fds = net_ListenTCP( p_this, hostname, port );
free( hostname );
if( host->fds == NULL )
@@ -1089,6 +1091,7 @@ static httpd_host_t *httpd_HostCreate( vlc_object_t *p_this,
goto error;
}
+ host->port = port;
host->i_url = 0;
host->url = NULL;
host->i_client = 0;
More information about the vlc-commits
mailing list