def process_command(self, cmd, *args, **kwargs): FTPHandler.process_command(self, cmd, *args, **kwargs) ts = datetime.now() last_response = None if self._last_response: last_response = self._last_response entry = ("POST", str(ts), self.remote_ip, self.remote_port, (cmd, last_response)) FTPSchemeDetectionHandler.db.append(entry)
def process_command(self, cmd, *args, **kwargs): """ Flush the FS cache with every new FTP command (non-shared cache). Also track the remote ip to set the X-Forwarded-For header. """ if self.fs: if self.fs.memcache_hosts is None: self.fs.flush() self.fs.conn.real_ip = self.remote_ip FTPHandler.process_command(self, cmd, *args, **kwargs)
def process_command(self, *args, **kwargs): # increase counter for every received command self.processed_cmds += 1 FTPHandler.process_command(self, *args, **kwargs)