Added
Link Here
|
1 |
--- djbdns-1.05.patch.orig 2007-08-26 15:08:50.000000000 +0200 |
2 |
+++ djbdns-1.05.patch 2007-12-17 21:34:49.000000000 +0100 |
3 |
@@ -1757,8 +1757,8 @@ |
4 |
{ |
5 |
|
6 |
=== modified file 'query.c' |
7 |
---- query.c 2004-07-08 11:45:45 +0000 |
8 |
-+++ query.c 2007-08-23 21:11:49 +0000 |
9 |
+--- query.c.orig 2007-12-17 21:14:09.000000000 +0100 |
10 |
++++ query.c 2007-12-17 21:33:24.000000000 +0100 |
11 |
@@ -12,6 +12,15 @@ |
12 |
#include "alloc.h" |
13 |
#include "response.h" |
14 |
@@ -1775,7 +1775,7 @@ |
15 |
|
16 |
static int flagforwardonly = 0; |
17 |
|
18 |
-@@ -20,10 +29,32 @@ |
19 |
+@@ -20,10 +29,31 @@ |
20 |
flagforwardonly = 1; |
21 |
} |
22 |
|
23 |
@@ -1790,12 +1790,11 @@ |
24 |
+#ifdef SQLCACHE |
25 |
+unsigned int db_reinsert_interval = 1*60*60; |
26 |
+unsigned int db_insert_minttl = 10*60; |
27 |
-+extern unsigned int save_ok; |
28 |
+#endif |
29 |
++static unsigned int save_ok; |
30 |
+ |
31 |
+char save_buf[8192]; |
32 |
+unsigned int save_len; |
33 |
-+static unsigned int save_ok; |
34 |
+ |
35 |
static void cachegeneric(const char type[2],const char *d,const char *data,unsigned int datalen,uint32 ttl) |
36 |
{ |
37 |
@@ -1808,7 +1807,7 @@ |
38 |
|
39 |
len = dns_domain_length(d); |
40 |
if (len > 255) return; |
41 |
-@@ -32,13 +63,26 @@ |
42 |
+@@ -32,13 +62,26 @@ |
43 |
byte_copy(key + 2,len,d); |
44 |
case_lowerb(key + 2,len); |
45 |
|
46 |
@@ -1839,7 +1838,7 @@ |
47 |
static void save_start(void) |
48 |
{ |
49 |
save_len = 0; |
50 |
-@@ -193,6 +237,7 @@ |
51 |
+@@ -193,6 +236,7 @@ |
52 |
int k; |
53 |
int p; |
54 |
int q; |
55 |
@@ -1847,7 +1846,7 @@ |
56 |
|
57 |
errno = error_io; |
58 |
if (state == 1) goto HAVEPACKET; |
59 |
-@@ -236,7 +281,9 @@ |
60 |
+@@ -236,7 +280,9 @@ |
61 |
response_rfinish(RESPONSE_ANSWER); |
62 |
} |
63 |
cleanup(z); |
64 |
@@ -1857,7 +1856,7 @@ |
65 |
return 1; |
66 |
} |
67 |
|
68 |
-@@ -246,7 +293,10 @@ |
69 |
+@@ -246,7 +292,10 @@ |
70 |
case_lowerb(key + 2,dlen); |
71 |
cached = cache_get(key,dlen + 2,&cachedlen,&ttl); |
72 |
if (cached) { |
73 |
@@ -1868,7 +1867,7 @@ |
74 |
goto NXDOMAIN; |
75 |
} |
76 |
|
77 |
-@@ -254,13 +304,17 @@ |
78 |
+@@ -254,13 +303,17 @@ |
79 |
cached = cache_get(key,dlen + 2,&cachedlen,&ttl); |
80 |
if (cached) { |
81 |
if (typematch(DNS_T_CNAME,dtype)) { |
82 |
@@ -1886,7 +1885,7 @@ |
83 |
if (!dns_domain_copy(&cname,cached)) goto DIE; |
84 |
goto CNAME; |
85 |
} |
86 |
-@@ -269,7 +323,9 @@ |
87 |
+@@ -269,7 +322,9 @@ |
88 |
byte_copy(key,2,DNS_T_NS); |
89 |
cached = cache_get(key,dlen + 2,&cachedlen,&ttl); |
90 |
if (cached && (cachedlen || byte_diff(dtype,2,DNS_T_ANY))) { |
91 |
@@ -1896,7 +1895,7 @@ |
92 |
if (!rqa(z)) goto DIE; |
93 |
pos = 0; |
94 |
while (pos = dns_packet_getname(cached,cachedlen,pos,&t2)) { |
95 |
-@@ -286,7 +342,9 @@ |
96 |
+@@ -286,7 +341,9 @@ |
97 |
byte_copy(key,2,DNS_T_PTR); |
98 |
cached = cache_get(key,dlen + 2,&cachedlen,&ttl); |
99 |
if (cached && (cachedlen || byte_diff(dtype,2,DNS_T_ANY))) { |
100 |
@@ -1906,7 +1905,7 @@ |
101 |
if (!rqa(z)) goto DIE; |
102 |
pos = 0; |
103 |
while (pos = dns_packet_getname(cached,cachedlen,pos,&t2)) { |
104 |
-@@ -303,7 +361,9 @@ |
105 |
+@@ -303,7 +360,9 @@ |
106 |
byte_copy(key,2,DNS_T_MX); |
107 |
cached = cache_get(key,dlen + 2,&cachedlen,&ttl); |
108 |
if (cached && (cachedlen || byte_diff(dtype,2,DNS_T_ANY))) { |
109 |
@@ -1916,7 +1915,7 @@ |
110 |
if (!rqa(z)) goto DIE; |
111 |
pos = 0; |
112 |
while (pos = dns_packet_copy(cached,cachedlen,pos,misc,2)) { |
113 |
-@@ -324,7 +384,9 @@ |
114 |
+@@ -324,7 +383,9 @@ |
115 |
cached = cache_get(key,dlen + 2,&cachedlen,&ttl); |
116 |
if (cached && (cachedlen || byte_diff(dtype,2,DNS_T_ANY))) { |
117 |
if (z->level) { |
118 |
@@ -1926,7 +1925,7 @@ |
119 |
while (cachedlen >= 4) { |
120 |
for (k = 0;k < 64;k += 4) |
121 |
if (byte_equal(z->servers[z->level - 1] + k,4,"\0\0\0\0")) { |
122 |
-@@ -337,7 +399,9 @@ |
123 |
+@@ -337,7 +398,9 @@ |
124 |
goto LOWERLEVEL; |
125 |
} |
126 |
|
127 |
@@ -1936,7 +1935,7 @@ |
128 |
if (!rqa(z)) goto DIE; |
129 |
while (cachedlen >= 4) { |
130 |
if (!response_rstart(d,DNS_T_A,ttl)) goto DIE; |
131 |
-@@ -355,7 +419,9 @@ |
132 |
+@@ -355,7 +418,9 @@ |
133 |
byte_copy(key,2,dtype); |
134 |
cached = cache_get(key,dlen + 2,&cachedlen,&ttl); |
135 |
if (cached && (cachedlen || byte_diff(dtype,2,DNS_T_ANY))) { |
136 |
@@ -1946,7 +1945,7 @@ |
137 |
if (!rqa(z)) goto DIE; |
138 |
while (cachedlen >= 2) { |
139 |
uint16_unpack_big(cached,&datalen); |
140 |
-@@ -396,7 +462,9 @@ |
141 |
+@@ -396,7 +461,9 @@ |
142 |
pos = 0; |
143 |
j = 0; |
144 |
while (pos = dns_packet_getname(cached,cachedlen,pos,&t1)) { |
145 |
@@ -1956,7 +1955,7 @@ |
146 |
if (j < QUERY_MAXNS) |
147 |
if (!dns_domain_copy(&z->ns[z->level][j++],t1)) goto DIE; |
148 |
} |
149 |
-@@ -430,12 +498,16 @@ |
150 |
+@@ -430,12 +497,16 @@ |
151 |
|
152 |
dns_sortip(z->servers[z->level],64); |
153 |
if (z->level) { |
154 |
@@ -1975,7 +1974,7 @@ |
155 |
} |
156 |
return 0; |
157 |
|
158 |
-@@ -590,15 +662,19 @@ |
159 |
+@@ -590,15 +661,19 @@ |
160 |
pos = dns_packet_getname(buf,len,pos + 10,&t2); if (!pos) goto DIE; |
161 |
pos = dns_packet_getname(buf,len,pos,&t3); if (!pos) goto DIE; |
162 |
pos = dns_packet_copy(buf,len,pos,misc,20); if (!pos) goto DIE; |
163 |
@@ -1995,7 +1994,7 @@ |
164 |
cachegeneric(DNS_T_CNAME,t1,t2,dns_domain_length(t2),ttl); |
165 |
} |
166 |
else if (byte_equal(type,2,DNS_T_PTR)) { |
167 |
-@@ -606,7 +682,9 @@ |
168 |
+@@ -606,7 +681,9 @@ |
169 |
while (i < j) { |
170 |
pos = dns_packet_skipname(buf,len,records[i]); if (!pos) goto DIE; |
171 |
pos = dns_packet_getname(buf,len,pos + 10,&t2); if (!pos) goto DIE; |
172 |
@@ -2005,7 +2004,7 @@ |
173 |
save_data(t2,dns_domain_length(t2)); |
174 |
++i; |
175 |
} |
176 |
-@@ -617,7 +695,9 @@ |
177 |
+@@ -617,7 +694,9 @@ |
178 |
while (i < j) { |
179 |
pos = dns_packet_skipname(buf,len,records[i]); if (!pos) goto DIE; |
180 |
pos = dns_packet_getname(buf,len,pos + 10,&t2); if (!pos) goto DIE; |
181 |
@@ -2015,7 +2014,7 @@ |
182 |
save_data(t2,dns_domain_length(t2)); |
183 |
++i; |
184 |
} |
185 |
-@@ -629,7 +709,9 @@ |
186 |
+@@ -629,7 +708,9 @@ |
187 |
pos = dns_packet_skipname(buf,len,records[i]); if (!pos) goto DIE; |
188 |
pos = dns_packet_copy(buf,len,pos + 10,misc,2); if (!pos) goto DIE; |
189 |
pos = dns_packet_getname(buf,len,pos,&t2); if (!pos) goto DIE; |
190 |
@@ -2025,7 +2024,7 @@ |
191 |
save_data(misc,2); |
192 |
save_data(t2,dns_domain_length(t2)); |
193 |
++i; |
194 |
-@@ -643,8 +725,13 @@ |
195 |
+@@ -643,8 +724,13 @@ |
196 |
pos = dns_packet_copy(buf,len,pos,header,10); if (!pos) goto DIE; |
197 |
if (byte_equal(header + 8,2,"\0\4")) { |
198 |
pos = dns_packet_copy(buf,len,pos,header,4); if (!pos) goto DIE; |
199 |
@@ -2039,7 +2038,7 @@ |
200 |
} |
201 |
++i; |
202 |
} |
203 |
-@@ -659,7 +746,9 @@ |
204 |
+@@ -659,7 +745,9 @@ |
205 |
if (datalen > len - pos) goto DIE; |
206 |
save_data(header + 8,2); |
207 |
save_data(buf + pos,datalen); |
208 |
@@ -2049,7 +2048,7 @@ |
209 |
++i; |
210 |
} |
211 |
save_finish(type,t1,ttl); |
212 |
-@@ -689,13 +778,21 @@ |
213 |
+@@ -689,13 +777,21 @@ |
214 |
} |
215 |
|
216 |
if (rcode == 3) { |
217 |
@@ -2072,7 +2071,7 @@ |
218 |
cleanup(z); |
219 |
return 1; |
220 |
} |
221 |
-@@ -706,10 +803,13 @@ |
222 |
+@@ -706,10 +802,13 @@ |
223 |
if (byte_diff(DNS_T_CNAME,2,dtype)) { |
224 |
save_start(); |
225 |
save_finish(dtype,d,soattl); |
226 |
@@ -2087,8 +2086,6 @@ |
227 |
|
228 |
|
229 |
if (flagout || flagsoa || !flagreferral) { |
230 |
- |
231 |
-=== modified file 'query.h' |
232 |
--- query.h 2004-07-08 11:45:45 +0000 |
233 |
+++ query.h 2007-08-23 20:36:07 +0000 |
234 |
@@ -28,5 +28,6 @@ |
235 |
@@ -2446,3 +2443,5 @@ |
236 |
if (cdb_make_finish(&cdb) == -1) die_datatmp(); |
237 |
if (fsync(fdcdb) == -1) die_datatmp(); |
238 |
|
239 |
+ |
240 |
+ |