View | Details | Raw Unified | Return to bug 2756 | Differences between
and this patch

Collapse All | Expand All

(-)a/serverloop.c (-2 / +10 lines)
Lines 204-209 wait_until_can_do_something(int connection_in, int connection_out, Link Here
204
	int ret;
204
	int ret;
205
	time_t minwait_secs = 0;
205
	time_t minwait_secs = 0;
206
	int client_alive_scheduled = 0;
206
	int client_alive_scheduled = 0;
207
	static time_t last_client_time;
207
208
208
	/* Allocate and update select() masks for channel descriptors. */
209
	/* Allocate and update select() masks for channel descriptors. */
209
	channel_prepare_select(readsetp, writesetp, maxfdp, nallocp,
210
	channel_prepare_select(readsetp, writesetp, maxfdp, nallocp,
Lines 268-275 wait_until_can_do_something(int connection_in, int connection_out, Link Here
268
		memset(*writesetp, 0, *nallocp);
269
		memset(*writesetp, 0, *nallocp);
269
		if (errno != EINTR)
270
		if (errno != EINTR)
270
			error("select: %.100s", strerror(errno));
271
			error("select: %.100s", strerror(errno));
271
	} else if (ret == 0 && client_alive_scheduled)
272
	} else if (client_alive_scheduled) {
272
		client_alive_check();
273
		if (ret == 0)  /* timeout */
274
			client_alive_check();
275
		if (FD_ISSET(connection_in, *readsetp))
276
			last_client_time = monotime();
277
		else if (last_client_time != 0 &&
278
		    last_client_time + options.client_alive_interval < monotime())
279
			client_alive_check();
280
	}
273
281
274
	notify_done(*readsetp);
282
	notify_done(*readsetp);
275
}
283
}

Return to bug 2756