about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorSteffen Jaeckel <jaeckel-floss@eyet-services.de>2022-02-08 19:50:06 +0100
committerSteffen Jaeckel <jaeckel-floss@eyet-services.de>2022-02-08 19:52:13 +0100
commit7a2af5e3ad39eca44d0e6bed65609be6e23f086c (patch)
tree6c305a7e2ca892ad85533a258f7eaee61db283f7 /src
parentfb9182488302b27009edbf4b0e141ddad3651680 (diff)
downloadprofani-tty-7a2af5e3ad39eca44d0e6bed65609be6e23f086c.tar.gz
fix handling of connection errors
When a `see-other-host` stream-error is received we try to re-connect to
the other host. Erroneously this also started the `reconnect_timer`.
This lead to the behavior that in cases where e.g. the login failed
we try to reconnect instead of bailing out with an error.

This commit fixes the wrong behavior by not starting the `reconnect_timer`.

Fix 0e58509c161ae8409c9accabb9606e0c7006b880

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
Diffstat (limited to 'src')
-rw-r--r--src/xmpp/session.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/xmpp/session.c b/src/xmpp/session.c
index ce3c557a..1dd5bdde 100644
--- a/src/xmpp/session.c
+++ b/src/xmpp/session.c
@@ -549,8 +549,6 @@ session_reconnect(gchar* altdomain, unsigned short altport)
 {
     reconnect.altdomain = altdomain;
     reconnect.altport = altport;
-    assert(reconnect_timer == NULL);
-    reconnect_timer = g_timer_new();
 }
 
 static void
@@ -583,7 +581,8 @@ _session_reconnect(void)
     connection_connect(jid, saved_account.passwd, server, port, account->tls_policy, account->auth_policy);
     free(jid);
     account_free(account);
-    g_timer_start(reconnect_timer);
+    if (reconnect_timer)
+        g_timer_start(reconnect_timer);
 }
 
 static void