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
43c9a04c
Commit
43c9a04c
authored
Jul 20, 2009
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
socket: improve converting SSL.Error to sslerror
parent
43cc056e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
gevent/socket.py
gevent/socket.py
+9
-2
No files found.
gevent/socket.py
View file @
43c9a04c
...
@@ -250,6 +250,9 @@ class GreenSocket(object):
...
@@ -250,6 +250,9 @@ class GreenSocket(object):
return
self
.
timeout
return
self
.
timeout
SysCallError_code_mapping
=
{
-
1
:
8
}
class
GreenSSL
(
GreenSocket
):
class
GreenSSL
(
GreenSocket
):
is_secure
=
True
is_secure
=
True
...
@@ -297,7 +300,8 @@ class GreenSSL(GreenSocket):
...
@@ -297,7 +300,8 @@ class GreenSSL(GreenSocket):
except
SSL
.
WantWriteError
:
except
SSL
.
WantWriteError
:
wait_writer
(
self
.
fileno
())
wait_writer
(
self
.
fileno
())
except
SSL
.
SysCallError
,
ex
:
except
SSL
.
SysCallError
,
ex
:
# XXX fix ex[0]
raise
sslerror
(
SysCallError_code_mapping
.
get
(
ex
.
args
[
0
],
ex
.
args
[
0
]),
ex
.
args
[
1
])
except
SSL
.
Error
,
ex
:
raise
sslerror
(
str
(
ex
))
raise
sslerror
(
str
(
ex
))
def
connect
(
self
,
*
args
):
def
connect
(
self
,
*
args
):
...
@@ -332,7 +336,10 @@ class GreenSSL(GreenSocket):
...
@@ -332,7 +336,10 @@ class GreenSSL(GreenSocket):
except
SSL
.
SysCallError
,
e
:
except
SSL
.
SysCallError
,
e
:
if
e
[
0
]
==
-
1
or
e
[
0
]
>
0
:
if
e
[
0
]
==
-
1
or
e
[
0
]
>
0
:
return
''
return
''
raise
sslerror
(
str
(
e
))
except
SSL
.
SysCallError
,
ex
:
raise
sslerror
(
SysCallError_code_mapping
.
get
(
ex
.
args
[
0
],
ex
.
args
[
0
]),
ex
.
args
[
1
])
except
SSL
.
Error
,
ex
:
raise
sslerror
(
str
(
ex
))
# NOTE: read() in SSLObject does not have the semantics of file.read
# NOTE: read() in SSLObject does not have the semantics of file.read
# reading here until we have buflen bytes or hit EOF is an error
# reading here until we have buflen bytes or hit EOF is an error
...
...
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