jabberd2
2.2.16
|
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 | |
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, char *action, char *target) |
send a new action route | |
void | sm_signature (sm_t sm, char *str) |
this is gratuitous, but apache gets one, so why not? | |
int | sm_register_ns (sm_t sm, char *uri) |
register a new global ns | |
void | sm_unregister_ns (sm_t sm, char *uri) |
unregister a global ns | |
int | sm_get_ns (sm_t sm, char *uri) |
get a globally registered ns | |
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 sm, event_WANT_READ, log_debug, ZONE, mio_read, sm_st::mio, sm_st::fd, event_WANT_WRITE, mio_write, event_READ, mio_fd_st::fd, _sx_buf_st::data, _sx_buf_st::len, MIO_WOULDBLOCK, log_write(), sm_st::log, MIO_STRERROR, MIO_ERROR, sx_kill(), event_WRITE, event_ERROR, _sx_error_st::generic, _sx_error_st::specific, _sx_error_st::code, SX_ERR_AUTH, sx_close(), event_STREAM, event_OPEN, sm_st::retry_left, sm_st::retry_lost, nad_new(), nad_add_namespace(), uri_COMPONENT, nad_append_elem(), nad_append_attr(), sm_st::id, sx_nad_write, sm_st::router, xhash_iter_first(), sm_st::hosts, xhash_iter_get(), nad_set_attr(), xhash_iter_next(), event_PACKET, NAD_ENS, nad_free(), _sx_st::state, state_STREAM, NAD_NURI_L, uri_STREAMS, NAD_NURI, NAD_ENAME_L, NAD_ENAME, sm_st::sx_ssl, _sx_st::ssf, nad_find_scoped_namespace(), uri_TLS, nad_find_elem(), sx_ssl_client_starttls(), sx_sasl_auth(), sm_st::sx_sasl, sm_st::router_user, sm_st::router_pass, state_OPEN, sm_st::online, nad_find_attr(), NAD_AVAL_L, NAD_AVAL, sm_st::started, pkt_new(), dispatch(), event_CLOSED, and mio_close.
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 sm, action_READ, log_debug, ZONE, mio_fd_st::fd, sx_kill(), sm_st::router, sx_can_read(), action_WRITE, sx_can_write(), action_CLOSE, log_write(), sm_st::log, sm_lost_router, sm_st::online, and action_ACCEPT.
Referenced by _sm_router_connect().
void sm_c2s_action | ( | sess_t | dest, |
char * | action, | ||
char * | target | ||
) |
send a new action route
Definition at line 280 of file sm.c.
References nad_new(), nad_add_namespace(), uri_COMPONENT, nad_append_elem(), nad_append_attr(), sess_st::c2s, sess_st::user, user_st::sm, sm_st::id, uri_SESSION, sess_st::c2s_id, sess_st::sm_id, log_debug, ZONE, sx_nad_write, and sm_st::router.
Referenced by JABBER_MAIN(), sm_storage_rate_limit(), user_delete(), _session_in_router(), and sess_start().
void sm_signature | ( | sm_t | sm, |
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, |
char * | uri | ||
) |
register a new global ns
Definition at line 324 of file sm.c.
References xhash_get(), sm_st::xmlns, xhash_count(), xhash_put(), pstrdup(), xhash_pool(), and sm_st::xmlns_refcount.
Referenced by module_init().
void sm_unregister_ns | ( | sm_t | sm, |
char * | uri | ||
) |
unregister a global ns
Definition at line 338 of file sm.c.
References xhash_get(), sm_st::xmlns_refcount, xhash_zap(), sm_st::xmlns, and xhash_put().
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, |
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 sm_st::query_rate_total, FALSE, xhash_get(), sm_st::users, sm_st::query_rates, rate_new(), sm_st::query_rate_seconds, sm_st::query_rate_wait, xhash_put(), pstrdup(), xhash_pool(), pool_cleanup(), rate_free(), rate_check(), log_write(), sm_st::log, user_st::sessions, sess_st::next, sm_c2s_action(), xhash_iter_first(), user_st::roster, xhash_iter_get(), pkt_router(), pkt_create(), user_st::sm, jid_full(), user_st::jid, xhash_iter_next(), TRUE, rate_add(), log_debug, and ZONE.
Referenced by _iq_vcard_in_sess(), _iq_vcard_pkt_user(), _roster_in_sess_s10n(), _roster_set_item(), and _roster_pkt_user().
sig_atomic_t sm_lost_router = 0 |
Definition at line 30 of file sm.c.
Referenced by _sm_signal(), _sm_router_connect(), JABBER_MAIN(), and sm_mio_callback().