diff options
author | defanor <defanor@uberspace.net> | 2020-03-02 05:12:48 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2020-03-02 05:12:48 +0300 |
commit | 51b9b4f3f7cfbe1eb9cd72baea47a1b443367680 (patch) | |
tree | f1fe3e4b3ce052a0bbe18f4a1c41dc66b2b8c333 | |
parent | 3b38c1223851ac41288644e0b7618655f75fd89a (diff) |
Schedule a reconnect on TLS failure
-rw-r--r-- | src/rexmpp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rexmpp.c b/src/rexmpp.c index 2ac87ce..9e6d8eb 100644 --- a/src/rexmpp.c +++ b/src/rexmpp.c @@ -663,7 +663,7 @@ void rexmpp_recv (rexmpp_t *s) { rexmpp_schedule_reconnect(s); } } - } while (chunk_raw_len > 0); + } while (chunk_raw_len > 0 && s->reconnect_number == 0); } rexmpp_err_t rexmpp_stream_open (rexmpp_t *s) { @@ -759,6 +759,7 @@ rexmpp_err_t rexmpp_tls_handshake (rexmpp_t *s) { } gnutls_bye(s->gnutls_session, GNUTLS_SHUT_RDWR); rexmpp_cleanup(s); + rexmpp_schedule_reconnect(s); return REXMPP_E_TLS; } s->tls_state = REXMPP_TLS_ACTIVE; @@ -797,6 +798,7 @@ rexmpp_err_t rexmpp_tls_handshake (rexmpp_t *s) { rexmpp_log(s, LOG_ERR, "Unexpected TLS handshake error: %s", gnutls_strerror(ret)); rexmpp_cleanup(s); + rexmpp_schedule_reconnect(s); return REXMPP_E_TLS; } } |