]> git.sesse.net Git - vlc/commitdiff
Specify port in Host: HTTP request header
authorRémi Denis-Courmont <rem@videolan.org>
Sat, 24 Jul 2004 17:22:40 +0000 (17:22 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sat, 24 Jul 2004 17:22:40 +0000 (17:22 +0000)
(thanks to Olivier Lourdais for the report)

modules/access/http.c

index 500b013ba286419079592b3b3fe3a042eb389035..27e2174f672e6f8087f62e544b6f8309c53484ae 100644 (file)
@@ -607,9 +607,19 @@ static int Connect( access_t *p_access, int64_t i_tell )
         {
             psz_path = "/";
         }
-        net_Printf( VLC_OBJECT(p_access), p_sys->fd,
-                    "GET %s HTTP/1.%d\r\nHost: %s\r\n",
-                    psz_path, p_sys->i_version, p_sys->url.psz_host );
+        if( p_sys->url.i_port != 80)
+        {
+            net_Printf( VLC_OBJECT(p_access), p_sys->fd,
+                        "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( VLC_OBJECT(p_access), p_sys->fd,
+                        "GET %s HTTP/1.%d\r\nHost: %s\r\n",
+                        psz_path, p_sys->i_version, p_sys->url.psz_host );
+        }
     }
     /* User Agent */
     net_Printf( VLC_OBJECT(p_access), p_sys->fd, "User-Agent: %s\r\n",