]> git.sesse.net Git - vlc/commitdiff
Use separate functions for RTSP and HTTP hosts
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 2 Aug 2011 15:37:19 +0000 (18:37 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 2 Aug 2011 16:19:10 +0000 (19:19 +0300)
Also prefix with vlc_ for namespace cleanliness.

include/vlc_httpd.h
modules/access/dvb/http.c
modules/access_output/http.c
modules/lua/libs/httpd.c
modules/misc/rtsp.c
modules/stream_out/rtp.c
modules/stream_out/rtsp.c
src/libvlccore.sym
src/missing.c
src/network/httpd.c

index f636ca2aaa4c74c148cd5a4d562cf654f29f8cef..32c7c25e0015392ab5e10f3fc5cbf937db72886e 100644 (file)
@@ -99,8 +99,9 @@ struct httpd_message_t
 };
 
 /* create a new host */
-VLC_API httpd_host_t * httpd_HostNew( vlc_object_t *, const char *psz_host, int i_port ) VLC_USED;
-VLC_API httpd_host_t * httpd_TLSHostNew( vlc_object_t *, const char *, int ) VLC_USED;
+VLC_API httpd_host_t *vlc_http_HostNew( vlc_object_t *, const char *psz_host, int i_port ) VLC_USED;
+VLC_API httpd_host_t *vlc_https_HostNew( vlc_object_t *, const char *, int ) VLC_USED;
+VLC_API httpd_host_t *vlc_rtsp_HostNew( vlc_object_t *, const char *, int ) VLC_USED;
 
 /* delete a host */
 VLC_API void httpd_HostDelete( httpd_host_t * );
index c30a7185a85d97d96ddc2524c4a2a9f4bb0ebb2c..dd00a48babc4522ffc75cd4325839077f62a3731 100644 (file)
@@ -96,8 +96,8 @@ int HTTPOpen( access_t *p_access )
 
     msg_Dbg( p_access, "base %s:%d", psz_address, i_port );
 
-    p_sys->p_httpd_host = httpd_HostNew( VLC_OBJECT(p_access), psz_address,
-                                         i_port );
+    p_sys->p_httpd_host = vlc_http_HostNew( VLC_OBJECT(p_access), psz_address,
+                                            i_port );
     if ( p_sys->p_httpd_host == NULL )
     {
         msg_Err( p_access, "cannot listen on %s:%d", psz_address, i_port );
index 226d775e0c38292cb4f31a62f84c635b7a6591ce..ec8fcce3485779be1da37c5591466aefd9d03719 100644 (file)
@@ -190,15 +190,15 @@ static int Open( vlc_object_t *p_this )
     {
         if( i_bind_port <= 0 )
             i_bind_port = DEFAULT_SSL_PORT;
-        p_sys->p_httpd_host = httpd_TLSHostNew( VLC_OBJECT(p_access),
-                                                psz_bind_addr, i_bind_port );
+        p_sys->p_httpd_host = vlc_https_HostNew( VLC_OBJECT(p_access),
+                                                 psz_bind_addr, i_bind_port );
     }
     else
     {
         if( i_bind_port <= 0 )
             i_bind_port = DEFAULT_PORT;
-        p_sys->p_httpd_host = httpd_HostNew( VLC_OBJECT(p_access),
-                                             psz_bind_addr, i_bind_port );
+        p_sys->p_httpd_host = vlc_http_HostNew( VLC_OBJECT(p_access),
+                                                psz_bind_addr, i_bind_port );
     }
 
     if( p_sys->p_httpd_host == NULL )
index 70430a3de3b435184a550c2271544741a6f5051a..e50271998c3723cb26518e5aee1ba58d8f6968bf 100644 (file)
@@ -70,7 +70,7 @@ static int vlclua_httpd_tls_host_new( lua_State *L )
     vlc_object_t *p_this = vlclua_get_this( L );
     const char *psz_host = luaL_checkstring( L, 1 );
     int i_port = luaL_checkint( L, 2 );
-    httpd_host_t *p_host = httpd_HostNew( p_this, psz_host, i_port );
+    httpd_host_t *p_host = vlc_http_HostNew( p_this, psz_host, i_port );
     if( !p_host )
         return luaL_error( L, "Failed to create HTTP host \"%s:%d\" ",
                            psz_host, i_port );
index 1ba5aea0aebbbd99475f13b3813c5be63d783ca5..81577854afc50d5a2f5ab888890da9d69920c60a 100644 (file)
@@ -282,7 +282,7 @@ static int Open( vlc_object_t *p_this )
     p_sys->psz_raw_mux = var_CreateGetString( p_this, "rtsp-raw-mux" );
 
     p_sys->p_rtsp_host =
-        httpd_HostNew( VLC_OBJECT(p_vod), url.psz_host, url.i_port );
+        vlc_rtsp_HostNew( VLC_OBJECT(p_vod), url.psz_host, url.i_port );
     if( !p_sys->p_rtsp_host )
     {
         msg_Err( p_vod, "cannot create RTSP server (%s:%i)",
index b12b34e5afa214291bc0bdd1b283bbb670ff346b..cc8b62ba1b36c887064ce772a721aeee717e6217 100644 (file)
@@ -1320,7 +1320,7 @@ static int HttpSetup( sout_stream_t *p_stream, const vlc_url_t *url)
 {
     sout_stream_sys_t *p_sys = p_stream->p_sys;
 
-    p_sys->p_httpd_host = httpd_HostNew( VLC_OBJECT(p_stream), url->psz_host,
+    p_sys->p_httpd_host = vlc_http_HostNew( VLC_OBJECT(p_stream), url->psz_host,
                                          url->i_port > 0 ? url->i_port : 80 );
     if( p_sys->p_httpd_host )
     {
index 6a8534a81cfb13de3eacdee728e6db4721132c6d..1ab9ad5bfce38ca93a32ed7f768a9c8608dd202d 100644 (file)
@@ -120,8 +120,8 @@ rtsp_stream_t *RtspSetup( vlc_object_t *owner, vod_media_t *media,
     msg_Dbg( owner, "RTSP stream: host %s port %d at %s",
              url->psz_host, rtsp->port, rtsp->psz_path );
 
-    rtsp->host = httpd_HostNew( VLC_OBJECT(owner), url->psz_host,
-                                rtsp->port );
+    rtsp->host = vlc_rtsp_HostNew( VLC_OBJECT(owner), url->psz_host,
+                                   rtsp->port );
     if( rtsp->host == NULL )
         goto error;
 
index 2a75e79898573786108d5a20a2313286038c08f5..a7673aa31c1cda771314b2a60ea8c89a2f30f23c 100644 (file)
@@ -159,7 +159,9 @@ httpd_FileNew
 httpd_HandlerDelete
 httpd_HandlerNew
 httpd_HostDelete
-httpd_HostNew
+vlc_http_HostNew
+vlc_https_HostNew
+vlc_rtsp_HostNew
 httpd_MsgAdd
 httpd_MsgGet
 httpd_RedirectDelete
@@ -169,7 +171,6 @@ httpd_StreamDelete
 httpd_StreamHeader
 httpd_StreamNew
 httpd_StreamSend
-httpd_TLSHostNew
 httpd_UrlCatch
 httpd_UrlDelete
 httpd_UrlNew
index ce318c58ac0cc1c0dcf40053e28aedf83ba88bd8..a2832d1269835221e39eaad370321bd9f6822a89 100644 (file)
@@ -93,18 +93,25 @@ void httpd_HostDelete (httpd_host_t *h)
     assert (0);
 }
 
-httpd_host_t *httpd_HostNew (vlc_object_t *obj, const char *host, int port)
+httpd_host_t *vlc_http_HostNew (vlc_object_t *obj, const char *host, int port)
 {
     (void) host; (void) port;
-    msg_Err (obj, "VLC httpd support not compiled-in!");
+    msg_Err (obj, "HTTP server not compiled-in!");
     return NULL;
 }
 
-httpd_host_t *httpd_TLSHostNew (vlc_object_t *obj, const char *host, int port)
+httpd_host_t *vlc_https_HostNew (vlc_object_t *obj, const char *host, int port)
 {
      return httpd_HostNew (obj, host, port);
 }
 
+httpd_host_t *vlc_rtsp_HostNew (vlc_object_t *obj, const char *host, int port)
+{
+    (void) host; (void) port;
+    msg_Err (obj, "RTSP server not compiled-in!");
+    return NULL;
+}
+
 void httpd_MsgAdd (httpd_message_t *m, const char *name, const char *fmt, ...)
 {
     (void) m; (void) name; (void) fmt;
index fa495b714071082ca5f320f1b428cd8666796968..1cafa7a96f23368686ad7da1fff0f6dc75871002 100644 (file)
@@ -968,13 +968,13 @@ static httpd_host_t *httpd_HostCreate( vlc_object_t *, const char *, int,
                                        vlc_tls_creds_t * );
 
 /* create a new host */
-httpd_host_t *httpd_HostNew( vlc_object_t *p_this, const char *psz_host,
-                             int i_port )
+httpd_host_t *vlc_http_HostNew( vlc_object_t *p_this, const char *psz_host,
+                                int i_port )
 {
     return httpd_HostCreate( p_this, psz_host, i_port, NULL );
 }
 
-httpd_host_t *httpd_TLSHostNew( vlc_object_t *obj, const char *host, int port )
+httpd_host_t *vlc_https_HostNew( vlc_object_t *obj, const char *host, int port )
 {
     char *cert = var_InheritString( obj, "http-cert" );
     if( cert == NULL )
@@ -1028,6 +1028,12 @@ error:
     return NULL;
 }
 
+httpd_host_t *vlc_rtsp_HostNew( vlc_object_t *p_this, const char *psz_host,
+                                int i_port )
+{
+    return httpd_HostCreate( p_this, psz_host, i_port, NULL );
+}
+
 static vlc_mutex_t httpd_mutex = VLC_STATIC_MUTEX;
 
 static httpd_host_t *httpd_HostCreate( vlc_object_t *p_this,