From: David Woodhouse Date: Wed, 18 Oct 2017 14:49:54 +0000 (+0100) Subject: Abort connection when server kicks us off X-Git-Tag: v0.2~16 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d44ce62462742653ae2b22fbd28050b2dbaf5735;p=pidgin-chime.git Abort connection when server kicks us off Oops, this snuck in with another commit. I'm willing to rewrite history to fix that, even though I wouldn't do it to fix the stupid "calender" typo that inexplicably slipped in last week. --- diff --git a/chime-juggernaut.c b/chime-juggernaut.c index efa0c75..0cecd66 100644 --- a/chime-juggernaut.c +++ b/chime-juggernaut.c @@ -144,6 +144,14 @@ static void on_websocket_message(SoupWebsocketConnection *ws, gint type, chime_connection_log(cxn, CHIME_LOGLVL_MISC, "websocket message received:\n'%s'\n", (char *)data); + /* DISCONNECT */ + if (!strcmp(data, "0::")) { + /* Do not attempt to reconnect */ + priv->jugg_online = FALSE; + chime_connection_fail(cxn, CHIME_ERROR_NETWORK, + _("Juggernaut server closed connection")); + return; + } /* CONNECT */ if (!strcmp(data, "1::")) { if (!priv->jugg_online) {