From 1cf1e022a204c4da5051d61b56301755a869cb06 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Mon, 1 Sep 2003 16:14:04 +0000 Subject: [PATCH] Removed some debugging stuff (clearing msg.prefix before sending it) and added logging to match asyncoreDrivers and twistedDrivers. --- src/socketDrivers.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/socketDrivers.py b/src/socketDrivers.py index e34ce1050..b7f09c0d0 100644 --- a/src/socketDrivers.py +++ b/src/socketDrivers.py @@ -67,9 +67,6 @@ class SocketDriver(drivers.IrcDriver): while msgs[-1] is not None: msgs.append(self.irc.takeMsg()) del msgs[-1] - for msg in msgs: - msg.prefix = '' - msg._str = None self.outbuffer += ''.join(map(str, msgs)) if self.outbuffer: sent = self.conn.send(self.outbuffer) @@ -86,7 +83,10 @@ class SocketDriver(drivers.IrcDriver): lines = self.inbuffer.split('\n') self.inbuffer = lines.pop() for line in lines: + started = time.time() msg = ircmsgs.IrcMsg(line) + debug.msg('Time to parse IrcMsg: %s' % (time.time()-start), + 'verbose') self.irc.feedMsg(msg) except socket.timeout: pass @@ -108,7 +108,10 @@ class SocketDriver(drivers.IrcDriver): self.irc.reset() self.conn.close() self.connected = False - schedule.addEvent(self.reconnect, time.time()+300) + when = time.time() + 60 + whenS = time.strftime(conf.logTimestampFormat, time.localtime(when)) + debug.msg('Scheduling reconnect at %s' % whenS, 'normal') + schedule.addEvent(self.reconnect, when) Driver = SocketDriver