Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
e2e9c2f5
Commit
e2e9c2f5
authored
Apr 25, 2017
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use ProtocolError instead of Notify for unexpected answers, and drop Notify
parent
b27db46f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
14 deletions
+1
-14
neo/lib/connection.py
neo/lib/connection.py
+1
-1
neo/lib/handler.py
neo/lib/handler.py
+0
-3
neo/lib/protocol.py
neo/lib/protocol.py
+0
-10
No files found.
neo/lib/connection.py
View file @
e2e9c2f5
...
@@ -138,7 +138,7 @@ class HandlerSwitcher(object):
...
@@ -138,7 +138,7 @@ class HandlerSwitcher(object):
else
:
else
:
logging
.
error
(
'Unexpected answer %r in %r'
,
packet
,
connection
)
logging
.
error
(
'Unexpected answer %r in %r'
,
packet
,
connection
)
if
not
connection
.
isClosed
():
if
not
connection
.
isClosed
():
connection
.
send
(
Packets
.
Notify
(
connection
.
answer
(
Errors
.
ProtocolError
(
'Unexpected answer: %r'
%
packet
))
'Unexpected answer: %r'
%
packet
))
connection
.
abort
()
connection
.
abort
()
finally
:
finally
:
...
...
neo/lib/handler.py
View file @
e2e9c2f5
...
@@ -198,9 +198,6 @@ class EventHandler(object):
...
@@ -198,9 +198,6 @@ class EventHandler(object):
# to test/maintain underlying connection.
# to test/maintain underlying connection.
pass
pass
def
notify
(
self
,
conn
,
message
):
logging
.
warning
(
'notification from %r: %s'
,
conn
,
message
)
def
closeClient
(
self
,
conn
):
def
closeClient
(
self
,
conn
):
conn
.
server
=
False
conn
.
server
=
False
if
not
conn
.
client
:
if
not
conn
.
client
:
...
...
neo/lib/protocol.py
View file @
e2e9c2f5
...
@@ -663,14 +663,6 @@ PFOidList = PList('oid_list',
...
@@ -663,14 +663,6 @@ PFOidList = PList('oid_list',
# packets definition
# packets definition
class
Notify
(
Packet
):
"""
General purpose notification (remote logging)
"""
_fmt
=
PStruct
(
'notify'
,
PString
(
'message'
),
)
class
Error
(
Packet
):
class
Error
(
Packet
):
"""
"""
Error is a special type of message, because this can be sent against
Error is a special type of message, because this can be sent against
...
@@ -1677,8 +1669,6 @@ class Packets(dict):
...
@@ -1677,8 +1669,6 @@ class Packets(dict):
Ping
)
Ping
)
CloseClient
=
register
(
CloseClient
=
register
(
CloseClient
)
CloseClient
)
Notify
=
register
(
Notify
)
AskPrimary
,
AnswerPrimary
=
register
(
AskPrimary
,
AnswerPrimary
=
register
(
PrimaryMaster
)
PrimaryMaster
)
NotPrimaryMaster
=
register
(
NotPrimaryMaster
=
register
(
...
...
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