]> git.sesse.net Git - vlc/commitdiff
Don't claim to support HTTP 1.x where x > 1
authorRémi Denis-Courmont <rem@videolan.org>
Sun, 2 Sep 2007 08:51:01 +0000 (08:51 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sun, 2 Sep 2007 08:51:01 +0000 (08:51 +0000)
include/vlc_httpd.h
src/network/httpd.c

index e01e4d1006d0ac3fa4e315cd3e12143bdb2541e6..1fd82248aae1e4e26aac3dfb75f166f18beb45e1 100644 (file)
@@ -67,9 +67,9 @@ struct httpd_message_t
 {
     httpd_client_t *cl; /* NULL if not throught a connection e vlc internal */
 
-    int     i_type;
-    int     i_proto;
-    int     i_version;
+    uint8_t i_type;
+    uint8_t i_proto;
+    uint8_t i_version;
 
     /* for an answer */
     int     i_status;
index a2bc884fcff93c5772822c4501d866217117e1ee..227ff2b7ae84d6cd30f069877e44d4c01bc36ef2 100644 (file)
@@ -399,7 +399,7 @@ httpd_FileCallBack( httpd_callback_sys_t *p_sys, httpd_client_t *cl,
         return VLC_SUCCESS;
     }
     answer->i_proto  = HTTPD_PROTO_HTTP;
-    answer->i_version= query->i_version;
+    answer->i_version= (query->i_version > 1) ? 1 : query->i_version;
     answer->i_type   = HTTPD_MSG_ANSWER;
 
     answer->i_status = 200;
@@ -642,8 +642,8 @@ static int httpd_RedirectCallBack( httpd_callback_sys_t *p_sys,
     {
         return VLC_SUCCESS;
     }
-    answer->i_proto  = query->i_proto;
-    answer->i_version= query->i_version;
+    answer->i_proto  = HTTPD_PROTO_HTTP;
+    answer->i_version= (query->i_version > 1) ? 1 : query->i_version;
     answer->i_type   = HTTPD_MSG_ANSWER;
     answer->i_status = 301;
 
@@ -1286,7 +1286,7 @@ void httpd_MsgInit( httpd_message_t *msg )
     msg->cl         = NULL;
     msg->i_type     = HTTPD_MSG_NONE;
     msg->i_proto    = HTTPD_PROTO_NONE;
-    msg->i_version  = -1;
+    msg->i_version  = -1; /* FIXME */
 
     msg->i_status   = 0;
 
@@ -1825,8 +1825,8 @@ static void httpd_ClientSend( httpd_client_t *cl )
         }
         p = (char *)cl->p_buffer;
 
-        p += sprintf( p, "%s/1.%d %d %s\r\n",
-                      cl->answer.i_proto ==  HTTPD_PROTO_HTTP ? "HTTP" : "RTSP",
+        p += sprintf( p, "%s.%u %d %s\r\n",
+                      cl->answer.i_proto ==  HTTPD_PROTO_HTTP ? "HTTP/1" : "RTSP/1",
                       cl->answer.i_version,
                       cl->answer.i_status, psz_status );
         for( i = 0; i < cl->answer.i_name; i++ )
@@ -2043,7 +2043,7 @@ static void httpd_HostThread( httpd_host_t *host )
                     const char *psz;
 
                     /* unimplemented */
-                    answer->i_proto  = query->i_proto ;
+                    answer->i_proto  = query->i_proto;
                     answer->i_type   = HTTPD_MSG_ANSWER;
                     answer->i_version= 0;