conn: implemented xmpp_connect_raw()

This function is similar to xmpp_connect_client(), but doesn't perform
authentication. Instead, it calls user's connection handler immediately
after establishing the connection. Hence, user can implement own
authendication or registration procedures.

Such a "raw" connection can be useful when user interaction is required
(e.g. Data Forms in XEP-0077, OAuth2).
This commit is contained in:
Dmitry Podgorny
2016-04-26 18:29:47 +00:00
parent 3869906357
commit dc56737b71
6 changed files with 130 additions and 22 deletions

View File

@@ -150,6 +150,7 @@ struct _xmpp_conn_t {
unsigned int ref;
xmpp_ctx_t *ctx;
xmpp_conn_type_t type;
int is_raw;
xmpp_conn_state_t state;
uint64_t timeout_stamp;
@@ -215,6 +216,7 @@ struct _xmpp_conn_t {
void conn_disconnect(xmpp_conn_t * const conn);
void conn_disconnect_clean(xmpp_conn_t * const conn);
void conn_established(xmpp_conn_t * const conn);
void conn_open_stream(xmpp_conn_t * const conn);
int conn_tls_start(xmpp_conn_t * const conn);
void conn_prepare_reset(xmpp_conn_t * const conn, xmpp_open_handler handler);
@@ -269,5 +271,7 @@ void disconnect_mem_error(xmpp_conn_t * const conn);
/* auth functions */
void auth_handle_open(xmpp_conn_t * const conn);
void auth_handle_component_open(xmpp_conn_t * const conn);
void auth_handle_open_raw(xmpp_conn_t * const conn);
void auth_handle_open_stub(xmpp_conn_t * const conn);
#endif /* __LIBSTROPHE_COMMON_H__ */