summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2008-11-07 14:50:30 +0000
committerRussell Bryant <russell@russellbryant.com>2008-11-07 14:50:30 +0000
commit1a239454f17db162df26a6cf8502312cf1dd08e4 (patch)
tree2abac73d6081e4d32e6aa8a55ead20df4eb447b8
parent210df649a2efaed02f294af96ffe3072398ed3d6 (diff)
Fix some code in chan_sip that was intended to unlink multiple objects from a
container. The OBJ_MULTIPLE flag must be provided here. Otherwise, this would only remove a single object. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@155241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--channels/chan_sip.c13
-rw-r--r--main/pbx.c2
2 files changed, 9 insertions, 6 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 4ebd970dc..8e6294f9b 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -13670,7 +13670,8 @@ static char *sip_prune_realtime(struct ast_cli_entry *e, int cmd, struct ast_cli
unref_peer(pi, "toss iterator peer ptr");
}
if (pruned) {
- ao2_t_callback(peers, OBJ_NODATA|OBJ_UNLINK, peer_is_marked, 0, "initiating callback to remove marked peers");
+ ao2_t_callback(peers, OBJ_NODATA | OBJ_UNLINK | OBJ_MULTIPLE, peer_is_marked, 0,
+ "initiating callback to remove marked peers");
ast_cli(a->fd, "%d peers pruned.\n", pruned);
} else
ast_cli(a->fd, "No peers found to prune.\n");
@@ -13679,7 +13680,7 @@ static char *sip_prune_realtime(struct ast_cli_entry *e, int cmd, struct ast_cli
if (prunepeer) {
struct sip_peer tmp;
ast_copy_string(tmp.name, name, sizeof(tmp.name));
- if ((peer = ao2_t_find(peers, &tmp, OBJ_POINTER|OBJ_UNLINK, "finding to unlink from peers"))) {
+ if ((peer = ao2_t_find(peers, &tmp, OBJ_POINTER | OBJ_UNLINK, "finding to unlink from peers"))) {
if (peer->addr.sin_addr.s_addr) {
ao2_t_unlink(peers_by_ip, peer, "unlinking peer from peers_by_ip also");
}
@@ -20613,7 +20614,8 @@ static void *do_monitor(void *data)
of time since the last time we did it (when MWI is being sent, we can
get back to this point every millisecond or less)
*/
- ao2_t_callback(dialogs, OBJ_UNLINK|OBJ_NODATA, dialog_needdestroy, &t, "callback to remove dialogs w/needdestroy");
+ ao2_t_callback(dialogs, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, dialog_needdestroy, &t,
+ "callback to remove dialogs w/needdestroy");
/* the old methodology would be to restart the search for dialogs to delete with every
dialog that was found and destroyed, probably because the list contents would change,
@@ -21817,7 +21819,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
during reload
*/
ast_copy_string(tmp_peer.name, name, sizeof(tmp_peer.name));
- peer = ao2_t_find(peers, &tmp_peer, OBJ_POINTER|OBJ_UNLINK, "find and unlink peer from peers table");
+ peer = ao2_t_find(peers, &tmp_peer, OBJ_POINTER | OBJ_UNLINK, "find and unlink peer from peers table");
}
if (peer) {
@@ -23650,7 +23652,8 @@ static int sip_do_reload(enum channelreloadreason reason)
start_poke = time(0);
/* Prune peers who still are supposed to be deleted */
- ao2_t_callback(peers, OBJ_NODATA|OBJ_UNLINK, peer_is_marked, 0, "callback to remove marked peers");
+ ao2_t_callback(peers, OBJ_NODATA | OBJ_UNLINK | OBJ_MULTIPLE, peer_is_marked, 0,
+ "callback to remove marked peers");
ast_debug(4, "--------------- Done destroying pruned peers\n");
diff --git a/main/pbx.c b/main/pbx.c
index 13d125e59..e120eeebc 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -4108,7 +4108,7 @@ static int xmldoc_parse_argument(struct ast_xml_node *fixnode, int insideparamet
{
struct ast_xml_node *node = fixnode;
const char *argname;
- int count=0, ret = 0;
+ int count = 0, ret = 0;
if (!node || !ast_xml_node_get_children(node)) {
return ret;