Skip to content

Commit

Permalink
Track priorities for default action return
Browse files Browse the repository at this point in the history
If the default action is return, take it ONLY if we're at priority 0
  • Loading branch information
alandekok committed Feb 8, 2013
1 parent 9d2e849 commit 5ca30f8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/modcall.c
Expand Up @@ -773,7 +773,7 @@ int modcall(int component, modcallable *c, REQUEST *request)
child->name ? child->name : "",
fr_int2str(rcode_table,
stack.result[stack.pointer],
"??"));
"??"));
goto do_return;
}

Expand Down Expand Up @@ -846,7 +846,8 @@ int modcall(int component, modcallable *c, REQUEST *request)
/*
* The child's action says return. Do so.
*/
if (child->actions[myresult] == MOD_ACTION_RETURN) {
if ((child->actions[myresult] == MOD_ACTION_RETURN) &&
(mypriority == 0)) {
stack.result[stack.pointer] = myresult;
stack.children[stack.pointer] = NULL;
goto do_return;
Expand Down Expand Up @@ -944,7 +945,7 @@ int modcall(int component, modcallable *c, REQUEST *request)
stack.pointer + 1, modcall_spaces,
group_name[parent->type],
parent->name ? parent->name : "",
fr_int2str(rcode_table, myresult, "??"));
fr_int2str(rcode_table, myresult, "??"));

#ifdef WITH_UNLANG
if ((parent->type == MOD_IF) ||
Expand Down

0 comments on commit 5ca30f8

Please sign in to comment.