From: wessels <> Date: Tue, 2 Jan 2001 07:09:55 +0000 (+0000) Subject: indent -br -ce -i4 -ci4 -l80 -nlp -npcs -npsl -d0 -sc -di0 -psl X-Git-Tag: SQUID_3_0_PRE1~1712 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f0debecbfa674d2a4e438d6d6e2c4b5b30bf4216;p=thirdparty%2Fsquid.git indent -br -ce -i4 -ci4 -l80 -nlp -npcs -npsl -d0 -sc -di0 -psl 'commitcheck' script now checks for this indentation before allowing a commit. --- diff --git a/src/access_log.cc b/src/access_log.cc index d7babefdcc..d583bc4f67 100644 --- a/src/access_log.cc +++ b/src/access_log.cc @@ -1,6 +1,6 @@ /* - * $Id: access_log.cc,v 1.63 2000/12/17 13:27:37 hno Exp $ + * $Id: access_log.cc,v 1.64 2001/01/02 00:09:55 wessels Exp $ * * DEBUG: section 46 Access Log * AUTHOR: Duane Wessels @@ -328,7 +328,7 @@ void accessLogInit(void) { assert(sizeof(log_tags) == (LOG_TYPE_MAX + 1) * sizeof(char *)); - if (strcasecmp (Config.Log.access, "none") == 0) + if (strcasecmp(Config.Log.access, "none") == 0) return; logfile = logfileOpen(Config.Log.access, MAX_URL << 1, 1); LogfileStatus = LOG_ENABLE; diff --git a/src/acl.cc b/src/acl.cc index f16e9cb38f..1acbfa2848 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -1,6 +1,6 @@ /* - * $Id: acl.cc,v 1.227 2001/01/01 22:03:55 wessels Exp $ + * $Id: acl.cc,v 1.228 2001/01/02 00:09:55 wessels Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -1795,7 +1795,7 @@ aclLookupProxyAuthDone(void *data, char *result) checklist->auth_user->passwd_ok = 1; else { if (strlen(result) > sizeof("ERR ")) - checklist->auth_user->message = xstrdup(result+4); + checklist->auth_user->message = xstrdup(result + 4); checklist->auth_user->passwd_ok = 0; } aclCheck(checklist); diff --git a/src/client_side.cc b/src/client_side.cc index 814fa982ea..3f7dab5f9d 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.518 2000/12/17 07:18:56 hno Exp $ + * $Id: client_side.cc,v 1.519 2001/01/02 00:09:55 wessels Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -854,22 +854,21 @@ clientInterpretRequestHeaders(clientHttpRequest * http) * Now knows about IE 5.5 fix (is actually only fixed in SP1, * but we can't tell whether we are talking to SP1 or not so * all 5.5 versions are treated 'normally'). - */ + */ if (Config.onoff.ie_refresh) { - if (http->flags.accel && request->flags.ims) { - if ( (str = httpHeaderGetStr(req_hdr, HDR_USER_AGENT)) ) { - if (strstr(str, "MSIE 5.01") != NULL) - no_cache++; - else if (strstr(str, "MSIE 5.0") != NULL) - no_cache++; - else if (strstr(str, "MSIE 4.") != NULL) - no_cache++; - else if (strstr(str, "MSIE 3.") != NULL) - no_cache++; - } - } + if (http->flags.accel && request->flags.ims) { + if ((str = httpHeaderGetStr(req_hdr, HDR_USER_AGENT))) { + if (strstr(str, "MSIE 5.01") != NULL) + no_cache++; + else if (strstr(str, "MSIE 5.0") != NULL) + no_cache++; + else if (strstr(str, "MSIE 4.") != NULL) + no_cache++; + else if (strstr(str, "MSIE 3.") != NULL) + no_cache++; + } + } } - if (no_cache) { #if HTTP_VIOLATIONS if (Config.onoff.reload_into_ims) @@ -2473,9 +2472,9 @@ parseHttpRequest(ConnStateData * conn, method_t * method_p, int *status, vport, url); #else #if LINUX_NETFILTER - /* If the call fails the address structure will be unchanged */ - getsockopt(conn->fd, SOL_IP, SO_ORIGINAL_DST, &conn->me, &sock_sz ); - debug(33, 5) ("parseHttpRequest: addr = %s", inet_ntoa(conn->me.sin_addr) ); + /* If the call fails the address structure will be unchanged */ + getsockopt(conn->fd, SOL_IP, SO_ORIGINAL_DST, &conn->me, &sock_sz); + debug(33, 5) ("parseHttpRequest: addr = %s", inet_ntoa(conn->me.sin_addr)); #endif snprintf(http->uri, url_sz, "http://%s:%d%s", inet_ntoa(http->conn->me.sin_addr), diff --git a/src/fs/aufs/aiops.cc b/src/fs/aufs/aiops.cc index 36ed301b59..1d40b01588 100644 --- a/src/fs/aufs/aiops.cc +++ b/src/fs/aufs/aiops.cc @@ -1,5 +1,5 @@ /* - * $Id: aiops.cc,v 1.5 2000/12/09 04:43:30 wessels Exp $ + * $Id: aiops.cc,v 1.6 2001/01/02 00:11:51 wessels Exp $ * * DEBUG: section 43 AIOPS * AUTHOR: Stewart Forster @@ -92,10 +92,10 @@ typedef struct aio_request_t { typedef struct aio_request_queue_t { pthread_mutex_t mutex; pthread_cond_t cond; - aio_request_t * volatile head; - aio_request_t * volatile * volatile tailp; + aio_request_t *volatile head; + aio_request_t *volatile *volatile tailp; unsigned long requests; - unsigned long blocked; /* main failed to lock the queue */ + unsigned long blocked; /* main failed to lock the queue */ } aio_request_queue_t; typedef struct aio_thread_t aio_thread_t; @@ -145,19 +145,29 @@ static int aio_initialised = 0; #define AIO_TINY_BUFS AIO_LARGE_BUFS >> 3 #define AIO_MICRO_BUFS 128 -static MemPool *aio_large_bufs = NULL; /* 16K */ +static MemPool *aio_large_bufs = NULL; /* 16K */ static MemPool *aio_medium_bufs = NULL; /* 8K */ -static MemPool *aio_small_bufs = NULL; /* 4K */ -static MemPool *aio_tiny_bufs = NULL; /* 2K */ -static MemPool *aio_micro_bufs = NULL; /* 128K */ +static MemPool *aio_small_bufs = NULL; /* 4K */ +static MemPool *aio_tiny_bufs = NULL; /* 2K */ +static MemPool *aio_micro_bufs = NULL; /* 128K */ static int request_queue_len = 0; static MemPool *aio_request_pool = NULL; static MemPool *aio_thread_pool = NULL; static aio_request_queue_t request_queue; -static struct { aio_request_t *head, **tailp; } request_queue2 = { NULL, &request_queue2.head }; +static struct { + aio_request_t *head, **tailp; +} request_queue2 = { + + NULL, &request_queue2.head +}; static aio_request_queue_t done_queue; -static struct { aio_request_t *head, **tailp; } done_requests = { NULL, &done_requests.head }; +static struct { + aio_request_t *head, **tailp; +} done_requests = { + + NULL, &done_requests.head +}; static pthread_attr_t globattr; static struct sched_param globsched; static pthread_t main_thread; @@ -167,16 +177,16 @@ aio_get_pool(int size) { MemPool *p; if (size <= AIO_LARGE_BUFS) { - if (size <= AIO_MICRO_BUFS) - p = aio_micro_bufs; + if (size <= AIO_MICRO_BUFS) + p = aio_micro_bufs; else if (size <= AIO_TINY_BUFS) - p = aio_tiny_bufs; - else if (size <= AIO_SMALL_BUFS) - p = aio_small_bufs; - else if (size <= AIO_MEDIUM_BUFS) - p = aio_medium_bufs; - else - p = aio_large_bufs; + p = aio_tiny_bufs; + else if (size <= AIO_SMALL_BUFS) + p = aio_small_bufs; + else if (size <= AIO_MEDIUM_BUFS) + p = aio_medium_bufs; + else + p = aio_large_bufs; } else p = NULL; return p; @@ -188,7 +198,7 @@ aio_xmalloc(int size) void *p; MemPool *pool; - if ( (pool = aio_get_pool(size)) != NULL) { + if ((pool = aio_get_pool(size)) != NULL) { p = memPoolAlloc(pool); } else p = xmalloc(size); @@ -200,7 +210,7 @@ static char * aio_xstrdup(const char *str) { char *p; - int len = strlen(str)+1; + int len = strlen(str) + 1; p = aio_xmalloc(len); strncpy(p, str, len); @@ -213,22 +223,22 @@ aio_xfree(void *p, int size) { MemPool *pool; - if ( (pool = aio_get_pool(size)) != NULL) { - memPoolFree(pool, p); + if ((pool = aio_get_pool(size)) != NULL) { + memPoolFree(pool, p); } else - xfree(p); + xfree(p); } static void aio_xstrfree(char *str) { MemPool *pool; - int len = strlen(str)+1; + int len = strlen(str) + 1; - if ( (pool = aio_get_pool(len)) != NULL) { - memPoolFree(pool, str); + if ((pool = aio_get_pool(len)) != NULL) { + memPoolFree(pool, str); } else - xfree(str); + xfree(str); } static void @@ -335,16 +345,16 @@ aio_thread_loop(void *ptr) threadp->current_req = request = NULL; request = NULL; /* Get a request to process */ - threadp->status = _THREAD_WAITING; + threadp->status = _THREAD_WAITING; pthread_mutex_lock(&request_queue.mutex); - while(!request_queue.head) { + while (!request_queue.head) { pthread_cond_wait(&request_queue.cond, &request_queue.mutex); } request = request_queue.head; if (request) request_queue.head = request->next; - if (!request_queue.head) - request_queue.tailp = &request_queue.head; + if (!request_queue.head) + request_queue.tailp = &request_queue.head; pthread_mutex_unlock(&request_queue.mutex); /* process the request */ threadp->status = _THREAD_BUSY; @@ -404,7 +414,7 @@ aio_queue_request(aio_request_t * request) { static int high_start = 0; debug(41, 9) ("aio_queue_request: %p type=%d result=%p\n", - request, request->request_type, request->resultp); + request, request->request_type, request->resultp); /* Mark it as not executed (failing result, no error) */ request->ret = -1; request->err = 0; @@ -420,11 +430,11 @@ aio_queue_request(aio_request_t * request) request_queue.tailp = &request->next; pthread_cond_signal(&request_queue.cond); pthread_mutex_unlock(&request_queue.mutex); - } else { + } else { /* Oops, the request queue is blocked, use request_queue2 */ *request_queue2.tailp = request; request_queue2.tailp = &request->next; - } + } } else { /* Secondary path. We have blocked requests to deal with */ /* add the request to the chain */ @@ -469,7 +479,7 @@ aio_queue_request(aio_request_t * request) debug(43, 1) ("aio_queue_request: WARNING - Disk I/O overloading\n"); if (squid_curtime >= (high_start + 15)) debug(43, 1) ("aio_queue_request: Queue Length: current=%d, high=%d, low=%d, duration=%d\n", - request_queue_len, queue_high, queue_low, squid_curtime - high_start); + request_queue_len, queue_high, queue_low, squid_curtime - high_start); last_warn = squid_curtime; } } else { @@ -541,7 +551,7 @@ aio_cancel(aio_result_t * resultp) if (request && request->resultp == resultp) { debug(41, 9) ("aio_cancel: %p type=%d result=%p\n", - request, request->request_type, request->resultp); + request, request->request_type, request->resultp); request->cancelled = 1; request->resultp = NULL; resultp->_data = NULL; @@ -830,7 +840,7 @@ aio_poll_done(void) return NULL; } debug(41, 9) ("aio_poll_done: %p type=%d result=%p\n", - request, request->request_type, request->resultp); + request, request->request_type, request->resultp); done_requests.head = request->next; if (!done_requests.head) done_requests.tailp = &done_requests.head; diff --git a/src/fs/aufs/async_io.cc b/src/fs/aufs/async_io.cc index 9f9565ca98..1bedf3b144 100644 --- a/src/fs/aufs/async_io.cc +++ b/src/fs/aufs/async_io.cc @@ -1,6 +1,6 @@ /* - * $Id: async_io.cc,v 1.6 2000/11/10 21:42:03 hno Exp $ + * $Id: async_io.cc,v 1.7 2001/01/02 00:11:51 wessels Exp $ * * DEBUG: section 32 Asynchronous Disk I/O * AUTHOR: Pete Bentley @@ -298,22 +298,22 @@ aioCheckCallbacks(SwapDir * SD) AIOCB *done_handler; void *their_data; int retval = 0; - + assert(initialised); aio_counts.check_callback++; for (;;) { if ((resultp = aio_poll_done()) == NULL) break; - ctrlp = (aio_ctrl_t *)resultp->data; + ctrlp = (aio_ctrl_t *) resultp->data; if (ctrlp == NULL) - continue; /* XXX Should not happen */ + continue; /* XXX Should not happen */ dlinkDelete(&ctrlp->node, &used_list); if ((done_handler = ctrlp->done_handler)) { their_data = ctrlp->done_handler_data; ctrlp->done_handler = NULL; ctrlp->done_handler_data = NULL; if (cbdataValid(their_data)) { - retval = 1; /* Return that we've actually done some work */ + retval = 1; /* Return that we've actually done some work */ done_handler(ctrlp->fd, their_data, ctrlp->result.aio_return, ctrlp->result.aio_errno); } diff --git a/src/fs/aufs/store_asyncufs.h b/src/fs/aufs/store_asyncufs.h index 737927d7df..99719c526b 100644 --- a/src/fs/aufs/store_asyncufs.h +++ b/src/fs/aufs/store_asyncufs.h @@ -28,8 +28,8 @@ struct _aio_result_t { int aio_return; int aio_errno; - void *_data; /* Internal housekeeping */ - void *data; /* Available to the caller */ + void *_data; /* Internal housekeeping */ + void *data; /* Available to the caller */ }; typedef struct _aio_result_t aio_result_t; diff --git a/src/fs/aufs/store_io_aufs.cc b/src/fs/aufs/store_io_aufs.cc index 88afc1d267..44f74aef34 100644 --- a/src/fs/aufs/store_io_aufs.cc +++ b/src/fs/aufs/store_io_aufs.cc @@ -339,7 +339,7 @@ storeAufsReadDone(int fd, int errflag, size_t len, void *my_data) errflag = DISK_OK; #else if (errflag == DISK_EOF) - errflag = DISK_OK; /* EOF is signalled by len == 0, not errors... */ + errflag = DISK_OK; /* EOF is signalled by len == 0, not errors... */ #endif assert(callback); assert(their_data); diff --git a/src/fs/coss/store_coss.h b/src/fs/coss/store_coss.h index 9699fd89e0..650630b81b 100644 --- a/src/fs/coss/store_coss.h +++ b/src/fs/coss/store_coss.h @@ -82,6 +82,6 @@ extern STSYNC storeCossSync; extern off_t storeCossAllocate(SwapDir * SD, const StoreEntry * e, int which); extern void storeCossAdd(SwapDir *, StoreEntry *); extern void storeCossRemove(SwapDir *, StoreEntry *); -extern void storeCossStartMembuf(SwapDir *SD); +extern void storeCossStartMembuf(SwapDir * SD); #endif diff --git a/src/fs/coss/store_io_coss.cc b/src/fs/coss/store_io_coss.cc index 64b5ad888b..adec953ab9 100644 --- a/src/fs/coss/store_io_coss.cc +++ b/src/fs/coss/store_io_coss.cc @@ -1,6 +1,6 @@ /* - * $Id: store_io_coss.cc,v 1.4 2000/06/08 18:05:38 hno Exp $ + * $Id: store_io_coss.cc,v 1.5 2001/01/02 00:11:54 wessels Exp $ * * DEBUG: section 81 Storage Manager COSS Interface * AUTHOR: Eric Stern @@ -417,7 +417,7 @@ storeCossSync(SwapDir * SD) int end; if (!cs->membufs) return; - for (t=cs->membufs; t; t = t->next) { + for (t = cs->membufs; t; t = t->next) { if (t->flags.writing) sleep(5); lseek(cs->fd, t->diskstart, SEEK_SET); @@ -517,7 +517,7 @@ storeCossCreateMemBuf(SwapDir * SD, size_t start, * Creates the initial membuf after rebuild */ void -storeCossStartMembuf(SwapDir *sd) +storeCossStartMembuf(SwapDir * sd) { CossInfo *cs = (CossInfo *) sd->fsdata; CossMemBuf *newmb = storeCossCreateMemBuf(sd, cs->current_offset, -1, NULL); diff --git a/src/fs/diskd/store_io_diskd.cc b/src/fs/diskd/store_io_diskd.cc index cb30f00eb8..d8e3d6dc29 100644 --- a/src/fs/diskd/store_io_diskd.cc +++ b/src/fs/diskd/store_io_diskd.cc @@ -1,6 +1,6 @@ /* - * $Id: store_io_diskd.cc,v 1.17 2000/11/27 00:03:33 adrian Exp $ + * $Id: store_io_diskd.cc,v 1.18 2001/01/02 00:11:54 wessels Exp $ * * DEBUG: section 81 Squid-side DISKD I/O functions. * AUTHOR: Duane Wessels @@ -364,14 +364,14 @@ storeDiskdReadDone(diomsg * M) sio->read.callback = NULL; sio->read.callback_data = NULL; if (valid) { - assert(!diskdstate->flags.close_request); - /* - * Only copy the data if the callback is still valid, - * if it isn't valid then the request should have been - * aborted. - * -- adrian - */ - xmemcpy(their_buf, sbuf, len); /* yucky copy */ + assert(!diskdstate->flags.close_request); + /* + * Only copy the data if the callback is still valid, + * if it isn't valid then the request should have been + * aborted. + * -- adrian + */ + xmemcpy(their_buf, sbuf, len); /* yucky copy */ callback(their_data, their_buf, len); } } diff --git a/src/fs/ufs/store_dir_ufs.cc b/src/fs/ufs/store_dir_ufs.cc index 3c7253e1e8..25806688d8 100644 --- a/src/fs/ufs/store_dir_ufs.cc +++ b/src/fs/ufs/store_dir_ufs.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir_ufs.cc,v 1.19 2000/12/09 01:47:23 wessels Exp $ + * $Id: store_dir_ufs.cc,v 1.20 2001/01/02 00:11:55 wessels Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -670,19 +670,19 @@ storeUfsDirRebuildFromSwapLog(void *data) /* load new */ (void) 0; } - /* update store_swap_size */ - rb->counts.objcount++; - e = storeUfsDirAddDiskRestore(SD, s.key, - s.swap_filen, - s.swap_file_sz, - s.expires, - s.timestamp, - s.lastref, - s.lastmod, - s.refcount, - s.flags, - (int) rb->flags.clean); - storeDirSwapLog(e, SWAP_LOG_ADD); + /* update store_swap_size */ + rb->counts.objcount++; + e = storeUfsDirAddDiskRestore(SD, s.key, + s.swap_filen, + s.swap_file_sz, + s.expires, + s.timestamp, + s.lastref, + s.lastmod, + s.refcount, + s.flags, + (int) rb->flags.clean); + storeDirSwapLog(e, SWAP_LOG_ADD); } eventAdd("storeRebuild", storeUfsDirRebuildFromSwapLog, rb, 0.0, 1); } diff --git a/src/repl/heap/store_heap_replacement.cc b/src/repl/heap/store_heap_replacement.cc index 70f5b2c30f..95479cb04e 100644 --- a/src/repl/heap/store_heap_replacement.cc +++ b/src/repl/heap/store_heap_replacement.cc @@ -1,6 +1,6 @@ /* - * $Id: store_heap_replacement.cc,v 1.3 2000/11/03 16:39:42 wessels Exp $ + * $Id: store_heap_replacement.cc,v 1.4 2001/01/02 00:11:55 wessels Exp $ * * DEBUG: section 20 Storage Manager Heap-based replacement * AUTHOR: John Dilley @@ -64,7 +64,7 @@ * for this to become a problem. (estimation is 10^8 cache * turnarounds) */ -heap_key +heap_key HeapKeyGen_StoreEntry_LFUDA(void *entry, double age) { StoreEntry *e = entry; @@ -105,7 +105,7 @@ HeapKeyGen_StoreEntry_LFUDA(void *entry, double age) * for this to become a problem. (estimation is 10^8 cache * turnarounds) */ -heap_key +heap_key HeapKeyGen_StoreEntry_GDSF(void *entry, double age) { StoreEntry *e = entry; @@ -128,7 +128,7 @@ HeapKeyGen_StoreEntry_GDSF(void *entry, double age) * Don't use it unless you are trying to compare performance among * heap-based replacement policies... */ -heap_key +heap_key HeapKeyGen_StoreEntry_LRU(void *entry, double age) { StoreEntry *e = entry; diff --git a/src/store.cc b/src/store.cc index 3d81aa6f40..d7285881c2 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.534 2000/12/17 08:54:02 hno Exp $ + * $Id: store.cc,v 1.535 2001/01/02 00:09:56 wessels Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -1296,7 +1296,7 @@ createRemovalPolicy(RemovalPolicySettings * settings) debug(20, 1) ("ERROR: Be sure to have set cache_replacement_policy\n"); debug(20, 1) ("ERROR: and memory_replacement_policy in squid.conf!\n"); fatalf("ERROR: Unknown policy %s\n", settings->type); - return NULL; /* NOTREACHED */ + return NULL; /* NOTREACHED */ } #if 0