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/branches/1.2@69258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.2
Jason Parker 19 years ago
parent 0156942fe0
commit fab1ba87cd

@ -97,15 +97,13 @@ static char *group_function_read(struct ast_channel *chan, char *cmd, char *data
ast_app_group_list_lock();
gi = ast_app_group_list_head();
while (gi) {
for (gi = ast_app_group_list_head(); gi; gi = AST_LIST_NEXT(gi, list)) {
if (gi->chan != chan)
continue;
if (ast_strlen_zero(data))
break;
if (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, data))
break;
gi = AST_LIST_NEXT(gi, list);
}
if (gi)
@ -150,8 +148,7 @@ static char *group_list_function_read(struct ast_channel *chan, char *cmd, char
ast_app_group_list_lock();
gi = ast_app_group_list_head();
while (gi) {
for (gi = ast_app_group_list_head(); gi; gi = AST_LIST_NEXT(gi, list)) {
if (gi->chan != chan)
continue;
if (!ast_strlen_zero(tmp1)) {
@ -166,7 +163,6 @@ static char *group_list_function_read(struct ast_channel *chan, char *cmd, char
else
snprintf(tmp1, sizeof(tmp1), "%s", gi->group);
}
gi = AST_LIST_NEXT(gi, list);
}
ast_app_group_list_unlock();

Loading…
Cancel
Save