From: wessels <> Date: Wed, 10 Apr 1996 05:28:32 +0000 (+0000) Subject: gindent X-Git-Tag: SQUID_3_0_PRE1~6250 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=147d3115d7391a3a2b54142c74c8a7d0f6ef56e5;p=thirdparty%2Fsquid.git gindent --- diff --git a/src/ftp.cc b/src/ftp.cc index ea170fa928..a2399da5c0 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -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 .\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) diff --git a/src/gopher.cc b/src/gopher.cc index 593de5f79e..b39f10b02b 100644 --- a/src/gopher.cc +++ b/src/gopher.cc @@ -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) diff --git a/src/http.cc b/src/http.cc index 5342860958..60d6b73f15 100644 --- a/src/http.cc +++ b/src/http.cc @@ -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); } diff --git a/src/store.cc b/src/store.cc index a003733bf2..d9a76d52c4 100644 --- a/src/store.cc +++ b/src/store.cc @@ -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 @@ -56,11 +56,12 @@ #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); diff --git a/src/tools.cc b/src/tools.cc index b67aa4ab0f..ea6b9cd82c 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -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) diff --git a/src/wais.cc b/src/wais.cc index 6947c02a45..f580019043 100644 --- a/src/wais.cc +++ b/src/wais.cc @@ -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)