[Patches] [ python-Patches-430706 ] Persistent connections in BaseHTTPServer

noreply@sourceforge.net noreply@sourceforge.net
Tue, 04 Sep 2001 04:40:44 -0700


Patches item #430706, was opened at 2001-06-06 08:33
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=430706&group_id=5470

Category: library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Chris Lawrence (lordsutch)
Assigned to: Martin v. Löwis (loewis)
Summary: Persistent connections in BaseHTTPServer

Initial Comment:
This patch provides HTTP/1.1 persistent 
connection support in BaseHTTPServer.py.  It is 
not enabled by default (for backwards 
compatibility) because Content-Length headers 
must be supplied for persistent connections to 
work correctly.

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2001-09-04 04:40

Message:
Logged In: YES 
user_id=21627

The patch in its current form seems to be broken. To see the
problem, please run SimpleHTTPServer on some directory, then
access it with a HTTP/1.1 client (e.g. Netscape 4.7).

The server will use the protocol version HTTP/1.0, but the
client will initially send 1.1, and send a Connection:
Keep-alive header. As a result, self.close_connection is set
to 0, despite using HTTP/1.0. In turn, the HTTP server won't
send a content length, and won't close the connection
either. Netscape waits forever from some completion which
never occurs, since the server waits for the next request on
the same connection.

It might be useful to enhance the SimpleHTTPServer test()
function to optionally operate in HTTP/1.1 mode (including
sending a proper ContentLength). Doing the same for the CGI
HTTP server is probably less useful.


----------------------------------------------------------------------

Comment By: Chris Lawrence (lordsutch)
Date: 2001-08-29 20:21

Message:
Logged In: YES 
user_id=6757

I have updated the patch against current CVS and have added
documentation.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2001-08-08 13:43

Message:
Logged In: YES 
user_id=21627

I haven't studied the patch in detail, yet, but I have a 
few comments on the style:

- there is no need to quote all authors of the RFC. Also,
  the reference to long-ago expired HTTP draft should go;
  just replace it with a single reference to the RFC
  number (giving an URL for the RFC might be convenient)
- Where is the documentation? A patch to 
Doc/lib/libbasehttp.tex would be appreciated. If you don't 
speak TeX, don't worry: Just write plain text, we'll do 
the mark-up.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=430706&group_id=5470