avformat/http: pass return code from http_open_cnx_internal() on its failure
authorAndrey Utkin <andrey.utkin@corp.bluecherry.net>
Thu, 23 Oct 2014 16:55:46 +0000 (20:55 +0400)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 23 Oct 2014 18:58:21 +0000 (20:58 +0200)
Previously, AVERROR(EIO) was returned on failure of
http_open_cnx_internal(). Now the value is passed to upper level, thus
it is possible to distinguish ECONNREFUSED, ETIMEDOUT, ENETUNREACH etc.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/http.c

index d12dcaa..dfc01ee 100644 (file)
@@ -250,6 +250,8 @@ redo:
 fail:
     if (s->hd)
         ffurl_closep(&s->hd);
+    if (location_changed < 0)
+        return location_changed;
     return ff_http_averror(s->http_code, AVERROR(EIO));
 }