]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] pre-compute t->expire in event_accept
authorWilly Tarreau <w@1wt.eu>
Sun, 29 Apr 2007 17:09:47 +0000 (19:09 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 29 Apr 2007 17:09:47 +0000 (19:09 +0200)
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

index bba3774ab444d66587ea84df79b85fa1900a162e..650db1fd7ff19c5784267fbbf0e256f461a4c8ae 100644 (file)
@@ -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)