extern unsigned int rlim_fd_cur_at_boot;
extern unsigned int rlim_fd_max_at_boot;
+/* handlers to compute internal process limits, if they are not provided via
+ * cmd line or via configuration file.
+*/
+int compute_ideal_maxpipes();
+int compute_ideal_maxconn();
+int compute_ideal_maxsock(int maxconn);
+int check_if_maxsock_permitted(int maxsock);
+
/* handlers to manipulate system resources limits granted by OS to process and
* to tie them up with the internal process limits
*/
* Note that a value of zero means there is no need for pipes. -1 is never
* returned if global.maxconn is valid.
*/
-static int compute_ideal_maxpipes()
+int compute_ideal_maxpipes()
{
struct proxy *cur;
int nbfe = 0, nbbe = 0;
* used to rely on this value as the default one. The system will emit a
* warning indicating how many FDs are missing anyway if needed.
*/
-static int compute_ideal_maxconn()
+int compute_ideal_maxconn()
{
int ssl_sides = !!global.ssl_used_frontend + !!global.ssl_used_backend;
int engine_fds = global.ssl_used_async_engines * ssl_sides;
* temporarily change global.maxconn for the time needed to propagate the
* computations, and will reset it.
*/
-static int compute_ideal_maxsock(int maxconn)
+int compute_ideal_maxsock(int maxconn)
{
int maxpipes = global.maxpipes;
int maxsock = global.maxsock;
* that the setting is possible, so that we defer the error processing to the
* final stage in charge of enforcing this.
*/
-static int check_if_maxsock_permitted(int maxsock)
+int check_if_maxsock_permitted(int maxsock)
{
struct rlimit orig_limit, test_limit;
int ret;