Compare commits
628 Commits
curl-7_19_
...
curl-7_20_
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f2f07dad34 | ||
![]() |
06ae8ca5a6 | ||
![]() |
d33da42334 | ||
![]() |
e118cd4ca0 | ||
![]() |
71593dfe57 | ||
![]() |
0f4a91afde | ||
![]() |
2c2464a682 | ||
![]() |
880452d2ed | ||
![]() |
e3009f2950 | ||
![]() |
cad9c3f55f | ||
![]() |
12d01bc5f7 | ||
![]() |
bc7615ae2d | ||
![]() |
7aef172a34 | ||
![]() |
f47b84b57f | ||
![]() |
1a5749424b | ||
![]() |
a9a5a8e45c | ||
![]() |
8044366134 | ||
![]() |
15efa262bb | ||
![]() |
429e544556 | ||
![]() |
680434f313 | ||
![]() |
c9f46446d5 | ||
![]() |
b77d0db59e | ||
![]() |
3205ac35b0 | ||
![]() |
381a4d6efe | ||
![]() |
f6d288a397 | ||
![]() |
013ec6a92f | ||
![]() |
e2fc294470 | ||
![]() |
d1717e7c90 | ||
![]() |
e569ff959f | ||
![]() |
839b61c32a | ||
![]() |
d28b8d3158 | ||
![]() |
2dfbd0d050 | ||
![]() |
54879d7763 | ||
![]() |
49ba75af26 | ||
![]() |
232d17ec64 | ||
![]() |
bafba6946c | ||
![]() |
da23b16ad8 | ||
![]() |
46de140aca | ||
![]() |
17a2c32ca9 | ||
![]() |
9f6c4daa27 | ||
![]() |
ea72194650 | ||
![]() |
35e220606d | ||
![]() |
55f1e787f3 | ||
![]() |
516cf5c8dd | ||
![]() |
35fbeda003 | ||
![]() |
715e3a806f | ||
![]() |
6ebd71d186 | ||
![]() |
4ee4e66c4f | ||
![]() |
4d19ebe738 | ||
![]() |
5312fdcd73 | ||
![]() |
fce02e1cab | ||
![]() |
15ddc1f134 | ||
![]() |
d65cf7889b | ||
![]() |
ddab9bd2ec | ||
![]() |
eff18763a1 | ||
![]() |
3e21f1e971 | ||
![]() |
ccffed997e | ||
![]() |
6259bcd51f | ||
![]() |
a4031dbd85 | ||
![]() |
2f3bce1193 | ||
![]() |
3cb76e5ebb | ||
![]() |
6418c0588d | ||
![]() |
124b35aafe | ||
![]() |
bbefdf88fd | ||
![]() |
06c96d01d2 | ||
![]() |
83e91586ef | ||
![]() |
c82a1f95eb | ||
![]() |
d34982bb65 | ||
![]() |
22ed0f5059 | ||
![]() |
9bc897f380 | ||
![]() |
9b0e57b0f7 | ||
![]() |
1d86ebfc88 | ||
![]() |
a9b860765d | ||
![]() |
483ff1ca75 | ||
![]() |
c054b8bfa7 | ||
![]() |
340ab2f87f | ||
![]() |
f8b16e5ccb | ||
![]() |
4bb80cfd75 | ||
![]() |
de2cc11a73 | ||
![]() |
c656098ee0 | ||
![]() |
94f33457d3 | ||
![]() |
80675818e0 | ||
![]() |
b0e2d47a3e | ||
![]() |
0abd928d3d | ||
![]() |
597ad5a2ce | ||
![]() |
703fa98a48 | ||
![]() |
ec4647c0f9 | ||
![]() |
33ce0ec1f1 | ||
![]() |
1435864030 | ||
![]() |
4a8a731476 | ||
![]() |
6636fbf238 | ||
![]() |
c94d44505f | ||
![]() |
0032ce762e | ||
![]() |
bdb338b3c7 | ||
![]() |
099eed7bf1 | ||
![]() |
bc253a4d5f | ||
![]() |
a771fb0d41 | ||
![]() |
c047fe8e90 | ||
![]() |
e45eefcb90 | ||
![]() |
844c19cc5b | ||
![]() |
4a8570313a | ||
![]() |
e59a5cbe4e | ||
![]() |
bfc4c33985 | ||
![]() |
5af20c70e4 | ||
![]() |
bd7430c1ee | ||
![]() |
6e5acc2fc1 | ||
![]() |
abe3e6b36c | ||
![]() |
105e430641 | ||
![]() |
4a349f7a54 | ||
![]() |
2f9a17fc44 | ||
![]() |
bc4582b68a | ||
![]() |
e09718d457 | ||
![]() |
2c0418f154 | ||
![]() |
a74e885bef | ||
![]() |
6291a1cf23 | ||
![]() |
a872ff742c | ||
![]() |
58a1557088 | ||
![]() |
422a7869be | ||
![]() |
471e8eefb6 | ||
![]() |
d2e1ec58f2 | ||
![]() |
48032c0880 | ||
![]() |
877dad1e24 | ||
![]() |
01030e9240 | ||
![]() |
a5ca3f1754 | ||
![]() |
77a17a21d1 | ||
![]() |
6035a4b044 | ||
![]() |
469d3ed591 | ||
![]() |
3afe2b65b6 | ||
![]() |
afdc3d81e9 | ||
![]() |
ccfe279117 | ||
![]() |
5b5ff41ef1 | ||
![]() |
0a713139f6 | ||
![]() |
0687bc6bd6 | ||
![]() |
424a8882fb | ||
![]() |
3fdced357b | ||
![]() |
ce2ac665e4 | ||
![]() |
0375f70b5c | ||
![]() |
7f8980114b | ||
![]() |
312494f25f | ||
![]() |
8d97b33347 | ||
![]() |
b51b703a5b | ||
![]() |
071c38988d | ||
![]() |
365e75a270 | ||
![]() |
b992928f3d | ||
![]() |
32413a8e34 | ||
![]() |
ada2774ab2 | ||
![]() |
a644af129e | ||
![]() |
7624527591 | ||
![]() |
383bf1e476 | ||
![]() |
8c8df3966b | ||
![]() |
4344215309 | ||
![]() |
0643829444 | ||
![]() |
7525670610 | ||
![]() |
b32a96eda0 | ||
![]() |
82f5ffff8f | ||
![]() |
3fd67b5f36 | ||
![]() |
1647d64a4b | ||
![]() |
d17416190b | ||
![]() |
2158e234aa | ||
![]() |
cb348a5b1f | ||
![]() |
377b2db05b | ||
![]() |
78b7d7f7a8 | ||
![]() |
5bec1b1cf0 | ||
![]() |
cd7b12edff | ||
![]() |
1103d0c718 | ||
![]() |
aae97c998a | ||
![]() |
017c14cc99 | ||
![]() |
b90703f594 | ||
![]() |
552c3de357 | ||
![]() |
aa2f447400 | ||
![]() |
184f92d243 | ||
![]() |
a1d701d05a | ||
![]() |
a114b7b1c0 | ||
![]() |
8524c04ca9 | ||
![]() |
31630203b1 | ||
![]() |
d37a9c4f87 | ||
![]() |
88944eb13a | ||
![]() |
bd8096b42b | ||
![]() |
1e87e4bb4e | ||
![]() |
9bd03483ce | ||
![]() |
2e83006603 | ||
![]() |
fd903eb6be | ||
![]() |
2c93ec5303 | ||
![]() |
d79b5a0613 | ||
![]() |
a62f32d3c2 | ||
![]() |
241c0ad5bd | ||
![]() |
605bbfc4c0 | ||
![]() |
42d365f199 | ||
![]() |
31266ca92a | ||
![]() |
3f3f6be825 | ||
![]() |
01682cca55 | ||
![]() |
99a5a5a3e9 | ||
![]() |
eb0479575a | ||
![]() |
97141d08f7 | ||
![]() |
99e9938617 | ||
![]() |
6c6dc3f879 | ||
![]() |
a1311e5a24 | ||
![]() |
5e6ffe353a | ||
![]() |
d7cd761047 | ||
![]() |
05488d63d0 | ||
![]() |
3184a91ec8 | ||
![]() |
0dde9056d7 | ||
![]() |
a487c80535 | ||
![]() |
1e9a946e6d | ||
![]() |
7cd5ffc1bf | ||
![]() |
fa6631edd5 | ||
![]() |
e70c0913b1 | ||
![]() |
5b2a31ae41 | ||
![]() |
c796f2646e | ||
![]() |
d0f6bde732 | ||
![]() |
1bd5784a13 | ||
![]() |
1f7d9f4f7b | ||
![]() |
b6ac8d62a1 | ||
![]() |
4ec17a08bc | ||
![]() |
aefe0299e0 | ||
![]() |
b89789d82f | ||
![]() |
a218235964 | ||
![]() |
73ad32e125 | ||
![]() |
77625f8560 | ||
![]() |
1af64730e0 | ||
![]() |
eacf62792f | ||
![]() |
6ce407305b | ||
![]() |
ae3892e8ab | ||
![]() |
c74875d94e | ||
![]() |
271dc9c582 | ||
![]() |
7bede9180d | ||
![]() |
f0917cabb5 | ||
![]() |
96395a908a | ||
![]() |
e9a993b9e9 | ||
![]() |
982fe33924 | ||
![]() |
fa188eec7b | ||
![]() |
bdd3763980 | ||
![]() |
1cfa52b67d | ||
![]() |
57d3488a0d | ||
![]() |
83d34a246e | ||
![]() |
76b3c9d70f | ||
![]() |
d911e22d8f | ||
![]() |
efd1d9dc04 | ||
![]() |
88a0060b2e | ||
![]() |
4adf7d62d4 | ||
![]() |
6add5baa3a | ||
![]() |
2a3dafc0cd | ||
![]() |
f912f8d5d2 | ||
![]() |
af7a5b297f | ||
![]() |
344bbcf259 | ||
![]() |
240fa29e94 | ||
![]() |
010fe5acd5 | ||
![]() |
aeec8e0b38 | ||
![]() |
2d15ac3d4e | ||
![]() |
53deae3781 | ||
![]() |
39cc424e81 | ||
![]() |
4d0b0cae9e | ||
![]() |
8343cb8910 | ||
![]() |
a75d9d9169 | ||
![]() |
54c60d0067 | ||
![]() |
91d05903b4 | ||
![]() |
10a11e3abe | ||
![]() |
414180b363 | ||
![]() |
7603a29fc3 | ||
![]() |
002ed5f298 | ||
![]() |
044ba6dad2 | ||
![]() |
3802d027cd | ||
![]() |
3111701c38 | ||
![]() |
2c9644b812 | ||
![]() |
99daca5a48 | ||
![]() |
a6abbb120e | ||
![]() |
b0f548fb56 | ||
![]() |
364d76aca7 | ||
![]() |
6e9a484ea6 | ||
![]() |
303f74c740 | ||
![]() |
4ea8ad584b | ||
![]() |
19b8a80ee9 | ||
![]() |
30eb452adf | ||
![]() |
92b9b46831 | ||
![]() |
83a6b34803 | ||
![]() |
43fefab2a1 | ||
![]() |
ec3bb8f727 | ||
![]() |
463d2d395c | ||
![]() |
2fc1752d6e | ||
![]() |
296ebf382c | ||
![]() |
b91ed67276 | ||
![]() |
315253b367 | ||
![]() |
3b1de97eaa | ||
![]() |
5ce6454d33 | ||
![]() |
0653fa107f | ||
![]() |
ebe5339003 | ||
![]() |
95362af43c | ||
![]() |
d14bf09ab8 | ||
![]() |
636d2fe00a | ||
![]() |
fb2425b147 | ||
![]() |
2286f566d0 | ||
![]() |
ed2aa87e63 | ||
![]() |
f0826974f2 | ||
![]() |
d61690ef46 | ||
![]() |
a72ce23f16 | ||
![]() |
bfae1bd999 | ||
![]() |
8a7231d7ae | ||
![]() |
4d922545d5 | ||
![]() |
1fc32d866a | ||
![]() |
230dc699e2 | ||
![]() |
3f6854272f | ||
![]() |
448f6684bb | ||
![]() |
af06a0e497 | ||
![]() |
6e38cc9048 | ||
![]() |
a240f4d1df | ||
![]() |
6f273b1a5f | ||
![]() |
f07f17f2a4 | ||
![]() |
c713627412 | ||
![]() |
b1a35cd3ac | ||
![]() |
9cbf69ca0b | ||
![]() |
c7d2e4c1e1 | ||
![]() |
cbd527843b | ||
![]() |
fba233bb34 | ||
![]() |
8b49428298 | ||
![]() |
19f79e5a79 | ||
![]() |
e20f3ecd7e | ||
![]() |
c83f7ede26 | ||
![]() |
f385fdefbe | ||
![]() |
88fe6557e9 | ||
![]() |
405e18571e | ||
![]() |
094afbeb56 | ||
![]() |
1fddcb3f88 | ||
![]() |
b723500af0 | ||
![]() |
4bfa0b08de | ||
![]() |
e536cb085f | ||
![]() |
083e2df4ed | ||
![]() |
b7997d8a3b | ||
![]() |
c80b593e5b | ||
![]() |
e37f8164a9 | ||
![]() |
35d4c57051 | ||
![]() |
f6114f2ec4 | ||
![]() |
f9e55c9908 | ||
![]() |
3005e63b02 | ||
![]() |
65e628cc97 | ||
![]() |
738e547815 | ||
![]() |
5ec8a3ae06 | ||
![]() |
fdfbc5d8da | ||
![]() |
504e6d7ae6 | ||
![]() |
c3266a5eb1 | ||
![]() |
ced1e1e726 | ||
![]() |
a41493b3b0 | ||
![]() |
6da73d09f1 | ||
![]() |
4c0ffd33f5 | ||
![]() |
99363a0ee1 | ||
![]() |
71260534f9 | ||
![]() |
5e62be1d8c | ||
![]() |
7e6a67b436 | ||
![]() |
5a0a473c30 | ||
![]() |
5129442ee7 | ||
![]() |
e8fd5d8062 | ||
![]() |
2f6dcaa644 | ||
![]() |
59939313f8 | ||
![]() |
961c504ca5 | ||
![]() |
b32d1a9a1d | ||
![]() |
4c8adc8fee | ||
![]() |
69ac7b0cf8 | ||
![]() |
09526fc9e9 | ||
![]() |
f0068267ee | ||
![]() |
7db7c0af4f | ||
![]() |
6bf10a111f | ||
![]() |
530fde3a22 | ||
![]() |
5b3be2ee35 | ||
![]() |
3b8d7fddf7 | ||
![]() |
0e80f0e4c4 | ||
![]() |
a2ddb0a61b | ||
![]() |
581ce03345 | ||
![]() |
f7f76e17c3 | ||
![]() |
1cbc93fb54 | ||
![]() |
a8ddd6ce31 | ||
![]() |
eb16c0e1eb | ||
![]() |
9c49e51f7e | ||
![]() |
90bc6ee8f3 | ||
![]() |
5e75817d44 | ||
![]() |
a7e4022d6b | ||
![]() |
4999847625 | ||
![]() |
d26a92493a | ||
![]() |
05a4abea04 | ||
![]() |
c1f9440aca | ||
![]() |
011a2818db | ||
![]() |
571309dc3e | ||
![]() |
d547d00f2c | ||
![]() |
668dc0ad87 | ||
![]() |
0b7e0eed49 | ||
![]() |
9b7e45e874 | ||
![]() |
40c2c3270d | ||
![]() |
b3e8cf539d | ||
![]() |
fb5f332834 | ||
![]() |
107c4d878a | ||
![]() |
5d786d0e97 | ||
![]() |
5f77eea408 | ||
![]() |
a0905ec0ab | ||
![]() |
d7470a3629 | ||
![]() |
2287e7ba8b | ||
![]() |
16a1e251cd | ||
![]() |
1aa320dedb | ||
![]() |
d17ce4e9f1 | ||
![]() |
50c3417686 | ||
![]() |
46f294dbb0 | ||
![]() |
d7231f54d7 | ||
![]() |
809f2a190c | ||
![]() |
4f62cdf6f9 | ||
![]() |
b8012ea251 | ||
![]() |
02673a8900 | ||
![]() |
676e0c28e7 | ||
![]() |
55e68ba333 | ||
![]() |
3f56d12830 | ||
![]() |
257f2376d5 | ||
![]() |
1d8d389bce | ||
![]() |
99e43046a7 | ||
![]() |
a5460f2431 | ||
![]() |
6bf9d56485 | ||
![]() |
367114bc87 | ||
![]() |
81d45ed3a2 | ||
![]() |
7d74e02519 | ||
![]() |
7611d30a05 | ||
![]() |
3704375292 | ||
![]() |
ea1f30e686 | ||
![]() |
9732b7cebe | ||
![]() |
f39380b1ac | ||
![]() |
c8da2980ed | ||
![]() |
b19dc0eeb0 | ||
![]() |
41de897b6b | ||
![]() |
108b414bb8 | ||
![]() |
be7af8beaa | ||
![]() |
db1281fa9b | ||
![]() |
223d848104 | ||
![]() |
d8884168e3 | ||
![]() |
5dd64e9e4b | ||
![]() |
ce6731baf1 | ||
![]() |
2c0b65d37b | ||
![]() |
a76f4ab7dd | ||
![]() |
d68f215f03 | ||
![]() |
0a5ac52b49 | ||
![]() |
8acb3803e4 | ||
![]() |
ac62a94de3 | ||
![]() |
0abcb37e3f | ||
![]() |
7da5efd55c | ||
![]() |
d4ff44d5f6 | ||
![]() |
fff706d702 | ||
![]() |
eac4310b2e | ||
![]() |
e87ee29e32 | ||
![]() |
61ebbc01ed | ||
![]() |
15f425bdb8 | ||
![]() |
861092637b | ||
![]() |
3717b7a792 | ||
![]() |
950a034895 | ||
![]() |
982e655c07 | ||
![]() |
308497ffc6 | ||
![]() |
b205525d34 | ||
![]() |
654b6b6c63 | ||
![]() |
3b908ed143 | ||
![]() |
265ed24ac0 | ||
![]() |
57eeee2ec3 | ||
![]() |
6a79b0e859 | ||
![]() |
0d9f14f5c1 | ||
![]() |
9fced16efb | ||
![]() |
f16868d301 | ||
![]() |
21af9bf1cd | ||
![]() |
b2f4308980 | ||
![]() |
6a37135f4d | ||
![]() |
b8e1e63379 | ||
![]() |
448d2b5f49 | ||
![]() |
7867d44251 | ||
![]() |
2380ca1714 | ||
![]() |
a1cc78d5a1 | ||
![]() |
7531ac89d6 | ||
![]() |
72acffc66c | ||
![]() |
525549f204 | ||
![]() |
3f8d3e9c50 | ||
![]() |
1951cd1eee | ||
![]() |
55aee95f11 | ||
![]() |
777134a07b | ||
![]() |
4b8ce9423f | ||
![]() |
051ab439a9 | ||
![]() |
12e60c6d4e | ||
![]() |
ff3223259f | ||
![]() |
3da1ade4e5 | ||
![]() |
ff40c83aa7 | ||
![]() |
f49427d364 | ||
![]() |
04e8ff84fe | ||
![]() |
6f4a5a4612 | ||
![]() |
6d4e6cc813 | ||
![]() |
86cec97b22 | ||
![]() |
e5ee822745 | ||
![]() |
167a92810a | ||
![]() |
b8b8c3d538 | ||
![]() |
21105ab344 | ||
![]() |
e49d928ce4 | ||
![]() |
5e253785af | ||
![]() |
3cbc8d1ba3 | ||
![]() |
b4af26a188 | ||
![]() |
6daede08cb | ||
![]() |
3669ff3c1e | ||
![]() |
9afdb05fe8 | ||
![]() |
4d9279cb3b | ||
![]() |
640e49976f | ||
![]() |
f1aa936d2c | ||
![]() |
a5ba25a5f6 | ||
![]() |
b4e6418aef | ||
![]() |
0077a6d51b | ||
![]() |
4798f4e652 | ||
![]() |
b38e28b6bc | ||
![]() |
052dac0d3f | ||
![]() |
2eeafcf9a6 | ||
![]() |
45e093fc45 | ||
![]() |
e593715d72 | ||
![]() |
1209f2c014 | ||
![]() |
7c821a85f8 | ||
![]() |
cf367a62ce | ||
![]() |
b233957885 | ||
![]() |
492aed1450 | ||
![]() |
cd91a1eeca | ||
![]() |
5ed274d0b7 | ||
![]() |
4271f44a9e | ||
![]() |
78d07cb0f9 | ||
![]() |
5b11e3883c | ||
![]() |
7d22ce5573 | ||
![]() |
b64dd3c63d | ||
![]() |
0ea6abe7df | ||
![]() |
8646cecb78 | ||
![]() |
867a0de670 | ||
![]() |
4f47fc4e14 | ||
![]() |
8d39a31e89 | ||
![]() |
66fcebdc9e | ||
![]() |
af9ce990f0 | ||
![]() |
e3d623f190 | ||
![]() |
15be441ad8 | ||
![]() |
c7c84e7420 | ||
![]() |
37489a855f | ||
![]() |
f03130a36e | ||
![]() |
a1d18227e5 | ||
![]() |
1549605c55 | ||
![]() |
14a3f4cd54 | ||
![]() |
9448659fc6 | ||
![]() |
4002714825 | ||
![]() |
61ea058d9f | ||
![]() |
0fdb77d643 | ||
![]() |
0c90cb7b83 | ||
![]() |
ede2ac0ea2 | ||
![]() |
d006efebc0 | ||
![]() |
f2f45339dc | ||
![]() |
be5c815f63 | ||
![]() |
31e106ced2 | ||
![]() |
250ba99498 | ||
![]() |
c2c3a46e3e | ||
![]() |
3eee678ab1 | ||
![]() |
62ed553054 | ||
![]() |
e3049e98d8 | ||
![]() |
86f9168797 | ||
![]() |
f7690db37d | ||
![]() |
7e0b0763fc | ||
![]() |
c67c4e7095 | ||
![]() |
64a05e540e | ||
![]() |
beb0a345ac | ||
![]() |
f60cb60fc6 | ||
![]() |
4002fbe1f5 | ||
![]() |
7ff4b4f2b5 | ||
![]() |
945feafe25 | ||
![]() |
5389ac0ddf | ||
![]() |
5d4a1e245b | ||
![]() |
3c199daa95 | ||
![]() |
4dd33ac575 | ||
![]() |
bb3bbfe56d | ||
![]() |
f09de577f5 | ||
![]() |
c2ce4e55f0 | ||
![]() |
5e3796349a | ||
![]() |
56a161e09a | ||
![]() |
2786ecaeef | ||
![]() |
1486a11839 | ||
![]() |
c4c15288d2 | ||
![]() |
aaed838872 | ||
![]() |
43fba2627a | ||
![]() |
7df26a5415 | ||
![]() |
f3611c2773 | ||
![]() |
d5de849552 | ||
![]() |
6569a23890 | ||
![]() |
2cf0f80e9f | ||
![]() |
223c0b980b | ||
![]() |
7ab1139f07 | ||
![]() |
d055226949 | ||
![]() |
cf910f3097 | ||
![]() |
183c9ce1cf | ||
![]() |
777168cb77 | ||
![]() |
0dd6c329e3 | ||
![]() |
7a642c8bf1 | ||
![]() |
e47c939822 | ||
![]() |
a0bbe25eef | ||
![]() |
b96f11f7ec | ||
![]() |
7e07da977c | ||
![]() |
ddb1fb7535 | ||
![]() |
ea2754e028 | ||
![]() |
ceda7e98f8 | ||
![]() |
2d0aca3b92 | ||
![]() |
4e9d3c26ed | ||
![]() |
f3bd0c3fc3 | ||
![]() |
eb438719f7 | ||
![]() |
44e2832b2a | ||
![]() |
9539d32298 | ||
![]() |
60c0994677 | ||
![]() |
e7f81d59b0 | ||
![]() |
f1320d6733 | ||
![]() |
68f7d5b8d3 | ||
![]() |
e8baa332d7 | ||
![]() |
39704bec3c | ||
![]() |
fad14bca01 | ||
![]() |
9e8eec4816 | ||
![]() |
fa2ea23c96 | ||
![]() |
1a255e0e28 | ||
![]() |
1d92cf1dab | ||
![]() |
8d1e46bdcc | ||
![]() |
b0b2824b58 | ||
![]() |
0cb6f3053f | ||
![]() |
95c2b205a4 | ||
![]() |
6ede4ce79d | ||
![]() |
10f2fa9c72 | ||
![]() |
8b5102ca83 | ||
![]() |
1048043963 | ||
![]() |
2c4fcf2ea8 | ||
![]() |
681162510a | ||
![]() |
5c59ee9488 | ||
![]() |
9075195ec4 | ||
![]() |
62960f8a42 | ||
![]() |
6293fe98a0 | ||
![]() |
5c716247aa | ||
![]() |
daf688eba6 | ||
![]() |
c6712a0c6c | ||
![]() |
4d74b52656 | ||
![]() |
be2fcbcbf1 |
32
Android.mk
32
Android.mk
@@ -1,15 +1,37 @@
|
||||
# Google Android makefile for curl and libcurl
|
||||
#
|
||||
# Place the curl source (including this makefile) into external/curl/ in the
|
||||
# Android source tree. Then build them with 'make curl' or just 'make libcurl'
|
||||
# from the Android root.
|
||||
# from the Android root. Tested with Android 1.5
|
||||
#
|
||||
# Note: you must first create a curl_config.h file by running configure in the
|
||||
# Android environment. I haven't found an easy way to do this yet. If there is
|
||||
# no easy way, a static config-android.h may need to be created and checked in
|
||||
# to the libcurl source tree.
|
||||
# Android environment. The only way I've found to do this is tricky. Perform a
|
||||
# normal Android build with libcurl in the source tree, providing the target
|
||||
# "showcommands" to make. The build will eventually fail (because curl_config.h
|
||||
# doesn't exist yet), but the compiler commands used to build curl will be
|
||||
# shown. Now, from the external/curl/ directory, run curl's normal configure
|
||||
# command with flags that match what Android itself uses. This will mean
|
||||
# putting the compiler directory into the PATH, putting the -I, -isystem and
|
||||
# -D options into CPPFLAGS, putting the -m, -f, -O and -nostdlib options into
|
||||
# CFLAGS, and putting the -Wl, -L and -l options into LIBS, along with the path
|
||||
# to the files libgcc.a, crtbegin_dynamic.o, and ccrtend_android.o. Remember
|
||||
# that the paths must be absolute since you will not be running configure from
|
||||
# the same directory as the Android make. The normal cross-compiler options
|
||||
# must also be set.
|
||||
#
|
||||
# The end result will be a configure command that looks something like this
|
||||
# (the environment variable A is set to the Android root path):
|
||||
#
|
||||
# A=`realpath ../..` && \
|
||||
# PATH="$A/prebuilt/linux-x86/toolchain/arm-eabi-X/bin:$PATH" \
|
||||
# ./configure --host=arm-linux CC=arm-eabi-gcc \
|
||||
# CPPFLAGS="-I $A/system/core/include ..." \
|
||||
# CFLAGS="-fno-exceptions -Wno-multichar ..." \
|
||||
# LIB="$A/prebuilt/linux-x86/toolchain/arm-eabi-X/lib/gcc/arm-eabi/X\
|
||||
# /interwork/libgcc.a ..." \
|
||||
#
|
||||
# Dan Fandrich
|
||||
# July 2009
|
||||
# September 2009
|
||||
|
||||
LOCAL_PATH:= $(call my-dir)
|
||||
|
||||
|
645
CHANGES
645
CHANGES
@@ -6,6 +6,651 @@
|
||||
|
||||
Changelog
|
||||
|
||||
Version 7.20.0 (9 February 2010)
|
||||
|
||||
Daniel Stenberg (9 Feb 2010)
|
||||
- When downloading compressed content over HTTP and the app asked libcurl to
|
||||
automatically uncompress it with the CURLOPT_ENCODING option, libcurl could
|
||||
wrongly provide the callback with more data than the maximum documented
|
||||
amount. An application could thus get tricked into badness if the maximum
|
||||
limit was trusted to be enforced by libcurl itself (as it is documented).
|
||||
|
||||
This is further detailed and explained in the libcurl security advisory
|
||||
20100209 at
|
||||
|
||||
http://curl.haxx.se/docs/adv_20100209.html
|
||||
|
||||
Daniel Fandrich (3 Feb 2010)
|
||||
- Changed the Watcom makefiles to make them easier to keep in sync with
|
||||
Makefile.inc since that can't be included directly.
|
||||
|
||||
Yang Tse (2 Feb 2010)
|
||||
- Symbol CURL_FORMAT_OFF_T now obsoleted, will be removed in a future release,
|
||||
symbol will not be available when building with CURL_NO_OLDIES defined. Use
|
||||
of CURL_FORMAT_CURL_OFF_T is preferred since 7.19.0
|
||||
|
||||
Daniel Stenberg (1 Feb 2010)
|
||||
- Using the multi_socket API, it turns out at times it seemed to "forget"
|
||||
connections (which caused a hang). It turned out to be an existing (7.19.7)
|
||||
bug in libcurl (that's been around for a long time) and it happened like
|
||||
this:
|
||||
|
||||
The app calls curl_multi_add_handle() to add a new easy handle, libcurl will
|
||||
then set it to timeout in 1 millisecond so libcurl will tell the app about
|
||||
it.
|
||||
|
||||
The app's timeout fires off that there's a timeout, the app calls libcurl as
|
||||
we so often document it:
|
||||
|
||||
do {
|
||||
res = curl_multi_socket_action(... TIMEOUT ...);
|
||||
} while(CURLM_CALL_MULTI_PERFORM == res);
|
||||
|
||||
And this is the problem number one:
|
||||
|
||||
When curl_multi_socket_action() is called with no specific handle, but only
|
||||
a timeout-action, it will *only* perform actions within libcurl that are
|
||||
marked to run at this time. In this case, the request would go from INIT to
|
||||
CONNECT and return CURLM_CALL_MULTI_PERFORM. When the app then calls libcurl
|
||||
again, there's no timer set for this handle so it remains in the CONNECT
|
||||
state. The CONNECT state is a transitional state in libcurl so it reports no
|
||||
sockets there, and thus libcurl never tells the app anything more about that
|
||||
easy handle/connection.
|
||||
|
||||
libcurl _does_ set a 1ms timeout for the handle at the end of
|
||||
multi_runsingle() if it returns CURLM_CALL_MULTI_PERFORM, but since the loop
|
||||
is instant the new job is not ready to run at that point (and there's no
|
||||
code that makes libcurl call the app to update the timout for this new
|
||||
timeout). It will simply rely on that some other timeout will trigger later
|
||||
on or that something else will update the timeout callback. This makes the
|
||||
bug fairly hard to repeat.
|
||||
|
||||
The fix made to adress this issue:
|
||||
|
||||
We introduce a loop in lib/multi.c around all calls to multi_runsingle() and
|
||||
simply check for CURLM_CALL_MULTI_PERFORM internally. This has the added
|
||||
benefit that this goes in line with my long-term wishes to get rid of the
|
||||
CURLM_CALL_MULTI_PERFORM all together from the public API.
|
||||
|
||||
The downside of this fix, is that the counter we return in 'running_handles'
|
||||
in several of our public functions then gets a slightly new and possibly
|
||||
confusing behavior during times:
|
||||
|
||||
If an app adds a handle that fails to connect (very quickly) it may just
|
||||
as well never appear as a 'running_handle' with this fix. Previously it
|
||||
would first bump the counter only to get it decreased again at next call.
|
||||
Even I have used that change in handle counter to signal "end of a
|
||||
transfer". The only *good* way to find the end of a individual transfer
|
||||
is calling curl_multi_info_read() to see if it returns one.
|
||||
|
||||
Of course, if the app previously did the looping before it checked the
|
||||
counter, it really shouldn't be any new effect.
|
||||
|
||||
Yang Tse (26 Jan 2010)
|
||||
- Constantine Sapuntzakis' and Joshua Kwan's work done in the last four months
|
||||
relative to the asynchronous DNS lookups, along with with some integration
|
||||
adjustments I have done are finally committed to CVS.
|
||||
|
||||
Currently these enhancements will benefit builds done using c-ares on any
|
||||
platform as well as Windows builds using the default threaded resolver.
|
||||
|
||||
This release does not make generally available POSIX threaded DNS lookups
|
||||
yet. There is no configure option to enable this feature yet. It is possible
|
||||
to experimantally try this feature running configure with compiler flags that
|
||||
make simultaneous definition of preprocessor symbols USE_THREADS_POSIX and
|
||||
HAVE_PTHREAD_H, as well as whatever reentrancy compiler flags and linker ones
|
||||
are required to link and properly use pthread_* functions on each platform.
|
||||
|
||||
Daniel Stenberg (26 Jan 2010)
|
||||
- Mike Crowe made libcurl return CURLE_COULDNT_RESOLVE_PROXY when it is the
|
||||
proxy that cannot be resolved when using c-ares. This matches the behaviour
|
||||
when not using c-ares.
|
||||
|
||||
Bj<EFBFBD>rn Stenberg (23 Jan 2010)
|
||||
- Added a new flag: -J/--remote-header-name. This option tells the
|
||||
-O/--remote-name option to use the server-specified Content-Disposition
|
||||
filename instead of extracting a filename from the URL.
|
||||
|
||||
Daniel Stenberg (21 Jan 2010)
|
||||
- Chris Conroy brought support for RTSP transfers, and with it comes 8(!) new
|
||||
libcurl options for controlling what to get and how to receive posssibly
|
||||
interleaved RTP data.
|
||||
|
||||
Daniel Stenberg (20 Jan 2010)
|
||||
- As was pointed out on the http-state mailing list, the order of cookies in a
|
||||
HTTP Cookie: header _needs_ to be sorted on the path length in the cases
|
||||
where two cookies using the same name are set more than once using
|
||||
(overlapping) paths. Realizing this, identically named cookies must be
|
||||
sorted correctly. But detecting only identically named cookies and take care
|
||||
of them individually is harder than just to blindly and unconditionally sort
|
||||
all cookies based on their path lengths. All major browsers also already do
|
||||
this, so this makes our behavior one step closer to them in the cookie area.
|
||||
|
||||
Test case 8 was the only one that broke due to this change and I updated it
|
||||
accordingly.
|
||||
|
||||
Daniel Stenberg (19 Jan 2010)
|
||||
- David McCreedy brought a fix and a new test case (129) to make libcurl work
|
||||
again when downloading files over FTP using ASCII and it turns out that the
|
||||
final size of the file is not the same as the initial size the server
|
||||
reported. This is very common since servers don't take the newline
|
||||
conversions into account.
|
||||
|
||||
Kamil Dudka (14 Jan 2010)
|
||||
- Suppressed side effect of OpenSSL configure checks, which prevented NSS from
|
||||
being properly detected under certain circumstances. It had been caused by
|
||||
strange behavior of pkg-config when handling PKG_CONFIG_LIBDIR. pkg-config
|
||||
distinguishes among empty and non-existent environment variable in that case.
|
||||
|
||||
Daniel Stenberg (12 Jan 2010)
|
||||
- Gil Weber reported a peculiar flaw with the multi interface when doing SFTP
|
||||
transfers: curl_multi_fdset() would return -1 and not set and file
|
||||
descriptors several times during a transfer of a single file. It turned out
|
||||
to be due to two different flaws now fixed. Gil's excellent recipe helped me
|
||||
nail this.
|
||||
|
||||
Daniel Stenberg (11 Jan 2010)
|
||||
- Made sure that the progress callback is repeatedly called at a regular
|
||||
interval even during very slow connects.
|
||||
|
||||
- The tests/runtests.pl script now checks to see if the test case that runs is
|
||||
present in the tests/data/Makefile.am and outputs a notice message on the
|
||||
screen if not. Each test file has to be included in that Makefile.am to get
|
||||
included in release archives and forgetting to add files there is a common
|
||||
mistake. This is an attempt to make it harder to forget.
|
||||
|
||||
Daniel Stenberg (9 Jan 2010)
|
||||
- Johan van Selst found and fixed a OpenSSL session ref count leak:
|
||||
|
||||
ossl_connect_step3() increments an SSL session handle reference counter on
|
||||
each call. When sessions are re-used this reference counter may be
|
||||
incremented many times, but it will be decremented only once when done (by
|
||||
Curl_ossl_session_free()); and the internal OpenSSL data will not be freed
|
||||
if this reference count remains positive. When a session is re-used the
|
||||
reference counter should be corrected by explicitly calling
|
||||
SSL_SESSION_free() after each consecutive SSL_get1_session() to avoid
|
||||
introducing a memory leak.
|
||||
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2926284)
|
||||
|
||||
Daniel Stenberg (7 Jan 2010)
|
||||
- Make sure the progress callback is called repeatedly even during very slow
|
||||
name resolves when c-ares is used for resolving.
|
||||
|
||||
Claes Jakobsson (6 Jan 2010)
|
||||
- Julien Chaffraix fixed so that the fragment part in an URL is not sent
|
||||
to the server anymore.
|
||||
|
||||
Kamil Dudka (3 Jan 2010)
|
||||
- Julien Chaffraix eliminated a duplicated initialization in singlesocket().
|
||||
|
||||
Daniel Stenberg (2 Jan 2010)
|
||||
- Make curl support --ssl and --ssl-reqd instead of the previous FTP-specific
|
||||
versions --ftp-ssl and --ftp-ssl-reqd as these options are now used to
|
||||
control SSL/TLS for IMAP, POP3 and SMTP as well in addition to FTP. The old
|
||||
option names are still working but the new ones are the ones listed and
|
||||
documented.
|
||||
|
||||
Daniel Stenberg (1 Jan 2010)
|
||||
- Ingmar Runge enhanced libcurl's FTP engine to support the PRET command. This
|
||||
command is a special "hack" used by the drftpd server, but even though it is
|
||||
a custom extension I've deemed it fine to add to libcurl since this server
|
||||
seems to survive and people keep using it and want libcurl to support
|
||||
it. The new libcurl option is named CURLOPT_FTP_USE_PRET, and it is also
|
||||
usable from the curl tool with --ftp-pret. Using this option on a server
|
||||
that doesn't support this command will make libcurl fail.
|
||||
|
||||
I added test cases 1107 and 1108 to verify the functionality.
|
||||
|
||||
The PRET command is documented at
|
||||
http://www.drftpd.org/index.php/Distributed_PASV
|
||||
|
||||
Yang Tse (30 Dec 2009)
|
||||
- Steven M. Schweda improved VMS build system, and Craig A. Berry helped
|
||||
with the patch and testing.
|
||||
|
||||
Daniel Stenberg (26 Dec 2009)
|
||||
- Renato Botelho and Peter Pentchev brought a patch that makes the libcurl
|
||||
headers work correctly even on FreeBSD systems before v8.
|
||||
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2916915)
|
||||
|
||||
Daniel Stenberg (17 Dec 2009)
|
||||
- David Byron fixed Curl_ossl_cleanup to actually call ENGINE_cleanup when
|
||||
available.
|
||||
|
||||
- Follow-up fix for the proxy fix I did for Jon Nelson's bug. It turned out I
|
||||
was a bit too quick and broke test case 1101 with that change. The order of
|
||||
some of the setups is sensitive. I now changed it slightly again to make
|
||||
sure we do them in this order:
|
||||
|
||||
1 - parse URL and figure out what protocol is used in the URL
|
||||
2 - prepend protocol:// to URL if missing
|
||||
3 - parse name+password off URL, which needs to know what protocol is used
|
||||
(since only some allows for name+password in the URL)
|
||||
4 - figure out if a proxy should be used set by an option
|
||||
5 - if no proxy option, check proxy environment variables
|
||||
6 - run the protocol-specific setup function, which needs to have the proxy
|
||||
already set
|
||||
|
||||
Daniel Stenberg (15 Dec 2009)
|
||||
- Jon Nelson found a regression that turned out to be a flaw in how libcurl
|
||||
detects and uses proxies based on the environment variables. If the proxy
|
||||
was given as an explicit option it worked, but due to the setup order
|
||||
mistake proxies would not be used fine for a few protocols when picked up
|
||||
from '[protocol]_proxy'. Obviously this broke after 7.19.4. I now also added
|
||||
test case 1106 that verifies this functionality.
|
||||
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2913886)
|
||||
|
||||
Daniel Stenberg (12 Dec 2009)
|
||||
- IMAP, POP3 and SMTP support and their TLS versions (including IMAPS, POP3S
|
||||
and SMTPS) are now supported. The current state may not yet be solid, but
|
||||
the foundation is in place and the test suite has some initial support for
|
||||
these protocols. Work will now persue to make them nice libcurl citizens
|
||||
until release.
|
||||
|
||||
The work with supporting these new protocols was sponsored by
|
||||
networking4all.com - thanks!
|
||||
|
||||
Daniel Stenberg (10 Dec 2009)
|
||||
- Siegfried Gyuricsko found out that the curl manual said --retry would retry
|
||||
on FTP errors in the transient 5xx range. Transient FTP errors are in the
|
||||
4xx range. The code itself only tried on 5xx errors that occured _at login_.
|
||||
Now the retry code retries on all FTP transfer failures that ended with a
|
||||
4xx response.
|
||||
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2911279)
|
||||
|
||||
- Constantine Sapuntzakis figured out a case which would lead to libcurl
|
||||
accessing alredy freed memory and thus crash when using HTTPS (with
|
||||
OpenSSL), multi interface and the CURLOPT_DEBUGFUNCTION and a certain order
|
||||
of cleaning things up. I fixed it.
|
||||
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2905220)
|
||||
|
||||
Daniel Stenberg (7 Dec 2009)
|
||||
- Martin Storsjo made libcurl use the Expect: 100-continue header for posts
|
||||
with unknown size. Previously it was only used for posts with a known size
|
||||
larger than 1024 bytes.
|
||||
|
||||
Daniel Stenberg (1 Dec 2009)
|
||||
- If the Expect: 100-continue header has been set by the application through
|
||||
curl_easy_setopt with CURLOPT_HTTPHEADER, the library should set
|
||||
data->state.expect100header accordingly - the current code (in 7.19.7 at
|
||||
least) doesn't handle this properly. Martin Storsjo provided the fix!
|
||||
|
||||
Yang Tse (28 Nov 2009)
|
||||
- Added Diffie-Hellman parameters to several test harness certificate files in
|
||||
PEM format. Required by several stunnel versions used by our test harness.
|
||||
|
||||
Daniel Stenberg (28 Nov 2009)
|
||||
- Markus Koetter provided a polished and updated version of Chad Monroe's TFTP
|
||||
rework patch that now integrates TFTP properly into libcurl so that it can
|
||||
be used non-blocking with the multi interface and more. BLKSIZE also works.
|
||||
|
||||
The --tftp-blksize option was added to allow setting the TFTP BLKSIZE from
|
||||
the command line.
|
||||
|
||||
Daniel Stenberg (26 Nov 2009)
|
||||
- Extended and fixed the change I did on Dec 11 for the the progress
|
||||
meter/callback during FTP command/response sequences. It turned out it was
|
||||
really lame before and now the progress meter SHOULD get called at least
|
||||
once per second.
|
||||
|
||||
Daniel Stenberg (23 Nov 2009)
|
||||
- Bjorn Augustsson reported a bug which made curl not report any problems even
|
||||
though it failed to write a very small download to disk (done in a single
|
||||
fwrite call). It turned out to be because fwrite() returned success, but
|
||||
there was insufficient error-checking for the fclose() call which tricked
|
||||
curl to believe things were fine.
|
||||
|
||||
Yang Tse (23 Nov 2009)
|
||||
- David Byron modified Makefile.dist vc8 and vc9 targets in order to allow
|
||||
finer granularity control when generating src and lib makefiles.
|
||||
|
||||
Yang Tse (22 Nov 2009)
|
||||
- I modified configure to force removal of the curlbuild.h file included in
|
||||
distribution tarballs for use by non-configure systems. As intended, this
|
||||
would get overwriten when doing in-tree builds. But VPATH builds would end
|
||||
having two curlbuild.h files, one in the source tree and another in the
|
||||
build tree. With the modification I introduced 5 Nov 2009 this could become
|
||||
an issue when running libcurl's test suite.
|
||||
|
||||
Daniel Stenberg (20 Nov 2009)
|
||||
- Constantine Sapuntzakis identified a write after close, as the sockets were
|
||||
closed by libcurl before the SSL lib were shutdown and they may write to its
|
||||
socket. Detected to at least happen with OpenSSL builds.
|
||||
|
||||
- Jad Chamcham pointed out a bug with connection re-use. If a connection had
|
||||
CURLOPT_HTTPPROXYTUNNEL enabled over a proxy, a subsequent request using the
|
||||
same proxy with the tunnel option disabled would still wrongly re-use that
|
||||
previous connection and the outcome would only be badness.
|
||||
|
||||
Yang Tse (18 Nov 2009)
|
||||
- I modified the memory tracking system to make it intolerant with zero sized
|
||||
malloc(), calloc() and realloc() function calls.
|
||||
|
||||
Daniel Stenberg (17 Nov 2009)
|
||||
- Constantine Sapuntzakis provided another fix for the DNS cache that could
|
||||
end up with entries that wouldn't time-out:
|
||||
|
||||
1. Set up a first web server that redirects (307) to a http://server:port
|
||||
that's down
|
||||
2. Have curl connect to the first web server using curl multi
|
||||
|
||||
After the curl_easy_cleanup call, there will be curl dns entries hanging
|
||||
around with in_use != 0.
|
||||
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2891591)
|
||||
|
||||
- Marc Kleine-Budde fixed: curl saved the LDFLAGS set during configure into
|
||||
its pkg-config file. So -Wl stuff ended up in the .pc file, which is really
|
||||
bad, and breaks if there are multiple -Wl in our LDFLAGS (which are in
|
||||
PTXdist). bug #2893592 (http://curl.haxx.se/bug/view.cgi?id=2893592)
|
||||
|
||||
Kamil Dudka (15 Nov 2009)
|
||||
- David Byron improved the configure script to use pkg-config to find OpenSSL
|
||||
(and in particular the list of required libraries) even if a path is given
|
||||
as argument to --with-ssl
|
||||
|
||||
Yang Tse (15 Nov 2009)
|
||||
- I removed enable-thread / disable-thread configure option. These were only
|
||||
placebo options. The library is always built as thread safe as possible on
|
||||
every system.
|
||||
|
||||
Claes Jakobsson (14 Nov 2009)
|
||||
- curl-config now accepts '--configure' to see what arguments was
|
||||
passed to the configure script when building curl.
|
||||
|
||||
Daniel Stenberg (14 Nov 2009)
|
||||
- Claes Jakobsson restored the configure functionality to detect NSS when
|
||||
--with-nss is set but not "yes".
|
||||
|
||||
I think we can still improve that to check for pkg-config in that path etc,
|
||||
but at least this patch brings back the same functionality we had before.
|
||||
|
||||
- Camille Moncelier added support for the file type SSL_FILETYPE_ENGINE for
|
||||
the client certificate. It also disable the key name test as some engines
|
||||
can select a private key/cert automatically (When there is only one key
|
||||
and/or certificate on the hardware device used by the engine)
|
||||
|
||||
Yang Tse (14 Nov 2009)
|
||||
- Constantine Sapuntzakis provided the fix that ensures that an SSL connection
|
||||
won't be reused unless protection level for peer and host verification match.
|
||||
|
||||
I refactored how preprocessor symbol _THREAD_SAFE definition is done.
|
||||
|
||||
Kamil Dudka (12 Nov 2009)
|
||||
- Kevin Baughman provided a fix preventing libcurl-NSS from crash on doubly
|
||||
closed NSPR descriptor. The issue was hard to find, reported several times
|
||||
before and always closed unresolved. More info at the RH bug:
|
||||
https://bugzilla.redhat.com/534176
|
||||
|
||||
- libcurl-NSS now tries to reconnect with TLS disabled in case it detects
|
||||
a broken TLS server. However it does not happen if SSL version is selected
|
||||
manually. The approach was originally taken from PSM. Kaspar Brand helped me
|
||||
to complete the patch. Original bug reports:
|
||||
https://bugzilla.redhat.com/525496
|
||||
https://bugzilla.redhat.com/527771
|
||||
|
||||
Yang Tse (12 Nov 2009)
|
||||
- I modified configure script to make the getaddrinfo function check also
|
||||
verify if the function is thread safe.
|
||||
|
||||
Yang Tse (11 Nov 2009)
|
||||
- Marco Maggi reported that compilation failed when configured --with-gssapi
|
||||
and GNU GSS installed due to a missing mutual exclusion of header files in
|
||||
the Kerberos 5 code path. He also verified that my patch worked for him.
|
||||
|
||||
Daniel Stenberg (11 Nov 2009)
|
||||
- Constantine Sapuntzakis posted bug #2891595
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2891595) which identified how an entry
|
||||
in the DNS cache would linger too long if the request that added it was in
|
||||
use that long. He also provided the patch that now makes libcurl capable of
|
||||
still doing a request while the DNS hash entry may get timed out.
|
||||
|
||||
- Christian Schmitz noticed that the progress meter/callback was not properly
|
||||
used during the FTP connection phase (after the actual TCP connect), while
|
||||
it of course should be. I also made the speed check get called correctly so
|
||||
that really slow servers will trigger that properly too.
|
||||
|
||||
Kamil Dudka (5 Nov 2009)
|
||||
- Dropped misleading timeouts in libcurl-NSS and made sure the SSL socket works
|
||||
in non-blocking mode.
|
||||
|
||||
Yang Tse (5 Nov 2009)
|
||||
- I removed leading 'curl' path on the 'curlbuild.h' include statement in
|
||||
curl.h, adjusting auto-makefiles include path, to enhance portability to
|
||||
OS's without an orthogonal directory tree structure such as OS/400.
|
||||
|
||||
Daniel Stenberg (4 Nov 2009)
|
||||
- I fixed several problems with the transfer progress meter. It showed the
|
||||
wrong percentage for small files, most notable for <1000 bytes and could
|
||||
easily end up showing more than 100% at the end. It also didn't show any
|
||||
percentage, transfer size or estimated transfer times when transferring
|
||||
less than 100 bytes.
|
||||
|
||||
Version 7.19.7 (4 November 2009)
|
||||
|
||||
Daniel Stenberg (2 Nov 2009)
|
||||
- As reported independent by both Stan van de Burgt and Didier Brisebourg,
|
||||
CURLINFO_SIZE_DOWNLOAD (the -w variable size_download) didn't work when
|
||||
getting data from ldap!
|
||||
|
||||
Daniel Stenberg (31 Oct 2009)
|
||||
- Gabriel Kuri reported a problem with CURLINFO_CONTENT_LENGTH_DOWNLOAD if the
|
||||
download was 0 bytes, as libcurl would then return the size as unknown (-1)
|
||||
and not 0. I wrote a fix and test case 566 to verify it.
|
||||
|
||||
Daniel Stenberg (30 Oct 2009)
|
||||
- Liza Alenchery mentioned a problem with re-used SCP connection when a bad
|
||||
auth is used, as it caused a crash. I failed to repeat the issue, but still
|
||||
made a change that now forces the TCP connection used for a freed SCP
|
||||
session to get closed and not be re-used.
|
||||
|
||||
- "Tom" posted a bug report that mentioned how libcurl did wrong when doing a
|
||||
POST using a read callback, with Digest authentication and
|
||||
"Transfer-Encoding: chunked" enforced. I would then cause the first request
|
||||
to be wrongly sent and then basically hang until the server closed the
|
||||
connection. I fixed the problem and added test case 565 to verify it.
|
||||
|
||||
Daniel Stenberg (25 Oct 2009)
|
||||
- Dima Barsky made the curl cookie parser accept cookies even with blank or
|
||||
unparsable expiry dates and then treat them as session cookies - previously
|
||||
libcurl would reject cookies with a date format it couldn't parse. Research
|
||||
shows that the major browser treat such cookies as session cookies. I
|
||||
modified test 8 and 31 to verify this.
|
||||
|
||||
Daniel Stenberg (21 Oct 2009)
|
||||
- Attempt to use pkg-config for finding out libssh2 installation details
|
||||
during configure.
|
||||
|
||||
- A patch in bug report #2883177 (http://curl.haxx.se/bug/view.cgi?id=2883177)
|
||||
by Johan van Selst introduced the --crlfile option to curl, which makes curl
|
||||
tell libcurl about a file with CRL (certificate revocation list) data to
|
||||
read.
|
||||
|
||||
Daniel Stenberg (18 Oct 2009)
|
||||
- Ray Dassen provided a patch in Debian's bug tracker (bug number #551461)
|
||||
that now makes curl_getdate(3) actually handles RFC 822 formatted dates that
|
||||
use the "single letter military timezones".
|
||||
http://www.rfc-ref.org/RFC-TEXTS/822/chapter5.html has the details.
|
||||
|
||||
- Fixed memory leak in the SCP/SFTP code as it never freed the knownhosts
|
||||
data!
|
||||
|
||||
- John Dennis filed bug report #2873666
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2873666) which identified a problem
|
||||
which made libcurl loop infinitely when given incorrect credentials when
|
||||
using HTTP GSS negotiate authentication. He also provided a small and simple
|
||||
patch for it.
|
||||
|
||||
- Kevin Baughman found a double close() problem with libcurl-NSS, as when
|
||||
libcurl called NSS to close the SSL "session" it also closed the actual
|
||||
socket.
|
||||
|
||||
Yang Tse (17 Oct 2009)
|
||||
- Bug report #2866724 indicated
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2866724) that curl on Windows failed
|
||||
when writing files whose file names originally contained characters which
|
||||
are not valid for file names on Windows. Dan Fandrich provided an initial
|
||||
patch and another revised one to fix this issue.
|
||||
|
||||
Daniel Stenberg (1 Oct 2009)
|
||||
- Tom Mueller correctly reported in bug report #2870221
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2870221) that libcurl returned an
|
||||
incorrect return code from the internal trynextip() function which caused
|
||||
him grief. This is a regression that was introduced in 7.19.1 and I find it
|
||||
strange it hasn't hit us harder, but I won't persue into figuring out
|
||||
exactly why.
|
||||
|
||||
- Constantine Sapuntzakis: The current implementation will always set
|
||||
SO_SNDBUF to CURL_WRITE_SIZE even if the SO_SNDBUF starts out larger. The
|
||||
patch doesn't do a setsockopt if SO_SNDBUF is already greater than
|
||||
CURL_WRITE_SIZE. This should help folks who have set up their computer with
|
||||
large send buffers.
|
||||
|
||||
Daniel Stenberg (27 Sep 2009)
|
||||
- I introduced a maximum limit for received HTTP headers. It is controlled by
|
||||
the define CURL_MAX_HTTP_HEADER which is even exposed in the public header
|
||||
file to allow for users to fairly easy rebuild libcurl with a modified
|
||||
limit. The rationale for a fixed limit is that libcurl is realloc()ing a
|
||||
buffer to be able to put a full header into it, so that it can call the
|
||||
header callback with the entire header, but that also risk getting it into
|
||||
trouble if a server by mistake or willingly sends a header that is more or
|
||||
less without an end. The limit is set to 100K.
|
||||
|
||||
Daniel Stenberg (26 Sep 2009)
|
||||
- John P. McCaskey posted a bug report that showed how libcurl did wrong when
|
||||
saving received cookies with no given path, if the path in the request had a
|
||||
query part. That is means a question mark (?) and characters on the right
|
||||
side of that. I wrote test case 1105 and fixed this problem.
|
||||
|
||||
Kamil Dudka (26 Sep 2009)
|
||||
- Implemented a protocol independent way to specify blocking direction, used by
|
||||
transfer.c for blocking. It is currently used only by SCP and SFTP protocols.
|
||||
This enhancement resolves an issue with 100% CPU usage during SFTP upload,
|
||||
reported by Vourhey.
|
||||
|
||||
Daniel Stenberg (25 Sep 2009)
|
||||
- Chris Mumford filed bug report #2861587
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2861587) identifying that libcurl used
|
||||
the OpenSSL function X509_load_crl_file() wrongly and failed if it would
|
||||
load a CRL file with more than one certificate within. This is now fixed.
|
||||
|
||||
Daniel Stenberg (16 Sep 2009)
|
||||
- Sven Anders reported that we introduced a cert verfication flaw for OpenSSL-
|
||||
powered libcurl in 7.19.6. If there was a X509v3 Subject Alternative Name
|
||||
field in the certficate it had to match and so even if non-DNS and non-IP
|
||||
entry was present it caused the verification to fail.
|
||||
|
||||
Daniel Fandrich (15 Sep 2009)
|
||||
- Moved the libssh2 checks after the SSL library checks. This helps when
|
||||
statically linking since libssh2 needs the SSL library link flags to be
|
||||
set up already to satisfy its dependencies. This wouldn't be necessary if
|
||||
the libssh2 configure check was changed to use pkg-config since the
|
||||
--static flag would add the dependencies automatically.
|
||||
|
||||
Yang Tse (14 Sep 2009)
|
||||
- Revert Joshua Kwan's patch committed 11 Sep 2009.
|
||||
|
||||
Some systems poll function sets POLLHUP in revents without setting
|
||||
POLLIN, and sets POLLERR without setting POLLIN and POLLOUT. In some
|
||||
libcurl code execution paths this could trigger busy wait loops with
|
||||
high CPU usage until a timeout condition aborted the loop.
|
||||
|
||||
The reverted patch addressed the above issue for a very specific case,
|
||||
when awaiting c-ares to resolve. A libcurl-wide fix for Curl_poll now
|
||||
superceeds this one.
|
||||
|
||||
Guenter Knauf (11 Sep 2009)
|
||||
- Joshua Kwan provided a patch to pass POLLERR / POLLHUP back to c-ares.
|
||||
This fixes a loop problem with high CPU usage.
|
||||
|
||||
Daniel Stenberg (10 Sep 2009)
|
||||
- Claes Jakobsson fixed a problem with cookie expiry dates at exctly the epoch
|
||||
start second "Thu Jan 1 00:00:00 GMT 1970" as the date parser then returns 0
|
||||
which internally then is treated as a session cookie. That particular date
|
||||
is now made to get the value of 1.
|
||||
|
||||
Daniel Stenberg (2 Sep 2009)
|
||||
- Daniel Johnson found a flaw in the code converting sftp-errors to libcurl
|
||||
errors.
|
||||
|
||||
Daniel Stenberg (1 Sep 2009)
|
||||
- Peter Sylvester made a debug feature for Curl_resolv() that now will force
|
||||
libcurl to resolve 'localhost' whatever name you use in the URL *if* you set
|
||||
the --interface option to (exactly) "LocalHost". This will enable us to
|
||||
write tests for custom hosts names but still use a local host server.
|
||||
|
||||
- configure now tries to use pkg-config for a number of sub-dependencies even
|
||||
when cross-compiling. The key to success is then you properly setup
|
||||
PKG_CONFIG_PATH before invoking configure.
|
||||
|
||||
I also improved how NSS is detected by trying nss-config if pkg-config isn't
|
||||
present, and as a last resort just use the lib name and force the user to
|
||||
setup the LIBS/LDFLAGS/CFLAGS etc properly. The previous last resort would
|
||||
add a range of various libs that would almost never be quite correct.
|
||||
|
||||
Daniel Stenberg (31 Aug 2009)
|
||||
- When using the multi interface with FTP and you asked for NOBODY, you did no
|
||||
QUOTE commands and the request used the same path as the connection had
|
||||
already changed to, it would decide that no commands would be necessary for
|
||||
the "DO" action and that was not handled properly but libcurl would instead
|
||||
hang.
|
||||
|
||||
Kamil Dudka (28 Aug 2009)
|
||||
- Improved error message for not matching certificate subject name in
|
||||
libcurl-NSS. Originally reported at:
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=516056#c9
|
||||
|
||||
Patrick Monnerat (24 Aug 2009)
|
||||
- Introduced a SYST-based test to properly set-up name format when dealing
|
||||
with the OS/400 FTP server.
|
||||
|
||||
- Fixed an ftp_readresp() bug preventing detection of failing control socket
|
||||
and causing FTP client to loop forever.
|
||||
|
||||
Daniel Stenberg (24 Aug 2009)
|
||||
- Marc de Bruin pointed out that configure --with-gnutls=PATH didn't work
|
||||
properly and provided a fix. http://curl.haxx.se/bug/view.cgi?id=2843008
|
||||
|
||||
- Eric Wong introduced support for the new option -T. (dot) that makes curl
|
||||
read stdin in a non-blocking fashion. This also brings back -T- (minus) to
|
||||
the previous blocking behavior since it could break stuff for people at
|
||||
times.
|
||||
|
||||
Michal Marek (21 Aug 2009)
|
||||
- With CURLOPT_PROXY_TRANSFER_MODE, avoid sending invalid URLs like
|
||||
ftp://example.com;type=i if the user specified ftp://example.com without the
|
||||
slash.
|
||||
|
||||
Daniel Stenberg (21 Aug 2009)
|
||||
- Andre Guibert de Bruet pointed out a missing return code check for a
|
||||
strdup() that could lead to segfault if it returned NULL. I extended his
|
||||
suggest patch to now have Curl_retry_request() return a regular return code
|
||||
and better check that.
|
||||
|
||||
- Lots of good work by Krister Johansen, mostly related to pipelining:
|
||||
|
||||
Fix SIGSEGV on free'd easy_conn when pipe unexpectedly breaks
|
||||
Fix data corruption issue with re-connected transfers
|
||||
Fix use after free if we're completed but easy_conn not NULL
|
||||
|
||||
Kamil Dudka (13 Aug 2009)
|
||||
- Changed NSS code to not ignore the value of ssl.verifyhost and produce more
|
||||
verbose error messages. Originally reported at:
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=516056
|
||||
|
||||
Daniel Stenberg (12 Aug 2009)
|
||||
- Karl Moerder fixed the Makefile.vc* makefiles to include the new file
|
||||
nonblock.c so that they work fine again
|
||||
|
||||
- I expanded test 517 with a bunch of more dates that originate from the
|
||||
Chrome browser test suite. It turns out most of them get parsed the same
|
||||
way.
|
||||
|
||||
Version 7.19.6 (12 August 2009)
|
||||
|
||||
Daniel Stenberg (12 Aug 2009)
|
||||
|
@@ -46,7 +46,7 @@ pkgconfig_DATA = libcurl.pc
|
||||
dist-hook:
|
||||
rm -rf $(top_builddir)/tests/log
|
||||
find $(distdir) -name "*.dist" -exec rm {} \;
|
||||
(distit=`find $(srcdir) -name "*.dist"`; \
|
||||
(distit=`find $(srcdir) -name "*.dist" | grep -v ./ares/`; \
|
||||
for file in $$distit; do \
|
||||
strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \
|
||||
cp $$file $(distdir)$$strip; \
|
||||
|
@@ -130,9 +130,9 @@ vc:
|
||||
|
||||
vc-x64:
|
||||
cd lib
|
||||
MACHINE=x64 nmake /f Makefile.$(VC) cfg=release
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release
|
||||
cd ..\src
|
||||
MACHINE=x64 nmake /f Makefile.$(VC)
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release
|
||||
|
||||
vc-zlib:
|
||||
cd lib
|
||||
@@ -152,6 +152,12 @@ vc-ssl-zlib:
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl-zlib
|
||||
|
||||
vc-x64-ssl-zlib:
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-zlib
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-zlib
|
||||
|
||||
vc-ssl-dll:
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release-ssl-dll
|
||||
@@ -257,15 +263,25 @@ linux: all
|
||||
linux-ssl: ssl
|
||||
|
||||
|
||||
vc8:
|
||||
@echo "generate VC8 makefiles"
|
||||
vc8: lib/Makefile.vc8 src/Makefile.vc8
|
||||
|
||||
lib/Makefile.vc8: lib/Makefile.vc6
|
||||
@echo "generate $@"
|
||||
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/wsock32.lib bufferoverflowu.lib/g" -e "s/VC6/VC8/g" lib/Makefile.vc6 > lib/Makefile.vc8
|
||||
|
||||
src/Makefile.vc8: src/Makefile.vc6
|
||||
@echo "generate $@"
|
||||
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/wsock32.lib bufferoverflowu.lib/g" -e "s/VC6/VC8/g" src/Makefile.vc6 > src/Makefile.vc8
|
||||
|
||||
# VC9 makefiles are for use with VS2008
|
||||
vc9:
|
||||
@echo "generate VC9 makefiles"
|
||||
vc9: lib/Makefile.vc9 src/Makefile.vc9
|
||||
|
||||
lib/Makefile.vc9: lib/Makefile.vc6
|
||||
@echo "generate $@"
|
||||
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/ws2_32.lib/g" -e "s/vc6/vc9/g" -e "s/VC6/VC9/g" lib/Makefile.vc6 > lib/Makefile.vc9
|
||||
|
||||
src/Makefile.vc9: src/Makefile.vc6
|
||||
@echo "generate $@"
|
||||
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/ws2_32.lib/g" -e "s/vc6/vc9/g" -e "s/VC6/VC9/g" src/Makefile.vc6 > src/Makefile.vc9
|
||||
|
||||
ca-bundle: lib/mk-ca-bundle.pl
|
||||
|
101
RELEASE-NOTES
101
RELEASE-NOTES
@@ -1,50 +1,59 @@
|
||||
Curl and libcurl 7.19.6
|
||||
Curl and libcurl 7.20.0
|
||||
|
||||
Public curl releases: 112
|
||||
Command line options: 132
|
||||
curl_easy_setopt() options: 163
|
||||
Public curl releases: 114
|
||||
Command line options: 136
|
||||
curl_easy_setopt() options: 174
|
||||
Public functions in libcurl: 58
|
||||
Known libcurl bindings: 38
|
||||
Contributors: 715
|
||||
Known libcurl bindings: 39
|
||||
Contributors: 761
|
||||
|
||||
This release includes the following changes:
|
||||
|
||||
o CURLOPT_FTPPORT (and curl's -P/--ftpport) support port ranges
|
||||
o Added CURLOPT_SSH_KNOWNHOSTS, CURLOPT_SSH_KEYFUNCTION, CURLOPT_SSH_KEYDATA
|
||||
o CURLOPT_QUOTE, CURLOPT_POSTQUOTE and CURLOPT_PREQUOTE can be told to ignore
|
||||
error responses when used with FTP
|
||||
o support SSL_FILETYPE_ENGINE for client certificate
|
||||
o curl-config can now show the arguments used when building curl
|
||||
o non-blocking TFTP
|
||||
o send Expect: 100-continue for POSTs with unknown sizes
|
||||
o added support for IMAP(S), POP3(S), SMTP(S) and RTSP
|
||||
o added new curl_easy_setopt() options for SMTP and RTSP
|
||||
o added --mail-from and --mail-rcpt for SMTP
|
||||
o VMS build system enhancements
|
||||
o added support for the PRET ftp command
|
||||
o curl supports --ssl and --ssl-reqd
|
||||
o added -J/--remote-header-name for using server-provided filename with -O
|
||||
o enhanced asynchronous DNS lookups
|
||||
o symbol CURL_FORMAT_OFF_T is obsoleted
|
||||
|
||||
This release includes the following bugfixes:
|
||||
|
||||
o crash on bad socket close with FTP
|
||||
o leaking cookie memory when duplicate domains or paths were used
|
||||
o build fix for Symbian
|
||||
o CURLOPT_USERPWD set to NULL clears auth credentials
|
||||
o libcurl-NSS build fixes
|
||||
o configure script fixed for VMS
|
||||
o set Content-Length: with POST and PUT failed with NTLM auth
|
||||
o allow building libcurl for VxWorks
|
||||
o curl tool exit codes fixed for VMS
|
||||
o --no-buffer treated correctly
|
||||
o djgpp build fix
|
||||
o configure detection of GnuTLS now based on pkg-config as well
|
||||
o libcurl-NSS client cert handling segfaults
|
||||
o curl uploading from stdin/pipes now works in non-blocking way so that it
|
||||
continues the downloading even when the read stalls
|
||||
o ftp credentials are added to the url if needed for http proxies
|
||||
o curl -o - sends data to stdout using binary mode on windows
|
||||
o fixed the separators for "array" style string that CURLINFO_CERTINFO returns
|
||||
o auth problem over several hosts with re-used connection
|
||||
o improved the support for client certificates in libcurl+NSS
|
||||
o fix leak in gtls code
|
||||
o missing algorithms in libcurl+OpenSSL
|
||||
o with noproxy set you could still get a proxy if a proxy env was set
|
||||
o rand seeding on libcurl on windows built with OpenSSL was not thread-safe
|
||||
o fixed the zero byte inserted in cert name flaw in libcurl+OpenSSL
|
||||
o don't try SNI with SSLv2 or SSLv3 (OpenSSL and GnuTLS builds)
|
||||
o libcurl+OpenSSL would wrongly acknowledge a cert if CN matched but
|
||||
subjectAltName didn't
|
||||
o TFTP upload sent illegal TSIZE packets
|
||||
o progress meter percentage and transfer time estimates fixes
|
||||
o portability enhancement for OS's without orthogonal directory tree structure
|
||||
o progress meter/callback during FTP connection
|
||||
o DNS cache timeout while transfer in progress
|
||||
o compilation when configured --with-gssapi having GNU GSS installed
|
||||
o SSL connection reused with mismatched protection level
|
||||
o configure --with-nss is set but not "yes"
|
||||
o don't store LDFLAGS in pkg-config file
|
||||
o never-pruned DNS cached entries
|
||||
o HTTP proxy tunnel re-used connection even if tunnel got disabled
|
||||
o SSL lib post-close write
|
||||
o curl failed to report write errors for tiny failed downloads
|
||||
o TFTP BLKSIZE
|
||||
o Expect: 100-continue handling when set by the application
|
||||
o multi interface with OpenSSL read already freed memory when closing down
|
||||
o --retry didn't do right for FTP transient errors
|
||||
o some *_proxy environment variables didn't function
|
||||
o libcurl-OpenSSL engine cleanup
|
||||
o header include fix for FreeBSD versions before v8
|
||||
o fragment part of URLs are no longer sent to the server
|
||||
o progress callback called repeatedly with c-ares for resolving
|
||||
o OpenSSL session id ref count leak
|
||||
o progress callback called repeatedly during slow connects
|
||||
o curl_multi_fdset() would return -1 too often during SCP/SFTP transfers
|
||||
o FTP file size checks with ASCII transfers
|
||||
o HTTP Cookie: headers sort cookies based on specified path lengths
|
||||
o CURLM_CALL_MULTI_PERFORM fix for multi socket timeout calls
|
||||
o libcurl data callback excessive length:
|
||||
http://curl.haxx.se/docs/adv_20100209.html
|
||||
|
||||
This release includes the following known bugs:
|
||||
|
||||
@@ -53,12 +62,12 @@ This release includes the following known bugs:
|
||||
This release would not have looked like this without help, code, reports and
|
||||
advice from friends like these:
|
||||
|
||||
Yang Tse, Daniel Fandrich, Kamil Dudka, Caolan McNamara, Frank McGeough,
|
||||
Andre Guibert de Bruet, Mike Crowe, Claes Jakobsson, John E. Malmberg,
|
||||
Aaron Oneal, Igor Novoseltsev, Eric Wong, Bill Hoffman, Daniel Steinberg,
|
||||
Fabian Keil, Michal Marek, Reuven Wachtfogel, Markus Koetter,
|
||||
Constantine Sapuntzakis, David Binderman, Johan van Selst, Alexander Beedie,
|
||||
Tanguy Fautre, Scott Cantor, Curt Bogmine, Peter Sylvester, Benbuck Nason,
|
||||
Carsten Lange
|
||||
Yang Tse, Kamil Dudka, Christian Schmitz, Constantine Sapuntzakis,
|
||||
Marco Maggi, Camille Moncelier, Claes Jakobsson, Kevin Baughman,
|
||||
Marc Kleine-Budde, Jad Chamcham, Bjorn Augustsson, David Byron,
|
||||
Markus Koetter, Chad Monroe, Martin Storsjo, Siegfried Gyuricsko,
|
||||
Jon Nelson, Julien Chaffraix, Renato Botelho, Peter Pentchev, Ingmar Runge,
|
||||
Johan van Selst, Charles Kerr, Gil Weber, David McCreedy, Chris Conroy,
|
||||
Bjorn Stenberg, Mike Crowe, Joshua Kwan, Daniel Fandrich, Wesley Miaw
|
||||
|
||||
Thanks! (and sorry if I forgot to mention someone)
|
||||
|
20
TODO-RELEASE
20
TODO-RELEASE
@@ -1,21 +1,6 @@
|
||||
To be addressed in 7.19.7 (planned release: October 2009)
|
||||
To be addressed in 7.20.0 (planned release: January 2010)
|
||||
=========================
|
||||
|
||||
248 - "Pausing pipeline problems."
|
||||
http://curl.haxx.se/mail/lib-2009-07/0214.html
|
||||
|
||||
251 - TFTP block size / better integration in transfer
|
||||
http://curl.haxx.se/mail/lib-2009-08/0028.html
|
||||
|
||||
254 - Problem re-using easy handle after call to curl_multi_remove_handle
|
||||
http://curl.haxx.se/mail/lib-2009-07/0249.html
|
||||
|
||||
255 - debugging a crash in Curl_pgrsTime/checkPendPipeline?
|
||||
http://curl.haxx.se/mail/lib-2009-08/0066.html
|
||||
|
||||
256 - "More questions about ares behavior"
|
||||
http://curl.haxx.se/mail/lib-2009-08/0012.html
|
||||
|
||||
244 - patch for [out] parameters
|
||||
http://curl.haxx.se/mail/lib-2009-06/0342.html
|
||||
|
||||
@@ -27,5 +12,4 @@ To be addressed in 7.19.7 (planned release: October 2009)
|
||||
|
||||
253 - add option to disable SNI for TLS handshakes
|
||||
|
||||
257 -
|
||||
|
||||
261 -
|
48
acinclude.m4
48
acinclude.m4
@@ -3190,25 +3190,53 @@ AC_DEFUN([CURL_CHECK_WIN32_LARGEFILE], [
|
||||
esac
|
||||
])
|
||||
|
||||
dnl CURL_CHECK_PKGCONFIG ($module)
|
||||
dnl CURL_EXPORT_PCDIR ($pcdir)
|
||||
dnl ------------------------
|
||||
dnl if $pcdir is not empty, set PKG_CONFIG_LIBDIR to $pcdir and export
|
||||
dnl
|
||||
dnl we need this macro since pkg-config distinguishes among empty and unset
|
||||
dnl variable while checking PKG_CONFIG_LIBDIR
|
||||
dnl
|
||||
|
||||
AC_DEFUN([CURL_EXPORT_PCDIR], [
|
||||
if test -n "$1"; then
|
||||
PKG_CONFIG_LIBDIR="$1"
|
||||
export PKG_CONFIG_LIBDIR
|
||||
fi
|
||||
])
|
||||
|
||||
dnl CURL_CHECK_PKGCONFIG ($module, [$pcdir])
|
||||
dnl ------------------------
|
||||
dnl search for the pkg-config tool (if not cross-compiling). Set the PKGCONFIG
|
||||
dnl variable to hold the path to it, or 'no' if not found/present.
|
||||
dnl
|
||||
dnl If pkg-config is present, check that it has info about the $module or return
|
||||
dnl "no" anyway!
|
||||
dnl If pkg-config is present, check that it has info about the $module or
|
||||
dnl return "no" anyway!
|
||||
dnl
|
||||
dnl Optionally PKG_CONFIG_LIBDIR may be given as $pcdir.
|
||||
dnl
|
||||
|
||||
AC_DEFUN([CURL_CHECK_PKGCONFIG], [
|
||||
if test x$cross_compiling != xyes; then
|
||||
dnl only do pkg-config magic when not cross-compiling
|
||||
AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
|
||||
|
||||
PKGCONFIG="no"
|
||||
|
||||
if test x$cross_compiling = xyes; then
|
||||
dnl see if there's a pkg-specific for this host setup
|
||||
AC_PATH_PROG( PKGCONFIG, ${host}-pkg-config, no,
|
||||
$PATH:/usr/bin:/usr/local/bin)
|
||||
fi
|
||||
|
||||
if test x$PKGCONFIG = xno; then
|
||||
AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
|
||||
fi
|
||||
|
||||
if test x$PKGCONFIG != xno; then
|
||||
AC_MSG_CHECKING([for $1 options with pkg-config])
|
||||
dnl ask pkg-config about $1
|
||||
$PKGCONFIG --exists $1
|
||||
if test "$?" -ne "0"; then
|
||||
itexists=`CURL_EXPORT_PCDIR([$2]) dnl
|
||||
$PKGCONFIG --exists $1 >/dev/null 2>&1 && echo 1`
|
||||
|
||||
if test -z "$itexists"; then
|
||||
dnl pkg-config does not have info about the given module! set the
|
||||
dnl variable to 'no'
|
||||
PKGCONFIG="no"
|
||||
@@ -3217,8 +3245,4 @@ AC_DEFUN([CURL_CHECK_PKGCONFIG], [
|
||||
AC_MSG_RESULT([found])
|
||||
fi
|
||||
fi
|
||||
|
||||
else
|
||||
PKGCONFIG="no"
|
||||
fi
|
||||
])
|
||||
|
@@ -3,17 +3,22 @@
|
||||
*.pdf
|
||||
.deps
|
||||
.libs
|
||||
MSVC*
|
||||
Makefile
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
acountry
|
||||
adig
|
||||
ahost
|
||||
ares_build.h
|
||||
ares_version.h.dist
|
||||
autom4te.cache
|
||||
config.guess
|
||||
ares_config.h
|
||||
ares_config.h.in
|
||||
ares_version.h.dist
|
||||
autom4te.cache
|
||||
compile
|
||||
config.guess
|
||||
config.h
|
||||
config.h.in
|
||||
config.log
|
||||
config.lt
|
||||
config.status
|
||||
@@ -26,4 +31,5 @@ libtool
|
||||
ltmain.sh
|
||||
man3
|
||||
missing
|
||||
msvc*
|
||||
stamp-h*
|
||||
|
153
ares/CHANGES
153
ares/CHANGES
@@ -1,5 +1,117 @@
|
||||
Changelog for the c-ares project
|
||||
|
||||
* January 28, 2010 (Daniel Stenberg)
|
||||
- Tommie Gannert pointed out a silly bug in ares_process_fd() since it didn't
|
||||
check for broken connections like ares_process() did. Based on that, I
|
||||
merged the two functions into a single generic one with two front-ends.
|
||||
|
||||
* December 29, 2009 (Yang Tse)
|
||||
- Laszlo Tamas Szabo adjusted Makefile.msvc compiler options so that where
|
||||
run-time error checks enabling compiler option /GZ was used it is replaced
|
||||
with equivalent /RTCsu for Visual Studio 2003 and newer versions. Option
|
||||
/GX is replaced with equivalent /EHsc for all versions. Also fixed socket
|
||||
data type for internal configure_socket function.
|
||||
|
||||
* December 21, 2009 (Yang Tse)
|
||||
- Ingmar Runge noticed that Windows config-win32.h configuration file
|
||||
did not include a definition for HAVE_CLOSESOCKET which resulted in
|
||||
function close() being inappropriately used to close sockets.
|
||||
|
||||
Version 1.7.0 (Nov 30, 2009)
|
||||
|
||||
* November 26, 2009 (Yang Tse)
|
||||
- Larry Lansing fixed ares_parse_srv_reply to properly parse replies
|
||||
which might contain non-SRV answers, skipping over potential non-SRV
|
||||
ones such as CNAMEs.
|
||||
|
||||
* November 23, 2009 (Yang Tse)
|
||||
- Changed naming convention for c-ares libraries built with MSVC, details
|
||||
and build instructions provided in README.msvc file.
|
||||
|
||||
* November 22, 2009 (Yang Tse)
|
||||
- Jakub Hrozek fixed more function prototypes in man pages to sync them
|
||||
with the ones declared in ares.h
|
||||
|
||||
- Jakub Hrozek renamed addrttl and addr6ttl structs to ares_addrttl and
|
||||
ares_addr6ttl in order to prevent name space pollution, along with
|
||||
necessary changes to code base and man pages.This change does not break
|
||||
ABI, there is no need to recompile existing applications. But existing
|
||||
applications using these structs with the old name will need source code
|
||||
adjustments when recompiled using c-ares 1.7.0.
|
||||
|
||||
* November 21, 2009 (Yang Tse)
|
||||
- Added manifest stuff to Makefile.msvc.
|
||||
|
||||
* November 20, 2009 (Yang Tse)
|
||||
- Fixed several function prototypes in man pages that were out of sync
|
||||
with the ones declared in ares.h. Added ares_free_data() along with
|
||||
man page. Updated ares_parse_srv_reply() and ares_parse_txt_reply()
|
||||
with changes from Jakub Hrozek making these now return linked lists
|
||||
instead of arrays, and merging the ares_free_data() adjustments.
|
||||
|
||||
* November 10, 2009 (Yang Tse)
|
||||
- Updated MSVC 6.0 project files to match settings from Makefile.msvc.
|
||||
|
||||
* November 9, 2009 (Yang Tse)
|
||||
- Makefile.msvc is now the reference method to build c-ares and sample
|
||||
programs with any MSVC compiler or MS Visual Studio version. If no
|
||||
option or target are specified it builds dynamic and static c-ares
|
||||
libraries in debug and release flavours and also builds all sample
|
||||
programs using each of the different c-ares libraries.
|
||||
|
||||
* November 2, 2009 (Yang Tse)
|
||||
- Renamed c-ares setup.h to ares_setup.h
|
||||
|
||||
* October 31, 2009 (Yang Tse)
|
||||
- Symbol hiding configure options are named now --enable-symbol-hiding
|
||||
and --disable-symbol-hiding in an attempt to make them less ambiguous.
|
||||
|
||||
* October 30, 2009 (Yang Tse)
|
||||
- Many fixes for ares_parse_txt_reply()
|
||||
|
||||
* October 29, 2009 (Daniel Stenberg)
|
||||
- Jakub Hrozek added ares_parse_txt_reply() for TXT parsing
|
||||
|
||||
* October 29, 2009 (Yang Tse)
|
||||
- Updated MSVC 6.0 workspace and project files that allows building
|
||||
dynamic and static c-ares libraries in debug and release flavours.
|
||||
Additionally each of the three sample programs is built against
|
||||
each of the four possible c-ares libraries, generating all this
|
||||
a total number of 12 executables and 4 libraries.
|
||||
|
||||
* October 28, 2009 (Yang Tse)
|
||||
- Initial step towards the ability to reduce c-ares exported symbols
|
||||
when built as a shared library based on the 'visibility' attribute
|
||||
for GNUC and Intel compilers and based on __global for Sun compilers,
|
||||
taking also in account __declspec function decoration for Win32 and
|
||||
Symbian DLL's.
|
||||
|
||||
* October 27, 2009 (Yang Tse)
|
||||
- Fixed Pelles C Win32 target compilation issues.
|
||||
|
||||
* October 23, 2009 (Yang Tse)
|
||||
- John Engelhart noticed an unreleased problem relative to a duplicate
|
||||
ARES_ECANCELLED error code value and missing error code description.
|
||||
|
||||
* October 7, 2009 (Yang Tse)
|
||||
- Overhauled ares__get_hostent() Fixing out of bounds memory overwrite
|
||||
triggered with malformed /etc/hosts file. Improving parsing of /etc/hosts
|
||||
file. Validating requested address family. Ensuring that failures always
|
||||
return a NULL pointer. Adjusting header inclusions.
|
||||
|
||||
* October 6, 2009 (Yang Tse)
|
||||
- Fix ssize_t redefinition errors on WIN64 reported by Alexey Simak.
|
||||
|
||||
* September 29, 2009 (Yang Tse)
|
||||
- Make configure script also check if _REENTRANT definition is required to
|
||||
make errno available as a preprocessor macro.
|
||||
|
||||
* September 7, 2009 (Yang Tse)
|
||||
- Add T_SRV portability check to ares_parse_srv_reply.c
|
||||
|
||||
* 4 Sep 2009 (Daniel Stenberg)
|
||||
- Jakub Hrozek added ares_parse_srv_reply() for SRV parsing
|
||||
|
||||
* 3 Aug 2009 (Daniel Stenberg)
|
||||
- Joshua Kwan fixed the init routine to fill in the defaults for stuff that
|
||||
fails to get inited by other means. This fixes a case of when the c-ares
|
||||
@@ -12,7 +124,27 @@
|
||||
* 14 Jul 2009 (Guenter Knauf)
|
||||
- renamed generated config.h to ares_config.h to avoid any future clashes
|
||||
with config.h from other projects.
|
||||
|
||||
|
||||
* June 20 2009 (Yang Tse)
|
||||
- Refactor how libraries are checked for connect() function in configure
|
||||
script and check for connect() as it is done for other functions.
|
||||
|
||||
* June 19 2009 (Yang Tse)
|
||||
- Make sclose() function-like macro definition used to close a socket,
|
||||
now solely based on HAVE_CLOSESOCKET and HAVE_CLOSESOCKET_CAMEL
|
||||
config file preprocessor definitions
|
||||
|
||||
* June 18 2009 (Yang Tse)
|
||||
- Add CloseSocket camel case function check for configure script.
|
||||
|
||||
* June 17 2009 (Yang Tse)
|
||||
- Check for socket() and closesocket() as it is done for other functions
|
||||
in configure script.
|
||||
|
||||
* June 11 2009 (Yang Tse)
|
||||
- Modified buildconf so that when automake runs it copies missing files
|
||||
instead of symlinking them.
|
||||
|
||||
* June 8 2009 (Yang Tse)
|
||||
- Removed buildconf.bat from release and daily snapshot archives. This
|
||||
file is only for CVS tree checkout builds.
|
||||
@@ -33,25 +165,36 @@
|
||||
which is only compiled for debug enabled builds. And symbol CURLDEBUG is
|
||||
used to differentiate code which is _only_ used for memory tracking.
|
||||
|
||||
Make ares_init(), ares_dup() and ares_init_options() fail returning
|
||||
ARES_ENOTINITIALIZED if library initialization has not been performed
|
||||
calling ares_library_init().
|
||||
|
||||
* May 20 2009 (Yang Tse)
|
||||
- Added ares_library_init() and ares_library_cleanup() man pages.
|
||||
|
||||
* May 19 2009 (Yang Tse)
|
||||
- Introduced ares_library_init() and ares_library_cleanup() functions.
|
||||
|
||||
This is an API and ABI break for Win32/64 systems. Non-Win32/64 build targets
|
||||
using c-ares 1.6.1 can still survive without calling these functions. Read all
|
||||
using c-ares 1.7.0 can still survive without calling these functions. Read all
|
||||
the details on ares_library_init(3) and ares_library_cleanup(3) man pages that
|
||||
are included.
|
||||
|
||||
curl/libcurl 7.19.5 is fully compatible with c-ares 1.6.1 on all systems.
|
||||
curl/libcurl 7.19.5 is fully compatible with c-ares 1.7.0 on all systems.
|
||||
|
||||
In order to use c-ares 1.6.1 with curl/libcurl on Win32/64 systems it is
|
||||
In order to use c-ares 1.7.0 with curl/libcurl on Win32/64 systems it is
|
||||
required that curl/libcurl is 7.19.5 or newer. In other words, it is not
|
||||
possible on Win32/64 to use c-ares 1.6.1 with a curl/libcurl version less
|
||||
possible on Win32/64 to use c-ares 1.7.0 with a curl/libcurl version less
|
||||
than 7.19.5
|
||||
|
||||
* May 11 2009 (Daniel Stenberg)
|
||||
- Gregor Jasny made c-ares link with libtool 's -export-symbols-regex option to
|
||||
only expose functions starting with ares_.
|
||||
|
||||
* May 7 2009 (Yang Tse)
|
||||
- Fix an m4 overquoting triggering a spurious 'AS_TR_CPP' symbol definition
|
||||
attempt in generated config.h
|
||||
|
||||
* May 2 2009 (Yang Tse)
|
||||
- Use a build-time configured ares_socklen_t data type instead of socklen_t.
|
||||
|
||||
|
@@ -13,15 +13,21 @@ ACLOCAL_AMFLAGS = -I m4
|
||||
# only works when c-ares is built and linked with a similarly debug-build
|
||||
# libcurl, but we do this anyway for convenience.
|
||||
#
|
||||
# $(top_builddir)/../include/curl for generated curlbuild.h included from curl.h
|
||||
# $(top_builddir)/../include is for libcurl's generated curl/curlbuild.h file
|
||||
# $(top_srcdir)/../include is for libcurl's external include files
|
||||
# $(top_builddir)/../lib is for libcurl's generated lib/curl_config.h file
|
||||
# $(top_srcdir)/../lib is for libcurl's lib/setup.h and other "private" files
|
||||
# $(top_builddir) is for c-ares's generated ares_config.h file
|
||||
# $(top_srcdir) is for c-ares's lib/setup.h and other "c-ares-private" files
|
||||
# $(top_srcdir) is for c-ares's ares_setup.h and other "c-ares-private" files
|
||||
|
||||
if CURLDEBUG
|
||||
INCLUDES = -I$(top_builddir)/../include \
|
||||
-I$(top_srcdir)/../include \
|
||||
-I$(top_builddir) \
|
||||
INCLUDES = -I$(top_builddir)/../include/curl \
|
||||
-I$(top_builddir)/../include \
|
||||
-I$(top_srcdir)/../include \
|
||||
-I$(top_builddir)/../lib \
|
||||
-I$(top_srcdir)/../lib \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_srcdir)
|
||||
else
|
||||
INCLUDES = -I$(top_builddir) \
|
||||
@@ -32,8 +38,8 @@ lib_LTLIBRARIES = libcares.la
|
||||
|
||||
man_MANS = $(MANPAGES)
|
||||
|
||||
MSVCFILES = vc/vc.dsw vc/acountry/acountry.dsp vc/adig/adig.dsp \
|
||||
vc/ahost/ahost.dsp vc/areslib/areslib.dsp vc/areslib/areslib.dsw
|
||||
MSVCFILES = vc/vc6aws.dsw vc/acountry/vc6acountry.dsp vc/adig/vc6adig.dsp \
|
||||
vc/ahost/vc6ahost.dsp vc/cares/vc6cares.dsp vc/cares/vc6cares.dsw
|
||||
|
||||
if CURLDEBUG
|
||||
PROGS =
|
||||
@@ -46,9 +52,9 @@ noinst_PROGRAMS =$(PROGS)
|
||||
# adig and ahost are just sample programs and thus not mentioned with the
|
||||
# regular sources and headers
|
||||
EXTRA_DIST = AUTHORS CHANGES README.cares Makefile.inc Makefile.dj \
|
||||
Makefile.m32 Makefile.netware Makefile.vc6 $(man_MANS) $(MSVCFILES) \
|
||||
Makefile.m32 Makefile.netware Makefile.msvc $(man_MANS) $(MSVCFILES) \
|
||||
config-win32.h RELEASE-NOTES libcares.pc.in buildconf get_ver.awk maketgz \
|
||||
TODO ares_build.h.in $(PDFPAGES)
|
||||
TODO ares_build.h.in $(PDFPAGES) cares.rc README.msvc
|
||||
|
||||
CLEANFILES = $(PDFPAGES) $(HTMLPAGES)
|
||||
|
||||
@@ -91,9 +97,7 @@ if NO_UNDEFINED
|
||||
UNDEF = -no-undefined
|
||||
endif
|
||||
|
||||
# EXPORT_SYMBOLS = -export-symbols-regex '^ares_[[:alnum:]].*'
|
||||
|
||||
libcares_la_LDFLAGS = $(UNDEF) $(VER) $(EXPORT_SYMBOLS)
|
||||
libcares_la_LDFLAGS = $(UNDEF) $(VER)
|
||||
|
||||
# Makefile.inc provides the CSOURCES and HHEADERS defines
|
||||
include Makefile.inc
|
||||
@@ -106,14 +110,17 @@ libcares_ladir = $(includedir)
|
||||
libcares_la_HEADERS = ares.h ares_version.h ares_dns.h \
|
||||
ares_build.h ares_rules.h
|
||||
|
||||
ahost_SOURCES = ahost.c ares_getopt.c ares_getopt.h
|
||||
ahost_SOURCES = ahost.c $(SAMPLESOURCES) $(SAMPLEHEADERS)
|
||||
ahost_LDADD = $(top_builddir)/libcares.la
|
||||
ahost_CFLAGS = $(AM_CFLAGS)
|
||||
|
||||
adig_SOURCES = adig.c ares_getopt.c ares_getopt.h
|
||||
adig_SOURCES = adig.c $(SAMPLESOURCES) $(SAMPLEHEADERS)
|
||||
adig_LDADD = $(top_builddir)/libcares.la
|
||||
adig_CFLAGS = $(AM_CFLAGS)
|
||||
|
||||
acountry_SOURCES = acountry.c ares_getopt.c ares_getopt.h
|
||||
acountry_SOURCES = acountry.c $(SAMPLESOURCES) $(SAMPLEHEADERS)
|
||||
acountry_LDADD = $(top_builddir)/libcares.la
|
||||
acountry_CFLAGS = $(AM_CFLAGS)
|
||||
|
||||
SOURCEDMANDIR = man3
|
||||
SOURCEDMANPAGES = ares_init.3
|
||||
|
@@ -1,12 +1,14 @@
|
||||
#
|
||||
# c-ares Makefile for djgpp/gcc/Watt-32.
|
||||
# By Gisle Vanem <giva@bgnett.no> 2004.
|
||||
# By Gisle Vanem <gvanem@broadpark.no> 2004.
|
||||
#
|
||||
# $Id$
|
||||
|
||||
|
||||
TOPDIR = ..
|
||||
|
||||
DEPEND_PREREQ = ares_config.h
|
||||
|
||||
include ../packages/DOS/common.dj
|
||||
include Makefile.inc
|
||||
|
||||
|
@@ -4,6 +4,7 @@ CSOURCES = ares__close_sockets.c \
|
||||
ares__read_line.c \
|
||||
ares__timeval.c \
|
||||
ares_cancel.c \
|
||||
ares_data.c \
|
||||
ares_destroy.c \
|
||||
ares_expand_name.c \
|
||||
ares_expand_string.c \
|
||||
@@ -22,6 +23,8 @@ CSOURCES = ares__close_sockets.c \
|
||||
ares_parse_aaaa_reply.c \
|
||||
ares_parse_ns_reply.c \
|
||||
ares_parse_ptr_reply.c \
|
||||
ares_parse_srv_reply.c \
|
||||
ares_parse_txt_reply.c \
|
||||
ares_process.c \
|
||||
ares_query.c \
|
||||
ares_search.c \
|
||||
@@ -39,6 +42,7 @@ CSOURCES = ares__close_sockets.c \
|
||||
|
||||
HHEADERS = ares.h \
|
||||
ares_build.h \
|
||||
ares_data.h \
|
||||
ares_dns.h \
|
||||
ares_ipv6.h \
|
||||
ares_library_init.h \
|
||||
@@ -53,7 +57,7 @@ HHEADERS = ares.h \
|
||||
inet_net_pton.h \
|
||||
inet_ntop.h \
|
||||
nameser.h \
|
||||
setup.h \
|
||||
ares_setup.h \
|
||||
setup_once.h
|
||||
|
||||
MANPAGES = ares_cancel.3 \
|
||||
@@ -63,6 +67,7 @@ MANPAGES = ares_cancel.3 \
|
||||
ares_expand_name.3 \
|
||||
ares_expand_string.3 \
|
||||
ares_fds.3 \
|
||||
ares_free_data.3 \
|
||||
ares_free_hostent.3 \
|
||||
ares_free_string.3 \
|
||||
ares_gethostbyaddr.3 \
|
||||
@@ -79,6 +84,8 @@ MANPAGES = ares_cancel.3 \
|
||||
ares_parse_aaaa_reply.3 \
|
||||
ares_parse_ns_reply.3 \
|
||||
ares_parse_ptr_reply.3 \
|
||||
ares_parse_srv_reply.3 \
|
||||
ares_parse_txt_reply.3 \
|
||||
ares_process.3 \
|
||||
ares_query.3 \
|
||||
ares_save_options.3 \
|
||||
@@ -96,6 +103,7 @@ HTMLPAGES = ares_cancel.html \
|
||||
ares_expand_name.html \
|
||||
ares_expand_string.html \
|
||||
ares_fds.html \
|
||||
ares_free_data.html \
|
||||
ares_free_hostent.html \
|
||||
ares_free_string.html \
|
||||
ares_gethostbyaddr.html \
|
||||
@@ -112,6 +120,8 @@ HTMLPAGES = ares_cancel.html \
|
||||
ares_parse_aaaa_reply.html \
|
||||
ares_parse_ns_reply.html \
|
||||
ares_parse_ptr_reply.html \
|
||||
ares_parse_srv_reply.html \
|
||||
ares_parse_txt_reply.html \
|
||||
ares_process.html \
|
||||
ares_query.html \
|
||||
ares_save_options.html \
|
||||
@@ -129,6 +139,7 @@ PDFPAGES = ares_cancel.pdf \
|
||||
ares_expand_name.pdf \
|
||||
ares_expand_string.pdf \
|
||||
ares_fds.pdf \
|
||||
ares_free_data.pdf \
|
||||
ares_free_hostent.pdf \
|
||||
ares_free_string.pdf \
|
||||
ares_gethostbyaddr.pdf \
|
||||
@@ -145,6 +156,8 @@ PDFPAGES = ares_cancel.pdf \
|
||||
ares_parse_aaaa_reply.pdf \
|
||||
ares_parse_ns_reply.pdf \
|
||||
ares_parse_ptr_reply.pdf \
|
||||
ares_parse_srv_reply.pdf \
|
||||
ares_parse_txt_reply.pdf \
|
||||
ares_process.pdf \
|
||||
ares_query.pdf \
|
||||
ares_save_options.pdf \
|
||||
@@ -155,3 +168,12 @@ PDFPAGES = ares_cancel.pdf \
|
||||
ares_timeout.pdf \
|
||||
ares_version.pdf
|
||||
|
||||
SAMPLESOURCES = ares_getopt.c \
|
||||
ares_strcasecmp.c \
|
||||
inet_net_pton.c \
|
||||
inet_ntop.c
|
||||
|
||||
SAMPLEHEADERS = ares_getopt.h \
|
||||
ares_strcasecmp.h \
|
||||
inet_net_pton.h \
|
||||
inet_ntop.h
|
||||
|
473
ares/Makefile.msvc
Normal file
473
ares/Makefile.msvc
Normal file
@@ -0,0 +1,473 @@
|
||||
# $Id$
|
||||
|
||||
# Copyright (C) 2009 by Daniel Stenberg
|
||||
#
|
||||
# Permission to use, copy, modify, and distribute this
|
||||
# software and its documentation for any purpose and without
|
||||
# fee is hereby granted, provided that the above copyright
|
||||
# notice appear in all copies and that both that copyright
|
||||
# notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in
|
||||
# advertising or publicity pertaining to distribution of the
|
||||
# software without specific, written prior permission.
|
||||
# M.I.T. makes no representations about the suitability of
|
||||
# this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
#
|
||||
# Makefile for building c-ares libraries and sample programs with MSVC.
|
||||
#
|
||||
# Usage: nmake /f makefile.msvc CFG=<config> <target>
|
||||
#
|
||||
# <config> must be one of: [ lib-release | lib-debug | dll-release | dll-debug }
|
||||
# <target> must be one of: [ ALL | c-ares | acountry | adig | ahost | clean }
|
||||
#
|
||||
# If a <target> other than ALL or clean is given, <config> becomes mandatory.
|
||||
#
|
||||
# If neither <config> nor <target> are specified this results in
|
||||
# all targets being built for all <config> c-ares library types.
|
||||
#
|
||||
# This makefile must be processed from the subdir where it is located.
|
||||
#
|
||||
# All results are generated below a subdirectory named msvcXXX.
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
NAME = cares
|
||||
|
||||
# ------------------------------------------------
|
||||
# c-ares static and dynamic libraries common base
|
||||
# file names for release and debug configurations
|
||||
# ------------------------------------------------
|
||||
|
||||
STA_LIB_REL = lib$(NAME)
|
||||
DYN_LIB_REL = $(NAME)
|
||||
STA_LIB_DBG = $(STA_LIB_REL)d
|
||||
DYN_LIB_DBG = $(DYN_LIB_REL)d
|
||||
|
||||
# -------------------------------------------
|
||||
# Base names for c-ares DLL import libraries
|
||||
# -------------------------------------------
|
||||
|
||||
IMP_LIB_REL = $(DYN_LIB_REL)
|
||||
IMP_LIB_DBG = $(DYN_LIB_DBG)
|
||||
|
||||
# --------------------------
|
||||
# Runtime library selection
|
||||
# --------------------------
|
||||
|
||||
RTLIB = /MD
|
||||
RTLIBD = /MDd
|
||||
|
||||
!IF "$(RTLIBCFG)" == "static"
|
||||
RTLIB = /MT
|
||||
RTLIBD = /MTd
|
||||
!ENDIF
|
||||
|
||||
# --------------------------------------------------------
|
||||
# Define USE_WATT32 to 1 to use the Watt-32 tcp/ip stack,
|
||||
# otherwise Winsock tcp/ip stack will be used as default.
|
||||
# --------------------------------------------------------
|
||||
|
||||
USE_WATT32 = 0
|
||||
|
||||
# -------------------------------------------
|
||||
# Detect NMAKE version deducing MSVC version
|
||||
# -------------------------------------------
|
||||
|
||||
!IFNDEF _NMAKE_VER
|
||||
! MESSAGE Macro _NMAKE_VER not defined.
|
||||
! MESSAGE Use MSVC's NMAKE to process this makefile.
|
||||
! ERROR See previous message.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(_NMAKE_VER)" == "6.00.8168.0"
|
||||
CC_VERS_NUM = 60
|
||||
!ELSEIF "$(_NMAKE_VER)" == "6.00.9782.0"
|
||||
CC_VERS_NUM = 60
|
||||
!ELSEIF "$(_NMAKE_VER)" == "7.00.9466"
|
||||
CC_VERS_NUM = 70
|
||||
!ELSEIF "$(_NMAKE_VER)" == "7.00.9955"
|
||||
CC_VERS_NUM = 70
|
||||
!ELSEIF "$(_NMAKE_VER)" == "7.10.3077"
|
||||
CC_VERS_NUM = 71
|
||||
!ELSEIF "$(_NMAKE_VER)" == "8.00.40607.16"
|
||||
CC_VERS_NUM = 80
|
||||
!ELSEIF "$(_NMAKE_VER)" == "8.00.50727.42"
|
||||
CC_VERS_NUM = 80
|
||||
!ELSEIF "$(_NMAKE_VER)" == "8.00.50727.762"
|
||||
CC_VERS_NUM = 80
|
||||
!ELSEIF "$(_NMAKE_VER)" == "9.00.21022.08"
|
||||
CC_VERS_NUM = 90
|
||||
!ELSEIF "$(_NMAKE_VER)" == "9.00.30729.01"
|
||||
CC_VERS_NUM = 90
|
||||
!ELSEIF "$(_NMAKE_VER)" == "10.00.20506.01"
|
||||
CC_VERS_NUM = 100
|
||||
!ELSE
|
||||
! MESSAGE Unknown value for _NMAKE_VER macro: "$(_NMAKE_VER)"
|
||||
! MESSAGE Please, report this condition on the c-ares development
|
||||
! MESSAGE mailing list: http://cool.haxx.se/mailman/listinfo/c-ares/
|
||||
! ERROR See previous message.
|
||||
!ENDIF
|
||||
|
||||
CC_VERS_STR = msvc$(CC_VERS_NUM)
|
||||
|
||||
# ----------------------------------------------------
|
||||
# Verify that current subdir is the c-ares source one
|
||||
# ----------------------------------------------------
|
||||
|
||||
!IF ! EXIST(.\ares_init.c)
|
||||
! MESSAGE Can not process Makefile.msvc from outside of c-ares source subdirectory.
|
||||
! MESSAGE Change to the subdirectory where Makefile.msvc is found, and try again.
|
||||
! ERROR See previous message.
|
||||
!ENDIF
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Base subdir is the common root from which other subdirs will hang,
|
||||
# the name depends on MSVC version being used when building c-ares.
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
BASE_DIR = .\$(CC_VERS_STR)
|
||||
|
||||
# ----------------------------------------
|
||||
# Subdir holding sources for all projects
|
||||
# ----------------------------------------
|
||||
|
||||
SRCDIR = .
|
||||
|
||||
# -------------------------
|
||||
# Configuration validation
|
||||
# -------------------------
|
||||
|
||||
VALID_CFGSET = FALSE
|
||||
!IF "$(CFG)" == "lib-release" || "$(CFG)" == "lib-debug" || \
|
||||
"$(CFG)" == "dll-release" || "$(CFG)" == "dll-debug"
|
||||
VALID_CFGSET = TRUE
|
||||
!ENDIF
|
||||
|
||||
!IF "$(VALID_CFGSET)" == "FALSE" && "$(CFG)" != ""
|
||||
! MESSAGE MSVC c-ares makefile
|
||||
! MESSAGE
|
||||
! MESSAGE Usage: nmake /f makefile.msvc CFG=<config> <target>
|
||||
! MESSAGE
|
||||
! MESSAGE <config> must be one of: [ lib-release | lib-debug | dll-release | dll-debug }
|
||||
! MESSAGE <target> must be one of: [ ALL | c-ares | acountry | adig | ahost | clean }
|
||||
! MESSAGE
|
||||
! MESSAGE If a <target> other than ALL or clean is given, <config> becomes mandatory.
|
||||
! MESSAGE
|
||||
! MESSAGE If neither <config> nor <target> are specified this results in
|
||||
! MESSAGE all targets being built for all <config> c-ares library types.
|
||||
! MESSAGE
|
||||
! ERROR Choose a valid configuration.
|
||||
!ENDIF
|
||||
|
||||
# --------------------------------------------------------
|
||||
# Project subdirs independent of configuration being used
|
||||
# --------------------------------------------------------
|
||||
|
||||
CARES_DIR = $(BASE_DIR)\cares
|
||||
PROG1_DIR = $(BASE_DIR)\acountry
|
||||
PROG2_DIR = $(BASE_DIR)\adig
|
||||
PROG3_DIR = $(BASE_DIR)\ahost
|
||||
|
||||
# ---------------------------------------------------
|
||||
# Subdirs which are configuration dependent are only
|
||||
# defined when a valid configuration has been given.
|
||||
# ---------------------------------------------------
|
||||
|
||||
!IF "$(VALID_CFGSET)" == "TRUE"
|
||||
CARES_OUTDIR = $(CARES_DIR)\$(CFG)
|
||||
PROG1_OUTDIR = $(PROG1_DIR)\$(CFG)
|
||||
PROG2_OUTDIR = $(PROG2_DIR)\$(CFG)
|
||||
PROG3_OUTDIR = $(PROG3_DIR)\$(CFG)
|
||||
CARES_OBJDIR = $(CARES_OUTDIR)\obj
|
||||
PROG1_OBJDIR = $(PROG1_OUTDIR)\obj
|
||||
PROG2_OBJDIR = $(PROG2_OUTDIR)\obj
|
||||
PROG3_OBJDIR = $(PROG3_OUTDIR)\obj
|
||||
!ELSE
|
||||
!UNDEF CARES_OUTDIR
|
||||
!UNDEF PROG1_OUTDIR
|
||||
!UNDEF PROG2_OUTDIR
|
||||
!UNDEF PROG3_OUTDIR
|
||||
!UNDEF CARES_OBJDIR
|
||||
!UNDEF PROG1_OBJDIR
|
||||
!UNDEF PROG2_OBJDIR
|
||||
!UNDEF PROG3_OBJDIR
|
||||
!ENDIF
|
||||
|
||||
# -------------------------------------
|
||||
# Settings that depend on tcp/ip stack
|
||||
# -------------------------------------
|
||||
|
||||
!IF "$(USE_WATT32)" == "1"
|
||||
CFLAGS = /UWIN32 /DWATT32 /I$(WATT_ROOT)\inc
|
||||
EX_LIBS_REL = $(WATT_ROOT)\lib\wattcpvc_imp.lib
|
||||
EX_LIBS_DBG = $(WATT_ROOT)\lib\wattcpvc_imp_d.lib
|
||||
!ELSE
|
||||
CFLAGS = /DWIN32
|
||||
EX_LIBS_REL = ws2_32.lib advapi32.lib kernel32.lib
|
||||
EX_LIBS_DBG = ws2_32.lib advapi32.lib kernel32.lib
|
||||
!ENDIF
|
||||
|
||||
# -----------------------------------------
|
||||
# Switches that depend on compiler version
|
||||
# -----------------------------------------
|
||||
|
||||
!IF $(CC_VERS_NUM) == 60
|
||||
PDB_NONE = /pdb:none
|
||||
PDBTYPE_CONSOLIDATE = /pdbtype:consolidate
|
||||
!ELSE
|
||||
!UNDEF PDB_NONE
|
||||
!UNDEF PDBTYPE_CONSOLIDATE
|
||||
!ENDIF
|
||||
|
||||
!IF $(CC_VERS_NUM) <= 70
|
||||
RT_ERROR_CHECKING = /GZ
|
||||
!ELSE
|
||||
RT_ERROR_CHECKING = /RTCsu
|
||||
!ENDIF
|
||||
|
||||
# ----------------------------
|
||||
# Assorted commands and flags
|
||||
# ----------------------------
|
||||
|
||||
CC_CMD_REL = cl.exe /nologo $(RTLIB) /DNDEBUG /O2
|
||||
CC_CMD_DBG = cl.exe /nologo $(RTLIBD) /D_DEBUG /Od /Zi $(RT_ERROR_CHECKING)
|
||||
CC_CFLAGS = $(CFLAGS) /I. /W3 /EHsc /FD
|
||||
|
||||
RC_CMD_REL = rc.exe /l 0x409 /d "NDEBUG"
|
||||
RC_CMD_DBG = rc.exe /l 0x409 /d "_DEBUG"
|
||||
|
||||
LINK_CMD_LIB = link.exe /lib /nologo
|
||||
LINK_CMD_DLL = link.exe /dll /nologo /incremental:no /fixed:no
|
||||
LINK_CMD_EXE = link.exe /nologo /incremental:no /fixed:no /subsystem:console
|
||||
|
||||
LINK_CMD_EXE_REL = $(LINK_CMD_EXE) /release $(PDB_NONE)
|
||||
LINK_CMD_EXE_DBG = $(LINK_CMD_EXE) /debug $(PDBTYPE_CONSOLIDATE)
|
||||
|
||||
# ---------------------------------
|
||||
# Configuration dependent settings
|
||||
# ---------------------------------
|
||||
|
||||
!IF "$(CFG)" == "lib-release"
|
||||
CARES_TARGET = $(STA_LIB_REL).lib
|
||||
CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB
|
||||
CARES_LFLAGS =
|
||||
SPROG_CFLAGS = /DCARES_STATICLIB
|
||||
SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS_REL) $(STA_LIB_REL).lib
|
||||
CARES_LINK = $(LINK_CMD_LIB)
|
||||
SPROG_LINK = $(LINK_CMD_EXE_REL)
|
||||
CC_CMD = $(CC_CMD_REL)
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "lib-debug"
|
||||
CARES_TARGET = $(STA_LIB_DBG).lib
|
||||
CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DCARES_STATICLIB /DDEBUGBUILD
|
||||
CARES_LFLAGS =
|
||||
SPROG_CFLAGS = /DCARES_STATICLIB
|
||||
SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS_DBG) $(STA_LIB_DBG).lib
|
||||
CARES_LINK = $(LINK_CMD_LIB)
|
||||
SPROG_LINK = $(LINK_CMD_EXE_DBG)
|
||||
CC_CMD = $(CC_CMD_DBG)
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "dll-release"
|
||||
CARES_TARGET = $(DYN_LIB_REL).dll
|
||||
CARES_CFLAGS = /DCARES_BUILDING_LIBRARY
|
||||
CARES_LFLAGS = /release $(EX_LIBS_REL) /implib:$(CARES_OUTDIR)\$(IMP_LIB_REL).lib $(PDB_NONE)
|
||||
SPROG_CFLAGS =
|
||||
SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS_REL) $(IMP_LIB_REL).lib
|
||||
CARES_LINK = $(LINK_CMD_DLL)
|
||||
SPROG_LINK = $(LINK_CMD_EXE_REL)
|
||||
CC_CMD = $(CC_CMD_REL)
|
||||
USE_RES_FILE = TRUE
|
||||
RC_CMD = $(RC_CMD_REL)
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "dll-debug"
|
||||
CARES_TARGET = $(DYN_LIB_DBG).dll
|
||||
CARES_CFLAGS = /DCARES_BUILDING_LIBRARY /DDEBUGBUILD
|
||||
CARES_LFLAGS = /debug $(EX_LIBS_DBG) /implib:$(CARES_OUTDIR)\$(IMP_LIB_DBG).lib /pdb:$(CARES_OUTDIR)\$(DYN_LIB_DBG).pdb $(PDBTYPE_CONSOLIDATE)
|
||||
SPROG_CFLAGS =
|
||||
SPROG_LFLAGS = /libpath:$(CARES_OUTDIR) $(EX_LIBS_DBG) $(IMP_LIB_DBG).lib
|
||||
CARES_LINK = $(LINK_CMD_DLL)
|
||||
SPROG_LINK = $(LINK_CMD_EXE_DBG)
|
||||
CC_CMD = $(CC_CMD_DBG)
|
||||
USE_RES_FILE = TRUE
|
||||
RC_CMD = $(RC_CMD_DBG)
|
||||
!ENDIF
|
||||
|
||||
# --------------------------------------------
|
||||
# Makefile.inc provides lists of source files
|
||||
# --------------------------------------------
|
||||
|
||||
!INCLUDE .\Makefile.inc
|
||||
|
||||
# ----------------------------
|
||||
# Build lists of object files
|
||||
# ----------------------------
|
||||
|
||||
!IF "$(VALID_CFGSET)" == "TRUE"
|
||||
|
||||
!IF [ECHO CARES_OBJS=^$(CARES_OBJDIR)\$(CSOURCES: = $(CARES_OBJDIR^)\) > .\cares_objs.inc] == 0
|
||||
!INCLUDE .\cares_objs.inc
|
||||
!IF [DEL .\cares_objs.inc]
|
||||
!ENDIF
|
||||
!ELSE
|
||||
!ERROR Problem generating CARES_OBJS list.
|
||||
!ENDIF
|
||||
CARES_OBJS = $(CARES_OBJS:.c=.obj)
|
||||
!IF "$(USE_RES_FILE)" == "TRUE"
|
||||
CARES_OBJS = $(CARES_OBJS) $(CARES_OBJDIR)\cares.res
|
||||
!ENDIF
|
||||
|
||||
!IF [ECHO PROG1_OBJS=^$(PROG1_OBJDIR)\$(SAMPLESOURCES: = $(PROG1_OBJDIR^)\) > .\prog1_objs.inc] == 0
|
||||
!INCLUDE .\prog1_objs.inc
|
||||
!IF [DEL .\prog1_objs.inc]
|
||||
!ENDIF
|
||||
!ELSE
|
||||
!ERROR Problem generating PROG1_OBJS list.
|
||||
!ENDIF
|
||||
PROG1_OBJS = $(PROG1_OBJS:.c=.obj)
|
||||
PROG1_OBJS = $(PROG1_OBJS) $(PROG1_OBJDIR)\acountry.obj
|
||||
|
||||
!IF [ECHO PROG2_OBJS=^$(PROG2_OBJDIR)\$(SAMPLESOURCES: = $(PROG2_OBJDIR^)\) > .\prog2_objs.inc] == 0
|
||||
!INCLUDE .\prog2_objs.inc
|
||||
!IF [DEL .\prog2_objs.inc]
|
||||
!ENDIF
|
||||
!ELSE
|
||||
!ERROR Problem generating PROG2_OBJS list.
|
||||
!ENDIF
|
||||
PROG2_OBJS = $(PROG2_OBJS:.c=.obj)
|
||||
PROG2_OBJS = $(PROG2_OBJS) $(PROG2_OBJDIR)\adig.obj
|
||||
|
||||
!IF [ECHO PROG3_OBJS=^$(PROG3_OBJDIR)\$(SAMPLESOURCES: = $(PROG3_OBJDIR^)\) > .\prog3_objs.inc] == 0
|
||||
!INCLUDE .\prog3_objs.inc
|
||||
!IF [DEL .\prog3_objs.inc]
|
||||
!ENDIF
|
||||
!ELSE
|
||||
!ERROR Problem generating PROG3_OBJS list.
|
||||
!ENDIF
|
||||
PROG3_OBJS = $(PROG3_OBJS:.c=.obj)
|
||||
PROG3_OBJS = $(PROG3_OBJS) $(PROG3_OBJDIR)\ahost.obj
|
||||
|
||||
!ENDIF
|
||||
|
||||
# --------------------------------
|
||||
# Only our custom inference rules
|
||||
# --------------------------------
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .rc
|
||||
|
||||
{$(SRCDIR)}.rc{$(CARES_OBJDIR)}.res:
|
||||
$(RC_CMD) /Fo $@ $<
|
||||
|
||||
{$(SRCDIR)}.c{$(CARES_OBJDIR)}.obj:
|
||||
$(CC_CMD) $(CC_CFLAGS) $(CARES_CFLAGS) /Fo$@ /Fd$(@D)\ /c $<
|
||||
|
||||
{$(SRCDIR)}.c{$(PROG1_OBJDIR)}.obj:
|
||||
$(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$@ /Fd$(@D)\ /c $<
|
||||
|
||||
{$(SRCDIR)}.c{$(PROG2_OBJDIR)}.obj:
|
||||
$(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$@ /Fd$(@D)\ /c $<
|
||||
|
||||
{$(SRCDIR)}.c{$(PROG3_OBJDIR)}.obj:
|
||||
$(CC_CMD) $(CC_CFLAGS) $(SPROG_CFLAGS) /Fo$@ /Fd$(@D)\ /c $<
|
||||
|
||||
# ------------------------------------------------------------- #
|
||||
# ------------------------------------------------------------- #
|
||||
# Default target when no CFG library type has been specified, #
|
||||
# results in building target ALL for all c-ares library types. #
|
||||
# ------------------------------------------------------------- #
|
||||
# ------------------------------------------------------------- #
|
||||
|
||||
!IF "$(VALID_CFGSET)" == "FALSE"
|
||||
|
||||
ALL:
|
||||
$(MAKE) /f .\Makefile.msvc CFG=lib-release ALL
|
||||
$(MAKE) /f .\Makefile.msvc CFG=lib-debug ALL
|
||||
$(MAKE) /f .\Makefile.msvc CFG=dll-release ALL
|
||||
$(MAKE) /f .\Makefile.msvc CFG=dll-debug ALL
|
||||
|
||||
clean:
|
||||
@-RMDIR /S /Q $(BASE_DIR) >NUL 2>&1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Targets only available when a proper CFG library type has been given
|
||||
# ---------------------------------------------------------------------
|
||||
|
||||
!IF "$(VALID_CFGSET)" == "TRUE"
|
||||
|
||||
ALL: c-ares acountry adig ahost
|
||||
@
|
||||
|
||||
c-ares: $(HHEADERS) $(CSOURCES) $(CARES_OBJDIR) $(CARES_OBJS) $(CARES_OUTDIR)
|
||||
$(CARES_LINK) $(CARES_LFLAGS) /out:$(CARES_OUTDIR)\$(CARES_TARGET) $(CARES_OBJS)
|
||||
! IF "$(USE_RES_FILE)" == "TRUE"
|
||||
@if exist $(CARES_OUTDIR)\$(CARES_TARGET).manifest mt -nologo -manifest $(CARES_OUTDIR)\$(CARES_TARGET).manifest -outputresource:$(CARES_OUTDIR)\$(CARES_TARGET);2
|
||||
! ENDIF
|
||||
|
||||
acountry: c-ares acountry.c $(SAMPLESOURCES) $(SAMPLEHEADERS) $(PROG1_OBJDIR) $(PROG1_OBJS) $(PROG1_OUTDIR)
|
||||
$(SPROG_LINK) $(SPROG_LFLAGS) /out:$(PROG1_OUTDIR)\acountry.exe $(PROG1_OBJS)
|
||||
@if exist $(PROG1_OUTDIR)\acountry.exe.manifest mt -nologo -manifest $(PROG1_OUTDIR)\acountry.exe.manifest -outputresource:$(PROG1_OUTDIR)\acountry.exe;1
|
||||
|
||||
adig: c-ares adig.c $(SAMPLESOURCES) $(SAMPLEHEADERS) $(PROG2_OBJDIR) $(PROG2_OBJS) $(PROG2_OUTDIR)
|
||||
$(SPROG_LINK) $(SPROG_LFLAGS) /out:$(PROG2_OUTDIR)\adig.exe $(PROG2_OBJS)
|
||||
@if exist $(PROG2_OUTDIR)\adig.exe.manifest mt -nologo -manifest $(PROG2_OUTDIR)\adig.exe.manifest -outputresource:$(PROG2_OUTDIR)\adig.exe;1
|
||||
|
||||
ahost: c-ares ahost.c $(SAMPLESOURCES) $(SAMPLEHEADERS) $(PROG3_OBJDIR) $(PROG3_OBJS) $(PROG3_OUTDIR)
|
||||
$(SPROG_LINK) $(SPROG_LFLAGS) /out:$(PROG3_OUTDIR)\ahost.exe $(PROG3_OBJS)
|
||||
@if exist $(PROG3_OUTDIR)\ahost.exe.manifest mt -nologo -manifest $(PROG3_OUTDIR)\ahost.exe.manifest -outputresource:$(PROG3_OUTDIR)\ahost.exe;1
|
||||
|
||||
$(CARES_OUTDIR): $(CARES_DIR)
|
||||
@if not exist $(CARES_OUTDIR) mkdir $(CARES_OUTDIR)
|
||||
|
||||
$(PROG1_OUTDIR): $(PROG1_DIR)
|
||||
@if not exist $(PROG1_OUTDIR) mkdir $(PROG1_OUTDIR)
|
||||
|
||||
$(PROG2_OUTDIR): $(PROG2_DIR)
|
||||
@if not exist $(PROG2_OUTDIR) mkdir $(PROG2_OUTDIR)
|
||||
|
||||
$(PROG3_OUTDIR): $(PROG3_DIR)
|
||||
@if not exist $(PROG3_OUTDIR) mkdir $(PROG3_OUTDIR)
|
||||
|
||||
$(CARES_OBJDIR): $(CARES_OUTDIR)
|
||||
@if not exist $(CARES_OBJDIR) mkdir $(CARES_OBJDIR)
|
||||
|
||||
$(PROG1_OBJDIR): $(PROG1_OUTDIR)
|
||||
@if not exist $(PROG1_OBJDIR) mkdir $(PROG1_OBJDIR)
|
||||
|
||||
$(PROG2_OBJDIR): $(PROG2_OUTDIR)
|
||||
@if not exist $(PROG2_OBJDIR) mkdir $(PROG2_OBJDIR)
|
||||
|
||||
$(PROG3_OBJDIR): $(PROG3_OUTDIR)
|
||||
@if not exist $(PROG3_OBJDIR) mkdir $(PROG3_OBJDIR)
|
||||
|
||||
clean:
|
||||
@-RMDIR /S /Q $(CARES_OUTDIR) >NUL 2>&1
|
||||
@-RMDIR /S /Q $(PROG1_OUTDIR) >NUL 2>&1
|
||||
@-RMDIR /S /Q $(PROG2_OUTDIR) >NUL 2>&1
|
||||
@-RMDIR /S /Q $(PROG3_OUTDIR) >NUL 2>&1
|
||||
|
||||
!ENDIF
|
||||
|
||||
$(BASE_DIR):
|
||||
@if not exist $(BASE_DIR) mkdir $(BASE_DIR)
|
||||
|
||||
$(CARES_DIR): $(BASE_DIR)
|
||||
@if not exist $(CARES_DIR) mkdir $(CARES_DIR)
|
||||
|
||||
$(PROG1_DIR): $(BASE_DIR)
|
||||
@if not exist $(PROG1_DIR) mkdir $(PROG1_DIR)
|
||||
|
||||
$(PROG2_DIR): $(BASE_DIR)
|
||||
@if not exist $(PROG2_DIR) mkdir $(PROG2_DIR)
|
||||
|
||||
$(PROG3_DIR): $(BASE_DIR)
|
||||
@if not exist $(PROG3_DIR) mkdir $(PROG3_DIR)
|
||||
|
||||
# End of Makefile.msvc
|
@@ -1,274 +0,0 @@
|
||||
# $Id$
|
||||
#
|
||||
# C-ares makefile for MSVC6+
|
||||
# G. Vanem <giva@bgnett.no>.
|
||||
#
|
||||
|
||||
CFG_MODEL = MD
|
||||
DEBUG_MODEL = d
|
||||
USE_WATT32 = 0
|
||||
|
||||
#
|
||||
# Configurations:
|
||||
# -MD - msvcrt.dll, threads, release (normal)
|
||||
# -MDd - msvcrtd.dll, threads, debug
|
||||
# -ML - libc, no threads, release (not available on VC-2008+)
|
||||
# -MLd - libc, no threads, debug (not available on VC-2008+)
|
||||
# -MT - libc, threads, release
|
||||
# -MTd - libc, threads, debug
|
||||
|
||||
CC = cl
|
||||
|
||||
CFLAGS = -nologo -$(CFG_MODEL)$(DEBUG_MODEL) -W3 -Yd -Zi
|
||||
LDFLAGS = -machine:i386 -map
|
||||
|
||||
OBJ_DIR = VC6_obj
|
||||
DEF_FILE = cares.def
|
||||
|
||||
!if "$(USE_WATT32)" == "1"
|
||||
CFLAGS = $(CFLAGS) -UWIN32 -DWATT32 -I$(WATT_ROOT)\inc
|
||||
EX_LIBS = $(WATT_ROOT)\lib\wattcpvc_imp.lib
|
||||
|
||||
!else
|
||||
CFLAGS = $(CFLAGS) -DWIN32 -DWIN32_LEAN_AND_MEAN
|
||||
EX_LIBS = advapi32.lib ws2_32.lib
|
||||
!endif
|
||||
|
||||
!if "$(DEBUG_MODEL)" == "d"
|
||||
CFLAGS = $(CFLAGS) -DDEBUGBUILD -D_DEBUG -GZ
|
||||
LDFLAGS = $(LDFLAGS) -debug -fixed:no
|
||||
|
||||
!else
|
||||
CFLAGS = $(CFLAGS) -O2 -Og
|
||||
LDFLAGS = $(LDFLAGS) -release
|
||||
!endif
|
||||
|
||||
CFLAGS = $(CFLAGS) -I.\.
|
||||
|
||||
OBJECTS = $(OBJ_DIR)\ares_fds.obj \
|
||||
$(OBJ_DIR)\ares_process.obj \
|
||||
$(OBJ_DIR)\ares_free_hostent.obj \
|
||||
$(OBJ_DIR)\ares_query.obj \
|
||||
$(OBJ_DIR)\ares__close_sockets.obj \
|
||||
$(OBJ_DIR)\ares_free_string.obj \
|
||||
$(OBJ_DIR)\ares_search.obj \
|
||||
$(OBJ_DIR)\ares__get_hostent.obj \
|
||||
$(OBJ_DIR)\ares_gethostbyaddr.obj \
|
||||
$(OBJ_DIR)\ares_getsock.obj \
|
||||
$(OBJ_DIR)\ares_send.obj \
|
||||
$(OBJ_DIR)\ares__read_line.obj \
|
||||
$(OBJ_DIR)\ares_gethostbyname.obj \
|
||||
$(OBJ_DIR)\ares_getnameinfo.obj \
|
||||
$(OBJ_DIR)\ares_strcasecmp.obj \
|
||||
$(OBJ_DIR)\ares_strerror.obj \
|
||||
$(OBJ_DIR)\ares_cancel.obj \
|
||||
$(OBJ_DIR)\ares_init.obj \
|
||||
$(OBJ_DIR)\ares_library_init.obj \
|
||||
$(OBJ_DIR)\ares_llist.obj \
|
||||
$(OBJ_DIR)\ares_timeout.obj \
|
||||
$(OBJ_DIR)\ares__timeval.obj \
|
||||
$(OBJ_DIR)\ares_destroy.obj \
|
||||
$(OBJ_DIR)\ares_mkquery.obj \
|
||||
$(OBJ_DIR)\ares_version.obj \
|
||||
$(OBJ_DIR)\ares_expand_name.obj \
|
||||
$(OBJ_DIR)\ares_parse_a_reply.obj \
|
||||
$(OBJ_DIR)\ares_parse_aaaa_reply.obj \
|
||||
$(OBJ_DIR)\ares_parse_ns_reply.obj \
|
||||
$(OBJ_DIR)\windows_port.obj \
|
||||
$(OBJ_DIR)\ares_expand_string.obj \
|
||||
$(OBJ_DIR)\ares_parse_ptr_reply.obj \
|
||||
$(OBJ_DIR)\ares_writev.obj \
|
||||
$(OBJ_DIR)\bitncmp.obj \
|
||||
$(OBJ_DIR)\inet_net_pton.obj \
|
||||
$(OBJ_DIR)\inet_ntop.obj
|
||||
|
||||
all: $(OBJ_DIR) cares.lib cares.dll cares_imp.lib ahost.exe adig.exe acountry.exe
|
||||
@echo Welcome to c-ares library and examples
|
||||
|
||||
$(OBJ_DIR):
|
||||
mkdir $(OBJ_DIR)
|
||||
|
||||
cares.lib: $(OBJ_DIR) $(OBJECTS)
|
||||
lib -nologo -out:$@ $(OBJECTS)
|
||||
|
||||
cares_imp.lib cares.dll: $(OBJ_DIR) $(DEF_FILE) $(OBJECTS)
|
||||
link $(LDFLAGS) -dll -implib:cares_imp.lib -out:cares.dll \
|
||||
-def:$(DEF_FILE) $(OBJECTS) $(EX_LIBS)
|
||||
|
||||
$(DEF_FILE): $(OBJECTS) Makefile.VC6
|
||||
@echo ; Generated. DO NOT EDIT > $@
|
||||
@echo LIBRARY cares.dll >> $@
|
||||
@echo EXPORTS >> $@
|
||||
@echo ares_cancel >> $@
|
||||
@echo ares_destroy >> $@
|
||||
@echo ares_expand_name >> $@
|
||||
@echo ares_expand_string >> $@
|
||||
@echo ares_fds >> $@
|
||||
@echo ares_free_hostent >> $@
|
||||
@echo ares_free_string >> $@
|
||||
@echo ares_gethostbyaddr >> $@
|
||||
@echo ares_gethostbyname >> $@
|
||||
@echo ares_getsock >> $@
|
||||
@echo ares_init >> $@
|
||||
@echo ares_init_options >> $@
|
||||
@echo ares_library_init >> $@
|
||||
@echo ares_library_cleanup >> $@
|
||||
@echo ares_mkquery >> $@
|
||||
@echo ares_parse_a_reply >> $@
|
||||
@echo ares_parse_ptr_reply >> $@
|
||||
@echo ares_parse_ns_reply >> $@
|
||||
@echo ares_process >> $@
|
||||
@echo ares_process_fd >> $@
|
||||
@echo ares_query >> $@
|
||||
@echo ares_search >> $@
|
||||
@echo ares_strerror >> $@
|
||||
@echo ares_strncasecmp >> $@
|
||||
@echo ares_strcasecmp >> $@
|
||||
@echo ares_timeout >> $@
|
||||
@echo ares_version >> $@
|
||||
@echo ares_inet_net_pton >> $@
|
||||
@echo ares_inet_ntop >> $@
|
||||
@echo ares_inet_pton >> $@
|
||||
@echo ares_getnameinfo >> $@
|
||||
@echo ares_parse_aaaa_reply >> $@
|
||||
!if "$(USE_WATT32)" == "0"
|
||||
@echo ares_writev >> $@
|
||||
!endif
|
||||
|
||||
ahost.exe: $(OBJ_DIR) $(OBJ_DIR)\ahost.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib
|
||||
link $(LDFLAGS) -out:$@ $(OBJ_DIR)\ahost.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib $(EX_LIBS)
|
||||
|
||||
adig.exe: $(OBJ_DIR) $(OBJ_DIR)\adig.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib
|
||||
link $(LDFLAGS) -out:$@ $(OBJ_DIR)\adig.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib $(EX_LIBS)
|
||||
|
||||
acountry.exe: $(OBJ_DIR) $(OBJ_DIR)\acountry.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib
|
||||
link $(LDFLAGS) -out:$@ $(OBJ_DIR)\acountry.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib $(EX_LIBS)
|
||||
|
||||
clean:
|
||||
- del $(OBJ_DIR)\*.obj *.ilk *.pdb *.pbt *.pbi *.pbo *._xe *.map
|
||||
|
||||
vclean realclean: clean
|
||||
- del $(DEF_FILE) cares.lib cares_imp.* cares.dll
|
||||
- del ahost.exe adig.exe acountry.exe
|
||||
- rd $(OBJ_DIR)
|
||||
|
||||
.c{$(OBJ_DIR)}.obj:
|
||||
$(CC) $(CFLAGS) -Fo$*.obj -c $<
|
||||
|
||||
#
|
||||
# Copyright "gcc -MM .."
|
||||
#
|
||||
$(OBJ_DIR)\ares_fds.obj: ares_fds.c setup.h setup_once.h ares.h ares_private.h \
|
||||
ares_ipv6.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_process.obj: ares_process.c setup.h setup_once.h nameser.h \
|
||||
ares.h ares_dns.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_free_hostent.obj: ares_free_hostent.c setup.h setup_once.h \
|
||||
ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_query.obj: ares_query.c setup.h setup_once.h nameser.h \
|
||||
ares.h ares_dns.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares__close_sockets.obj: ares__close_sockets.c setup.h setup_once.h \
|
||||
ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_free_string.obj: ares_free_string.c setup.h setup_once.h \
|
||||
ares.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_search.obj: ares_search.c setup.h setup_once.h nameser.h \
|
||||
ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares__get_hostent.obj: ares__get_hostent.c setup.h setup_once.h \
|
||||
ares.h ares_private.h ares_ipv6.h inet_net_pton.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_gethostbyaddr.obj: ares_gethostbyaddr.c setup.h setup_once.h \
|
||||
nameser.h ares.h ares_private.h ares_ipv6.h inet_net_pton.h ares_build.h \
|
||||
ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_send.obj: ares_send.c setup.h setup_once.h nameser.h ares.h \
|
||||
ares_dns.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares__read_line.obj: ares__read_line.c setup.h setup_once.h ares.h \
|
||||
ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_gethostbyname.obj: ares_gethostbyname.c setup.h setup_once.h \
|
||||
nameser.h ares.h ares_private.h ares_ipv6.h inet_net_pton.h bitncmp.h \
|
||||
ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_strcasecmp.obj: ares_strcasecmp.c setup.h setup_once.h ares.h \
|
||||
ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_strerror.obj: ares_strerror.c setup.h setup_once.h ares.h \
|
||||
ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_cancel.obj: ares_cancel.c setup.h setup_once.h ares.h \
|
||||
ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_init.obj: ares_init.c setup.h setup_once.h nameser.h ares.h \
|
||||
ares_private.h ares_ipv6.h inet_net_pton.h ares_build.h ares_rules.h \
|
||||
ares_library_init.h
|
||||
|
||||
$(OBJ_DIR)\ares_timeout.obj: ares_timeout.c setup.h setup_once.h ares.h \
|
||||
ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares__timeval.obj: ares__timeval.c setup.h setup_once.h ares.h \
|
||||
ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_destroy.obj: ares_destroy.c setup.h setup_once.h ares.h \
|
||||
ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_mkquery.obj: ares_mkquery.c setup.h setup_once.h nameser.h \
|
||||
ares.h ares_dns.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_version.obj: ares_version.c setup.h setup_once.h ares.h \
|
||||
ares_version.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_expand_name.obj: ares_expand_name.c setup.h setup_once.h \
|
||||
nameser.h ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_parse_a_reply.obj: ares_parse_a_reply.c setup.h setup_once.h \
|
||||
nameser.h ares.h ares_dns.h ares_private.h ares_ipv6.h ares_build.h \
|
||||
ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\windows_port.obj: windows_port.c setup.h setup_once.h nameser.h \
|
||||
ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_expand_string.obj: ares_expand_string.c setup.h setup_once.h \
|
||||
nameser.h ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_parse_ptr_reply.obj: ares_parse_ptr_reply.c setup.h \
|
||||
setup_once.h nameser.h ares.h ares_dns.h ares_private.h ares_ipv6.h \
|
||||
ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_parse_aaaa_reply.obj: ares_parse_aaaa_reply.c setup.h \
|
||||
setup_once.h nameser.h ares.h ares_dns.h inet_net_pton.h ares_private.h \
|
||||
ares_ipv6.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_parse_ns_reply.obj: ares_parse_ns_reply.c setup.h \
|
||||
setup_once.h nameser.h ares.h ares_dns.h ares_private.h ares_ipv6.h \
|
||||
ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_getnameinfo.obj: ares_getnameinfo.c setup.h setup_once.h \
|
||||
nameser.h ares.h ares_private.h ares_ipv6.h inet_ntop.h ares_build.h \
|
||||
ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\inet_net_pton.obj: inet_net_pton.c setup.h setup_once.h nameser.h \
|
||||
ares_ipv6.h inet_net_pton.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\bitncmp.obj: bitncmp.c bitncmp.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\inet_ntop.obj: inet_ntop.c setup.h setup_once.h nameser.h \
|
||||
ares_ipv6.h inet_ntop.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_getopt.obj: ares_getopt.c ares_getopt.h ares_build.h \
|
||||
ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_library_init.obj: ares_library_init.c setup.h setup_once.h \
|
||||
ares.h ares_private.h ares_library_init.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_llist.obj: ares_llist.c setup.h setup_once.h ares.h \
|
||||
ares_private.h ares_llist.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_writev.obj: ares_writev.c setup.h setup_once.h ares.h \
|
||||
ares_writev.h ares_build.h ares_rules.h
|
@@ -27,7 +27,7 @@ You'll find all c-ares details and news here:
|
||||
|
||||
NOTES FOR C-ARES HACKERS
|
||||
|
||||
The following notes apply to c-ares version 1.6.1 and later.
|
||||
The following notes apply to c-ares version 1.7.0 and later.
|
||||
|
||||
* The distributed ares_build.h file is only intended to be used on systems
|
||||
which can not run the also distributed configure script.
|
||||
@@ -50,7 +50,7 @@ The following notes apply to c-ares version 1.6.1 and later.
|
||||
the library that you have built. It is _your_ responsability to provide this
|
||||
file. No one at the c-ares project can know how you have built the library.
|
||||
|
||||
* File ares_build.h includes platform and configuration dependant info,
|
||||
* File ares_build.h includes platform and configuration dependent info,
|
||||
and must not be modified by anyone. Configure script generates it for you.
|
||||
|
||||
* We cannot assume anything else but very basic compiler features being
|
||||
|
119
ares/README.msvc
Normal file
119
ares/README.msvc
Normal file
@@ -0,0 +1,119 @@
|
||||
$Id$
|
||||
|
||||
|
||||
___ __ _ _ __ ___ ___
|
||||
/ __| ___ / _` | '__/ _ \/ __|
|
||||
| (_ |___| (_| | | | __/\__ \
|
||||
\___| \__,_|_| \___||___/
|
||||
|
||||
|
||||
How to build c-ares using MSVC or Visual Studio
|
||||
=================================================
|
||||
|
||||
|
||||
|
||||
How to build using MSVC from the command line
|
||||
---------------------------------------------
|
||||
|
||||
Open a command prompt window and ensure that the environment is properly
|
||||
set up in order to use MSVC or Visual Studio compiler tools.
|
||||
|
||||
Change to c-ares source folder where Makefile.msvc file is located and run:
|
||||
|
||||
> nmake -f Makefile.msvc
|
||||
|
||||
This will build all c-ares libraries as well as three sample programs.
|
||||
|
||||
Once the above command has finished a new folder named MSVCXX will exist
|
||||
below the folder where makefile.msvc is found. The name of the folder
|
||||
depends on the MSVC compiler version being used to build c-ares.
|
||||
|
||||
Below the MSVCXX folder there will exist four folders named 'cares',
|
||||
'ahost', 'acountry', and 'adig'. The 'cares' folder is the one that
|
||||
holds the c-ares libraries you have just generated, the other three
|
||||
hold sample programs that use the libraries.
|
||||
|
||||
The above command builds four versions of the c-ares library, dynamic
|
||||
and static versions and each one in release and debug flavours. Each
|
||||
of these is found in folders named dll-release, dll-debug, lib-release,
|
||||
and lib-debug, which hang from the 'cares' folder mentioned above. Each
|
||||
sample program also has folders with the same names to reflect which
|
||||
library version it is using.
|
||||
|
||||
|
||||
How to build using Visual Studio 6 IDE
|
||||
--------------------------------------
|
||||
|
||||
A VC++ 6.0 reference workspace (vc6aws.dsw) is available within the 'vc'
|
||||
folder to allow proper building of the library and sample programs.
|
||||
|
||||
1) Open the vc6aws.dsw workspace with MSVC6's IDE.
|
||||
2) Select 'Build' from top menu.
|
||||
3) Select 'Batch Build' from dropdown menu.
|
||||
4) Make sure that the sixteen project configurations are 'checked'.
|
||||
5) Click on the 'Build' button.
|
||||
6) Once the sixteen project configurations are built you are done.
|
||||
|
||||
Dynamic and static c-ares libraries are built in debug and release flavours,
|
||||
and can be located each one in its own subdirectory, dll-debug, dll-release,
|
||||
lib-debug and lib-release, all of them below the 'vc\cares' subdirectory.
|
||||
|
||||
In the same way four executable versions of each sample program are built,
|
||||
each using its respective library. The resulting sample executables are
|
||||
located in its own subdirectory, dll-debug, dll-release, lib-debug and
|
||||
lib-release, below the 'vc\acountry', 'vc\adig' and 'vc\ahost'folders.
|
||||
|
||||
These reference VC++ 6.0 configurations are generated using the dynamic CRT.
|
||||
|
||||
|
||||
How to build using Visual Studio 2003 or newer IDE
|
||||
--------------------------------------------------
|
||||
|
||||
First you have to convert the VC++ 6.0 reference workspace and project files
|
||||
to the Visual Studio IDE version you are using, following next steps:
|
||||
|
||||
1) Open vc\vc6aws.dsw with VS20XX.
|
||||
2) Allow VS20XX to update all projects and workspaces.
|
||||
3) Save ALL and close VS20XX.
|
||||
4) Open vc\vc6aws.sln with VS20XX.
|
||||
5) Select batch build, check 'all' projects and click 'build' button.
|
||||
|
||||
Same comments relative to generated files and folders as done above for
|
||||
Visual Studio 6 IDE apply here.
|
||||
|
||||
|
||||
Relationship between c-ares library file names and versions
|
||||
-----------------------------------------------------------
|
||||
|
||||
c-ares static release library version files:
|
||||
|
||||
libcares.lib -> static release library
|
||||
|
||||
c-ares static debug library version files:
|
||||
|
||||
libcaresd.lib -> static debug library
|
||||
|
||||
c-ares dynamic release library version files:
|
||||
|
||||
cares.dll -> dynamic release library
|
||||
cares.lib -> import library for the dynamic release library
|
||||
cares.exp -> export file for the dynamic release library
|
||||
|
||||
c-ares dynamic debug library version files:
|
||||
|
||||
caresd.dll -> dynamic debug library
|
||||
caresd.lib -> import library for the dynamic debug library
|
||||
caresd.exp -> export file for the dynamic debug library
|
||||
caresd.pdb -> debug symbol file for the dynamic debug library
|
||||
|
||||
|
||||
How to use c-ares static libraries
|
||||
----------------------------------
|
||||
|
||||
When using the c-ares static library in your program, you will have to
|
||||
define preprocessor symbol CARES_STATICLIB while building your program,
|
||||
otherwise you will get errors at linkage stage.
|
||||
|
||||
|
||||
Have Fun!
|
||||
|
@@ -1,27 +1,17 @@
|
||||
This is what's new and changed in the c-ares 1.6.1 release:
|
||||
This is what's new and changed in the c-ares 1.7.1 release:
|
||||
|
||||
Changed:
|
||||
|
||||
o in6_addr is not used in ares.h anymore, but a private ares_in6_addr is
|
||||
instead declared and used
|
||||
o ares_gethostbyname() now supports 'AF_UNSPEC' as a family for resolving
|
||||
either AF_INET6 or AF_INET
|
||||
o a build-time configured ares_socklen_t is now used instead of socklen_t
|
||||
o new ares_library_init() and ares_library_cleanup() functions
|
||||
o new --enable-curldebug configure option
|
||||
o ARES_ECANCELLED is now sent as reason for ares_cancel()
|
||||
o
|
||||
|
||||
Fixed:
|
||||
|
||||
o ares_parse_*_reply() functions now return ARES_EBADRESP instead of
|
||||
ARES_EBADNAME if the name in the response failed to decode
|
||||
o only expose/export symbols starting with 'ares_'
|
||||
o fix \Device\TCP handle leaks triggered by buggy iphlpapi.dll
|
||||
o init without internet gone no longer fails
|
||||
o closing of sockets on Windows systems
|
||||
o MSVC deprecated compiler options warnings
|
||||
o ares_process_fd() didn't check broken connections
|
||||
|
||||
Thanks go to these friendly people for their efforts and contributions:
|
||||
|
||||
Phil Blundell, Japheth Cleaver, Yang Tse, Gregor Jasny, Joshua Kwan,
|
||||
Timo Teras
|
||||
Ingmar Runge, Laszlo Tamas Szabo, Yang Tse, Tommie Gannert
|
||||
|
||||
Have fun!
|
||||
|
@@ -33,7 +33,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -199,7 +199,7 @@ int main(int argc, char **argv)
|
||||
*/
|
||||
static void wait_ares(ares_channel channel)
|
||||
{
|
||||
while (1)
|
||||
for (;;)
|
||||
{
|
||||
struct timeval *tvp, tv;
|
||||
fd_set read_fds, write_fds;
|
||||
|
29
ares/adig.c
29
ares/adig.c
@@ -15,7 +15,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
@@ -157,7 +157,6 @@ static const char *opcodes[] = {
|
||||
"UPDATEA", "UPDATED", "UPDATEDA", "UPDATEM", "UPDATEMA",
|
||||
"ZONEINIT", "ZONEREF"
|
||||
};
|
||||
struct in_addr inaddr;
|
||||
|
||||
static const char *rcodes[] = {
|
||||
"NOERROR", "FORMERR", "SERVFAIL", "NXDOMAIN", "NOTIMP", "REFUSED",
|
||||
@@ -165,6 +164,8 @@ static const char *rcodes[] = {
|
||||
"(unknown)", "(unknown)", "(unknown)", "(unknown)", "NOCHANGE"
|
||||
};
|
||||
|
||||
static struct in_addr inaddr;
|
||||
|
||||
static void callback(void *arg, int status, int timeouts,
|
||||
unsigned char *abuf, int alen);
|
||||
static const unsigned char *display_question(const unsigned char *aptr,
|
||||
@@ -321,7 +322,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* Wait for all queries to complete. */
|
||||
while (1)
|
||||
for (;;)
|
||||
{
|
||||
FD_ZERO(&read_fds);
|
||||
FD_ZERO(&write_fds);
|
||||
@@ -551,12 +552,20 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
len = *p;
|
||||
if (p + len + 1 > aptr + dlen)
|
||||
return NULL;
|
||||
printf("\t%.*s", (int)len, p + 1);
|
||||
p += len + 1;
|
||||
status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t%s", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
p += len;
|
||||
len = *p;
|
||||
if (p + len + 1 > aptr + dlen)
|
||||
return NULL;
|
||||
printf("\t%.*s", (int)len, p + 1);
|
||||
status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t%s", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
break;
|
||||
|
||||
case T_MINFO:
|
||||
@@ -623,8 +632,12 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
len = *p;
|
||||
if (p + len + 1 > aptr + dlen)
|
||||
return NULL;
|
||||
printf("\t%.*s", (int)len, p + 1);
|
||||
p += len + 1;
|
||||
status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t%s", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
p += len;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#if !defined(WIN32) || defined(WATT32)
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
@@ -140,7 +140,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* Wait for all queries to complete. */
|
||||
while (1)
|
||||
for (;;)
|
||||
{
|
||||
FD_ZERO(&read_fds);
|
||||
FD_ZERO(&write_fds);
|
||||
|
310
ares/ares.h
310
ares/ares.h
@@ -1,6 +1,6 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
/* Copyright 1998, 2009 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2007-2009 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
@@ -27,8 +27,9 @@
|
||||
* Define WIN32 when build target is Win32 API
|
||||
*/
|
||||
|
||||
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
|
||||
#define WIN32
|
||||
#if (defined(_WIN32) || defined(__WIN32__)) && \
|
||||
!defined(WIN32) && !defined(__SYMBIAN32__)
|
||||
# define WIN32
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -45,9 +46,9 @@
|
||||
#endif
|
||||
|
||||
#if defined(WATT32)
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
#include <tcp.h>
|
||||
# include <netinet/in.h>
|
||||
# include <sys/socket.h>
|
||||
# include <tcp.h>
|
||||
#elif defined(WIN32)
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
@@ -56,14 +57,37 @@
|
||||
# include <winsock2.h>
|
||||
# include <ws2tcpip.h>
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
# include <sys/socket.h>
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** c-ares external API function linkage decorations.
|
||||
*/
|
||||
|
||||
#if !defined(CARES_STATICLIB) && \
|
||||
(defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__))
|
||||
/* __declspec function decoration for Win32 and Symbian DLL's */
|
||||
# if defined(CARES_BUILDING_LIBRARY)
|
||||
# define CARES_EXTERN __declspec(dllexport)
|
||||
# else
|
||||
# define CARES_EXTERN __declspec(dllimport)
|
||||
# endif
|
||||
#else
|
||||
/* visibility function decoration for other cases */
|
||||
# if !defined(CARES_SYMBOL_HIDING) || \
|
||||
defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)
|
||||
# define CARES_EXTERN
|
||||
# else
|
||||
# define CARES_EXTERN CARES_SYMBOL_SCOPE_EXTERN
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#define ARES_SUCCESS 0
|
||||
|
||||
/* Server error codes (ARES_ENODATA indicates no relevant answer) */
|
||||
@@ -86,7 +110,6 @@ extern "C" {
|
||||
#define ARES_ENOMEM 15
|
||||
#define ARES_EDESTRUCTION 16
|
||||
#define ARES_EBADSTR 17
|
||||
#define ARES_ECANCELLED 21
|
||||
|
||||
/* ares_getnameinfo error codes */
|
||||
#define ARES_EBADFLAGS 18
|
||||
@@ -96,11 +119,14 @@ extern "C" {
|
||||
#define ARES_EBADHINTS 20
|
||||
|
||||
/* Uninitialized library error code */
|
||||
#define ARES_ENOTINITIALIZED 21
|
||||
#define ARES_ENOTINITIALIZED 21 /* introduced in 1.7.0 */
|
||||
|
||||
/* ares_library_init error codes */
|
||||
#define ARES_ELOADIPHLPAPI 22
|
||||
#define ARES_EADDRGETNETWORKPARAMS 23
|
||||
#define ARES_ELOADIPHLPAPI 22 /* introduced in 1.7.0 */
|
||||
#define ARES_EADDRGETNETWORKPARAMS 23 /* introduced in 1.7.0 */
|
||||
|
||||
/* More error codes */
|
||||
#define ARES_ECANCELLED 24 /* introduced in 1.7.0 */
|
||||
|
||||
/* Flag values */
|
||||
#define ARES_FLAG_USEVC (1 << 0)
|
||||
@@ -239,68 +265,149 @@ struct hostent;
|
||||
struct timeval;
|
||||
struct sockaddr;
|
||||
struct ares_channeldata;
|
||||
|
||||
typedef struct ares_channeldata *ares_channel;
|
||||
typedef void (*ares_callback)(void *arg, int status, int timeouts,
|
||||
unsigned char *abuf, int alen);
|
||||
typedef void (*ares_host_callback)(void *arg, int status, int timeouts,
|
||||
|
||||
typedef void (*ares_callback)(void *arg,
|
||||
int status,
|
||||
int timeouts,
|
||||
unsigned char *abuf,
|
||||
int alen);
|
||||
|
||||
typedef void (*ares_host_callback)(void *arg,
|
||||
int status,
|
||||
int timeouts,
|
||||
struct hostent *hostent);
|
||||
typedef void (*ares_nameinfo_callback)(void *arg, int status, int timeouts,
|
||||
char *node, char *service);
|
||||
|
||||
typedef void (*ares_nameinfo_callback)(void *arg,
|
||||
int status,
|
||||
int timeouts,
|
||||
char *node,
|
||||
char *service);
|
||||
|
||||
typedef int (*ares_sock_create_callback)(ares_socket_t socket_fd,
|
||||
int type, void *data);
|
||||
int type,
|
||||
void *data);
|
||||
|
||||
int ares_library_init(int flags);
|
||||
void ares_library_cleanup(void);
|
||||
const char *ares_version(int *version);
|
||||
CARES_EXTERN int ares_library_init(int flags);
|
||||
|
||||
int ares_init(ares_channel *channelptr);
|
||||
int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
||||
int optmask);
|
||||
int ares_save_options(ares_channel channel, struct ares_options *options,
|
||||
int *optmask);
|
||||
void ares_destroy_options(struct ares_options *options);
|
||||
int ares_dup(ares_channel *dest, ares_channel src);
|
||||
void ares_destroy(ares_channel channel);
|
||||
void ares_cancel(ares_channel channel);
|
||||
void ares_set_socket_callback(ares_channel channel,
|
||||
ares_sock_create_callback callback,
|
||||
void *user_data);
|
||||
void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
|
||||
ares_callback callback, void *arg);
|
||||
void ares_query(ares_channel channel, const char *name, int dnsclass,
|
||||
int type, ares_callback callback, void *arg);
|
||||
void ares_search(ares_channel channel, const char *name, int dnsclass,
|
||||
int type, ares_callback callback, void *arg);
|
||||
void ares_gethostbyname(ares_channel channel, const char *name, int family,
|
||||
ares_host_callback callback, void *arg);
|
||||
int ares_gethostbyname_file(ares_channel channel, const char *name,
|
||||
int family, struct hostent **host);
|
||||
void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen,
|
||||
int family, ares_host_callback callback, void *arg);
|
||||
void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa,
|
||||
ares_socklen_t salen, int flags,
|
||||
ares_nameinfo_callback callback,
|
||||
void *arg);
|
||||
int ares_fds(ares_channel channel, fd_set *read_fds, fd_set *write_fds);
|
||||
int ares_getsock(ares_channel channel, int *socks, int numsocks);
|
||||
struct timeval *ares_timeout(ares_channel channel, struct timeval *maxtv,
|
||||
struct timeval *tv);
|
||||
void ares_process(ares_channel channel, fd_set *read_fds, fd_set *write_fds);
|
||||
void ares_process_fd(ares_channel channel, ares_socket_t read_fd,
|
||||
ares_socket_t write_fd);
|
||||
CARES_EXTERN void ares_library_cleanup(void);
|
||||
|
||||
int ares_mkquery(const char *name, int dnsclass, int type, unsigned short id,
|
||||
int rd, unsigned char **buf, int *buflen);
|
||||
int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
|
||||
int alen, char **s, long *enclen);
|
||||
int ares_expand_string(const unsigned char *encoded, const unsigned char *abuf,
|
||||
int alen, unsigned char **s, long *enclen);
|
||||
CARES_EXTERN const char *ares_version(int *version);
|
||||
|
||||
CARES_EXTERN int ares_init(ares_channel *channelptr);
|
||||
|
||||
CARES_EXTERN int ares_init_options(ares_channel *channelptr,
|
||||
struct ares_options *options,
|
||||
int optmask);
|
||||
|
||||
CARES_EXTERN int ares_save_options(ares_channel channel,
|
||||
struct ares_options *options,
|
||||
int *optmask);
|
||||
|
||||
CARES_EXTERN void ares_destroy_options(struct ares_options *options);
|
||||
|
||||
CARES_EXTERN int ares_dup(ares_channel *dest,
|
||||
ares_channel src);
|
||||
|
||||
CARES_EXTERN void ares_destroy(ares_channel channel);
|
||||
|
||||
CARES_EXTERN void ares_cancel(ares_channel channel);
|
||||
|
||||
CARES_EXTERN void ares_set_socket_callback(ares_channel channel,
|
||||
ares_sock_create_callback callback,
|
||||
void *user_data);
|
||||
|
||||
CARES_EXTERN void ares_send(ares_channel channel,
|
||||
const unsigned char *qbuf,
|
||||
int qlen,
|
||||
ares_callback callback,
|
||||
void *arg);
|
||||
|
||||
CARES_EXTERN void ares_query(ares_channel channel,
|
||||
const char *name,
|
||||
int dnsclass,
|
||||
int type,
|
||||
ares_callback callback,
|
||||
void *arg);
|
||||
|
||||
CARES_EXTERN void ares_search(ares_channel channel,
|
||||
const char *name,
|
||||
int dnsclass,
|
||||
int type,
|
||||
ares_callback callback,
|
||||
void *arg);
|
||||
|
||||
CARES_EXTERN void ares_gethostbyname(ares_channel channel,
|
||||
const char *name,
|
||||
int family,
|
||||
ares_host_callback callback,
|
||||
void *arg);
|
||||
|
||||
CARES_EXTERN int ares_gethostbyname_file(ares_channel channel,
|
||||
const char *name,
|
||||
int family,
|
||||
struct hostent **host);
|
||||
|
||||
CARES_EXTERN void ares_gethostbyaddr(ares_channel channel,
|
||||
const void *addr,
|
||||
int addrlen,
|
||||
int family,
|
||||
ares_host_callback callback,
|
||||
void *arg);
|
||||
|
||||
CARES_EXTERN void ares_getnameinfo(ares_channel channel,
|
||||
const struct sockaddr *sa,
|
||||
ares_socklen_t salen,
|
||||
int flags,
|
||||
ares_nameinfo_callback callback,
|
||||
void *arg);
|
||||
|
||||
CARES_EXTERN int ares_fds(ares_channel channel,
|
||||
fd_set *read_fds,
|
||||
fd_set *write_fds);
|
||||
|
||||
CARES_EXTERN int ares_getsock(ares_channel channel,
|
||||
int *socks,
|
||||
int numsocks);
|
||||
|
||||
CARES_EXTERN struct timeval *ares_timeout(ares_channel channel,
|
||||
struct timeval *maxtv,
|
||||
struct timeval *tv);
|
||||
|
||||
CARES_EXTERN void ares_process(ares_channel channel,
|
||||
fd_set *read_fds,
|
||||
fd_set *write_fds);
|
||||
|
||||
CARES_EXTERN void ares_process_fd(ares_channel channel,
|
||||
ares_socket_t read_fd,
|
||||
ares_socket_t write_fd);
|
||||
|
||||
CARES_EXTERN int ares_mkquery(const char *name,
|
||||
int dnsclass,
|
||||
int type,
|
||||
unsigned short id,
|
||||
int rd,
|
||||
unsigned char **buf,
|
||||
int *buflen);
|
||||
|
||||
CARES_EXTERN int ares_expand_name(const unsigned char *encoded,
|
||||
const unsigned char *abuf,
|
||||
int alen,
|
||||
char **s,
|
||||
long *enclen);
|
||||
|
||||
CARES_EXTERN int ares_expand_string(const unsigned char *encoded,
|
||||
const unsigned char *abuf,
|
||||
int alen,
|
||||
unsigned char **s,
|
||||
long *enclen);
|
||||
|
||||
/*
|
||||
* NOTE: before c-ares 1.6.1 we would most often use the system in6_addr
|
||||
* NOTE: before c-ares 1.7.0 we would most often use the system in6_addr
|
||||
* struct below when ares itself was built, but many apps would use this
|
||||
* private version since the header checked a HAVE_* define for it. Starting
|
||||
* with 1.6.1 we always declare and use our own to stop relying on the
|
||||
* with 1.7.0 we always declare and use our own to stop relying on the
|
||||
* system's one.
|
||||
*/
|
||||
struct ares_in6_addr {
|
||||
@@ -309,19 +416,30 @@ struct ares_in6_addr {
|
||||
} _S6_un;
|
||||
};
|
||||
|
||||
/*
|
||||
* TODO: the structs 'addrttl' and 'addr6ttl' really should get their names
|
||||
* prefixed with ares_ to keep them in our own "name space".
|
||||
*/
|
||||
struct addrttl {
|
||||
struct ares_addrttl {
|
||||
struct in_addr ipaddr;
|
||||
int ttl;
|
||||
};
|
||||
struct addr6ttl {
|
||||
|
||||
struct ares_addr6ttl {
|
||||
struct ares_in6_addr ip6addr;
|
||||
int ttl;
|
||||
};
|
||||
|
||||
struct ares_srv_reply {
|
||||
struct ares_srv_reply *next;
|
||||
char *host;
|
||||
unsigned short priority;
|
||||
unsigned short weight;
|
||||
unsigned short port;
|
||||
};
|
||||
|
||||
struct ares_txt_reply {
|
||||
struct ares_txt_reply *next;
|
||||
unsigned char *txt;
|
||||
size_t length; /* length excludes null termination */
|
||||
};
|
||||
|
||||
/*
|
||||
** Parse the buffer, starting at *abuf and of length alen bytes, previously
|
||||
** obtained from an ares_search call. Put the results in *host, if nonnull.
|
||||
@@ -329,19 +447,45 @@ struct addr6ttl {
|
||||
** their TTLs in that array, and set *naddrttls to the number of addresses
|
||||
** so written.
|
||||
*/
|
||||
int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
||||
struct hostent **host,
|
||||
struct addrttl *addrttls, int *naddrttls);
|
||||
int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
struct hostent **host,
|
||||
struct addr6ttl *addrttls, int *naddrttls);
|
||||
int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
||||
int addrlen, int family, struct hostent **host);
|
||||
int ares_parse_ns_reply(const unsigned char *abuf, int alen,
|
||||
struct hostent **host);
|
||||
void ares_free_string(void *str);
|
||||
void ares_free_hostent(struct hostent *host);
|
||||
const char *ares_strerror(int code);
|
||||
|
||||
CARES_EXTERN int ares_parse_a_reply(const unsigned char *abuf,
|
||||
int alen,
|
||||
struct hostent **host,
|
||||
struct ares_addrttl *addrttls,
|
||||
int *naddrttls);
|
||||
|
||||
CARES_EXTERN int ares_parse_aaaa_reply(const unsigned char *abuf,
|
||||
int alen,
|
||||
struct hostent **host,
|
||||
struct ares_addr6ttl *addrttls,
|
||||
int *naddrttls);
|
||||
|
||||
CARES_EXTERN int ares_parse_ptr_reply(const unsigned char *abuf,
|
||||
int alen,
|
||||
const void *addr,
|
||||
int addrlen,
|
||||
int family,
|
||||
struct hostent **host);
|
||||
|
||||
CARES_EXTERN int ares_parse_ns_reply(const unsigned char *abuf,
|
||||
int alen,
|
||||
struct hostent **host);
|
||||
|
||||
CARES_EXTERN int ares_parse_srv_reply(const unsigned char* abuf,
|
||||
int alen,
|
||||
struct ares_srv_reply** srv_out);
|
||||
|
||||
CARES_EXTERN int ares_parse_txt_reply(const unsigned char* abuf,
|
||||
int alen,
|
||||
struct ares_txt_reply** txt_out);
|
||||
|
||||
CARES_EXTERN void ares_free_string(void *str);
|
||||
|
||||
CARES_EXTERN void ares_free_hostent(struct hostent *host);
|
||||
|
||||
CARES_EXTERN void ares_free_data(void *dataptr);
|
||||
|
||||
CARES_EXTERN const char *ares_strerror(int code);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
/* Copyright 1998, 2009 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -15,27 +15,20 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#if !defined(WIN32) || defined(WATT32)
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "inet_net_pton.h"
|
||||
@@ -43,136 +36,204 @@
|
||||
|
||||
int ares__get_hostent(FILE *fp, int family, struct hostent **host)
|
||||
{
|
||||
char *line = NULL, *p, *q, *canonical, **alias;
|
||||
int status, linesize, end_at_hostname, naliases;
|
||||
struct in_addr addr;
|
||||
struct in6_addr addr6;
|
||||
size_t addrlen = sizeof(struct in_addr);
|
||||
char *line = NULL, *p, *q, **alias;
|
||||
char *txtaddr, *txthost, *txtalias;
|
||||
int status;
|
||||
size_t addrlen, linesize, naliases;
|
||||
struct ares_addr addr;
|
||||
struct hostent *hostent = NULL;
|
||||
|
||||
*host = NULL; /* Assume failure */
|
||||
|
||||
/* Validate family */
|
||||
switch (family) {
|
||||
case AF_INET:
|
||||
case AF_INET6:
|
||||
case AF_UNSPEC:
|
||||
break;
|
||||
default:
|
||||
return ARES_EBADFAMILY;
|
||||
}
|
||||
|
||||
while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS)
|
||||
{
|
||||
/* Skip comment lines; terminate line at comment character. */
|
||||
if (*line == '#' || !*line)
|
||||
continue;
|
||||
p = strchr(line, '#');
|
||||
if (p)
|
||||
*p = 0;
|
||||
|
||||
/* Get the address part. */
|
||||
/* Trim line comment. */
|
||||
p = line;
|
||||
while (*p && (*p != '#'))
|
||||
p++;
|
||||
*p = '\0';
|
||||
|
||||
/* Trim trailing whitespace. */
|
||||
q = p - 1;
|
||||
while ((q >= line) && ISSPACE(*q))
|
||||
q--;
|
||||
*++q = '\0';
|
||||
|
||||
/* Skip leading whitespace. */
|
||||
p = line;
|
||||
while (*p && ISSPACE(*p))
|
||||
p++;
|
||||
if (!*p)
|
||||
/* Ignore line if empty. */
|
||||
continue;
|
||||
|
||||
/* Pointer to start of IPv4 or IPv6 address part. */
|
||||
txtaddr = p;
|
||||
|
||||
/* Advance past address part. */
|
||||
while (*p && !ISSPACE(*p))
|
||||
p++;
|
||||
if (!*p)
|
||||
continue;
|
||||
*p = 0;
|
||||
addr.s_addr = inet_addr(line);
|
||||
if (addr.s_addr == INADDR_NONE)
|
||||
{
|
||||
/* It wasn't an AF_INET dotted address, then AF_UNSPEC and AF_INET6
|
||||
families are subject for this further check */
|
||||
if ((family != AF_INET) &&
|
||||
(ares_inet_pton(AF_INET6, line, &addr6) > 0)) {
|
||||
addrlen = sizeof(struct in6_addr);
|
||||
family = AF_INET6;
|
||||
}
|
||||
else
|
||||
continue;
|
||||
}
|
||||
else if (family == AF_UNSPEC)
|
||||
family = AF_INET; /* now confirmed! */
|
||||
else if (family != AF_INET)
|
||||
/* unknown, keep moving */
|
||||
/* Ignore line if reached end of line. */
|
||||
continue;
|
||||
|
||||
/* Get the canonical hostname. */
|
||||
/* Null terminate address part. */
|
||||
*p = '\0';
|
||||
|
||||
/* Advance to host name */
|
||||
p++;
|
||||
while (ISSPACE(*p))
|
||||
while (*p && ISSPACE(*p))
|
||||
p++;
|
||||
if (!*p)
|
||||
/* Ignore line if reached end of line. */
|
||||
continue;
|
||||
q = p;
|
||||
while (*q && !ISSPACE(*q))
|
||||
q++;
|
||||
end_at_hostname = (*q == 0);
|
||||
*q = 0;
|
||||
canonical = p;
|
||||
|
||||
naliases = 0;
|
||||
if (!end_at_hostname)
|
||||
/* Pointer to start of host name. */
|
||||
txthost = p;
|
||||
|
||||
/* Advance past host name. */
|
||||
while (*p && !ISSPACE(*p))
|
||||
p++;
|
||||
|
||||
/* Pointer to start of first alias. */
|
||||
txtalias = NULL;
|
||||
if (*p)
|
||||
{
|
||||
/* Count the aliases. */
|
||||
p = q + 1;
|
||||
while (ISSPACE(*p))
|
||||
p++;
|
||||
q = p + 1;
|
||||
while (*q && ISSPACE(*q))
|
||||
q++;
|
||||
if (*q)
|
||||
txtalias = q;
|
||||
}
|
||||
|
||||
/* Null terminate host name. */
|
||||
*p = '\0';
|
||||
|
||||
/* find out number of aliases. */
|
||||
naliases = 0;
|
||||
if (txtalias)
|
||||
{
|
||||
p = txtalias;
|
||||
while (*p)
|
||||
{
|
||||
while (*p && !ISSPACE(*p))
|
||||
p++;
|
||||
while (ISSPACE(*p))
|
||||
while (*p && ISSPACE(*p))
|
||||
p++;
|
||||
naliases++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Allocate memory for the host structure. */
|
||||
/* Convert address string to network address for the requested family. */
|
||||
addrlen = 0;
|
||||
addr.family = AF_UNSPEC;
|
||||
addr.addrV4.s_addr = INADDR_NONE;
|
||||
if ((family == AF_INET) || (family == AF_UNSPEC))
|
||||
{
|
||||
addr.addrV4.s_addr = inet_addr(txtaddr);
|
||||
if (addr.addrV4.s_addr != INADDR_NONE)
|
||||
{
|
||||
/* Actual network address family and length. */
|
||||
addr.family = AF_INET;
|
||||
addrlen = sizeof(struct in_addr);
|
||||
}
|
||||
}
|
||||
if ((family == AF_INET6) || ((family == AF_UNSPEC) && (!addrlen)))
|
||||
{
|
||||
if (ares_inet_pton(AF_INET6, txtaddr, &addr.addrV6) > 0)
|
||||
{
|
||||
/* Actual network address family and length. */
|
||||
addr.family = AF_INET6;
|
||||
addrlen = sizeof(struct in6_addr);
|
||||
}
|
||||
}
|
||||
if (!addrlen)
|
||||
/* Ignore line if invalid address string for the requested family. */
|
||||
continue;
|
||||
|
||||
/*
|
||||
** Actual address family possible values are AF_INET and AF_INET6 only.
|
||||
*/
|
||||
|
||||
/* Allocate memory for the hostent structure. */
|
||||
hostent = malloc(sizeof(struct hostent));
|
||||
if (!hostent)
|
||||
break;
|
||||
|
||||
/* Initialize fields for out of memory condition. */
|
||||
hostent->h_aliases = NULL;
|
||||
hostent->h_addr_list = NULL;
|
||||
hostent->h_name = strdup(canonical);
|
||||
|
||||
/* Copy official host name. */
|
||||
hostent->h_name = strdup(txthost);
|
||||
if (!hostent->h_name)
|
||||
break;
|
||||
|
||||
/* Copy network address. */
|
||||
hostent->h_addr_list = malloc(2 * sizeof(char *));
|
||||
if (!hostent->h_addr_list)
|
||||
break;
|
||||
hostent->h_addr_list[1] = NULL;
|
||||
hostent->h_addr_list[0] = malloc(addrlen);
|
||||
if (!hostent->h_addr_list[0])
|
||||
break;
|
||||
if (addr.family == AF_INET)
|
||||
memcpy(hostent->h_addr_list[0], &addr.addrV4, sizeof(struct in_addr));
|
||||
else
|
||||
memcpy(hostent->h_addr_list[0], &addr.addrV6, sizeof(struct in6_addr));
|
||||
|
||||
/* Copy aliases. */
|
||||
hostent->h_aliases = malloc((naliases + 1) * sizeof(char *));
|
||||
if (!hostent->h_aliases)
|
||||
break;
|
||||
|
||||
/* Copy in aliases. */
|
||||
naliases = 0;
|
||||
if (!end_at_hostname)
|
||||
alias = hostent->h_aliases;
|
||||
while (naliases)
|
||||
*(alias + naliases--) = NULL;
|
||||
*alias = NULL;
|
||||
while (txtalias)
|
||||
{
|
||||
p = canonical + strlen(canonical) + 1;
|
||||
while (ISSPACE(*p))
|
||||
p = txtalias;
|
||||
while (*p && !ISSPACE(*p))
|
||||
p++;
|
||||
while (*p)
|
||||
{
|
||||
q = p;
|
||||
while (*q && !ISSPACE(*q))
|
||||
q++;
|
||||
hostent->h_aliases[naliases] = malloc(q - p + 1);
|
||||
if (hostent->h_aliases[naliases] == NULL)
|
||||
break;
|
||||
memcpy(hostent->h_aliases[naliases], p, q - p);
|
||||
hostent->h_aliases[naliases][q - p] = 0;
|
||||
p = q;
|
||||
while (ISSPACE(*p))
|
||||
p++;
|
||||
naliases++;
|
||||
}
|
||||
if (*p)
|
||||
q = p;
|
||||
while (*q && ISSPACE(*q))
|
||||
q++;
|
||||
*p = '\0';
|
||||
if ((*alias = strdup(txtalias)) == NULL)
|
||||
break;
|
||||
alias++;
|
||||
txtalias = *q ? q : NULL;
|
||||
}
|
||||
hostent->h_aliases[naliases] = NULL;
|
||||
if (txtalias)
|
||||
/* Alias memory allocation failure. */
|
||||
break;
|
||||
|
||||
hostent->h_addrtype = family;
|
||||
/* Copy actual network address family and length. */
|
||||
hostent->h_addrtype = addr.family;
|
||||
hostent->h_length = (int)addrlen;
|
||||
if (family == AF_INET)
|
||||
memcpy(hostent->h_addr_list[0], &addr, addrlen);
|
||||
else if (family == AF_INET6)
|
||||
memcpy(hostent->h_addr_list[0], &addr6, addrlen);
|
||||
hostent->h_addr_list[1] = NULL;
|
||||
*host = hostent;
|
||||
|
||||
/* Free line buffer. */
|
||||
free(line);
|
||||
|
||||
/* Return hostent successfully */
|
||||
*host = hostent;
|
||||
return ARES_SUCCESS;
|
||||
|
||||
}
|
||||
if(line)
|
||||
|
||||
/* If allocated, free line buffer. */
|
||||
if (line)
|
||||
free(line);
|
||||
|
||||
if (status == ARES_SUCCESS)
|
||||
@@ -180,22 +241,22 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host)
|
||||
/* Memory allocation failure; clean up. */
|
||||
if (hostent)
|
||||
{
|
||||
if(hostent->h_name)
|
||||
if (hostent->h_name)
|
||||
free((char *) hostent->h_name);
|
||||
if (hostent->h_aliases)
|
||||
{
|
||||
for (alias = hostent->h_aliases; *alias; alias++)
|
||||
free(*alias);
|
||||
free(hostent->h_aliases);
|
||||
}
|
||||
if (hostent->h_addr_list)
|
||||
{
|
||||
if (hostent->h_addr_list[0])
|
||||
free(hostent->h_addr_list[0]);
|
||||
free(hostent->h_addr_list);
|
||||
}
|
||||
if(hostent->h_aliases)
|
||||
free(hostent->h_aliases);
|
||||
if (hostent->h_addr_list && hostent->h_addr_list[0])
|
||||
free(hostent->h_addr_list[0]);
|
||||
if(hostent->h_addr_list)
|
||||
free(hostent->h_addr_list);
|
||||
free(hostent);
|
||||
}
|
||||
*host = NULL;
|
||||
return ARES_ENOMEM;
|
||||
}
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -30,7 +30,7 @@
|
||||
* appropriate. The initial value of *buf should be NULL. After the
|
||||
* calling routine is done reading lines, it should free *buf.
|
||||
*/
|
||||
int ares__read_line(FILE *fp, char **buf, int *bufsize)
|
||||
int ares__read_line(FILE *fp, char **buf, size_t *bufsize)
|
||||
{
|
||||
char *newbuf;
|
||||
size_t offset = 0;
|
||||
@@ -44,9 +44,9 @@ int ares__read_line(FILE *fp, char **buf, int *bufsize)
|
||||
*bufsize = 128;
|
||||
}
|
||||
|
||||
while (1)
|
||||
for (;;)
|
||||
{
|
||||
if (!fgets(*buf + offset, *bufsize - (int)offset, fp))
|
||||
if (!fgets(*buf + offset, (int)(*bufsize - offset), fp))
|
||||
return (offset != 0) ? 0 : (ferror(fp)) ? ARES_EFILE : ARES_EOF;
|
||||
len = offset + strlen(*buf + offset);
|
||||
if ((*buf)[len - 1] == '\n')
|
||||
|
@@ -13,7 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
|
@@ -21,7 +21,7 @@ ares_cancel \- Cancel a resolve
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_cancel(ares_channel \fIchannel\fP)
|
||||
.B void ares_cancel(ares_channel \fIchannel\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The \fBares_cancel\fP function cancels all lookups/requests made on the the
|
||||
|
@@ -13,7 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include "ares.h"
|
||||
|
143
ares/ares_data.c
Normal file
143
ares/ares_data.c
Normal file
@@ -0,0 +1,143 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 2009 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_data.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
|
||||
/*
|
||||
** ares_free_data() - c-ares external API function.
|
||||
**
|
||||
** This function must be used by the application to free data memory that
|
||||
** has been internally allocated by some c-ares function and for which a
|
||||
** pointer has already been returned to the calling application. The list
|
||||
** of c-ares functions returning pointers that must be free'ed using this
|
||||
** function is:
|
||||
**
|
||||
** ares_parse_srv_reply()
|
||||
** ares_parse_txt_reply()
|
||||
*/
|
||||
|
||||
void ares_free_data(void *dataptr)
|
||||
{
|
||||
struct ares_data *ptr;
|
||||
|
||||
if (!dataptr)
|
||||
return;
|
||||
|
||||
ptr = (void *)((char *)dataptr - offsetof(struct ares_data, data));
|
||||
|
||||
if (ptr->mark != ARES_DATATYPE_MARK)
|
||||
return;
|
||||
|
||||
switch (ptr->type)
|
||||
{
|
||||
case ARES_DATATYPE_SRV_REPLY:
|
||||
|
||||
if (ptr->data.srv_reply.next)
|
||||
ares_free_data(ptr->data.srv_reply.next);
|
||||
if (ptr->data.srv_reply.host)
|
||||
free(ptr->data.srv_reply.host);
|
||||
break;
|
||||
|
||||
case ARES_DATATYPE_TXT_REPLY:
|
||||
|
||||
if (ptr->data.txt_reply.next)
|
||||
ares_free_data(ptr->data.txt_reply.next);
|
||||
if (ptr->data.txt_reply.txt)
|
||||
free(ptr->data.txt_reply.txt);
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** ares_malloc_data() - c-ares internal helper function.
|
||||
**
|
||||
** This function allocates memory for a c-ares private ares_data struct
|
||||
** for the specified ares_datatype, initializes c-ares private fields
|
||||
** and zero initializes those which later might be used from the public
|
||||
** API. It returns an interior pointer which can be passed by c-ares
|
||||
** functions to the calling application, and that must be free'ed using
|
||||
** c-ares external API function ares_free_data().
|
||||
*/
|
||||
|
||||
void *ares_malloc_data(ares_datatype type)
|
||||
{
|
||||
struct ares_data *ptr;
|
||||
|
||||
ptr = malloc(sizeof(struct ares_data));
|
||||
if (!ptr)
|
||||
return NULL;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case ARES_DATATYPE_SRV_REPLY:
|
||||
ptr->data.srv_reply.next = NULL;
|
||||
ptr->data.srv_reply.host = NULL;
|
||||
ptr->data.srv_reply.priority = 0;
|
||||
ptr->data.srv_reply.weight = 0;
|
||||
ptr->data.srv_reply.port = 0;
|
||||
break;
|
||||
|
||||
case ARES_DATATYPE_TXT_REPLY:
|
||||
ptr->data.txt_reply.next = NULL;
|
||||
ptr->data.txt_reply.txt = NULL;
|
||||
ptr->data.txt_reply.length = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
free(ptr);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ptr->mark = ARES_DATATYPE_MARK;
|
||||
ptr->type = type;
|
||||
|
||||
return &ptr->data;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** ares_get_datatype() - c-ares internal helper function.
|
||||
**
|
||||
** This function returns the ares_datatype of the data stored in a
|
||||
** private ares_data struct when given the public API pointer.
|
||||
*/
|
||||
|
||||
ares_datatype ares_get_datatype(void * dataptr)
|
||||
{
|
||||
struct ares_data *ptr;
|
||||
|
||||
ptr = (void *)((char *)dataptr - offsetof(struct ares_data, data));
|
||||
|
||||
if (ptr->mark == ARES_DATATYPE_MARK)
|
||||
return ptr->type;
|
||||
|
||||
return ARES_DATATYPE_UNKNOWN;
|
||||
}
|
62
ares/ares_data.h
Normal file
62
ares/ares_data.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 2009 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
ARES_DATATYPE_UNKNOWN = 1, /* unknown data type - introduced in 1.7.0 */
|
||||
ARES_DATATYPE_SRV_REPLY, /* struct ares_srv_reply - introduced in 1.7.0 */
|
||||
ARES_DATATYPE_TXT_REPLY, /* struct ares_txt_reply - introduced in 1.7.0 */
|
||||
#if 0
|
||||
ARES_DATATYPE_ADDR6TTL, /* struct ares_addrttl */
|
||||
ARES_DATATYPE_ADDRTTL, /* struct ares_addr6ttl */
|
||||
ARES_DATATYPE_HOSTENT, /* struct hostent */
|
||||
ARES_DATATYPE_OPTIONS, /* struct ares_options */
|
||||
#endif
|
||||
ARES_DATATYPE_LAST /* not used - introduced in 1.7.0 */
|
||||
} ares_datatype;
|
||||
|
||||
#define ARES_DATATYPE_MARK 0xbead
|
||||
|
||||
/*
|
||||
* ares_data struct definition is internal to c-ares and shall not
|
||||
* be exposed by the public API in order to allow future changes
|
||||
* and extensions to it without breaking ABI. This will be used
|
||||
* internally by c-ares as the container of multiple types of data
|
||||
* dynamically allocated for which a reference will be returned
|
||||
* to the calling application.
|
||||
*
|
||||
* c-ares API functions returning a pointer to c-ares internally
|
||||
* allocated data will actually be returning an interior pointer
|
||||
* into this ares_data struct.
|
||||
*
|
||||
* All this is 'invisible' to the calling application, the only
|
||||
* requirement is that this kind of data must be free'ed by the
|
||||
* calling application using ares_free_data() with the pointer
|
||||
* it has received from a previous c-ares function call.
|
||||
*/
|
||||
|
||||
struct ares_data {
|
||||
ares_datatype type; /* Actual data type identifier. */
|
||||
unsigned int mark; /* Private ares_data signature. */
|
||||
union {
|
||||
struct ares_txt_reply txt_reply;
|
||||
struct ares_srv_reply srv_reply;
|
||||
} data;
|
||||
};
|
||||
|
||||
void *ares_malloc_data(ares_datatype type);
|
||||
|
||||
ares_datatype ares_get_datatype(void * dataptr);
|
@@ -15,7 +15,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include "ares.h"
|
||||
|
@@ -21,12 +21,12 @@ ares_dup \- Duplicate a resolver channel
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_dup(ares_channel *\fIchannel\fP, ares_channel \fIsource\fP)
|
||||
.B int ares_dup(ares_channel *\fIdest\fP, ares_channel \fIsource\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The \fBares_dup(3)\fP function duplicates an existing communications channel
|
||||
for name service lookups. If it returns successfully, \fBares_dup(3)\fP will
|
||||
set the variable pointed to by \fIchannel\fP to a handle used to identify the
|
||||
set the variable pointed to by \fIdest\fP to a handle used to identify the
|
||||
name service channel. The caller should invoke \fIares_destroy(3)\fP on the
|
||||
handle when the channel is no longer needed.
|
||||
|
||||
|
@@ -14,7 +14,7 @@
|
||||
.\" this software for any purpose. It is provided "as is"
|
||||
.\" without express or implied warranty.
|
||||
.\"
|
||||
.TH ARES_EXPAND_NAME 3 "23 July 1998"
|
||||
.TH ARES_EXPAND_NAME 3 "20 Nov 2009"
|
||||
.SH NAME
|
||||
ares_expand_name \- Expand a DNS-encoded domain name
|
||||
.SH SYNOPSIS
|
||||
@@ -23,7 +23,7 @@ ares_expand_name \- Expand a DNS-encoded domain name
|
||||
.PP
|
||||
.B int ares_expand_name(const unsigned char *\fIencoded\fP,
|
||||
.B const unsigned char *\fIabuf\fP, int \fIalen\fP, char **\fIs\fP,
|
||||
.B int *\fIenclen\fP)
|
||||
.B long *\fIenclen\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
@@ -71,10 +71,10 @@ int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
|
||||
const unsigned char *p;
|
||||
|
||||
len = name_length(encoded, abuf, alen);
|
||||
if (len == -1)
|
||||
if (len < 0)
|
||||
return ARES_EBADNAME;
|
||||
|
||||
*s = malloc(len + 1);
|
||||
*s = malloc(((size_t)len) + 1);
|
||||
if (!*s)
|
||||
return ARES_ENOMEM;
|
||||
q = *s;
|
||||
|
@@ -14,7 +14,7 @@
|
||||
.\" this software for any purpose. It is provided "as is"
|
||||
.\" without express or implied warranty.
|
||||
.\"
|
||||
.TH ARES_EXPAND_NAME 3 "23 July 1998"
|
||||
.TH ARES_EXPAND_NAME 3 "20 Nov 2009"
|
||||
.SH NAME
|
||||
ares_expand_string \- Expand a length encoded string
|
||||
.SH SYNOPSIS
|
||||
@@ -23,7 +23,7 @@ ares_expand_string \- Expand a length encoded string
|
||||
.PP
|
||||
.B int ares_expand_string(const unsigned char *\fIencoded\fP,
|
||||
.B const unsigned char *\fIabuf\fP, int \fIalen\fP, unsigned char **\fIs\fP,
|
||||
.B int *\fIenclen\fP)
|
||||
.B long *\fIenclen\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
|
60
ares/ares_free_data.3
Normal file
60
ares/ares_free_data.3
Normal file
@@ -0,0 +1,60 @@
|
||||
.\" $Id$
|
||||
.\"
|
||||
.\" Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
.\" Copyright (C) 2004-2009 by Daniel Stenberg
|
||||
.\"
|
||||
.\" Permission to use, copy, modify, and distribute this
|
||||
.\" software and its documentation for any purpose and without
|
||||
.\" fee is hereby granted, provided that the above copyright
|
||||
.\" notice appear in all copies and that both that copyright
|
||||
.\" notice and this permission notice appear in supporting
|
||||
.\" documentation, and that the name of M.I.T. not be used in
|
||||
.\" advertising or publicity pertaining to distribution of the
|
||||
.\" software without specific, written prior permission.
|
||||
.\" M.I.T. makes no representations about the suitability of
|
||||
.\" this software for any purpose. It is provided "as is"
|
||||
.\" without express or implied warranty.
|
||||
.\"
|
||||
.TH ARES_FREE_DATA 3 "23 Nov 2009"
|
||||
.SH NAME
|
||||
ares_free_data \- Free data allocated by several c-ares functions
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B void ares_free_data(void *\fIdataptr\fP)
|
||||
.PP
|
||||
.B cc file.c -lcares
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The
|
||||
.B ares_free_data(3)
|
||||
function frees one or more data structures allocated and returned
|
||||
by several c-ares functions. Specifically the data returned by the
|
||||
following list of functions must be deallocated using this function.
|
||||
.TP 5
|
||||
.B ares_parse_srv_reply(3)
|
||||
When used to free the data returned by ares_parse_srv_reply(3) this
|
||||
will free the whole linked list of ares_srv_reply structures returned
|
||||
by ares_parse_srv_reply(3), along with any additional storage
|
||||
associated with those structures.
|
||||
.TP
|
||||
.B ares_parse_txt_reply(3)
|
||||
When used to free the data returned by ares_parse_txt_reply(3) this
|
||||
will free the whole linked list of ares_txt_reply structures returned
|
||||
by ares_parse_txt_reply(3), along with any additional storage
|
||||
associated with those structures.
|
||||
.SH RETURN VALUE
|
||||
The ares_free_data() function does not return a value.
|
||||
.SH AVAILABILITY
|
||||
This function was first introduced in c-ares version 1.7.0.
|
||||
.SH SEE ALSO
|
||||
.BR ares_parse_srv_reply(3),
|
||||
.BR ares_parse_txt_reply(3)
|
||||
.SH AUTHOR
|
||||
Yang Tse
|
||||
.PP
|
||||
Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
.br
|
||||
Copyright (C) 2004-2009 by Daniel Stenberg.
|
@@ -15,10 +15,10 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#if !defined(WIN32) || defined(WATT32)
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
#include <stdlib.h>
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
@@ -14,7 +14,7 @@
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
@@ -245,15 +245,16 @@ static int fake_hostent(const char *name, int family, ares_host_callback callbac
|
||||
struct in_addr in;
|
||||
struct in6_addr in6;
|
||||
|
||||
if (family == AF_INET)
|
||||
if (family == AF_INET || family == AF_INET6)
|
||||
{
|
||||
/* It only looks like an IP address if it's all numbers and dots. */
|
||||
int numdots = 0;
|
||||
int numdots = 0, valid = 1;
|
||||
const char *p;
|
||||
for (p = name; *p; p++)
|
||||
{
|
||||
if (!ISDIGIT(*p) && *p != '.') {
|
||||
return 0;
|
||||
valid = 0;
|
||||
break;
|
||||
} else if (*p == '.') {
|
||||
numdots++;
|
||||
}
|
||||
@@ -262,12 +263,15 @@ static int fake_hostent(const char *name, int family, ares_host_callback callbac
|
||||
/* if we don't have 3 dots, it is illegal
|
||||
* (although inet_addr doesn't think so).
|
||||
*/
|
||||
if (numdots != 3)
|
||||
if (numdots != 3 || !valid)
|
||||
result = 0;
|
||||
else
|
||||
result = ((in.s_addr = inet_addr(name)) == INADDR_NONE ? 0 : 1);
|
||||
|
||||
if (result)
|
||||
family = AF_INET;
|
||||
}
|
||||
else if (family == AF_INET6)
|
||||
if (family == AF_INET6)
|
||||
result = (ares_inet_pton(AF_INET6, name, &in6) < 1 ? 0 : 1);
|
||||
|
||||
if (!result)
|
||||
|
@@ -21,7 +21,7 @@ ares_gethostbyname_file \- Lookup a name in the system's hosts file
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B void ares_gethostbyname_file(ares_channel \fIchannel\fP, const char *\fIname\fP,
|
||||
.B int ares_gethostbyname_file(ares_channel \fIchannel\fP, const char *\fIname\fP,
|
||||
.B int \fIfamily\fP, struct hostent **host)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
|
@@ -14,7 +14,7 @@
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_GETSERVBYPORT_R
|
||||
# if !defined(GETSERVBYPORT_R_ARGS) || \
|
||||
@@ -61,10 +61,6 @@
|
||||
#include "inet_ntop.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
#ifdef WATT32
|
||||
#undef WIN32
|
||||
#endif
|
||||
|
||||
struct nameinfo_query {
|
||||
ares_nameinfo_callback callback;
|
||||
void *arg;
|
||||
@@ -99,12 +95,19 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa,
|
||||
struct sockaddr_in *addr = NULL;
|
||||
struct sockaddr_in6 *addr6 = NULL;
|
||||
struct nameinfo_query *niquery;
|
||||
unsigned int port = 0;
|
||||
|
||||
/* Verify the buffer size */
|
||||
if (salen == sizeof(struct sockaddr_in))
|
||||
addr = (struct sockaddr_in *)sa;
|
||||
{
|
||||
addr = (struct sockaddr_in *)sa;
|
||||
port = addr->sin_port;
|
||||
}
|
||||
else if (salen == sizeof(struct sockaddr_in6))
|
||||
addr6 = (struct sockaddr_in6 *)sa;
|
||||
{
|
||||
addr6 = (struct sockaddr_in6 *)sa;
|
||||
port = addr6->sin6_port;
|
||||
}
|
||||
else
|
||||
{
|
||||
callback(arg, ARES_ENOTIMP, 0, NULL, NULL);
|
||||
@@ -119,12 +122,7 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa,
|
||||
if ((flags & ARES_NI_LOOKUPSERVICE) && !(flags & ARES_NI_LOOKUPHOST))
|
||||
{
|
||||
char buf[33], *service;
|
||||
unsigned int port = 0;
|
||||
|
||||
if (salen == sizeof(struct sockaddr_in))
|
||||
port = addr->sin_port;
|
||||
else
|
||||
port = addr6->sin6_port;
|
||||
service = lookup_service((unsigned short)(port & 0xffff),
|
||||
flags, buf, sizeof(buf));
|
||||
callback(arg, ARES_SUCCESS, 0, NULL, service);
|
||||
@@ -137,7 +135,6 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa,
|
||||
/* A numeric host can be handled without DNS */
|
||||
if ((flags & ARES_NI_NUMERICHOST))
|
||||
{
|
||||
unsigned int port = 0;
|
||||
char ipbuf[IPBUFSIZ];
|
||||
char srvbuf[33];
|
||||
char *service = NULL;
|
||||
@@ -154,7 +151,6 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa,
|
||||
if (salen == sizeof(struct sockaddr_in6))
|
||||
{
|
||||
ares_inet_ntop(AF_INET6, &addr6->sin6_addr, ipbuf, IPBUFSIZ);
|
||||
port = addr6->sin6_port;
|
||||
/* If the system supports scope IDs, use it */
|
||||
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
|
||||
append_scopeid(addr6, flags, ipbuf, sizeof(ipbuf));
|
||||
@@ -163,7 +159,6 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa,
|
||||
else
|
||||
{
|
||||
ares_inet_ntop(AF_INET, &addr->sin_addr, ipbuf, IPBUFSIZ);
|
||||
port = addr->sin_port;
|
||||
}
|
||||
/* They also want a service */
|
||||
if (flags & ARES_NI_LOOKUPSERVICE)
|
||||
|
@@ -50,9 +50,9 @@
|
||||
#include "ares_getopt.h"
|
||||
|
||||
int opterr = 1, /* if error message should be printed */
|
||||
optind = 1, /* index into parent argv vector */
|
||||
optopt, /* character checked for validity */
|
||||
optreset; /* reset getopt */
|
||||
optind = 1; /* index into parent argv vector */
|
||||
int optopt = 0; /* character checked for validity */
|
||||
static int optreset; /* reset getopt */
|
||||
char *optarg; /* argument associated with option */
|
||||
|
||||
#define BADCH (int)'?'
|
||||
|
@@ -33,15 +33,21 @@
|
||||
|
||||
int ares_getopt(int nargc, char * const nargv[], const char *ostr);
|
||||
|
||||
#if defined(WATT32)
|
||||
#undef optarg
|
||||
#undef optind
|
||||
#undef opterr
|
||||
#endif
|
||||
#undef optopt
|
||||
#undef optreset
|
||||
|
||||
#define optarg ares_optarg
|
||||
#define optind ares_optind
|
||||
#define opterr ares_opterr
|
||||
#define optopt ares_optopt
|
||||
#define optreset ares_optreset
|
||||
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
extern int opterr;
|
||||
|
||||
extern int optopt;
|
||||
|
||||
#endif /* ARES_GETOPT_H */
|
||||
|
@@ -13,7 +13,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
|
@@ -22,8 +22,8 @@ ares_init, ares_init_options \- Initialize a resolver channel
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_init(ares_channel *\fIchannel\fP)
|
||||
.B int ares_init_options(ares_channel *\fIchannel\fP,
|
||||
.B int ares_init(ares_channel *\fIchannelptr\fP)
|
||||
.B int ares_init_options(ares_channel *\fIchannelptr\fP,
|
||||
.B struct ares_options *\fIoptions\fP, int \fIoptmask\fP)
|
||||
.PP
|
||||
.B cc file.c -lcares
|
||||
@@ -31,7 +31,7 @@ ares_init, ares_init_options \- Initialize a resolver channel
|
||||
.SH DESCRIPTION
|
||||
The \fBares_init\fP function initializes a communications channel for name
|
||||
service lookups. If it returns successfully, \fBares_init\fP will set the
|
||||
variable pointed to by \fIchannel\fP to a handle used to identify the name
|
||||
variable pointed to by \fIchannelptr\fP to a handle used to identify the name
|
||||
service channel. The caller should invoke
|
||||
.BR ares_destroy (3)
|
||||
on the handle when the channel is no longer needed.
|
||||
|
@@ -16,9 +16,9 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#ifdef USE_WINSOCK
|
||||
#include <iphlpapi.h>
|
||||
#endif
|
||||
|
||||
@@ -80,14 +80,16 @@ static int init_by_environment(ares_channel channel);
|
||||
static int init_by_resolv_conf(ares_channel channel);
|
||||
static int init_by_defaults(ares_channel channel);
|
||||
|
||||
#ifndef WATT32
|
||||
static int config_nameserver(struct server_state **servers, int *nservers,
|
||||
char *str);
|
||||
#endif
|
||||
static int set_search(ares_channel channel, const char *str);
|
||||
static int set_options(ares_channel channel, const char *str);
|
||||
static const char *try_option(const char *p, const char *q, const char *opt);
|
||||
static int init_id_key(rc4_key* key,int key_data_len);
|
||||
|
||||
#ifndef WIN32
|
||||
#if !defined(WIN32) && !defined(WATT32)
|
||||
static int sortlist_alloc(struct apattern **sortlist, int *nsort, struct apattern *pat);
|
||||
static int ip_addr(const char *s, int len, struct in_addr *addr);
|
||||
static void natural_mask(struct apattern *pat);
|
||||
@@ -579,7 +581,7 @@ static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size)
|
||||
if (!fi)
|
||||
return 0;
|
||||
|
||||
res = (*fpGetNetworkParams) (fi, &size);
|
||||
res = (*ares_fpGetNetworkParams) (fi, &size);
|
||||
if ((res != ERROR_BUFFER_OVERFLOW) && (res != ERROR_SUCCESS))
|
||||
goto quit;
|
||||
|
||||
@@ -588,7 +590,7 @@ static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size)
|
||||
goto quit;
|
||||
|
||||
fi = newfi;
|
||||
res = (*fpGetNetworkParams) (fi, &size);
|
||||
res = (*ares_fpGetNetworkParams) (fi, &size);
|
||||
if (res != ERROR_SUCCESS)
|
||||
goto quit;
|
||||
|
||||
@@ -635,7 +637,9 @@ quit:
|
||||
|
||||
static int init_by_resolv_conf(ares_channel channel)
|
||||
{
|
||||
#ifndef WATT32
|
||||
char *line = NULL;
|
||||
#endif
|
||||
int status = -1, nservers = 0, nsort = 0;
|
||||
struct server_state *servers = NULL;
|
||||
struct apattern *sortlist = NULL;
|
||||
@@ -793,7 +797,7 @@ DhcpNameServer
|
||||
return ARES_SUCCESS; /* use localhost DNS server */
|
||||
|
||||
nservers = i;
|
||||
servers = calloc(sizeof(*servers), i);
|
||||
servers = calloc(i, sizeof(struct server_state));
|
||||
if (!servers)
|
||||
return ARES_ENOMEM;
|
||||
|
||||
@@ -805,7 +809,7 @@ DhcpNameServer
|
||||
{
|
||||
char *p;
|
||||
FILE *fp;
|
||||
int linesize;
|
||||
size_t linesize;
|
||||
int error;
|
||||
|
||||
/* Don't read resolv.conf and friends if we don't have to */
|
||||
@@ -971,6 +975,9 @@ static int init_by_defaults(ares_channel channel)
|
||||
{
|
||||
char *hostname = NULL;
|
||||
int rc = ARES_SUCCESS;
|
||||
#ifdef HAVE_GETHOSTNAME
|
||||
char *dot;
|
||||
#endif
|
||||
|
||||
if (channel->flags == -1)
|
||||
channel->flags = 0;
|
||||
@@ -1040,15 +1047,15 @@ static int init_by_defaults(ares_channel channel)
|
||||
|
||||
} while(0);
|
||||
|
||||
if (strchr(hostname, '.')) {
|
||||
dot = strchr(hostname, '.');
|
||||
if (dot) {
|
||||
/* a dot was found */
|
||||
|
||||
channel->domains = malloc(sizeof(char *));
|
||||
if (!channel->domains) {
|
||||
rc = ARES_ENOMEM;
|
||||
goto error;
|
||||
}
|
||||
channel->domains[0] = strdup(strchr(hostname, '.') + 1);
|
||||
channel->domains[0] = strdup(dot + 1);
|
||||
if (!channel->domains[0]) {
|
||||
rc = ARES_ENOMEM;
|
||||
goto error;
|
||||
@@ -1088,7 +1095,7 @@ static int init_by_defaults(ares_channel channel)
|
||||
return rc;
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
#if !defined(WIN32) && !defined(WATT32)
|
||||
static int config_domain(ares_channel channel, char *str)
|
||||
{
|
||||
char *q;
|
||||
@@ -1101,11 +1108,19 @@ static int config_domain(ares_channel channel, char *str)
|
||||
return set_search(channel, str);
|
||||
}
|
||||
|
||||
#if defined(__INTEL_COMPILER) && (__INTEL_COMPILER == 910) && \
|
||||
defined(__OPTIMIZE__) && defined(__unix__) && defined(__i386__)
|
||||
/* workaround icc 9.1 optimizer issue */
|
||||
# define vqualifier volatile
|
||||
#else
|
||||
# define vqualifier
|
||||
#endif
|
||||
|
||||
static int config_lookup(ares_channel channel, const char *str,
|
||||
const char *bindch, const char *filech)
|
||||
{
|
||||
char lookups[3], *l;
|
||||
const char *p;
|
||||
const char *vqualifier p;
|
||||
|
||||
/* Set the lookup order. Only the first letter of each work
|
||||
* is relevant, and it has to be "b" for DNS or "f" for the
|
||||
@@ -1128,9 +1143,9 @@ static int config_lookup(ares_channel channel, const char *str,
|
||||
channel->lookups = strdup(lookups);
|
||||
return (channel->lookups) ? ARES_SUCCESS : ARES_ENOMEM;
|
||||
}
|
||||
#endif /* !WIN32 & !WATT32 */
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef WATT32
|
||||
static int config_nameserver(struct server_state **servers, int *nservers,
|
||||
char *str)
|
||||
{
|
||||
@@ -1273,7 +1288,8 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
|
||||
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
#endif /* !WIN32 */
|
||||
#endif /* !WATT32 */
|
||||
|
||||
static int set_search(ares_channel channel, const char *str)
|
||||
{
|
||||
@@ -1365,29 +1381,39 @@ static int set_options(ares_channel channel, const char *str)
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
static const char *try_option(const char *p, const char *q, const char *opt)
|
||||
{
|
||||
size_t len = strlen(opt);
|
||||
return ((size_t)(q - p) >= len && !strncmp(p, opt, len)) ? &p[len] : NULL;
|
||||
}
|
||||
|
||||
#if !defined(WIN32) && !defined(WATT32)
|
||||
static char *try_config(char *s, const char *opt)
|
||||
{
|
||||
size_t len;
|
||||
ssize_t i;
|
||||
ssize_t j;
|
||||
char *p;
|
||||
char *q;
|
||||
|
||||
if (!s || !opt)
|
||||
/* no line or no option */
|
||||
return NULL;
|
||||
|
||||
/* trim line comment */
|
||||
for (i = 0; s[i] && s[i] != '#'; ++i);
|
||||
s[i] = '\0';
|
||||
p = s;
|
||||
while (*p && (*p != '#'))
|
||||
p++;
|
||||
*p = '\0';
|
||||
|
||||
/* trim trailing whitespace */
|
||||
for (j = i-1; j >= 0 && ISSPACE(s[j]); --j);
|
||||
s[++j] = '\0';
|
||||
q = p - 1;
|
||||
while ((q >= s) && ISSPACE(*q))
|
||||
q--;
|
||||
*++q = '\0';
|
||||
|
||||
/* skip leading whitespace */
|
||||
for (i = 0; s[i] && ISSPACE(s[i]); ++i);
|
||||
p = &s[i];
|
||||
p = s;
|
||||
while (*p && ISSPACE(*p))
|
||||
p++;
|
||||
|
||||
if (!*p)
|
||||
/* empty line */
|
||||
@@ -1424,15 +1450,7 @@ static char *try_config(char *s, const char *opt)
|
||||
/* return pointer to option value */
|
||||
return p;
|
||||
}
|
||||
#endif
|
||||
|
||||
static const char *try_option(const char *p, const char *q, const char *opt)
|
||||
{
|
||||
size_t len = strlen(opt);
|
||||
return ((size_t)(q - p) >= len && !strncmp(p, opt, len)) ? &p[len] : NULL;
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
static int sortlist_alloc(struct apattern **sortlist, int *nsort,
|
||||
struct apattern *pat)
|
||||
{
|
||||
@@ -1478,7 +1496,8 @@ static void natural_mask(struct apattern *pat)
|
||||
else
|
||||
pat->mask.addr4.s_addr = htonl(IN_CLASSC_NET);
|
||||
}
|
||||
#endif
|
||||
#endif /* !WIN32 && !WATT32 */
|
||||
|
||||
/* initialize an rc4 key. If possible a cryptographically secure random key
|
||||
is generated using a suitable function (for example win32's RtlGenRandom as
|
||||
described in
|
||||
@@ -1492,9 +1511,9 @@ static void randomize_key(unsigned char* key,int key_data_len)
|
||||
int counter=0;
|
||||
#ifdef WIN32
|
||||
BOOLEAN res;
|
||||
if (fpSystemFunction036)
|
||||
if (ares_fpSystemFunction036)
|
||||
{
|
||||
res = (*fpSystemFunction036) (key, key_data_len);
|
||||
res = (*ares_fpSystemFunction036) (key, key_data_len);
|
||||
if (res)
|
||||
randomized = 1;
|
||||
}
|
||||
|
@@ -53,16 +53,16 @@ conflict with any other thread that is already using these other libraries.
|
||||
Win32/64 application DLLs shall not call \fIares_library_cleanup(3)\fP from
|
||||
the DllMain function. Doing so will produce deadlocks and other problems.
|
||||
.SH AVAILABILITY
|
||||
This function was first introduced in c-ares version 1.6.1 along with the
|
||||
This function was first introduced in c-ares version 1.7.0 along with the
|
||||
definition of preprocessor symbol \fICARES_HAVE_ARES_LIBRARY_CLEANUP\fP as an
|
||||
indication of the availability of this function.
|
||||
.PP
|
||||
Since the introduction of this function, it is absolutely mandatory to call it
|
||||
for any Win32/64 program using c-ares.
|
||||
.PP
|
||||
Non-Win32/64 systems can still use c-ares version 1.6.1 without calling
|
||||
\fIares_library_cleanup(3)\fP due to the fact that it is nearly a do-nothing
|
||||
function on non-Win32/64 platforms.
|
||||
Non-Win32/64 systems can still use c-ares version 1.7.0 without calling
|
||||
\fIares_library_cleanup(3)\fP due to the fact that \fIcurrently\fP it is nearly
|
||||
a do-nothing function on non-Win32/64 platforms.
|
||||
.SH SEE ALSO
|
||||
.BR ares_library_init(3),
|
||||
.BR ares_cancel(3)
|
||||
|
@@ -76,16 +76,16 @@ non-zero error number will be returned to indicate the error. Except for
|
||||
\fIares_strerror(3)\fP, you shall not call any other c-ares function upon
|
||||
\fIares_library_init(3)\fP failure.
|
||||
.SH AVAILABILITY
|
||||
This function was first introduced in c-ares version 1.6.1 along with the
|
||||
This function was first introduced in c-ares version 1.7.0 along with the
|
||||
definition of preprocessor symbol \fICARES_HAVE_ARES_LIBRARY_INIT\fP as an
|
||||
indication of the availability of this function.
|
||||
.PP
|
||||
Since the introduction of this function it is absolutely mandatory to
|
||||
call it for any Win32/64 program using c-ares.
|
||||
.PP
|
||||
Non-Win32/64 systems can still use c-ares version 1.6.1 without calling
|
||||
\fIares_library_init(3)\fP due to the fact that it is nearly a do-nothing
|
||||
function on non-Win32/64 platforms at this point.
|
||||
Non-Win32/64 systems can still use c-ares version 1.7.0 without calling
|
||||
\fIares_library_init(3)\fP due to the fact that \fIcurrently\fP it is nearly
|
||||
a do-nothing function on non-Win32/64 platforms at this point.
|
||||
.SH SEE ALSO
|
||||
.BR ares_library_cleanup(3),
|
||||
.BR ares_strerror(3)
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_library_init.h"
|
||||
@@ -24,9 +24,9 @@
|
||||
|
||||
/* library-private global and unique instance vars */
|
||||
|
||||
#ifdef WIN32
|
||||
fpGetNetworkParams_t fpGetNetworkParams = ZERO_NULL;
|
||||
fpSystemFunction036_t fpSystemFunction036 = ZERO_NULL;
|
||||
#ifdef USE_WINSOCK
|
||||
fpGetNetworkParams_t ares_fpGetNetworkParams = ZERO_NULL;
|
||||
fpSystemFunction036_t ares_fpSystemFunction036 = ZERO_NULL;
|
||||
#endif
|
||||
|
||||
/* library-private global vars with source visibility restricted to this file */
|
||||
@@ -34,7 +34,7 @@ fpSystemFunction036_t fpSystemFunction036 = ZERO_NULL;
|
||||
static unsigned int ares_initialized;
|
||||
static int ares_init_flags;
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef USE_WINSOCK
|
||||
static HMODULE hnd_iphlpapi;
|
||||
static HMODULE hnd_advapi32;
|
||||
#endif
|
||||
@@ -42,16 +42,16 @@ static HMODULE hnd_advapi32;
|
||||
|
||||
static int ares_win32_init(void)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef USE_WINSOCK
|
||||
|
||||
hnd_iphlpapi = 0;
|
||||
hnd_iphlpapi = LoadLibrary("iphlpapi.dll");
|
||||
if (!hnd_iphlpapi)
|
||||
return ARES_ELOADIPHLPAPI;
|
||||
|
||||
fpGetNetworkParams = (fpGetNetworkParams_t)
|
||||
ares_fpGetNetworkParams = (fpGetNetworkParams_t)
|
||||
GetProcAddress(hnd_iphlpapi, "GetNetworkParams");
|
||||
if (!fpGetNetworkParams)
|
||||
if (!ares_fpGetNetworkParams)
|
||||
{
|
||||
FreeLibrary(hnd_iphlpapi);
|
||||
return ARES_EADDRGETNETWORKPARAMS;
|
||||
@@ -67,7 +67,7 @@ static int ares_win32_init(void)
|
||||
hnd_advapi32 = LoadLibrary("advapi32.dll");
|
||||
if (hnd_advapi32)
|
||||
{
|
||||
fpSystemFunction036 = (fpSystemFunction036_t)
|
||||
ares_fpSystemFunction036 = (fpSystemFunction036_t)
|
||||
GetProcAddress(hnd_advapi32, "SystemFunction036");
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ static int ares_win32_init(void)
|
||||
|
||||
static void ares_win32_cleanup(void)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef USE_WINSOCK
|
||||
if (hnd_advapi32)
|
||||
FreeLibrary(hnd_advapi32);
|
||||
if (hnd_iphlpapi)
|
||||
@@ -123,7 +123,7 @@ void ares_library_cleanup(void)
|
||||
|
||||
int ares_library_initialized(void)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef USE_WINSOCK
|
||||
if (!ares_initialized)
|
||||
return ARES_ENOTINITIALIZED;
|
||||
#endif
|
||||
|
@@ -19,9 +19,9 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef USE_WINSOCK
|
||||
|
||||
#include <iphlpapi.h>
|
||||
|
||||
@@ -31,10 +31,10 @@ typedef BOOLEAN (APIENTRY *fpSystemFunction036_t) (void*, ULONG);
|
||||
/* Forward-declaration of variables defined in ares_library_init.c */
|
||||
/* that are global and unique instances for whole c-ares library. */
|
||||
|
||||
extern fpGetNetworkParams_t fpGetNetworkParams;
|
||||
extern fpSystemFunction036_t fpSystemFunction036;
|
||||
extern fpGetNetworkParams_t ares_fpGetNetworkParams;
|
||||
extern fpSystemFunction036_t ares_fpSystemFunction036;
|
||||
|
||||
#endif /* WIN32 */
|
||||
#endif /* USE_WINSOCK */
|
||||
|
||||
#endif /* HEADER_CARES_LIBRARY_INIT_H */
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
@@ -14,7 +14,7 @@
|
||||
.\" this software for any purpose. It is provided "as is"
|
||||
.\" without express or implied warranty.
|
||||
.\"
|
||||
.TH ARES_MKQUERY 3 "4 January 2000"
|
||||
.TH ARES_MKQUERY 3 "20 Nov 2009"
|
||||
.SH NAME
|
||||
ares_mkquery \- Compose a single-question DNS query buffer
|
||||
.SH SYNOPSIS
|
||||
@@ -22,7 +22,7 @@ ares_mkquery \- Compose a single-question DNS query buffer
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_mkquery(const char *\fIname\fP, int \fIdnsclass\fP, int \fItype\fP,
|
||||
.B unsigned short \fIid\fP, int \fIrd\fP, char **\fIbuf\fP,
|
||||
.B unsigned short \fIid\fP, int \fIrd\fP, unsigned char **\fIbuf\fP,
|
||||
.B int *\fIbuflen\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
|
@@ -16,14 +16,14 @@
|
||||
.\"
|
||||
.TH ARES_PARSE_A_REPLY 3 "25 July 1998"
|
||||
.SH NAME
|
||||
ares_parse_a_reply \- Parse a reply to a DNS query of type A into a hostent
|
||||
ares_parse_a_reply \- Parse a reply to a DNS query of type A
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_parse_a_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP,
|
||||
.B struct hostent **\fIhost\fP,
|
||||
.B struct addrttl *\fIaddrttls\fB, int *\fInaddrttls\fB);
|
||||
.B struct ares_addrttl *\fIaddrttls\fB, int *\fInaddrttls\fB);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
@@ -31,7 +31,7 @@ The
|
||||
function parses the response to a query of type A into a
|
||||
.BR "struct hostent"
|
||||
and/or an array of
|
||||
.BR "struct addrttls" .
|
||||
.BR "struct ares_addrttls" .
|
||||
The parameters
|
||||
.I abuf
|
||||
and
|
||||
@@ -51,7 +51,7 @@ and
|
||||
.IR naddrttls
|
||||
are both nonnull,
|
||||
then up to *naddrttls
|
||||
.BR "struct addrttl"
|
||||
.BR "struct ares_addrttl"
|
||||
records are stored in the array pointed to by addrttls,
|
||||
and then *naddrttls is set to the number of records so stored.
|
||||
Note that the memory for these records is supplied by the caller.
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
||||
struct hostent **host,
|
||||
struct addrttl *addrttls, int *naddrttls)
|
||||
struct ares_addrttl *addrttls, int *naddrttls)
|
||||
{
|
||||
unsigned int qdcount, ancount;
|
||||
int status, i, rr_type, rr_class, rr_len, rr_ttl, naddrs;
|
||||
@@ -157,7 +157,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
||||
}
|
||||
if (naddrs < max_addr_ttls)
|
||||
{
|
||||
struct addrttl * const at = &addrttls[naddrs];
|
||||
struct ares_addrttl * const at = &addrttls[naddrs];
|
||||
if (aptr + sizeof(struct in_addr) > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
|
@@ -14,16 +14,16 @@
|
||||
.\" this software for any purpose. It is provided "as is"
|
||||
.\" without express or implied warranty.
|
||||
.\"
|
||||
.TH ARES_PARSE_AAAA_REPLY 3 "10 March 2005"
|
||||
.TH ARES_PARSE_AAAA_REPLY 3 "20 Nov 2009"
|
||||
.SH NAME
|
||||
ares_parse_aaaa_reply \- Parse a reply to a DNS query of type AAAA into a hostent
|
||||
ares_parse_aaaa_reply \- Parse a reply to a DNS query of type AAAA
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_parse_aaaa_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP,
|
||||
.B struct hostent **\fIhost\fP,
|
||||
.B struct addrttl *\fIaddrttls\fB, int *\fInaddrttls\fB);
|
||||
.B struct ares_addr6ttl *\fIaddrttls\fB, int *\fInaddrttls\fB);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
@@ -31,7 +31,7 @@ The
|
||||
function parses the response to a query of type AAAA into a
|
||||
.BR "struct hostent"
|
||||
and/or an array of
|
||||
.BR "struct addrttls" .
|
||||
.BR "struct ares_addr6ttl" .
|
||||
The parameters
|
||||
.I abuf
|
||||
and
|
||||
@@ -51,7 +51,7 @@ and
|
||||
.IR naddrttls
|
||||
are both nonnull,
|
||||
then up to *naddrttls
|
||||
.BR "struct addr6ttl"
|
||||
.BR "struct ares_addr6ttl"
|
||||
records are stored in the array pointed to by addrttls,
|
||||
and then *naddrttls is set to the number of records so stored.
|
||||
Note that the memory for these records is supplied by the caller.
|
||||
|
@@ -1,6 +1,7 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 2005 Dominick Meglio
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright 2005 Dominick Meglio
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -15,7 +16,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
@@ -54,7 +55,7 @@
|
||||
#include "ares_private.h"
|
||||
|
||||
int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
struct hostent **host, struct addr6ttl *addrttls,
|
||||
struct hostent **host, struct ares_addr6ttl *addrttls,
|
||||
int *naddrttls)
|
||||
{
|
||||
unsigned int qdcount, ancount;
|
||||
@@ -156,7 +157,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
}
|
||||
if (naddrs < max_addr_ttls)
|
||||
{
|
||||
struct addr6ttl * const at = &addrttls[naddrs];
|
||||
struct ares_addr6ttl * const at = &addrttls[naddrs];
|
||||
if (aptr + sizeof(struct in6_addr) > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
|
@@ -1,13 +1,15 @@
|
||||
/* $Id */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
@@ -18,7 +20,7 @@
|
||||
* on behalf of AVIRA Gmbh - http://www.avira.com
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
|
81
ares/ares_parse_srv_reply.3
Normal file
81
ares/ares_parse_srv_reply.3
Normal file
@@ -0,0 +1,81 @@
|
||||
.\"
|
||||
.\" Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
.\"
|
||||
.\" Permission to use, copy, modify, and distribute this
|
||||
.\" software and its documentation for any purpose and without
|
||||
.\" fee is hereby granted, provided that the above copyright
|
||||
.\" notice appear in all copies and that both that copyright
|
||||
.\" notice and this permission notice appear in supporting
|
||||
.\" documentation, and that the name of M.I.T. not be used in
|
||||
.\" advertising or publicity pertaining to distribution of the
|
||||
.\" software without specific, written prior permission.
|
||||
.\" M.I.T. makes no representations about the suitability of
|
||||
.\" this software for any purpose. It is provided "as is"
|
||||
.\" without express or implied warranty.
|
||||
.\"
|
||||
.TH ARES_PARSE_SRV_REPLY 3 "4 August 2009"
|
||||
.SH NAME
|
||||
ares_parse_srv_reply \- Parse a reply to a DNS query of type SRV
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_parse_srv_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP,
|
||||
.B struct ares_srv_reply** \fIsrv_out\fP);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.B ares_parse_srv_reply
|
||||
function parses the response to a query of type SRV into a
|
||||
linked list of
|
||||
.I struct ares_srv_reply
|
||||
The parameters
|
||||
.I abuf
|
||||
and
|
||||
.I alen
|
||||
give the contents of the response. The result is stored in allocated
|
||||
memory and a pointer to it stored into the variable pointed to by
|
||||
.IR srv_out .
|
||||
It is the caller's responsibility to free the resulting
|
||||
.IR srv_out
|
||||
structure when it is no longer needed using the function
|
||||
.B ares_free_data
|
||||
.PP
|
||||
The structure
|
||||
.I ares_srv_reply
|
||||
contains the following fields:
|
||||
.sp
|
||||
.in +4n
|
||||
.nf
|
||||
struct ares_srv_reply {
|
||||
struct ares_srv_reply *next;
|
||||
unsigned short weight;
|
||||
unsigned short priority;
|
||||
unsigned short port;
|
||||
char *host;
|
||||
};
|
||||
.fi
|
||||
.in
|
||||
.PP
|
||||
.SH RETURN VALUES
|
||||
.B ares_parse_srv_reply
|
||||
can return any of the following values:
|
||||
.TP 15
|
||||
.B ARES_SUCCESS
|
||||
The response was successfully parsed.
|
||||
.TP 15
|
||||
.B ARES_EBADRESP
|
||||
The response was malformatted.
|
||||
.TP 15
|
||||
.B ARES_ENODATA
|
||||
The response did not contain an answer to the query.
|
||||
.TP 15
|
||||
.B ARES_ENOMEM
|
||||
Memory was exhausted.
|
||||
.SH AVAILABILITY
|
||||
This function was first introduced in c-ares version 1.7.0.
|
||||
.SH SEE ALSO
|
||||
.BR ares_query (3)
|
||||
.BR ares_free_data (3)
|
||||
.SH AUTHOR
|
||||
Written by Jakub Hrozek <jhrozek@redhat.com>, on behalf of Red Hat, Inc http://www.redhat.com
|
180
ares/ares_parse_srv_reply.c
Normal file
180
ares/ares_parse_srv_reply.c
Normal file
@@ -0,0 +1,180 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2009 by Jakub Hrozek <jhrozek@redhat.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_data.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
/* AIX portability check */
|
||||
#ifndef T_SRV
|
||||
# define T_SRV 33 /* server selection */
|
||||
#endif
|
||||
|
||||
int
|
||||
ares_parse_srv_reply (const unsigned char *abuf, int alen,
|
||||
struct ares_srv_reply **srv_out)
|
||||
{
|
||||
unsigned int qdcount, ancount, i;
|
||||
const unsigned char *aptr, *vptr;
|
||||
int status, rr_type, rr_class, rr_len;
|
||||
long len;
|
||||
char *hostname = NULL, *rr_name = NULL;
|
||||
struct ares_srv_reply *srv_head = NULL;
|
||||
struct ares_srv_reply *srv_last = NULL;
|
||||
struct ares_srv_reply *srv_curr;
|
||||
|
||||
/* Set *srv_out to NULL for all failure cases. */
|
||||
*srv_out = NULL;
|
||||
|
||||
/* Give up if abuf doesn't have room for a header. */
|
||||
if (alen < HFIXEDSZ)
|
||||
return ARES_EBADRESP;
|
||||
|
||||
/* Fetch the question and answer count from the header. */
|
||||
qdcount = DNS_HEADER_QDCOUNT (abuf);
|
||||
ancount = DNS_HEADER_ANCOUNT (abuf);
|
||||
if (qdcount != 1)
|
||||
return ARES_EBADRESP;
|
||||
if (ancount == 0)
|
||||
return ARES_ENODATA;
|
||||
|
||||
/* Expand the name from the question, and skip past the question. */
|
||||
aptr = abuf + HFIXEDSZ;
|
||||
status = ares_expand_name (aptr, abuf, alen, &hostname, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return status;
|
||||
|
||||
if (aptr + len + QFIXEDSZ > abuf + alen)
|
||||
{
|
||||
free (hostname);
|
||||
return ARES_EBADRESP;
|
||||
}
|
||||
aptr += len + QFIXEDSZ;
|
||||
|
||||
/* Examine each answer resource record (RR) in turn. */
|
||||
for (i = 0; i < ancount; i++)
|
||||
{
|
||||
/* Decode the RR up to the data field. */
|
||||
status = ares_expand_name (aptr, abuf, alen, &rr_name, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
{
|
||||
break;
|
||||
}
|
||||
aptr += len;
|
||||
if (aptr + RRFIXEDSZ > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
rr_type = DNS_RR_TYPE (aptr);
|
||||
rr_class = DNS_RR_CLASS (aptr);
|
||||
rr_len = DNS_RR_LEN (aptr);
|
||||
aptr += RRFIXEDSZ;
|
||||
|
||||
/* Check if we are really looking at a SRV record */
|
||||
if (rr_class == C_IN && rr_type == T_SRV)
|
||||
{
|
||||
/* parse the SRV record itself */
|
||||
if (rr_len < 6)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Allocate storage for this SRV answer appending it to the list */
|
||||
srv_curr = ares_malloc_data(ARES_DATATYPE_SRV_REPLY);
|
||||
if (!srv_curr)
|
||||
{
|
||||
status = ARES_ENOMEM;
|
||||
break;
|
||||
}
|
||||
if (srv_last)
|
||||
{
|
||||
srv_last->next = srv_curr;
|
||||
}
|
||||
else
|
||||
{
|
||||
srv_head = srv_curr;
|
||||
}
|
||||
srv_last = srv_curr;
|
||||
|
||||
vptr = aptr;
|
||||
srv_curr->priority = ntohs (*((unsigned short *)vptr));
|
||||
vptr += sizeof(unsigned short);
|
||||
srv_curr->weight = ntohs (*((unsigned short *)vptr));
|
||||
vptr += sizeof(unsigned short);
|
||||
srv_curr->port = ntohs (*((unsigned short *)vptr));
|
||||
vptr += sizeof(unsigned short);
|
||||
|
||||
status = ares_expand_name (vptr, abuf, alen, &srv_curr->host, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
}
|
||||
|
||||
/* Don't lose memory in the next iteration */
|
||||
free (rr_name);
|
||||
rr_name = NULL;
|
||||
|
||||
/* Move on to the next record */
|
||||
aptr += rr_len;
|
||||
}
|
||||
|
||||
if (hostname)
|
||||
free (hostname);
|
||||
if (rr_name)
|
||||
free (rr_name);
|
||||
|
||||
/* clean up on error */
|
||||
if (status != ARES_SUCCESS)
|
||||
{
|
||||
if (srv_head)
|
||||
ares_free_data (srv_head);
|
||||
return status;
|
||||
}
|
||||
|
||||
/* everything looks fine, return the data */
|
||||
*srv_out = srv_head;
|
||||
|
||||
return ARES_SUCCESS;
|
||||
}
|
80
ares/ares_parse_txt_reply.3
Normal file
80
ares/ares_parse_txt_reply.3
Normal file
@@ -0,0 +1,80 @@
|
||||
.\"
|
||||
.\" Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
.\"
|
||||
.\" Permission to use, copy, modify, and distribute this
|
||||
.\" software and its documentation for any purpose and without
|
||||
.\" fee is hereby granted, provided that the above copyright
|
||||
.\" notice appear in all copies and that both that copyright
|
||||
.\" notice and this permission notice appear in supporting
|
||||
.\" documentation, and that the name of M.I.T. not be used in
|
||||
.\" advertising or publicity pertaining to distribution of the
|
||||
.\" software without specific, written prior permission.
|
||||
.\" M.I.T. makes no representations about the suitability of
|
||||
.\" this software for any purpose. It is provided "as is"
|
||||
.\" without express or implied warranty.
|
||||
.\"
|
||||
.TH ARES_PARSE_TXT_REPLY 3 "27 October 2009"
|
||||
.SH NAME
|
||||
ares_parse_txt_reply \- Parse a reply to a DNS query of type TXT
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_parse_txt_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP,
|
||||
.B struct ares_txt_reply **\fItxt_out\fP);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.B ares_parse_txt_reply
|
||||
function parses the response to a query of type TXT into a
|
||||
linked list of
|
||||
.I struct ares_txt_reply
|
||||
The parameters
|
||||
.I abuf
|
||||
and
|
||||
.I alen
|
||||
give the contents of the response. The result is stored in allocated
|
||||
memory and a pointer to it stored into the variable pointed to by
|
||||
.IR txt_out .
|
||||
It is the caller's responsibility to free the resulting
|
||||
.IR txt_out
|
||||
structure when it is no longer needed using the function
|
||||
.B ares_free_data
|
||||
.PP
|
||||
The structure
|
||||
.I ares_txt_reply
|
||||
contains the following fields:
|
||||
.sp
|
||||
.in +4n
|
||||
.nf
|
||||
struct ares_txt_reply {
|
||||
struct ares_txt_reply *next;
|
||||
unsigned int length;
|
||||
unsigned char *txt;
|
||||
};
|
||||
.fi
|
||||
.in
|
||||
.PP
|
||||
.SH RETURN VALUES
|
||||
.B ares_parse_txt_reply
|
||||
can return any of the following values:
|
||||
.TP 15
|
||||
.B ARES_SUCCESS
|
||||
The response was successfully parsed.
|
||||
.TP 15
|
||||
.B ARES_EBADRESP
|
||||
The response was malformatted.
|
||||
.TP 15
|
||||
.B ARES_ENODATA
|
||||
The response did not contain an answer to the query.
|
||||
.TP 15
|
||||
.B ARES_ENOMEM
|
||||
Memory was exhausted.
|
||||
.SH AVAILABILITY
|
||||
This function was first introduced in c-ares version 1.7.0.
|
||||
.SH SEE ALSO
|
||||
.BR ares_query (3)
|
||||
.BR ares_free_data (3)
|
||||
.SH AUTHOR
|
||||
Written by Jakub Hrozek <jhrozek@redhat.com>, on behalf of Red Hat, Inc http://www.redhat.com
|
||||
|
202
ares/ares_parse_txt_reply.c
Normal file
202
ares/ares_parse_txt_reply.c
Normal file
@@ -0,0 +1,202 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2009 by Jakub Hrozek <jhrozek@redhat.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_data.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
int
|
||||
ares_parse_txt_reply (const unsigned char *abuf, int alen,
|
||||
struct ares_txt_reply **txt_out)
|
||||
{
|
||||
size_t substr_len, str_len;
|
||||
unsigned int qdcount, ancount, i;
|
||||
const unsigned char *aptr;
|
||||
const unsigned char *strptr;
|
||||
int status, rr_type, rr_class, rr_len;
|
||||
long len;
|
||||
char *hostname = NULL, *rr_name = NULL;
|
||||
struct ares_txt_reply *txt_head = NULL;
|
||||
struct ares_txt_reply *txt_last = NULL;
|
||||
struct ares_txt_reply *txt_curr;
|
||||
|
||||
/* Set *txt_out to NULL for all failure cases. */
|
||||
*txt_out = NULL;
|
||||
|
||||
/* Give up if abuf doesn't have room for a header. */
|
||||
if (alen < HFIXEDSZ)
|
||||
return ARES_EBADRESP;
|
||||
|
||||
/* Fetch the question and answer count from the header. */
|
||||
qdcount = DNS_HEADER_QDCOUNT (abuf);
|
||||
ancount = DNS_HEADER_ANCOUNT (abuf);
|
||||
if (qdcount != 1)
|
||||
return ARES_EBADRESP;
|
||||
if (ancount == 0)
|
||||
return ARES_ENODATA;
|
||||
|
||||
/* Expand the name from the question, and skip past the question. */
|
||||
aptr = abuf + HFIXEDSZ;
|
||||
status = ares_expand_name (aptr, abuf, alen, &hostname, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return status;
|
||||
|
||||
if (aptr + len + QFIXEDSZ > abuf + alen)
|
||||
{
|
||||
free (hostname);
|
||||
return ARES_EBADRESP;
|
||||
}
|
||||
aptr += len + QFIXEDSZ;
|
||||
|
||||
/* Examine each answer resource record (RR) in turn. */
|
||||
for (i = 0; i < ancount; i++)
|
||||
{
|
||||
/* Decode the RR up to the data field. */
|
||||
status = ares_expand_name (aptr, abuf, alen, &rr_name, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
{
|
||||
break;
|
||||
}
|
||||
aptr += len;
|
||||
if (aptr + RRFIXEDSZ > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
rr_type = DNS_RR_TYPE (aptr);
|
||||
rr_class = DNS_RR_CLASS (aptr);
|
||||
rr_len = DNS_RR_LEN (aptr);
|
||||
aptr += RRFIXEDSZ;
|
||||
|
||||
/* Check if we are really looking at a TXT record */
|
||||
if (rr_class == C_IN && rr_type == T_TXT)
|
||||
{
|
||||
/* Allocate storage for this TXT answer appending it to the list */
|
||||
txt_curr = ares_malloc_data(ARES_DATATYPE_TXT_REPLY);
|
||||
if (!txt_curr)
|
||||
{
|
||||
status = ARES_ENOMEM;
|
||||
break;
|
||||
}
|
||||
if (txt_last)
|
||||
{
|
||||
txt_last->next = txt_curr;
|
||||
}
|
||||
else
|
||||
{
|
||||
txt_head = txt_curr;
|
||||
}
|
||||
txt_last = txt_curr;
|
||||
|
||||
/*
|
||||
* There may be multiple substrings in a single TXT record. Each
|
||||
* substring may be up to 255 characters in length, with a
|
||||
* "length byte" indicating the size of the substring payload.
|
||||
* RDATA contains both the length-bytes and payloads of all
|
||||
* substrings contained therein.
|
||||
*/
|
||||
|
||||
/* Compute total length to allow a single memory allocation */
|
||||
strptr = aptr;
|
||||
while (strptr < (aptr + rr_len))
|
||||
{
|
||||
substr_len = (unsigned char)*strptr;
|
||||
txt_curr->length += substr_len;
|
||||
strptr += substr_len + 1;
|
||||
}
|
||||
|
||||
/* Including null byte */
|
||||
txt_curr->txt = malloc (txt_curr->length + 1);
|
||||
if (txt_curr->txt == NULL)
|
||||
{
|
||||
status = ARES_ENOMEM;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Step through the list of substrings, concatenating them */
|
||||
str_len = 0;
|
||||
strptr = aptr;
|
||||
while (strptr < (aptr + rr_len))
|
||||
{
|
||||
substr_len = (unsigned char)*strptr;
|
||||
strptr++;
|
||||
memcpy ((char *) txt_curr->txt + str_len, strptr, substr_len);
|
||||
str_len += substr_len;
|
||||
strptr += substr_len;
|
||||
}
|
||||
/* Make sure we NULL-terminate */
|
||||
*((char *) txt_curr->txt + txt_curr->length) = '\0';
|
||||
}
|
||||
|
||||
/* Don't lose memory in the next iteration */
|
||||
free (rr_name);
|
||||
rr_name = NULL;
|
||||
|
||||
/* Move on to the next record */
|
||||
aptr += rr_len;
|
||||
}
|
||||
|
||||
if (hostname)
|
||||
free (hostname);
|
||||
if (rr_name)
|
||||
free (rr_name);
|
||||
|
||||
/* clean up on error */
|
||||
if (status != ARES_SUCCESS)
|
||||
{
|
||||
if (txt_head)
|
||||
ares_free_data (txt_head);
|
||||
return status;
|
||||
}
|
||||
|
||||
/* everything looks fine, return the data */
|
||||
*txt_out = txt_head;
|
||||
|
||||
return ARES_SUCCESS;
|
||||
}
|
@@ -30,7 +30,7 @@
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if !defined(WIN32) || defined(WATT32)
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
@@ -312,7 +312,7 @@ void ares__send_query(ares_channel channel, struct query *query,
|
||||
struct timeval *now);
|
||||
void ares__close_sockets(ares_channel channel, struct server_state *server);
|
||||
int ares__get_hostent(FILE *fp, int family, struct hostent **host);
|
||||
int ares__read_line(FILE *fp, char **buf, int *bufsize);
|
||||
int ares__read_line(FILE *fp, char **buf, size_t *bufsize);
|
||||
void ares__free_query(struct query *query);
|
||||
unsigned short ares__generate_new_id(rc4_key* key);
|
||||
struct timeval ares__tvnow(void);
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2004-2009 by Daniel Stenberg
|
||||
* Copyright (C) 2004-2010 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -16,7 +16,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
@@ -92,7 +92,7 @@ static void skip_server(ares_channel channel, struct query *query,
|
||||
int whichserver);
|
||||
static void next_server(ares_channel channel, struct query *query,
|
||||
struct timeval *now);
|
||||
static int configure_socket(int s, ares_channel channel);
|
||||
static int configure_socket(ares_socket_t s, ares_channel channel);
|
||||
static int open_tcp_socket(ares_channel channel, struct server_state *server);
|
||||
static int open_udp_socket(ares_channel channel, struct server_state *server);
|
||||
static int same_questions(const unsigned char *qbuf, int qlen,
|
||||
@@ -139,18 +139,28 @@ long ares__timeoffset(struct timeval *now,
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* generic process function
|
||||
*/
|
||||
static void processfds(ares_channel channel,
|
||||
fd_set *read_fds, ares_socket_t read_fd,
|
||||
fd_set *write_fds, ares_socket_t write_fd)
|
||||
{
|
||||
struct timeval now = ares__tvnow();
|
||||
|
||||
write_tcp_data(channel, write_fds, write_fd, &now);
|
||||
read_tcp_data(channel, read_fds, read_fd, &now);
|
||||
read_udp_packets(channel, read_fds, read_fd, &now);
|
||||
process_timeouts(channel, &now);
|
||||
process_broken_connections(channel, &now);
|
||||
}
|
||||
|
||||
/* Something interesting happened on the wire, or there was a timeout.
|
||||
* See what's up and respond accordingly.
|
||||
*/
|
||||
void ares_process(ares_channel channel, fd_set *read_fds, fd_set *write_fds)
|
||||
{
|
||||
struct timeval now = ares__tvnow();
|
||||
|
||||
write_tcp_data(channel, write_fds, ARES_SOCKET_BAD, &now);
|
||||
read_tcp_data(channel, read_fds, ARES_SOCKET_BAD, &now);
|
||||
read_udp_packets(channel, read_fds, ARES_SOCKET_BAD, &now);
|
||||
process_timeouts(channel, &now);
|
||||
process_broken_connections(channel, &now);
|
||||
processfds(channel, read_fds, ARES_SOCKET_BAD, write_fds, ARES_SOCKET_BAD);
|
||||
}
|
||||
|
||||
/* Something interesting happened on the wire, or there was a timeout.
|
||||
@@ -161,12 +171,7 @@ void ares_process_fd(ares_channel channel,
|
||||
file descriptors */
|
||||
ares_socket_t write_fd)
|
||||
{
|
||||
struct timeval now = ares__tvnow();
|
||||
|
||||
write_tcp_data(channel, NULL, write_fd, &now);
|
||||
read_tcp_data(channel, NULL, read_fd, &now);
|
||||
read_udp_packets(channel, NULL, read_fd, &now);
|
||||
process_timeouts(channel, &now);
|
||||
processfds(channel, NULL, read_fd, NULL, write_fd);
|
||||
}
|
||||
|
||||
|
||||
@@ -174,7 +179,8 @@ void ares_process_fd(ares_channel channel,
|
||||
* otherwise. This is mostly for HP-UX, which could return EAGAIN or
|
||||
* EWOULDBLOCK. See this man page
|
||||
*
|
||||
* http://devrsrc1.external.hp.com/STKS/cgi-bin/man2html?manpage=/usr/share/man/man2.Z/send.2
|
||||
* http://devrsrc1.external.hp.com/STKS/cgi-bin/man2html?
|
||||
* manpage=/usr/share/man/man2.Z/send.2
|
||||
*/
|
||||
static int try_again(int errnum)
|
||||
{
|
||||
@@ -732,7 +738,7 @@ void ares__send_query(ares_channel channel, struct query *query,
|
||||
return;
|
||||
}
|
||||
}
|
||||
sendreq = calloc(sizeof(struct send_request), 1);
|
||||
sendreq = calloc(1, sizeof(struct send_request));
|
||||
if (!sendreq)
|
||||
{
|
||||
end_query(channel, query, ARES_ENOMEM, NULL, 0);
|
||||
@@ -802,8 +808,9 @@ void ares__send_query(ares_channel channel, struct query *query,
|
||||
}
|
||||
|
||||
/*
|
||||
* setsocknonblock sets the given socket to either blocking or non-blocking mode
|
||||
* based on the 'nonblock' boolean argument. This function is highly portable.
|
||||
* setsocknonblock sets the given socket to either blocking or non-blocking
|
||||
* mode based on the 'nonblock' boolean argument. This function is highly
|
||||
* portable.
|
||||
*/
|
||||
static int setsocknonblock(ares_socket_t sockfd, /* operate on this */
|
||||
int nonblock /* TRUE or FALSE */)
|
||||
@@ -856,7 +863,7 @@ static int setsocknonblock(ares_socket_t sockfd, /* operate on this */
|
||||
#endif
|
||||
}
|
||||
|
||||
static int configure_socket(int s, ares_channel channel)
|
||||
static int configure_socket(ares_socket_t s, ares_channel channel)
|
||||
{
|
||||
setsocknonblock(s, TRUE);
|
||||
|
||||
@@ -902,10 +909,10 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
|
||||
|
||||
#ifdef TCP_NODELAY
|
||||
/*
|
||||
* Disable the Nagle algorithm (only relevant for TCP sockets, and thus not in
|
||||
* configure_socket). In general, in DNS lookups we're pretty much interested
|
||||
* in firing off a single request and then waiting for a reply, so batching
|
||||
* isn't very interesting in general.
|
||||
* Disable the Nagle algorithm (only relevant for TCP sockets, and thus not
|
||||
* in configure_socket). In general, in DNS lookups we're pretty much
|
||||
* interested in firing off a single request and then waiting for a reply,
|
||||
* so batching isn't very interesting in general.
|
||||
*/
|
||||
opt = 1;
|
||||
if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY,
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
|
@@ -50,7 +50,7 @@
|
||||
* that the dimension of a constant array can not be a negative one.
|
||||
* In this way if the compile time verification fails, the compilation
|
||||
* will fail issuing an error. The error description wording is compiler
|
||||
* dependant but it will be quite similar to one of the following:
|
||||
* dependent but it will be quite similar to one of the following:
|
||||
*
|
||||
* "negative subscript or subscript is too large"
|
||||
* "array must have at least one element"
|
||||
|
@@ -21,7 +21,7 @@ ares_save_options \- Save configuration values obtained from initialized ares_ch
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B void ares_save_options(ares_channel \fIchannel\fP, struct ares_options *\fIoptions\fP, int *\fIoptmask\fP)
|
||||
.B int ares_save_options(ares_channel \fIchannel\fP, struct ares_options *\fIoptions\fP, int *\fIoptmask\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The \fBares_save_options(3)\fP function saves the channel data identified by
|
||||
@@ -36,6 +36,20 @@ The resultant options and optmask are then able to be
|
||||
passed directly to ares_init_options. When the options
|
||||
are no longer needed, ares_destroy_options should be called
|
||||
to free any associated memory.
|
||||
.SH RETURN VALUES
|
||||
.B ares_save_options(3)
|
||||
can return any of the following values:
|
||||
.TP 15
|
||||
.B ARES_SUCCESS
|
||||
The channel data was successfuly stored
|
||||
.TP 15
|
||||
.B ARES_ENOMEM
|
||||
The memory was exhausted
|
||||
.TP 15
|
||||
.B ARES_ENODATA
|
||||
The channel data identified by
|
||||
.IR channel
|
||||
were invalid.
|
||||
.SH NOTE
|
||||
Since c-ares 1.6.0 the ares_options struct has been "locked" meaning that it
|
||||
won't be extended to cover new funtions. This function will remain
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -238,7 +238,8 @@ static int single_domain(ares_channel channel, const char *name, char **s)
|
||||
const char *hostaliases;
|
||||
FILE *fp;
|
||||
char *line = NULL;
|
||||
int linesize, status;
|
||||
int status;
|
||||
size_t linesize;
|
||||
const char *p, *q;
|
||||
int error;
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
|
@@ -1,15 +1,20 @@
|
||||
.\" $Id$
|
||||
.\"
|
||||
.TH ARES_SET_SOCKET_CALLBACK 3 "2 Dec 2008"
|
||||
.TH ARES_SET_SOCKET_CALLBACK 3 "20 Nov 2009"
|
||||
.SH NAME
|
||||
ares_set_socket_callback \- Set a socket creation callback
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
int ares_set_socket_callback(ares_channel \fIchannel\fP,
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B void ares_set_socket_callback(ares_channel \fIchannel\fP,
|
||||
ares_sock_create_callback \fIcallback\fP,
|
||||
void *\fIuserdata\fP)
|
||||
.PP
|
||||
.B cc file.c -lcares
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
This function sets a \fIcallback\fP in the given ares channel handle. This
|
||||
callback function will be invoked after the socket has been created, and
|
||||
connected to the remote server. The callback must return ARES_SUCCESS if
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#ifndef __ARES_SETUP_H
|
||||
#define __ARES_SETUP_H
|
||||
#ifndef HEADER_CARES_SETUP_H
|
||||
#define HEADER_CARES_SETUP_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
@@ -48,6 +48,17 @@
|
||||
/* system header files in our config files, avoid this at any cost. */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* AIX 4.3 and newer needs _THREAD_SAFE defined to build
|
||||
* proper reentrant code. Others may also need it.
|
||||
*/
|
||||
|
||||
#ifdef NEED_THREAD_SAFE
|
||||
# ifndef _THREAD_SAFE
|
||||
# define _THREAD_SAFE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Tru64 needs _REENTRANT set for a few function prototypes and
|
||||
* things to appear in the system header files. Unixware needs it
|
||||
@@ -78,16 +89,16 @@
|
||||
|
||||
#include <ares_rules.h>
|
||||
|
||||
/* ================================================================ */
|
||||
/* No system header file shall be included in this file before this */
|
||||
/* point. The only allowed ones are those included from curlbuild.h */
|
||||
/* ================================================================ */
|
||||
/* ================================================================= */
|
||||
/* No system header file shall be included in this file before this */
|
||||
/* point. The only allowed ones are those included from ares_build.h */
|
||||
/* ================================================================= */
|
||||
|
||||
/*
|
||||
* Include header files for windows builds before redefining anything.
|
||||
* Use this preproessor block only to include or exclude windows.h,
|
||||
* winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
|
||||
* to any other further and independant block. Under Cygwin things work
|
||||
* to any other further and independent block. Under Cygwin things work
|
||||
* just as under linux (e.g. <sys/socket.h>) and the winsock headers should
|
||||
* never be included when __CYGWIN__ is defined. configure script takes
|
||||
* care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H,
|
||||
@@ -133,12 +144,6 @@
|
||||
|
||||
#ifndef HAVE_CONFIG_H
|
||||
|
||||
#if defined(__DJGPP__) || (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \
|
||||
defined(__POCC__)
|
||||
#else
|
||||
#define ssize_t int
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_SYS_TIME_H) && !defined(_MSC_VER) && !defined(__WATCOMC__)
|
||||
#define HAVE_SYS_TIME_H
|
||||
#endif
|
||||
@@ -153,6 +158,12 @@
|
||||
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#ifdef __POCC__
|
||||
# include <sys/types.h>
|
||||
# include <unistd.h>
|
||||
# define ESRCH 3
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Recent autoconf versions define these symbols in ares_config.h. We don't
|
||||
* want them (since they collide with the libcurl ones when we build
|
||||
@@ -184,4 +195,4 @@
|
||||
#include "setup_once.h"
|
||||
#endif
|
||||
|
||||
#endif /* __ARES_SETUP_H */
|
||||
#endif /* HEADER_CARES_SETUP_H */
|
@@ -16,7 +16,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
#include "ares_strcasecmp.h"
|
||||
|
||||
#ifndef HAVE_STRCASECMP
|
||||
|
@@ -18,7 +18,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifndef HAVE_STRCASECMP
|
||||
extern int ares_strcasecmp(const char *a, const char *b);
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
#include "ares_strdup.h"
|
||||
|
||||
#ifndef HAVE_STRDUP
|
||||
|
@@ -18,7 +18,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifndef HAVE_STRDUP
|
||||
extern char *ares_strdup(const char *s1);
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
#include <assert.h>
|
||||
#include "ares.h"
|
||||
|
||||
@@ -46,7 +46,8 @@ const char *ares_strerror(int code)
|
||||
"Illegal hints flags specified",
|
||||
"c-ares library initialization not yet performed",
|
||||
"Error loading iphlpapi.dll",
|
||||
"Could not find GetNetworkParams function"
|
||||
"Could not find GetNetworkParams function",
|
||||
"DNS query cancelled"
|
||||
};
|
||||
|
||||
if(code >= 0 && code < (int)(sizeof(errtext) / sizeof(*errtext)))
|
||||
|
@@ -22,7 +22,7 @@ ares_fds \- Get file descriptors to select on for name service
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B struct timeval *ares_timeout(ares_channel \fIchannel\fP,
|
||||
.B struct timeval *\fImaxtv\fP, struct timeval *\fItvbuf\fP)
|
||||
.B struct timeval *\fImaxtv\fP, struct timeval *\fItv\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
@@ -33,13 +33,13 @@ invoking \fIares_process(3)\fP to process timeouts. The parameter
|
||||
specifies a existing maximum timeout, or
|
||||
.B NULL
|
||||
if the caller does not wish to apply a maximum timeout. The parameter
|
||||
.I tvbuf
|
||||
.I tv
|
||||
must point to a writable buffer of type
|
||||
.BR "struct timeval" .
|
||||
It is valid for
|
||||
.I maxtv
|
||||
and
|
||||
.I tvbuf
|
||||
.I tv
|
||||
to have the same value.
|
||||
.PP
|
||||
If no queries have timeouts pending sooner than the given maximum
|
||||
@@ -50,9 +50,9 @@ returns the value of
|
||||
otherwise
|
||||
.B ares_timeout
|
||||
stores the appropriate timeout value into the buffer pointed to by
|
||||
.I tvbuf
|
||||
.I tv
|
||||
and returns the value of
|
||||
.IR tvbuf .
|
||||
.IR tv .
|
||||
.SH SEE ALSO
|
||||
.BR ares_fds (3),
|
||||
.BR ares_process (3)
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/* $Id$ */
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
#include "ares.h"
|
||||
|
||||
const char *ares_version(int *version)
|
||||
|
@@ -4,14 +4,14 @@
|
||||
#define ARES__VERSION_H
|
||||
|
||||
#define ARES_VERSION_MAJOR 1
|
||||
#define ARES_VERSION_MINOR 6
|
||||
#define ARES_VERSION_MINOR 7
|
||||
#define ARES_VERSION_PATCH 1
|
||||
#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
|
||||
(ARES_VERSION_MINOR<<8)|\
|
||||
(ARES_VERSION_PATCH))
|
||||
#define ARES_VERSION_STR "1.6.1-CVS"
|
||||
#define ARES_VERSION_STR "1.7.1-CVS"
|
||||
|
||||
#if (ARES_VERSION >= 0x010601)
|
||||
#if (ARES_VERSION >= 0x010700)
|
||||
# define CARES_HAVE_ARES_LIBRARY_INIT 1
|
||||
# define CARES_HAVE_ARES_LIBRARY_CLEANUP 1
|
||||
#else
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
|
@@ -18,7 +18,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
#include "ares.h"
|
||||
|
||||
#ifndef HAVE_WRITEV
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
#ifndef HAVE_BITNCMP
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
#include "bitncmp.h"
|
||||
|
||||
/*
|
||||
@@ -41,7 +41,7 @@ ares_bitncmp(const void *l, const void *r, int n) {
|
||||
|
||||
b = n / 8;
|
||||
x = memcmp(l, r, b);
|
||||
if (x)
|
||||
if (x || (n % 8) == 0)
|
||||
return (x);
|
||||
|
||||
lb = ((const unsigned char *)l)[b];
|
||||
|
@@ -1,7 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
# The logic for finding the right libtoolize is taken from libcurl's buildconf
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# findtool works as 'which' but we use a different name to make it more
|
||||
# obvious we aren't using 'which'! ;-)
|
||||
@@ -22,6 +20,37 @@ findtool(){
|
||||
IFS=$old_IFS
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# removethis() removes all files and subdirectories with the given name,
|
||||
# inside and below the current subdirectory at invocation time.
|
||||
#
|
||||
removethis(){
|
||||
if test "$#" = "1"; then
|
||||
find . -depth -name $1 -print > buildconf.tmp.$$
|
||||
while read fdname
|
||||
do
|
||||
if test -f "$fdname"; then
|
||||
rm -f "$fdname"
|
||||
elif test -d "$fdname"; then
|
||||
rm -f -r "$fdname"
|
||||
fi
|
||||
done < buildconf.tmp.$$
|
||||
rm -f buildconf.tmp.$$
|
||||
fi
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# Ensure that buildconf runs from the subdirectory where configure.ac lives
|
||||
#
|
||||
if test ! -f configure.ac ||
|
||||
test ! -f ares_init.c ||
|
||||
test ! -f m4/cares-functions.m4; then
|
||||
echo "Can not run buildconf from outside of c-ares source subdirectory!"
|
||||
echo "Change to the subdirectory where buildconf is found, and try again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# this approach that tries 'glibtool' first is some kind of work-around for
|
||||
# some BSD-systems I believe that use to provide the GNU libtool named
|
||||
# glibtool, with 'libtool' being something completely different.
|
||||
@@ -38,6 +67,49 @@ else
|
||||
libtoolize=`findtool $LIBTOOLIZE`
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# Remove files generated on previous buildconf/configure run.
|
||||
#
|
||||
for fname in .deps \
|
||||
.libs \
|
||||
*.la \
|
||||
*.lo \
|
||||
*.a \
|
||||
*.o \
|
||||
Makefile \
|
||||
Makefile.in \
|
||||
aclocal.m4 \
|
||||
aclocal.m4.bak \
|
||||
ares_build.h \
|
||||
ares_config.h \
|
||||
ares_config.h.in \
|
||||
autom4te.cache \
|
||||
compile \
|
||||
config.guess \
|
||||
config.log \
|
||||
config.lt \
|
||||
config.status \
|
||||
config.sub \
|
||||
configure \
|
||||
depcomp \
|
||||
libcares.pc \
|
||||
libtool \
|
||||
libtool.m4 \
|
||||
ltmain.sh \
|
||||
ltoptions.m4 \
|
||||
ltsugar.m4 \
|
||||
ltversion.m4 \
|
||||
lt~obsolete.m4 \
|
||||
missing \
|
||||
stamp-h1 \
|
||||
stamp-h2 ; do
|
||||
removethis "$fname"
|
||||
done
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# run the correct scripts now
|
||||
#
|
||||
|
||||
${libtoolize} --copy --automake --force
|
||||
${ACLOCAL:-aclocal} -I m4 $ACLOCAL_FLAGS
|
||||
${AUTOHEADER:-autoheader}
|
||||
|
66
ares/cares.rc
Normal file
66
ares/cares.rc
Normal file
@@ -0,0 +1,66 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 2009 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include <winver.h>
|
||||
#include "ares_version.h"
|
||||
|
||||
LANGUAGE 0x09,0x01
|
||||
|
||||
#define RC_VERSION ARES_VERSION_MAJOR, ARES_VERSION_MINOR, ARES_VERSION_PATCH, 0
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION RC_VERSION
|
||||
PRODUCTVERSION RC_VERSION
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#if defined(DEBUGBUILD) || defined(_DEBUG)
|
||||
FILEFLAGS 1
|
||||
#else
|
||||
FILEFLAGS 0
|
||||
#endif
|
||||
FILEOS VOS__WINDOWS32
|
||||
FILETYPE VFT_DLL
|
||||
FILESUBTYPE 0x0L
|
||||
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "The c-ares library, http://c-ares.haxx.se/\0"
|
||||
#if defined(DEBUGBUILD) || defined(_DEBUG)
|
||||
VALUE "FileDescription", "c-ares Debug Shared Library\0"
|
||||
VALUE "FileVersion", ARES_VERSION_STR "\0"
|
||||
VALUE "InternalName", "c-ares\0"
|
||||
VALUE "OriginalFilename", "caresd.dll\0"
|
||||
#else
|
||||
VALUE "FileDescription", "c-ares Shared Library\0"
|
||||
VALUE "FileVersion", ARES_VERSION_STR "\0"
|
||||
VALUE "InternalName", "c-ares\0"
|
||||
VALUE "OriginalFilename", "cares.dll\0"
|
||||
#endif
|
||||
VALUE "ProductName", "The c-ares library\0"
|
||||
VALUE "ProductVersion", ARES_VERSION_STR "\0"
|
||||
VALUE "LegalCopyright", "<22> 2004 - 2009 Daniel Stenberg, <daniel@haxx.se>.\0"
|
||||
VALUE "License", "http://c-ares.haxx.se/license.html\0"
|
||||
END
|
||||
END
|
||||
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
@@ -25,13 +25,18 @@
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Define if you have the <getopt.h> header file. */
|
||||
#if defined(__MINGW32__)
|
||||
#if defined(__MINGW32__) || defined(__POCC__)
|
||||
#define HAVE_GETOPT_H 1
|
||||
#endif
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define if you have the <process.h> header file. */
|
||||
#ifndef __SALFORDC__
|
||||
#define HAVE_PROCESS_H 1
|
||||
#endif
|
||||
|
||||
/* Define if you have the <signal.h> header file. */
|
||||
#define HAVE_SIGNAL_H 1
|
||||
|
||||
@@ -41,9 +46,6 @@
|
||||
/* Define if you have the <time.h> header file. */
|
||||
#define HAVE_TIME_H 1
|
||||
|
||||
/* Define if you have the <process.h> header file. */
|
||||
#define HAVE_PROCESS_H 1
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) || \
|
||||
defined(__POCC__)
|
||||
@@ -57,10 +59,14 @@
|
||||
#define HAVE_WINSOCK_H 1
|
||||
|
||||
/* Define if you have the <winsock2.h> header file. */
|
||||
#ifndef __SALFORDC__
|
||||
#define HAVE_WINSOCK2_H 1
|
||||
#endif
|
||||
|
||||
/* Define if you have the <ws2tcpip.h> header file. */
|
||||
#ifndef __SALFORDC__
|
||||
#define HAVE_WS2TCPIP_H 1
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* OTHER HEADER INFO */
|
||||
@@ -79,6 +85,12 @@
|
||||
/* FUNCTIONS */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Define if you have the closesocket function. */
|
||||
#define HAVE_CLOSESOCKET 1
|
||||
|
||||
/* Define if you have the gethostname function. */
|
||||
#define HAVE_GETHOSTNAME 1
|
||||
|
||||
/* Define if you have the ioctlsocket function. */
|
||||
#define HAVE_IOCTLSOCKET 1
|
||||
|
||||
@@ -100,9 +112,6 @@
|
||||
/* Define if you have the strnicmp function. */
|
||||
#define HAVE_STRNICMP 1
|
||||
|
||||
/* Define if you have the gethostname function. */
|
||||
#define HAVE_GETHOSTNAME 1
|
||||
|
||||
/* Define if you have the recv function. */
|
||||
#define HAVE_RECV 1
|
||||
|
||||
@@ -196,11 +205,17 @@
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define ssize_t if it is not an available 'typedefed' type */
|
||||
#if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || defined(__POCC__)
|
||||
#elif defined(_WIN64)
|
||||
#define ssize_t __int64
|
||||
#else
|
||||
#define ssize_t int
|
||||
#ifndef _SSIZE_T_DEFINED
|
||||
# if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \
|
||||
defined(__POCC__) || \
|
||||
defined(__MINGW32__)
|
||||
# elif defined(_WIN64)
|
||||
# define _SSIZE_T_DEFINED
|
||||
# define ssize_t __int64
|
||||
# else
|
||||
# define _SSIZE_T_DEFINED
|
||||
# define ssize_t int
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
@@ -211,7 +226,9 @@
|
||||
#define HAVE_STRUCT_ADDRINFO 1
|
||||
|
||||
/* Define this if you have struct sockaddr_storage */
|
||||
#ifndef __SALFORDC__
|
||||
#define HAVE_STRUCT_SOCKADDR_STORAGE 1
|
||||
#endif
|
||||
|
||||
/* Define this if you have struct timeval */
|
||||
#define HAVE_STRUCT_TIMEVAL 1
|
||||
@@ -256,10 +273,25 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is quite */
|
||||
/* convoluted, compiler dependant and in some cases even build target dependat. */
|
||||
/* When no build target is specified Pelles C 5.00 and later default build
|
||||
target is Windows Vista. We override default target to be Windows 2000. */
|
||||
#if defined(__POCC__) && (__POCC__ >= 500)
|
||||
# ifndef _WIN32_WINNT
|
||||
# define _WIN32_WINNT 0x0500
|
||||
# endif
|
||||
# ifndef WINVER
|
||||
# define WINVER 0x0500
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is
|
||||
quite convoluted, compiler dependent and even build target dependent. */
|
||||
#if defined(HAVE_WS2TCPIP_H)
|
||||
# if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
|
||||
# if defined(__POCC__)
|
||||
# define HAVE_FREEADDRINFO 1
|
||||
# define HAVE_GETADDRINFO 1
|
||||
# define HAVE_GETNAMEINFO 1
|
||||
# elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
|
||||
# define HAVE_FREEADDRINFO 1
|
||||
# define HAVE_GETADDRINFO 1
|
||||
# define HAVE_GETNAMEINFO 1
|
||||
@@ -270,6 +302,15 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__POCC__)
|
||||
# ifndef _MSC_VER
|
||||
# error Microsoft extensions /Ze compiler option is required
|
||||
# endif
|
||||
# ifndef __POCC__OLDNAMES
|
||||
# error Compatibility names /Go compiler option is required
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* IPV6 COMPATIBILITY */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
@@ -14,8 +14,9 @@ CARES_CHECK_OPTION_DEBUG
|
||||
CARES_CHECK_OPTION_OPTIMIZE
|
||||
CARES_CHECK_OPTION_WARNINGS
|
||||
CARES_CHECK_OPTION_CURLDEBUG
|
||||
CARES_CHECK_OPTION_SYMBOL_HIDING
|
||||
|
||||
CARES_CHECK_PATH_SEPARATOR
|
||||
CARES_CHECK_PATH_SEPARATOR_REQUIRED
|
||||
|
||||
dnl SED is mandatory for configure process and libtool.
|
||||
dnl Set it now, allowing it to be changed later.
|
||||
@@ -51,7 +52,7 @@ fi
|
||||
AC_SUBST([EGREP])
|
||||
|
||||
dnl AR is mandatory for configure process and libtool.
|
||||
dnl This is target dependant, so check it as a tool.
|
||||
dnl This is target dependent, so check it as a tool.
|
||||
AC_PATH_TOOL([AR], [ar], [not_found],
|
||||
[$PATH:/usr/bin:/usr/local/bin])
|
||||
if test -z "$AR" || test "$AR" = "not_found"; then
|
||||
@@ -59,6 +60,11 @@ if test -z "$AR" || test "$AR" = "not_found"; then
|
||||
fi
|
||||
AC_SUBST([AR])
|
||||
|
||||
dnl Remove non-configure distributed ares_build.h
|
||||
if test -f ${srcdir}/ares_build.h; then
|
||||
rm -f ${srcdir}/ares_build.h
|
||||
fi
|
||||
|
||||
dnl Fetch c-ares version from ares_version.h
|
||||
VERSION=`$SED -ne 's/^#define ARES_VERSION_STR "\(.*\)"/\1/p' ${srcdir}/ares_version.h`
|
||||
AM_INIT_AUTOMAKE([c-ares], [$VERSION])
|
||||
@@ -81,6 +87,7 @@ dnl This defines _ALL_SOURCE for AIX
|
||||
CARES_CHECK_AIX_ALL_SOURCE
|
||||
|
||||
dnl Our configure and build reentrant settings
|
||||
CARES_CONFIGURE_THREAD_SAFE
|
||||
CARES_CONFIGURE_REENTRANT
|
||||
|
||||
dnl check for how to do large files
|
||||
@@ -107,9 +114,39 @@ case $host in
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_MSG_CHECKING([if compiler is icc (to build with PIC)])
|
||||
case $CC in
|
||||
icc | */icc)
|
||||
AC_MSG_RESULT([yes])
|
||||
with_pic=yes
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([no])
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl libtool setup
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
AC_MSG_CHECKING([if we need CARES_BUILDING_LIBRARY])
|
||||
case $host in
|
||||
*-*-mingw*)
|
||||
AC_DEFINE(CARES_BUILDING_LIBRARY, 1, [when building c-ares library])
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_MSG_CHECKING([if we need CARES_STATICLIB])
|
||||
if test "X$enable_shared" = "Xno"
|
||||
then
|
||||
AC_DEFINE(CARES_STATICLIB, 1, [when not building a shared library])
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl platform/compiler/architecture specific checks/flags
|
||||
dnl **********************************************************************
|
||||
@@ -120,30 +157,21 @@ CARES_SET_COMPILER_DEBUG_OPTS
|
||||
CARES_SET_COMPILER_OPTIMIZE_OPTS
|
||||
CARES_SET_COMPILER_WARNING_OPTS
|
||||
|
||||
case $host in
|
||||
if test "$compiler_id" = "INTEL_UNIX_C"; then
|
||||
#
|
||||
x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
|
||||
#
|
||||
if test "$compiler_id" = "INTEL_UNIX_C"; then
|
||||
#
|
||||
if test "$compiler_num" -ge "900" &&
|
||||
test "$compiler_num" -lt "1000"; then
|
||||
dnl icc 9.X specific
|
||||
CFLAGS="$CFLAGS -i-dynamic"
|
||||
fi
|
||||
#
|
||||
if test "$compiler_num" -ge "1000"; then
|
||||
dnl icc 10.X or later
|
||||
CFLAGS="$CFLAGS -shared-intel"
|
||||
fi
|
||||
#
|
||||
fi
|
||||
;;
|
||||
if test "$compiler_num" -ge "1000"; then
|
||||
dnl icc 10.X or later
|
||||
CFLAGS="$CFLAGS -shared-intel"
|
||||
elif test "$compiler_num" -ge "900"; then
|
||||
dnl icc 9.X specific
|
||||
CFLAGS="$CFLAGS -i-dynamic"
|
||||
fi
|
||||
#
|
||||
esac
|
||||
fi
|
||||
|
||||
CARES_CHECK_COMPILER_HALT_ON_ERROR
|
||||
CARES_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
|
||||
CARES_CHECK_COMPILER_SYMBOL_HIDING
|
||||
|
||||
CARES_CHECK_NO_UNDEFINED
|
||||
AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
|
||||
@@ -360,58 +388,10 @@ AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
|
||||
)
|
||||
|
||||
|
||||
dnl Default is to try the thread-safe versions of a few functions
|
||||
OPT_THREAD=on
|
||||
|
||||
dnl detect AIX 4.3 or later
|
||||
AC_MSG_CHECKING([AIX 4.3 or later])
|
||||
AC_PREPROC_IFELSE([
|
||||
#if defined(_AIX) && defined(_AIX43)
|
||||
printf("just fine");
|
||||
#else
|
||||
#error "this is not AIX 4.3 or later"
|
||||
#endif
|
||||
],
|
||||
[ AC_MSG_RESULT([yes])
|
||||
RECENTAIX=yes
|
||||
OPT_THREAD=off ],
|
||||
[ AC_MSG_RESULT([no]) ]
|
||||
)
|
||||
|
||||
AC_ARG_ENABLE(thread,dnl
|
||||
AC_HELP_STRING([--disable-thread],[don't look for thread-safe functions])
|
||||
AC_HELP_STRING([--enable-thread],[look for thread-safe functions]),
|
||||
[ case "$enableval" in
|
||||
no)
|
||||
OPT_THREAD=off
|
||||
AC_MSG_WARN(c-ares will not get built using thread-safe functions)
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
]
|
||||
)
|
||||
|
||||
if test X"$OPT_THREAD" = Xoff
|
||||
then
|
||||
AC_DEFINE(DISABLED_THREADSAFE, 1,
|
||||
[Set to explicitly specify we don't want to use thread-safe functions])
|
||||
fi
|
||||
|
||||
dnl for recent AIX versions, we skip all the thread-safe checks above since
|
||||
dnl they claim a thread-safe libc using the standard API. But there are
|
||||
dnl some functions still not thread-safe. Check for these!
|
||||
|
||||
dnl Let's hope this split URL remains working:
|
||||
dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
|
||||
dnl genprogc/thread_quick_ref.htm
|
||||
|
||||
if test "x$RECENTAIX" = "xyes"; then
|
||||
|
||||
AC_DEFINE(_THREAD_SAFE, 1, [define this if you need it to compile thread-safe code])
|
||||
|
||||
fi
|
||||
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Back to "normal" configuring
|
||||
@@ -432,6 +412,7 @@ AC_CHECK_HEADERS(
|
||||
sys/ioctl.h \
|
||||
sys/param.h \
|
||||
sys/uio.h \
|
||||
assert.h \
|
||||
netdb.h \
|
||||
netinet/in.h \
|
||||
netinet/tcp.h \
|
||||
@@ -876,6 +857,8 @@ fi
|
||||
CARES_CHECK_OPTION_NONBLOCKING
|
||||
CARES_CHECK_NONBLOCKING_SOCKET
|
||||
|
||||
CARES_CONFIGURE_SYMBOL_HIDING
|
||||
|
||||
CARES_PRIVATE_LIBS="$LIBS"
|
||||
AC_SUBST(CARES_PRIVATE_LIBS)
|
||||
|
||||
|
@@ -17,7 +17,7 @@
|
||||
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
@@ -81,7 +81,7 @@ inet_net_pton_ipv4(const char *src, unsigned char *dst, size_t size)
|
||||
if (ch == '0' && (src[0] == 'x' || src[0] == 'X')
|
||||
&& ISXDIGIT(src[1])) {
|
||||
/* Hexadecimal: Eat nybble string. */
|
||||
if (size <= 0U)
|
||||
if (!size)
|
||||
goto emsgsize;
|
||||
dirty = 0;
|
||||
src++; /* skip x or X. */
|
||||
@@ -94,14 +94,14 @@ inet_net_pton_ipv4(const char *src, unsigned char *dst, size_t size)
|
||||
else
|
||||
tmp = (tmp << 4) | n;
|
||||
if (++dirty == 2) {
|
||||
if (size-- <= 0U)
|
||||
if (!size--)
|
||||
goto emsgsize;
|
||||
*dst++ = (unsigned char) tmp;
|
||||
dirty = 0;
|
||||
}
|
||||
}
|
||||
if (dirty) { /* Odd trailing nybble? */
|
||||
if (size-- <= 0U)
|
||||
if (!size--)
|
||||
goto emsgsize;
|
||||
*dst++ = (unsigned char) (tmp << 4);
|
||||
}
|
||||
@@ -117,7 +117,7 @@ inet_net_pton_ipv4(const char *src, unsigned char *dst, size_t size)
|
||||
goto enoent;
|
||||
} while ((ch = *src++) != '\0' &&
|
||||
ISDIGIT(ch));
|
||||
if (size-- <= 0U)
|
||||
if (!size--)
|
||||
goto emsgsize;
|
||||
*dst++ = (unsigned char) tmp;
|
||||
if (ch == '\0' || ch == '/')
|
||||
@@ -179,7 +179,7 @@ inet_net_pton_ipv4(const char *src, unsigned char *dst, size_t size)
|
||||
}
|
||||
/* Extend network to cover the actual mask. */
|
||||
while (bits > ((dst - odst) * 8)) {
|
||||
if (size-- <= 0U)
|
||||
if (!size--)
|
||||
goto emsgsize;
|
||||
*dst++ = '\0';
|
||||
}
|
||||
@@ -426,7 +426,8 @@ ares_inet_net_pton(int af, const char *src, void *dst, size_t size)
|
||||
#ifndef HAVE_INET_PTON
|
||||
int ares_inet_pton(int af, const char *src, void *dst)
|
||||
{
|
||||
int size, result;
|
||||
int result;
|
||||
size_t size;
|
||||
|
||||
if (af == AF_INET)
|
||||
size = sizeof(struct in_addr);
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#***************************************************************************
|
||||
|
||||
# File version for 'aclocal' use. Keep it a single number.
|
||||
# serial 56
|
||||
# serial 63
|
||||
|
||||
|
||||
dnl CARES_CHECK_COMPILER
|
||||
@@ -1150,8 +1150,7 @@ AC_DEFUN([CARES_CHECK_CURLDEBUG], [
|
||||
if test "$want_curldebug" = "yes"; then
|
||||
dnl TODO: Verify if the BUILDING_LIBCURL definition is still required.
|
||||
AC_DEFINE(BUILDING_LIBCURL, 1, [when building as static part of libcurl])
|
||||
# CPPFLAGS="$CPPFLAGS -DCURLDEBUG"
|
||||
CPPFLAGS="$CPPFLAGS -DCURLDEBUG -I../lib"
|
||||
CPPFLAGS="$CPPFLAGS -DCURLDEBUG"
|
||||
squeeze CPPFLAGS
|
||||
fi
|
||||
#
|
||||
@@ -1311,6 +1310,102 @@ AC_DEFUN([CARES_CHECK_COMPILER_STRUCT_MEMBER_SIZE], [
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CHECK_COMPILER_SYMBOL_HIDING
|
||||
dnl -------------------------------------------------
|
||||
dnl Verify if compiler supports hiding library internal symbols, setting
|
||||
dnl shell variable supports_symbol_hiding value as appropriate, as well as
|
||||
dnl variables symbol_hiding_CFLAGS and symbol_hiding_EXTERN when supported.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_COMPILER_SYMBOL_HIDING], [
|
||||
AC_REQUIRE([CARES_CHECK_COMPILER])dnl
|
||||
AC_BEFORE([$0],[CARES_CONFIGURE_SYMBOL_HIDING])dnl
|
||||
AC_MSG_CHECKING([if compiler supports hiding library internal symbols])
|
||||
supports_symbol_hiding="no"
|
||||
symbol_hiding_CFLAGS=""
|
||||
symbol_hiding_EXTERN=""
|
||||
tmp_CFLAGS=""
|
||||
tmp_EXTERN=""
|
||||
case "$compiler_id" in
|
||||
GNU_C)
|
||||
dnl Only gcc 3.4 or later
|
||||
if test "$compiler_num" -ge "304"; then
|
||||
if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then
|
||||
tmp_EXTERN="__attribute__ ((visibility (\"default\")))"
|
||||
tmp_CFLAGS="-fvisibility=hidden"
|
||||
supports_symbol_hiding="yes"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
INTEL_UNIX_C)
|
||||
dnl Only icc 9.0 or later
|
||||
if test "$compiler_num" -ge "900"; then
|
||||
if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then
|
||||
tmp_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -fvisibility=hidden"
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
# include <stdio.h>
|
||||
]],[[
|
||||
printf("icc fvisibility bug test");
|
||||
]])
|
||||
],[
|
||||
tmp_EXTERN="__attribute__ ((visibility (\"default\")))"
|
||||
tmp_CFLAGS="-fvisibility=hidden"
|
||||
supports_symbol_hiding="yes"
|
||||
])
|
||||
CFLAGS="$tmp_save_CFLAGS"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
SUNPRO_C)
|
||||
if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then
|
||||
tmp_EXTERN="__global"
|
||||
tmp_CFLAGS="-xldscope=hidden"
|
||||
supports_symbol_hiding="yes"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if test "$supports_symbol_hiding" = "yes"; then
|
||||
tmp_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$tmp_save_CFLAGS $tmp_CFLAGS"
|
||||
squeeze CFLAGS
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
$tmp_EXTERN char *dummy(char *buff);
|
||||
char *dummy(char *buff)
|
||||
{
|
||||
if(buff)
|
||||
return ++buff;
|
||||
else
|
||||
return buff;
|
||||
}
|
||||
]],[[
|
||||
char b[16];
|
||||
char *r = dummy(&b);
|
||||
if(r)
|
||||
return (int)*r;
|
||||
]])
|
||||
],[
|
||||
supports_symbol_hiding="yes"
|
||||
],[
|
||||
supports_symbol_hiding="no"
|
||||
echo " " >&6
|
||||
sed 's/^/cc-src: /' conftest.$ac_ext >&6
|
||||
sed 's/^/cc-err: /' conftest.err >&6
|
||||
echo " " >&6
|
||||
])
|
||||
CFLAGS="$tmp_save_CFLAGS"
|
||||
fi
|
||||
if test "$supports_symbol_hiding" = "yes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
symbol_hiding_CFLAGS="$tmp_CFLAGS"
|
||||
symbol_hiding_EXTERN="$tmp_EXTERN"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_VAR_MATCH (VARNAME, VALUE)
|
||||
dnl -------------------------------------------------
|
||||
dnl Verifies if shell variable VARNAME contains VALUE.
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#***************************************************************************
|
||||
|
||||
# File version for 'aclocal' use. Keep it a single number.
|
||||
# serial 5
|
||||
# serial 8
|
||||
|
||||
|
||||
dnl CARES_CHECK_OPTION_CURLDEBUG
|
||||
@@ -180,6 +180,46 @@ AC_HELP_STRING([--disable-optimize],[Disable compiler optimizations]),
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CHECK_OPTION_SYMBOL_HIDING
|
||||
dnl -------------------------------------------------
|
||||
dnl Verify if configure has been invoked with option
|
||||
dnl --enable-symbol-hiding or --disable-symbol-hiding,
|
||||
dnl setting shell variable want_symbol_hiding value.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_OPTION_SYMBOL_HIDING], [
|
||||
AC_BEFORE([$0],[CARES_CHECK_COMPILER_SYMBOL_HIDING])dnl
|
||||
AC_MSG_CHECKING([whether to enable hiding of library internal symbols])
|
||||
OPT_SYMBOL_HIDING="default"
|
||||
AC_ARG_ENABLE(symbol-hiding,
|
||||
AC_HELP_STRING([--enable-symbol-hiding],[Enable hiding of library internal symbols])
|
||||
AC_HELP_STRING([--disable-symbol-hiding],[Disable hiding of library internal symbols]),
|
||||
OPT_SYMBOL_HIDING=$enableval)
|
||||
case "$OPT_SYMBOL_HIDING" in
|
||||
no)
|
||||
dnl --disable-symbol-hiding option used.
|
||||
dnl This is an indication to not attempt hiding of library internal
|
||||
dnl symbols. Default symbol visibility will be used, which normally
|
||||
dnl exposes all library internal symbols.
|
||||
want_symbol_hiding="no"
|
||||
AC_MSG_RESULT([no])
|
||||
;;
|
||||
default)
|
||||
dnl configure's symbol-hiding option not specified.
|
||||
dnl Handle this as if --enable-symbol-hiding option was given.
|
||||
want_symbol_hiding="yes"
|
||||
AC_MSG_RESULT([yes])
|
||||
;;
|
||||
*)
|
||||
dnl --enable-symbol-hiding option used.
|
||||
dnl This is an indication to attempt hiding of library internal
|
||||
dnl symbols. This is only supported on some compilers/linkers.
|
||||
want_symbol_hiding="yes"
|
||||
AC_MSG_RESULT([yes])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CHECK_OPTION_WARNINGS
|
||||
dnl -------------------------------------------------
|
||||
dnl Verify if configure has been invoked with option
|
||||
@@ -252,3 +292,29 @@ AC_DEFUN([CARES_CHECK_NONBLOCKING_SOCKET], [
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CONFIGURE_SYMBOL_HIDING
|
||||
dnl -------------------------------------------------
|
||||
dnl Depending on --enable-symbol-hiding or --disable-symbol-hiding
|
||||
dnl configure option, and compiler capability to actually honor such
|
||||
dnl option, this will modify compiler flags as appropriate and also
|
||||
dnl provide needed definitions for configuration file.
|
||||
dnl This macro should not be used until all compilation tests have
|
||||
dnl been done to prevent interferences on other tests.
|
||||
|
||||
AC_DEFUN([CARES_CONFIGURE_SYMBOL_HIDING], [
|
||||
AC_MSG_CHECKING([whether hiding of library internal symbols will actually happen])
|
||||
if test x"$ac_cv_native_windows" != "xyes" &&
|
||||
test "$want_symbol_hiding" = "yes" &&
|
||||
test "$supports_symbol_hiding" = "yes"; then
|
||||
CFLAGS="$CFLAGS $symbol_hiding_CFLAGS"
|
||||
AC_DEFINE_UNQUOTED(CARES_SYMBOL_HIDING, 1,
|
||||
[Define to 1 to enable hiding of library internal symbols.])
|
||||
AC_DEFINE_UNQUOTED(CARES_SYMBOL_SCOPE_EXTERN, $symbol_hiding_EXTERN,
|
||||
[Definition to make a library symbol externally visible.])
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
])
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#***************************************************************************
|
||||
|
||||
# File version for 'aclocal' use. Keep it a single number.
|
||||
# serial 32
|
||||
# serial 39
|
||||
|
||||
|
||||
dnl CARES_INCLUDES_ARPA_INET
|
||||
@@ -873,7 +873,10 @@ dnl Verify if getaddrinfo is available, prototyped, can
|
||||
dnl be compiled and seems to work. If all of these are
|
||||
dnl true, and usage has not been previously disallowed
|
||||
dnl with shell variable cares_disallow_getaddrinfo, then
|
||||
dnl HAVE_GETADDRINFO will be defined.
|
||||
dnl HAVE_GETADDRINFO will be defined. Additionally when
|
||||
dnl HAVE_GETADDRINFO gets defined this will also attempt
|
||||
dnl to find out if getaddrinfo happens to be threadsafe,
|
||||
dnl defining HAVE_GETADDRINFO_THREADSAFE when true.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_FUNC_GETADDRINFO], [
|
||||
AC_REQUIRE([CARES_INCLUDES_WS2TCPIP])dnl
|
||||
@@ -887,6 +890,7 @@ AC_DEFUN([CARES_CHECK_FUNC_GETADDRINFO], [
|
||||
tst_compi_getaddrinfo="unknown"
|
||||
tst_works_getaddrinfo="unknown"
|
||||
tst_allow_getaddrinfo="unknown"
|
||||
tst_tsafe_getaddrinfo="unknown"
|
||||
#
|
||||
AC_MSG_CHECKING([if getaddrinfo can be linked])
|
||||
AC_LINK_IFELSE([
|
||||
@@ -1001,6 +1005,82 @@ AC_DEFUN([CARES_CHECK_FUNC_GETADDRINFO], [
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
ac_cv_func_getaddrinfo="no"
|
||||
ac_cv_func_getaddrinfo_threadsafe="no"
|
||||
fi
|
||||
#
|
||||
if test "$ac_cv_func_getaddrinfo" = "yes"; then
|
||||
AC_MSG_CHECKING([if getaddrinfo is threadsafe])
|
||||
case $host_os in
|
||||
aix[[1234]].* | aix5.[[01]].*)
|
||||
dnl aix 5.1 and older
|
||||
tst_tsafe_getaddrinfo="no"
|
||||
;;
|
||||
aix*)
|
||||
dnl aix 5.2 and newer
|
||||
tst_tsafe_getaddrinfo="yes"
|
||||
;;
|
||||
darwin[[12345]].*)
|
||||
dnl darwin 5.0 and mac os x 10.1.X and older
|
||||
tst_tsafe_getaddrinfo="no"
|
||||
;;
|
||||
darwin*)
|
||||
dnl darwin 6.0 and mac os x 10.2.X and newer
|
||||
tst_tsafe_getaddrinfo="yes"
|
||||
;;
|
||||
freebsd[[1234]].* | freebsd5.[[1234]]*)
|
||||
dnl freebsd 5.4 and older
|
||||
tst_tsafe_getaddrinfo="no"
|
||||
;;
|
||||
freebsd*)
|
||||
dnl freebsd 5.5 and newer
|
||||
tst_tsafe_getaddrinfo="yes"
|
||||
;;
|
||||
hpux[[123456789]].* | hpux10.* | hpux11.0* | hpux11.10*)
|
||||
dnl hpux 11.10 and older
|
||||
tst_tsafe_getaddrinfo="no"
|
||||
;;
|
||||
hpux*)
|
||||
dnl hpux 11.11 and newer
|
||||
tst_tsafe_getaddrinfo="yes"
|
||||
;;
|
||||
netbsd[[123]].*)
|
||||
dnl netbsd 3.X and older
|
||||
tst_tsafe_getaddrinfo="no"
|
||||
;;
|
||||
netbsd*)
|
||||
dnl netbsd 4.X and newer
|
||||
tst_tsafe_getaddrinfo="yes"
|
||||
;;
|
||||
*bsd*)
|
||||
dnl All other bsd's
|
||||
tst_tsafe_getaddrinfo="no"
|
||||
;;
|
||||
solaris2*)
|
||||
dnl solaris which have it
|
||||
tst_tsafe_getaddrinfo="yes"
|
||||
;;
|
||||
esac
|
||||
if test "$tst_tsafe_getaddrinfo" = "unknown"; then
|
||||
CURL_CHECK_DEF_CC([h_errno], [
|
||||
$cares_includes_ws2tcpip
|
||||
$cares_includes_sys_socket
|
||||
$cares_includes_netdb
|
||||
], [silent])
|
||||
if test "$curl_cv_have_def_h_errno" = "no"; then
|
||||
tst_tsafe_getaddrinfo="no"
|
||||
fi
|
||||
fi
|
||||
if test "$tst_tsafe_getaddrinfo" = "unknown"; then
|
||||
tst_tsafe_getaddrinfo="yes"
|
||||
fi
|
||||
AC_MSG_RESULT([$tst_tsafe_getaddrinfo])
|
||||
if test "$tst_tsafe_getaddrinfo" = "yes"; then
|
||||
AC_DEFINE_UNQUOTED(HAVE_GETADDRINFO_THREADSAFE, 1,
|
||||
[Define to 1 if the getaddrinfo function is threadsafe.])
|
||||
ac_cv_func_getaddrinfo_threadsafe="yes"
|
||||
else
|
||||
ac_cv_func_getaddrinfo_threadsafe="no"
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#***************************************************************************
|
||||
|
||||
# File version for 'aclocal' use. Keep it a single number.
|
||||
# serial 2
|
||||
# serial 3
|
||||
|
||||
dnl CARES_OVERRIDE_AUTOCONF
|
||||
dnl -------------------------------------------------
|
||||
@@ -92,12 +92,11 @@ dnl used across different Autoconf versions and to
|
||||
dnl allow us to use this macro early enough in the
|
||||
dnl configure script.
|
||||
|
||||
m4_define([_AS_PATH_SEPARATOR_PREPARE],
|
||||
m4_defun([_AS_PATH_SEPARATOR_PREPARE],
|
||||
[CARES_CHECK_PATH_SEPARATOR
|
||||
m4_define([$0],[])])
|
||||
|
||||
m4_define([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
|
||||
m4_defun([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
|
||||
[CARES_CHECK_PATH_SEPARATOR
|
||||
m4_define([$0],[])])
|
||||
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#***************************************************************************
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (C) 2008 by Daniel Stenberg et al
|
||||
# Copyright (C) 2008 - 2009 by Daniel Stenberg et al
|
||||
#
|
||||
# Permission to use, copy, modify, and distribute this software and its
|
||||
# documentation for any purpose and without fee is hereby granted, provided
|
||||
@@ -16,7 +16,7 @@
|
||||
#***************************************************************************
|
||||
|
||||
# File version for 'aclocal' use. Keep it a single number.
|
||||
# serial 3
|
||||
# serial 4
|
||||
|
||||
dnl Note 1
|
||||
dnl ------
|
||||
@@ -25,6 +25,58 @@ dnl conditionally include header files. These macros are used early in the
|
||||
dnl configure process much before header file availability is known.
|
||||
|
||||
|
||||
dnl CARES_CHECK_NEED_REENTRANT_ERRNO
|
||||
dnl -------------------------------------------------
|
||||
dnl Checks if the preprocessor _REENTRANT definition
|
||||
dnl makes errno available as a preprocessor macro.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_NEED_REENTRANT_ERRNO], [
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#include <errno.h>
|
||||
]],[[
|
||||
if(0 != errno)
|
||||
return 1;
|
||||
]])
|
||||
],[
|
||||
tmp_errno="yes"
|
||||
],[
|
||||
tmp_errno="no"
|
||||
])
|
||||
if test "$tmp_errno" = "yes"; then
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#include <errno.h>
|
||||
]],[[
|
||||
#ifdef errno
|
||||
int dummy=1;
|
||||
#else
|
||||
force compilation error
|
||||
#endif
|
||||
]])
|
||||
],[
|
||||
tmp_errno="errno_macro_defined"
|
||||
],[
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#define _REENTRANT
|
||||
#include <errno.h>
|
||||
]],[[
|
||||
#ifdef errno
|
||||
int dummy=1;
|
||||
#else
|
||||
force compilation error
|
||||
#endif
|
||||
]])
|
||||
],[
|
||||
tmp_errno="errno_macro_needs_reentrant"
|
||||
tmp_need_reentrant="yes"
|
||||
])
|
||||
])
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CHECK_NEED_REENTRANT_GMTIME_R
|
||||
dnl -------------------------------------------------
|
||||
dnl Checks if the preprocessor _REENTRANT definition
|
||||
@@ -370,8 +422,8 @@ dnl must be unconditionally done for this platform.
|
||||
dnl Internal macro for CARES_CONFIGURE_REENTRANT.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_NEED_REENTRANT_SYSTEM], [
|
||||
case $host in
|
||||
*-*-solaris*)
|
||||
case $host_os in
|
||||
solaris*)
|
||||
tmp_need_reentrant="yes"
|
||||
;;
|
||||
*)
|
||||
@@ -381,6 +433,29 @@ AC_DEFUN([CARES_CHECK_NEED_REENTRANT_SYSTEM], [
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CHECK_NEED_THREAD_SAFE_SYSTEM
|
||||
dnl -------------------------------------------------
|
||||
dnl Checks if the preprocessor _THREAD_SAFE definition
|
||||
dnl must be unconditionally done for this platform.
|
||||
dnl Internal macro for CARES_CONFIGURE_THREAD_SAFE.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_NEED_THREAD_SAFE_SYSTEM], [
|
||||
case $host_os in
|
||||
aix[[123]].* | aix4.[[012]].*)
|
||||
dnl aix 4.2 and older
|
||||
tmp_need_thread_safe="no"
|
||||
;;
|
||||
aix*)
|
||||
dnl AIX 4.3 and newer
|
||||
tmp_need_thread_safe="yes"
|
||||
;;
|
||||
*)
|
||||
tmp_need_thread_safe="no"
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT
|
||||
dnl -------------------------------------------------
|
||||
dnl This macro ensures that configuration tests done
|
||||
@@ -401,6 +476,26 @@ _EOF
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CONFIGURE_FROM_NOW_ON_WITH_THREAD_SAFE
|
||||
dnl -------------------------------------------------
|
||||
dnl This macro ensures that configuration tests done
|
||||
dnl after this will execute with preprocessor symbol
|
||||
dnl _THREAD_SAFE defined. This macro also ensures that
|
||||
dnl the generated config file defines NEED_THREAD_SAFE
|
||||
dnl and that in turn setup.h will define _THREAD_SAFE.
|
||||
dnl Internal macro for CARES_CONFIGURE_THREAD_SAFE.
|
||||
|
||||
AC_DEFUN([CARES_CONFIGURE_FROM_NOW_ON_WITH_THREAD_SAFE], [
|
||||
AC_DEFINE(NEED_THREAD_SAFE, 1,
|
||||
[Define to 1 if _THREAD_SAFE preprocessor symbol must be defined.])
|
||||
cat >>confdefs.h <<_EOF
|
||||
#ifndef _THREAD_SAFE
|
||||
# define _THREAD_SAFE
|
||||
#endif
|
||||
_EOF
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CONFIGURE_REENTRANT
|
||||
dnl -------------------------------------------------
|
||||
dnl This first checks if the preprocessor _REENTRANT
|
||||
@@ -437,6 +532,9 @@ AC_DEFUN([CARES_CONFIGURE_REENTRANT], [
|
||||
if test "$tmp_reentrant_initially_defined" = "no"; then
|
||||
AC_MSG_CHECKING([if _REENTRANT is actually needed])
|
||||
CARES_CHECK_NEED_REENTRANT_SYSTEM
|
||||
if test "$tmp_need_reentrant" = "no"; then
|
||||
CARES_CHECK_NEED_REENTRANT_ERRNO
|
||||
fi
|
||||
if test "$tmp_need_reentrant" = "no"; then
|
||||
CARES_CHECK_NEED_REENTRANT_FUNCTIONS_R
|
||||
fi
|
||||
@@ -458,3 +556,56 @@ AC_DEFUN([CARES_CONFIGURE_REENTRANT], [
|
||||
#
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CONFIGURE_THREAD_SAFE
|
||||
dnl -------------------------------------------------
|
||||
dnl This first checks if the preprocessor _THREAD_SAFE
|
||||
dnl symbol is already defined. If it isn't currently
|
||||
dnl defined a set of checks are performed to verify
|
||||
dnl if its definition is required. Finally, if
|
||||
dnl _THREAD_SAFE is already defined or needed it takes
|
||||
dnl care of making adjustments necessary to ensure
|
||||
dnl that it is defined equally for further configure
|
||||
dnl tests and generated config file.
|
||||
|
||||
AC_DEFUN([CARES_CONFIGURE_THREAD_SAFE], [
|
||||
AC_PREREQ([2.50])dnl
|
||||
#
|
||||
AC_MSG_CHECKING([if _THREAD_SAFE is already defined])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
]],[[
|
||||
#ifdef _THREAD_SAFE
|
||||
int dummy=1;
|
||||
#else
|
||||
force compilation error
|
||||
#endif
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
tmp_thread_safe_initially_defined="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
tmp_thread_safe_initially_defined="no"
|
||||
])
|
||||
#
|
||||
if test "$tmp_thread_safe_initially_defined" = "no"; then
|
||||
AC_MSG_CHECKING([if _THREAD_SAFE is actually needed])
|
||||
CARES_CHECK_NEED_THREAD_SAFE_SYSTEM
|
||||
if test "$tmp_need_thread_safe" = "yes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
fi
|
||||
#
|
||||
AC_MSG_CHECKING([if _THREAD_SAFE is onwards defined])
|
||||
if test "$tmp_thread_safe_initially_defined" = "yes" ||
|
||||
test "$tmp_need_thread_safe" = "yes"; then
|
||||
CARES_CONFIGURE_FROM_NOW_ON_WITH_THREAD_SAFE
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
#
|
||||
])
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#***************************************************************************
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (C) 2008 by Daniel Stenberg et al
|
||||
# Copyright (C) 2008 - 2009 by Daniel Stenberg et al
|
||||
#
|
||||
# Permission to use, copy, modify, and distribute this software and its
|
||||
# documentation for any purpose and without fee is hereby granted, provided
|
||||
@@ -16,7 +16,7 @@
|
||||
#***************************************************************************
|
||||
|
||||
# File version for 'aclocal' use. Keep it a single number.
|
||||
# serial 2
|
||||
# serial 3
|
||||
|
||||
|
||||
dnl CARES_CHECK_PATH_SEPARATOR
|
||||
@@ -72,3 +72,12 @@ AC_DEFUN([CARES_CHECK_PATH_SEPARATOR], [
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CHECK_PATH_SEPARATOR_REQUIRED
|
||||
dnl -------------------------------------------------
|
||||
dnl Use this to ensure that the path separator check
|
||||
dnl macro is only expanded and included once.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_PATH_SEPARATOR_REQUIRED], [
|
||||
AC_REQUIRE([CARES_CHECK_PATH_SEPARATOR])dnl
|
||||
])
|
||||
|
||||
|
@@ -415,7 +415,7 @@ typedef int sig_atomic_t;
|
||||
* Actually use __32_getpwuid() on 64-bit VMS builds for getpwuid()
|
||||
*/
|
||||
|
||||
#if defined(VMS) && \
|
||||
#if defined(__VMS) && \
|
||||
defined(__INITIAL_POINTER_SIZE) && (__INITIAL_POINTER_SIZE == 64)
|
||||
#define getpwuid __32_getpwuid
|
||||
#endif
|
||||
@@ -425,7 +425,7 @@ typedef int sig_atomic_t;
|
||||
* Macro argv_item_t hides platform details to code using it.
|
||||
*/
|
||||
|
||||
#ifdef VMS
|
||||
#ifdef __VMS
|
||||
#define argv_item_t __char_ptr32
|
||||
#else
|
||||
#define argv_item_t char *
|
||||
|
@@ -1,2 +1,4 @@
|
||||
vc.ncb
|
||||
vc.opt
|
||||
vc6aws.ncb
|
||||
vc6aws.opt
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user