]> git.sesse.net Git - vlc/commitdiff
Only rewrite the URI if it's a permanent redirection. Thanks to Sebastian Wiedenroth...
authorChristophe Mutricy <xtophe@videolan.org>
Sun, 6 Jan 2008 19:54:28 +0000 (19:54 +0000)
committerChristophe Mutricy <xtophe@videolan.org>
Sun, 6 Jan 2008 19:54:28 +0000 (19:54 +0000)
modules/access/http.c

index cce9f70c55964b4c58a71e169bd0b9d81773f6d3..76b868ea30e1f9b5bb8247c5e75d8db9773a1fe6 100644 (file)
@@ -330,19 +330,20 @@ connect:
             msg_Err( p_access, "insecure redirection ignored" );
             goto error;
         }
+        if( p_sys->i_code == 301 )
+        {
+            /* Permanent redirection: Change the URI */
+            p_playlist = pl_Yield( p_access );
+            PL_LOCK;
 
-        /* Change the URI */
-        p_playlist = pl_Yield( p_access );
-        PL_LOCK;
+            p_input_item = p_playlist->status.p_item->p_input;
+            input_item_SetURI( p_input_item, p_sys->psz_location );
 
-        p_input_item = p_playlist->status.p_item->p_input;
-        input_item_SetURI( p_input_item, p_sys->psz_location );
+            PL_UNLOCK;
+            pl_Release( p_access );
+        }
         free( p_access->psz_path );
         p_access->psz_path = strdup( p_sys->psz_location );
-
-        PL_UNLOCK;
-        pl_Release( p_access );
-
         /* Clean up current Open() run */
         vlc_UrlClean( &p_sys->url );
         vlc_UrlClean( &p_sys->proxy );