From e132b60e77f395463cf95dc4ee09e96e9658ae35 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 11 Nov 2012 23:32:47 +0000 Subject: Extend keepalive code to time out connections when pings don't get acknowledged, using this for Twitter streams and MSN so far. --- protocols/msn/msn.c | 1 + protocols/msn/ns.c | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'protocols/msn') diff --git a/protocols/msn/msn.c b/protocols/msn/msn.c index 71570ce0..845f9cf8 100644 --- a/protocols/msn/msn.c +++ b/protocols/msn/msn.c @@ -52,6 +52,7 @@ static void msn_login( account_t *acc ) struct msn_data *md = g_new0( struct msn_data, 1 ); ic->proto_data = md; + ic->flags |= OPT_PONGS | OPT_PONGED; if( strchr( acc->user, '@' ) == NULL ) { diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c index d9a558f9..7acf4654 100644 --- a/protocols/msn/ns.c +++ b/protocols/msn/ns.c @@ -576,6 +576,10 @@ static int msn_ns_command( struct msn_handler_data *handler, char **cmd, int num if( num_parts >= 7 ) handler->msglen = atoi( cmd[6] ); } + else if( strcmp( cmd[0], "QNG" ) == 0 ) + { + ic->flags |= OPT_PONGED; + } else if( isdigit( cmd[0][0] ) ) { int num = atoi( cmd[0] ); -- cgit v1.2.3