]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
- cf.data.pre had disabled all cachemgr passwords
authorwessels <>
Tue, 15 Jul 1997 09:29:00 +0000 (09:29 +0000)
committerwessels <>
Tue, 15 Jul 1997 09:29:00 +0000 (09:29 +0000)
- nuke ENTRY_HTML flag
- set defaults for more things in globals.h
- Added storeComplete() call for bad cachemgr passwords.
- icpProcessMISS needed to have protoDispatch() AFTER storeClientCopy()
  because if cachemgr passwd was incorrect, storeComplete() would
  get called before storeClientCopy().
- in storeCreateEntry(), set the key before other stuff, notably
  call storeReleaseRequest().
- Little more debugging to store.c

src/cf.data.pre
src/defines.h
src/globals.h
src/gopher.cc
src/stat.cc
src/store.cc

index 51c195b02b7c83d9d08570283cdd8e4609c0c0da..f885436af50e220ab87c1bdc27e36d530032770d 100644 (file)
@@ -1647,7 +1647,7 @@ DOC_END
 
 NAME: cachemgr_passwd
 TYPE: cachemgrpasswd
-DEFAULT: disable all
+DEFAULT: none
 LOC: Config.passwd_list
 DOC_START
        Specify passwords for cachemgr operations.
@@ -1706,8 +1706,8 @@ DOC_END
 #swap_level2_dirs 256
 
 NAME: store_avg_object_size
-COMMENT: (bytes)
-TYPE: size_t
+COMMENT: (kbytes)
+TYPE: kb_size_t
 DEFAULT: 20 KB
 LOC: Config.Store.avgObjectSize
 DOC_START
index fd9a140a98f1407a5ee0aa10d268894dce67684c..d519d4ea3904fab0cea17ac87391a18ef14cee1e 100644 (file)
 #define HIERARCHICAL           (1<<13)         /* can we query neighbors? */
 #define KEY_PRIVATE            (1<<12)         /* is the key currently private? */
 #define ENTRY_DISPATCHED       (1<<11)
-#define ENTRY_HTML             (1<<10)
+#define ENTRY_UNUSED10                 (1<<10)
 #define KEY_CHANGE             (1<<9)
 #define KEY_URL                (1<<8)
 #define ENTRY_CACHABLE         (1<<7)
index 174ef1febe2e7413cfe33c1ab1b7895af01e497b..618aec78e41aefa5b8477df663689de448ea8591 100644 (file)
@@ -7,23 +7,23 @@ extern cacheinfo *HTTPCacheInfo;
 extern cacheinfo *ICPCacheInfo;
 extern char *ConfigFile;       /* NULL */
 extern char *IcpOpcodeStr[];
-extern char *dns_error_message;
+extern char *dns_error_message; /* NULL */
 extern char *log_tags[];
-extern char *tmp_error_buf;
-extern char *volatile debug_options;
+extern char *tmp_error_buf; /* NULL */
+extern char *volatile debug_options; /* NULL */
 extern char ThisCache[SQUIDHOSTNAMELEN << 1];
 extern char config_input_line[BUFSIZ];
-extern const char *AclMatchedName;
+extern const char *AclMatchedName; /* NULL */
 extern const char *DefaultConfigFile;  /* DEFAULT_CONFIG_FILE */
 extern const char *DefaultSwapDir;     /* DEFAULT_SWAP_DIR */
 extern const char *RequestMethodStr[];
 extern const char *cfg_filename;       /* NULL */
 extern const char *const appname; /* "squid" */
-extern const char *const close_bracket;
+extern const char *const close_bracket; /* "}\n" */
 extern const char *const dash_str; /* "-" */
 extern const char *const localhost; /* "127.0.0.1" */
 extern const char *const null_string; /* "" */
-extern const char *const open_bracket;
+extern const char *const open_bracket; /* "{\n" */
 extern const char *const version_string ; /* SQUID_VERSION */
 extern const char *const w_space; /* " \t\n\r" */
 extern const char *fdstatTypeStr[];
@@ -33,7 +33,7 @@ extern const char *pingStatusStr[];
 extern const char *storeStatusStr[];
 extern const char *swapStatusStr[];
 extern dnsStatData DnsStats;
-extern fde *fd_table;
+extern fde *fd_table; /* NULL */
 extern int Biggest_FD; /* -1 */
 extern int HttpSockets[MAXHTTPPORTS];
 extern int NDnsServersAlloc;   /* 0 */
@@ -43,10 +43,10 @@ extern int Squid_MaxFD; /* SQUID_MAXFD */
 extern int config_lineno;      /* 0 */
 extern int configured_once; /* 0 */
 extern int debugLevels[MAX_DEBUG_SECTIONS];
-extern int do_mallinfo;
+extern int do_mallinfo; /* 0 */
 extern int do_reuse; /* 1 */
 extern int hash_links_allocated;
-extern int icmp_sock;
+extern int icmp_sock; /* -1 */
 extern int neighbors_do_private_keys; /* 1 */
 extern int opt_accel_uses_host; /* 0 */
 extern int opt_catch_signals; /* 1 */
@@ -60,7 +60,7 @@ extern int opt_syslog_enable; /* 0 */
 extern int opt_udp_hit_obj; /* 0 */
 extern int opt_zap_disk_store; /* 0 */
 extern int select_loops; /* 0 */
-extern int syslog_enable;
+extern int syslog_enable; /* 0 */
 extern int theInIcpConnection; /* -1 */
 extern int theOutIcpConnection; /* -1 */
 extern int vhost_mode; /* 0 */
@@ -70,13 +70,13 @@ extern stmem_stats disk_stats;
 extern stmem_stats mem_obj_pool;
 extern stmem_stats request_pool;
 extern stmem_stats sm_stats;
-extern struct _acl_deny_info_list *DenyInfoList;
+extern struct _acl_deny_info_list *DenyInfoList; /* NULL */
 extern struct in_addr any_addr;
 extern struct in_addr local_addr;
 extern struct in_addr no_addr;
 extern struct in_addr theOutICPAddr;
 extern struct timeval current_time;
-extern time_t squid_curtime;
+extern time_t squid_curtime; /* 0 */
 extern time_t squid_starttime; /* 0 */
 extern volatile int reconfigure_pending; /* 0 */
 extern volatile int shutdown_pending; /* 0 */
index e5a4c77c76b2a6f15588293b7d0c52a193b671fc..ccc7b3f841fcccdeaa2fe913f387a0b661be3afc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: gopher.cc,v 1.88 1997/07/14 23:50:17 wessels Exp $
+ * $Id: gopher.cc,v 1.89 1997/07/15 03:29:02 wessels Exp $
  *
  * DEBUG: section 10    Gopher
  * AUTHOR: Harvest Derived
@@ -770,26 +770,19 @@ gopherSendComplete(int fd, char *buf, int size, int errflag, void *data)
      * stuff.  Do it anyway even though request is not HTML type.
      */
     gopherMimeCreate(gopherState);
-
-    if (!BIT_TEST(entry->flag, ENTRY_HTML))
-       gopherState->conversion = NORMAL;
-    else
        switch (gopherState->type_id) {
-
        case GOPHER_DIRECTORY:
            /* we got to convert it first */
            BIT_SET(entry->flag, DELAY_SENDING);
            gopherState->conversion = HTML_DIR;
            gopherState->HTML_header_added = 0;
            break;
-
        case GOPHER_INDEX:
            /* we got to convert it first */
            BIT_SET(entry->flag, DELAY_SENDING);
            gopherState->conversion = HTML_INDEX_RESULT;
            gopherState->HTML_header_added = 0;
            break;
-
        case GOPHER_CSO:
            /* we got to convert it first */
            BIT_SET(entry->flag, DELAY_SENDING);
@@ -797,16 +790,11 @@ gopherSendComplete(int fd, char *buf, int size, int errflag, void *data)
            gopherState->cso_recno = 0;
            gopherState->HTML_header_added = 0;
            break;
-
        default:
            gopherState->conversion = NORMAL;
-
-       }
+    }
     /* Schedule read reply. */
-    commSetSelect(fd,
-       COMM_SELECT_READ,
-       gopherReadReply,
-       gopherState, 0);
+    commSetSelect(fd, COMM_SELECT_READ, gopherReadReply, gopherState, 0);
     if (buf)
        put_free_4k_page(buf);  /* Allocated by gopherSendRequest. */
 }
@@ -881,8 +869,7 @@ gopherStart(StoreEntry * entry)
        return;
     }
     if (((gopherState->type_id == GOPHER_INDEX) || (gopherState->type_id == GOPHER_CSO))
-       && (strchr(gopherState->request, '?') == NULL)
-       && (BIT_TEST(entry->flag, ENTRY_HTML))) {
+       && (strchr(gopherState->request, '?') == NULL)) {
        /* Index URL without query word */
        /* We have to generate search page back to client. No need for connection */
        gopherMimeCreate(gopherState);
index 5a69b52c7994fc9ffbf036b23f61eeee7709ce0a..3247872aee45245d8a4c68424dd2b185500e52e2 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: stat.cc,v 1.147 1997/07/07 05:29:54 wessels Exp $
+ * $Id: stat.cc,v 1.148 1997/07/15 03:29:05 wessels Exp $
  *
  * DEBUG: section 18    Cache Manager Statistics
  * AUTHOR: Harvest Derived
@@ -305,8 +305,6 @@ describeFlags(const StoreEntry * entry)
        strcat(buf, "KC,");
     if (BIT_TEST(flags, KEY_URL))
        strcat(buf, "KU,");
-    if (BIT_TEST(flags, ENTRY_HTML))
-       strcat(buf, "HT,");
     if (BIT_TEST(flags, ENTRY_DISPATCHED))
        strcat(buf, "ED,");
     if (BIT_TEST(flags, KEY_PRIVATE))
index 282c8fd1d65320364157d1f7e2b703e316b21e39..135c4c51430cbc652a8a2eeb9dcfbb489b03aa4d 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.269 1997/07/14 23:45:06 wessels Exp $
+ * $Id: store.cc,v 1.270 1997/07/15 03:29:05 wessels Exp $
  *
  * DEBUG: section 20    Storeage Manager
  * AUTHOR: Harvest Derived
@@ -543,7 +543,8 @@ storeReleaseRequest(StoreEntry * e)
        return;
     if (!storeEntryLocked(e))
        fatal_dump("storeReleaseRequest: unlocked entry");
-    debug(20, 3) ("storeReleaseRequest: '%s'\n", e->key);
+    debug(20, 3) ("storeReleaseRequest: '%s'\n",
+       e->key ? e->key : e->url);
     BIT_SET(e->flag, RELEASE_REQUEST);
     storeSetPrivateKey(e);
 }
