From fb64d693f13842a6220f4badec9b93b3b2e13d88 Mon Sep 17 00:00:00 2001 From: Richard Nyberg Date: Tue, 31 Oct 2006 19:32:04 +0000 Subject: Now that btpd doesn't use select, we don't need to limit fd's to FD_SETSIZE unless libevent uses the select method. --- btpd/net.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/btpd/net.c b/btpd/net.c index c6af6ba..17271f0 100644 --- a/btpd/net.c +++ b/btpd/net.c @@ -655,7 +655,9 @@ net_init(void) m_bw_bytes_out = net_bw_limit_out; m_bw_bytes_in = net_bw_limit_in; - int safe_fds = min(getdtablesize(), FD_SETSIZE) * 4 / 5; + int safe_fds = getdtablesize() * 4 / 5; + if (strcmp(event_get_method(), "select") == 0) + safe_fds = min(safe_fds, FD_SETSIZE * 4 / 5); if (net_max_peers == 0 || net_max_peers > safe_fds) net_max_peers = safe_fds; -- cgit 1.4.1