From: robertc <> Date: Mon, 1 Sep 2003 03:20:08 +0000 (+0000) Subject: Summary: Coss bugfixes. X-Git-Tag: SQUID_3_0_PRE4~1229 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d9e04dc7583103e3a6329b71e433bc14116b35bc;p=thirdparty%2Fsquid.git Summary: Coss bugfixes. Keywords: Remove unused prototypes from store_dir_coss.cc. Fixup a couple of bugs in the new coss option parsing. Bugfix debug options to allow debugging of the parser. --- diff --git a/src/Debug.h b/src/Debug.h index 0cc3f1d1b8..6b9d90c6a8 100644 --- a/src/Debug.h +++ b/src/Debug.h @@ -1,6 +1,6 @@ /* - * $Id: Debug.h,v 1.6 2003/07/16 05:27:17 robertc Exp $ + * $Id: Debug.h,v 1.7 2003/08/31 21:20:08 robertc Exp $ * * DEBUG: section 0 Debug Routines * AUTHOR: Harvest Derived @@ -60,6 +60,7 @@ public: static int level; static std::ostream &getDebugOut(); static void finishDebug(); + static void parseOptions(char const *); private: static std::ostringstream *CurrentDebug; diff --git a/src/SwapDir.cc b/src/SwapDir.cc index f022ca865c..6022070316 100644 --- a/src/SwapDir.cc +++ b/src/SwapDir.cc @@ -1,6 +1,6 @@ /* - * $Id: SwapDir.cc,v 1.4 2003/07/22 15:23:01 robertc Exp $ + * $Id: SwapDir.cc,v 1.5 2003/08/31 21:20:08 robertc Exp $ * * DEBUG: section ?? Swap Dir base object * AUTHOR: Robert Collins @@ -154,6 +154,8 @@ SwapDir::parseOptions(int reconfiguring) if (value) *value++ = '\0'; /* cut on = */ + debugs(3,2, "SwapDir::parseOptions: parsing store option '" << name << "'='" << (value ? value : "") << "'"); + if (newOption) if (!newOption->parse(name, value, reconfiguring)) self_destruct(); diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 271c7b356b..452b91f2f6 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.cc,v 1.448 2003/08/13 16:05:22 wessels Exp $ + * $Id: cache_cf.cc,v 1.449 2003/08/31 21:20:08 robertc Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -2014,6 +2014,8 @@ parse_onoff(int *var) #define free_onoff free_int #define dump_eol dump_string #define free_eol free_string +#define dump_debug dump_string +#define free_debug free_string static void dump_refreshpattern(StoreEntry * entry, const char *name, refresh_t * head) @@ -2234,6 +2236,15 @@ parse_eol(char *volatile *var) *var = xstrdup((char *) token); } +void +parse_debug(char *volatile *var) +{ + parse_eol(var); + safe_free(debug_options) + debug_options = xstrdup(Config.debugOptions); + Debug::parseOptions(Config.debugOptions); +} + static void dump_time_t(StoreEntry * entry, const char *name, time_t var) { diff --git a/src/cf.data.pre b/src/cf.data.pre index 6277c517e1..8b81eb01ee 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.340 2003/08/27 21:19:32 wessels Exp $ +# $Id: cf.data.pre,v 1.341 2003/08/31 21:20:08 robertc Exp $ # # # SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -1323,7 +1323,7 @@ DOC_END NAME: debug_options -TYPE: eol +TYPE: debug DEFAULT: ALL,1 LOC: Config.debugOptions DOC_START diff --git a/src/debug.cc b/src/debug.cc index 8c03eacc03..7b23d563c7 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -1,6 +1,6 @@ /* - * $Id: debug.cc,v 1.95 2003/07/14 08:21:56 robertc Exp $ + * $Id: debug.cc,v 1.96 2003/08/31 21:20:08 robertc Exp $ * * DEBUG: section 0 Debug Routines * AUTHOR: Harvest Derived @@ -232,7 +232,7 @@ debugOpenLog(const char *logfile) { } void -_db_init(const char *logfile, const char *options) { +Debug::parseOptions(char const *options) { int i; char *p = NULL; char *s = NULL; @@ -248,6 +248,11 @@ _db_init(const char *logfile, const char *options) { xfree(p); } +} + +void +_db_init(const char *logfile, const char *options) { + Debug::parseOptions(options); debugOpenLog(logfile); diff --git a/src/fs/coss/store_dir_coss.cc b/src/fs/coss/store_dir_coss.cc index 454f44b349..e7c7311661 100644 --- a/src/fs/coss/store_dir_coss.cc +++ b/src/fs/coss/store_dir_coss.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir_coss.cc,v 1.49 2003/08/30 06:39:24 robertc Exp $ + * $Id: store_dir_coss.cc,v 1.50 2003/08/31 21:20:10 robertc Exp $ * * DEBUG: section 47 Store COSS Directory Routines * AUTHOR: Eric Stern @@ -49,9 +49,6 @@ MemPool *coss_index_pool = NULL; typedef struct _RebuildState RebuildState; -void storeCossDirParseBlkSize(SwapDir *, const char *, const char *, int); -void storeCossDirDumpBlkSize(StoreEntry *, const char *, const SwapDir *); - struct _RebuildState { CossSwapDir *sd; @@ -900,7 +897,7 @@ CossSwapDir::dump(StoreEntry &entry)const } -CossSwapDir::CossSwapDir() : SwapDir ("coss"), fd (-1), swaplog_fd(-1), count(0), current_membuf (NULL), current_offset(0), numcollisions(0) +CossSwapDir::CossSwapDir() : SwapDir ("coss"), fd (-1), swaplog_fd(-1), count(0), current_membuf (NULL), current_offset(0), numcollisions(0), blksz_bits(0) { membufs.head = NULL; membufs.tail = NULL; @@ -912,6 +909,14 @@ CossSwapDir::CossSwapDir() : SwapDir ("coss"), fd (-1), swaplog_fd(-1), count(0) bool CossSwapDir::optionBlockSizeParse(const char *option, const char *value, int reconfiguring) { + assert(option); + + if (strcmp(option, "block-size") != 0) + return false; + + if (!value) + self_destruct(); + int blksz = atoi(value); if (blksz == (1 << blksz_bits))