mirror of https://github.com/cowrie/cowrie.git
updates to logging to fix race condition
This commit is contained in:
parent
35d853c8b9
commit
8733cca515
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
||||
|
|
Loading…
Reference in New Issue