[project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-112]

add finish_subsystem()
when a SubsystemHandler is being decomissioned (the client has closed the
channel or transport, or the socket went away), make a callback to let the
handler do any shutdown it needs to.
This commit is contained in:
Robey Pointer 2004-11-22 07:07:08 +00:00
parent 961525f3d8
commit 611d66428e
1 changed files with 10 additions and 1 deletions

View File

@ -325,7 +325,7 @@ class SubsystemHandler (threading.Thread):
(self.__name, str(e))) (self.__name, str(e)))
self.__transport._log(ERROR, util.tb_strings()) self.__transport._log(ERROR, util.tb_strings())
try: try:
self.__channel.close() self.finish_subsystem()
except: except:
pass pass
@ -356,3 +356,12 @@ class SubsystemHandler (threading.Thread):
@type channel: L{Channel} @type channel: L{Channel}
""" """
pass pass
def finish_subsystem(self):
"""
Perform any cleanup at the end of a subsystem. The default
implementation just closes the channel.
@since: 1.1
"""
self.__channel.close()