#include <string.h>#include <unistd.h>#include <stdio.h>#include <sys/time.h>#include <sys/types.h>#include "../../dprint.h"#include "../../mem/mem.h"#include "../../mem/shm_mem.h"#include "../../timer.h"#include "xjab_util.h"#include "xjab_jcon.h"#include "mdefines.h"

Go to the source code of this file.
Functions | |
| int | xj_jcon_pool_add (xj_jcon_pool jcp, xj_jcon jc) |
| int | xj_jcon_pool_add_jmsg (xj_jcon_pool jcp, xj_sipmsg _jsm, xj_jcon _ojc) |
| int | xj_jcon_pool_del (xj_jcon_pool jcp, xj_jkey jkey) |
| int | xj_jcon_pool_del_jmsg (xj_jcon_pool jcp, int idx) |
| void | xj_jcon_pool_free (xj_jcon_pool jcp) |
| xj_jcon | xj_jcon_pool_get (xj_jcon_pool jcp, xj_jkey jkey) |
| xj_jcon_pool | xj_jcon_pool_init (int size, int jlen, int ch) |
| int xj_jcon_pool_add | ( | xj_jcon_pool | jcp, | |
| xj_jcon | jc | |||
| ) |
add a new connection in pool
Definition at line 149 of file xjab_util.c.
References _xj_jcon_pool::len, len, LM_DBG, NULL, and _xj_jcon_pool::ojc.
Referenced by xj_worker_process().
| int xj_jcon_pool_add_jmsg | ( | xj_jcon_pool | jcp, | |
| xj_sipmsg | _jsm, | |||
| xj_jcon | _ojc | |||
| ) |
add a new element in messages queue
Definition at line 101 of file xjab_util.c.
References _xj_jmsg_queue::cache, _xj_jmsg_queue::expire, get_ticks(), _xj_jcon_pool::jmqueue, _xj_jmsg_queue::jsm, _xj_jmsg_queue::len, LM_DBG, NULL, _xj_jmsg_queue::ojc, and _xj_jmsg_queue::size.
Referenced by xj_worker_process().
| int xj_jcon_pool_del | ( | xj_jcon_pool | jcp, | |
| xj_jkey | jkey | |||
| ) |
remove the connection associated with 'id' from pool
Definition at line 205 of file xjab_util.c.
References _xj_jkey::hash, _xj_jkey::id, _xj_jcon::jkey, _str::len, len, LM_DBG, NULL, _xj_jcon_pool::ojc, _str::s, and xj_jcon_free().
| int xj_jcon_pool_del_jmsg | ( | xj_jcon_pool | jcp, | |
| int | idx | |||
| ) |
delete first element from messages queue
Definition at line 131 of file xjab_util.c.
References _xj_jcon_pool::jmqueue, _xj_jmsg_queue::jsm, NULL, _xj_jmsg_queue::ojc, and _xj_jmsg_queue::size.
Referenced by xj_worker_check_qmsg().
| void xj_jcon_pool_free | ( | xj_jcon_pool | jcp | ) |
free a Jabber connections pool structure
Definition at line 233 of file xjab_util.c.
References _M_FREE, _xj_jmsg_queue::expire, _xj_jcon_pool::jmqueue, _xj_jmsg_queue::jsm, _xj_jcon_pool::len, LM_DBG, NULL, _xj_jmsg_queue::ojc, _xj_jcon_pool::ojc, and xj_jcon_free().
| xj_jcon xj_jcon_pool_get | ( | xj_jcon_pool | jcp, | |
| xj_jkey | jkey | |||
| ) |
get the jabber connection associated with 'id'
Definition at line 173 of file xjab_util.c.
References _xj_jkey::hash, _xj_jkey::id, _xj_jcon::jkey, len, _str::len, LM_DBG, NULL, _xj_jcon_pool::ojc, and _str::s.
Referenced by xj_worker_process().
| xj_jcon_pool xj_jcon_pool_init | ( | int | size, | |
| int | jlen, | |||
| int | ch | |||
| ) |
init a jc_pool structure
Definition at line 48 of file xjab_util.c.
References _M_FREE, _M_MALLOC, _xj_jmsg_queue::cache, _xj_jmsg_queue::expire, _xj_jcon_pool::jmqueue, _xj_jmsg_queue::jsm, _xj_jmsg_queue::len, _xj_jcon_pool::len, NULL, _xj_jmsg_queue::ojc, _xj_jcon_pool::ojc, and _xj_jmsg_queue::size.
Referenced by xj_worker_process().
1.5.6