summaryrefslogtreecommitdiffstats
path: root/ssnet.py
diff options
context:
space:
mode:
Diffstat (limited to 'ssnet.py')
-rw-r--r--ssnet.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/ssnet.py b/ssnet.py
index 1577aa4..c06498f 100644
--- a/ssnet.py
+++ b/ssnet.py
@@ -350,8 +350,12 @@ class Mux(Handler):
else:
raise Exception('got CMD_HOST_LIST without got_host_list?')
else:
- callback = self.channels[channel]
- callback(cmd, data)
+ callback = self.channels.get(channel)
+ if not callback:
+ log('warning: closed channel %d got cmd=%s len=%d\n'
+ % (channel, cmd_to_name.get(cmd,hex(cmd)), len(data)))
+ else:
+ callback(cmd, data)
def flush(self):
self.wsock.setblocking(False)