rename ctrl_c to handle_CTRL_C

This commit is contained in:
Michel Oosterhof
2015-08-27 16:50:35 +04:00
parent 9acee60fe7
commit 0de25af036
5 changed files with 6 additions and 6 deletions

View File

@@ -350,7 +350,7 @@ class command_yes(HoneyPotCommand):
self.writeln('y')
self.scheduled = reactor.callLater(0.01, self.y)
def ctrl_c(self):
def handle_CTRL_C(self):
self.scheduled.cancel()
self.exit()
commands['/usr/bin/yes'] = command_yes

View File

@@ -136,7 +136,7 @@ class command_curl(HoneyPotCommand):
host, port, factory, bindAddress=out_addr)
return factory.deferred
def ctrl_c(self):
def handle_CTRL_C(self):
self.writeln('^C')
self.connection.transport.loseConnection()

View File

@@ -123,7 +123,7 @@ class command_gcc(HoneyPotCommand):
else:
self.no_files()
def ctrl_c(self):
def handle_CTRL_C(self):
""" Make sure the scheduled call will be canceled """
if getattr(self, 'scheduled', False):

View File

@@ -63,7 +63,7 @@ class command_ping(HoneyPotCommand):
self.count += 1
self.scheduled = reactor.callLater(1, self.showreply)
def ctrl_c(self):
def handle_CTRL_C(self):
self.scheduled.cancel()
self.writeln('--- %s ping statistics ---' % self.host)
self.writeln('%d packets transmitted, %d received, 0%% packet loss, time 907ms' % \

View File

@@ -47,7 +47,7 @@ def splitthousands( s, sep=','):
class command_wget(HoneyPotCommand):
def start(self):
try:
optlist, args = getopt.getopt(self.args, 'cO:')
optlist, args = getopt.getopt(self.args, 'cqO:')
except getopt.GetoptError as err:
self.writeln('Unrecognized option')
self.exit()
@@ -136,7 +136,7 @@ class command_wget(HoneyPotCommand):
host, port, factory, bindAddress=out_addr)
return factory.deferred
def ctrl_c(self):
def handle_CTRL_C(self):
self.writeln('^C')
self.connection.transport.loseConnection()