From 5465e111fdbba53a2d211631e9a72c3397769a8c Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sun, 29 Apr 2007 19:09:47 +0200 Subject: [PATCH] [MINOR] pre-compute t->expire in event_accept At the end of event_accept(), t->expire is computed with tv_min between two exclusive values. Let's simply assign it at the same time. --- src/client.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/client.c b/src/client.c index bba3774ab..650db1fd7 100644 --- a/src/client.c +++ b/src/client.c @@ -409,16 +409,19 @@ int event_accept(int fd) { tv_eternity(&s->req->cex); tv_eternity(&s->rep->rex); tv_eternity(&s->rep->wex); + tv_eternity(&t->expire); if (s->fe->clitimeout) { - if (EV_FD_ISSET(cfd, DIR_RD)) + if (EV_FD_ISSET(cfd, DIR_RD)) { tv_ms_add(&s->req->rex, &now, s->fe->clitimeout); - if (EV_FD_ISSET(cfd, DIR_WR)) + t->expire = s->req->rex; + } + if (EV_FD_ISSET(cfd, DIR_WR)) { tv_ms_add(&s->rep->wex, &now, s->fe->clitimeout); + t->expire = s->req->rex; + } } - tv_min(&t->expire, &s->req->rex, &s->rep->wex); - task_queue(t); if (p->mode != PR_MODE_HEALTH) -- 2.47.3