]> git.pld-linux.org Git - packages/squid.git/blame - squid-2.5.STABLE4-positive_dns_ttl.patch
- added align patch, release 2.1 for tests
[packages/squid.git] / squid-2.5.STABLE4-positive_dns_ttl.patch
CommitLineData
495e7591
AM
1Index: squid/src/cf.data.pre
2diff -c squid/src/cf.data.pre:1.245.2.52 squid/src/cf.data.pre:1.245.2.53
3*** squid/src/cf.data.pre:1.245.2.52 Thu Nov 6 07:54:20 2003
4--- squid/src/cf.data.pre Fri Nov 28 12:14:31 2003
5***************
6*** 1733,1739 ****
7 LOC: Config.positiveDnsTtl
8 DEFAULT: 6 hours
9 DOC_START
10! Time-to-Live (TTL) for positive caching of successful DNS lookups.
11 Default is 6 hours (360 minutes). If you want to minimize the
12 use of Squid's ipcache, set this to 1, not 0.
13 DOC_END
14--- 1733,1739 ----
15 LOC: Config.positiveDnsTtl
16 DEFAULT: 6 hours
17 DOC_START
18! Upper limit on how long Squid will cache positive DNS responses.
19 Default is 6 hours (360 minutes). If you want to minimize the
20 use of Squid's ipcache, set this to 1, not 0.
21 DOC_END
22Index: squid/src/fqdncache.c
23diff -c squid/src/fqdncache.c:1.149.2.1 squid/src/fqdncache.c:1.149.2.2
24*** squid/src/fqdncache.c:1.149.2.1 Sat Oct 11 16:32:31 2003
25--- squid/src/fqdncache.c Fri Nov 28 12:14:32 2003
26***************
27*** 260,266 ****
28 }
29 f.flags.negcached = 0;
30 ttl = atoi(token);
31! if (ttl > 0)
32 f.expires = squid_curtime + ttl;
33 else
34 f.expires = squid_curtime + Config.positiveDnsTtl;
35--- 260,266 ----
36 }
37 f.flags.negcached = 0;
38 ttl = atoi(token);
39! if (ttl > 0 && ttl < Config.positiveDnsTtl)
40 f.expires = squid_curtime + ttl;
41 else
42 f.expires = squid_curtime + Config.positiveDnsTtl;
43***************
44*** 303,309 ****
45 f.flags.negcached = 0;
46 f.names[0] = xstrdup(answers[k].rdata);
47 f.name_count = 1;
48! f.expires = squid_curtime + answers[k].ttl;
49 return &f;
50 }
51 debug(35, 1) ("fqdncacheParse: No PTR record\n");
52--- 303,312 ----
53 f.flags.negcached = 0;
54 f.names[0] = xstrdup(answers[k].rdata);
55 f.name_count = 1;
56! if (answers[k].ttl < Config.positiveDnsTtl)
57! f.expires = squid_curtime + answers[k].ttl;
58! else
59! f.expires = squid_curtime + Config.positiveDnsTtl;
60 return &f;
61 }
62 debug(35, 1) ("fqdncacheParse: No PTR record\n");
63Index: squid/src/ipcache.c
64diff -c squid/src/ipcache.c:1.236 squid/src/ipcache.c:1.236.2.1
65*** squid/src/ipcache.c:1.236 Tue Nov 13 15:16:24 2001
66--- squid/src/ipcache.c Fri Nov 28 12:14:32 2003
67***************
68*** 275,281 ****
69 }
70 i.flags.negcached = 0;
71 ttl = atoi(token);
72! if (ttl > 0)
73 i.expires = squid_curtime + ttl;
74 else
75 i.expires = squid_curtime + Config.positiveDnsTtl;
76--- 275,281 ----
77 }
78 i.flags.negcached = 0;
79 ttl = atoi(token);
80! if (ttl > 0 && ttl < Config.positiveDnsTtl)
81 i.expires = squid_curtime + ttl;
82 else
83 i.expires = squid_curtime + Config.positiveDnsTtl;
84***************
85*** 344,351 ****
86 continue;
87 if (answers[k].class != RFC1035_CLASS_IN)
88 continue;
89! if (j == 0)
90! i.expires = squid_curtime + answers[k].ttl;
91 assert(answers[k].rdlength == 4);
92 xmemcpy(&i.addrs.in_addrs[j++], answers[k].rdata, 4);
93 debug(14, 3) ("ipcacheParse: #%d %s\n",
94--- 344,355 ----
95 continue;
96 if (answers[k].class != RFC1035_CLASS_IN)
97 continue;
98! if (j == 0) {
99! if (answers[k].ttl < Config.positiveDnsTtl)
100! i.expires = squid_curtime + answers[k].ttl;
101! else
102! i.expires = squid_curtime + Config.positiveDnsTtl;
103! }
104 assert(answers[k].rdlength == 4);
105 xmemcpy(&i.addrs.in_addrs[j++], answers[k].rdata, 4);
106 debug(14, 3) ("ipcacheParse: #%d %s\n",
This page took 0.130699 seconds and 4 git commands to generate.