[Python-Dev] more on httplib
Greg Stein
gstein@lyra.org
Sat, 3 Jun 2000 16:13:55 -0700 (PDT)
I would like to propose a few changes to the (new) httplib:
*) drop HTTPS() -- this class isn't in 1.5.2, so there isn't a reason to
provide backwards-compat for it
*) revamp the pipeline support:
- record the "last response object" ... when a new getreply() is done,
then we store the "last" into response.prior
- reading of the "HTTP/1.1 <code> <msg>" line is deferred, and
performed by the response object
- the read of that line is lazy
- if the response line is read *before* the "prior" response (if any)
is "closed", then an exception is raised: ResponseNotReady
*) address some of Moshe's concerns:
- use class-based exceptions
- clarify that HTTPConnection is designed for *blocking* sockets
- conn.close() followed by conn.send() will reopen the socket. This
could lead to programming errors. I'll add a class-based default flag
to disable this behavior.
- in request(), we check for errno==32 ... what to do on Windows?
I will implement these changes in small chunks so that each can be
reviewed in my CVS repository. The history is available at:
http://www.lyra.org/cgi-bin/viewcvs.cgi/gjspy/httplib.py/
Cheers,
-g
--
Greg Stein, http://www.lyra.org/