Keep scanner probes and dropped connections out of the sync log.
This commit is contained in:
1 parent
ee1079a079
commit
0224e8f395
1 file changed
+16
@@ -355,6 +355,22 @@ def sync_body(payload, db=None):
|
|||||||
class Handler(BaseHTTPRequestHandler):
|
class Handler(BaseHTTPRequestHandler):
|
||||||
protocol_version = "HTTP/1.1"
|
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):
|
def log_message(self, fmt, *args):
|
||||||
sys.stdout.write("%s - %s\n" % (self.address_string(), fmt % args))
|
sys.stdout.write("%s - %s\n" % (self.address_string(), fmt % args))
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user