--------------------- PatchSet 2990 Date: 2001/09/09 12:28:37 Author: serassio Branch: nt-2_3-tolsty Tag: (none) Log: Fixed indent problems Members: src/asn.c:1.1.1.3.4.2.2.3.2.1->1.1.1.3.4.2.2.3.2.2 src/cache_diff.c:1.1.1.1.4.1.2.2.2.1->1.1.1.1.4.1.2.2.2.2 src/cache_manager.c:1.1.1.2.4.1.2.1.2.1->1.1.1.2.4.1.2.1.2.2 src/client_db.c:1.1.1.3.4.1.2.1.2.1->1.1.1.3.4.1.2.1.2.2 src/leakfinder.c:1.1.1.1.4.1.2.2.2.1->1.1.1.1.4.1.2.2.2.2 src/mime.c:1.1.1.3.4.1.2.2.2.1->1.1.1.3.4.1.2.2.2.2 Index: squid/src/asn.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/asn.c,v retrieving revision 1.1.1.3.4.2.2.3.2.1 retrieving revision 1.1.1.3.4.2.2.3.2.2 diff -u -r1.1.1.3.4.2.2.3.2.1 -r1.1.1.3.4.2.2.3.2.2 --- squid/src/asn.c 27 Aug 2001 21:48:19 -0000 1.1.1.3.4.2.2.3.2.1 +++ squid/src/asn.c 9 Sep 2001 12:28:37 -0000 1.1.1.3.4.2.2.3.2.2 @@ -1,5 +1,5 @@ /* - * $Id: asn.c,v 1.1.1.3.4.2.2.3.2.1 2001/08/27 21:48:19 tolsty Exp $ + * $Id: asn.c,v 1.1.1.3.4.2.2.3.2.2 2001/09/09 12:28:37 serassio Exp $ * * DEBUG: section 53 AS Number handling * AUTHOR: Duane Wessels, Kostas Anagnostakis @@ -55,14 +55,12 @@ * an intlist but it's coded as a structure for future * enhancements (e.g. expires) */ -struct _as_info -{ +struct _as_info { intlist *as_number; time_t expires; /* NOTUSED */ }; -struct _ASState -{ +struct _ASState { StoreEntry *entry; request_t *request; int as_number; @@ -74,8 +72,7 @@ typedef struct _as_info as_info; /* entry into the radix tree */ -struct _rtentry -{ +struct _rtentry { struct radix_node e_nodes[2]; as_info *e_info; m_int e_addr; @@ -209,7 +206,11 @@ asState->offset = 0; storeClientCopy(e, asState->seen, - asState->offset, 4096, memAllocate(MEM_4K_BUF), asHandleReply, asState); + asState->offset, + 4096, + memAllocate(MEM_4K_BUF), + asHandleReply, + asState); } static void @@ -263,16 +264,23 @@ debug(53, 3) ("asState->seen = %d, asState->offset = %d\n", asState->seen, asState->offset); if (e->store_status == STORE_PENDING) { - debug(53, 3) ("asHandleReply: store_status == STORE_PENDING: %s\n", - storeUrl(e)); - storeClientCopy(e, asState->seen, asState->offset, SM_PAGE_SIZE, buf, - asHandleReply, asState); + debug(53, 3) ("asHandleReply: store_status == STORE_PENDING: %s\n", storeUrl(e)); + storeClientCopy(e, + asState->seen, + asState->offset, + SM_PAGE_SIZE, + buf, + asHandleReply, + asState); } else if (asState->seen < e->mem_obj->inmem_hi) { - debug(53, - 3) ("asHandleReply: asState->seen < e->mem_obj->inmem_hi %s\n", - storeUrl(e)); - storeClientCopy(e, asState->seen, asState->offset, SM_PAGE_SIZE, buf, - asHandleReply, asState); + debug(53, 3) ("asHandleReply: asState->seen < e->mem_obj->inmem_hi %s\n", storeUrl(e)); + storeClientCopy(e, + asState->seen, + asState->offset, + SM_PAGE_SIZE, + buf, + asHandleReply, + asState); } else { debug(53, 3) ("asHandleReply: Done: %s\n", storeUrl(e)); memFree(buf, MEM_4K_BUF); @@ -311,8 +319,7 @@ t = strchr(as_string, '/'); if (t == NULL) { - debug(53, - 3) ("asnAddNet: failed, invalid response from whois server.\n"); + debug(53, 3) ("asnAddNet: failed, invalid response from whois server.\n"); return 0; } *t = '\0'; @@ -338,14 +345,10 @@ if (rn != NULL) { asinfo = ((rtentry *) rn)->e_info; if (intlistFind(asinfo->as_number, as_number)) { - debug(53, - 3) ("asnAddNet: Ignoring repeated network '%s/%d' for AS %d\n", + debug(53, 3) ("asnAddNet: Ignoring repeated network '%s/%d' for AS %d\n", dbg1, bitl, as_number); } else { - debug(53, 3) - - - ("asnAddNet: Warning: Found a network with multiple AS numbers!\n"); + debug(53, 3) ("asnAddNet: Warning: Found a network with multiple AS numbers!\n"); for (Tail = &asinfo->as_number; *Tail; Tail = &(*Tail)->next); q = xcalloc(1, sizeof(intlist)); q->i = as_number; Index: squid/src/cache_diff.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/cache_diff.c,v retrieving revision 1.1.1.1.4.1.2.2.2.1 retrieving revision 1.1.1.1.4.1.2.2.2.2 diff -u -r1.1.1.1.4.1.2.2.2.1 -r1.1.1.1.4.1.2.2.2.2 --- squid/src/cache_diff.c 27 Aug 2001 21:48:20 -0000 1.1.1.1.4.1.2.2.2.1 +++ squid/src/cache_diff.c 9 Sep 2001 12:28:37 -0000 1.1.1.1.4.1.2.2.2.2 @@ -1,5 +1,5 @@ /* - * $Id: cache_diff.c,v 1.1.1.1.4.1.2.2.2.1 2001/08/27 21:48:20 tolsty Exp $ + * $Id: cache_diff.c,v 1.1.1.1.4.1.2.2.2.2 2001/09/09 12:28:37 serassio Exp $ * * AUTHOR: Alex Rousskov * @@ -39,30 +39,27 @@ #include "squid.h" -typedef struct -{ +typedef struct { const char *name; hash_table *hash; int count; /* #currently cached entries */ int scanned_count; /* #scanned entries */ int bad_add_count; /* #duplicate adds */ int bad_del_count; /* #dels with no prior add */ -} -CacheIndex; +} CacheIndex; -typedef struct _CacheEntry -{ +typedef struct _CacheEntry { const cache_key *key; struct _CacheEntry *next; /* storeSwapLogData s; */ unsigned char key_arr[MD5_DIGEST_CHARS]; -} -CacheEntry; +} CacheEntry; /* copied from url.c */ -const char *RequestMethodStr[] = { +const char *RequestMethodStr[] = +{ "NONE", "GET", "POST", @@ -152,9 +149,12 @@ cacheIndexInitReport(CacheIndex * idx) { assert(idx); - fprintf(stderr, "%s: bad swap_add: %d\n", idx->name, idx->bad_add_count); - fprintf(stderr, "%s: bad swap_del: %d\n", idx->name, idx->bad_del_count); - fprintf(stderr, "%s: scanned lines: %d\n", idx->name, idx->scanned_count); + fprintf(stderr, "%s: bad swap_add: %d\n", + idx->name, idx->bad_add_count); + fprintf(stderr, "%s: bad swap_del: %d\n", + idx->name, idx->bad_del_count); + fprintf(stderr, "%s: scanned lines: %d\n", + idx->name, idx->scanned_count); } static int @@ -243,8 +243,7 @@ static int usage(const char *prg_name) { - fprintf(stderr, - "usage: %s : ... : ...\n", + fprintf(stderr, "usage: %s : ... : ...\n", prg_name); return -1; } Index: squid/src/cache_manager.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/cache_manager.c,v retrieving revision 1.1.1.2.4.1.2.1.2.1 retrieving revision 1.1.1.2.4.1.2.1.2.2 diff -u -r1.1.1.2.4.1.2.1.2.1 -r1.1.1.2.4.1.2.1.2.2 --- squid/src/cache_manager.c 27 Aug 2001 21:48:20 -0000 1.1.1.2.4.1.2.1.2.1 +++ squid/src/cache_manager.c 9 Sep 2001 12:28:37 -0000 1.1.1.2.4.1.2.1.2.2 @@ -1,5 +1,6 @@ + /* - * $Id: cache_manager.c,v 1.1.1.2.4.1.2.1.2.1 2001/08/27 21:48:20 tolsty Exp $ + * $Id: cache_manager.c,v 1.1.1.2.4.1.2.1.2.2 2001/09/09 12:28:37 serassio Exp $ * * DEBUG: section 16 Cache Manager Objects * AUTHOR: Duane Wessels @@ -36,34 +37,27 @@ #define MGR_PASSWD_SZ 128 -typedef struct -{ +typedef struct { StoreEntry *entry; char *action; char *user_name; char *passwd; -} -cachemgrStateData; +} cachemgrStateData; -typedef struct _action_table -{ +typedef struct _action_table { char *action; char *desc; OBJH *handler; - struct - { + struct { int pw_req:1; int atomic:1; - } - flags; + } flags; struct _action_table *next; -} -action_table; +} action_table; static action_table *cachemgrFindAction(const char *action); static cachemgrStateData *cachemgrParseUrl(const char *url); -static void cachemgrParseHeaders(cachemgrStateData * mgr, - const request_t * request); +static void cachemgrParseHeaders(cachemgrStateData * mgr, const request_t * request); static int cachemgrCheckPassword(cachemgrStateData *); static void cachemgrStateFree(cachemgrStateData * mgr); static char *cachemgrPasswdGet(cachemgr_passwd *, const char *); @@ -75,8 +69,7 @@ action_table *ActionTable = NULL; void -cachemgrRegister(const char *action, const char *desc, OBJH * handler, - int pw_req_flag, int atomic) +cachemgrRegister(const char *action, const char *desc, OBJH * handler, int pw_req_flag, int atomic) { action_table *a; action_table **A; @@ -133,8 +126,7 @@ } else { prot = cachemgrActionProtection(a); if (!strcmp(prot, "disabled") || !strcmp(prot, "hidden")) { - debug(16, 1) ("cachemgrParseUrl: action '%s' is %s\n", request, - prot); + debug(16, 1) ("cachemgrParseUrl: action '%s' is %s\n", request, prot); return NULL; } } @@ -152,14 +144,11 @@ const char *basic_cookie; /* base 64 _decoded_ user:passwd pair */ const char *passwd_del; assert(mgr && request); - basic_cookie = - httpHeaderGetAuth(&request->header, HDR_AUTHORIZATION, "Basic"); + basic_cookie = httpHeaderGetAuth(&request->header, HDR_AUTHORIZATION, "Basic"); if (!basic_cookie) return; if (!(passwd_del = strchr(basic_cookie, ':'))) { - debug(16, - 1) ("cachemgrParseHeaders: unknown basic_cookie format '%s'\n", - basic_cookie); + debug(16, 1) ("cachemgrParseHeaders: unknown basic_cookie format '%s'\n", basic_cookie); return; } /* found user:password pair, reset old values */ @@ -169,8 +158,7 @@ mgr->user_name[passwd_del - basic_cookie] = '\0'; mgr->passwd = xstrdup(passwd_del + 1); /* warning: this prints decoded password which maybe not what you want to do @?@ @?@ */ - debug(16, 9) ("cachemgrParseHeaders: got user: '%s' passwd: '%s'\n", - mgr->user_name, mgr->passwd); + debug(16, 9) ("cachemgrParseHeaders: got user: '%s' passwd: '%s'\n", mgr->user_name, mgr->passwd); } /* @@ -268,7 +256,12 @@ HttpReply *rep = entry->mem_obj->reply; /* prove there are no previous reply headers around */ assert(0 == rep->sline.status); - httpReplySetHeaders(rep, (double) 1.0, HTTP_OK, NULL, "text/plain", -1, /* C-Len */ + httpReplySetHeaders(rep, + (double) 1.0, + HTTP_OK, + NULL, + "text/plain", + -1, /* C-Len */ squid_curtime, /* LMT */ squid_curtime); httpReplySwapOut(rep, entry); @@ -342,9 +335,13 @@ void cachemgrInit(void) { - cachemgrRegister("menu", "This Cachemanager Menu", cachemgrMenu, 0, 1); + cachemgrRegister("menu", + "This Cachemanager Menu", + cachemgrMenu, 0, 1); cachemgrRegister("shutdown", - "Shut Down the Squid Process", cachemgrShutdown, 1, 1); + "Shut Down the Squid Process", + cachemgrShutdown, 1, 1); cachemgrRegister("offline_toggle", - "Toggle offline_mode setting", cachemgrOfflineToggle, 1, 1); + "Toggle offline_mode setting", + cachemgrOfflineToggle, 1, 1); } Index: squid/src/client_db.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_db.c,v retrieving revision 1.1.1.3.4.1.2.1.2.1 retrieving revision 1.1.1.3.4.1.2.1.2.2 diff -u -r1.1.1.3.4.1.2.1.2.1 -r1.1.1.3.4.1.2.1.2.2 --- squid/src/client_db.c 27 Aug 2001 21:48:20 -0000 1.1.1.3.4.1.2.1.2.1 +++ squid/src/client_db.c 9 Sep 2001 12:28:37 -0000 1.1.1.3.4.1.2.1.2.2 @@ -1,5 +1,6 @@ + /* - * $Id: client_db.c,v 1.1.1.3.4.1.2.1.2.1 2001/08/27 21:48:20 tolsty Exp $ + * $Id: client_db.c,v 1.1.1.3.4.1.2.1.2.2 2001/09/09 12:28:37 serassio Exp $ * * DEBUG: section 0 Client Database * AUTHOR: Duane Wessels @@ -56,7 +57,10 @@ if (client_table) return; client_table = hash_create((HASHCMP *) strcmp, 467, hash_string); - cachemgrRegister("client_list", "Cache Client List", clientdbDump, 0, 1); + cachemgrRegister("client_list", + "Cache Client List", + clientdbDump, + 0, 1); } void @@ -169,7 +173,8 @@ storeAppendPrintf(sentry, "Name: %s\n", fqdnFromAddr(c->addr)); storeAppendPrintf(sentry, "Currently established connections: %d\n", c->n_established); - storeAppendPrintf(sentry, " ICP Requests %d\n", c->Icp.n_requests); + storeAppendPrintf(sentry, " ICP Requests %d\n", + c->Icp.n_requests); for (l = LOG_TAG_NONE; l < LOG_TYPE_MAX; l++) { if (c->Icp.result_hist[l] == 0) continue; @@ -182,7 +187,8 @@ c->Icp.result_hist[l], percent(c->Icp.result_hist[l], c->Icp.n_requests)); } - storeAppendPrintf(sentry, " HTTP Requests %d\n", c->Http.n_requests); + storeAppendPrintf(sentry, " HTTP Requests %d\n", + c->Http.n_requests); for (l = LOG_TAG_NONE; l < LOG_TYPE_MAX; l++) { if (c->Http.result_hist[l] == 0) continue; @@ -257,9 +263,8 @@ *ErrP = SNMP_ERR_NOERROR; debug(49, 6) ("snmp_meshCtblFn: Current : \n"); snmpDebugOid(6, Var->name, Var->name_length); - snprintf(key, sizeof(key), "%d.%d.%d.%d", Var->name[LEN_SQ_NET + 3], - Var->name[LEN_SQ_NET + 4], Var->name[LEN_SQ_NET + 5], - Var->name[LEN_SQ_NET + 6]); + snprintf(key, sizeof(key), "%d.%d.%d.%d", Var->name[LEN_SQ_NET + 3], Var->name[LEN_SQ_NET + 4], + Var->name[LEN_SQ_NET + 5], Var->name[LEN_SQ_NET + 6]); debug(49, 5) ("snmp_meshCtblFn: [%s] requested!\n", key); c = (ClientInfo *) hash_lookup(client_table, key); if (c == NULL) { @@ -270,15 +275,18 @@ switch (Var->name[LEN_SQ_NET + 2]) { case MESH_CTBL_ADDR: Answer = snmp_var_new_integer(Var->name, Var->name_length, - (snint) c->addr.s_addr, SMI_IPADDRESS); + (snint) c->addr.s_addr, + SMI_IPADDRESS); break; case MESH_CTBL_HTBYTES: Answer = snmp_var_new_integer(Var->name, Var->name_length, - (snint) c->Http.kbytes_out.kb, SMI_COUNTER32); + (snint) c->Http.kbytes_out.kb, + SMI_COUNTER32); break; case MESH_CTBL_HTREQ: Answer = snmp_var_new_integer(Var->name, Var->name_length, - (snint) c->Http.n_requests, SMI_COUNTER32); + (snint) c->Http.n_requests, + SMI_COUNTER32); break; case MESH_CTBL_HTHITS: aggr = 0; @@ -287,28 +295,34 @@ aggr += c->Http.result_hist[l]; } Answer = snmp_var_new_integer(Var->name, Var->name_length, - (snint) aggr, SMI_COUNTER32); + (snint) aggr, + SMI_COUNTER32); break; case MESH_CTBL_HTHITBYTES: Answer = snmp_var_new_integer(Var->name, Var->name_length, - (snint) c->Http.hit_kbytes_out.kb, SMI_COUNTER32); + (snint) c->Http.hit_kbytes_out.kb, + SMI_COUNTER32); break; case MESH_CTBL_ICPBYTES: Answer = snmp_var_new_integer(Var->name, Var->name_length, - (snint) c->Icp.kbytes_out.kb, SMI_COUNTER32); + (snint) c->Icp.kbytes_out.kb, + SMI_COUNTER32); break; case MESH_CTBL_ICPREQ: Answer = snmp_var_new_integer(Var->name, Var->name_length, - (snint) c->Icp.n_requests, SMI_COUNTER32); + (snint) c->Icp.n_requests, + SMI_COUNTER32); break; case MESH_CTBL_ICPHITS: aggr = c->Icp.result_hist[LOG_UDP_HIT]; Answer = snmp_var_new_integer(Var->name, Var->name_length, - (snint) aggr, SMI_COUNTER32); + (snint) aggr, + SMI_COUNTER32); break; case MESH_CTBL_ICPHITBYTES: Answer = snmp_var_new_integer(Var->name, Var->name_length, - (snint) c->Icp.hit_kbytes_out.kb, SMI_COUNTER32); + (snint) c->Icp.hit_kbytes_out.kb, + SMI_COUNTER32); break; default: *ErrP = SNMP_ERR_NOSUCHNAME; Index: squid/src/leakfinder.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/leakfinder.c,v retrieving revision 1.1.1.1.4.1.2.2.2.1 retrieving revision 1.1.1.1.4.1.2.2.2.2 diff -u -r1.1.1.1.4.1.2.2.2.1 -r1.1.1.1.4.1.2.2.2.2 --- squid/src/leakfinder.c 27 Aug 2001 21:48:21 -0000 1.1.1.1.4.1.2.2.2.1 +++ squid/src/leakfinder.c 9 Sep 2001 12:28:37 -0000 1.1.1.1.4.1.2.2.2.2 @@ -1,6 +1,6 @@ /* - * $Id: leakfinder.c,v 1.1.1.1.4.1.2.2.2.1 2001/08/27 21:48:21 tolsty Exp $ + * $Id: leakfinder.c,v 1.1.1.1.4.1.2.2.2.2 2001/09/09 12:28:37 serassio Exp $ * * DEBUG: section 45 Callback Data Registry * AUTHOR: Duane Wessels @@ -43,15 +43,13 @@ static int leakCount = 0; -typedef struct _ptr -{ +typedef struct _ptr { void *key; struct _ptr *next; const char *file; int line; time_t when; -} -ptr; +} ptr; static HASHCMP ptr_cmp; static HASHHASH ptr_hash; @@ -64,7 +62,9 @@ { debug(45, 3) ("ptrInit\n"); htable = hash_create(ptr_cmp, 1 << 8, ptr_hash); - cachemgrRegister("leaks", "Memory Leak Tracking", ptrDump, 0, 1); + cachemgrRegister("leaks", + "Memory Leak Tracking", + ptrDump, 0, 1); } void * Index: squid/src/mime.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/mime.c,v retrieving revision 1.1.1.3.4.1.2.2.2.1 retrieving revision 1.1.1.3.4.1.2.2.2.2 diff -u -r1.1.1.3.4.1.2.2.2.1 -r1.1.1.3.4.1.2.2.2.2 --- squid/src/mime.c 27 Aug 2001 21:48:21 -0000 1.1.1.3.4.1.2.2.2.1 +++ squid/src/mime.c 9 Sep 2001 12:28:37 -0000 1.1.1.3.4.1.2.2.2.2 @@ -1,5 +1,6 @@ + /* - * $Id: mime.c,v 1.1.1.3.4.1.2.2.2.1 2001/08/27 21:48:21 tolsty Exp $ + * $Id: mime.c,v 1.1.1.3.4.1.2.2.2.2 2001/09/09 12:28:37 serassio Exp $ * * DEBUG: section 25 MIME Parsing * AUTHOR: Harvest Derived @@ -36,8 +37,7 @@ #define GET_HDR_SZ 1024 -typedef struct _mime_entry -{ +typedef struct _mime_entry { char *pattern; regex_t compiled_pattern; char *icon; @@ -46,8 +46,7 @@ char transfer_mode; unsigned int view_option:1, download_option:1; struct _mime_entry *next; -} -mimeEntry; +} mimeEntry; static mimeEntry *MimeTable = NULL; static mimeEntry **MimeTableTail = NULL; @@ -115,7 +114,8 @@ return NULL; } -size_t headersEnd(const char *mime, size_t l) +size_t +headersEnd(const char *mime, size_t l) { size_t e = 0; int state = 0; @@ -332,8 +332,7 @@ else if (!strcmp(option, "+view")) view_option = 1; else - debug(25, 1) ("mimeInit: unknown option: '%s' (%s)\n", buf, - option); + debug(25, 1) ("mimeInit: unknown option: '%s' (%s)\n", buf, option); } if (regcomp(&re, pattern, re_flags) != 0) { debug(25, 1) ("mimeInit: regcomp error: '%s'\n", buf); @@ -413,7 +412,10 @@ } flags = null_request_flags; flags.cachable = 1; - e = storeCreateEntry(url, url, flags, METHOD_GET); + e = storeCreateEntry(url, + url, + flags, + METHOD_GET); assert(e != NULL); storeSetPublicKey(e); storeBuffer(e);