@@ -475,9 +475,8 @@ int notify_ebr_subscriptions( ebr_event *ev, evi_params_t *params)
475
475
476
476
/* check the EBR subscription on this event and apply the filters */
477
477
sub_prev = NULL ;
478
- sub_next = NULL ;
479
- for ( sub = ev -> subs ; sub ; sub_prev = sub ,
480
- sub = sub_next ?sub_next :(sub ?sub -> next :NULL ) ) {
478
+ for ( sub = ev -> subs ; sub ; sub_prev = sub , sub = sub_next ) {
479
+ sub_next = sub -> next ;
481
480
482
481
/* discard expired subscriptions */
483
482
if (sub -> expire < my_time ) {
@@ -507,8 +506,7 @@ int notify_ebr_subscriptions( ebr_event *ev, evi_params_t *params)
507
506
continue ; /* keep it and try next time */
508
507
}
509
508
}
510
- /* remove the subscription */
511
- sub_next = sub -> next ;
509
+
512
510
/* unlink it */
513
511
if (sub_prev ) sub_prev -> next = sub_next ;
514
512
else ev -> subs = sub_next ;
@@ -521,7 +519,6 @@ int notify_ebr_subscriptions( ebr_event *ev, evi_params_t *params)
521
519
522
520
/* run the filters */
523
521
matches = 1 ;
524
- sub_next = NULL ;
525
522
for ( filter = sub -> filters ; matches && filter ; filter = filter -> next ) {
526
523
527
524
/* look for the evi param with the same name */
@@ -592,9 +589,7 @@ int notify_ebr_subscriptions( ebr_event *ev, evi_params_t *params)
592
589
LM_ERR ("failed to send job via IPC, skipping...\n" );
593
590
shm_free (job );
594
591
}
595
- /* remove the subscription, as it can be triggered only
596
- * one time */
597
- sub_next = sub -> next ;
592
+
598
593
/* unlink it */
599
594
if (sub_prev ) sub_prev -> next = sub_next ;
600
595
else ev -> subs = sub_next ;
@@ -648,9 +643,8 @@ void ebr_timeout(unsigned int ticks, void* param)
648
643
649
644
/* check the EBR subscriptions on this event */
650
645
sub_prev = NULL ;
651
- sub_next = NULL ;
652
- for ( sub = ev -> subs ; sub ; sub_prev = sub ,
653
- sub = sub_next ?sub_next :(sub ?sub -> next :NULL ) ) {
646
+ for ( sub = ev -> subs ; sub ; sub_prev = sub , sub = sub_next ) {
647
+ sub_next = sub -> next ;
654
648
655
649
/* skip valid and non WAIT subscriptions */
656
650
if ( (sub -> flags & EBR_SUBS_TYPE_WAIT )== 0 || sub -> expire > my_time )
@@ -682,8 +676,6 @@ void ebr_timeout(unsigned int ticks, void* param)
682
676
continue ; /* with the next subscription */
683
677
}
684
678
685
- /* remove the subscription */
686
- sub_next = sub -> next ;
687
679
/* unlink it */
688
680
if (sub_prev ) sub_prev -> next = sub_next ;
689
681
else ev -> subs = sub_next ;
0 commit comments