Also call the connection handler callback if a connection attempt fails.
Otherwise there's no way for the client to stop the event loop and/or retry.
This commit is contained in:
@@ -162,6 +162,9 @@ void xmpp_run_once(xmpp_ctx_t *ctx, const unsigned long timeout)
|
|||||||
xmpp_debug(ctx, "xmpp", "connection failed");
|
xmpp_debug(ctx, "xmpp", "connection failed");
|
||||||
conn->state = XMPP_STATE_DISCONNECTED;
|
conn->state = XMPP_STATE_DISCONNECTED;
|
||||||
sock_close(conn->sock);
|
sock_close(conn->sock);
|
||||||
|
/* notify the connection handler */
|
||||||
|
conn->conn_handler(conn, XMPP_CONN_FAIL, conn->error,
|
||||||
|
conn->stream_error, conn->userdata);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,8 @@ typedef struct _xmpp_stanza_t xmpp_stanza_t;
|
|||||||
/* connect callback */
|
/* connect callback */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
XMPP_CONN_CONNECT,
|
XMPP_CONN_CONNECT,
|
||||||
XMPP_CONN_DISCONNECT
|
XMPP_CONN_DISCONNECT,
|
||||||
|
XMPP_CONN_FAIL
|
||||||
} xmpp_conn_event_t;
|
} xmpp_conn_event_t;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|||||||
Reference in New Issue
Block a user