--------------------- PatchSet 3015 Date: 2001/09/12 19:38:35 Author: serassio Branch: nt-2_3-tolsty Tag: (none) Log: Fixed indent problems Members: include/tree.h:1.1.1.1.44.1.2.1->1.1.1.1.44.1.2.2 src/acl.c:1.1.1.3.4.3.2.3.2.1->1.1.1.3.4.3.2.3.2.2 src/async_io.c:1.1.1.3.4.2.2.1.2.1->1.1.1.3.4.2.2.1.2.2 Index: squid/include/tree.h =================================================================== RCS file: /cvsroot/squid-sf//squid/include/Attic/tree.h,v retrieving revision 1.1.1.1.44.1.2.1 retrieving revision 1.1.1.1.44.1.2.2 diff -u -r1.1.1.1.44.1.2.1 -r1.1.1.1.44.1.2.2 --- squid/include/tree.h 27 Aug 2001 21:48:17 -0000 1.1.1.1.44.1.2.1 +++ squid/include/tree.h 12 Sep 2001 19:38:35 -0000 1.1.1.1.44.1.2.2 @@ -3,20 +3,18 @@ * vix 22jan93 [revisited; uses RCS, ANSI, POSIX; has bug fixes] * vix 27jun86 [broken out of tree.c] * - * $Id: tree.h,v 1.1.1.1.44.1.2.1 2001/08/27 21:48:17 tolsty Exp $ + * $Id: tree.h,v 1.1.1.1.44.1.2.2 2001/09/12 19:38:35 serassio Exp $ */ #ifndef _TREE_H_INCLUDED #define _TREE_H_INCLUDED -typedef struct tree_s -{ +typedef struct tree_s { void *data; struct tree_s *left, *right; int bal; -} -tree; +} tree; typedef int BTREE_CMP(void *, void *); typedef int BTREE_UAR(void *); Index: squid/src/acl.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/acl.c,v retrieving revision 1.1.1.3.4.3.2.3.2.1 retrieving revision 1.1.1.3.4.3.2.3.2.2 diff -u -r1.1.1.3.4.3.2.3.2.1 -r1.1.1.3.4.3.2.3.2.2 --- squid/src/acl.c 27 Aug 2001 21:48:19 -0000 1.1.1.3.4.3.2.3.2.1 +++ squid/src/acl.c 12 Sep 2001 19:38:35 -0000 1.1.1.3.4.3.2.3.2.2 @@ -1,5 +1,6 @@ + /* - * $Id: acl.c,v 1.1.1.3.4.3.2.3.2.1 2001/08/27 21:48:19 tolsty Exp $ + * $Id: acl.c,v 1.1.1.3.4.3.2.3.2.2 2001/09/12 19:38:35 serassio Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -452,11 +453,7 @@ if (!decode_addr(addr1, &q->addr1, &q->mask)) { debug(28, 0) ("%s line %d: %s\n", cfg_filename, config_lineno, config_input_line); - debug(28, 0) - - - ("aclParseIpData: Ignoring invalid IP acl entry: unknown first address '%s'\n", - addr1); + debug(28, 0) ("aclParseIpData: Ignoring invalid IP acl entry: unknown first address '%s'\n", addr1); safe_free(q); return NULL; } @@ -464,11 +461,7 @@ if (*addr2 && !decode_addr(addr2, &q->addr2, &q->mask)) { debug(28, 0) ("%s line %d: %s\n", cfg_filename, config_lineno, config_input_line); - debug(28, 0) - - - ("aclParseIpData: Ignoring invalid IP acl entry: unknown second address '%s'\n", - addr2); + debug(28, 0) ("aclParseIpData: Ignoring invalid IP acl entry: unknown second address '%s'\n", addr2); safe_free(q); return NULL; } @@ -476,11 +469,7 @@ if (*mask && !decode_addr(mask, &q->mask, NULL)) { debug(28, 0) ("%s line %d: %s\n", cfg_filename, config_lineno, config_input_line); - debug(28, 0) - - - ("aclParseIpData: Ignoring invalid IP acl entry: unknown netmask '%s'\n", - mask); + debug(28, 0) ("aclParseIpData: Ignoring invalid IP acl entry: unknown netmask '%s'\n", mask); safe_free(q); return NULL; } @@ -553,7 +542,8 @@ default: debug(28, 0) ("%s line %d: %s\n", cfg_filename, config_lineno, config_input_line); - debug(28, 0) ("aclParseTimeSpec: Bad Day '%c'\n", *t); + debug(28, 0) ("aclParseTimeSpec: Bad Day '%c'\n", + *t); break; } } @@ -571,8 +561,7 @@ if (q->start > q->stop) { debug(28, 0) ("%s line %d: %s\n", cfg_filename, config_lineno, config_input_line); - debug(28, - 0) ("aclParseTimeSpec: IGNORING Reversed time range\n"); + debug(28, 0) ("aclParseTimeSpec: IGNORING Reversed time range\n"); xfree(q); return; } @@ -610,8 +599,7 @@ regerror(errcode, &comp, errbuf, sizeof errbuf); debug(28, 0) ("%s line %d: %s\n", cfg_filename, config_lineno, config_input_line); - debug(28, - 0) ("aclParseRegexList: Invalid regular expression '%s': %s\n", + debug(28, 0) ("aclParseRegexList: Invalid regular expression '%s': %s\n", t, errbuf); continue; } @@ -686,11 +674,7 @@ new_acl = 1; } else { if (acltype != A->type) { - debug(28, 0) - - - ("aclParseAclLine: ACL '%s' already exists with different type, skipping.\n", - A->name); + debug(28, 0) ("aclParseAclLine: ACL '%s' already exists with different type, skipping.\n", A->name); return; } debug(28, 3) ("aclParseAclLine: Appending to '%s'\n", aclname); @@ -746,8 +730,7 @@ aclParseWordList(&A->data); if (!proxy_auth_cache) { /* First time around, 7921 should be big enough */ - proxy_auth_cache = - hash_create((HASHCMP *) strcmp, 7921, hash_string); + proxy_auth_cache = hash_create((HASHCMP *) strcmp, 7921, hash_string); assert(proxy_auth_cache); } break; @@ -842,8 +825,7 @@ if ((t = strtok(NULL, w_space)) == NULL) { debug(28, 0) ("%s line %d: %s\n", cfg_filename, config_lineno, config_input_line); - debug(28, - 0) ("aclParseDenyInfoLine: missing 'error page' parameter.\n"); + debug(28, 0) ("aclParseDenyInfoLine: missing 'error page' parameter.\n"); return; } A = xcalloc(1, sizeof(acl_deny_info_list)); @@ -861,10 +843,7 @@ if (A->acl_list == NULL) { debug(28, 0) ("%s line %d: %s\n", cfg_filename, config_lineno, config_input_line); - debug(28, 0) - - - ("aclParseDenyInfoLine: deny_info line contains no ACL's, skipping\n"); + debug(28, 0) ("aclParseDenyInfoLine: deny_info line contains no ACL's, skipping\n"); xfree(A); return; } @@ -899,9 +878,7 @@ else { debug(28, 0) ("%s line %d: %s\n", cfg_filename, config_lineno, config_input_line); - debug(28, - 0) ("aclParseAccessLine: expecting 'allow' or 'deny', got '%s'.\n", - t); + debug(28, 0) ("aclParseAccessLine: expecting 'allow' or 'deny', got '%s'.\n", t); xfree(A); return; } @@ -933,8 +910,7 @@ if (A->acl_list == NULL) { debug(28, 0) ("%s line %d: %s\n", cfg_filename, config_lineno, config_input_line); - debug(28, 0) - ("aclParseAccessLine: Access line contains no ACL's, skipping\n"); + debug(28, 0) ("aclParseAccessLine: Access line contains no ACL's, skipping\n"); xfree(A); return; } @@ -1012,8 +988,7 @@ debug(28, 3) ("aclMatchUser: checking '%s'\n", user); while (data) { debug(28, 3) ("aclMatchUser: looking for '%s'\n", data->key); - if (strcmp(data->key, "REQUIRED") == 0 && *user != '\0' - && strcmp(user, "-") != 0) + if (strcmp(data->key, "REQUIRED") == 0 && *user != '\0' && strcmp(user, "-") != 0) return 1; if (strcmp(data->key, user) == 0) return 1; @@ -1023,8 +998,7 @@ } static int -aclDecodeProxyAuth(const char *proxy_auth, char **user, char **password, - char *buf, size_t bufsize) +aclDecodeProxyAuth(const char *proxy_auth, char **user, char **password, char *buf, size_t bufsize) { char *sent_auth; char *cleartext; @@ -1032,9 +1006,7 @@ return 0; debug(28, 6) ("aclDecodeProxyAuth: header = '%s'\n", proxy_auth); if (strncasecmp(proxy_auth, "Basic ", 6) != 0) { - debug(28, - 1) ("aclDecodeProxyAuth: Unsupported proxy-auth scheme, '%s'\n", - proxy_auth); + debug(28, 1) ("aclDecodeProxyAuth: Unsupported proxy-auth scheme, '%s'\n", proxy_auth); return 0; } proxy_auth += 6; /* "Basic " */ @@ -1058,11 +1030,7 @@ if ((*password = strchr(*user, ':')) != NULL) *(*password)++ = '\0'; if (*password == NULL) { - debug(28, 1) - - - ("aclDecodeProxyAuth: no password in proxy authorization header '%s'\n", - proxy_auth); + debug(28, 1) ("aclDecodeProxyAuth: no password in proxy authorization header '%s'\n", proxy_auth); return 0; } if (**password == '\0') { @@ -1082,15 +1050,13 @@ */ static int -aclMatchProxyAuth(wordlist * data, const char *proxy_auth, - acl_proxy_auth_user * auth_user, aclCheck_t * checklist) +aclMatchProxyAuth(wordlist * data, const char *proxy_auth, acl_proxy_auth_user * auth_user, aclCheck_t * checklist) { /* checklist is used to register user name when identified, nothing else */ LOCAL_ARRAY(char, login_buf, USER_IDENT_SZ); char *user, *password; - if (!aclDecodeProxyAuth(proxy_auth, &user, &password, login_buf, - sizeof(login_buf))) + if (!aclDecodeProxyAuth(proxy_auth, &user, &password, login_buf, sizeof(login_buf))) /* No or invalid Proxy-Auth header */ return -2; @@ -1109,8 +1075,7 @@ if (auth_user->passwd_ok != 1) { /* password was checked but did not match */ assert(auth_user->passwd_ok == 0); - debug(28, - 4) ("aclMatchProxyAuth: authentication failed for user '%s'\n", + debug(28, 4) ("aclMatchProxyAuth: authentication failed for user '%s'\n", user); aclFreeProxyAuthUser(auth_user); /* @@ -1126,8 +1091,7 @@ debug(28, 4) ("aclMatchProxyAuth: user '%s' validated OK\n", user); /* store validated user in hash, after filling in expiretime */ xstrncpy(checklist->request->user_ident, user, USER_IDENT_SZ); - auth_user->expiretime = - current_time.tv_sec + Config.authenticateTTL; + auth_user->expiretime = current_time.tv_sec + Config.authenticateTTL; auth_user->ip_expiretime = squid_curtime + Config.authenticateIpTTL; auth_user->ipaddr = checklist->src_addr; hash_join(proxy_auth_cache, (hash_link *) auth_user); @@ -1156,9 +1120,7 @@ return aclMatchUser(data, user); } else { /* user has switched to another IP addr */ - debug(28, - 1) ("aclMatchProxyAuth: user '%s' has changed IP address\n", - user); + debug(28, 1) ("aclMatchProxyAuth: user '%s' has changed IP address\n", user); /* remove this user from the hash, making him unknown */ hash_remove_link(proxy_auth_cache, (hash_link *) auth_user); aclFreeProxyAuthUser(auth_user); @@ -1167,8 +1129,7 @@ } } else { /* password mismatch/timeout */ - debug(28, - 4) ("aclMatchProxyAuth: user '%s' password mismatch/timeout\n", + debug(28, 4) ("aclMatchProxyAuth: user '%s' password mismatch/timeout\n", user); /* remove this user from the hash, making him unknown */ hash_remove_link(proxy_auth_cache, (hash_link *) auth_user); @@ -1206,8 +1167,7 @@ * in aclMatchProxyAuth, and we should never get this far. */ assert(ok); - debug(28, 4) ("aclLookupProxyAuthStart: going to ask authenticator on %s\n", - user); + debug(28, 4) ("aclLookupProxyAuthStart: going to ask authenticator on %s\n", user); /* we must still check this user's password */ auth_user = memAllocate(MEM_ACL_PROXY_AUTH_USER); auth_user->user = xstrdup(user); @@ -1215,7 +1175,8 @@ auth_user->passwd_ok = -1; auth_user->expiretime = -1; checklist->auth_user = auth_user; - authenticateStart(checklist->auth_user, aclLookupProxyAuthDone, checklist); + authenticateStart(checklist->auth_user, aclLookupProxyAuthDone, + checklist); } static int @@ -1356,8 +1317,7 @@ return aclMatchDomainList(&ae->data, "none"); /* NOTREACHED */ case ACL_SRC_DOMAIN: - fqdn = - fqdncache_gethostbyaddr(checklist->src_addr, FQDN_LOOKUP_IF_MISS); + fqdn = fqdncache_gethostbyaddr(checklist->src_addr, FQDN_LOOKUP_IF_MISS); if (fqdn) { return aclMatchDomainList(&ae->data, fqdn); } else if (checklist->state[ACL_SRC_DOMAIN] == ACL_LOOKUP_NONE) { @@ -1383,8 +1343,7 @@ return aclMatchRegex(ae->data, "none"); /* NOTREACHED */ case ACL_SRC_DOM_REGEX: - fqdn = - fqdncache_gethostbyaddr(checklist->src_addr, FQDN_LOOKUP_IF_MISS); + fqdn = fqdncache_gethostbyaddr(checklist->src_addr, FQDN_LOOKUP_IF_MISS); if (fqdn) { return aclMatchRegex(ae->data, fqdn); } else if (checklist->state[ACL_SRC_DOMAIN] == ACL_LOOKUP_NONE) { @@ -1461,11 +1420,7 @@ header = httpHeaderGetStr(&checklist->request->header, HDR_AUTHORIZATION); #else - debug(28, 1) - - - ("aclMatchAcl: proxy_auth %s not applicable on accelerated requests.\n", - ae->name); + debug(28, 1) ("aclMatchAcl: proxy_auth %s not applicable on accelerated requests.\n", ae->name); return -1; #endif } @@ -1476,7 +1431,9 @@ r->flags.used_proxy_auth = 1; /* Check the password */ switch (aclMatchProxyAuth(ae->data, - header, checklist->auth_user, checklist)) { + header, + checklist->auth_user, + checklist)) { case 0: /* Correct password, but was not allowed in this ACL */ return 0; @@ -1589,17 +1546,20 @@ if (checklist->state[ACL_DST_IP] == ACL_LOOKUP_NEEDED) { checklist->state[ACL_DST_IP] = ACL_LOOKUP_PENDING; ipcache_nbgethostbyname(checklist->request->host, - aclLookupDstIPDone, checklist); + aclLookupDstIPDone, + checklist); return; } else if (checklist->state[ACL_DST_ASN] == ACL_LOOKUP_NEEDED) { checklist->state[ACL_DST_ASN] = ACL_LOOKUP_PENDING; ipcache_nbgethostbyname(checklist->request->host, - aclLookupDstIPforASNDone, checklist); + aclLookupDstIPforASNDone, + checklist); return; } else if (checklist->state[ACL_SRC_DOMAIN] == ACL_LOOKUP_NEEDED) { checklist->state[ACL_SRC_DOMAIN] = ACL_LOOKUP_PENDING; fqdncache_nbgethostbyaddr(checklist->src_addr, - aclLookupSrcFQDNDone, checklist); + aclLookupSrcFQDNDone, + checklist); return; } else if (checklist->state[ACL_DST_DOMAIN] == ACL_LOOKUP_NEEDED) { ia = ipcacheCheckNumeric(checklist->request->host); @@ -1610,7 +1570,8 @@ checklist->dst_addr = ia->in_addrs[0]; checklist->state[ACL_DST_DOMAIN] = ACL_LOOKUP_PENDING; fqdncache_nbgethostbyaddr(checklist->dst_addr, - aclLookupDstFQDNDone, checklist); + aclLookupDstFQDNDone, + checklist); return; } else if (checklist->state[ACL_PROXY_AUTH] == ACL_LOOKUP_NEEDED) { debug(28, 3) ("aclCheck: checking password via authenticator\n"); @@ -1633,10 +1594,7 @@ checklist->state[ACL_IDENT] = ACL_LOOKUP_PENDING; return; } else { - debug(28, 1) - - - ("aclCheck: Can't start ident lookup. No client connection\n"); + debug(28, 1) ("aclCheck: Can't start ident lookup. No client connection\n"); cbdataUnlock(checklist->conn); checklist->conn = NULL; allow = 0; @@ -1706,8 +1664,7 @@ aclCheck_t *checklist = data; if (ident) { xstrncpy(checklist->ident, ident, sizeof(checklist->ident)); - xstrncpy(checklist->request->user_ident, ident, - sizeof(checklist->request->user_ident)); + xstrncpy(checklist->request->user_ident, ident, sizeof(checklist->request->user_ident)); } else { xstrncpy(checklist->ident, "-", sizeof(checklist->ident)); } @@ -1716,8 +1673,7 @@ * over and over on persistent connections */ if (cbdataValid(checklist->conn) && !checklist->conn->ident[0]) - xstrncpy(checklist->conn->ident, checklist->ident, - sizeof(checklist->conn->ident)); + xstrncpy(checklist->conn->ident, checklist->ident, sizeof(checklist->conn->ident)); aclCheck(checklist); } #endif @@ -1769,7 +1725,9 @@ } aclCheck_t * -aclChecklistCreate(const acl_access * A, request_t * request, const char *ident) +aclChecklistCreate(const acl_access * A, + request_t * request, + const char *ident) { int i; aclCheck_t *checklist = memAllocate(MEM_ACLCHECK_T); @@ -1994,16 +1952,8 @@ } if (ret == 0) { debug(28, 0) ("WARNING: '%s' is a subdomain of '%s'\n", d1, d2); - debug(28, 0) - - - ("WARNING: because of this '%s' is ignored to keep splay tree searching predictable\n", - a); - debug(28, 0) - - - ("WARNING: You should probably remove '%s' from the ACL named '%s'\n", - d1, AclMatchedName); + debug(28, 0) ("WARNING: because of this '%s' is ignored to keep splay tree searching predictable\n", a); + debug(28, 0) ("WARNING: You should probably remove '%s' from the ACL named '%s'\n", d1, AclMatchedName); } return ret; } @@ -2111,7 +2061,10 @@ t->weekbits & ACL_THURSDAY ? 'H' : '-', t->weekbits & ACL_FRIDAY ? 'F' : '-', t->weekbits & ACL_SATURDAY ? 'A' : '-', - t->start / 60, t->start % 60, t->stop / 60, t->stop % 60); + t->start / 60, + t->start % 60, + t->stop / 60, + t->stop % 60); wordlistAdd(&W, buf); t = t->next; } @@ -2337,11 +2290,7 @@ if (!decode_eth(eth, q->eth)) { debug(28, 0) ("%s line %d: %s\n", cfg_filename, config_lineno, config_input_line); - debug(28, 0) - - - ("aclParseArpData: Ignoring invalid ARP acl entry: can't parse '%s'\n", - eth); + debug(28, 0) ("aclParseArpData: Ignoring invalid ARP acl entry: can't parse '%s'\n", eth); safe_free(q); return NULL; } @@ -2470,7 +2419,8 @@ arpReq.arp_ha.sa_data[2] & 0xff, arpReq.arp_ha.sa_data[3] & 0xff, arpReq.arp_ha.sa_data[4] & 0xff, - arpReq.arp_ha.sa_data[5] & 0xff, ifr->ifr_name); + arpReq.arp_ha.sa_data[5] & 0xff, + ifr->ifr_name); /* Do lookup */ *Top = splay_splay(&arpReq.arp_ha.sa_data, *Top, aclArpCompare); /* Return if match, otherwise continue to other interfaces */ Index: squid/src/async_io.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/async_io.c,v retrieving revision 1.1.1.3.4.2.2.1.2.1 retrieving revision 1.1.1.3.4.2.2.1.2.2 diff -u -r1.1.1.3.4.2.2.1.2.1 -r1.1.1.3.4.2.2.1.2.2 --- squid/src/async_io.c 27 Aug 2001 21:48:19 -0000 1.1.1.3.4.2.2.1.2.1 +++ squid/src/async_io.c 12 Sep 2001 19:38:36 -0000 1.1.1.3.4.2.2.1.2.2 @@ -1,5 +1,6 @@ + /* - * $Id: async_io.c,v 1.1.1.3.4.2.2.1.2.1 2001/08/27 21:48:19 tolsty Exp $ + * $Id: async_io.c,v 1.1.1.3.4.2.2.1.2.2 2001/09/12 19:38:36 serassio Exp $ * * DEBUG: section 32 Asynchronous Disk I/O * AUTHOR: Pete Bentley @@ -45,19 +46,16 @@ #define _AIO_OPENDIR 5 #define _AIO_STAT 6 -typedef struct aio_ctrl_t -{ +typedef struct aio_ctrl_t { struct aio_ctrl_t *next; int fd; int operation; AIOCB *done_handler; void *done_handler_data; aio_result_t result; -} -aio_ctrl_t; +} aio_ctrl_t; -struct -{ +struct { int open; int close; int cancel; @@ -66,15 +64,12 @@ int stat; int unlink; int check_callback; -} -aio_counts; +} aio_counts; -typedef struct aio_unlinkq_t -{ +typedef struct aio_unlinkq_t { char *path; struct aio_unlinkq_t *next; -} -aio_unlinkq_t; +} aio_unlinkq_t; static aio_ctrl_t *used_list = NULL; static int initialised = 0; @@ -113,8 +108,7 @@ #endif void -aioOpen(const char *path, int oflag, mode_t mode, AIOCB * callback, - void *callback_data) +aioOpen(const char *path, int oflag, mode_t mode, AIOCB * callback, void *callback_data) { aio_ctrl_t *ctrlp; int ret; @@ -210,8 +204,7 @@ void -aioWrite(int fd, int offset, char *bufp, int len, AIOCB * callback, - void *callback_data, FREE * free_func) +aioWrite(int fd, int offset, char *bufp, int len, AIOCB * callback, void *callback_data, FREE * free_func) { aio_ctrl_t *ctrlp; int seekmode; @@ -260,8 +253,7 @@ void -aioRead(int fd, int offset, char *bufp, int len, AIOCB * callback, - void *callback_data) +aioRead(int fd, int offset, char *bufp, int len, AIOCB * callback, void *callback_data) { aio_ctrl_t *ctrlp; int seekmode; @@ -373,8 +365,8 @@ if ((resultp = aio_poll_done()) == NULL) break; prev = NULL; - for (ctrlp = used_list; ctrlp != NULL; - prev = ctrlp, ctrlp = ctrlp->next) if (&ctrlp->result == resultp) + for (ctrlp = used_list; ctrlp != NULL; prev = ctrlp, ctrlp = ctrlp->next) + if (&ctrlp->result == resultp) break; if (ctrlp == NULL) continue; @@ -408,8 +400,7 @@ storeAppendPrintf(sentry, "read\t%d\n", aio_counts.read); storeAppendPrintf(sentry, "stat\t%d\n", aio_counts.stat); storeAppendPrintf(sentry, "unlink\t%d\n", aio_counts.unlink); - storeAppendPrintf(sentry, "check_callback\t%d\n", - aio_counts.check_callback); + storeAppendPrintf(sentry, "check_callback\t%d\n", aio_counts.check_callback); storeAppendPrintf(sentry, "queue\t%d\n", aio_get_queue_len()); }