[rtmpdump] r550 - trunk/librtmp/rtmp.c

hyc subversion at mplayerhq.hu
Fri Aug 13 22:34:59 CEST 2010


Author: hyc
Date: Fri Aug 13 22:34:58 2010
New Revision: 550

Log:
Less case-sensitive check for Content-length: header

Modified:
   trunk/librtmp/rtmp.c

Modified: trunk/librtmp/rtmp.c
==============================================================================
--- trunk/librtmp/rtmp.c	Fri Aug 13 22:05:35 2010	(r549)
+++ trunk/librtmp/rtmp.c	Fri Aug 13 22:34:58 2010	(r550)
@@ -3664,11 +3664,15 @@ HTTP_read(RTMP *r, int fill)
     return -1;
   if (strncmp(r->m_sb.sb_start, "HTTP/1.1 200 ", 13))
     return -1;
-  ptr = strstr(r->m_sb.sb_start, "Content-Length:");
+  ptr = r->m_sb.sb_start + sizeof("HTTP/1.1 200");
+  while ((ptr = strstr(ptr, "Content-"))) {
+    if (!strncasecmp(ptr+8, "length:", 7)) break;
+    ptr += 8;
+  }
   if (!ptr)
     return -1;
   hlen = atoi(ptr+16);
-  ptr = strstr(ptr, "\r\n\r\n");
+  ptr = strstr(ptr+16, "\r\n\r\n");
   if (!ptr)
     return -1;
   ptr += 4;


More information about the rtmpdump mailing list