telepathy-idle: Parse PONG more leniently

Will Thompson wjt at kemper.freedesktop.org
Fri Nov 16 01:10:22 PST 2012


Module: telepathy-idle
Branch: master
Commit: 452284ab9ed546a430cad13aeae4126cfcb616a2
URL:    http://cgit.freedesktop.org/telepathy/telepathy-idle/commit/?id=452284ab9ed546a430cad13aeae4126cfcb616a2

Author: Will Thompson <will.thompson at collabora.co.uk>
Date:   Fri Nov 16 08:50:43 2012 +0000

Parse PONG more leniently

---

 src/idle-parser.c             |    2 +-
 tests/twisted/connect/ping.py |    6 ++++++
 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.



More information about the telepathy-commits mailing list