]> granicus.if.org Git - rtmpdump/commitdiff
Look for a fourth slash when splitting the url into app+playpath
authorBjörn Axelsson <bjorn.axelsson@intinor.se>
Tue, 30 Oct 2012 17:31:01 +0000 (19:31 +0200)
committerHoward Chu <hyc@highlandsun.com>
Tue, 30 Oct 2012 18:30:26 +0000 (11:30 -0700)
librtmp/parseurl.c

index 0183958cc45bc0ee05e172c3278ffde6030af688..646c70c188285312a07eaf40a81edbfc8fbc3704 100644 (file)
@@ -137,12 +137,14 @@ parsehost:
         * application = app[/appinstance]
         */
 
-       char *slash2, *slash3 = NULL;
+       char *slash2, *slash3 = NULL, *slash4 = NULL;
        int applen, appnamelen;
 
        slash2 = strchr(p, '/');
        if(slash2)
                slash3 = strchr(slash2+1, '/');
+       if(slash3)
+               slash4 = strchr(slash3+1, '/');
 
        applen = end-p; /* ondemand, pass all parameters as app */
        appnamelen = applen; /* ondemand length */
@@ -156,7 +158,9 @@ parsehost:
                 appnamelen = 8;
         }
        else { /* app!=ondemand, so app is app[/appinstance] */
-               if(slash3)
+               if(slash4)
+                       appnamelen = slash4-p;
+               else if(slash3)
                        appnamelen = slash3-p;
                else if(slash2)
                        appnamelen = slash2-p;