From 1953bb845860384054e9ac5b0c960f1edbe1c2c1 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 2 Sep 2015 07:55:42 +0200 Subject: [PATCH] ipc: Disconnect on invalid data. --- qutebrowser/misc/ipc.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qutebrowser/misc/ipc.py b/qutebrowser/misc/ipc.py index 535ef1ca9..98ca5150e 100644 --- a/qutebrowser/misc/ipc.py +++ b/qutebrowser/misc/ipc.py @@ -206,6 +206,8 @@ class IPCServer(QObject): log.ipc.debug("invalid data: {}".format( binascii.hexlify(data))) self.got_invalid_data.emit() + self._socket.error.connect(self.on_error) + self._socket.disconnectFromServer() return log.ipc.debug("Processing: {}".format(decoded)) try: @@ -214,6 +216,8 @@ class IPCServer(QObject): log.ipc.error("Ignoring invalid IPC data.") log.ipc.debug("invalid json: {}".format(decoded.strip())) self.got_invalid_data.emit() + self._socket.error.connect(self.on_error) + self._socket.disconnectFromServer() return try: args = json_data['args'] @@ -221,6 +225,8 @@ class IPCServer(QObject): log.ipc.error("Ignoring invalid IPC data.") log.ipc.debug("no args: {}".format(decoded.strip())) self.got_invalid_data.emit() + self._socket.error.connect(self.on_error) + self._socket.disconnectFromServer() return cwd = json_data.get('cwd', None) self.got_args.emit(args, cwd)