lavf/http: Process HTTP header before sending response.
authorStephan Holljes <klaxa1337@googlemail.com>
Wed, 3 Jun 2015 23:17:51 +0000 (01:17 +0200)
committerNicolas George <george@nsup.org>
Sat, 6 Jun 2015 07:13:42 +0000 (09:13 +0200)
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
libavformat/http.c

index 546741a..e51f524 100644 (file)
@@ -318,10 +318,10 @@ static int http_listen(URLContext *h, const char *uri, int flags,
     if ((ret = ffurl_open(&s->hd, lower_url, AVIO_FLAG_READ_WRITE,
                           &h->interrupt_callback, options)) < 0)
         goto fail;
-    if ((ret = ffurl_write(s->hd, header, strlen(header))) < 0)
-        goto fail;
     if ((ret = http_read_header(h, &new_location)) < 0)
          goto fail;
+    if ((ret = ffurl_write(s->hd, header, strlen(header))) < 0)
+         goto fail;
     return 0;
 
 fail: