--------------------- PatchSet 2129 Date: 2001/04/27 21:20:57 Author: serassio Branch: cygwin Tag: (none) Log: Opsss, Fixed my indent mistake ... Members: src/dns_internal.c:1.5.26.8->1.5.26.9 src/globals.h:1.5.12.6->1.5.12.7 Index: squid/src/dns_internal.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/dns_internal.c,v retrieving revision 1.5.26.8 retrieving revision 1.5.26.9 diff -u -r1.5.26.8 -r1.5.26.9 --- squid/src/dns_internal.c 27 Apr 2001 20:26:46 -0000 1.5.26.8 +++ squid/src/dns_internal.c 27 Apr 2001 21:20:57 -0000 1.5.26.9 @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.c,v 1.5.26.8 2001/04/27 20:26:46 serassio Exp $ + * $Id: dns_internal.c,v 1.5.26.9 2001/04/27 21:20:57 serassio Exp $ * * DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c * AUTHOR: Duane Wessels @@ -53,8 +53,7 @@ typedef struct _idns_query idns_query; typedef struct _ns ns; -struct _idns_query -{ +struct _idns_query { char buf[512]; size_t sz; unsigned short id; @@ -67,8 +66,7 @@ int attempt; }; -struct _ns -{ +struct _ns { struct sockaddr_in S; int nqueries; int nreplies; @@ -103,16 +101,12 @@ { struct in_addr A; if (!safe_inet_addr(buf, &A)) { - debug(78, 0) - ("WARNING: rejecting '%s' as a name server, because it is not a numeric IP address\n", - buf); + debug(78, 0) ("WARNING: rejecting '%s' as a name server, because it is not a numeric IP address\n", buf); return; } if (A.s_addr == 0) { - debug(78, 0) - ("WARNING: Squid does not accept 0.0.0.0 in DNS server specifications.\n"); - debug(78, 0) - ("Will be using 127.0.0.1 instead, assuming you meant that DNS is running on the same machine\n"); + debug(78, 0) ("WARNING: Squid does not accept 0.0.0.0 in DNS server specifications.\n"); + debug(78, 0) ("Will be using 127.0.0.1 instead, assuming you meant that DNS is running on the same machine\n"); safe_inet_addr("127.0.0.1", &A); } if (nns == nns_alloc) { @@ -157,9 +151,9 @@ static void idnsParseResolvConf(void) { - char *t; FILE *fp; char buf[512]; + char *t; fp = fopen(_PATH_RESOLV_CONF, "r"); if (fp == NULL) { @@ -353,7 +347,8 @@ for (i = 0; i < nns; i++) { storeAppendPrintf(sentry, "%-15s %9d %9d\n", inet_ntoa(nameservers[i].S.sin_addr), - nameservers[i].nqueries, nameservers[i].nreplies); + nameservers[i].nqueries, + nameservers[i].nreplies); } storeAppendPrintf(sentry, "\nRcode Matrix:\n"); storeAppendPrintf(sentry, "RCODE"); @@ -395,7 +390,10 @@ try_again: ns = q->nsends % nns; x = comm_udp_sendto(DnsSocket, - &nameservers[ns].S, sizeof(nameservers[ns].S), q->buf, q->sz); + &nameservers[ns].S, + sizeof(nameservers[ns].S), + q->buf, + q->sz); q->nsends++; q->sent_t = current_time; if (x < 0) { @@ -447,7 +445,10 @@ rfc1035_rr *answers = NULL; unsigned short rid = 0xFFFF; idns_query *q; - n = rfc1035AnswersUnpack(buf, sz, &answers, &rid); + n = rfc1035AnswersUnpack(buf, + sz, + &answers, + &rid); debug(78, 3) ("idnsGrokReply: ID %#hx, %d answers\n", rid, n); if (rid == 0xFFFF) { debug(78, 1) ("idnsGrokReply: Unknown error\n"); @@ -520,7 +521,9 @@ assert(N); (*N)++; debug(78, 3) ("idnsRead: FD %d: received %d bytes from %s.\n", - fd, len, inet_ntoa(from.sin_addr)); + fd, + len, + inet_ntoa(from.sin_addr)); ns = idnsFromKnownNameserver(&from); if (ns >= 0) { nameservers[ns].nreplies++; @@ -568,20 +571,19 @@ /* name servers went away; reconfiguring or shutting down */ break; q = n->data; - if (tvSubDsec(q->sent_t, - current_time) < - Config.Timeout.idns_retransmit * (1 << q->nsends % nns)) + if (tvSubDsec(q->sent_t, current_time) < Config.Timeout.idns_retransmit * (1 << q->nsends % nns)) break; - debug(78, 3) ("idnsCheckQueue: ID %#04x timeout\n", q->id); + debug(78, 3) ("idnsCheckQueue: ID %#04x timeout\n", + q->id); p = n->prev; dlinkDelete(&q->lru, &lru_list); if (tvSubDsec(q->start_t, current_time) < Config.Timeout.idns_query) { idnsSendQuery(q); } else { int v = cbdataValid(q->callback_data); - debug(78, 1) - ("idnsCheckQueue: ID %x: giving up after %d tries and %5.1f seconds\n", - (int) q->id, q->nsends, tvSubDsec(q->start_t, current_time)); + debug(78, 1) ("idnsCheckQueue: ID %x: giving up after %d tries and %5.1f seconds\n", + (int) q->id, q->nsends, + tvSubDsec(q->start_t, current_time)); cbdataUnlock(q->callback_data); if (v) q->callback(q->callback_data, NULL, 0); @@ -614,7 +616,11 @@ static int init = 0; if (DnsSocket < 0) { DnsSocket = comm_open(SOCK_DGRAM, - 0, Config.Addrs.udp_outgoing, 0, COMM_NONBLOCKING, "DNS Socket"); + 0, + Config.Addrs.udp_outgoing, + 0, + COMM_NONBLOCKING, + "DNS Socket"); if (DnsSocket < 0) fatal("Could not create a DNS socket"); debug(78, 1) ("DNS Socket created on FD %d\n", DnsSocket); @@ -639,7 +645,9 @@ " or use the 'dns_nameservers' option in squid.conf."); if (!init) { memDataInit(MEM_IDNS_QUERY, "idns_query", sizeof(idns_query), 0); - cachemgrRegister("idns", "Internal DNS Statistics", idnsStats, 0, 1); + cachemgrRegister("idns", + "Internal DNS Statistics", + idnsStats, 0, 1); memset(RcodeMatrix, '\0', sizeof(RcodeMatrix)); init++; } @@ -700,8 +708,7 @@ { int i, n = 0; variable_list *Answer = NULL; - debug(49, 5) ("snmp_netDnsFn: Processing request:\n", - Var->name[LEN_SQ_NET + 1]); + debug(49, 5) ("snmp_netDnsFn: Processing request:\n", Var->name[LEN_SQ_NET + 1]); snmpDebugOid(5, Var->name, Var->name_length); *ErrP = SNMP_ERR_NOERROR; switch (Var->name[LEN_SQ_NET + 1]) { @@ -709,17 +716,20 @@ for (i = 0; i < nns; i++) n += nameservers[i].nqueries; Answer = snmp_var_new_integer(Var->name, Var->name_length, - n, SMI_COUNTER32); + n, + SMI_COUNTER32); break; case DNS_REP: for (i = 0; i < nns; i++) n += nameservers[i].nreplies; Answer = snmp_var_new_integer(Var->name, Var->name_length, - n, SMI_COUNTER32); + n, + SMI_COUNTER32); break; case DNS_SERVERS: Answer = snmp_var_new_integer(Var->name, Var->name_length, - 0, SMI_COUNTER32); + 0, + SMI_COUNTER32); break; default: *ErrP = SNMP_ERR_NOSUCHNAME; Index: squid/src/globals.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/globals.h,v retrieving revision 1.5.12.6 retrieving revision 1.5.12.7 diff -u -r1.5.12.6 -r1.5.12.7 --- squid/src/globals.h 27 Apr 2001 20:26:46 -0000 1.5.12.6 +++ squid/src/globals.h 27 Apr 2001 21:20:57 -0000 1.5.12.7 @@ -1,6 +1,6 @@ /* - * $Id: globals.h,v 1.5.12.6 2001/04/27 20:26:46 serassio Exp $ + * $Id: globals.h,v 1.5.12.7 2001/04/27 21:20:57 serassio Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -131,7 +131,7 @@ extern int _db_level; extern const int CacheDigestHashFuncCount; /* 4 */ extern CacheDigest *store_digest; /* NULL */ -extern const char *StoreDigestFileName; /* "store_digest" */ +extern const char *StoreDigestFileName; /* "store_digest" */ extern const char *StoreDigestMimeStr; /* "application/cache-digest" */ #if USE_CACHE_DIGESTS extern const Version CacheDigestVer; /* { 5, 3 } */