[sr-dev] [kamailio] rtpengine: hash table to keep the selected nodes (#390)

Richard Fuchs notifications at github.com
Wed Nov 11 17:04:27 CET 2015


>  found:
>  	if (do_test) {
>  		node->rn_disabled = rtpp_test(node, node->rn_disabled, 0);
>  		if (node->rn_disabled)
>  			goto retry;
>  	}
> +
> +	/* build hash table entry */
> +	struct rtpengine_hash_entry *entry = shm_malloc(sizeof(struct rtpp_node));
> +	if (shm_str_dup(&entry->callid, &callid) < 0) {
> +		LM_ERR("rtpengine hash table fail to duplicate calllen=%d callid=%.*s",
> +			callid.len, callid.len, callid.s);
> +	}
> +	entry->node = node;
> +	entry->next = NULL;
> +	entry->tout = get_ticks() + hash_table_tout;
> +
> +	/* Insert the key<->entry from the hashtable */
> +	if (!rtpengine_hash_table_insert(&callid, entry)) {
> +		LM_ERR("rtpengine hash table fail to insert node=%.*s for calllen=%d callid=%.*s",

The error case needs some shm_free() I think

---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/390/files#r44548900
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20151111/4779b384/attachment.html>


More information about the sr-dev mailing list