Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
8c9cf2e2
Commit
8c9cf2e2
authored
Apr 16, 2015
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make most of the tests pass again with the ssl279 code.
parent
b6fcd5e4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
gevent/_sslgte279.py
gevent/_sslgte279.py
+25
-4
No files found.
gevent/_sslgte279.py
View file @
8c9cf2e2
...
...
@@ -30,6 +30,7 @@ __imports__ = []
# Import all symbols from Python's ssl.py, except those that we are implementing
# and "private" symbols.
value
=
None
for
name
in
dir
(
__ssl__
):
if
name
in
__implements__
:
continue
...
...
@@ -41,6 +42,11 @@ for name in dir(__ssl__):
del
name
,
value
try
:
_delegate_methods
except
NameError
:
# PyPy doesn't expose this detail
_delegate_methods
=
(
'recv'
,
'recvfrom'
,
'recv_into'
,
'recvfrom_into'
,
'send'
,
'sendto'
)
__all__
=
__implements__
+
__imports__
orig_SSLContext
=
__ssl__
.
SSLContext
...
...
@@ -166,7 +172,6 @@ class SSLSocket(socket):
server_hostname
=
None
,
_context
=
None
):
self
.
_makefile_refs
=
0
if
_context
:
self
.
_context
=
_context
else
:
...
...
@@ -197,7 +202,10 @@ class SSLSocket(socket):
# mixed in.
if
sock
.
getsockopt
(
SOL_SOCKET
,
SO_TYPE
)
!=
SOCK_STREAM
:
raise
NotImplementedError
(
"only stream sockets are supported"
)
socket
.
__init__
(
self
,
_sock
=
sock
.
_sock
)
socket
.
__init__
(
self
,
_sock
=
sock
)
if
PYPY
:
sock
.
_drop
()
# The initializer for socket overrides the methods send(), recv(), etc.
# in the instancce, which we don't need -- but we want to provide the
# methods defined in SSLSocket.
...
...
@@ -243,6 +251,8 @@ class SSLSocket(socket):
except
socket_error
as
x
:
self
.
close
()
raise
x
self
.
_makefile_refs
=
0
@
property
def
context
(
self
):
...
...
@@ -469,6 +479,17 @@ class SSLSocket(socket):
else
:
self
.
_makefile_refs
-=
1
if
PYPY
:
def
_reuse
(
self
):
self
.
_makefile_refs
+=
1
def
_drop
(
self
):
if
self
.
_makefile_refs
<
1
:
self
.
close
()
else
:
self
.
_makefile_refs
-=
1
def
_sslobj_shutdown
(
self
):
while
True
:
try
:
...
...
@@ -571,7 +592,7 @@ class SSLSocket(socket):
"""Make and return a file-like object that
works with the SSL connection. Just use the code
from the socket module."""
if
not
PYPY
:
self
.
_makefile_refs
+=
1
# close=True so as to decrement the reference count when done with
# the file-like object.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment