Skip to content

Commit 6ef166a

Browse files
committed
go to the next sub on continue
1 parent d0f238c commit 6ef166a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

modules/event_routing/ebr_data.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ int notify_ebr_subscriptions( ebr_event *ev, evi_params_t *params)
492492
job =(ebr_ipc_job*)shm_malloc( sizeof(ebr_ipc_job) );
493493
if (job==NULL) {
494494
LM_ERR("failed to allocated new IPC job, skipping..\n");
495+
sub_next = sub->next;
495496
continue; /* with the next subscription */
496497
}
497498
job->ev = ev;
@@ -504,6 +505,7 @@ int notify_ebr_subscriptions( ebr_event *ev, evi_params_t *params)
504505
if (ipc_send_job( sub->proc_no, ebr_ipc_type , (void*)job)<0) {
505506
LM_ERR("failed to send job via IPC, skipping...\n");
506507
shm_free(job);
508+
sub_next = sub->next;
507509
continue; /* keep it and try next time */
508510
}
509511
}
@@ -556,6 +558,7 @@ int notify_ebr_subscriptions( ebr_event *ev, evi_params_t *params)
556558
job =(ebr_ipc_job*)shm_malloc( sizeof(ebr_ipc_job) );
557559
if (job==NULL) {
558560
LM_ERR("failed to allocated new IPC job, skipping..\n");
561+
sub_next = sub->next;
559562
continue; /* with the next subscription */
560563
}
561564

@@ -653,8 +656,10 @@ void ebr_timeout(unsigned int ticks, void* param)
653656
sub=sub_next?sub_next:(sub?sub->next:NULL) ) {
654657

655658
/* skip valid and non WAIT subscriptions */
656-
if ( (sub->flags&EBR_SUBS_TYPE_WAIT)==0 || sub->expire>my_time )
659+
if ( (sub->flags&EBR_SUBS_TYPE_WAIT)==0 || sub->expire>my_time ) {
660+
sub_next = sub->next;
657661
continue;
662+
}
658663

659664
LM_DBG("subscription type [%s] from process %d(pid %d) on "
660665
"event <%.*s> expired at %d, now %d\n",
@@ -667,6 +672,7 @@ void ebr_timeout(unsigned int ticks, void* param)
667672
job =(ebr_ipc_job*)shm_malloc( sizeof(ebr_ipc_job) );
668673
if (job==NULL) {
669674
LM_ERR("failed to allocated new IPC job, skipping..\n");
675+
sub_next = sub->next;
670676
continue; /* with the next subscription */
671677
}
672678
job->ev = ev;
@@ -679,6 +685,7 @@ void ebr_timeout(unsigned int ticks, void* param)
679685
if (ipc_send_job( sub->proc_no, ebr_ipc_type , (void*)job)<0) {
680686
LM_ERR("failed to send job via IPC, skipping...\n");
681687
shm_free(job);
688+
sub_next = sub->next;
682689
continue; /* with the next subscription */
683690
}
684691

0 commit comments

Comments
 (0)