diff options
author | defanor <defanor@uberspace.net> | 2020-06-24 09:50:59 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2020-06-24 09:50:59 +0300 |
commit | f9c2810adb8e19a228535ea7c8b131a5e8b6928e (patch) | |
tree | 9b023d1d5b6e0da8558034789833fd6c009f381f | |
parent | 25385f15c3d51b9587648c2d6fbd9607240705db (diff) |
Don't deinit gnutls session on REXMPP_TLS_AWAITING_DIRECT
-rw-r--r-- | src/rexmpp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rexmpp.c b/src/rexmpp.c index 4b7a62c..02dcf5b 100644 --- a/src/rexmpp.c +++ b/src/rexmpp.c @@ -344,10 +344,11 @@ rexmpp_err_t rexmpp_init (rexmpp_t *s, const char *jid) structures), but keeps others (e.g., stanza queue and stream ID, since we may resume the stream afterwards). */ void rexmpp_cleanup (rexmpp_t *s) { - if (s->tls_state != REXMPP_TLS_INACTIVE) { + if (s->tls_state != REXMPP_TLS_INACTIVE && + s->tls_state != REXMPP_TLS_AWAITING_DIRECT) { gnutls_deinit(s->gnutls_session); - s->tls_state = REXMPP_TLS_INACTIVE; } + s->tls_state = REXMPP_TLS_INACTIVE; if (s->sasl_state != REXMPP_SASL_INACTIVE) { gsasl_finish(s->sasl_session); s->sasl_session = NULL; |