changeset 18852:b17648e2762e

be more tolerant on server responses parameters case (fix 1.17 from xine, see http://xine.cvs.sourceforge.net/xine/xine-lib/src/input/librtsp/rtsp.c?r1=1.16&r2=1.17)
author ben
date Thu, 29 Jun 2006 21:46:51 +0000
parents 703273c5e860
children 1ec19da0c642
files libmpdemux/librtsp/rtsp.c
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/librtsp/rtsp.c	Thu Jun 29 21:27:07 2006 +0000
+++ b/libmpdemux/librtsp/rtsp.c	Thu Jun 29 21:46:51 2006 +0000
@@ -332,8 +332,8 @@
     if (!answer)
       return 0;
     
-    if (!strncmp(answer,"CSeq:",5)) {
-      sscanf(answer,"CSeq: %u",&answer_seq);
+    if (!strncasecmp(answer,"CSeq:",5)) {
+      sscanf(answer,"%*s %u",&answer_seq);
       if (s->cseq != answer_seq) {
 #ifdef LOG
         mp_msg(MSGT_OPEN, MSGL_WARN, "librtsp: warning: CSeq mismatch. got %u, assumed %u", answer_seq, s->cseq);
@@ -341,16 +341,16 @@
         s->cseq=answer_seq;
       }
     }
-    if (!strncmp(answer,"Server:",7)) {
+    if (!strncasecmp(answer,"Server:",7)) {
       char *buf = malloc(strlen(answer));
-      sscanf(answer,"Server: %s",buf);
+      sscanf(answer,"%*s %s",buf);
       if (s->server) free(s->server);
       s->server=strdup(buf);
       free(buf);
     }
-    if (!strncmp(answer,"Session:",8)) {
+    if (!strncasecmp(answer,"Session:",8)) {
       char *buf = calloc(1, strlen(answer));
-      sscanf(answer,"Session: %s",buf);
+      sscanf(answer,"%*s %s",buf);
       if (s->session) {
         if (strcmp(buf, s->session)) {
           mp_msg(MSGT_OPEN, MSGL_WARN, "rtsp: warning: setting NEW session: %s\n", buf);
@@ -536,8 +536,8 @@
         rest=rtsp_get(s);
         if (!rest)
           return -1;
-        if (!strncmp(rest,"CSeq:",5))
-          sscanf(rest,"CSeq: %u",&seq);
+        if (!strncasecmp(rest,"CSeq:",5))
+          sscanf(rest,"%*s %u",&seq);
       } while (strlen(rest)!=0);
       free(rest);
       if (seq<0) {