Search
j0ke.net Open Build Service
>
Projects
>
ha
>
varnish
> bin__varnishd__cache_acceptor_epoll.c.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File bin__varnishd__cache_acceptor_epoll.c.patch of Package varnish
--- bin/varnishd/cache_acceptor_epoll.c.orig 2008-10-01 07:51:40.000000000 +0200 +++ bin/varnishd/cache_acceptor_epoll.c 2008-10-01 07:54:01.000000000 +0200 @@ -70,6 +70,8 @@ { struct epoll_event ev; double deadline; + int dotimer = 0; + double last_timeout = 0, tmp_timeout; struct sess *sp, *sp2; int i; @@ -81,7 +83,7 @@ vca_add(vca_pipes[0], vca_pipes); while (1) { - if (epoll_wait(epfd, &ev, 1, 100) > 0) { + if ((dotimer = epoll_wait(epfd, &ev, 1, 100)) > 0) { if (ev.data.ptr == vca_pipes) { i = read(vca_pipes[0], &sp, sizeof sp); assert(i == sizeof sp); @@ -102,6 +104,14 @@ } } } + tmp_timeout = TIM_mono(); + if ((tmp_timeout - last_timeout) > 60) { + last_timeout = tmp_timeout; + } else { + if (dotimer > 0 ) + continue; + } + /* check for timeouts */ deadline = TIM_real() - params->sess_timeout; VTAILQ_FOREACH_SAFE(sp, &sesshead, list, sp2) {