diff options
author | Avery Pennarun <apenwarr@gmail.com> | 2010-12-11 17:27:12 -0800 |
---|---|---|
committer | Avery Pennarun <apenwarr@gmail.com> | 2010-12-11 17:27:12 -0800 |
commit | 41fd0348eb8f27d9c47d0b51c49fbf92d769ab5b (patch) | |
tree | ddcddbfd75f1ada616c83de219bf00056aa1a65e | |
parent | 1907048dad40c5cd6e8b13fe093b6cdf5598b9ff (diff) |
Fix a bug when packets are received on a channel after it closes.sshuttle-0.43a
Reported by cbowns.
-rw-r--r-- | ssnet.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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) |