瀏覽代碼

Now that btpd doesn't use select, we don't need to limit fd's to FD_SETSIZE

unless libevent uses the select method.
master
Richard Nyberg 18 年之前
父節點
當前提交
fb64d693f1
共有 1 個檔案被更改,包括 3 行新增1 行删除
  1. +3
    -1
      btpd/net.c

+ 3
- 1
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;



Loading…
取消
儲存