提交 c28ced72 authored 作者: dschreiber's avatar dschreiber

Merging FS-3432 switch_core_hash.c patch in from Tamas

上级 37e61ee6
...@@ -157,7 +157,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_delete_multi(switch_hash_t *has ...@@ -157,7 +157,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_delete_multi(switch_hash_t *has
switch_event_create_subclass(&event, SWITCH_EVENT_CLONE, NULL); switch_event_create_subclass(&event, SWITCH_EVENT_CLONE, NULL);
switch_assert(event); switch_assert(event);
/* iterate through the hash, call callback, if callback returns true, put the key on the list (event) /* iterate through the hash, call callback, if callback returns NULL or true, put the key on the list (event)
When done, iterate through the list deleting hash entries When done, iterate through the list deleting hash entries
*/ */
...@@ -165,7 +165,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_delete_multi(switch_hash_t *has ...@@ -165,7 +165,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_delete_multi(switch_hash_t *has
const void *key; const void *key;
void *val; void *val;
switch_hash_this(hi, &key, NULL, &val); switch_hash_this(hi, &key, NULL, &val);
if (callback(key, val, pData)) { if (!callback || callback(key, val, pData)) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "delete", (const char *) key); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "delete", (const char *) key);
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论