summaryrefslogtreecommitdiff
path: root/miniircd
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2012-07-01 18:23:12 +0200
committerJoel Rosdahl <joel@rosdahl.net>2012-07-01 18:37:14 +0200
commit57f15c089067fddd3d1a712c23f46fd31bba0276 (patch)
tree9ab6619a2e8c110b320523496be29123bbe03f15 /miniircd
parent5f64e56973deddd5f80ae0bf78cec2932fbb7b9a (diff)
downloadminiircd-57f15c089067fddd3d1a712c23f46fd31bba0276.tar.gz
miniircd-57f15c089067fddd3d1a712c23f46fd31bba0276.zip
Fix crash when the write queue for a disconnected client is non-empty
Reported by Jim Leonard.
Diffstat (limited to 'miniircd')
-rwxr-xr-xminiircd5
1 files changed, 3 insertions, 2 deletions
diff --git a/miniircd b/miniircd
index 4d6bfc9..c348520 100755
--- a/miniircd
+++ b/miniircd
@@ -1,7 +1,7 @@
#! /usr/bin/env python
# Hey, Emacs! This is -*-python-*-.
#
-# Copyright (C) 2003, 2011 Joel Rosdahl
+# Copyright (C) 2003, 2011-2012 Joel Rosdahl
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -753,7 +753,8 @@ class Server(object):
self.print_info("Accepted connection from %s:%s." % (
addr[0], addr[1]))
for x in owtd:
- self.clients[x].socket_writable_notification()
+ if x in self.clients: # client may have been disconnected
+ self.clients[x].socket_writable_notification()
now = time.time()
if last_aliveness_check + 10 < now:
for client in self.clients.values():