Browse code

core: proper reverse order execution for net_data_out event callbacks

Daniel-Constantin Mierla authored on 05/09/2014 14:18:38
Showing 1 changed files
... ...
@@ -213,9 +213,10 @@ int sr_event_exec(int type, void *data)
213 213
 							"%.*s\n+++++++++++++++++++\n", p->len, p->s);
214 214
 #endif /* EXTRA_DEBUG */
215 215
 					ret = 0;
216
-					for(i=SREV_CB_LIST_SIZE-1;
217
-							i>=0 && _sr_events_list.net_data_out[i]; i--) {
218
-						ret |= _sr_events_list.net_data_out[i](data);
216
+					for(i=0; i<SREV_CB_LIST_SIZE; i++) {
217
+						if(_sr_events_list.net_data_out[i]) {
218
+							ret |= _sr_events_list.net_data_out[i](data);
219
+						}
219 220
 					}
220 221
 #ifdef EXTRA_DEBUG
221 222
 					LM_DBG("POST-OUT ++++++++++++++++++++\n"