MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / mq_head_fetch

Function mq_head_fetch

modules/mqueue/mqueue_api.c:249–270  ·  view source on GitHub ↗

* */

Source from the content-addressed store, hash-verified

247 *
248 */
249int mq_head_fetch(str *name)
250{
251 mq_head_t *mh = NULL;
252 mq_pv_t *mp = NULL;
253
254 mp = mq_pv_get(name);
255 if(mp == NULL)
256 return -1;
257 if(mp->item != NULL) {
258 shm_free(mp->item);
259 mp->item = NULL;
260 }
261 mh = mq_head_get(name);
262 if(mh == NULL)
263 return -1;
264 lock_get(&mh->lock);
265
266 mp->item = mq_head_fetch_item(mh);
267
268 lock_release(&mh->lock);
269 return (mp->item?0:-2);
270}
271
272/**
273 *

Callers 3

mqueue_db_save_queueFunction · 0.85
w_mq_fetchFunction · 0.85
mi_fetchFunction · 0.85

Calls 6

mq_pv_getFunction · 0.85
shm_freeFunction · 0.85
mq_head_getFunction · 0.85
lock_getFunction · 0.85
mq_head_fetch_itemFunction · 0.85
lock_releaseFunction · 0.85

Tested by

no test coverage detected