我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用http.server.BaseHTTPRequestHandler.handle()。
def handle(self): """Handles a request ignoring dropped connections.""" rv = None try: rv = BaseHTTPRequestHandler.handle(self) except (socket.error, socket.timeout) as e: self.connection_dropped(e) except Exception: if self.server.ssl_context is None or not is_ssl_error(): raise if self.server.shutdown_signal: self.initiate_shutdown() return rv
def handle(self): """Handles a request ignoring dropped connections.""" try: self.stager = self.server.stager self.shell = self.stager.shell self.options = copy.deepcopy(self.server.server.options) self.loader = core.loader self.shell.print_verbose("handler::handle() - Incoming HTTP from %s" % str(self.client_address)) return BaseHTTPRequestHandler.handle(self) except (socket.error, socket.timeout) as e: pass # except: # pass