forked from fedora-python/python26
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpython-2.6.6-ssl-connection-stays-open.patch
34 lines (31 loc) · 1.56 KB
/
python-2.6.6-ssl-connection-stays-open.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
diff -rup old/Python-2.6.6/Lib/ssl.py new/Python-2.6.6/Lib/ssl.py
--- old/Python-2.6.6/Lib/ssl.py 2010-04-28 00:05:18.000000000 +0200
+++ new/Python-2.6.6/Lib/ssl.py 2013-05-31 10:13:56.911553401 +0200
@@ -301,16 +301,20 @@ class SSLSocket(socket):
SSL channel, and the address of the remote client."""
newsock, addr = socket.accept(self)
- return (SSLSocket(newsock,
- keyfile=self.keyfile,
- certfile=self.certfile,
- server_side=True,
- cert_reqs=self.cert_reqs,
- ssl_version=self.ssl_version,
- ca_certs=self.ca_certs,
- do_handshake_on_connect=self.do_handshake_on_connect,
- suppress_ragged_eofs=self.suppress_ragged_eofs),
- addr)
+ try:
+ return (SSLSocket(newsock,
+ keyfile=self.keyfile,
+ certfile=self.certfile,
+ server_side=True,
+ cert_reqs=self.cert_reqs,
+ ssl_version=self.ssl_version,
+ ca_certs=self.ca_certs,
+ do_handshake_on_connect=self.do_handshake_on_connect,
+ suppress_ragged_eofs=self.suppress_ragged_eofs),
+ addr)
+ except socket_error as e:
+ newsock.close()
+ raise e
def makefile(self, mode='r', bufsize=-1):