diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2022-05-06 20:44:13 +0200 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2022-05-06 20:44:13 +0200 |
commit | 3911333cff907a2d15d6dac33199b59137487a93 (patch) | |
tree | e3d3bc8a68bc1e6511575000c9fb9ea8f2e35d2a | |
parent | dns server. untested. compiles. (diff) | |
download | ircxmpp-3911333cff907a2d15d6dac33199b59137487a93.tar ircxmpp-3911333cff907a2d15d6dac33199b59137487a93.tar.gz ircxmpp-3911333cff907a2d15d6dac33199b59137487a93.tar.bz2 ircxmpp-3911333cff907a2d15d6dac33199b59137487a93.tar.lz ircxmpp-3911333cff907a2d15d6dac33199b59137487a93.tar.xz ircxmpp-3911333cff907a2d15d6dac33199b59137487a93.tar.zst ircxmpp-3911333cff907a2d15d6dac33199b59137487a93.zip |
-rw-r--r-- | ircxmpp.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -714,12 +714,14 @@ void ircxmpp_run_once (struct ircxmpp * ircxmpp) { if (!ircxmpp->ctx || !ircxmpp->conn || (!xmpp_conn_is_connected(ircxmpp->conn) && !xmpp_conn_is_connecting(ircxmpp->conn))) { LOG(ircxmpp, IRCXMPP_WARN, "XMPP control is DISCONNECTED! CONNECTING!"); - if (ircxmpp->conn) - xmpp_conn_release(ircxmpp->conn); - if (ircxmpp->ctx) - xmpp_ctx_free(ircxmpp->ctx); - ircxmpp->ctx = xmpp_ctx_new(NULL, &ircxmpp->xmpp_logger); - ircxmpp->conn = xmpp_conn_new(ircxmpp->ctx); + if (!ircxmpp->bridges) { // bridges contain ctx inside of their conns. + if (ircxmpp->conn) // maybe conn can be freed but i don't know + xmpp_conn_release(ircxmpp->conn); // bottom line: ctx really can't be + if (ircxmpp->ctx) + xmpp_ctx_free(ircxmpp->ctx); + ircxmpp->ctx = xmpp_ctx_new(NULL, &ircxmpp->xmpp_logger); + ircxmpp->conn = xmpp_conn_new(ircxmpp->ctx); + } xmpp_conn_set_jid(ircxmpp->conn, ircxmpp->jid); xmpp_conn_set_pass(ircxmpp->conn, ircxmpp->password); xmpp_connect_client(ircxmpp->conn, NULL, 0, conn_handler, ircxmpp); |