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.

classification
Title: httplib : SSL fake sockets to close correctly
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: kxroberto, loewis
Priority: normal Keywords: patch

Created on 2005-10-01 17:21 by kxroberto, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg48820 - (view) Author: kxroberto (kxroberto) Date: 2005-10-01 17:21
[refers to bug #978833 ; ]

Now I managed to solve the problem for me with attached
patch of httplib.py: a explicit shutdown ( 2 or 1 ) of the
(faked) ssl'ed socket solves it definitely.
I still guess the ssl'ed socket (ssl dll) should do that
auto on sock.close() ; there may be still a bug in ssl.c . 

the original problem obviously only shows up with FTPS
connection (as described in the bug), which relies on
correct socket closing and also shows with certain
https firewalls/caches which cause a sslerror: (8, 'EOF
occurred in violation of protocol') .


*** \usr\src\py24old/httplib.py Sat Sep 24 21:35:28 2005
--- httplib.py  Sat Sep 24 21:37:48 2005
*************** class SharedSocket:
*** 899,904 ****
--- 899,905 ----
          self._refcnt -= 1
          assert self._refcnt >= 0
          if self._refcnt == 0:
+             self.sock.shutdown(2)
              self.sock.close()

      def __del__(self):
msg48821 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-04-04 18:47
The original problem is now being solved in a different way; rejecting this patch as out-of-date
History
Date User Action Args
2022-04-11 14:56:13adminsetgithub: 42439
2005-10-01 17:21:42kxrobertocreate