]> git.sesse.net Git - vlc/commitdiff
Ignore leading "white" characters in HTTP and RTSP requests
authorRémi Denis-Courmont <rem@videolan.org>
Mon, 24 Sep 2007 16:22:33 +0000 (16:22 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Mon, 24 Sep 2007 16:22:33 +0000 (16:22 +0000)
src/network/httpd.c

index b8e76a2530b6f9ae4a7d663ba1b7f601b31e4924..62e34f532a58917f04c7d5a4b0be7d65747676ac 100644 (file)
@@ -1500,6 +1500,21 @@ static void httpd_ClientRecv( httpd_client_t *cl )
 {
     int i_len;
 
+    /* ignore leading whites */
+    if( ( cl->query.i_proto == HTTPD_PROTO_NONE ) &&
+        ( cl->i_buffer == 0 ) )
+    {
+        unsigned char c;
+
+        i_len = httpd_NetRecv( cl, &c, 1 );
+
+        if( ( i_len > 0 ) && ( strchr( "\r\n\t ", c ) == NULL ) )
+        {
+            cl->p_buffer[0] = c;
+            cl->i_buffer++;
+        }
+    }
+    else
     if( cl->query.i_proto == HTTPD_PROTO_NONE )
     {
         /* enough to see if it's Interleaved RTP over RTSP or RTSP/HTTP */