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

Richard Fuchs notifications at github.com
Wed Nov 11 16:55:19 CET 2015


> +}
> +
> +int rtpengine_hash_table_insert(void *key, void *value) {
> +	struct rtpengine_hash_entry *entry, *last_entry;
> +	struct rtpengine_hash_entry *new_entry = (struct rtpengine_hash_entry *) value;
> +	unsigned int hash_index;
> +
> +	// check rtpengine hashtable
> +	if (!rtpengine_hash_table) {
> +		LM_ERR("NULL rtpengine_hash_table");
> +		return 0;
> +	}
> +
> +	// get entry list
> +	hash_index = str_hash(key);
> +	entry = rtpengine_hash_table->entry_list[hash_index];

Don't you need to acquire the lock before accessing the start element for the list?

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


More information about the sr-dev mailing list