@@ -726,6 +727,10 @@ storeCreateEntry(const char *url, int flags, method_t method)
     e->url = xstrdup(url);
     meta_data.url_strings += strlen(url);
     e->method = method;
+    if (neighbors_do_private_keys || !BIT_TEST(flags, REQ_HIERARCHICAL))
+       storeSetPrivateKey(e);
+    else
+       storeSetPublicKey(e);
     if (BIT_TEST(flags, REQ_CACHABLE)) {
        BIT_SET(e->flag, ENTRY_CACHABLE);
        BIT_RESET(e->flag, RELEASE_REQUEST);
@@ -737,12 +742,6 @@ storeCreateEntry(const char *url, int flags, method_t method)
        BIT_SET(e->flag, HIERARCHICAL);
     else
        BIT_RESET(e->flag, HIERARCHICAL);
-    if (neighbors_do_private_keys || !BIT_TEST(flags, REQ_HIERARCHICAL))
-       storeSetPrivateKey(e);
-    else
-       storeSetPublicKey(e);
-    BIT_SET(e->flag, ENTRY_HTML);
-
     e->store_status = STORE_PENDING;
     storeSetMemStatus(e, NOT_IN_MEMORY);
     e->swap_status = NO_SWAP;
@@ -782,7 +781,6 @@ storeAddDiskRestore(const char *url, int file_number, int size, time_t expires,
     storeSetPublicKey(e);
     BIT_SET(e->flag, ENTRY_CACHABLE);
     BIT_RESET(e->flag, RELEASE_REQUEST);
-    BIT_SET(e->flag, ENTRY_HTML);
     e->store_status = STORE_OK;
     storeSetMemStatus(e, NOT_IN_MEMORY);
     e->swap_status = SWAP_OK;
@@ -869,8 +867,10 @@ InvokeHandlers(StoreEntry * e)
     struct _store_client *sc;
     ssize_t size;
     assert(mem->clients != NULL || mem->nclients == 0);
+    debug(20,3)("InvokeHandlers: %s\n", e->key);
     /* walk the entire list looking for valid callbacks */
     for (i = 0; i < mem->nclients; i++) {
+        debug(20,3)("InvokeHandlers: checking client #%d\n", i);
        sc = &mem->clients[i];
        if (sc->callback_data == NULL)
            continue;
@@ -882,6 +882,7 @@ InvokeHandlers(StoreEntry * e)
            sc->copy_offset,
            sc->copy_buf,
            sc->copy_size);
+        debug(20,3)("InvokeHandlers: calling handler: %p\n", callback);
        callback(sc->callback_data, sc->copy_buf, size);
     }
 }
@@ -2133,6 +2134,13 @@ storeClientCopy(StoreEntry * e,
     assert(seen_offset <= mem->e_current_len);
     assert(copy_offset >= mem->e_lowest_offset);
     assert(recurse_detect < 3);        /* could == 1 for IMS not modified's */
+    debug(20,3)("storeClientCopy: %s, seen %d want %d, size %d, cb %p, cbdata %p\n",
+       e->key,
+       (int) seen_offset,
+       (int) copy_offset,
+       (int) size,
+       callback,
+       data);
     if ((ci = storeClientListSearch(mem, data)) < 0)
        fatal_dump("storeClientCopy: Unregistered client");
     sc = &mem->clients[ci];
@@ -2225,7 +2233,7 @@ storeInitHashValues(void)
     int i;
     /* Calculate size of hash table (maximum currently 64k buckets).  */
     i = Config.Swap.maxSize / Config.Store.avgObjectSize;
-    debug(20, 1) ("Swap maxSize %d kB, estimated %d objects\n",
+    debug(20, 1) ("Swap maxSize %d KB, estimated %d objects\n",
        Config.Swap.maxSize, i);
     i /= Config.Store.objectsPerBucket;
     debug(20, 1) ("Target number of buckets: %d\n", i);