From 1dc2fa0424cc1b87fce5ca12bcd3eba7e34725b7 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Tue, 5 May 2015 10:59:37 +1200 Subject: pathoc: cope with errors during websocket frame read. --- libpathod/pathoc.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libpathod/pathoc.py') diff --git a/libpathod/pathoc.py b/libpathod/pathoc.py index 53ba4447..2574da6c 100644 --- a/libpathod/pathoc.py +++ b/libpathod/pathoc.py @@ -161,7 +161,11 @@ class WebsocketFrameReader(threading.Thread): pass for rfile in r: with self.log(rfile) as log: - frm = websockets.Frame.from_file(self.rfile) + try: + frm = websockets.Frame.from_file(self.rfile) + except tcp.NetLibError: + self.ws_read_limit = 0 + break log("<< %s"%frm.header.human_readable()) self.callback(frm) if self.ws_read_limit is not None: @@ -479,4 +483,3 @@ def main(args): # pragma: nocover pass if p: p.stop() - p.wait() -- cgit v1.2.3