]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
gindent
authorwessels <>
Wed, 10 Apr 1996 05:28:32 +0000 (05:28 +0000)
committerwessels <>
Wed, 10 Apr 1996 05:28:32 +0000 (05:28 +0000)
src/ftp.cc
src/gopher.cc
src/http.cc
src/store.cc
src/tools.cc
src/wais.cc

index ea170fa9289d9efbdeafd0df9ddcea303650193a..a2399da5c037a259c4a7538d311316b25312ffcd 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ftp.cc,v 1.25 1996/04/09 23:27:55 wessels Exp $ */
+/* $Id: ftp.cc,v 1.26 1996/04/09 23:28:32 wessels Exp $ */
 
 /*
  * DEBUG: Section 9           ftp: FTP
@@ -187,7 +187,7 @@ int ftpReadReply(fd, data)
             * by `ftpget'. */
        } else {
            BIT_RESET(entry->flag, CACHABLE);
-           storeReleaseRequest(entry, __FILE__,__LINE__);
+           storeReleaseRequest(entry, __FILE__, __LINE__);
            cached_error_entry(entry, ERR_READ_ERROR, xstrerror());
            ftpCloseAndFree(fd, data);
        }
@@ -205,7 +205,7 @@ int ftpReadReply(fd, data)
            debug(9, 1, "ftpReadReply: Didn't see magic marker, purging <URL:%s>.\n", entry->url);
            entry->expires = cached_curtime + getNegativeTTL();
            BIT_RESET(entry->flag, CACHABLE);
-           storeReleaseRequest(entry, __FILE__,__LINE__);
+           storeReleaseRequest(entry, __FILE__, __LINE__);
        } else if (!(entry->flag & DELETE_BEHIND)) {
            entry->expires = cached_curtime + ttlSet(entry);
        }
@@ -374,7 +374,7 @@ void ftpSendRequest(fd, data)
        ftpSendComplete,
        (void *) data);
     if (!BIT_TEST(data->entry->flag, ENTRY_PRIVATE))
-       storeSetPublicKey(data->entry); /* Make it public */
+       storeSetPublicKey(data->entry);         /* Make it public */
 }
 
 void ftpConnInProgress(fd, data)
index 593de5f79e6e1c955e7dd9eaf6c7c2472a51a066..b39f10b02bab54533bdb68c1cbe4d9015ea74324 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: gopher.cc,v 1.20 1996/04/09 23:27:55 wessels Exp $ */
+/* $Id: gopher.cc,v 1.21 1996/04/09 23:28:33 wessels Exp $ */
 
 /*
  * DEBUG: Section 10          gopher: GOPHER
@@ -663,7 +663,7 @@ int gopherReadReply(fd, data)
                (PF) gopherReadReplyTimeout, (void *) data, getReadTimeout());
        } else {
            BIT_RESET(entry->flag, CACHABLE);
-           storeReleaseRequest(entry, __FILE__,__LINE__);
+           storeReleaseRequest(entry, __FILE__, __LINE__);
            cached_error_entry(entry, ERR_READ_ERROR, xstrerror());
            gopherCloseAndFree(fd, data);
        }
@@ -843,7 +843,7 @@ void gopherSendRequest(fd, data)
        gopherSendComplete,
        (void *) data);
     if (!BIT_TEST(data->entry->flag, ENTRY_PRIVATE))
-       storeSetPublicKey(data->entry); /* Make it public */
+       storeSetPublicKey(data->entry);         /* Make it public */
 }
 
 int gopherStart(unusedfd, url, entry)
index 53428609589cac8c3a5416ce52cd84186a5910c8..60d6b73f158fe30cdf5225604f1f147fd5d84def 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: http.cc,v 1.33 1996/04/09 23:27:56 wessels Exp $ */
+/* $Id: http.cc,v 1.34 1996/04/09 23:28:33 wessels Exp $ */
 
 /*
  * DEBUG: Section 11          http: HTTP
@@ -174,7 +174,7 @@ static void httpProcessReplyHeader(data, buf, size)
        else
            t = t2 ? t2 : t1;
        if (!t)
-               return;         /* headers not complete */
+           return;             /* headers not complete */
        t += (t == t1 ? 4 : 2);
        *t = '\0';
        reply = entry->mem_obj->reply;
