#
# Makefile for the Squid Object Cache server
#
-# $Id: Makefile.am,v 1.195 2007/12/26 22:33:31 hno Exp $
+# $Id: Makefile.am,v 1.196 2007/12/27 14:55:47 hno Exp $
#
# Uncomment and customize the following to suit your needs:
#
DEFAULT_ACCESS_LOG = $(DEFAULT_LOG_PREFIX)/access.log
DEFAULT_STORE_LOG = $(DEFAULT_LOG_PREFIX)/store.log
DEFAULT_PID_FILE = $(DEFAULT_LOG_PREFIX)/squid.pid
+DEFAULT_NETDB_FILE = $(DEFAULT_LOG_PREFIX)/netdb.state
DEFAULT_SWAP_DIR = $(localstatedir)/cache
DEFAULT_PINGER = $(libexecdir)/`echo pinger | sed '$(transform);s/$$/$(EXEEXT)/'`
DEFAULT_UNLINKD = $(libexecdir)/`echo unlinkd | sed '$(transform);s/$$/$(EXEEXT)/'`
s%@DEFAULT_ACCESS_LOG@%$(DEFAULT_ACCESS_LOG)%g;\
s%@DEFAULT_STORE_LOG@%$(DEFAULT_STORE_LOG)%g;\
s%@DEFAULT_PID_FILE@%$(DEFAULT_PID_FILE)%g;\
+ s%@DEFAULT_NETDB_FILE@%$(DEFAULT_NETDB_FILE)%g;\
s%@DEFAULT_SWAP_DIR@%$(DEFAULT_SWAP_DIR)%g;\
s%@DEFAULT_ICON_DIR@%$(DEFAULT_ICON_DIR)%g;\
s%@DEFAULT_MIB_PATH@%$(DEFAULT_MIB_PATH)%g;\
#
-# $Id: cf.data.pre,v 1.489 2007/12/14 23:11:46 amosjeffries Exp $
+# $Id: cf.data.pre,v 1.490 2007/12/27 14:55:47 hno Exp $
#
# SQUID Web Proxy Cache http://www.squid-cache.org/
# ----------------------------------------------------------
enabled in which case performance will suffer badly anyway..).
DOC_END
+NAME: netdb_filename
+TYPE: string
+DEFAULT: @DEFAULT_NETDB_FILE@
+LOC: Config.netdbFilename
+DOC_START
+ A filename where Squid stores it's netdb state between restarts.
+ To disable, enter "none".
+DOC_END
+
COMMENT_START
OPTIONS FOR FTP GATEWAYING
-----------------------------------------------------------------------------
/*
- * $Id: net_db.cc,v 1.199 2007/12/14 23:11:47 amosjeffries Exp $
+ * $Id: net_db.cc,v 1.200 2007/12/27 14:55:47 hno Exp $
*
* DEBUG: section 38 Network Measurement Database
* AUTHOR: Duane Wessels
return 0;
}
-static void
-netdbPath(char *path)
-{
- /* this is completely wrong. the netdb location should be memoised
- * separately from the cache dirs, and also be settable in
- * squid.conf RBC 20041225
- */
- snprintf(path, SQUID_MAXPATHLEN, "%s/netdb_state",
- dynamic_cast<SwapDir *>(Config.cacheSwap.swapDirs[0].getRaw())->path);
-}
-
static void
netdbSaveState(void *foo)
{
- LOCAL_ARRAY(char, path, SQUID_MAXPATHLEN);
+ if (strcmp(config.netdbFilename, "none") == 0)
+ return;
+
Logfile *lf;
netdbEntry *n;
net_db_name *x;
struct timeval start = current_time;
int count = 0;
- netdbPath(path);
/*
* This was nicer when we were using stdio, but thanks to
* Solaris bugs, its a bad idea. fopen can fail if more than
* unlink() is here because there is currently no way to make
* logfileOpen() use O_TRUNC.
*/
- unlink(path);
- lf = logfileOpen(path, 4096, 0);
+ unlink(Config.netdbFilename);
+ lf = logfileOpen(Config.netdbFilename, 4096, 0);
if (NULL == lf) {
debugs(50, 1, "netdbSaveState: " << path << ": " << xstrerror());
static void
netdbReloadState(void)
{
- LOCAL_ARRAY(char, path, SQUID_MAXPATHLEN);
+ if (strcmp(config.netdbFilename, "none") == 0)
+ return;
+
char *s;
int fd;
int l;
int count = 0;
struct timeval start = current_time;
- netdbPath(path);
/*
* This was nicer when we were using stdio, but thanks to
* Solaris bugs, its a bad idea. fopen can fail if more than
* 256 FDs are open.
*/
- fd = file_open(path, O_RDONLY | O_BINARY);
+ fd = file_open(Config.netdbFilename, O_RDONLY | O_BINARY);
if (fd < 0)
return;