Add log lines

This commit is contained in:
Erik Johnston 2017-04-05 17:13:44 +01:00
parent ea0152b132
commit fcc803b2bf
1 changed files with 2 additions and 1 deletions

View File

@ -220,6 +220,7 @@ class BaseReplicationStreamProtocol(LineOnlyReceiver):
logger.exception("[%s] Failed to handle line: %r", self.id(), line) logger.exception("[%s] Failed to handle line: %r", self.id(), line)
def close(self): def close(self):
logger.warn("[%s] Closing connection", self.id())
self.time_we_closed = self.clock.time_msec() self.time_we_closed = self.clock.time_msec()
self.transport.loseConnection() self.transport.loseConnection()
self.on_connection_closed() self.on_connection_closed()
@ -505,7 +506,7 @@ class ClientReplicationStreamProtocol(BaseReplicationStreamProtocol):
def on_SERVER(self, cmd): def on_SERVER(self, cmd):
if cmd.data != self.server_name: if cmd.data != self.server_name:
logger.error("[%s] Connected to wrong remote: %r", self.id(), cmd.data) logger.error("[%s] Connected to wrong remote: %r", self.id(), cmd.data)
self.transport.abortConnection() self.send_error("Wrong remote")
def on_RDATA(self, cmd): def on_RDATA(self, cmd):
try: try: