imager: catch BrokenPipeError
This commit is contained in:
parent
83f45d6c2f
commit
736a09ff5f
|
@ -99,14 +99,13 @@ class StreamingHandler(http.server.BaseHTTPRequestHandler):
|
||||||
output.condition.wait()
|
output.condition.wait()
|
||||||
frame = output.frame
|
frame = output.frame
|
||||||
self.wfile.write(b"--FRAME\r\n")
|
self.wfile.write(b"--FRAME\r\n")
|
||||||
# TODO exception BrokenPipeError here
|
|
||||||
self.send_header("Content-Type", "image/jpeg")
|
self.send_header("Content-Type", "image/jpeg")
|
||||||
self.send_header("Content-Length", len(frame))
|
self.send_header("Content-Length", len(frame))
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
self.wfile.write(frame)
|
self.wfile.write(frame)
|
||||||
self.wfile.write(b"\r\n")
|
self.wfile.write(b"\r\n")
|
||||||
except Exception as e:
|
except BrokenPipeError as e:
|
||||||
logger.exception(f"Removed streaming client {self.client_address}")
|
logger.info(f"Removed streaming client {self.client_address}")
|
||||||
else:
|
else:
|
||||||
self.send_error(404)
|
self.send_error(404)
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
|
|
Loading…
Reference in a new issue