]> git.sesse.net Git - vlc/blobdiff - modules/access/http.c
* modules/access/mms/mmstu.c: use net_Write() instead of send().
[vlc] / modules / access / http.c
index 2dade0f2d1aa1412fa5cfaab39c35c233ca5b2ff..fd55de0ef469ae0f19910101d7185212e5540d98 100644 (file)
@@ -82,10 +82,9 @@ vlc_module_begin();
               RECONNECT_LONGTEXT, VLC_TRUE );
     add_bool( "http-continuous", 0, NULL, CONTINUOUS_TEXT,
               CONTINUOUS_LONGTEXT, VLC_TRUE );
-
+    add_suppressed_string("http-user");
+    add_suppressed_string("http-pwd");
     add_shortcut( "http" );
-    add_shortcut( "http4" );
-    add_shortcut( "http6" );
     add_shortcut( "https" );
     add_shortcut( "unsv" );
     set_callbacks( Open, Close );
@@ -153,33 +152,7 @@ static int Open( vlc_object_t *p_this )
 {
     access_t     *p_access = (access_t*)p_this;
     access_sys_t *p_sys;
-    char         *psz;
-
-    /* First set ipv4/ipv6 */
-    var_Create( p_access, "ipv4", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
-    var_Create( p_access, "ipv6", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
-
-    if( *p_access->psz_access )
-    {
-        vlc_value_t val;
-        /* Find out which shortcut was used */
-        if( !strncmp( p_access->psz_access, "http4", 6 ) )
-        {
-            val.b_bool = VLC_TRUE;
-            var_Set( p_access, "ipv4", val );
-
-            val.b_bool = VLC_FALSE;
-            var_Set( p_access, "ipv6", val );
-        }
-        else if( !strncmp( p_access->psz_access, "http6", 6 ) )
-        {
-            val.b_bool = VLC_TRUE;
-            var_Set( p_access, "ipv6", val );
-
-            val.b_bool = VLC_FALSE;
-            var_Set( p_access, "ipv4", val );
-        }
-    }
+    char         *psz, *p;
 
     /* Set up p_access */
     p_access->pf_read = Read;
@@ -214,21 +187,12 @@ static int Open( vlc_object_t *p_this )
     p_sys->psz_icy_title = NULL;
     p_sys->i_remaining = 0;
 
-    /* Parse URI */
-    if( vlc_UrlIsNotEncoded( p_access->psz_path ) )
-    {
-        psz = vlc_UrlEncode( p_access->psz_path );
-        if( psz == NULL )
-        {
-            free( p_sys );
-            return VLC_ENOMEM;
-        }
-
-        vlc_UrlParse( &p_sys->url, psz, 0 );
-        free( psz );
-    }
-    else
-        vlc_UrlParse( &p_sys->url, p_access->psz_path, 0 );
+    /* Parse URI - remove spaces */
+    p = psz = strdup( p_access->psz_path );
+    while( (p = strchr( p, ' ' )) != NULL )
+        *p = '+';
+    vlc_UrlParse( &p_sys->url, psz, 0 );
+    free( psz );
 
     if( p_sys->url.psz_host == NULL || *p_sys->url.psz_host == '\0' )
     {
@@ -614,8 +578,10 @@ static int ReadICYMeta( access_t *p_access )
     /* Read meta data length */
     i_read = net_Read( p_access, p_sys->fd, p_sys->p_vs, &buffer, 1,
                        VLC_TRUE );
-    if( ( i_read <= 0 ) || ( buffer == 0 ) )
+    if( i_read <= 0 )
         return VLC_EGENERIC;
+    if( buffer == 0 )
+        return VLC_SUCCESS;
 
     i_read = buffer << 4;
     msg_Dbg( p_access, "ICY meta size=%u", i_read);