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)
committerMartin Storsjö <martin@martin.st>
Tue, 14 Aug 2018 19:30:23 +0000 (22:30 +0300)
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: Martin Storsjö <martin@martin.st>
libavformat/http.c

index 80c87f7..dfb9564 100644 (file)
@@ -248,6 +248,8 @@ fail:
     if (s->hd)
         ffurl_close(s->hd);
     s->hd = NULL;
+    if (location_changed < 0)
+        return location_changed;
     return AVERROR(EIO);
 }