]> granicus.if.org Git - rtmpdump/commitdiff
Skip leading dot in filenames
authorhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Sat, 9 Jan 2010 07:00:31 +0000 (07:00 +0000)
committerhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Sat, 9 Jan 2010 07:00:31 +0000 (07:00 +0000)
git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@226 400ebc74-4327-4243-bc38-086b20814532

rtmpsuck.c

index 2b0fc66417d2b39f77dc5c156032c67e03425e7f..782f2a722816d4a90dd17f6780cdcc9459e18fdc 100644 (file)
@@ -325,9 +325,11 @@ ServeInvoke(STREAMING_SERVER *server, int which, RTMPPacket *pack, const char *b
           if (AVMATCH(&av, &fl->f_path))
             count++;
         }
+      /* strip trailing URL parameters */
       q = memchr(av.av_val, '?', av.av_len);
       if (q)
         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 == '/')
           {
@@ -336,6 +338,12 @@ ServeInvoke(STREAMING_SERVER *server, int which, RTMPPacket *pack, const char *b
             av.av_val = p;
             break;
           }
+      /* skip leading dot */
+      if (av.av_val[0] == '.')
+        {
+          av.av_val++;
+          av.av_len--;
+        }
       flen = av.av_len;
       /* hope there aren't more than 255 dups */
       if (count)
@@ -1096,7 +1104,7 @@ main(int argc, char **argv)
   LogPrintf("RTMP Proxy Server %s\n", RTMPDUMP_VERSION);
   LogPrintf("(c) 2010 Andrej Stepanchuk, Howard Chu; license: GPL\n\n");
 
-  debuglevel = LOGDEBUG;
+  debuglevel = LOGINFO;
 
   if (argc > 1 && !strcmp(argv[1], "-z"))
     debuglevel = LOGALL;