classification
Title: httplib code thinks it closes connection, but does not
Type: behavior Stage: needs patch
Components: Library (Lib) Versions: Python 3.2, Python 3.1, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: orsenthil Nosy List: BreamoreBoy, dstanek, flox, gennad, jjlee, orsenthil, ysj.ray
Priority: normal Keywords:

Created on 2008-12-02 18:15 by jjlee, last changed 2011-03-20 14:40 by orsenthil.

Messages (3)
msg76764 - (view) Author: John J Lee (jjlee) Date: 2008-12-02 18:15
The fix for #900744 tried to close the connection when a bad chunk
length was received.  The comment inserted with that fix "close the
connection as protocol synchronisation is probably lost" is incorrect:
self.close() in _read_chunked does not close the connection.  You have
to call HTTPConnection.close() to close the connection.

So:

 * The comment is incorrect, and should be removed or fixed.  I guess
the self.close() should stay.

 * It's probably a bug that it doesn't result in the connection being
closed.  I guess a fix for that would be for the HTTPResponse to set
some state on itself that HTTPConnection can query so that
HTTPConnection can close itself the next time somebody tries to do
something with the connection.
msg109659 - (view) Author: Mark Lawrence (BreamoreBoy) Date: 2010-07-09 01:24
John could you provide a patch for this?
msg131487 - (view) Author: ysj.ray (ysj.ray) Date: 2011-03-20 12:09
Another fix could be making HTTPResponse to hold a reference to the HTTPConnection object and call its close() at the time of a bad chunk
length was received. This can close the connection as soon as possible.
History
Date User Action Args
2011-03-20 14:40:13orsenthilsetassignee: orsenthil

nosy: + orsenthil
2011-03-20 12:09:24ysj.raysetnosy: jjlee, dstanek, flox, ysj.ray, BreamoreBoy, gennad
messages: + msg131487
2011-03-17 14:58:24ysj.raysetnosy: + ysj.ray
2011-03-17 10:45:31gennadsetnosy: + gennad
2011-03-16 22:19:40floxsetnosy: + flox
2011-01-26 17:54:16dstaneksetnosy: + dstanek
2010-07-09 01:25:00BreamoreBoysetversions: + Python 3.1, Python 3.2, - Python 2.6, Python 3.0
nosy: + BreamoreBoy

messages: + msg109659

stage: needs patch
2008-12-02 18:15:19jjleecreate