Merged revisions 69259 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r69259 | qwell | 2007-06-14 10:21:29 -0500 (Thu, 14 Jun 2007) | 12 lines

Merged revisions 69258 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r69258 | qwell | 2007-06-14 10:15:53 -0500 (Thu, 14 Jun 2007) | 4 lines

Change a quite broken while loop to a for loop, so "continue;" works as expected instead of eating 99% CPU...

Issue 9966, patch by me.

........

................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.0
Jason Parker 19 years ago
parent 6a35e6cfb6
commit f593698f79

@ -102,15 +102,13 @@ static int group_function_read(struct ast_channel *chan, const char *cmd,
ast_app_group_list_rdlock(); ast_app_group_list_rdlock();
gi = ast_app_group_list_head(); for (gi = ast_app_group_list_head(); gi; gi = AST_LIST_NEXT(gi, list)) {
while (gi) {
if (gi->chan != chan) if (gi->chan != chan)
continue; continue;
if (ast_strlen_zero(data)) if (ast_strlen_zero(data))
break; break;
if (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, data)) if (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, data))
break; break;
gi = AST_LIST_NEXT(gi, list);
} }
if (gi) if (gi)
@ -160,8 +158,7 @@ static int group_list_function_read(struct ast_channel *chan, const char *cmd,
ast_app_group_list_rdlock(); ast_app_group_list_rdlock();
gi = ast_app_group_list_head(); for (gi = ast_app_group_list_head(); gi; gi = AST_LIST_NEXT(gi, list)) {
while (gi) {
if (gi->chan != chan) if (gi->chan != chan)
continue; continue;
if (!ast_strlen_zero(tmp1)) { if (!ast_strlen_zero(tmp1)) {
@ -176,7 +173,6 @@ static int group_list_function_read(struct ast_channel *chan, const char *cmd,
else else
snprintf(tmp1, sizeof(tmp1), "%s", gi->group); snprintf(tmp1, sizeof(tmp1), "%s", gi->group);
} }
gi = AST_LIST_NEXT(gi, list);
} }
ast_app_group_list_unlock(); ast_app_group_list_unlock();

Loading…
Cancel
Save