[rtmpdump] r444 - in trunk: rtmpsrv.c rtmpsuck.c

hyc subversion at mplayerhq.hu
Sat Apr 24 09:22:33 CEST 2010


Author: hyc
Date: Sat Apr 24 09:22:32 2010
New Revision: 444

Log:
Fix: if playpath begins with '?' just use the remainder

Modified:
   trunk/rtmpsrv.c
   trunk/rtmpsuck.c

Modified: trunk/rtmpsrv.c
==============================================================================
--- trunk/rtmpsrv.c	Wed Apr 21 04:38:16 2010	(r443)
+++ trunk/rtmpsrv.c	Sat Apr 24 09:22:32 2010	(r444)
@@ -649,7 +649,17 @@ ServeInvoke(STREAMING_SERVER *server, RT
 	  /* strip trailing URL parameters */
 	  q = memchr(av.av_val, '?', av.av_len);
 	  if (q)
-	    av.av_len = q - av.av_val;
+	    {
+		  if (q == av.av_val)
+		    {
+			  av.av_val++;
+			  av.av_len--;
+			}
+		  else
+		    {
+	          av.av_len = q - av.av_val;
+			}
+		}
 	  /* strip leading slash components */
 	  for (p=av.av_val+av.av_len-1; p>=av.av_val; p--)
 	    if (*p == '/')

Modified: trunk/rtmpsuck.c
==============================================================================
--- trunk/rtmpsuck.c	Wed Apr 21 04:38:16 2010	(r443)
+++ trunk/rtmpsuck.c	Sat Apr 24 09:22:32 2010	(r444)
@@ -241,7 +241,10 @@ ServeInvoke(STREAMING_SERVER *server, in
                       r1 = pval.av_val+8;
                     }
                   r2 = strchr(r1, '/');
-                  len = r2 - r1;
+		  if (r2)
+                    len = r2 - r1;
+		  else
+		    len = pval.av_len - (r1 - pval.av_val);
                   r2 = malloc(len+1);
                   memcpy(r2, r1, len);
                   r2[len] = '\0';
@@ -327,7 +330,17 @@ ServeInvoke(STREAMING_SERVER *server, in
       /* strip trailing URL parameters */
       q = memchr(av.av_val, '?', av.av_len);
       if (q)
-        av.av_len = q - av.av_val;
+        {
+	  if (q == av.av_val)
+	    {
+	      av.av_val++;
+	      av.av_len--;
+	    }
+	  else
+	    {
+              av.av_len = q - av.av_val;
+	    }
+	}
       /* strip leading slash components */
       for (p=av.av_val+av.av_len-1; p>=av.av_val; p--)
         if (*p == '/')


More information about the rtmpdump mailing list