]> git.sesse.net Git - vlc/blobdiff - modules/access/http.c
Add ranges to font sizes
[vlc] / modules / access / http.c
index 1389810caa2cb3580d73054f23327b0c54ab84e0..9817bcaee8476d2961f98ecf033dd8a673810caf 100644 (file)
@@ -110,6 +110,7 @@ vlc_module_begin ()
                 false )
     add_password( "http-proxy-pwd", NULL,
                   PROXY_PASS_TEXT, PROXY_PASS_LONGTEXT, false )
+    add_obsolete_bool( "http-use-IE-proxy" )
     add_string( "http-referrer", NULL, REFERER_TEXT, REFERER_LONGTEXT, false )
         change_safe()
     add_string( "http-user-agent", NULL, UA_TEXT, UA_LONGTEXT, false )
@@ -401,7 +402,7 @@ static int OpenWithCookies( vlc_object_t *p_this, const char *psz_access,
             msg_Err(p_access, "Allocating memory for libproxy failed");
         }
     }
-#elif defined( WIN32 )
+#elif (0) // defined( WIN32 ) The parsing is not complete enough
     else
     {
         /* Try to get the proxy server address from Windows internet settings using registry. */
@@ -449,6 +450,7 @@ static int OpenWithCookies( vlc_object_t *p_this, const char *psz_access,
             }
             else
                 msg_Dbg( p_access, "HTTP proxy disabled (MSIE)" );
+            RegCloseKey( h_key );
         }
     }
 #else
@@ -916,13 +918,11 @@ static int ReadICYMeta( access_t *p_access )
     for( i_read = 0; i_read < i_size; )
     {
         int i_tmp;
-        if( ReadData( p_access, &i_tmp, (uint8_t *)&psz_meta[i_read], i_size - i_read ) )
+        if( ReadData( p_access, &i_tmp, (uint8_t *)&psz_meta[i_read], i_size - i_read ) || i_tmp <= 0 )
         {
             free( psz_meta );
             return VLC_EGENERIC;
         }
-        if( i_tmp <= 0 )
-            return VLC_EGENERIC;
         i_read += i_tmp;
     }
     psz_meta[i_read] = '\0'; /* Just in case */
@@ -1240,44 +1240,22 @@ static int Request( access_t *p_access, uint64_t i_tell )
     p_sys->b_persist = false;
 
     p_sys->i_remaining = 0;
-    if( p_sys->b_proxy )
-    {
-        if( p_sys->url.psz_path )
-        {
-            net_Printf( p_access, p_sys->fd, NULL,
-                        "GET http://%s:%d%s HTTP/1.%d\r\n",
-                        p_sys->url.psz_host, p_sys->url.i_port,
-                        p_sys->url.psz_path, p_sys->i_version );
-        }
-        else
-        {
-            net_Printf( p_access, p_sys->fd, NULL,
-                        "GET http://%s:%d/ HTTP/1.%d\r\n",
-                        p_sys->url.psz_host, p_sys->url.i_port,
-                        p_sys->i_version );
-        }
-    }
+
+    const char *psz_path = p_sys->url.psz_path;
+    if( !psz_path || !*psz_path )
+        psz_path = "/";
+    net_Write( p_access, p_sys->fd, pvs, "GET ", 4 );
+    if( p_sys->b_proxy && pvs == NULL )
+        net_Printf( p_access, p_sys->fd, NULL, "http://%s:%d",
+                    p_sys->url.psz_host, p_sys->url.i_port );
+    net_Printf( p_access, p_sys->fd, pvs, "%s HTTP/1.%d\r\n",
+                psz_path, p_sys->i_version );
+    if( p_sys->url.i_port != (pvs ? 443 : 80) )
+        net_Printf( p_access, p_sys->fd, pvs, "Host: %s:%d\r\n",
+                    p_sys->url.psz_host, p_sys->url.i_port );
     else
-    {
-        const char *psz_path = p_sys->url.psz_path;
-        if( !psz_path || !*psz_path )
-        {
-            psz_path = "/";
-        }
-        if( p_sys->url.i_port != (pvs ? 443 : 80) )
-        {
-            net_Printf( p_access, p_sys->fd, pvs,
-                        "GET %s HTTP/1.%d\r\nHost: %s:%d\r\n",
-                        psz_path, p_sys->i_version, p_sys->url.psz_host,
-                        p_sys->url.i_port );
-        }
-        else
-        {
-            net_Printf( p_access, p_sys->fd, pvs,
-                        "GET %s HTTP/1.%d\r\nHost: %s\r\n",
-                        psz_path, p_sys->i_version, p_sys->url.psz_host );
-        }
-    }
+        net_Printf( p_access, p_sys->fd, pvs, "Host: %s\r\n",
+                    p_sys->url.psz_host );
     /* User Agent */
     net_Printf( p_access, p_sys->fd, pvs,
                 "User-Agent: %s\r\n",