New submission from Tanakorn Leesatapornwongsa <tanakorn....@gmail.com>:

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.

----------
components: Library (Lib)
files: ssl.py.patch
keywords: patch
messages: 126919
nosy: tanakorn
priority: normal
severity: normal
status: open
title: HTTPSConnection does not close when call close() method
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file20501/ssl.py.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10993>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to