Commit e2e9c2f5 authored by Julien Muchembled's avatar Julien Muchembled

Use ProtocolError instead of Notify for unexpected answers, and drop Notify

parent b27db46f
......@@ -138,7 +138,7 @@ class HandlerSwitcher(object):
else:
logging.error('Unexpected answer %r in %r', packet, connection)
if not connection.isClosed():
connection.send(Packets.Notify(
connection.answer(Errors.ProtocolError(
'Unexpected answer: %r' % packet))
connection.abort()
finally:
......
......@@ -198,9 +198,6 @@ class EventHandler(object):
# to test/maintain underlying connection.
pass
def notify(self, conn, message):
logging.warning('notification from %r: %s', conn, message)
def closeClient(self, conn):
conn.server = False
if not conn.client:
......
......@@ -663,14 +663,6 @@ PFOidList = PList('oid_list',
# packets definition
class Notify(Packet):
"""
General purpose notification (remote logging)
"""
_fmt = PStruct('notify',
PString('message'),
)
class Error(Packet):
"""
Error is a special type of message, because this can be sent against
......@@ -1677,8 +1669,6 @@ class Packets(dict):
Ping)
CloseClient = register(
CloseClient)
Notify = register(
Notify)
AskPrimary, AnswerPrimary = register(
PrimaryMaster)
NotPrimaryMaster = register(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment