mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-12-04 14:46:30 -05:00
Feature: Warn about FD_SETSIZE being too small
This commit is contained in:
parent
8efbbed486
commit
85d55c850d
@ -33,6 +33,10 @@
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OPENSSL
|
||||
#include <openssl/opensslv.h>
|
||||
#endif
|
||||
@ -1836,6 +1840,10 @@ static void command_version (client_t *client, source_t *source, adm
|
||||
reportxml_helper_add_value_string(resource, "version", ICECAST_VERSION_STRING);
|
||||
reportxml_helper_add_value_int(resource, "address-bits", sizeof(void*)*8);
|
||||
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
reportxml_helper_add_value_int(resource, "fd-set-size", FD_SETSIZE);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GETHOSTNAME
|
||||
if (true) {
|
||||
char hostname[80];
|
||||
|
@ -25,6 +25,9 @@
|
||||
#ifndef _WIN32
|
||||
#include <fnmatch.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/uri.h>
|
||||
@ -1045,6 +1048,13 @@ int config_parse_file(const char *filename, ice_config_t *configuration)
|
||||
ICECAST_LOG_ERROR("Client limit (%i) is too small for given source limit (%i)", configuration->client_limit, configuration->source_limit);
|
||||
}
|
||||
|
||||
#ifndef HAVE_POLL
|
||||
if (configuration->client_limit > (FD_SETSIZE - 32)) {
|
||||
configuration->config_problems |= CONFIG_PROBLEM_VALIDATION;
|
||||
ICECAST_LOG_ERROR("Client limit (%i) is too big for FD_SETSIZE (%i)", configuration->client_limit, FD_SETSIZE);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user