From: wessels <> Date: Mon, 26 Jun 2000 04:28:42 +0000 (+0000) Subject: DW: X-Git-Tag: SQUID_3_0_PRE1~1924 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c1dd71ae4ab90baa7e5a7b784bc37eab1738ee22;p=thirdparty%2Fsquid.git DW: - gindent -br -ce -i4 -ci4 -l80 -nlp -npcs -npsl -d0 -sc -di0 -psl --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 90016c1db5..21e05acd6f 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.cc,v 1.350 2000/06/08 18:05:34 hno Exp $ + * $Id: cache_cf.cc,v 1.351 2000/06/25 22:28:42 wessels Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -1725,7 +1725,7 @@ dump_uri_whitespace(StoreEntry * entry, const char *name, int var) } static void -free_removalpolicy(RemovalPolicySettings **settings) +free_removalpolicy(RemovalPolicySettings ** settings) { if (!*settings) return; @@ -1736,7 +1736,7 @@ free_removalpolicy(RemovalPolicySettings **settings) } static void -parse_removalpolicy(RemovalPolicySettings **settings) +parse_removalpolicy(RemovalPolicySettings ** settings) { if (*settings) free_removalpolicy(settings); @@ -1746,7 +1746,7 @@ parse_removalpolicy(RemovalPolicySettings **settings) } static void -dump_removalpolicy(StoreEntry * entry, const char *name, RemovalPolicySettings *settings) +dump_removalpolicy(StoreEntry * entry, const char *name, RemovalPolicySettings * settings) { wordlist *args; storeAppendPrintf(entry, "%s %s", name, settings->type); @@ -1756,7 +1756,7 @@ dump_removalpolicy(StoreEntry * entry, const char *name, RemovalPolicySettings * args = args->next; } } - + #include "cf_parser.c" @@ -1859,5 +1859,3 @@ requirePathnameExists(const char *name, const char *path) if (stat(path, &sb) < 0) fatalf("%s: %s", path, xstrerror()); } - - diff --git a/src/ftp.cc b/src/ftp.cc index 53fed3d1f8..494018c18a 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.294 2000/05/31 10:00:24 hno Exp $ + * $Id: ftp.cc,v 1.295 2000/06/25 22:28:42 wessels Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -1880,7 +1880,6 @@ ftpAcceptDataConnection(int fd, void *data) comm_close(ftpState->ctrl.fd); return; } - fd = comm_accept(fd, &my_peer, &me); if (fd < 0) { debug(9, 1) ("ftpHandleDataAccept: comm_accept(%d): %s", fd, xstrerror()); diff --git a/src/globals.h b/src/globals.h index 884c91ff80..71afbea562 100644 --- a/src/globals.h +++ b/src/globals.h @@ -1,6 +1,6 @@ /* - * $Id: globals.h,v 1.92 2000/06/08 18:05:35 hno Exp $ + * $Id: globals.h,v 1.93 2000/06/25 22:28:42 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -149,5 +149,5 @@ extern storefs_entry_t *storefs_list; /* NULL */ extern int store_swap_low; /* 0 */ extern int store_swap_high; /* 0 */ extern int store_pages_max; /* 0 */ -extern ssize_t store_maxobjsize; /* -1 */ +extern ssize_t store_maxobjsize; /* -1 */ extern RemovalPolicy *mem_policy; diff --git a/src/protos.h b/src/protos.h index cd53a47fc9..5235c335ea 100644 --- a/src/protos.h +++ b/src/protos.h @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.371 2000/06/25 21:27:57 wessels Exp $ + * $Id: protos.h,v 1.372 2000/06/25 22:28:43 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -1182,9 +1182,10 @@ extern void logfilePrintf(Logfile * lf, const char *fmt,...); extern void logfilePrintf(va_alist); #endif -/* Removal Policies */ -RemovalPolicy * -createRemovalPolicy(RemovalPolicySettings *settings); +/* + * Removal Policies + */ +extern RemovalPolicy *createRemovalPolicy(RemovalPolicySettings * settings); /* * prototypes for system functions missing from system includes diff --git a/src/store.cc b/src/store.cc index 6e1856b3e4..0e2bc2b520 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.525 2000/06/08 18:05:36 hno Exp $ + * $Id: store.cc,v 1.526 2000/06/25 22:28:43 wessels Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -218,7 +218,7 @@ storePurgeMem(StoreEntry * e) } static void -storeEntryReferenced(StoreEntry *e) +storeEntryReferenced(StoreEntry * e) { SwapDir *SD; @@ -229,25 +229,25 @@ storeEntryReferenced(StoreEntry *e) SD->refobj(SD, e); } /* Notify the memory cache that we're referencing this object again */ - if(e->mem_obj) { + if (e->mem_obj) { if (mem_policy->Referenced) mem_policy->Referenced(mem_policy, e, &e->mem_obj->repl); } } static void -storeEntryDereferenced(StoreEntry *e) +storeEntryDereferenced(StoreEntry * e) { SwapDir *SD; /* Notify the fs that we're not referencing this object any more */ if (e->swap_filen > -1) { - SD = INDEXSD(e->swap_dirn); + SD = INDEXSD(e->swap_dirn); if (SD->unrefobj != NULL) SD->unrefobj(SD, e); } /* Notify the memory cache that we're not referencing this object any more */ - if(e->mem_obj) { + if (e->mem_obj) { if (mem_policy->Dereferenced) mem_policy->Dereferenced(mem_policy, e, &e->mem_obj->repl); } @@ -714,7 +714,7 @@ storeGetMemSpace(int size) debug(20, 2) ("storeGetMemSpace: Starting, need %d pages\n", pages_needed); /* XXX what to set as max_scan here? */ walker = mem_policy->PurgeInit(mem_policy, 100000); - while((e = walker->Next(walker))) { + while ((e = walker->Next(walker))) { storePurgeMem(e); released++; if (memInUse(MEM_STMEM_BUF) + pages_needed < store_pages_max) @@ -747,11 +747,11 @@ storeMaintainSwapSpace(void *datanotused) /* walk each fs */ for (i = 0; i < Config.cacheSwap.n_configured; i++) { /* call the maintain function .. */ - SD = INDEXSD(i); + SD = INDEXSD(i); /* XXX FixMe: This should be done "in parallell" on the different * cache_dirs, not one at a time. */ - if (SD->maintainfs != NULL) + if (SD->maintainfs != NULL) SD->maintainfs(SD); } if (store_swap_size > Config.Swap.maxSize) { @@ -1122,8 +1122,8 @@ storeSetMemStatus(StoreEntry * e, int new_status) hot_obj_count++; } else { if (EBIT_TEST(e->flags, ENTRY_SPECIAL)) { - debug(20, 4) ("storeSetMemStatus: special entry %s\n", - mem->url); + debug(20, 4) ("storeSetMemStatus: special entry %s\n", + mem->url); } else { mem_policy->Remove(mem_policy, e, &mem->repl); debug(20, 4) ("storeSetMemStatus: removed mem node %s\n", diff --git a/src/store_dir.cc b/src/store_dir.cc index 8081119794..1ab208f9ef 100644 --- a/src/store_dir.cc +++ b/src/store_dir.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir.cc,v 1.111 2000/06/08 18:05:36 hno Exp $ + * $Id: store_dir.cc,v 1.112 2000/06/25 22:28:43 wessels Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -387,7 +387,7 @@ storeDirWriteCleanLogs(int reopen) continue; } } - while(notdone) { + while (notdone) { notdone = 0; for (dirn = 0; dirn < Config.cacheSwap.n_configured; dirn++) { sd = &Config.cacheSwap.swapDirs[dirn]; @@ -419,7 +419,7 @@ storeDirWriteCleanLogs(int reopen) /* Flush */ for (dirn = 0; dirn < Config.cacheSwap.n_configured; dirn++) { sd = &Config.cacheSwap.swapDirs[dirn]; - sd->log.clean.done(sd); + sd->log.clean.done(sd); } if (reopen) storeDirOpenSwapLogs(); @@ -458,16 +458,15 @@ storeDirCallback(void) SwapDir *SD; static int ndir = 0; do { - j = 0; - for (i = 0; i < Config.cacheSwap.n_configured; i++) { - if (ndir >= Config.cacheSwap.n_configured) - ndir = ndir % Config.cacheSwap.n_configured; - SD = &Config.cacheSwap.swapDirs[ndir++]; - if (NULL == SD->callback) - continue; - j += SD->callback(SD); - } + j = 0; + for (i = 0; i < Config.cacheSwap.n_configured; i++) { + if (ndir >= Config.cacheSwap.n_configured) + ndir = ndir % Config.cacheSwap.n_configured; + SD = &Config.cacheSwap.swapDirs[ndir++]; + if (NULL == SD->callback) + continue; + j += SD->callback(SD); + } } while (j > 0); ndir++; } - diff --git a/src/store_log.cc b/src/store_log.cc index afb059305f..76c6e0df28 100644 --- a/src/store_log.cc +++ b/src/store_log.cc @@ -1,6 +1,6 @@ /* - * $Id: store_log.cc,v 1.16 2000/06/08 18:05:36 hno Exp $ + * $Id: store_log.cc,v 1.17 2000/06/25 22:28:43 wessels Exp $ * * DEBUG: section 20 Storage Manager Logging Functions * AUTHOR: Duane Wessels @@ -55,33 +55,33 @@ storeLog(int tag, const StoreEntry * e) if (EBIT_TEST(e->flags, ENTRY_DONT_LOG)) return; if (mem != NULL) { - if (mem->log_url == NULL) { - debug(20, 1) ("storeLog: NULL log_url for %s\n", mem->url); - storeMemObjectDump(mem); - mem->log_url = xstrdup(mem->url); - } - reply = mem->reply; - /* - * XXX Ok, where should we print the dir number here? - * Because if we print it before the swap file number, it'll break - * the existing log format. - */ - logfilePrintf(storelog, "%9d.%03d %-7s %02d %08X %s %4d %9d %9d %9d %s %d/%d %s %s\n", - (int) current_time.tv_sec, - (int) current_time.tv_usec / 1000, - storeLogTags[tag], - e->swap_dirn, - e->swap_filen, - storeKeyText(e->key), - reply->sline.status, - (int) reply->date, - (int) reply->last_modified, - (int) reply->expires, - strLen(reply->content_type) ? strBuf(reply->content_type) : "unknown", - reply->content_length, - (int) (mem->inmem_hi - mem->reply->hdr_sz), - RequestMethodStr[mem->method], - mem->log_url); + if (mem->log_url == NULL) { + debug(20, 1) ("storeLog: NULL log_url for %s\n", mem->url); + storeMemObjectDump(mem); + mem->log_url = xstrdup(mem->url); + } + reply = mem->reply; + /* + * XXX Ok, where should we print the dir number here? + * Because if we print it before the swap file number, it'll break + * the existing log format. + */ + logfilePrintf(storelog, "%9d.%03d %-7s %02d %08X %s %4d %9d %9d %9d %s %d/%d %s %s\n", + (int) current_time.tv_sec, + (int) current_time.tv_usec / 1000, + storeLogTags[tag], + e->swap_dirn, + e->swap_filen, + storeKeyText(e->key), + reply->sline.status, + (int) reply->date, + (int) reply->last_modified, + (int) reply->expires, + strLen(reply->content_type) ? strBuf(reply->content_type) : "unknown", + reply->content_length, + (int) (mem->inmem_hi - mem->reply->hdr_sz), + RequestMethodStr[mem->method], + mem->log_url); } else { /* no mem object. Most RELEASE cases */ logfilePrintf(storelog, "%9d.%03d %-7s %02d %08X %s ? ? ? ? ?/? ?/? ? ?\n", diff --git a/src/store_swapout.cc b/src/store_swapout.cc index 2027d00a77..19d6cbf5c5 100644 --- a/src/store_swapout.cc +++ b/src/store_swapout.cc @@ -1,6 +1,6 @@ /* - * $Id: store_swapout.cc,v 1.70 2000/06/02 17:30:48 wessels Exp $ + * $Id: store_swapout.cc,v 1.71 2000/06/25 22:28:43 wessels Exp $ * * DEBUG: section 20 Storage Manager Swapout Functions * AUTHOR: Duane Wessels @@ -159,8 +159,8 @@ storeSwapOut(StoreEntry * e) */ if ((on_disk = storeSwapOutObjectBytesOnDisk(mem)) - 1 < new_mem_lo) new_mem_lo = on_disk - 1; - if ( new_mem_lo == -1 ) - new_mem_lo = 0; /* the above might become -1 */ + if (new_mem_lo == -1) + new_mem_lo = 0; /* the above might become -1 */ } else if (new_mem_lo > 0) { /* * Its not swap-able, and we're about to delete a chunk, diff --git a/src/structs.h b/src/structs.h index 8ae03d8710..81b66f1ab6 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.339 2000/06/08 18:05:36 hno Exp $ + * $Id: structs.h,v 1.340 2000/06/25 22:28:43 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -1280,28 +1280,28 @@ struct _RemovalPolicyNode { struct _RemovalPolicy { char *_type; void *_data; - void (*Free)(RemovalPolicy *policy); - void (*Add)(RemovalPolicy *policy, StoreEntry *entry, RemovalPolicyNode *node); - void (*Remove)(RemovalPolicy *policy, StoreEntry *entry, RemovalPolicyNode *node); - void (*Referenced)(RemovalPolicy *policy, const StoreEntry *entry, RemovalPolicyNode *node); - void (*Dereferenced)(RemovalPolicy *policy, const StoreEntry *entry, RemovalPolicyNode *node); - RemovalPolicyWalker *(*WalkInit)(RemovalPolicy *policy); - RemovalPurgeWalker *(*PurgeInit)(RemovalPolicy *policy, int max_scan); + void (*Free) (RemovalPolicy * policy); + void (*Add) (RemovalPolicy * policy, StoreEntry * entry, RemovalPolicyNode * node); + void (*Remove) (RemovalPolicy * policy, StoreEntry * entry, RemovalPolicyNode * node); + void (*Referenced) (RemovalPolicy * policy, const StoreEntry * entry, RemovalPolicyNode * node); + void (*Dereferenced) (RemovalPolicy * policy, const StoreEntry * entry, RemovalPolicyNode * node); + RemovalPolicyWalker *(*WalkInit) (RemovalPolicy * policy); + RemovalPurgeWalker *(*PurgeInit) (RemovalPolicy * policy, int max_scan); }; struct _RemovalPolicyWalker { RemovalPolicy *_policy; void *_data; - const StoreEntry *(*Next)(RemovalPolicyWalker *walker); - void (*Done)(RemovalPolicyWalker *walker); + const StoreEntry *(*Next) (RemovalPolicyWalker * walker); + void (*Done) (RemovalPolicyWalker * walker); }; struct _RemovalPurgeWalker { RemovalPolicy *_policy; void *_data; int scanned, max_scan, locked; - StoreEntry *(*Next)(RemovalPurgeWalker *walker); - void (*Done)(RemovalPurgeWalker *walker); + StoreEntry *(*Next) (RemovalPurgeWalker * walker); + void (*Done) (RemovalPurgeWalker * walker); }; /* This structure can be freed while object is purged out from memory */ @@ -1909,4 +1909,3 @@ struct _Logfile { size_t bufsz; off_t offset; }; - diff --git a/src/typedefs.h b/src/typedefs.h index e0684479af..780349ea26 100644 --- a/src/typedefs.h +++ b/src/typedefs.h @@ -1,6 +1,6 @@ /* - * $Id: typedefs.h,v 1.104 2000/06/08 18:05:37 hno Exp $ + * $Id: typedefs.h,v 1.105 2000/06/25 22:28:43 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -308,5 +308,5 @@ typedef unsigned int delay_id; typedef struct _htcpReplyData htcpReplyData; #endif -typedef RemovalPolicy *REMOVALPOLICYCREATE(wordlist *args); +typedef RemovalPolicy *REMOVALPOLICYCREATE(wordlist * args); #endif /* _TYPEDEFS_H_ */