From 9a53ff42a920e015b819f762d916604289f15502 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 6 Mar 2014 20:21:02 -0800 Subject: [PATCH] irkerd: Store less state in IRCServerConnection.connect() We will never need the connection-time port, server_address, username, ircname, or password again, so don't store them. We *do* need server and real_server_name for Event handling, so keep them around. --- irkerd | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/irkerd b/irkerd index a71c841..65828a6 100755 --- a/irkerd +++ b/irkerd @@ -214,23 +214,18 @@ class IRCServerConnection(): self.event_handlers = {} self.real_server_name = "" self.server = server - self.port = port - self.server_address = (server, port) self.nickname = nickname - self.username = username or nickname - self.ircname = ircname or nickname - self.password = password try: self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.socket.bind(('', 0)) - self.socket.connect(self.server_address) + self.socket.connect((server, port)) except socket.error as err: raise IRCServerConnectionError("Couldn't connect to socket: %s" % err) - if self.password: - self.ship("PASS " + self.password) + if password: + self.ship("PASS " + password) self.nick(self.nickname) - self.user(self.username, self.ircname) + self.user(username=username or ircname, realname=ircname or nickname) return self def close(self): -- 2.26.2