]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Summary: Coss bugfixes.
authorrobertc <>
Mon, 1 Sep 2003 03:20:08 +0000 (03:20 +0000)
committerrobertc <>
Mon, 1 Sep 2003 03:20:08 +0000 (03:20 +0000)
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.

src/Debug.h
src/SwapDir.cc
src/cache_cf.cc
src/cf.data.pre
src/debug.cc
src/fs/coss/store_dir_coss.cc

index 0cc3f1d1b8d643b8040e5efa558c4ed286de49ff..6b9d90c6a82f6705565e1ab6a8ff0554787a91fe 100644 (file)
@@ -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;
index f022ca865c6e8d8a2de440bf8500d2f09095fd96..60220703161518a7faefdcd83e6883cfb74aa15e 100644 (file)
@@ -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();
index 271c7b356ba66f1030135ac335220865e154cae8..452b91f2f603609f58a9aef2a4e9f836c3d96a5d 100644 (file)
@@ -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)
 {
index 6277c517e187d4bbef2f0d6e36dd177f168cbb90..8b81eb01ee44089f6f2c1fe27ce323809d88fa47 100644 (file)
@@ -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
index 8c03eacc03b238b1dcd137ced62f07b98941aee7..7b23d563c7b0291f9e7c984e0f8f34ad16b76b4d 100644 (file)
@@ -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);
 
index 454f44b349192e6de8c0abf7fecd8b18b192e140..e7c7311661d8414c66ab69888a6b8f893c44ae0a 100644 (file)
@@ -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))