Module: sip-router
Branch: master
Commit: 3b159696b1e418360de30b370ec61390cd0ca7e3
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3b15969…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Fri Sep 5 16:18:38 2014 +0200
core: proper reverse order execution for net_data_out event callbacks
---
events.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/events.c b/events.c
index 6ee808a..6de9e2f 100644
--- a/events.c
+++ b/events.c
@@ -213,9 +213,10 @@ int sr_event_exec(int type, void *data)
"%.*s\n+++++++++++++++++++\n", p->len, p->s);
#endif /* EXTRA_DEBUG */
ret = 0;
- for(i=SREV_CB_LIST_SIZE-1;
- i>=0 && _sr_events_list.net_data_out[i]; i--) {
- ret |= _sr_events_list.net_data_out[i](data);
+ for(i=0; i<SREV_CB_LIST_SIZE; i++) {
+ if(_sr_events_list.net_data_out[i]) {
+ ret |= _sr_events_list.net_data_out[i](data);
+ }
}
#ifdef EXTRA_DEBUG
LM_DBG("POST-OUT ++++++++++++++++++++\n"