On Mac OS X getrlimit() returns 2^(sizeof(size_t) * 8) instead of the actual number of available socket descriptors.
This commit is contained in:
parent
e3cf41cb97
commit
928225fb7b
@ -69,7 +69,7 @@ size_t net_get_max_sockets()
|
|||||||
struct rlimit limits;
|
struct rlimit limits;
|
||||||
if (getrlimit(RLIMIT_NOFILE, &limits) == 0)
|
if (getrlimit(RLIMIT_NOFILE, &limits) == 0)
|
||||||
{
|
{
|
||||||
return limits.rlim_max;
|
return MIN(limits.rlim_max, 65536);
|
||||||
}
|
}
|
||||||
LOG_ERROR("getrlimit() failed");
|
LOG_ERROR("getrlimit() failed");
|
||||||
return 1024;
|
return 1024;
|
||||||
|
Loading…
Reference in New Issue
Block a user