Wrong HTTP version in responce on HTTP/1.0 GET

Olga Soiko <[email protected]> Thu, 04 May 2006 12:50:50 +0300
Newsgroups gmane.linux.upnp-sdk.general
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------050205080205020203040606
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: 7bit

According to "Use and Interpretation of HTTP Version Numbers" 
specification states that HTTP/1.1 servers should return HTTP/1.1
 even if the HTTP server  receives a request marked with HTTP/1.0.
I think changes should be maid in 'process_request' function after
'http_CalcResponseVersion' call. One of variants I'm sending.


--------------050205080205020203040606
Content-Type: text/plain;
 name="7.2.5.5.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="7.2.5.5.diff"

diff -Naur old/upnp/src/genlib/net/http/webserver.c new/upnp/src/genlib/net/http/webserver.c
--- old/upnp/src/genlib/net/http/webserver.c	2006-02-22 23:38:03 +0200
+++ new/upnp/src/genlib/net/http/webserver.c	2006-04-10 16:41:38 +0300
@@ -50,6 +50,7 @@
 #include <sys/stat.h>
 #include "ithread.h"
 #include "unixutil.h"
+#include "syslog.h"
 
 /*
    Response Types 
@@ -1208,6 +1209,12 @@
 
     http_CalcResponseVersion( req->major_version, req->minor_version,
                               &resp_major, &resp_minor );
+    if( req->method == HTTPMETHOD_GET ) {
+      if( ( req->major_version == 1 ) && ( req->minor_version == 0 ) ) {
+        resp_major = 1;
+        resp_minor = 1;
+      } 
+    }
 
     //
     // remove dots

--------------050205080205020203040606--


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642