[FFmpeg-cvslog] http: Clear the old URLContext pointer when closed
Martin Storsjö
git at videolan.org
Fri Jun 1 20:05:37 CEST 2012
ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Fri Jun 1 16:24:47 2012 +0300| [3cbcfa2decdbe2b223f7f878b03a5f33a41a22f5] | committer: Martin Storsjö
http: Clear the old URLContext pointer when closed
This fixes issues with opening http urls that have authentication
or redirects, introduced in commit e999b641.
Signed-off-by: Martin Storsjö <martin at martin.st>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3cbcfa2decdbe2b223f7f878b03a5f33a41a22f5
---
libavformat/http.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavformat/http.c b/libavformat/http.c
index 22600b4..61266df 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -161,6 +161,7 @@ static int http_open_cnx(URLContext *h)
if ((cur_auth_type == HTTP_AUTH_NONE || s->auth_state.stale) &&
s->auth_state.auth_type != HTTP_AUTH_NONE && attempts < 4) {
ffurl_close(hd);
+ s->hd = hd = NULL;
goto redo;
} else
goto fail;
@@ -169,6 +170,7 @@ static int http_open_cnx(URLContext *h)
if ((cur_proxy_auth_type == HTTP_AUTH_NONE || s->proxy_auth_state.stale) &&
s->proxy_auth_state.auth_type != HTTP_AUTH_NONE && attempts < 4) {
ffurl_close(hd);
+ s->hd = hd = NULL;
goto redo;
} else
goto fail;
@@ -177,6 +179,7 @@ static int http_open_cnx(URLContext *h)
&& location_changed == 1) {
/* url moved, get next */
ffurl_close(hd);
+ s->hd = hd = NULL;
if (redirects++ >= MAX_REDIRECTS)
return AVERROR(EIO);
/* Restart the authentication process with the new target, which
More information about the ffmpeg-cvslog
mailing list