Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
ce608653
Commit
ce608653
authored
Feb 25, 2019
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error handling when setting up a listening connector
getAddress (via __repr__) raised EBADF on closed connectors.
parent
1a070186
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
neo/lib/connector.py
neo/lib/connector.py
+6
-6
No files found.
neo/lib/connector.py
View file @
ce608653
...
...
@@ -127,6 +127,7 @@ class SocketConnector(object):
self
.
_bind
(
self
.
addr
)
self
.
socket
.
listen
(
self
.
SOMAXCONN
)
except
socket
.
error
,
e
:
self
.
is_closed
=
True
self
.
socket
.
close
()
self
.
_error
(
'listen'
,
e
)
...
...
@@ -220,12 +221,13 @@ class SocketConnector(object):
def
__repr__
(
self
):
if
self
.
is_closed
is
None
:
state
=
'never opened'
state
=
'
,
never opened'
else
:
if
self
.
is_closed
:
state
=
'closed '
state
=
'
,
closed '
else
:
state
=
'opened '
state
=
' fileno %s %s, opened '
%
(
self
.
socket_fd
,
self
.
getAddress
())
if
self
.
is_server
is
None
:
state
+=
'listening'
else
:
...
...
@@ -234,9 +236,7 @@ class SocketConnector(object):
else
:
state
+=
'to '
state
+=
str
(
self
.
addr
)
return
'<%s at 0x%x fileno %s %s, %s>'
%
(
self
.
__class__
.
__name__
,
id
(
self
),
'?'
if
self
.
is_closed
else
self
.
socket_fd
,
self
.
getAddress
(),
state
)
return
'<%s at 0x%x%s>'
%
(
self
.
__class__
.
__name__
,
id
(
self
),
state
)
class
SocketConnectorIPv4
(
SocketConnector
):
" Wrapper for IPv4 sockets"
...
...
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