if (Config.errHtmlText == NULL)
Config.errHtmlText = xstrdup(null_string);
+#if !HAVE_SETRLIMIT || !defined(RLIMIT_NOFILE)
+ if (Config.max_filedescriptors > 0) {
+ debugs(0, DBG_WARNING, "WARNING: max_filedescriptors disabled. Operating System setrlimit(RLIMIT_NOFILE) is missing.");
+ }
+#elif USE_SELECT || USE_SELECT_WIN32
+ if (Config.max_filedescriptors > FD_SETSIZE) {
+ debugs(0, DBG_WARNING, "WARNING: max_filedescriptors limited to " << FD_SETSIZE << " by select() algorithm.");
+ }
+#endif
+
storeConfigure();
snprintf(ThisCache, sizeof(ThisCache), "%s (%s)",
} else if (Config.max_filedescriptors > 0) {
#if USE_SELECT || USE_SELECT_WIN32
/* select() breaks if this gets set too big */
- if (Config.max_filedescriptors > FD_SETSIZE)
+ if (Config.max_filedescriptors > FD_SETSIZE) {
rl.rlim_cur = FD_SETSIZE;
- else
+ debugs(50, DBG_CRITICAL, "WARNING: 'max_filedescriptors " << Config.max_filedescriptors << "' does not work with select()");
+ } else
#endif
rl.rlim_cur = Config.max_filedescriptors;
if (rl.rlim_cur > rl.rlim_max)
rl.rlim_max = rl.rlim_cur;
if (setrlimit(RLIMIT_NOFILE, &rl)) {
- debugs(50, DBG_CRITICAL, "setrlimit: RLIMIT_NOFILE: " << xstrerror());
+ debugs(50, DBG_CRITICAL, "ERROR: setrlimit: RLIMIT_NOFILE: " << xstrerror());
getrlimit(RLIMIT_NOFILE, &rl);
rl.rlim_cur = rl.rlim_max;
if (setrlimit(RLIMIT_NOFILE, &rl)) {
- debugs(50, DBG_CRITICAL, "setrlimit: RLIMIT_NOFILE: " << xstrerror());
+ debugs(50, DBG_CRITICAL, "ERROR: setrlimit: RLIMIT_NOFILE: " << xstrerror());
}
}
}
if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
- debugs(50, DBG_CRITICAL, "setrlimit: RLIMIT_NOFILE: " << xstrerror());
+ debugs(50, DBG_CRITICAL, "ERROR: getrlimit: RLIMIT_NOFILE: " << xstrerror());
} else {
Squid_MaxFD = rl.rlim_cur;
}