]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
indent -br -ce -i4 -ci4 -l80 -nlp -npcs -npsl -d0 -sc -di0 -psl
authorwessels <>
Tue, 2 Jan 2001 07:09:55 +0000 (07:09 +0000)
committerwessels <>
Tue, 2 Jan 2001 07:09:55 +0000 (07:09 +0000)
'commitcheck' script now checks for this indentation before allowing
a commit.

13 files changed:
src/access_log.cc
src/acl.cc
src/client_side.cc
src/fs/aufs/aiops.cc
src/fs/aufs/async_io.cc
src/fs/aufs/store_asyncufs.h
src/fs/aufs/store_io_aufs.cc
src/fs/coss/store_coss.h
src/fs/coss/store_io_coss.cc
src/fs/diskd/store_io_diskd.cc
src/fs/ufs/store_dir_ufs.cc
src/repl/heap/store_heap_replacement.cc
src/store.cc

index d7babefdcc3a14fc680401c6ff164e6392a8bae4..d583bc4f6779e121ed08742ab3cd1ed1fbec58f2 100644 (file)
@@ -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;
index f16e9cb38f3dfc8b95b93f76e2540b38dcfea8a0..1acbfa28488def98ca6ec91288b7d70c21a9477a 100644 (file)
@@ -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);
index 814fa982ea2f139ce0fbaba0a6b096d397db8be1..3f7dab5f9d005c7617fae5865b16d0b890e5c24f 100644 (file)
@@ -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),
index 36ed301b59bc0f9262c765c185feaaac708ae30b..1d40b01588ba6a13f9a3c07a0d1f7be6916392aa 100644 (file)
@@ -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 <slf@connect.com.au>
@@ -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;
index 9f9565ca98bda13c9439414b6b74e4dfd715369a..1bedf3b144dca9999b25d63d19dad2ecd8919f85 100644 (file)
@@ -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 <pete@demon.net>
@@ -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);
            }
index 737927d7dfa09a9a05be2bbd6e9da9e206fdcc02..99719c526bc46494af743b4ee080159c3b745236 100644 (file)
@@ -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;
index 88afc1d267ede943e27caf515ff1dde7299789c4..44f74aef34585894dd09e7da7e19b72291d82f04 100644 (file)
@@ -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);
index 9699fd89e075aefbadc6e146029cf47f05821a4c..650630b81b74ae897060798c9e802dc89fc8f5a7 100644 (file)
@@ -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
index 64b5ad888b00cfba378ae7f112e7a69d35ed9161..adec953ab9d4e455e48c9ddd522b3b38d3abcf44 100644 (file)
@@ -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);
index cb30f00eb8b295d6ec7160bfd7183496716307a0..d8e3d6dc29fa1a23b642d8ae8a90eefeab72ac4c 100644 (file)
@@ -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);
     }
 }
index 3c7253e1e84e3911b5fbbb3341f2446eb17450d2..25806688d8c2d7b0c15910ac12f3f14aca422212 100644 (file)
@@ -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);
 }
index 70f5b2c30f18653857b9f675758696637f21bce2..95479cb04e403707f1f30b2498b7a5dd4adf702a 100644 (file)
@@ -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;
index 3d81aa6f40da825d74c458c52446cc3ce873a416..d7285881c25fd3a151da5ec24874aaa13c46588d 100644 (file)
@@ -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