Mercurial > libavformat.hg
changeset 5890:f075d373e9be libavformat
Actually parse the auth headers in RTSP
author | mstorsjo |
---|---|
date | Thu, 25 Mar 2010 21:48:58 +0000 |
parents | 4b42835727aa |
children | 59e4df62d614 |
files | rtsp.c rtsp.h |
diffstat | 2 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/rtsp.c Thu Mar 25 21:47:33 2010 +0000 +++ b/rtsp.c Thu Mar 25 21:48:58 2010 +0000 @@ -838,7 +838,8 @@ } } -void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf) +void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf, + HTTPAuthState *auth_state) { const char *p; @@ -871,6 +872,12 @@ } else if (av_stristart(p, "Location:", &p)) { skip_spaces(&p); av_strlcpy(reply->location, p , sizeof(reply->location)); + } else if (av_stristart(p, "WWW-Authenticate:", &p) && auth_state) { + skip_spaces(&p); + ff_http_auth_handle_header(auth_state, "WWW-Authenticate", p); + } else if (av_stristart(p, "Authentication-Info:", &p) && auth_state) { + skip_spaces(&p); + ff_http_auth_handle_header(auth_state, "Authentication-Info", p); } } @@ -951,7 +958,7 @@ get_word(buf1, sizeof(buf1), &p); reply->status_code = atoi(buf1); } else { - ff_rtsp_parse_line(reply, p); + ff_rtsp_parse_line(reply, p, &rt->auth_state); av_strlcat(rt->last_reply, p, sizeof(rt->last_reply)); av_strlcat(rt->last_reply, "\n", sizeof(rt->last_reply)); }
--- a/rtsp.h Thu Mar 25 21:47:33 2010 +0000 +++ b/rtsp.h Thu Mar 25 21:48:58 2010 +0000 @@ -322,7 +322,8 @@ //@} } RTSPStream; -void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf); +void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf, + HTTPAuthState *auth_state); #if LIBAVFORMAT_VERSION_INT < (53 << 16) extern int rtsp_default_protocols;