From 2df9598774dfff1782db9804ae79e7ace8425f2e Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Sat, 8 Jul 2017 07:33:29 +0200 Subject: [PATCH] Asyncore update: Fix incoming connections - dereferencing wasn't done correctly for incoming connections --- src/network/receivequeuethread.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/network/receivequeuethread.py b/src/network/receivequeuethread.py index 5e707398..6a2ebb65 100644 --- a/src/network/receivequeuethread.py +++ b/src/network/receivequeuethread.py @@ -35,26 +35,25 @@ class ReceiveQueueThread(threading.Thread, StoppableThread): # cycle as long as there is data # methods should return False if there isn't enough data, or the connection is to be aborted - # state_* methods should return False if there isn't enough data, - # or the connection is to be aborted + # state_* methods should return False if there isn't enough data, + # or the connection is to be aborted try: BMConnectionPool().inboundConnections[dest].process() except KeyError: - pass + try: + BMConnectionPool().inboundConnections[dest.host].process() + except KeyError: + pass except AttributeError: - logger.error("Unknown state %s, ignoring", connection.state) + pass try: BMConnectionPool().outboundConnections[dest].process() - except KeyError: + except (KeyError, AttributeError): pass - except AttributeError: - logger.error("Unknown state %s, ignoring", connection.state) try: BMConnectionPool().udpSockets[dest].process() - except KeyError: + except (KeyError, AttributeError): pass - except AttributeError: - logger.error("Unknown state %s, ignoring", connection.state)