[Patches] [Patch #101536] httplib should not close socket on zero-length response

noreply@sourceforge.net noreply@sourceforge.net
Wed, 20 Sep 2000 13:47:41 -0700


Patch #101536 has been updated. 

Project: 
Category: library
Status: Closed
Summary: httplib should not close socket on zero-length response

Follow-Ups:

Date: 2000-Sep-15 10:45
By: jhylton

Comment:
In the current httplib, an HTTPConnection object calls close on itself when it receives a response with a content-length == 0.  I don't think this is a good feature and it is not backwards compatible with the old httplib, which left the socket open.

We have had problems with clients of httplib that expect to always read whatever message body is returned.  Reading from a socket with no data returns '' (and len('') == 0) which seems completely correct.  This patch restores the old behavior and lets clients like urllib call read for any valid response.

This patch also restores the set_debuglevel feature.  I don't care much if this is included or not, but it added to debug the other problem and it was helpful for that.

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

Date: 2000-Sep-18 15:47
By: jhylton

Comment:
(Greg is on vacation until after 2.0b2.)

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

Date: 2000-Sep-18 15:51
By: jhylton

Comment:
Applied in rev. 1.22 of httplib.py

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

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=101536&group_id=5470