#include "jsm.h"
Data Structures | |
| struct | ht_count_struct |
Typedefs | |
| typedef struct ht_count_struct * | ht_count |
| typedef struct ht_count_struct | _ht_count |
Functions | |
| void | _js_users_del (xht h, const char *key, void *data, void *arg) |
| void | _js_hosts_del (xht h, const char *key, void *data, void *arg) |
| result | js_users_gc (void *arg) |
| void | js_user_free_aux_data (void *arg) |
| udata | js_user (jsmi si, jid id, xht ht) |
| int | js_user_create (jsmi si, jid id) |
| int | js_user_delete (jsmi si, jid id) |
Contains the garbage collector for user records we don't need in memory anymore and the function to load user records to memory.
| typedef struct ht_count_struct _ht_count |
| typedef struct ht_count_struct * ht_count |
| void _js_hosts_del | ( | xht | h, | |
| const char * | key, | |||
| void * | data, | |||
| void * | arg | |||
| ) |
xhash_walker callback for walking the host hash tree
| h | the hash table containing all hosts | |
| key | the host for which the callback ist called | |
| data | the hashtable containing the users of this host | |
| arg | pointer to the user counter |
References _js_users_del(), ht_count_struct::count, ht_count_struct::ht, log_debug2, LOGT_SESSION, xhash_walk(), and ZONE.
Referenced by js_users_gc().
| void _js_users_del | ( | xht | h, | |
| const char * | key, | |||
| void * | data, | |||
| void * | arg | |||
| ) |
call-back for deleting user from the hash table
This function is called periodically by the user data garbage collection thread. It removes users aren't logged in from the global hashtable.
| h | the hash table containing the users of the presently cleaned host | |
| key | the user | |
| data | the user's data | |
| arg | structure holding the hashtable of hosts and the user counter |
References ht_count_struct::count, xmppd::jabberid::get_node(), ht_count_struct::ht, udata_struct::id, log_debug2, LOGT_SESSION, udata_struct::p, pool_free(), udata_struct::ref, udata_struct::sessions, xhash_zap(), and ZONE.
Referenced by _js_hosts_del().
get the udata record for a user
js_user attempts to locate the user data record for the specifed id. First it looks in current list, if that fails, it looks in xdb and creates new list entry. If THAT fails, it returns NULL (not a user).
| si | the session manager instance data | |
| id | which user to load (some memory is allocated from this jid's pool) | |
| ht | the hash table for the host the user belongs to (may be NULL) |
References udata_struct::aux_data, xmppd::jabberid::get_domain(), xmppd::jabberid::get_node(), xmppd::jabberid_pool::get_pool(), xmppd::jabberid::has_node(), jsmi_struct::hosts, udata_struct::id, jid_full(), jid_new(), jid_user(), js_user_free_aux_data(), log_debug2, LOGT_SESSION, NS_AUTH, NS_AUTH_CRYPT, udata_struct::p, pmalloco(), pool_cleanup(), pool_heap, udata_struct::si, jsmi_struct::xc, xdb_get(), xhash_get(), xhash_new(), xhash_put(), xmlnode_free(), and ZONE.
inform registered modules of a newly created user
| si | the session manager instance | |
| id | the jid of the new user |
References e_CREATE, js_mapi_call(), and js_user().
Referenced by _js_routed_session_control_packet().
inform registered modules of a deleted user
| si | the session manager instance | |
| id | the jid of the deleted user |
References e_DELETE, js_mapi_call(), and js_user().
Referenced by _js_routed_session_control_packet().
| void js_user_free_aux_data | ( | void * | arg | ) |
| result js_users_gc | ( | void * | arg | ) |
js_users_gc is a heartbeat that flushes old users from memory.
| arg | the session manager internal data |
References _js_hosts_del(), jsmi_struct::hosts, log_debug2, log_notice(), LOGT_STATUS, r_DONE, xhash_walk(), and ZONE.
Referenced by jsm().
1.5.5