@@ -193,7 +193,7 @@ static void httpProcessReplyHeader(data, buf, size)
            while (*s == '\r')
                *s-- = '\0';
            if (!strncasecmp(t, "HTTP", 4)) {
-               sscanf (t+1, "%lf", &reply->version);
+               sscanf(t + 1, "%lf", &reply->version);
                if ((t = strchr(t, ' '))) {
                    t++;
                    reply->code = atoi(t);
@@ -201,7 +201,7 @@ static void httpProcessReplyHeader(data, buf, size)
            } else if (!strncasecmp(t, "Content-type:", 13)) {
                if ((t = strchr(t, ' '))) {
                    t++;
-                   strncpy(reply->content_type, t, HTTP_REPLY_FIELD_SZ-1);
+                   strncpy(reply->content_type, t, HTTP_REPLY_FIELD_SZ - 1);
                }
            } else if (!strncasecmp(t, "Content-length:", 15)) {
                if ((t = strchr(t, ' '))) {
@@ -211,17 +211,17 @@ static void httpProcessReplyHeader(data, buf, size)
            } else if (!strncasecmp(t, "Date:", 5)) {
                if ((t = strchr(t, ' '))) {
                    t++;
-                   strncpy(reply->date, t, HTTP_REPLY_FIELD_SZ-1);
+                   strncpy(reply->date, t, HTTP_REPLY_FIELD_SZ - 1);
                }
            } else if (!strncasecmp(t, "Expires:", 8)) {
                if ((t = strchr(t, ' '))) {
                    t++;
-                   strncpy(reply->expires, t, HTTP_REPLY_FIELD_SZ-1);
+                   strncpy(reply->expires, t, HTTP_REPLY_FIELD_SZ - 1);
                }
            } else if (!strncasecmp(t, "Last-Modified:", 14)) {
                if ((t = strchr(t, ' '))) {
                    t++;
-                   strncpy(reply->last_modified, t, HTTP_REPLY_FIELD_SZ-1);
+                   strncpy(reply->last_modified, t, HTTP_REPLY_FIELD_SZ - 1);
                }
            }
            t = strtok(NULL, "\n");
@@ -246,7 +246,7 @@ static void httpProcessReplyHeader(data, buf, size)
                storeSetPrivateKey(entry);
            storeExpireNow(entry);
            BIT_RESET(entry->flag, CACHABLE);
-           storeReleaseRequest(entry, __FILE__,__LINE__);
+           storeReleaseRequest(entry, __FILE__, __LINE__);
            break;
        default:
            /* These can be negative cached, make key public */
@@ -321,7 +321,7 @@ static void httpReadReply(fd, data)
                (PF) httpReadReplyTimeout, (void *) data, getReadTimeout());
        } else {
            BIT_RESET(entry->flag, CACHABLE);
-           storeReleaseRequest(entry, __FILE__,__LINE__);
+           storeReleaseRequest(entry, __FILE__, __LINE__);
            cached_error_entry(entry, ERR_READ_ERROR, xstrerror());
            httpCloseAndFree(fd, data);
        }
index a003733bf2b5b198613d42f02bac8b84cf8d1b25..d9a76d52c4e3ea01482330a1c214b53e6552659a 100644 (file)
@@ -1,6 +1,6 @@
 
