Skip to content
Snippets Groups Projects
Commit 851297e2 authored by Marek Vavrusa's avatar Marek Vavrusa
Browse files

Revert "Count inactivity since last poll time."

This actually solves only half of the problem, reverting for now.

This reverts commit 8caf9941.
parent 8caf9941
No related branches found
No related tags found
No related merge requests found
......@@ -595,7 +595,7 @@ int tcp_loop_worker(dthread_t *thread)
/* Accept clients. */
dbg_net("tcp: worker %p started\n", w);
fdset_t *set = &w->set;
timev_t next_sweep, last_poll_time;
timev_t next_sweep;
time_now(&next_sweep);
next_sweep.tv_sec += TCP_SWEEP_INTERVAL;
for (;;) {
......@@ -609,9 +609,6 @@ int tcp_loop_worker(dthread_t *thread)
if (nfds < 0)
continue;
/* Mark the time of the last poll. */
time_now(&last_poll_time);
/* Establish timeouts. */
rcu_read_lock();
int max_idle = conf()->max_conn_idle;
......@@ -658,12 +655,14 @@ int tcp_loop_worker(dthread_t *thread)
}
/* Sweep inactive. */
if (last_poll_time.tv_sec >= next_sweep.tv_sec) {
fdset_sweep(set, &tcp_sweep, NULL);
time_now(&next_sweep);
next_sweep.tv_sec += TCP_SWEEP_INTERVAL;
timev_t now;
if (time_now(&now) == 0) {
if (now.tv_sec >= next_sweep.tv_sec) {
fdset_sweep(set, &tcp_sweep, NULL);
memcpy(&next_sweep, &now, sizeof(next_sweep));
next_sweep.tv_sec += TCP_SWEEP_INTERVAL;
}
}
}
/* Stop whole unit. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment