[Patches] [ python-Patches-1310381 ] httplib : SSL fake sockets to close correctly

SourceForge.net noreply at sourceforge.net
Wed Apr 4 20:47:01 CEST 2007


Patches item #1310381, was opened at 2005-10-01 19:21
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1310381&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 2.4
>Status: Closed
>Resolution: Out of Date
Priority: 5
Private: No
Submitted By: kxroberto (kxroberto)
Assigned to: Nobody/Anonymous (nobody)
Summary: httplib : SSL fake sockets to close correctly

Initial Comment:
[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):

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

>Comment By: Martin v. Löwis (loewis)
Date: 2007-04-04 20:47

Message:
Logged In: YES 
user_id=21627
Originator: NO

The original problem is now being solved in a different way; rejecting
this patch as out-of-date

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1310381&group_id=5470


More information about the Patches mailing list