Browse code

core: unlikely() to test ev SREV_CFG_RUN_ACTION

- test if the event is enabled before creating the parameter and
executing the callback

Daniel-Constantin Mierla authored on 04/02/2010 11:30:47
Showing 1 changed files
... ...
@@ -144,9 +144,12 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
144 144
 	ser_error=E_UNSPEC;
145 145
 
146 146
 	/* hook for every executed action (in use by cfg debugger) */
147
-	srevp[0] = (void*)a;
148
-	srevp[1] = (void*)msg;
149
-	sr_event_exec(SREV_CFG_RUN_ACTION, (void*)srevp);
147
+	if(unlikely(sr_event_enabled(SREV_CFG_RUN_ACTION)))
148
+	{
149
+		srevp[0] = (void*)a;
150
+		srevp[1] = (void*)msg;
151
+		sr_event_exec(SREV_CFG_RUN_ACTION, (void*)srevp);
152
+	}
150 153
 
151 154
 	ret=E_BUG;
152 155
 	switch ((unsigned char)a->type){