-/* $Id: store.cc,v 1.35 1996/04/09 23:27:59 wessels Exp $ */
-#ident "$Id: store.cc,v 1.35 1996/04/09 23:27:59 wessels Exp $"
+/* $Id: store.cc,v 1.36 1996/04/09 23:28:36 wessels Exp $ */
+#ident "$Id: store.cc,v 1.36 1996/04/09 23:28:36 wessels Exp $"
 
 /*
  * DEBUG: Section 20          store
 #define STORE_LOG_SWAPOUT      2
 #define STORE_LOG_RELEASE      3
 
-static char *storeLogTags[] = {
-       "CREATE",
-       "SWAPIN",
-       "SWAPOUT",
-       "RELEASE"
+static char *storeLogTags[] =
+{
+    "CREATE",
+    "SWAPIN",
+    "SWAPOUT",
+    "RELEASE"
 };
 
 /* Now, this table is inaccessible to outsider. They have to use a method
@@ -108,7 +109,7 @@ static MemObject *new_MemObject()
 {
     MemObject *m = NULL;
     m = (MemObject *) xcalloc(1, sizeof(MemObject));
-    m->reply = (struct _http_reply *) xcalloc (1, sizeof(struct _http_reply));
+    m->reply = (struct _http_reply *) xcalloc(1, sizeof(struct _http_reply));
     meta_data.store_in_mem_objects++;
     debug(20, 3, "new_MemObject: returning %p\n", m);
     return m;
@@ -293,27 +294,27 @@ void storeFreeEntry(e)
     destroy_StoreEntry(e);
 }
 
-static char *time_describe (t)
-       time_t t;
+static char *time_describe(t)
+     time_t t;
 {
-       static char buf[128];
+    static char buf[128];
 
-       if (t < 60) {
-               sprintf (buf, "%ds", (int) t);
-       } else if (t < 3600) {
-               sprintf(buf, "%dm", (int) t/60);
-       } else if (t < 86400) {
-               sprintf(buf, "%dh", (int) t/3600);
-       } else if (t < 604800) {
-               sprintf(buf, "%dD", (int) t/86400);
-       } else if (t < 2592000) {
-               sprintf(buf, "%dW", (int) t/604800);
-       } else if (t < 31536000) {
-               sprintf(buf, "%dM", (int) t/2592000);
-       } else {
-               sprintf(buf, "%dY", (int) t/31536000);
-       }
-       return buf;
+    if (t < 60) {
+       sprintf(buf, "%ds", (int) t);
+    } else if (t < 3600) {
+       sprintf(buf, "%dm", (int) t / 60);
+    } else if (t < 86400) {
+       sprintf(buf, "%dh", (int) t / 3600);
+    } else if (t < 604800) {
+       sprintf(buf, "%dD", (int) t / 86400);
+    } else if (t < 2592000) {
+       sprintf(buf, "%dW", (int) t / 604800);
+    } else if (t < 31536000) {
+       sprintf(buf, "%dM", (int) t / 2592000);
+    } else {
+       sprintf(buf, "%dY", (int) t / 31536000);
+    }
+    return buf;
 }
 
 static void storeLog(tag, e)
@@ -425,14 +426,14 @@ int storeLockObject(e)
     return status;
 }
 
-void storeReleaseRequest (e, file, line)
-       StoreEntry *e;
-       char *file;
-       int line;
+void storeReleaseRequest(e, file, line)
+     StoreEntry *e;
+     char *file;
+     int line;
 {
-       debug(20,1,"storeReleaseRequest: FROM %s:%d FOR '%s'\n",
-               file, line, e->key ? e->key : e->url);
-       BIT_SET(e->flag, RELEASE_REQUEST);
+    debug(20, 1, "storeReleaseRequest: FROM %s:%d FOR '%s'\n",
+       file, line, e->key ? e->key : e->url);
+    BIT_SET(e->flag, RELEASE_REQUEST);
 }
 
 /* unlock object, return -1 if object get released after unlock
@@ -574,7 +575,7 @@ void storeSetPublicKey(e)
        debug(20, 0, "storeSetPublicKey: Making old '%s' private.\n", newkey);
        e2 = (StoreEntry *) table_entry;
        storeSetPrivateKey(e2);
-       storeReleaseRequest(e2, __FILE__,__LINE__);
+       storeReleaseRequest(e2, __FILE__, __LINE__);
     }
     if (e->key)
        storeHashDelete(e);
@@ -620,7 +621,7 @@ StoreEntry *storeCreateEntry(url, req_hdr, flags, method)
        BIT_RESET(e->flag, ENTRY_PRIVATE);
     } else {
        BIT_RESET(e->flag, CACHABLE);
-       storeReleaseRequest(e, __FILE__,__LINE__);
+       storeReleaseRequest(e, __FILE__, __LINE__);
        BIT_SET(e->flag, ENTRY_PRIVATE);
     }
     if (neighbors_do_private_keys || !BIT_TEST(flags, REQ_PUBLIC))
@@ -883,7 +884,7 @@ void storeStartDeleteBehind(e)
     /* change its key, so it couldn't be found by other client */
     storeSetPrivateKey(e);
     BIT_SET(e->flag, DELETE_BEHIND);
-    storeReleaseRequest(e, __FILE__,__LINE__);
+    storeReleaseRequest(e, __FILE__, __LINE__);
     BIT_RESET(e->flag, CACHABLE);
     storeExpireNow(e);
 }
@@ -1094,7 +1095,7 @@ void storeSwapOutHandle(fd, flag, e)
        e->swap_status = NO_SWAP;
        put_free_8k_page(page_ptr, __FILE__, __LINE__);
        file_close(fd);
