[FFmpeg-cvslog] r22677 - in trunk: ffserver.c libavformat/rtsp.c libavformat/rtsp.h

mstorsjo subversion
Thu Mar 25 22:48:59 CET 2010


Author: mstorsjo
Date: Thu Mar 25 22:48:58 2010
New Revision: 22677

Log:
Actually parse the auth headers in RTSP

Modified:
   trunk/ffserver.c
   trunk/libavformat/rtsp.c
   trunk/libavformat/rtsp.h

Modified: trunk/ffserver.c
==============================================================================
--- trunk/ffserver.c	Thu Mar 25 22:47:33 2010	(r22676)
+++ trunk/ffserver.c	Thu Mar 25 22:48:58 2010	(r22677)
@@ -2756,7 +2756,7 @@ static int rtsp_parse_request(HTTPContex
             len = sizeof(line) - 1;
         memcpy(line, p, len);
         line[len] = '\0';
-        ff_rtsp_parse_line(header, line);
+        ff_rtsp_parse_line(header, line, NULL);
         p = p1 + 1;
     }
 

Modified: trunk/libavformat/rtsp.c
==============================================================================
--- trunk/libavformat/rtsp.c	Thu Mar 25 22:47:33 2010	(r22676)
+++ trunk/libavformat/rtsp.c	Thu Mar 25 22:48:58 2010	(r22677)
@@ -838,7 +838,8 @@ static void rtsp_parse_transport(RTSPMes
     }
 }
 
-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 @@ void ff_rtsp_parse_line(RTSPMessageHeade
     } 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 @@ int ff_rtsp_read_reply(AVFormatContext *
             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));
         }

Modified: trunk/libavformat/rtsp.h
==============================================================================
--- trunk/libavformat/rtsp.h	Thu Mar 25 22:47:33 2010	(r22676)
+++ trunk/libavformat/rtsp.h	Thu Mar 25 22:48:58 2010	(r22677)
@@ -322,7 +322,8 @@ typedef struct RTSPStream {
     //@}
 } 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;



More information about the ffmpeg-cvslog mailing list