[sr-dev] git:master: table: drop in event_route[htable:mod-init]

Daniel-Constantin Mierla miconda at gmail.com
Thu Jul 9 12:36:18 CEST 2009


Module: sip-router
Branch: master
Commit: 3734194dfe4b3e81c49119508ff9aa3dd4682978
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3734194dfe4b3e81c49119508ff9aa3dd4682978

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Thu Jul  9 12:30:48 2009 +0200

table: drop in event_route[htable:mod-init]

- usage of drop in event_route[htable:mod-init] causes failure of
  child_init(), stopping the start process

---

 modules_k/htable/htable.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/modules_k/htable/htable.c b/modules_k/htable/htable.c
index 648ab09..41a9a2c 100644
--- a/modules_k/htable/htable.c
+++ b/modules_k/htable/htable.c
@@ -170,6 +170,7 @@ static int mod_init(void)
 static int child_init(int rank)
 {
 	struct sip_msg *fmsg;
+	struct run_act_ctx ctx;
 	int rtb, rt;
 
 	LM_DBG("rank is (%d)\n", rank);
@@ -184,7 +185,12 @@ static int child_init(int rank)
 		fmsg = faked_msg_next();
 		rtb = get_route_type();
 		set_route_type(REQUEST_ROUTE);
-		run_top_route(event_rt.rlist[rt], fmsg, 0);
+		run_top_route(event_rt.rlist[rt], fmsg, &ctx);
+		if(ctx.run_flags&DROP_R_F)
+		{
+			LM_ERR("exit due to 'drop' in event route\n");
+			return -1;
+		}
 		set_route_type(rtb);
 	}
 




More information about the sr-dev mailing list