-       storeReleaseRequest(e, __FILE__,__LINE__);
+       storeReleaseRequest(e, __FILE__, __LINE__);
        if (e->swap_file_number != -1) {
            file_map_bit_reset(e->swap_file_number);
            safeunlink(filename, 0);    /* remove it */
@@ -1432,7 +1433,7 @@ static int storeCheckSwapable(e)
     } else
        return 1;
 
-    storeReleaseRequest(e, __FILE__,__LINE__);
+    storeReleaseRequest(e, __FILE__, __LINE__);
     BIT_RESET(e->flag, CACHABLE);
     return 0;
 }
@@ -2029,7 +2030,7 @@ int storeRelease(e)
        storeExpireNow(e);
        debug(20, 3, "storeRelease: Only setting RELEASE_REQUEST bit\n");
        if (!BIT_TEST(e->flag, RELEASE_REQUEST))
-               storeReleaseRequest(e, __FILE__,__LINE__);
+           storeReleaseRequest(e, __FILE__, __LINE__);
        return -1;
     }
     if (e->key != NULL) {
@@ -2076,7 +2077,7 @@ int storeRelease(e)
        e->object_len);
     if (hptr)
        storeHashDelete(hptr);
-    storeLog(STORE_LOG_RELEASE,e);
+    storeLog(STORE_LOG_RELEASE, e);
     storeFreeEntry(e);
     return 0;
 }
@@ -2323,7 +2324,7 @@ int storeEntryValidLength(e)
        fatal_dump("storeEntryValidLength: NULL mem_obj");
 
     hdr_sz = e->mem_obj->reply->hdr_sz;
-    content_length   = e->mem_obj->reply->content_length;
+    content_length = e->mem_obj->reply->content_length;
 
     debug(20, 3, "storeEntryValidLength: Checking '%s'\n", e->key);
     debug(20, 5, "storeEntryValidLength:     object_len = %d\n", e->object_len);
@@ -2420,7 +2421,7 @@ int storeInit()
 {
     int dir_created;
 
-    storelog_fd = file_open("store.log", NULL, O_WRONLY|O_APPEND|O_CREAT);
+    storelog_fd = file_open("store.log", NULL, O_WRONLY | O_APPEND | O_CREAT);
 
     storeSanityCheck();
     file_map_create(MAX_SWAP_FILE);
index b67aa4ab0f57b4de12f5ff6275257170d8618664..ea6b9cd82c97a416fc6b1e1434226b724b5512dd 100644 (file)
@@ -1,5 +1,5 @@
 
-/* $Id: tools.cc,v 1.25 1996/04/08 19:32:42 wessels Exp $ */
+/* $Id: tools.cc,v 1.26 1996/04/09 23:28:37 wessels Exp $ */
 
 /*
  * DEBUG: Section 21          tools
@@ -184,6 +184,7 @@ void shut_down(sig)
     ipcacheShutdownServers();
     shutdown_pending = 1;
 }
+
 #endif
 
 void fatal_common(message)
index 6947c02a45c5af62ccf734b61744662de3e93fbb..f58001904310849e4a1a9baa61d3e8d8ae2bab21 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: wais.cc,v 1.21 1996/04/09 23:28:01 wessels Exp $ */
+/* $Id: wais.cc,v 1.22 1996/04/09 23:28:37 wessels Exp $ */
 
 /*
  * DEBUG: Section 24          wais
@@ -130,7 +130,7 @@ void waisReadReply(fd, data)
                (PF) waisReadReplyTimeout, (void *) data, getReadTimeout());
        } else {
            BIT_RESET(entry->flag, CACHABLE);
-           storeReleaseRequest(entry, __FILE__,__LINE__);
+           storeReleaseRequest(entry, __FILE__, __LINE__);
            cached_error_entry(entry, ERR_READ_ERROR, xstrerror());
            waisCloseAndFree(fd, data);
        }
@@ -233,7 +233,7 @@ void waisSendRequest(fd, data)
        waisSendComplete,
        (void *) data);
     if (!BIT_TEST(data->entry->flag, ENTRY_PRIVATE))
-       storeSetPublicKey(data->entry); /* Make it public */
+       storeSetPublicKey(data->entry);         /* Make it public */
 }
 
 int waisStart(unusedfd, url, type, mime_hdr, entry)