This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tanakorn
Recipients tanakorn
Date 2011-01-24.10:51:43
SpamBayes Score 1.9134166e-06
Marked as misclassified No
Message-id <1295866303.79.0.709048263214.issue10993@psf.upfronthosting.co.za>
In-reply-to
Content
With this code on python 2.6, I found that HTTPSConnection does not close connection properly.

from httplib import HTTPSConnection

for i in range(1000):
  https = HTTPSConnection("google.com")
  https.connect()
  https.request("GET", "/")
  response = https.getresponse()
  response.close()
  https.close()
  print i

After searching python library, I guess that in ssl.py, implementation of close() method of SSLSocket is wrong.
socket.close(self) should not be called when self._makefile_refs < 1 but should be call when self._makefile_refs == 1, isn't it?
I modified the code, made the patch and attached it with this issue.
History
Date User Action Args
2011-01-24 10:51:43tanakornsetrecipients: + tanakorn
2011-01-24 10:51:43tanakornsetmessageid: <1295866303.79.0.709048263214.issue10993@psf.upfronthosting.co.za>
2011-01-24 10:51:43tanakornlinkissue10993 messages
2011-01-24 10:51:43tanakorncreate