OSDN Git Service

http: Handle 301/307 redirect requests, too
authorMike Edenfield <kutulu@kutulu.org>
Tue, 2 Nov 2010 20:37:01 +0000 (20:37 +0000)
committerMartin Storsjö <martin@martin.st>
Tue, 2 Nov 2010 20:37:01 +0000 (20:37 +0000)
Patch by Mike Edenfield, kutulu at kutulu dot org

Originally committed as revision 25651 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/http.c

index f58c78a..e9fab3b 100644 (file)
@@ -138,7 +138,8 @@ static int http_open_cnx(URLContext *h)
         } else
             goto fail;
     }
-    if ((s->http_code == 302 || s->http_code == 303) && location_changed == 1) {
+    if ((s->http_code == 301 || s->http_code == 302 || s->http_code == 303 || s->http_code == 307)
+        && location_changed == 1) {
         /* url moved, get next */
         url_close(hd);
         if (redirects++ >= MAX_REDIRECTS)