2
0
Эх сурвалжийг харах

cfgutils: Properly handle 'exit' when from route_if_exists()

exit is supposed to exit the routing script. route_if_exists() wasn't
handling the exit, so script would continue to run after 'exit'.
Alex Hermann 8 жил өмнө
parent
commit
d6a374d707

+ 4 - 0
src/modules/cfgutils/cfgutils.c

@@ -818,9 +818,13 @@ static int w_route_exists(struct sip_msg *msg, char *route)
 	}
 	backup_rt = get_route_type();
 	set_route_type(REQUEST_ROUTE);
+
 	init_run_actions_ctx(&ctx);
 	ret = run_top_route(main_rt.rlist[newroute], msg, &ctx);
 	set_route_type(backup_rt);
+	if (ctx.run_flags & EXIT_R_F) {
+		return 0;
+	}
 	return ret;
 }