]> git.sesse.net Git - vlc/commitdiff
* modules/access/http.c: When redirecting, don't include port number in URL if it...
authorAntoine Cellerier <dionoea@videolan.org>
Fri, 18 May 2007 14:01:38 +0000 (14:01 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Fri, 18 May 2007 14:01:38 +0000 (14:01 +0000)
modules/access/http.c

index 27f9b764e2c2aba8ce9f8f27c6888fcefb3cb80b..8d3bcfd705b1c5f598486642461b780d3509e544 100644 (file)
@@ -1086,8 +1086,16 @@ static int Request( access_t *p_access, int64_t i_tell )
             {
                 const char *psz_http_ext = p_sys->b_ssl ? "s" : "" ;
 
-                asprintf(&psz_new_loc, "http%s://%s:%d%s", psz_http_ext,
-                         p_sys->url.psz_host, p_sys->url.i_port, p);
+                if( p_sys->url.i_port == ( p_sys->b_ssl ? 443 : 80 ) )
+                {
+                    asprintf(&psz_new_loc, "http%s://%s%s", psz_http_ext,
+                             p_sys->url.psz_host, p);
+                }
+                else
+                {
+                    asprintf(&psz_new_loc, "http%s://%s:%d%s", psz_http_ext,
+                             p_sys->url.psz_host, p_sys->url.i_port, p);
+                }
             }
             else
             {