updates to logging to fix race condition

This commit is contained in:
Michel Oosterhof 2015-03-11 13:46:14 +00:00
parent 35d853c8b9
commit 8733cca515
2 changed files with 4 additions and 2 deletions

View File

@ -60,8 +60,10 @@ class HoneyPotBaseProtocol(insults.TerminalProtocol):
s.close()
# this is only called on explicit logout, not on disconnect
# this indicates the closing of the channel/session, not the closing of the connection
def connectionLost(self, reason):
log.msg( eventid='KIPP0011', format='Connection lost')
pass
#log.msg( eventid='KIPP0013', format='Session closed')
# not sure why i need to do this:
# scratch that, these don't seem to be necessary anymore:
#del self.fs

View File

@ -227,12 +227,12 @@ class HoneyPotTransport(sshserver.KippoSSHServerTransport):
# this seems to be the only reliable place of catching lost connection
def connectionLost(self, reason):
log.msg( "Connection Lost in SSH Transport" )
for i in self.interactors:
i.sessionClosed()
if self.transport.sessionno in self.factory.sessions:
del self.factory.sessions[self.transport.sessionno]
sshserver.KippoSSHServerTransport.connectionLost(self, reason)
log.msg( eventid='KIPP0011', format='Connection lost')
class HoneyPotSSHSession(session.SSHSession):