jabberd2
2.3.4
|
stream / io callbacks More...
#include "sm.h"
Go to the source code of this file.
Functions | |
int | sm_sx_callback (sx_t s, sx_event_t e, void *data, void *arg) |
our master callback More... | |
int | sm_mio_callback (mio_t m, mio_action_t a, mio_fd_t fd, void *data, void *arg) |
void | sm_c2s_action (sess_t dest, const char *action, const char *target) |
send a new action route More... | |
void | sm_signature (sm_t sm, const char *str) |
this is gratuitous, but apache gets one, so why not? More... | |
int | sm_register_ns (sm_t sm, const char *uri) |
register a new global ns More... | |
void | sm_unregister_ns (sm_t sm, const char *uri) |
unregister a global ns More... | |
int | sm_get_ns (sm_t sm, const char *uri) |
get a globally registered ns More... | |
int | sm_storage_rate_limit (sm_t sm, const char *owner) |
Variables | |
sig_atomic_t | sm_lost_router = 0 |
int sm_sx_callback | ( | sx_t | s, |
sx_event_t | e, | ||
void * | data, | ||
void * | arg | ||
) |
our master callback
Definition at line 33 of file sm.c.
References _sx_error_st::code, _sx_buf_st::data, dispatch(), event_CLOSED, event_ERROR, event_OPEN, event_PACKET, event_READ, event_STREAM, event_WANT_READ, event_WANT_WRITE, event_WRITE, mio_fd_st::fd, sm_st::fd, _sx_error_st::generic, sm_st::hosts, sm_st::id, _sx_buf_st::len, sm_st::log, log_debug, log_write(), sm_st::mio, mio_close, MIO_ERROR, mio_read, MIO_STRERROR, MIO_WOULDBLOCK, mio_write, nad_add_namespace(), nad_append_attr(), nad_append_elem(), NAD_AVAL, NAD_AVAL_L, NAD_ENAME, NAD_ENAME_L, NAD_ENS, nad_find_attr(), nad_find_elem(), nad_find_scoped_namespace(), nad_free(), nad_new(), NAD_NURI, NAD_NURI_L, nad_set_attr(), sm_st::online, pkt_new(), sm_st::retry_left, sm_st::retry_lost, sm_st::router, sm_st::router_pass, sm_st::router_user, sm, _sx_error_st::specific, _sx_st::ssf, sm_st::started, _sx_st::state, state_OPEN, state_STREAM, sx_close(), SX_ERR_AUTH, sx_kill(), sx_nad_write, sm_st::sx_sasl, sx_sasl_auth(), sm_st::sx_ssl, sx_ssl_client_starttls(), uri_COMPONENT, uri_STREAMS, uri_TLS, xhash_iter_first(), xhash_iter_get(), xhash_iter_next(), and ZONE.
Referenced by _sm_router_connect().
int sm_mio_callback | ( | mio_t | m, |
mio_action_t | a, | ||
mio_fd_t | fd, | ||
void * | data, | ||
void * | arg | ||
) |
Definition at line 241 of file sm.c.
References action_ACCEPT, action_CLOSE, action_READ, action_WRITE, mio_fd_st::fd, sm_st::log, log_debug, log_write(), sm_st::online, sm_st::router, sm, sm_lost_router, sx_can_read(), sx_can_write(), sx_kill(), and ZONE.
Referenced by _sm_router_connect().
void sm_c2s_action | ( | sess_t | dest, |
const char * | action, | ||
const char * | target | ||
) |
send a new action route
Definition at line 280 of file sm.c.
References sess_st::c2s, sess_st::c2s_id, sm_st::id, log_debug, nad_add_namespace(), nad_append_attr(), nad_append_elem(), nad_new(), sm_st::router, user_st::sm, sess_st::sm_id, sx_nad_write, uri_COMPONENT, uri_SESSION, sess_st::user, and ZONE.
Referenced by _session_in_router(), JABBER_MAIN(), sess_start(), sm_storage_rate_limit(), and user_delete().
void sm_signature | ( | sm_t | sm, |
const char * | str | ||
) |
this is gratuitous, but apache gets one, so why not?
Definition at line 313 of file sm.c.
References sm_st::siglen, and sm_st::signature.
Referenced by JABBER_MAIN().
int sm_register_ns | ( | sm_t | sm, |
const char * | uri | ||
) |
register a new global ns
Definition at line 324 of file sm.c.
References pstrdup(), xhash_count(), xhash_get(), xhash_pool(), xhash_put(), sm_st::xmlns, and sm_st::xmlns_refcount.
Referenced by module_init().
void sm_unregister_ns | ( | sm_t | sm, |
const char * | uri | ||
) |
unregister a global ns
Definition at line 338 of file sm.c.
References xhash_get(), xhash_put(), xhash_zap(), sm_st::xmlns, and sm_st::xmlns_refcount.
Referenced by _iq_last_free(), _iq_ping_free(), _iq_private_free(), _iq_time_free(), _iq_vcard_free(), _iq_version_free(), _privacy_free(), and _vacation_free().
int sm_get_ns | ( | sm_t | sm, |
const char * | uri | ||
) |
get a globally registered ns
Definition at line 349 of file sm.c.
References xhash_get(), and sm_st::xmlns.
int sm_storage_rate_limit | ( | sm_t | sm, |
const char * | owner | ||
) |
Definition at line 355 of file sm.c.
References item_st::jid, user_st::jid, jid_full(), sm_st::log, log_debug, log_write(), sess_st::next, pkt_create(), pkt_router(), pool_cleanup(), pstrdup(), sm_st::query_rate_seconds, sm_st::query_rate_total, sm_st::query_rate_wait, sm_st::query_rates, rate_add(), rate_check(), rate_free(), rate_new(), user_st::roster, user_st::sessions, user_st::sm, sm_c2s_action(), item_st::to, sm_st::users, xhash_get(), xhash_iter_first(), xhash_iter_get(), xhash_iter_next(), xhash_pool(), xhash_put(), and ZONE.
Referenced by _iq_vcard_in_sess(), _iq_vcard_pkt_user(), _roster_in_sess_s10n(), _roster_pkt_user(), and _roster_set_item().
sig_atomic_t sm_lost_router = 0 |
Definition at line 30 of file sm.c.
Referenced by _sm_router_connect(), _sm_signal(), JABBER_MAIN(), and sm_mio_callback().