diff options
author | Joel Rosdahl <joel@rosdahl.net> | 2003-09-18 18:22:22 +0000 |
---|---|---|
committer | Joel Rosdahl <joel@rosdahl.net> | 2011-08-21 15:53:49 +0200 |
commit | da59bba930de58cac33b219c2d2fb0ebd088710f (patch) | |
tree | 214b9015021b24db9ab558fffe4d1242e7e2eb39 /miniircd | |
parent | 10436ecc0669489df7d89540d76cbadb8707b62b (diff) | |
download | miniircd-da59bba930de58cac33b219c2d2fb0ebd088710f.tar.gz miniircd-da59bba930de58cac33b219c2d2fb0ebd088710f.zip |
Fix use of socket.getpeername() after socket has been closed
Also remember the port from the call in the constructor and use the
stored host and port when writing the disconnect message.
Diffstat (limited to 'miniircd')
-rwxr-xr-x | miniircd | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -59,7 +59,7 @@ class Client(object): self.__writebuffer = "" self.__nickname = None self.__user = None - self.__host = socket.getpeername()[0] + self.__host, self.__port = socket.getpeername() self.__realname = None self.__channels = {} # irc_lower(Channel name) --> Channel if self.__server.password: @@ -514,7 +514,7 @@ class Client(object): self.message("ERROR :%s" % quitmsg) addr = self.socket.getpeername() self.__server.printInfo("Disconnected connection from %s:%s." % ( - addr[0], addr[1])) + self.__host, self.__port)) self.socket.close() self.__server.removeClient(self, quitmsg) |