Claudio Jeker([email protected]) on 2017.12.10 12:52:55 +0100:
> On Sat, Dec 09, 2017 at 08:26:58PM +0100, Sebastian Benoit wrote:
> > 
> > Hi,
> > 
> > sorry for the delay, and thanks for the report and the analysis!
> > 
> > here is a slighty changed version:
> > 
> > diff --git usr.sbin/relayd/hce.c usr.sbin/relayd/hce.c
> > index 5c5ee6f3013..bb2903c8dfa 100644
> > --- usr.sbin/relayd/hce.c
> > +++ usr.sbin/relayd/hce.c
> > @@ -80,11 +80,11 @@ hce_setup_events(void)
> >     struct timeval   tv;
> >     struct table    *table;
> >  
> > -   if (!(TAILQ_EMPTY(env->sc_tables) ||
> > -       event_initialized(&env->sc_ev))) {
> > +   if (!event_initialized(&env->sc_ev)) {
> >             evtimer_set(&env->sc_ev, hce_launch_checks, env);
> >             bzero(&tv, sizeof(tv));
> > -           evtimer_add(&env->sc_ev, &tv);
> > +           if (!TAILQ_EMPTY(env->sc_tables))
> > +               evtimer_add(&env->sc_ev, &tv);
> >     }
> >  
> >     if (env->sc_conf.flags & F_TLS) {
> > 
> > 
> > ok?
> 
> I think then you want to have a similar TAILQ_EMPTY check in
> hce_launch_checks(). Because doing an IMSG_CTL_POLL will trigger the
> evtimer_add() in there.  Either we always run the timer or we make sure we
> never run the timer for an empty queue.

I thought you would catch that ;)

Lets just run the timer unconditionaly.

ok?


diff --git usr.sbin/relayd/hce.c usr.sbin/relayd/hce.c
index 5c5ee6f3013..a67d37f25d8 100644
--- usr.sbin/relayd/hce.c
+++ usr.sbin/relayd/hce.c
@@ -80,8 +80,7 @@ hce_setup_events(void)
        struct timeval   tv;
        struct table    *table;
 
-       if (!(TAILQ_EMPTY(env->sc_tables) ||
-           event_initialized(&env->sc_ev))) {
+       if (!event_initialized(&env->sc_ev)) {
                evtimer_set(&env->sc_ev, hce_launch_checks, env);
                bzero(&tv, sizeof(tv));
                evtimer_add(&env->sc_ev, &tv);

Reply via email to