conn: clear system handlers on reconnect

xmpp_conn_t object can be reused with saving user's handlers.
However, saving system handlers can lead to a fail during connection
process. This is because old object may contain timed handlers for
missed features or other handlers that would handle incoming stanzas
incorrectly.
This commit is contained in:
Dmitry Podgorny
2017-06-24 02:10:03 +03:00
parent da8dc2d3cb
commit 5ecb0c5d0c
4 changed files with 76 additions and 0 deletions

View File

@@ -1215,6 +1215,8 @@ static void _conn_reset(xmpp_conn_t * const conn)
conn->secured = 0;
conn->tls_failed = 0;
conn->error = 0;
handler_system_delete_all(conn);
}
static int _conn_connect(xmpp_conn_t * const conn,