fix: 静默 BrokenPipeError 因为后关server

This commit is contained in:
2026-04-02 22:49:25 +08:00
parent c7b995efd7
commit 0f2405cb04
2 changed files with 10 additions and 4 deletions

View File

@@ -971,8 +971,11 @@ class OmniDaemonHTTPHandler(BaseHTTPRequestHandler):
self.send_header("Content-Length", str(len(payload)))
self.send_header("Cache-Control", "no-store")
self.send_header("Connection", "keep-alive")
self.end_headers()
self.wfile.write(payload)
try:
self.end_headers()
self.wfile.write(payload)
except (BrokenPipeError, ConnectionResetError):
return
class ASideOmniDaemon: