Keep scanner probes and dropped connections out of the sync log.

This commit is contained in:
RallyBlock committed 2026-10-22 20:46:33 -07:00
1 parent ee1079a079
commit 0224e8f395
1 file changed
+16
+16
View File
@@ -355,6 +355,22 @@ def sync_body(payload, db=None):
class Handler(BaseHTTPRequestHandler):
protocol_version = "HTTP/1.1"
def handle(self):
try:
super().handle()
except (ConnectionError, TimeoutError):
return
def send_error(self, code, message=None, explain=None):
try:
self.close_connection = True
self.send_response_only(code)
self.send_header("Content-Length", "0")
self.send_header("Connection", "close")
self.end_headers()
except (ConnectionError, TimeoutError):
self.close_connection = True
def log_message(self, fmt, *args):
sys.stdout.write("%s - %s\n" % (self.address_string(), fmt % args))