From bc9863d9e0d65831cb82f39313c734f825c5315e Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 17 Jul 2015 16:20:41 -0700 Subject: [PATCH] Make reconnecting a bit less... broken --- main.py | 2 +- plugins/relay.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 8d847de..e620d20 100755 --- a/main.py +++ b/main.py @@ -107,7 +107,7 @@ class Irc(): log.debug('(%s) self.pingtimeout: %s', self.name, self.pingtimeout) data = self.socket.recv(2048).decode("utf-8") buf += data - if not data: + if self.connected and not data: break while '\n' in buf: line, buf = buf.split('\n', 1) diff --git a/plugins/relay.py b/plugins/relay.py index 98e1b9f..dc0f889 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -19,7 +19,7 @@ def normalizeNick(irc, netname, nick, separator="/"): # Block until we know the IRC network's nick length (after capabilities # are sent) log.debug('(%s) normalizeNick: waiting for irc.connected', irc.name) - irc.connected.wait(3) + irc.connected.wait(1) orig_nick = nick protoname = irc.proto.__name__