home
·
contact
·
privacy
projects
/
plomlombot-irc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix crash on server connect error.
[plomlombot-irc.git]
/
plomlombot.py
diff --git
a/plomlombot.py
b/plomlombot.py
index ac78be9fa88d967fd5e71b6cbd37bfa710c17787..80def0db6990eba4dd76fd180529e648cf8c3883 100755
(executable)
--- a/
plomlombot.py
+++ b/
plomlombot.py
@@
-118,7
+118,10
@@
class IO:
self.line_buffer = []
self.rune_buffer = ""
self.last_pong = time.time()
self.line_buffer = []
self.rune_buffer = ""
self.last_pong = time.time()
- self.servername = self.recv_line(send_ping=False).split(" ")[0][1:]
+ line = self.recv_line(send_ping=False)
+ if not line or len(line) < 1:
+ raise ExceptionForRestart
+ self.servername = line.split(" ")[0][1:]
def _pingtest(self, send_ping=True):
if self.last_pong + self.timeout < time.time():
def _pingtest(self, send_ping=True):
if self.last_pong + self.timeout < time.time():
@@
-488,7
+491,7
@@
class Session:
notice("maximum number of urls to parse per message "
"reached")
break
notice("maximum number of urls to parse per message "
"reached")
break
- if "!" == msg[0] and len(
tokens
) > 1:
+ if "!" == msg[0] and len(
msg
) > 1:
tokens = msg[1:].split()
argument = str.join(" ", tokens[1:])
handle_command(tokens[0], argument, notice, target, self)
tokens = msg[1:].split()
argument = str.join(" ", tokens[1:])
handle_command(tokens[0], argument, notice, target, self)