[rtmpdump] [PATCH] Look for a fourth slash when splitting the url into app+playpath

Martin Storsjo martin at martin.st
Tue Oct 30 18:31:01 CET 2012


From: Björn Axelsson <bjorn.axelsson at intinor.se>

---
 librtmp/parseurl.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/librtmp/parseurl.c b/librtmp/parseurl.c
index 0183958..646c70c 100644
--- a/librtmp/parseurl.c
+++ b/librtmp/parseurl.c
@@ -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;
-- 
1.7.9.4



More information about the rtmpdump mailing list