[1/3] http: pass return code from http_open_cnx_internal() on its failure

Message ID 20180813193015.15253-1-martin@martin.st
State Committed
Commit 5d01bd181bb77e6740462095d7be4e0733a59420
Headers show
Series
  • [1/3] http: pass return code from http_open_cnx_internal() on its failure
Related show

Commit Message

Martin Storsjö Aug. 13, 2018, 7:30 p.m.
From: Andrey Utkin <andrey.utkin@corp.bluecherry.net>

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.
---
 libavformat/http.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Luca Barbato Aug. 14, 2018, 11:56 a.m. | #1
Set ok.

Patch

diff --git a/libavformat/http.c b/libavformat/http.c
index 80c87f786a..dfb95642c0 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -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);
 }