[FFmpeg-cvslog] http: use ffurl_closep()
Michael Niedermayer
git at videolan.org
Fri Jun 1 14:54:12 CEST 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Jun 1 14:48:17 2012 +0200| [f218121a4d79f9aab45526f3d1655ec2cc8de0d1] | committer: Michael Niedermayer
http: use ffurl_closep()
Fixes Ticket1383
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f218121a4d79f9aab45526f3d1655ec2cc8de0d1
---
libavformat/http.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/libavformat/http.c b/libavformat/http.c
index a069464..a303129 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -163,7 +163,8 @@ static int http_open_cnx(URLContext *h)
if (s->http_code == 401) {
if ((cur_auth_type == HTTP_AUTH_NONE || s->auth_state.stale) &&
s->auth_state.auth_type != HTTP_AUTH_NONE && attempts < 4) {
- ffurl_close(hd);
+ ffurl_closep(&hd);
+ s->hd = NULL;
goto redo;
} else
goto fail;
@@ -171,7 +172,8 @@ static int http_open_cnx(URLContext *h)
if (s->http_code == 407) {
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);
+ ffurl_closep(&hd);
+ s->hd = NULL;
goto redo;
} else
goto fail;
@@ -179,7 +181,8 @@ static int http_open_cnx(URLContext *h)
if ((s->http_code == 301 || s->http_code == 302 || s->http_code == 303 || s->http_code == 307)
&& location_changed == 1) {
/* url moved, get next */
- ffurl_close(hd);
+ ffurl_closep(&hd);
+ s->hd = NULL;
if (redirects++ >= MAX_REDIRECTS)
return AVERROR(EIO);
/* Restart the authentication process with the new target, which
@@ -192,7 +195,7 @@ static int http_open_cnx(URLContext *h)
return 0;
fail:
if (hd)
- ffurl_close(hd);
+ ffurl_closep(&hd);
s->hd = NULL;
return AVERROR(EIO);
}
@@ -602,7 +605,7 @@ static int http_close(URLContext *h)
}
if (s->hd)
- ffurl_close(s->hd);
+ ffurl_closep(&s->hd);
return ret;
}
@@ -684,7 +687,7 @@ static int http_proxy_close(URLContext *h)
{
HTTPContext *s = h->priv_data;
if (s->hd)
- ffurl_close(s->hd);
+ ffurl_closep(&s->hd);
return 0;
}
@@ -755,8 +758,7 @@ redo:
if (s->http_code == 407 &&
(cur_auth_type == HTTP_AUTH_NONE || s->proxy_auth_state.stale) &&
s->proxy_auth_state.auth_type != HTTP_AUTH_NONE && attempts < 2) {
- ffurl_close(s->hd);
- s->hd = NULL;
+ ffurl_closep(&s->hd);
goto redo;
}
More information about the ffmpeg-cvslog
mailing list