From: RĂ©mi Denis-Courmont Date: Sun, 2 Sep 2007 08:51:01 +0000 (+0000) Subject: Don't claim to support HTTP 1.x where x > 1 X-Git-Tag: 0.9.0-test0~5923 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=50e9af20476418c62d01648e1fe4d3f51dd5cb07;p=vlc Don't claim to support HTTP 1.x where x > 1 --- diff --git a/include/vlc_httpd.h b/include/vlc_httpd.h index e01e4d1006..1fd82248aa 100644 --- a/include/vlc_httpd.h +++ b/include/vlc_httpd.h @@ -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; diff --git a/src/network/httpd.c b/src/network/httpd.c index a2bc884fcf..227ff2b7ae 100644 --- a/src/network/httpd.c +++ b/src/network/httpd.c @@ -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;