summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2012-11-16 08:50:43 +0000
committerWill Thompson <will.thompson@collabora.co.uk>2012-11-16 08:50:43 +0000
commit452284ab9ed546a430cad13aeae4126cfcb616a2 (patch)
treeffcd491f7793f479f2a4342e9ce14fc61cec4154
parent3e3dd269f63f808049b4c7df5c7f1e50b7daedf2 (diff)
Parse PONG more leniently
-rw-r--r--src/idle-parser.c2
-rw-r--r--tests/twisted/connect/ping.py6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/idle-parser.c b/src/idle-parser.c
index 1699774..159e6cc 100644
--- a/src/idle-parser.c
+++ b/src/idle-parser.c
@@ -85,7 +85,7 @@ static const MessageSpec message_specs[] = {
{"NOTICE", "cIr:", IDLE_PARSER_PREFIXCMD_NOTICE_CHANNEL},
{"NOTICE", "cIc:", IDLE_PARSER_PREFIXCMD_NOTICE_USER},
{"PART", "cIr.", IDLE_PARSER_PREFIXCMD_PART},
- {"PONG", "IIs:", IDLE_PARSER_PREFIXCMD_PONG},
+ {"PONG", "IIs.", IDLE_PARSER_PREFIXCMD_PONG},
{"PRIVMSG", "cIr:", IDLE_PARSER_PREFIXCMD_PRIVMSG_CHANNEL},
{"PRIVMSG", "cIc:", IDLE_PARSER_PREFIXCMD_PRIVMSG_USER},
{"QUIT", "cI.", IDLE_PARSER_PREFIXCMD_QUIT},
diff --git a/tests/twisted/connect/ping.py b/tests/twisted/connect/ping.py
index 9c1f6ca..09fafbd 100644
--- a/tests/twisted/connect/ping.py
+++ b/tests/twisted/connect/ping.py
@@ -16,6 +16,12 @@ def test(q, bus, conn, stream):
stream.sendMessage('PONG', 'idle.test.server', ':%s' % timestamp,
prefix='idle.test.server')
+ # Apparently bip replies like this:
+ e = q.expect('stream-PING')
+ assertLength(1, e.data)
+ timestamp = e.data[0]
+ stream.sendMessage('PONG', timestamp, prefix='idle.test.server')
+
q.expect('stream-PING')
# If we don't answer Idle's ping, after some period of time Idle should
# give up and close the connection.