Compare commits
887 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 | ||
![]() |
6247b6d468 | ||
![]() |
966cb698e6 | ||
![]() |
4b44638f4d | ||
![]() |
13afff5752 | ||
![]() |
e73fe837a8 | ||
![]() |
a9caeb1064 | ||
![]() |
171eef68c3 | ||
![]() |
33368ebd02 | ||
![]() |
501f9f8309 | ||
![]() |
9fe787fc1f | ||
![]() |
0dec3e5e6a | ||
![]() |
66f5baa16e | ||
![]() |
1cb921b7f3 | ||
![]() |
0cf6721898 | ||
![]() |
97c8bc9757 | ||
![]() |
2cad095425 | ||
![]() |
37d509f04f | ||
![]() |
35eb9fc6ad | ||
![]() |
df09088a96 | ||
![]() |
1a14966577 | ||
![]() |
0606b792f0 | ||
![]() |
a53525e930 | ||
![]() |
3a9c03bef3 | ||
![]() |
f0dbdcff9d | ||
![]() |
9d03dd7fb8 | ||
![]() |
781b82baf5 | ||
![]() |
2838362a7b | ||
![]() |
0b66efac9c | ||
![]() |
47a9660ec1 | ||
![]() |
aabf62e7d2 | ||
![]() |
6d891d2a3b | ||
![]() |
c0e8bed5bf | ||
![]() |
0dce2ff8a0 | ||
![]() |
2642638fca | ||
![]() |
8b0fc9819f | ||
![]() |
bf5f91244b | ||
![]() |
e8e84cf1da | ||
![]() |
0179dbe1c2 | ||
![]() |
8978b87728 | ||
![]() |
0684128209 | ||
![]() |
9b5c00a664 | ||
![]() |
b347a7a96e | ||
![]() |
240bfaa69e | ||
![]() |
7dc48e57a6 | ||
![]() |
8570883412 | ||
![]() |
1d5627b181 | ||
![]() |
038fff6c9f | ||
![]() |
21dd9a8021 | ||
![]() |
59934c1176 | ||
![]() |
2f6ff57d96 | ||
![]() |
77eba8727d | ||
![]() |
47c392e135 | ||
![]() |
9cff716925 | ||
![]() |
4c207a004c | ||
![]() |
650543a042 | ||
![]() |
5f0cae8037 | ||
![]() |
95c2ab77e7 | ||
![]() |
d7f33b7e4e | ||
![]() |
56e6441ceb | ||
![]() |
b74b5e0602 | ||
![]() |
b4dcbbfabd | ||
![]() |
6dd0277c22 | ||
![]() |
fb08218a04 | ||
![]() |
08d95bff5e | ||
![]() |
b476530755 | ||
![]() |
a8ea1e9ef4 | ||
![]() |
6dade671ad | ||
![]() |
38b88b5892 | ||
![]() |
340e3b952f | ||
![]() |
35c91f6ea9 | ||
![]() |
f5f9354093 | ||
![]() |
600460ffc6 | ||
![]() |
18b3833f90 | ||
![]() |
f671d0513c | ||
![]() |
100f6b7703 | ||
![]() |
4e75c70874 | ||
![]() |
bdbfe1f8a9 | ||
![]() |
bea9d2cafd | ||
![]() |
d709cb2ae3 | ||
![]() |
444bb03fab | ||
![]() |
966cc10fcc | ||
![]() |
0c7087c41f | ||
![]() |
c42a06bc1f | ||
![]() |
b4c00a8fb0 | ||
![]() |
f3403d4c5b | ||
![]() |
5cf78472e1 | ||
![]() |
2aaff16a87 | ||
![]() |
6236198d43 | ||
![]() |
83fb285d40 | ||
![]() |
3050f10676 | ||
![]() |
175fc5096d | ||
![]() |
18f238dd53 | ||
![]() |
4f551259dd | ||
![]() |
9cb68c6e32 | ||
![]() |
a9a89c604a | ||
![]() |
e96a9190a3 | ||
![]() |
1ff4e9008b | ||
![]() |
2d716517a8 | ||
![]() |
22226a8aec | ||
![]() |
9b8e56c97c | ||
![]() |
ad1bfc5468 | ||
![]() |
2c0c05e96d | ||
![]() |
d6d63147b6 | ||
![]() |
98f7771d74 | ||
![]() |
37eba37019 | ||
![]() |
40b2f2553b | ||
![]() |
d3e35d49ae | ||
![]() |
a0474685c1 | ||
![]() |
0b317b72ae | ||
![]() |
afe06d1563 | ||
![]() |
c40365e9b6 | ||
![]() |
4b6d3a2bfd | ||
![]() |
7ae624e700 | ||
![]() |
c32cf33a16 | ||
![]() |
7eb59de7df | ||
![]() |
5931cf77f4 | ||
![]() |
989aace192 | ||
![]() |
65cf30e441 | ||
![]() |
d4480c979d | ||
![]() |
169e94d68b | ||
![]() |
0cc8184057 | ||
![]() |
a7c75142fa | ||
![]() |
02d3c452e4 | ||
![]() |
1c148575ea | ||
![]() |
d1a1865650 | ||
![]() |
067544abc5 | ||
![]() |
77da57057f | ||
![]() |
aa1da57c37 | ||
![]() |
c2ce2aa4de | ||
![]() |
90c9fd55fc | ||
![]() |
47e403640b | ||
![]() |
4ea513cc38 | ||
![]() |
3ca0b9bb47 | ||
![]() |
e592da5a59 | ||
![]() |
2c93f889fd | ||
![]() |
6173ce6463 | ||
![]() |
065a51d2e1 | ||
![]() |
7edcc22136 | ||
![]() |
352177090f | ||
![]() |
9d18c0b156 | ||
![]() |
ec65a9a364 | ||
![]() |
5c4b6a8ef0 | ||
![]() |
5d502eb90c | ||
![]() |
d6662d8442 | ||
![]() |
1d97f13462 | ||
![]() |
2c16681225 | ||
![]() |
065047dc62 | ||
![]() |
eba8d6d5f5 | ||
![]() |
744dceaffe | ||
![]() |
8740d147c9 | ||
![]() |
16ae283fb4 | ||
![]() |
312600fe9c | ||
![]() |
3e0c067e43 | ||
![]() |
f90551ff41 | ||
![]() |
9442fc0b52 | ||
![]() |
dbb93a2718 | ||
![]() |
242cf423f8 | ||
![]() |
217faf778b | ||
![]() |
01b74950b7 | ||
![]() |
420bfbcf40 | ||
![]() |
89f6567fda | ||
![]() |
efec05d581 | ||
![]() |
47198dce5d | ||
![]() |
f45500c612 | ||
![]() |
6f3e817372 | ||
![]() |
cfda5df020 | ||
![]() |
2b4f41603d | ||
![]() |
448f448d14 | ||
![]() |
ee6a618116 | ||
![]() |
e08f81c891 | ||
![]() |
9324f1c29f | ||
![]() |
d71c1514f2 | ||
![]() |
2df75e84e7 | ||
![]() |
9ab89734de | ||
![]() |
960c0319c4 | ||
![]() |
439891cb9f | ||
![]() |
bdfb3ef11c | ||
![]() |
8d581f7fe4 | ||
![]() |
262907d0a3 | ||
![]() |
15be673054 | ||
![]() |
16a5649670 | ||
![]() |
6582895b51 | ||
![]() |
e3d65389d7 | ||
![]() |
027cb376f3 | ||
![]() |
f1261bcdd7 | ||
![]() |
2e7b36d04f | ||
![]() |
ce1a58414a | ||
![]() |
1012c5705a | ||
![]() |
1c2947581b | ||
![]() |
00883822be | ||
![]() |
13fdb9d8a5 | ||
![]() |
52b2bc4109 | ||
![]() |
b59b3a5152 | ||
![]() |
fe6c03370e | ||
![]() |
e3f128875c | ||
![]() |
7bf82a814b | ||
![]() |
e1270928a3 | ||
![]() |
6fce5b54a8 | ||
![]() |
3c38eafd75 | ||
![]() |
9dcc1b3370 | ||
![]() |
e3c37aac28 | ||
![]() |
61a967095d | ||
![]() |
c0e004ec1c | ||
![]() |
0a1b7296b9 | ||
![]() |
cd5e6743f7 | ||
![]() |
2091fe530f | ||
![]() |
cda8d63d43 | ||
![]() |
bef1b140e9 | ||
![]() |
c9188e2260 | ||
![]() |
15eaf27bc7 | ||
![]() |
bf2277e263 | ||
![]() |
348ffbc47e | ||
![]() |
f13cbcf175 | ||
![]() |
9418c56fd3 | ||
![]() |
7dbd502931 | ||
![]() |
0bf9c1e881 | ||
![]() |
bf07d37737 | ||
![]() |
eecb713616 | ||
![]() |
bf085e2c4b | ||
![]() |
ce1a97d6c8 | ||
![]() |
34c9ec4e1a | ||
![]() |
e73fb6808a | ||
![]() |
1c93d9dcfe | ||
![]() |
675d6ec5e6 | ||
![]() |
1ad43c54c0 | ||
![]() |
1cf6c15ab4 | ||
![]() |
8fc17ed764 | ||
![]() |
26028068e8 | ||
![]() |
8519682564 | ||
![]() |
5ca0c73e98 | ||
![]() |
4c979aa44f | ||
![]() |
274dc3ecac | ||
![]() |
5e2b5edde5 | ||
![]() |
b8b6521659 | ||
![]() |
e37b1b0623 | ||
![]() |
4a79462c3e | ||
![]() |
c328cc9608 | ||
![]() |
cf2d39220a | ||
![]() |
7dbd649f60 | ||
![]() |
4282199bb4 | ||
![]() |
7071dd0162 | ||
![]() |
e61a687eda | ||
![]() |
7e85d2fbd4 | ||
![]() |
969ab28261 | ||
![]() |
90d36cc630 | ||
![]() |
1bb68cbcfa | ||
![]() |
de7a14003c | ||
![]() |
e3ead9f585 | ||
![]() |
a461b0ae44 | ||
![]() |
1b28f9fa89 | ||
![]() |
dff8076022 | ||
![]() |
dd3c187484 | ||
![]() |
4677778f85 | ||
![]() |
f96204dbe0 | ||
![]() |
0427b783e2 | ||
![]() |
4650732f4a | ||
![]() |
1e138c1401 | ||
![]() |
89fb7c85bf | ||
![]() |
0e51fc90e3 |
@@ -5,7 +5,7 @@ aclocal.m4.bak
|
||||
autom4te.cache
|
||||
compile
|
||||
config.guess
|
||||
config.h
|
||||
curl_config.h
|
||||
config.log
|
||||
config.lt
|
||||
config.status
|
||||
|
87
Android.mk
Normal file
87
Android.mk
Normal file
@@ -0,0 +1,87 @@
|
||||
# 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. Tested with Android 1.5
|
||||
#
|
||||
# Note: you must first create a curl_config.h file by running configure in the
|
||||
# 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
|
||||
# September 2009
|
||||
|
||||
LOCAL_PATH:= $(call my-dir)
|
||||
|
||||
common_CFLAGS := -Wpointer-arith -Wwrite-strings -Wunused -Winline -Wnested-externs -Wmissing-declarations -Wmissing-prototypes -Wno-long-long -Wfloat-equal -Wno-multichar -Wsign-compare -Wno-format-nonliteral -Wendif-labels -Wstrict-prototypes -Wdeclaration-after-statement -Wno-system-headers -DHAVE_CONFIG_H
|
||||
|
||||
#########################
|
||||
# Build the libcurl library
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
include $(LOCAL_PATH)/lib/Makefile.inc
|
||||
CURL_HEADERS := \
|
||||
curlbuild.h \
|
||||
curl.h \
|
||||
curlrules.h \
|
||||
curlver.h \
|
||||
easy.h \
|
||||
mprintf.h \
|
||||
multi.h \
|
||||
stdcheaders.h \
|
||||
typecheck-gcc.h \
|
||||
types.h
|
||||
|
||||
LOCAL_SRC_FILES := $(addprefix lib/,$(CSOURCES))
|
||||
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include/
|
||||
LOCAL_CFLAGS += $(common_CFLAGS)
|
||||
|
||||
LOCAL_COPY_HEADERS_TO := libcurl/curl
|
||||
LOCAL_COPY_HEADERS := $(addprefix include/curl/,$(CURL_HEADERS))
|
||||
|
||||
LOCAL_MODULE:= libcurl
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
|
||||
#########################
|
||||
# Build the curl binary
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
include $(LOCAL_PATH)/src/Makefile.inc
|
||||
LOCAL_SRC_FILES := $(addprefix src/,$(CURL_SOURCES))
|
||||
|
||||
LOCAL_MODULE := curl
|
||||
LOCAL_STATIC_LIBRARIES := libcurl
|
||||
LOCAL_SYSTEM_SHARED_LIBRARIES := libc
|
||||
|
||||
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include $(LOCAL_PATH)/lib
|
||||
|
||||
# This will also need to include $(CURLX_ONES) in order to correctly build
|
||||
# a dynamic library
|
||||
LOCAL_CFLAGS += $(common_CFLAGS)
|
||||
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
961
CHANGES
961
CHANGES
@@ -6,6 +6,967 @@
|
||||
|
||||
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)
|
||||
- Carsten Lange reported a bug and provided a patch for TFTP upload and the
|
||||
sending of the TSIZE option. I don't like fixing bugs just hours before
|
||||
a release, but since it was broken and the patch fixes this for him I decided
|
||||
to get it in anyway.
|
||||
|
||||
Daniel Stenberg (11 Aug 2009)
|
||||
- Peter Sylvester made the HTTPS test server use specific certificates for
|
||||
each test, so that the test suite can now be used to actually test the
|
||||
verification of cert names etc. This made an error show up in the OpenSSL-
|
||||
specific code where it would attempt to match the CN field even if a
|
||||
subjectAltName exists that doesn't match. This is now fixed and verified
|
||||
in test 311.
|
||||
|
||||
- Benbuck Nason posted the bug report #2835196
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2835196), fixing a few compiler
|
||||
warnings when mixing ints and bools.
|
||||
|
||||
Daniel Fandrich (10 Aug 2009)
|
||||
- Fixed a memory leak in the FTP code and an off-by-one heap buffer overflow.
|
||||
|
||||
Daniel Fandrich (9 Aug 2009)
|
||||
- Fixed some memory leaks in the command-line tool that caused most of the
|
||||
torture tests to fail.
|
||||
|
||||
Daniel Stenberg (2 Aug 2009)
|
||||
- Curt Bogmine reported a problem with SNI enabled on a particular server. We
|
||||
should introduce an option to disable SNI, but as we're in feature freeze
|
||||
now I've addressed the obvious bug here (pointed out by Peter Sylvester): we
|
||||
shouldn't try to enable SNI when SSLv2 or SSLv3 is explicitly selected.
|
||||
Code for OpenSSL and GnuTLS was fixed. NSS doesn't seem to have a particular
|
||||
option for SNI, or are we simply not using it?
|
||||
|
||||
Daniel Stenberg (1 Aug 2009)
|
||||
- Scott Cantor posted the bug report #2829955
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2829955) mentioning the recent SSL cert
|
||||
verification flaw found and exploited by Moxie Marlinspike. The presentation
|
||||
he did at Black Hat is available here:
|
||||
https://www.blackhat.com/html/bh-usa-09/bh-usa-09-archives.html#Marlinspike
|
||||
|
||||
Apparently at least one CA allowed a subjectAltName or CN that contain a
|
||||
zero byte, and thus clients that assumed they would never have zero bytes
|
||||
were exploited to OK a certificate that didn't actually match the site. Like
|
||||
if the name in the cert was "example.com\0theatualsite.com", libcurl would
|
||||
happily verify that cert for example.com.
|
||||
|
||||
libcurl now better uses the length of the extracted name, not using the zero
|
||||
termination for getting the string length.
|
||||
|
||||
This fixing only made and needed in OpenSSL interfacing code.
|
||||
|
||||
- Tanguy Fautre pointed out that OpenSSL's function RAND_screen() (present
|
||||
only in some OpenSSL installs - like on Windows) isn't thread-safe and we
|
||||
agreed that moving it to the global_init() function is a decent way to deal
|
||||
with this situation.
|
||||
|
||||
- Alexander Beedie provided the patch for a noproxy problem: If I have set
|
||||
CURLOPT_NOPROXY to "*", or to a host that should not use a proxy, I actually
|
||||
could still end up using a proxy if a proxy environment variable was set.
|
||||
|
||||
Daniel Stenberg (27 Jul 2009)
|
||||
- All the quote options (CURLOPT_QUOTE, CURLOPT_POSTQUOTE and
|
||||
CURLOPT_PREQUOTE) now accept a preceeding asterisk before the command to
|
||||
send when using FTP, as a sign that libcurl shall simply ignore the response
|
||||
from the server instead of treating it as an error. Not treating a 400+ FTP
|
||||
response code as an error means that failed commands will not abort the
|
||||
chain of commands, nor will they cause the connection to get disconnected.
|
||||
|
||||
Daniel Stenberg (26 Jul 2009)
|
||||
- Johan van Selst posted bug report #2825989
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2825989) pointing out that
|
||||
OpenSSL-powered libcurl didn't support the SHA-2 digest algorithm, and
|
||||
provided the solution too: to use OpenSSL_add_all_algorithms() in addition
|
||||
to the older SSLeay_* alternative. OpenSSL_add_all_algorithms was added in
|
||||
OpenSSL 0.9.5
|
||||
|
||||
Daniel Stenberg (23 Jul 2009)
|
||||
- Added CURLOPT_SSH_KNOWNHOSTS, CURLOPT_SSH_KEYFUNCTION, CURLOPT_SSH_KEYDATA.
|
||||
They introduce known_host support for SSH keys to libcurl. See docs for
|
||||
details. Note that this feature depends on a new enough libssh2 version, to
|
||||
be supported in libssh2 1.2 and later (or current git repo at this time).
|
||||
|
||||
Michal Marek (22 Jul 2009)
|
||||
- David Binderman found a memory and fd leak in lib/gtls.c:load_file()
|
||||
(https://bugzilla.novell.com/523919). When looking at the code, I found that
|
||||
also the ptr pointer can leak.
|
||||
|
||||
Kamil Dudka (20 Jul 2009)
|
||||
- Claes Jakobsson improved the support for client certificates handling in
|
||||
NSS-powered libcurl. Now the client certificates can be selected
|
||||
automatically by a NSS built-in hook. Additionally pre-login to all PKCS11
|
||||
slots is no more performed. It used to cause problems with HW tokens.
|
||||
|
||||
- Fixed reference counting for NSS client certificates. Now the PEM reader
|
||||
module should be always properly unloaded on Curl_nss_cleanup(). If the
|
||||
unload fails though, libcurl will try to reuse the already loaded instance.
|
||||
|
||||
Daniel Fandrich (15 Jul 2009)
|
||||
- Added nonblock.c to the non-automake makefiles (note that the dependencies
|
||||
in the Watcom makefiles aren't quite correct).
|
||||
|
||||
Michal Marek (15 Jul 2009)
|
||||
- Changed the description of CURLINFO_OS_ERRNO to make it clear that the
|
||||
errno is not reset on success.
|
||||
|
||||
Guenter Knauf (14 Jul 2009)
|
||||
- renamed generated config.h to curl_config.h to avoid any future clashes
|
||||
with config.h from other projects.
|
||||
|
||||
Daniel Stenberg (9 Jul 2009)
|
||||
- Eric Wong introduced curlx_nonblock() that the curl tool now (re-)uses for
|
||||
setting a file descriptor non-blocking. Used by the functionality Eric
|
||||
himself brough on June 15th.
|
||||
|
||||
Daniel Stenberg (8 Jul 2009)
|
||||
- Constantine Sapuntzakis posted bug report #2813123
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2813123) and an a patch that fixes the
|
||||
problem:
|
||||
|
||||
Url A is accessed using auth. Url A redirects to Url B (on a different
|
||||
server0. Url B reuses a persistent connection. Url B has auth, even though
|
||||
it's on a different server.
|
||||
|
||||
Note: if Url B does not reuse a persistent connection, auth is not sent.
|
||||
|
||||
reason:
|
||||
|
||||
data->state.first_host is not initialized becuase Curl_http_connect is not
|
||||
called when a connection is reused.
|
||||
|
||||
Solution:
|
||||
|
||||
move initialization of data->state.first_host to Curl_http. No code before
|
||||
Curl_http uses data->state.first_host anyway.
|
||||
|
||||
Guenter Knauf (4 Jul 2009)
|
||||
- Markus Koetter provided a patch to avoid getnameinfo() usage which broke a
|
||||
couple of both IPv4 and IPv6 autobuilds.
|
||||
|
||||
Daniel Stenberg (29 Jun 2009)
|
||||
- Markus Koetter made CURLOPT_FTPPORT (and curl's -P/--ftpport) support a port
|
||||
range if given colon-separated after the host name/address part. Like
|
||||
"192.168.0.1:2000-10000"
|
||||
|
||||
- Modified the separators used for CURLOPT_CERTINFO in multi-part outputs. I
|
||||
don't know how they got wrong in the first place, but using this output
|
||||
format makes it possible to quite easily separate the string into an array
|
||||
of multiple items.
|
||||
|
||||
Daniel Fandrich (16 June 2009)
|
||||
- Added a few more compiler warning options for gcc.
|
||||
|
||||
Daniel Stenberg (16 Jun 2009)
|
||||
- Reuven Wachtfogel made curl -o - properly produce a binary output on windows
|
||||
(no newline translations). Use -B/--use-ascii if you rather get the ascii
|
||||
approach.
|
||||
|
||||
Michal Marek (16 Jun 2009)
|
||||
- When doing non-anonymous ftp via http proxies and the password is not
|
||||
provided in the url, add it there (squid needs this).
|
||||
|
||||
Daniel Stenberg (15 Jun 2009)
|
||||
- Eric Wong's patch:
|
||||
|
||||
This allows curl(1) to be used as a client-side tunnel for arbitrary stream
|
||||
protocols by abusing chunked transfer encoding in both the HTTP request and
|
||||
HTTP response. This requires server support for sending a response while a
|
||||
request is still being read, of course.
|
||||
|
||||
If attempting to read from stdin returns EAGAIN, then we pause our sender.
|
||||
This leaves curl to attempt to read from the socket while reading from stdin
|
||||
(and thus sending) is paused.
|
||||
|
||||
This change was needed to allow successfully tunneling the git protocol over
|
||||
HTTP (--no-buffer is needed, as well).
|
||||
|
||||
Patrick Monnerat (15 Jun 2009)
|
||||
- Replaced use of standard C library rand()/srand() by our own pseudo-random
|
||||
number generator.
|
||||
|
||||
Yang Tse (11 Jun 2009)
|
||||
- I adapted testcurl script to allow building test harness programs when
|
||||
cross-compiling for a *-*-mingw* host.
|
||||
|
||||
Daniel Stenberg (10 Jun 2009)
|
||||
- Fabian Keil ran clang on the (lib)curl code, found a bunch of warnings and
|
||||
contributed a range of patches to fix them.
|
||||
|
||||
Yang Tse (10 Jun 2009)
|
||||
- I introduced configure script option --enable-curldebug which now allows
|
||||
the decoupled enabling or disabling of the curl debug memory tracking
|
||||
feature from the --enable-debug option which no longer controls this.
|
||||
|
||||
curl --version will list 'Debug' feature for debug enabled builds, and
|
||||
will list 'TrackMemory' feature for curl debug memory tracking capable
|
||||
builds. These features are independent and can be controlled when running
|
||||
the configure script. When --enable-debug is given both features will be
|
||||
enabled, unless some restriction prevents memory tracking from being used.
|
||||
|
||||
Internally, definition of preprocessor symbol DEBUGBUILD restricts code
|
||||
which is only compiled for debug enabled builds. And symbol CURLDEBUG is
|
||||
used to differentiate code which is _only_ used for memory tracking.
|
||||
|
||||
Yang Tse (9 Jun 2009)
|
||||
- Daniel Steinberg pointed out that Curl_FormInit() in formdata.c was not
|
||||
initializing the fread callback pointer and this triggered a compiler
|
||||
warning, also provided a friendly suggestion on how to fix it.
|
||||
|
||||
Daniel Stenberg (8 Jun 2009)
|
||||
- Claes Jakobsson provided a patch for libcurl-NSS that fixed a bad refcount
|
||||
issue with client certs that caused issues like segfaults.
|
||||
http://curl.haxx.se/mail/lib-2009-05/0316.html
|
||||
|
||||
- Triggered by bug report #2798852 and the patch in there, I fixed configure
|
||||
to detect gnutls build options with pkg-config only and not libgnutls-config
|
||||
anymore since GnuTLS has stopped distributing that tool. If an explicit path
|
||||
is given to configure, we will instead guess on how to link and use that
|
||||
lib. I did not use the patch from the bug report.
|
||||
|
||||
Yang Tse (8 Jun 2009)
|
||||
- Igor Novoseltsev adjusted Makefile.vxworks to get sources and headers
|
||||
included from Makefile.inc, and provided docs\INSTALL VxWorks section.
|
||||
|
||||
- I removed buildconf.bat from release and daily snapshot archives. This
|
||||
file is only for CVS tree checkout builds.
|
||||
|
||||
Daniel Stenberg (8 Jun 2009)
|
||||
- Eric Wong fixed --no-buffer to actually switch off output buffering. Been
|
||||
broken since 7.19.0
|
||||
|
||||
Bill Hoffman (6 Jun 2009)
|
||||
- Added some cmake docs and fixed socklen_t in the build.
|
||||
|
||||
Yang Tse (5 Jun 2009)
|
||||
- John E. Malmberg provided VMS specific patch: "This fixes an existing bug
|
||||
in urlglob.c where it was not converting the Curl Unix exit code to a VMS
|
||||
DCL compatible exit code. This fix required the enhancement described next.
|
||||
This also adds an enhancement to main.c so that when curl is run under a
|
||||
Unix shell like Bash on VMS, it will return the standard Unix exit codes
|
||||
and messages." And another patch for docs/examples.
|
||||
|
||||
I introduced os-specific.c and os-specific.h for use in curl tool code
|
||||
and adjusted John E. Malmberg's patch placement to use these new files
|
||||
as an effort to prevent main.c from growing ad infinitum. Code already
|
||||
existing in main.c which is OS specific should be moved into these files.
|
||||
|
||||
Daniel Stenberg (4 June 2009)
|
||||
- Setting the Content-Length: header from your app when you do a POST or PUT
|
||||
is almost always a VERY BAD IDEA. Yet there are still apps out there doing
|
||||
this, and now recently it triggered a bug/side-effect in libcurl as when
|
||||
libcurl sends a POST or PUT with NTLM, it sends an empty post first when it
|
||||
knows it will just get a 401/407 back. If the app then replaced the
|
||||
Content-Length header, it caused the server to wait for input that libcurl
|
||||
wouldn't send. Aaron Oneal reported this problem in bug report #2799008
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2799008) and helped us verify the fix.
|
||||
|
||||
Yang Tse (4 Jun 2009)
|
||||
- Igor Novoseltsev provided patches and information, that after some
|
||||
adjustments to better fit curl's way of doing things, have resulted
|
||||
in the posibility of building libcurl for VxWorks.
|
||||
|
||||
Daniel Fandrich (2 June 2009)
|
||||
- Checked in a Google Android make file. To use it, you must first
|
||||
create a config.h file by running configure in the Android environment,
|
||||
which doesn't seem to be easy to do. If no easy way can be found, a
|
||||
static config-android.h may need to be created and checked in to the
|
||||
libcurl source tree.
|
||||
|
||||
Daniel Stenberg (1 June 2009)
|
||||
- Claes Jakobsson fixed the configure script to better find and use NSS
|
||||
without pkg-config.
|
||||
|
||||
Yang Tse (1 Jun 2009)
|
||||
- John E. Malmberg provided a VMS specific clean-up for curl.h, and pointed
|
||||
out that the configure script was failing to detect the timeval struct on
|
||||
VMS when building with _XOPEN_SOURCE_EXTENDED undefined due to definition
|
||||
taking place in socket.h instead of time.h. I have adjusted configure
|
||||
script to also include this header when checking struct timeval.
|
||||
|
||||
Daniel Stenberg (27 May 2009)
|
||||
- Frank McGeough provided a small OpenSSL #include fix to make libcurl compile
|
||||
fine with Nokia 5th edition 1.0 SDK for Symbian.
|
||||
|
||||
- Andre Guibert de Bruet found a call to a OpenSSL function that didn't check
|
||||
for a failure properly.
|
||||
|
||||
- Mike Crowe pointed out that setting CURLOPT_USERPWD to NULL used to clear
|
||||
the auth credentials back in 7.19.0 and earlier while now you have to set ""
|
||||
to get the same effect. His patch brings back the ability to use NULL.
|
||||
|
||||
- Claes Jakobsson fixed libcurl-NSS to build fine even without the
|
||||
PK11_CreateGenericObject() function.
|
||||
|
||||
Daniel Stenberg (25 May 2009)
|
||||
- bug report #2796358 (http://curl.haxx.se/bug/view.cgi?id=2796358) pointed
|
||||
out that the cookie parser would leak memory when it parses cookies that are
|
||||
received with domain, path etc set multiple times in the same header. While
|
||||
such a cookie is questionable, they occur in the wild and libcurl no longer
|
||||
leaks memory for them. I added such a header to test case 8.
|
||||
|
||||
Daniel Fandrich (22 May 2009)
|
||||
- Removed some obsolete digest code that caused a valgrind error in test 551.
|
||||
|
||||
Daniel Fandrich (20 May 2009)
|
||||
- Added "non-existing host" test keywords to make it easy to skip those
|
||||
tests on machines that have broken DNS configurations (such as
|
||||
those configured to use OpenDNS).
|
||||
|
||||
Daniel Stenberg (19 May 2009)
|
||||
- Kamil Dudka brought the patch from the Redhat bug entry
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=427966 which was libcurl closing
|
||||
a bad file descriptor when closing down the FTP data connection. Caolan
|
||||
McNamara seems to be the original author of it.
|
||||
|
||||
Version 7.19.5 (18 May 2009)
|
||||
|
||||
Daniel Stenberg (17 May 2009)
|
||||
|
@@ -6,6 +6,13 @@
|
||||
# include <sys/types.h>
|
||||
#endif /* HAVE_SYS_TYPES_H */
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <winsock2.h>
|
||||
# include <ws2tcpip.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif /* HAVE_STDINT_H */
|
||||
|
@@ -6,51 +6,51 @@
|
||||
# VARIABLE - variable to store size if the type exists.
|
||||
# HAVE_${VARIABLE} - does the variable exists or not
|
||||
|
||||
MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
|
||||
SET(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1)
|
||||
IF(NOT DEFINED ${VARIABLE})
|
||||
IF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
|
||||
SET(CHECK_TYPE_SIZE_TYPE "${TYPE}")
|
||||
SET(MACRO_CHECK_TYPE_SIZE_FLAGS
|
||||
"${CMAKE_REQUIRED_FLAGS}")
|
||||
FOREACH(def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H)
|
||||
IF("${def}")
|
||||
SET(MACRO_CHECK_TYPE_SIZE_FLAGS
|
||||
"${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}")
|
||||
ENDIF("${def}")
|
||||
ENDFOREACH(def)
|
||||
SET(CHECK_TYPE_SIZE_PREMAIN)
|
||||
FOREACH(def ${CMAKE_EXTRA_INCLUDE_FILES})
|
||||
SET(CHECK_TYPE_SIZE_PREMAIN "${CHECK_TYPE_SIZE_PREMAIN}#include \"${def}\"\n")
|
||||
ENDFOREACH(def)
|
||||
CONFIGURE_FILE(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/CMake/CheckTypeSize.c.in"
|
||||
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckTypeSize.c"
|
||||
IMMEDIATE @ONLY)
|
||||
FILE(READ
|
||||
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckTypeSize.c"
|
||||
CHECK_TYPE_SIZE_FILE_CONTENT)
|
||||
MESSAGE(STATUS "Check size of ${TYPE}")
|
||||
IF(CMAKE_REQUIRED_LIBRARIES)
|
||||
SET(CHECK_TYPE_SIZE_ADD_LIBRARIES
|
||||
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
|
||||
ENDIF(CMAKE_REQUIRED_LIBRARIES)
|
||||
TRY_RUN(${VARIABLE} HAVE_${VARIABLE}
|
||||
${CMAKE_BINARY_DIR}
|
||||
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckTypeSize.c"
|
||||
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_TYPE_SIZE_FLAGS}
|
||||
"${CHECK_TYPE_SIZE_ADD_LIBRARIES}"
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
IF(HAVE_${VARIABLE})
|
||||
MESSAGE(STATUS "Check size of ${TYPE} - done")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determining size of ${TYPE} passed with the following output:\n${OUTPUT}\n\n")
|
||||
ELSE(HAVE_${VARIABLE})
|
||||
MESSAGE(STATUS "Check size of ${TYPE} - failed")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\nCheckTypeSize.c:\n${CHECK_TYPE_SIZE_FILE_CONTENT}\n\n")
|
||||
ENDIF(HAVE_${VARIABLE})
|
||||
ENDIF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
|
||||
ENDIF(NOT DEFINED ${VARIABLE})
|
||||
SET(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS )
|
||||
ENDMACRO(CHECK_TYPE_SIZE)
|
||||
macro(CHECK_TYPE_SIZE TYPE VARIABLE)
|
||||
set(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1)
|
||||
if(NOT DEFINED ${VARIABLE})
|
||||
if("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
|
||||
set(CHECK_TYPE_SIZE_TYPE "${TYPE}")
|
||||
set(MACRO_CHECK_TYPE_SIZE_FLAGS
|
||||
"${CMAKE_REQUIRED_FLAGS}")
|
||||
foreach(def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H)
|
||||
if("${def}")
|
||||
set(MACRO_CHECK_TYPE_SIZE_FLAGS
|
||||
"${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}")
|
||||
endif("${def}")
|
||||
endforeach(def)
|
||||
set(CHECK_TYPE_SIZE_PREMAIN)
|
||||
foreach(def ${CMAKE_EXTRA_INCLUDE_FILES})
|
||||
set(CHECK_TYPE_SIZE_PREMAIN "${CHECK_TYPE_SIZE_PREMAIN}#include \"${def}\"\n")
|
||||
endforeach(def)
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/CMake/CheckTypeSize.c.in"
|
||||
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckTypeSize.c"
|
||||
IMMEDIATE @ONLY)
|
||||
file(READ
|
||||
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckTypeSize.c"
|
||||
CHECK_TYPE_SIZE_FILE_CONTENT)
|
||||
message(STATUS "Check size of ${TYPE}")
|
||||
if(CMAKE_REQUIRED_LIBRARIES)
|
||||
set(CHECK_TYPE_SIZE_ADD_LIBRARIES
|
||||
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
|
||||
endif(CMAKE_REQUIRED_LIBRARIES)
|
||||
try_run(${VARIABLE} HAVE_${VARIABLE}
|
||||
${CMAKE_BINARY_DIR}
|
||||
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckTypeSize.c"
|
||||
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_TYPE_SIZE_FLAGS}
|
||||
"${CHECK_TYPE_SIZE_ADD_LIBRARIES}"
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
if(HAVE_${VARIABLE})
|
||||
message(STATUS "Check size of ${TYPE} - done")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Determining size of ${TYPE} passed with the following output:\n${OUTPUT}\n\n")
|
||||
else(HAVE_${VARIABLE})
|
||||
message(STATUS "Check size of ${TYPE} - failed")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\nCheckTypeSize.c:\n${CHECK_TYPE_SIZE_FILE_CONTENT}\n\n")
|
||||
endif(HAVE_${VARIABLE})
|
||||
endif("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
|
||||
endif(NOT DEFINED ${VARIABLE})
|
||||
set(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS )
|
||||
endmacro(CHECK_TYPE_SIZE)
|
||||
|
@@ -12,43 +12,43 @@
|
||||
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
||||
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||
|
||||
MACRO(CURL_CHECK_C_SOURCE_COMPILES SOURCE VAR)
|
||||
IF("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
|
||||
SET(message "${VAR}")
|
||||
macro(CURL_CHECK_C_SOURCE_COMPILES SOURCE VAR)
|
||||
if("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
|
||||
set(message "${VAR}")
|
||||
# If the number of arguments is greater than 2 (SOURCE VAR)
|
||||
IF(${ARGC} GREATER 2)
|
||||
if(${ARGC} GREATER 2)
|
||||
# then add the third argument as a message
|
||||
SET(message "${ARGV2} (${VAR})")
|
||||
ENDIF(${ARGC} GREATER 2)
|
||||
SET(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||
set(message "${ARGV2} (${VAR})")
|
||||
endif(${ARGC} GREATER 2)
|
||||
set(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
|
||||
IF(CMAKE_REQUIRED_LIBRARIES)
|
||||
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
|
||||
if(CMAKE_REQUIRED_LIBRARIES)
|
||||
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
|
||||
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
|
||||
ELSE(CMAKE_REQUIRED_LIBRARIES)
|
||||
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
|
||||
ENDIF(CMAKE_REQUIRED_LIBRARIES)
|
||||
IF(CMAKE_REQUIRED_INCLUDES)
|
||||
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
|
||||
else(CMAKE_REQUIRED_LIBRARIES)
|
||||
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
|
||||
endif(CMAKE_REQUIRED_LIBRARIES)
|
||||
if(CMAKE_REQUIRED_INCLUDES)
|
||||
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
|
||||
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
|
||||
ELSE(CMAKE_REQUIRED_INCLUDES)
|
||||
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
|
||||
ENDIF(CMAKE_REQUIRED_INCLUDES)
|
||||
SET(src "")
|
||||
FOREACH(def ${EXTRA_DEFINES})
|
||||
SET(src "${src}#define ${def} 1\n")
|
||||
ENDFOREACH(def)
|
||||
FOREACH(inc ${HEADER_INCLUDES})
|
||||
SET(src "${src}#include <${inc}>\n")
|
||||
ENDFOREACH(inc)
|
||||
else(CMAKE_REQUIRED_INCLUDES)
|
||||
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
|
||||
endif(CMAKE_REQUIRED_INCLUDES)
|
||||
set(src "")
|
||||
foreach(def ${EXTRA_DEFINES})
|
||||
set(src "${src}#define ${def} 1\n")
|
||||
endforeach(def)
|
||||
foreach(inc ${HEADER_INCLUDES})
|
||||
set(src "${src}#include <${inc}>\n")
|
||||
endforeach(inc)
|
||||
|
||||
SET(src "${src}\nint main() { ${SOURCE} ; return 0; }")
|
||||
SET(CMAKE_CONFIGURABLE_FILE_CONTENT "${src}")
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CMakeConfigurableFile.in
|
||||
set(src "${src}\nint main() { ${SOURCE} ; return 0; }")
|
||||
set(CMAKE_CONFIGURABLE_FILE_CONTENT "${src}")
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CMakeConfigurableFile.in
|
||||
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
|
||||
IMMEDIATE)
|
||||
MESSAGE(STATUS "Performing Test ${message}")
|
||||
TRY_COMPILE(${VAR}
|
||||
message(STATUS "Performing Test ${message}")
|
||||
try_compile(${VAR}
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
|
||||
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
|
||||
@@ -56,20 +56,20 @@ MACRO(CURL_CHECK_C_SOURCE_COMPILES SOURCE VAR)
|
||||
"${CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
|
||||
"${CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
IF(${VAR})
|
||||
SET(${VAR} 1 CACHE INTERNAL "Test ${message}")
|
||||
MESSAGE(STATUS "Performing Test ${message} - Success")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
if(${VAR})
|
||||
set(${VAR} 1 CACHE INTERNAL "Test ${message}")
|
||||
message(STATUS "Performing Test ${message} - Success")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Performing C SOURCE FILE Test ${message} succeded with the following output:\n"
|
||||
"${OUTPUT}\n"
|
||||
"Source file was:\n${src}\n")
|
||||
ELSE(${VAR})
|
||||
MESSAGE(STATUS "Performing Test ${message} - Failed")
|
||||
SET(${VAR} "" CACHE INTERNAL "Test ${message}")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
else(${VAR})
|
||||
message(STATUS "Performing Test ${message} - Failed")
|
||||
set(${VAR} "" CACHE INTERNAL "Test ${message}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Performing C SOURCE FILE Test ${message} failed with the following output:\n"
|
||||
"${OUTPUT}\n"
|
||||
"Source file was:\n${src}\n")
|
||||
ENDIF(${VAR})
|
||||
ENDIF("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
|
||||
ENDMACRO(CURL_CHECK_C_SOURCE_COMPILES)
|
||||
endif(${VAR})
|
||||
endif("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
|
||||
endmacro(CURL_CHECK_C_SOURCE_COMPILES)
|
||||
|
@@ -12,43 +12,43 @@
|
||||
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
||||
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||
|
||||
MACRO(CURL_CHECK_C_SOURCE_RUNS SOURCE VAR)
|
||||
IF("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
|
||||
SET(message "${VAR}")
|
||||
macro(CURL_CHECK_C_SOURCE_RUNS SOURCE VAR)
|
||||
if("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
|
||||
set(message "${VAR}")
|
||||
# If the number of arguments is greater than 2 (SOURCE VAR)
|
||||
IF(${ARGC} GREATER 2)
|
||||
if(${ARGC} GREATER 2)
|
||||
# then add the third argument as a message
|
||||
SET(message "${ARGV2} (${VAR})")
|
||||
ENDIF(${ARGC} GREATER 2)
|
||||
SET(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||
set(message "${ARGV2} (${VAR})")
|
||||
endif(${ARGC} GREATER 2)
|
||||
set(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
|
||||
IF(CMAKE_REQUIRED_LIBRARIES)
|
||||
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
|
||||
if(CMAKE_REQUIRED_LIBRARIES)
|
||||
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
|
||||
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
|
||||
ELSE(CMAKE_REQUIRED_LIBRARIES)
|
||||
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
|
||||
ENDIF(CMAKE_REQUIRED_LIBRARIES)
|
||||
IF(CMAKE_REQUIRED_INCLUDES)
|
||||
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
|
||||
else(CMAKE_REQUIRED_LIBRARIES)
|
||||
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
|
||||
endif(CMAKE_REQUIRED_LIBRARIES)
|
||||
if(CMAKE_REQUIRED_INCLUDES)
|
||||
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
|
||||
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
|
||||
ELSE(CMAKE_REQUIRED_INCLUDES)
|
||||
SET(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
|
||||
ENDIF(CMAKE_REQUIRED_INCLUDES)
|
||||
SET(src "")
|
||||
FOREACH(def ${EXTRA_DEFINES})
|
||||
SET(src "${src}#define ${def} 1\n")
|
||||
ENDFOREACH(def)
|
||||
FOREACH(inc ${HEADER_INCLUDES})
|
||||
SET(src "${src}#include <${inc}>\n")
|
||||
ENDFOREACH(inc)
|
||||
else(CMAKE_REQUIRED_INCLUDES)
|
||||
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
|
||||
endif(CMAKE_REQUIRED_INCLUDES)
|
||||
set(src "")
|
||||
foreach(def ${EXTRA_DEFINES})
|
||||
set(src "${src}#define ${def} 1\n")
|
||||
endforeach(def)
|
||||
foreach(inc ${HEADER_INCLUDES})
|
||||
set(src "${src}#include <${inc}>\n")
|
||||
endforeach(inc)
|
||||
|
||||
SET(src "${src}\nint main() { ${SOURCE} ; return 0; }")
|
||||
SET(CMAKE_CONFIGURABLE_FILE_CONTENT "${src}")
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CMakeConfigurableFile.in
|
||||
set(src "${src}\nint main() { ${SOURCE} ; return 0; }")
|
||||
set(CMAKE_CONFIGURABLE_FILE_CONTENT "${src}")
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CMakeConfigurableFile.in
|
||||
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
|
||||
IMMEDIATE)
|
||||
MESSAGE(STATUS "Performing Test ${message}")
|
||||
TRY_RUN(${VAR} ${VAR}_COMPILED
|
||||
message(STATUS "Performing Test ${message}")
|
||||
try_run(${VAR} ${VAR}_COMPILED
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
|
||||
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
|
||||
@@ -57,27 +57,27 @@ MACRO(CURL_CHECK_C_SOURCE_RUNS SOURCE VAR)
|
||||
"${CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
# if it did not compile make the return value fail code of 1
|
||||
IF(NOT ${VAR}_COMPILED)
|
||||
SET(${VAR} 1)
|
||||
ENDIF(NOT ${VAR}_COMPILED)
|
||||
if(NOT ${VAR}_COMPILED)
|
||||
set(${VAR} 1)
|
||||
endif(NOT ${VAR}_COMPILED)
|
||||
# if the return value was 0 then it worked
|
||||
SET(result_var ${${VAR}})
|
||||
IF("${result_var}" EQUAL 0)
|
||||
SET(${VAR} 1 CACHE INTERNAL "Test ${message}")
|
||||
MESSAGE(STATUS "Performing Test ${message} - Success")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
set(result_var ${${VAR}})
|
||||
if("${result_var}" EQUAL 0)
|
||||
set(${VAR} 1 CACHE INTERNAL "Test ${message}")
|
||||
message(STATUS "Performing Test ${message} - Success")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Performing C SOURCE FILE Test ${message} succeded with the following output:\n"
|
||||
"${OUTPUT}\n"
|
||||
"Return value: ${${VAR}}\n"
|
||||
"Source file was:\n${src}\n")
|
||||
ELSE("${result_var}" EQUAL 0)
|
||||
MESSAGE(STATUS "Performing Test ${message} - Failed")
|
||||
SET(${VAR} "" CACHE INTERNAL "Test ${message}")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
else("${result_var}" EQUAL 0)
|
||||
message(STATUS "Performing Test ${message} - Failed")
|
||||
set(${VAR} "" CACHE INTERNAL "Test ${message}")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Performing C SOURCE FILE Test ${message} failed with the following output:\n"
|
||||
"${OUTPUT}\n"
|
||||
"Return value: ${result_var}\n"
|
||||
"Source file was:\n${src}\n")
|
||||
ENDIF("${result_var}" EQUAL 0)
|
||||
ENDIF("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
|
||||
ENDMACRO(CURL_CHECK_C_SOURCE_RUNS)
|
||||
endif("${result_var}" EQUAL 0)
|
||||
endif("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
|
||||
endmacro(CURL_CHECK_C_SOURCE_RUNS)
|
||||
|
42
CMake/FindCARES.cmake
Executable file
42
CMake/FindCARES.cmake
Executable file
@@ -0,0 +1,42 @@
|
||||
# - Find c-ares
|
||||
# Find the c-ares includes and library
|
||||
# This module defines
|
||||
# CARES_INCLUDE_DIR, where to find ares.h, etc.
|
||||
# CARES_LIBRARIES, the libraries needed to use c-ares.
|
||||
# CARES_FOUND, If false, do not try to use c-ares.
|
||||
# also defined, but not for general use are
|
||||
# CARES_LIBRARY, where to find the c-ares library.
|
||||
|
||||
FIND_PATH(CARES_INCLUDE_DIR ares.h
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
)
|
||||
|
||||
SET(CARES_NAMES ${CARES_NAMES} cares)
|
||||
FIND_LIBRARY(CARES_LIBRARY
|
||||
NAMES ${CARES_NAMES}
|
||||
PATHS /usr/lib /usr/local/lib
|
||||
)
|
||||
|
||||
IF (CARES_LIBRARY AND CARES_INCLUDE_DIR)
|
||||
SET(CARES_LIBRARIES ${CARES_LIBRARY})
|
||||
SET(CARES_FOUND "YES")
|
||||
ELSE (CARES_LIBRARY AND CARES_INCLUDE_DIR)
|
||||
SET(CARES_FOUND "NO")
|
||||
ENDIF (CARES_LIBRARY AND CARES_INCLUDE_DIR)
|
||||
|
||||
|
||||
IF (CARES_FOUND)
|
||||
IF (NOT CARES_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found c-ares: ${CARES_LIBRARIES}")
|
||||
ENDIF (NOT CARES_FIND_QUIETLY)
|
||||
ELSE (CARES_FOUND)
|
||||
IF (CARES_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find c-ares library")
|
||||
ENDIF (CARES_FIND_REQUIRED)
|
||||
ENDIF (CARES_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
CARES_LIBRARY
|
||||
CARES_INCLUDE_DIR
|
||||
)
|
@@ -1,19 +1,19 @@
|
||||
# Extension of the standard FindOpenSSL.cmake
|
||||
# Adds OPENSSL_INCLUDE_DIRS and libeay32
|
||||
INCLUDE("${CMAKE_ROOT}/Modules/FindOpenSSL.cmake")
|
||||
include("${CMAKE_ROOT}/Modules/FindOpenSSL.cmake")
|
||||
|
||||
# Bill Hoffman told that libeay32 is necessary for him:
|
||||
FIND_LIBRARY(SSL_LIBEAY NAMES libeay32)
|
||||
find_library(SSL_LIBEAY NAMES libeay32)
|
||||
|
||||
IF(OPENSSL_FOUND)
|
||||
IF(SSL_LIBEAY)
|
||||
LIST(APPEND OPENSSL_LIBRARIES ${SSL_LIBEAY})
|
||||
ELSE()
|
||||
SET(OPENSSL_FOUND FALSE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
if(OPENSSL_FOUND)
|
||||
if(SSL_LIBEAY)
|
||||
list(APPEND OPENSSL_LIBRARIES ${SSL_LIBEAY})
|
||||
else()
|
||||
set(OPENSSL_FOUND FALSE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
IF(OPENSSL_FOUND)
|
||||
SET(OPENSSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
if(OPENSSL_FOUND)
|
||||
set(OPENSSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
|
||||
endif()
|
||||
|
@@ -1,8 +1,8 @@
|
||||
# Locate zlib
|
||||
INCLUDE("${CMAKE_ROOT}/Modules/FindZLIB.cmake")
|
||||
include("${CMAKE_ROOT}/Modules/FindZLIB.cmake")
|
||||
|
||||
FIND_LIBRARY(ZLIB_LIBRARY_DEBUG NAMES zd zlibd zdlld zlib1d )
|
||||
find_library(ZLIB_LIBRARY_DEBUG NAMES zd zlibd zdlld zlib1d )
|
||||
|
||||
IF(ZLIB_FOUND AND ZLIB_LIBRARY_DEBUG)
|
||||
SET( ZLIB_LIBRARIES optimized "${ZLIB_LIBRARY}" debug ${ZLIB_LIBRARY_DEBUG})
|
||||
ENDIF()
|
||||
if(ZLIB_FOUND AND ZLIB_LIBRARY_DEBUG)
|
||||
set( ZLIB_LIBRARIES optimized "${ZLIB_LIBRARY}" debug ${ZLIB_LIBRARY_DEBUG})
|
||||
endif()
|
||||
|
@@ -1,250 +1,250 @@
|
||||
INCLUDE(CurlCheckCSourceCompiles)
|
||||
SET(EXTRA_DEFINES "__unused1\n#undef inline\n#define __unused2")
|
||||
SET(HEADER_INCLUDES)
|
||||
SET(headers_hack)
|
||||
include(CurlCheckCSourceCompiles)
|
||||
set(EXTRA_DEFINES "__unused1\n#undef inline\n#define __unused2")
|
||||
set(HEADER_INCLUDES)
|
||||
set(headers_hack)
|
||||
|
||||
MACRO(add_header_include check header)
|
||||
IF(${check})
|
||||
SET(headers_hack
|
||||
macro(add_header_include check header)
|
||||
if(${check})
|
||||
set(headers_hack
|
||||
"${headers_hack}\n#include <${header}>")
|
||||
#SET(HEADER_INCLUDES
|
||||
# ${HEADER_INCLUDES}
|
||||
# "${header}")
|
||||
ENDIF(${check})
|
||||
ENDMACRO(add_header_include)
|
||||
endif(${check})
|
||||
endmacro(add_header_include)
|
||||
|
||||
SET(signature_call_conv)
|
||||
IF(HAVE_WINDOWS_H)
|
||||
set(signature_call_conv)
|
||||
if(HAVE_WINDOWS_H)
|
||||
add_header_include(HAVE_WINDOWS_H "windows.h")
|
||||
add_header_include(HAVE_WINSOCK2_H "winsock2.h")
|
||||
add_header_include(HAVE_WINSOCK_H "winsock.h")
|
||||
SET(EXTRA_DEFINES ${EXTRA_DEFINES}
|
||||
set(EXTRA_DEFINES ${EXTRA_DEFINES}
|
||||
"__unused7\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif\n#define __unused3")
|
||||
SET(signature_call_conv "PASCAL")
|
||||
ELSE(HAVE_WINDOWS_H)
|
||||
set(signature_call_conv "PASCAL")
|
||||
else(HAVE_WINDOWS_H)
|
||||
add_header_include(HAVE_SYS_TYPES_H "sys/types.h")
|
||||
add_header_include(HAVE_SYS_SOCKET_H "sys/socket.h")
|
||||
ENDIF(HAVE_WINDOWS_H)
|
||||
endif(HAVE_WINDOWS_H)
|
||||
|
||||
SET(EXTRA_DEFINES_BACKUP "${EXTRA_DEFINES}")
|
||||
SET(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5")
|
||||
CURL_CHECK_C_SOURCE_COMPILES("recv(0, 0, 0, 0)" curl_cv_recv)
|
||||
IF(curl_cv_recv)
|
||||
set(EXTRA_DEFINES_BACKUP "${EXTRA_DEFINES}")
|
||||
set(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5")
|
||||
curl_check_c_source_compiles("recv(0, 0, 0, 0)" curl_cv_recv)
|
||||
if(curl_cv_recv)
|
||||
# AC_CACHE_CHECK([types of arguments and return type for recv],
|
||||
#[curl_cv_func_recv_args], [
|
||||
#SET(curl_cv_func_recv_args "unknown")
|
||||
#for recv_retv in 'int' 'ssize_t'; do
|
||||
IF(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown")
|
||||
FOREACH(recv_retv "int" "ssize_t" )
|
||||
FOREACH(recv_arg1 "int" "ssize_t" "SOCKET")
|
||||
FOREACH(recv_arg2 "void *" "char *")
|
||||
FOREACH(recv_arg3 "size_t" "int" "socklen_t" "unsigned int")
|
||||
FOREACH(recv_arg4 "int" "unsigned int")
|
||||
IF(NOT curl_cv_func_recv_done)
|
||||
SET(curl_cv_func_recv_test "UNKNOWN")
|
||||
SET(extern_line "extern ${recv_retv} ${signature_call_conv} recv(${recv_arg1}, ${recv_arg2}, ${recv_arg3}, ${recv_arg4})\;")
|
||||
SET(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5")
|
||||
CURL_CHECK_C_SOURCE_COMPILES("
|
||||
if(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown")
|
||||
foreach(recv_retv "int" "ssize_t" )
|
||||
foreach(recv_arg1 "int" "ssize_t" "SOCKET")
|
||||
foreach(recv_arg2 "void *" "char *")
|
||||
foreach(recv_arg3 "size_t" "int" "socklen_t" "unsigned int")
|
||||
foreach(recv_arg4 "int" "unsigned int")
|
||||
if(NOT curl_cv_func_recv_done)
|
||||
set(curl_cv_func_recv_test "UNKNOWN")
|
||||
set(extern_line "extern ${recv_retv} ${signature_call_conv} recv(${recv_arg1}, ${recv_arg2}, ${recv_arg3}, ${recv_arg4})\;")
|
||||
set(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5")
|
||||
curl_check_c_source_compiles("
|
||||
${recv_arg1} s=0;
|
||||
${recv_arg2} buf=0;
|
||||
${recv_arg3} len=0;
|
||||
${recv_arg4} flags=0;
|
||||
${recv_retv} res = recv(s, buf, len, flags)"
|
||||
curl_cv_func_recv_test
|
||||
"${recv_retv} recv(${recv_arg1}, ${recv_arg2}, ${recv_arg3}, ${recv_arg4})")
|
||||
IF(curl_cv_func_recv_test)
|
||||
SET(curl_cv_func_recv_args
|
||||
curl_cv_func_recv_test
|
||||
"${recv_retv} recv(${recv_arg1}, ${recv_arg2}, ${recv_arg3}, ${recv_arg4})")
|
||||
if(curl_cv_func_recv_test)
|
||||
set(curl_cv_func_recv_args
|
||||
"${recv_arg1},${recv_arg2},${recv_arg3},${recv_arg4},${recv_retv}")
|
||||
SET(RECV_TYPE_ARG1 "${recv_arg1}")
|
||||
SET(RECV_TYPE_ARG2 "${recv_arg2}")
|
||||
SET(RECV_TYPE_ARG3 "${recv_arg3}")
|
||||
SET(RECV_TYPE_ARG4 "${recv_arg4}")
|
||||
SET(RECV_TYPE_RETV "${recv_retv}")
|
||||
SET(HAVE_RECV 1)
|
||||
SET(curl_cv_func_recv_done 1)
|
||||
ENDIF(curl_cv_func_recv_test)
|
||||
ENDIF(NOT curl_cv_func_recv_done)
|
||||
ENDFOREACH(recv_arg4)
|
||||
ENDFOREACH(recv_arg3)
|
||||
ENDFOREACH(recv_arg2)
|
||||
ENDFOREACH(recv_arg1)
|
||||
ENDFOREACH(recv_retv)
|
||||
ELSE(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown")
|
||||
STRING(REGEX REPLACE "^([^,]*),[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG1 "${curl_cv_func_recv_args}")
|
||||
STRING(REGEX REPLACE "^[^,]*,([^,]*),[^,]*,[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG2 "${curl_cv_func_recv_args}")
|
||||
STRING(REGEX REPLACE "^[^,]*,[^,]*,([^,]*),[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG3 "${curl_cv_func_recv_args}")
|
||||
STRING(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,([^,]*),[^,]*$" "\\1" RECV_TYPE_ARG4 "${curl_cv_func_recv_args}")
|
||||
STRING(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,([^,]*)$" "\\1" RECV_TYPE_RETV "${curl_cv_func_recv_args}")
|
||||
set(RECV_TYPE_ARG1 "${recv_arg1}")
|
||||
set(RECV_TYPE_ARG2 "${recv_arg2}")
|
||||
set(RECV_TYPE_ARG3 "${recv_arg3}")
|
||||
set(RECV_TYPE_ARG4 "${recv_arg4}")
|
||||
set(RECV_TYPE_RETV "${recv_retv}")
|
||||
set(HAVE_RECV 1)
|
||||
set(curl_cv_func_recv_done 1)
|
||||
endif(curl_cv_func_recv_test)
|
||||
endif(NOT curl_cv_func_recv_done)
|
||||
endforeach(recv_arg4)
|
||||
endforeach(recv_arg3)
|
||||
endforeach(recv_arg2)
|
||||
endforeach(recv_arg1)
|
||||
endforeach(recv_retv)
|
||||
else(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown")
|
||||
string(REGEX REPLACE "^([^,]*),[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG1 "${curl_cv_func_recv_args}")
|
||||
string(REGEX REPLACE "^[^,]*,([^,]*),[^,]*,[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG2 "${curl_cv_func_recv_args}")
|
||||
string(REGEX REPLACE "^[^,]*,[^,]*,([^,]*),[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG3 "${curl_cv_func_recv_args}")
|
||||
string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,([^,]*),[^,]*$" "\\1" RECV_TYPE_ARG4 "${curl_cv_func_recv_args}")
|
||||
string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,([^,]*)$" "\\1" RECV_TYPE_RETV "${curl_cv_func_recv_args}")
|
||||
#MESSAGE("RECV_TYPE_ARG1 ${RECV_TYPE_ARG1}")
|
||||
#MESSAGE("RECV_TYPE_ARG2 ${RECV_TYPE_ARG2}")
|
||||
#MESSAGE("RECV_TYPE_ARG3 ${RECV_TYPE_ARG3}")
|
||||
#MESSAGE("RECV_TYPE_ARG4 ${RECV_TYPE_ARG4}")
|
||||
#MESSAGE("RECV_TYPE_RETV ${RECV_TYPE_RETV}")
|
||||
ENDIF(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown")
|
||||
endif(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown")
|
||||
|
||||
IF("${curl_cv_func_recv_args}" STREQUAL "unknown")
|
||||
MESSAGE(FATAL_ERROR "Cannot find proper types to use for recv args")
|
||||
ENDIF("${curl_cv_func_recv_args}" STREQUAL "unknown")
|
||||
ELSE(curl_cv_recv)
|
||||
MESSAGE(FATAL_ERROR "Unable to link function recv")
|
||||
ENDIF(curl_cv_recv)
|
||||
SET(curl_cv_func_recv_args "${curl_cv_func_recv_args}" CACHE INTERNAL "Arguments for recv")
|
||||
SET(HAVE_RECV 1)
|
||||
if("${curl_cv_func_recv_args}" STREQUAL "unknown")
|
||||
message(FATAL_ERROR "Cannot find proper types to use for recv args")
|
||||
endif("${curl_cv_func_recv_args}" STREQUAL "unknown")
|
||||
else(curl_cv_recv)
|
||||
message(FATAL_ERROR "Unable to link function recv")
|
||||
endif(curl_cv_recv)
|
||||
set(curl_cv_func_recv_args "${curl_cv_func_recv_args}" CACHE INTERNAL "Arguments for recv")
|
||||
set(HAVE_RECV 1)
|
||||
|
||||
CURL_CHECK_C_SOURCE_COMPILES("send(0, 0, 0, 0)" curl_cv_send)
|
||||
IF(curl_cv_send)
|
||||
curl_check_c_source_compiles("send(0, 0, 0, 0)" curl_cv_send)
|
||||
if(curl_cv_send)
|
||||
# AC_CACHE_CHECK([types of arguments and return type for send],
|
||||
#[curl_cv_func_send_args], [
|
||||
#SET(curl_cv_func_send_args "unknown")
|
||||
#for send_retv in 'int' 'ssize_t'; do
|
||||
IF(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown")
|
||||
FOREACH(send_retv "int" "ssize_t" )
|
||||
FOREACH(send_arg1 "int" "ssize_t" "SOCKET")
|
||||
FOREACH(send_arg2 "const void *" "void *" "char *" "const char *")
|
||||
FOREACH(send_arg3 "size_t" "int" "socklen_t" "unsigned int")
|
||||
FOREACH(send_arg4 "int" "unsigned int")
|
||||
IF(NOT curl_cv_func_send_done)
|
||||
SET(curl_cv_func_send_test "UNKNOWN")
|
||||
SET(extern_line "extern ${send_retv} ${signature_call_conv} send(${send_arg1}, ${send_arg2}, ${send_arg3}, ${send_arg4})\;")
|
||||
SET(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5")
|
||||
CURL_CHECK_C_SOURCE_COMPILES("
|
||||
if(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown")
|
||||
foreach(send_retv "int" "ssize_t" )
|
||||
foreach(send_arg1 "int" "ssize_t" "SOCKET")
|
||||
foreach(send_arg2 "const void *" "void *" "char *" "const char *")
|
||||
foreach(send_arg3 "size_t" "int" "socklen_t" "unsigned int")
|
||||
foreach(send_arg4 "int" "unsigned int")
|
||||
if(NOT curl_cv_func_send_done)
|
||||
set(curl_cv_func_send_test "UNKNOWN")
|
||||
set(extern_line "extern ${send_retv} ${signature_call_conv} send(${send_arg1}, ${send_arg2}, ${send_arg3}, ${send_arg4})\;")
|
||||
set(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5")
|
||||
curl_check_c_source_compiles("
|
||||
${send_arg1} s=0;
|
||||
${send_arg2} buf=0;
|
||||
${send_arg3} len=0;
|
||||
${send_arg4} flags=0;
|
||||
${send_retv} res = send(s, buf, len, flags)"
|
||||
curl_cv_func_send_test
|
||||
"${send_retv} send(${send_arg1}, ${send_arg2}, ${send_arg3}, ${send_arg4})")
|
||||
IF(curl_cv_func_send_test)
|
||||
curl_cv_func_send_test
|
||||
"${send_retv} send(${send_arg1}, ${send_arg2}, ${send_arg3}, ${send_arg4})")
|
||||
if(curl_cv_func_send_test)
|
||||
#MESSAGE("Found arguments: ${curl_cv_func_send_test}")
|
||||
STRING(REGEX REPLACE "(const) .*" "\\1" send_qual_arg2 "${send_arg2}")
|
||||
STRING(REGEX REPLACE "const (.*)" "\\1" send_arg2 "${send_arg2}")
|
||||
SET(curl_cv_func_send_args
|
||||
string(REGEX REPLACE "(const) .*" "\\1" send_qual_arg2 "${send_arg2}")
|
||||
string(REGEX REPLACE "const (.*)" "\\1" send_arg2 "${send_arg2}")
|
||||
set(curl_cv_func_send_args
|
||||
"${send_arg1},${send_arg2},${send_arg3},${send_arg4},${send_retv},${send_qual_arg2}")
|
||||
SET(SEND_TYPE_ARG1 "${send_arg1}")
|
||||
SET(SEND_TYPE_ARG2 "${send_arg2}")
|
||||
SET(SEND_TYPE_ARG3 "${send_arg3}")
|
||||
SET(SEND_TYPE_ARG4 "${send_arg4}")
|
||||
SET(SEND_TYPE_RETV "${send_retv}")
|
||||
SET(HAVE_SEND 1)
|
||||
SET(curl_cv_func_send_done 1)
|
||||
ENDIF(curl_cv_func_send_test)
|
||||
ENDIF(NOT curl_cv_func_send_done)
|
||||
ENDFOREACH(send_arg4)
|
||||
ENDFOREACH(send_arg3)
|
||||
ENDFOREACH(send_arg2)
|
||||
ENDFOREACH(send_arg1)
|
||||
ENDFOREACH(send_retv)
|
||||
ELSE(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown")
|
||||
STRING(REGEX REPLACE "^([^,]*),[^,]*,[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG1 "${curl_cv_func_send_args}")
|
||||
STRING(REGEX REPLACE "^[^,]*,([^,]*),[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG2 "${curl_cv_func_send_args}")
|
||||
STRING(REGEX REPLACE "^[^,]*,[^,]*,([^,]*),[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG3 "${curl_cv_func_send_args}")
|
||||
STRING(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,([^,]*),[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG4 "${curl_cv_func_send_args}")
|
||||
STRING(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,([^,]*),[^,]*$" "\\1" SEND_TYPE_RETV "${curl_cv_func_send_args}")
|
||||
STRING(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,[^,]*,([^,]*)$" "\\1" SEND_QUAL_ARG2 "${curl_cv_func_send_args}")
|
||||
set(SEND_TYPE_ARG1 "${send_arg1}")
|
||||
set(SEND_TYPE_ARG2 "${send_arg2}")
|
||||
set(SEND_TYPE_ARG3 "${send_arg3}")
|
||||
set(SEND_TYPE_ARG4 "${send_arg4}")
|
||||
set(SEND_TYPE_RETV "${send_retv}")
|
||||
set(HAVE_SEND 1)
|
||||
set(curl_cv_func_send_done 1)
|
||||
endif(curl_cv_func_send_test)
|
||||
endif(NOT curl_cv_func_send_done)
|
||||
endforeach(send_arg4)
|
||||
endforeach(send_arg3)
|
||||
endforeach(send_arg2)
|
||||
endforeach(send_arg1)
|
||||
endforeach(send_retv)
|
||||
else(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown")
|
||||
string(REGEX REPLACE "^([^,]*),[^,]*,[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG1 "${curl_cv_func_send_args}")
|
||||
string(REGEX REPLACE "^[^,]*,([^,]*),[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG2 "${curl_cv_func_send_args}")
|
||||
string(REGEX REPLACE "^[^,]*,[^,]*,([^,]*),[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG3 "${curl_cv_func_send_args}")
|
||||
string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,([^,]*),[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG4 "${curl_cv_func_send_args}")
|
||||
string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,([^,]*),[^,]*$" "\\1" SEND_TYPE_RETV "${curl_cv_func_send_args}")
|
||||
string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,[^,]*,([^,]*)$" "\\1" SEND_QUAL_ARG2 "${curl_cv_func_send_args}")
|
||||
#MESSAGE("SEND_TYPE_ARG1 ${SEND_TYPE_ARG1}")
|
||||
#MESSAGE("SEND_TYPE_ARG2 ${SEND_TYPE_ARG2}")
|
||||
#MESSAGE("SEND_TYPE_ARG3 ${SEND_TYPE_ARG3}")
|
||||
#MESSAGE("SEND_TYPE_ARG4 ${SEND_TYPE_ARG4}")
|
||||
#MESSAGE("SEND_TYPE_RETV ${SEND_TYPE_RETV}")
|
||||
#MESSAGE("SEND_QUAL_ARG2 ${SEND_QUAL_ARG2}")
|
||||
ENDIF(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown")
|
||||
endif(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown")
|
||||
|
||||
IF("${curl_cv_func_send_args}" STREQUAL "unknown")
|
||||
MESSAGE(FATAL_ERROR "Cannot find proper types to use for send args")
|
||||
ENDIF("${curl_cv_func_send_args}" STREQUAL "unknown")
|
||||
SET(SEND_QUAL_ARG2 "const")
|
||||
ELSE(curl_cv_send)
|
||||
MESSAGE(FATAL_ERROR "Unable to link function send")
|
||||
ENDIF(curl_cv_send)
|
||||
SET(curl_cv_func_send_args "${curl_cv_func_send_args}" CACHE INTERNAL "Arguments for send")
|
||||
SET(HAVE_SEND 1)
|
||||
if("${curl_cv_func_send_args}" STREQUAL "unknown")
|
||||
message(FATAL_ERROR "Cannot find proper types to use for send args")
|
||||
endif("${curl_cv_func_send_args}" STREQUAL "unknown")
|
||||
set(SEND_QUAL_ARG2 "const")
|
||||
else(curl_cv_send)
|
||||
message(FATAL_ERROR "Unable to link function send")
|
||||
endif(curl_cv_send)
|
||||
set(curl_cv_func_send_args "${curl_cv_func_send_args}" CACHE INTERNAL "Arguments for send")
|
||||
set(HAVE_SEND 1)
|
||||
|
||||
SET(EXTRA_DEFINES "${EXTRA_DEFINES}\n${headers_hack}\n#define __unused5")
|
||||
CURL_CHECK_C_SOURCE_COMPILES("int flag = MSG_NOSIGNAL" HAVE_MSG_NOSIGNAL)
|
||||
set(EXTRA_DEFINES "${EXTRA_DEFINES}\n${headers_hack}\n#define __unused5")
|
||||
curl_check_c_source_compiles("int flag = MSG_NOSIGNAL" HAVE_MSG_NOSIGNAL)
|
||||
|
||||
SET(EXTRA_DEFINES "__unused1\n#undef inline\n#define __unused2")
|
||||
SET(HEADER_INCLUDES)
|
||||
SET(headers_hack)
|
||||
set(EXTRA_DEFINES "__unused1\n#undef inline\n#define __unused2")
|
||||
set(HEADER_INCLUDES)
|
||||
set(headers_hack)
|
||||
|
||||
MACRO(add_header_include check header)
|
||||
IF(${check})
|
||||
SET(headers_hack
|
||||
macro(add_header_include check header)
|
||||
if(${check})
|
||||
set(headers_hack
|
||||
"${headers_hack}\n#include <${header}>")
|
||||
#SET(HEADER_INCLUDES
|
||||
# ${HEADER_INCLUDES}
|
||||
# "${header}")
|
||||
ENDIF(${check})
|
||||
ENDMACRO(add_header_include header)
|
||||
endif(${check})
|
||||
endmacro(add_header_include header)
|
||||
|
||||
IF(HAVE_WINDOWS_H)
|
||||
SET(EXTRA_DEFINES ${EXTRA_DEFINES}
|
||||
if(HAVE_WINDOWS_H)
|
||||
set(EXTRA_DEFINES ${EXTRA_DEFINES}
|
||||
"__unused7\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif\n#define __unused3")
|
||||
add_header_include(HAVE_WINDOWS_H "windows.h")
|
||||
add_header_include(HAVE_WINSOCK2_H "winsock2.h")
|
||||
add_header_include(HAVE_WINSOCK_H "winsock.h")
|
||||
ELSE(HAVE_WINDOWS_H)
|
||||
else(HAVE_WINDOWS_H)
|
||||
add_header_include(HAVE_SYS_TYPES_H "sys/types.h")
|
||||
add_header_include(HAVE_SYS_TIME_H "sys/time.h")
|
||||
add_header_include(TIME_WITH_SYS_TIME "time.h")
|
||||
add_header_include(HAVE_TIME_H "time.h")
|
||||
ENDIF(HAVE_WINDOWS_H)
|
||||
SET(EXTRA_DEFINES "${EXTRA_DEFINES}\n${headers_hack}\n#define __unused5")
|
||||
CURL_CHECK_C_SOURCE_COMPILES("struct timeval ts;\nts.tv_sec = 0;\nts.tv_usec = 0" HAVE_STRUCT_TIMEVAL)
|
||||
endif(HAVE_WINDOWS_H)
|
||||
set(EXTRA_DEFINES "${EXTRA_DEFINES}\n${headers_hack}\n#define __unused5")
|
||||
curl_check_c_source_compiles("struct timeval ts;\nts.tv_sec = 0;\nts.tv_usec = 0" HAVE_STRUCT_TIMEVAL)
|
||||
|
||||
|
||||
INCLUDE(CurlCheckCSourceRuns)
|
||||
SET(EXTRA_DEFINES)
|
||||
SET(HEADER_INCLUDES)
|
||||
IF(HAVE_SYS_POLL_H)
|
||||
SET(HEADER_INCLUDES "sys/poll.h")
|
||||
ENDIF(HAVE_SYS_POLL_H)
|
||||
CURL_CHECK_C_SOURCE_RUNS("return poll((void *)0, 0, 10 /*ms*/)" HAVE_POLL_FINE)
|
||||
include(CurlCheckCSourceRuns)
|
||||
set(EXTRA_DEFINES)
|
||||
set(HEADER_INCLUDES)
|
||||
if(HAVE_SYS_POLL_H)
|
||||
set(HEADER_INCLUDES "sys/poll.h")
|
||||
endif(HAVE_SYS_POLL_H)
|
||||
curl_check_c_source_runs("return poll((void *)0, 0, 10 /*ms*/)" HAVE_POLL_FINE)
|
||||
|
||||
SET(HAVE_SIG_ATOMIC_T 1)
|
||||
SET(EXTRA_DEFINES)
|
||||
SET(HEADER_INCLUDES)
|
||||
IF(HAVE_SIGNAL_H)
|
||||
SET(HEADER_INCLUDES "signal.h")
|
||||
SET(CMAKE_EXTRA_INCLUDE_FILES "signal.h")
|
||||
ENDIF(HAVE_SIGNAL_H)
|
||||
CHECK_TYPE_SIZE("sig_atomic_t" SIZEOF_SIG_ATOMIC_T)
|
||||
IF(HAVE_SIZEOF_SIG_ATOMIC_T)
|
||||
CURL_CHECK_C_SOURCE_COMPILES("static volatile sig_atomic_t dummy = 0" HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
|
||||
IF(NOT HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
|
||||
SET(HAVE_SIG_ATOMIC_T_VOLATILE 1)
|
||||
ENDIF(NOT HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
|
||||
ENDIF(HAVE_SIZEOF_SIG_ATOMIC_T)
|
||||
set(HAVE_SIG_ATOMIC_T 1)
|
||||
set(EXTRA_DEFINES)
|
||||
set(HEADER_INCLUDES)
|
||||
if(HAVE_SIGNAL_H)
|
||||
set(HEADER_INCLUDES "signal.h")
|
||||
set(CMAKE_EXTRA_INCLUDE_FILES "signal.h")
|
||||
endif(HAVE_SIGNAL_H)
|
||||
check_type_size("sig_atomic_t" SIZEOF_SIG_ATOMIC_T)
|
||||
if(HAVE_SIZEOF_SIG_ATOMIC_T)
|
||||
curl_check_c_source_compiles("static volatile sig_atomic_t dummy = 0" HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
|
||||
if(NOT HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
|
||||
set(HAVE_SIG_ATOMIC_T_VOLATILE 1)
|
||||
endif(NOT HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
|
||||
endif(HAVE_SIZEOF_SIG_ATOMIC_T)
|
||||
|
||||
SET(CHECK_TYPE_SIZE_PREINCLUDE
|
||||
set(CHECK_TYPE_SIZE_PREINCLUDE
|
||||
"#undef inline")
|
||||
|
||||
IF(HAVE_WINDOWS_H)
|
||||
SET(CHECK_TYPE_SIZE_PREINCLUDE "${CHECK_TYPE_SIZE_PREINCLUDE}
|
||||
if(HAVE_WINDOWS_H)
|
||||
set(CHECK_TYPE_SIZE_PREINCLUDE "${CHECK_TYPE_SIZE_PREINCLUDE}
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>")
|
||||
IF(HAVE_WINSOCK2_H)
|
||||
SET(CHECK_TYPE_SIZE_PREINCLUDE "${CHECK_TYPE_SIZE_PREINCLUDE}\n#include <winsock2.h>")
|
||||
ENDIF(HAVE_WINSOCK2_H)
|
||||
ELSE(HAVE_WINDOWS_H)
|
||||
IF(HAVE_SYS_SOCKET_H)
|
||||
SET(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES}
|
||||
if(HAVE_WINSOCK2_H)
|
||||
set(CHECK_TYPE_SIZE_PREINCLUDE "${CHECK_TYPE_SIZE_PREINCLUDE}\n#include <winsock2.h>")
|
||||
endif(HAVE_WINSOCK2_H)
|
||||
else(HAVE_WINDOWS_H)
|
||||
if(HAVE_SYS_SOCKET_H)
|
||||
set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES}
|
||||
"sys/socket.h")
|
||||
ENDIF(HAVE_SYS_SOCKET_H)
|
||||
IF(HAVE_NETINET_IN_H)
|
||||
SET(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES}
|
||||
endif(HAVE_SYS_SOCKET_H)
|
||||
if(HAVE_NETINET_IN_H)
|
||||
set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES}
|
||||
"netinet/in.h")
|
||||
ENDIF(HAVE_NETINET_IN_H)
|
||||
IF(HAVE_ARPA_INET_H)
|
||||
SET(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES}
|
||||
endif(HAVE_NETINET_IN_H)
|
||||
if(HAVE_ARPA_INET_H)
|
||||
set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES}
|
||||
"arpa/inet.h")
|
||||
ENDIF(HAVE_ARPA_INET_H)
|
||||
ENDIF(HAVE_WINDOWS_H)
|
||||
endif(HAVE_ARPA_INET_H)
|
||||
endif(HAVE_WINDOWS_H)
|
||||
|
||||
CHECK_TYPE_SIZE("struct sockaddr_storage" SIZEOF_STRUCT_SOCKADDR_STORAGE)
|
||||
IF(HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE)
|
||||
SET(HAVE_STRUCT_SOCKADDR_STORAGE 1)
|
||||
ENDIF(HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE)
|
||||
check_type_size("struct sockaddr_storage" SIZEOF_STRUCT_SOCKADDR_STORAGE)
|
||||
if(HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE)
|
||||
set(HAVE_STRUCT_SOCKADDR_STORAGE 1)
|
||||
endif(HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE)
|
||||
|
||||
|
@@ -1,121 +1,121 @@
|
||||
IF(NOT UNIX)
|
||||
IF(WIN32)
|
||||
SET(HAVE_LIBDL 0)
|
||||
SET(HAVE_LIBUCB 0)
|
||||
SET(HAVE_LIBSOCKET 0)
|
||||
SET(NOT_NEED_LIBNSL 0)
|
||||
SET(HAVE_LIBNSL 0)
|
||||
SET(HAVE_LIBZ 0)
|
||||
SET(HAVE_LIBCRYPTO 0)
|
||||
if(NOT UNIX)
|
||||
if(WIN32)
|
||||
set(HAVE_LIBDL 0)
|
||||
set(HAVE_LIBUCB 0)
|
||||
set(HAVE_LIBSOCKET 0)
|
||||
set(NOT_NEED_LIBNSL 0)
|
||||
set(HAVE_LIBNSL 0)
|
||||
set(HAVE_LIBZ 0)
|
||||
set(HAVE_LIBCRYPTO 0)
|
||||
|
||||
SET(HAVE_DLOPEN 0)
|
||||
set(HAVE_DLOPEN 0)
|
||||
|
||||
SET(HAVE_ALLOCA_H 0)
|
||||
SET(HAVE_ARPA_INET_H 0)
|
||||
SET(HAVE_DLFCN_H 0)
|
||||
SET(HAVE_FCNTL_H 1)
|
||||
SET(HAVE_FEATURES_H 0)
|
||||
SET(HAVE_INTTYPES_H 0)
|
||||
SET(HAVE_IO_H 1)
|
||||
SET(HAVE_MALLOC_H 1)
|
||||
SET(HAVE_MEMORY_H 1)
|
||||
SET(HAVE_NETDB_H 0)
|
||||
SET(HAVE_NETINET_IF_ETHER_H 0)
|
||||
SET(HAVE_NETINET_IN_H 0)
|
||||
SET(HAVE_NET_IF_H 0)
|
||||
SET(HAVE_PROCESS_H 1)
|
||||
SET(HAVE_PWD_H 0)
|
||||
SET(HAVE_SETJMP_H 1)
|
||||
SET(HAVE_SGTTY_H 0)
|
||||
SET(HAVE_SIGNAL_H 1)
|
||||
SET(HAVE_SOCKIO_H 0)
|
||||
SET(HAVE_STDINT_H 0)
|
||||
SET(HAVE_STDLIB_H 1)
|
||||
SET(HAVE_STRINGS_H 0)
|
||||
SET(HAVE_STRING_H 1)
|
||||
SET(HAVE_SYS_PARAM_H 0)
|
||||
SET(HAVE_SYS_POLL_H 0)
|
||||
SET(HAVE_SYS_SELECT_H 0)
|
||||
SET(HAVE_SYS_SOCKET_H 0)
|
||||
SET(HAVE_SYS_SOCKIO_H 0)
|
||||
SET(HAVE_SYS_STAT_H 1)
|
||||
SET(HAVE_SYS_TIME_H 0)
|
||||
SET(HAVE_SYS_TYPES_H 1)
|
||||
SET(HAVE_SYS_UTIME_H 1)
|
||||
SET(HAVE_TERMIOS_H 0)
|
||||
SET(HAVE_TERMIO_H 0)
|
||||
SET(HAVE_TIME_H 1)
|
||||
SET(HAVE_UNISTD_H 0)
|
||||
SET(HAVE_UTIME_H 0)
|
||||
SET(HAVE_X509_H 0)
|
||||
SET(HAVE_ZLIB_H 0)
|
||||
set(HAVE_ALLOCA_H 0)
|
||||
set(HAVE_ARPA_INET_H 0)
|
||||
set(HAVE_DLFCN_H 0)
|
||||
set(HAVE_FCNTL_H 1)
|
||||
set(HAVE_FEATURES_H 0)
|
||||
set(HAVE_INTTYPES_H 0)
|
||||
set(HAVE_IO_H 1)
|
||||
set(HAVE_MALLOC_H 1)
|
||||
set(HAVE_MEMORY_H 1)
|
||||
set(HAVE_NETDB_H 0)
|
||||
set(HAVE_NETINET_IF_ETHER_H 0)
|
||||
set(HAVE_NETINET_IN_H 0)
|
||||
set(HAVE_NET_IF_H 0)
|
||||
set(HAVE_PROCESS_H 1)
|
||||
set(HAVE_PWD_H 0)
|
||||
set(HAVE_SETJMP_H 1)
|
||||
set(HAVE_SGTTY_H 0)
|
||||
set(HAVE_SIGNAL_H 1)
|
||||
set(HAVE_SOCKIO_H 0)
|
||||
set(HAVE_STDINT_H 0)
|
||||
set(HAVE_STDLIB_H 1)
|
||||
set(HAVE_STRINGS_H 0)
|
||||
set(HAVE_STRING_H 1)
|
||||
set(HAVE_SYS_PARAM_H 0)
|
||||
set(HAVE_SYS_POLL_H 0)
|
||||
set(HAVE_SYS_SELECT_H 0)
|
||||
set(HAVE_SYS_SOCKET_H 0)
|
||||
set(HAVE_SYS_SOCKIO_H 0)
|
||||
set(HAVE_SYS_STAT_H 1)
|
||||
set(HAVE_SYS_TIME_H 0)
|
||||
set(HAVE_SYS_TYPES_H 1)
|
||||
set(HAVE_SYS_UTIME_H 1)
|
||||
set(HAVE_TERMIOS_H 0)
|
||||
set(HAVE_TERMIO_H 0)
|
||||
set(HAVE_TIME_H 1)
|
||||
set(HAVE_UNISTD_H 0)
|
||||
set(HAVE_UTIME_H 0)
|
||||
set(HAVE_X509_H 0)
|
||||
set(HAVE_ZLIB_H 0)
|
||||
|
||||
SET(HAVE_SIZEOF_LONG_DOUBLE 1)
|
||||
SET(SIZEOF_LONG_DOUBLE 8)
|
||||
set(HAVE_SIZEOF_LONG_DOUBLE 1)
|
||||
set(SIZEOF_LONG_DOUBLE 8)
|
||||
|
||||
SET(HAVE_SOCKET 1)
|
||||
SET(HAVE_POLL 0)
|
||||
SET(HAVE_SELECT 1)
|
||||
SET(HAVE_STRDUP 1)
|
||||
SET(HAVE_STRSTR 1)
|
||||
SET(HAVE_STRTOK_R 0)
|
||||
SET(HAVE_STRFTIME 1)
|
||||
SET(HAVE_UNAME 0)
|
||||
SET(HAVE_STRCASECMP 0)
|
||||
SET(HAVE_STRICMP 1)
|
||||
SET(HAVE_STRCMPI 1)
|
||||
SET(HAVE_GETHOSTBYADDR 1)
|
||||
SET(HAVE_GETTIMEOFDAY 0)
|
||||
SET(HAVE_INET_ADDR 1)
|
||||
SET(HAVE_INET_NTOA 1)
|
||||
SET(HAVE_INET_NTOA_R 0)
|
||||
SET(HAVE_TCGETATTR 0)
|
||||
SET(HAVE_TCSETATTR 0)
|
||||
SET(HAVE_PERROR 1)
|
||||
SET(HAVE_CLOSESOCKET 1)
|
||||
SET(HAVE_SETVBUF 0)
|
||||
SET(HAVE_SIGSETJMP 0)
|
||||
SET(HAVE_GETPASS_R 0)
|
||||
SET(HAVE_STRLCAT 0)
|
||||
SET(HAVE_GETPWUID 0)
|
||||
SET(HAVE_GETEUID 0)
|
||||
SET(HAVE_UTIME 1)
|
||||
SET(HAVE_RAND_EGD 0)
|
||||
SET(HAVE_RAND_SCREEN 0)
|
||||
SET(HAVE_RAND_STATUS 0)
|
||||
SET(HAVE_GMTIME_R 0)
|
||||
SET(HAVE_LOCALTIME_R 0)
|
||||
SET(HAVE_GETHOSTBYADDR_R 0)
|
||||
SET(HAVE_GETHOSTBYNAME_R 0)
|
||||
SET(HAVE_SIGNAL_FUNC 1)
|
||||
SET(HAVE_SIGNAL_MACRO 0)
|
||||
set(HAVE_SOCKET 1)
|
||||
set(HAVE_POLL 0)
|
||||
set(HAVE_SELECT 1)
|
||||
set(HAVE_STRDUP 1)
|
||||
set(HAVE_STRSTR 1)
|
||||
set(HAVE_STRTOK_R 0)
|
||||
set(HAVE_STRFTIME 1)
|
||||
set(HAVE_UNAME 0)
|
||||
set(HAVE_STRCASECMP 0)
|
||||
set(HAVE_STRICMP 1)
|
||||
set(HAVE_STRCMPI 1)
|
||||
set(HAVE_GETHOSTBYADDR 1)
|
||||
set(HAVE_GETTIMEOFDAY 0)
|
||||
set(HAVE_INET_ADDR 1)
|
||||
set(HAVE_INET_NTOA 1)
|
||||
set(HAVE_INET_NTOA_R 0)
|
||||
set(HAVE_TCGETATTR 0)
|
||||
set(HAVE_TCSETATTR 0)
|
||||
set(HAVE_PERROR 1)
|
||||
set(HAVE_CLOSESOCKET 1)
|
||||
set(HAVE_SETVBUF 0)
|
||||
set(HAVE_SIGSETJMP 0)
|
||||
set(HAVE_GETPASS_R 0)
|
||||
set(HAVE_STRLCAT 0)
|
||||
set(HAVE_GETPWUID 0)
|
||||
set(HAVE_GETEUID 0)
|
||||
set(HAVE_UTIME 1)
|
||||
set(HAVE_RAND_EGD 0)
|
||||
set(HAVE_RAND_SCREEN 0)
|
||||
set(HAVE_RAND_STATUS 0)
|
||||
set(HAVE_GMTIME_R 0)
|
||||
set(HAVE_LOCALTIME_R 0)
|
||||
set(HAVE_GETHOSTBYADDR_R 0)
|
||||
set(HAVE_GETHOSTBYNAME_R 0)
|
||||
set(HAVE_SIGNAL_FUNC 1)
|
||||
set(HAVE_SIGNAL_MACRO 0)
|
||||
|
||||
SET(HAVE_GETHOSTBYADDR_R_5 0)
|
||||
SET(HAVE_GETHOSTBYADDR_R_5_REENTRANT 0)
|
||||
SET(HAVE_GETHOSTBYADDR_R_7 0)
|
||||
SET(HAVE_GETHOSTBYADDR_R_7_REENTRANT 0)
|
||||
SET(HAVE_GETHOSTBYADDR_R_8 0)
|
||||
SET(HAVE_GETHOSTBYADDR_R_8_REENTRANT 0)
|
||||
SET(HAVE_GETHOSTBYNAME_R_3 0)
|
||||
SET(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0)
|
||||
SET(HAVE_GETHOSTBYNAME_R_5 0)
|
||||
SET(HAVE_GETHOSTBYNAME_R_5_REENTRANT 0)
|
||||
SET(HAVE_GETHOSTBYNAME_R_6 0)
|
||||
SET(HAVE_GETHOSTBYNAME_R_6_REENTRANT 0)
|
||||
set(HAVE_GETHOSTBYADDR_R_5 0)
|
||||
set(HAVE_GETHOSTBYADDR_R_5_REENTRANT 0)
|
||||
set(HAVE_GETHOSTBYADDR_R_7 0)
|
||||
set(HAVE_GETHOSTBYADDR_R_7_REENTRANT 0)
|
||||
set(HAVE_GETHOSTBYADDR_R_8 0)
|
||||
set(HAVE_GETHOSTBYADDR_R_8_REENTRANT 0)
|
||||
set(HAVE_GETHOSTBYNAME_R_3 0)
|
||||
set(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0)
|
||||
set(HAVE_GETHOSTBYNAME_R_5 0)
|
||||
set(HAVE_GETHOSTBYNAME_R_5_REENTRANT 0)
|
||||
set(HAVE_GETHOSTBYNAME_R_6 0)
|
||||
set(HAVE_GETHOSTBYNAME_R_6_REENTRANT 0)
|
||||
|
||||
SET(TIME_WITH_SYS_TIME 0)
|
||||
SET(HAVE_O_NONBLOCK 0)
|
||||
SET(HAVE_IN_ADDR_T 0)
|
||||
SET(HAVE_INET_NTOA_R_DECL 0)
|
||||
SET(HAVE_INET_NTOA_R_DECL_REENTRANT 0)
|
||||
SET(HAVE_GETADDRINFO 0)
|
||||
SET(STDC_HEADERS 1)
|
||||
SET(RETSIGTYPE_TEST 1)
|
||||
set(TIME_WITH_SYS_TIME 0)
|
||||
set(HAVE_O_NONBLOCK 0)
|
||||
set(HAVE_IN_ADDR_T 0)
|
||||
set(HAVE_INET_NTOA_R_DECL 0)
|
||||
set(HAVE_INET_NTOA_R_DECL_REENTRANT 0)
|
||||
set(HAVE_GETADDRINFO 0)
|
||||
set(STDC_HEADERS 1)
|
||||
set(RETSIGTYPE_TEST 1)
|
||||
|
||||
SET(HAVE_SIGACTION 0)
|
||||
SET(HAVE_MACRO_SIGSETJMP 0)
|
||||
ELSE(WIN32)
|
||||
MESSAGE("This file should be included on Windows platform only")
|
||||
ENDIF(WIN32)
|
||||
ENDIF(NOT UNIX)
|
||||
set(HAVE_SIGACTION 0)
|
||||
set(HAVE_MACRO_SIGSETJMP 0)
|
||||
else(WIN32)
|
||||
message("This file should be included on Windows platform only")
|
||||
endif(WIN32)
|
||||
endif(NOT UNIX)
|
||||
|
||||
|
@@ -1,31 +1,31 @@
|
||||
# File containing various utilities
|
||||
|
||||
# Converts a CMake list to a string containing elements separated by spaces
|
||||
FUNCTION(TO_LIST_SPACES _LIST_NAME OUTPUT_VAR)
|
||||
SET(NEW_LIST_SPACE)
|
||||
FOREACH(ITEM ${${_LIST_NAME}})
|
||||
SET(NEW_LIST_SPACE "${NEW_LIST_SPACE} ${ITEM}")
|
||||
ENDFOREACH()
|
||||
STRING(STRIP ${NEW_LIST_SPACE} NEW_LIST_SPACE)
|
||||
SET(${OUTPUT_VAR} "${NEW_LIST_SPACE}" PARENT_SCOPE)
|
||||
ENDFUNCTION()
|
||||
function(TO_LIST_SPACES _LIST_NAME OUTPUT_VAR)
|
||||
set(NEW_LIST_SPACE)
|
||||
foreach(ITEM ${${_LIST_NAME}})
|
||||
set(NEW_LIST_SPACE "${NEW_LIST_SPACE} ${ITEM}")
|
||||
endforeach()
|
||||
string(STRIP ${NEW_LIST_SPACE} NEW_LIST_SPACE)
|
||||
set(${OUTPUT_VAR} "${NEW_LIST_SPACE}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Appends a lis of item to a string which is a space-separated list, if they don't already exist.
|
||||
FUNCTION(LIST_SPACES_APPEND_ONCE LIST_NAME)
|
||||
STRING(REPLACE " " ";" _LIST ${${LIST_NAME}})
|
||||
LIST(APPEND _LIST ${ARGN})
|
||||
LIST(REMOVE_DUPLICATES _LIST)
|
||||
TO_LIST_SPACES(_LIST NEW_LIST_SPACE)
|
||||
SET(${LIST_NAME} "${NEW_LIST_SPACE}" PARENT_SCOPE)
|
||||
ENDFUNCTION()
|
||||
function(LIST_SPACES_APPEND_ONCE LIST_NAME)
|
||||
string(REPLACE " " ";" _LIST ${${LIST_NAME}})
|
||||
list(APPEND _LIST ${ARGN})
|
||||
list(REMOVE_DUPLICATES _LIST)
|
||||
to_list_spaces(_LIST NEW_LIST_SPACE)
|
||||
set(${LIST_NAME} "${NEW_LIST_SPACE}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Convinience function that does the same as LIST(FIND ...) but with a TRUE/FALSE return value.
|
||||
# Ex: IN_STR_LIST(MY_LIST "Searched item" WAS_FOUND)
|
||||
FUNCTION(IN_STR_LIST LIST_NAME ITEM_SEARCHED RETVAL)
|
||||
LIST(FIND ${LIST_NAME} ${ITEM_SEARCHED} FIND_POS)
|
||||
IF(${FIND_POS} EQUAL -1)
|
||||
SET(${RETVAL} FALSE PARENT_SCOPE)
|
||||
ELSE()
|
||||
SET(${RETVAL} TRUE PARENT_SCOPE)
|
||||
ENDIF()
|
||||
ENDFUNCTION()
|
||||
function(IN_STR_LIST LIST_NAME ITEM_SEARCHED RETVAL)
|
||||
list(FIND ${LIST_NAME} ${ITEM_SEARCHED} FIND_POS)
|
||||
if(${FIND_POS} EQUAL -1)
|
||||
set(${RETVAL} FALSE PARENT_SCOPE)
|
||||
else()
|
||||
set(${RETVAL} TRUE PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
1087
CMakeLists.txt
1087
CMakeLists.txt
File diff suppressed because it is too large
Load Diff
@@ -8,6 +8,6 @@ set(CTEST_PROJECT_NAME "CURL")
|
||||
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
|
||||
|
||||
set(CTEST_DROP_METHOD "http")
|
||||
set(CTEST_DROP_SITE "www.cdash.org")
|
||||
set(CTEST_DROP_LOCATION "/CDashPublic/submit.php?project=CURL")
|
||||
set(CTEST_DROP_SITE "my.cdash.org")
|
||||
set(CTEST_DROP_LOCATION "/submit.php?project=CURL")
|
||||
set(CTEST_DROP_SITE_CDASH TRUE)
|
||||
|
@@ -32,8 +32,8 @@ CMake/FindZLIB.cmake CMake/OtherTests.cmake CMake/Platforms/WindowsCache.cmake \
|
||||
CMake/Utilities.cmake include/curl/curlbuild.h.cmake
|
||||
|
||||
EXTRA_DIST = CHANGES COPYING maketgz Makefile.dist curl-config.in \
|
||||
curl-style.el sample.emacs RELEASE-NOTES buildconf buildconf.bat \
|
||||
libcurl.pc.in vc6curl.dsw MacOSX-Framework $(CMAKE_DIST)
|
||||
curl-style.el sample.emacs RELEASE-NOTES buildconf \
|
||||
libcurl.pc.in vc6curl.dsw MacOSX-Framework Android.mk $(CMAKE_DIST)
|
||||
|
||||
bin_SCRIPTS = curl-config
|
||||
|
||||
@@ -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
|
||||
|
104
RELEASE-NOTES
104
RELEASE-NOTES
@@ -1,53 +1,59 @@
|
||||
Curl and libcurl 7.19.5
|
||||
Curl and libcurl 7.20.0
|
||||
|
||||
Public curl releases: 111
|
||||
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 libcurl now closes all dead connections whenever you attempt to open a new
|
||||
connection
|
||||
o libssh2's version number can now be figured out run-time instead of using
|
||||
the build-time fixed number
|
||||
o CURLOPT_SEEKFUNCTION may now return CURL_SEEKFUNC_CANTSEEK
|
||||
o curl can now upload with resume even when reading from a pipe
|
||||
o a build-time configured curl_socklen_t is now used instead of socklen_t
|
||||
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 NTLM authentication memory leak on SSPI enabled Windows builds
|
||||
o fixed the GnuTLS-using code to do correct return code checks
|
||||
o an alloc-related call in the OpenSSL-using code didn't check the return value
|
||||
o curl_easy_duphandle() failed to duplicate cookies at times
|
||||
o missing TELNET timeout support in Windows builds
|
||||
o missing Curl_read() and write callback result checking in TELNET transfers
|
||||
o more ciphers enabled in libcurl built to use NSS
|
||||
o properly return an error code in curl_easy_recv
|
||||
o Sun compilers specific preprocessor block removed from curlbuild.h.dist
|
||||
o allow creation of four way fat libcurl Mac OS X Framework
|
||||
o several memory leaks in libcurl+NSS
|
||||
o improved the CURLOPT_NOBODY set to 0 confusions
|
||||
o persistent connections when doing FTP over a HTTP proxy
|
||||
o --libcurl bogus strings where other data was pointed to
|
||||
o crash related to FTP and "Re-used connection seems dead, get a new one"
|
||||
o CURLINFO_APPCONNECT_TIME with the multi interface
|
||||
o Enhanced upload speeds on Windows
|
||||
o TFTP problems after a failed transfer to the same host
|
||||
o improved out of the box TPF compatibility
|
||||
o HTTP PUT protocol line endings portions mangled from CRLF to CRCRLF
|
||||
o Rejected SSL session ids are killed properly (for OpenSSL and GnuTLS builds)
|
||||
o Deal with the TFTP OACK packet
|
||||
o fixed roff mistakes in man pages
|
||||
o use SOCKS proxy with the multi interface
|
||||
o fixed the Curl_getoff_all_pipelines SIGSEGV
|
||||
o POST, NTLM and following a redirect hang
|
||||
o libcurl+NSS endless loop on incorrect password for private key
|
||||
o gzip decompression memory leak
|
||||
o no_proxy flaw with user name in URL
|
||||
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:
|
||||
|
||||
@@ -56,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:
|
||||
|
||||
Daniel Fandrich, Yang Tse, David James, Chris Deidun, Bill Egert,
|
||||
Andre Guibert de Bruet, Andreas Farber, Frank Hempel, Pierre Brico,
|
||||
Kamil Dudka, Jim Freeman, Daniel Johnson, Toshio Kuratomi, Martin Storsjo,
|
||||
Pramod Sharma, Gisle Vanem, Lenaic Lefever, Rainer Koenig, Sven Wegener,
|
||||
Tim Chen, Constantine Sapuntzakis, David McCreedy, Michael Smith,
|
||||
Colin Watson, Ebenezer Ikonne, Laurent Rabret, Michael Cronenworth,
|
||||
Balint Szilakszi, James Bursa
|
||||
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)
|
||||
|
16
TODO-RELEASE
16
TODO-RELEASE
@@ -1,9 +1,15 @@
|
||||
To be addressed in 7.19.6 (planned release: July 2009)
|
||||
To be addressed in 7.20.0 (planned release: January 2010)
|
||||
=========================
|
||||
|
||||
226 - Active Mode FTPS Data Port Range
|
||||
244 - patch for [out] parameters
|
||||
http://curl.haxx.se/mail/lib-2009-06/0342.html
|
||||
|
||||
235 - KNOWN_BUG #65
|
||||
Code adjustment for FTP over socks proxy remains
|
||||
245 - HTTP version getinfo
|
||||
http://curl.haxx.se/mail/lib-2009-06/0312.html
|
||||
|
||||
240 -
|
||||
247 - Using CURLINFO_ERROR in Curl_failf
|
||||
http://curl.haxx.se/mail/lib-2009-06/0065.html
|
||||
|
||||
253 - add option to disable SNI for TLS handshakes
|
||||
|
||||
261 -
|
99
acinclude.m4
99
acinclude.m4
@@ -1852,7 +1852,7 @@ AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [
|
||||
AC_REQUIRE([AC_HEADER_TIME])dnl
|
||||
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl
|
||||
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
|
||||
AC_CHECK_HEADERS(sys/types.h sys/time.h time.h)
|
||||
AC_CHECK_HEADERS(sys/types.h sys/time.h time.h sys/socket.h)
|
||||
AC_CACHE_CHECK([for struct timeval], [ac_cv_struct_timeval], [
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
@@ -1882,6 +1882,9 @@ AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [
|
||||
#ifdef HAVE_TIME_H
|
||||
#include <time.h>
|
||||
#endif
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
]],[[
|
||||
struct timeval ts;
|
||||
@@ -2199,6 +2202,52 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_LIBS_CONNECT
|
||||
dnl -------------------------------------------------
|
||||
dnl Verify if network connect function is already available
|
||||
dnl using current libraries or if another one is required.
|
||||
|
||||
AC_DEFUN([CURL_CHECK_LIBS_CONNECT], [
|
||||
AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
|
||||
AC_MSG_CHECKING([for connect in libraries])
|
||||
tst_connect_save_LIBS="$LIBS"
|
||||
tst_connect_need_LIBS="unknown"
|
||||
for tst_lib in '' '-lsocket' ; do
|
||||
if test "$tst_connect_need_LIBS" = "unknown"; then
|
||||
LIBS="$tst_lib $tst_connect_save_LIBS"
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
$curl_includes_winsock2
|
||||
#ifndef HAVE_WINDOWS_H
|
||||
int connect(int, void*, int);
|
||||
#endif
|
||||
]],[[
|
||||
if(0 != connect(0, 0, 0))
|
||||
return 1;
|
||||
]])
|
||||
],[
|
||||
tst_connect_need_LIBS="$tst_lib"
|
||||
])
|
||||
fi
|
||||
done
|
||||
LIBS="$tst_connect_save_LIBS"
|
||||
#
|
||||
case X-"$tst_connect_need_LIBS" in
|
||||
X-unknown)
|
||||
AC_MSG_RESULT([cannot find connect])
|
||||
AC_MSG_ERROR([cannot find connect function in libraries.])
|
||||
;;
|
||||
X-)
|
||||
AC_MSG_RESULT([yes])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([$tst_connect_need_LIBS])
|
||||
LIBS="$tst_connect_need_LIBS $tst_connect_save_LIBS"
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_DEFINE_UNQUOTED (VARIABLE, [VALUE])
|
||||
dnl -------------------------------------------------
|
||||
dnl Like AC_DEFINE_UNQUOTED this macro will define a C preprocessor
|
||||
@@ -3141,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"
|
||||
@@ -3168,8 +3245,4 @@ AC_DEFUN([CURL_CHECK_PKGCONFIG], [
|
||||
AC_MSG_RESULT([found])
|
||||
fi
|
||||
fi
|
||||
|
||||
else
|
||||
PKGCONFIG="no"
|
||||
fi
|
||||
])
|
||||
|
@@ -1,14 +1,21 @@
|
||||
*.html
|
||||
*.lo
|
||||
*.pdf
|
||||
.deps
|
||||
.libs
|
||||
MSVC*
|
||||
Makefile
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
acountry
|
||||
adig
|
||||
ahost
|
||||
ares_build.h
|
||||
ares_config.h
|
||||
ares_config.h.in
|
||||
ares_version.h.dist
|
||||
autom4te.cache
|
||||
compile
|
||||
config.guess
|
||||
config.h
|
||||
config.h.in
|
||||
@@ -22,5 +29,7 @@ libcares.la
|
||||
libcares.pc
|
||||
libtool
|
||||
ltmain.sh
|
||||
man3
|
||||
missing
|
||||
msvc*
|
||||
stamp-h*
|
||||
|
191
ares/CHANGES
191
ares/CHANGES
@@ -1,9 +1,200 @@
|
||||
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
|
||||
init fails when internet access is fone.
|
||||
|
||||
- Timo Teras changed the reason code used in the resolve callback done when
|
||||
ares_cancel() is used, to be ARES_ECANCELLED instead of ARES_ETIMEOUT to
|
||||
better allow the callback to know what's happening.
|
||||
|
||||
* 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.
|
||||
|
||||
* May 26 2009 (Yang Tse)
|
||||
- Added --enable-curldebug configure option to enable and disable building
|
||||
with the low-level curl debug memory tracking 'feature' to allow decoupled
|
||||
setting from --enable-debug, allowing again to build c-ares independently
|
||||
out of the CVS tree.
|
||||
|
||||
For the c-ares library option --enable-debug enables debug build features
|
||||
which are _not_ related with memory tracking. For the c-ares library when
|
||||
--enable-debug is given it does not enable the memory tracking feature. If
|
||||
you wish to enable the curl debug memory tracking you must use configure
|
||||
option --enable-curldebug explicitily to do so.
|
||||
|
||||
Internally, definition of preprocessor symbol DEBUGBUILD restricts code
|
||||
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.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.7.0 on all systems.
|
||||
|
||||
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.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.
|
||||
|
||||
|
7
ares/CVS-INFO
Normal file
7
ares/CVS-INFO
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
CVS-INFO
|
||||
|
||||
This file is only present in the CVS - never in release archives. It is used
|
||||
as a sentinel file in buildconf.bat in order to differentiate a CVS checkout
|
||||
from release and daily snapshot archives.
|
||||
|
@@ -13,13 +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_builddir) is for c-ares's generated config.h file
|
||||
# $(top_srcdir) is for c-ares's lib/setup.h and other "c-ares-private" files
|
||||
# $(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 ares_setup.h and other "c-ares-private" files
|
||||
|
||||
if CURLDEBUG
|
||||
INCLUDES = -I$(top_builddir)/../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) \
|
||||
@@ -30,10 +38,10 @@ 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 DEBUGBUILD
|
||||
if CURLDEBUG
|
||||
PROGS =
|
||||
else
|
||||
PROGS = ahost adig acountry
|
||||
@@ -44,9 +52,11 @@ 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 buildconf.bat
|
||||
TODO ares_build.h.in $(PDFPAGES) cares.rc README.msvc
|
||||
|
||||
CLEANFILES = $(PDFPAGES) $(HTMLPAGES)
|
||||
|
||||
DISTCLEANFILES = ares_build.h
|
||||
|
||||
@@ -87,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
|
||||
@@ -102,14 +110,56 @@ 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_LDADD = $(top_builddir)/$(lib_LTLIBRARIES)
|
||||
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_LDADD = $(top_builddir)/$(lib_LTLIBRARIES)
|
||||
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_LDADD = $(top_builddir)/$(lib_LTLIBRARIES)
|
||||
acountry_SOURCES = acountry.c $(SAMPLESOURCES) $(SAMPLEHEADERS)
|
||||
acountry_LDADD = $(top_builddir)/libcares.la
|
||||
acountry_CFLAGS = $(AM_CFLAGS)
|
||||
|
||||
SOURCEDMANDIR = man3
|
||||
SOURCEDMANPAGES = ares_init.3
|
||||
|
||||
clean-local: clean-sourced-manpages
|
||||
|
||||
clean-sourced-manpages:
|
||||
@srcdmandir='$(SOURCEDMANDIR)'; \
|
||||
echo "rm -rf $(top_builddir)/$$srcdmandir"; \
|
||||
rm -rf $(top_builddir)/$$srcdmandir
|
||||
|
||||
sourced-manpages: clean-sourced-manpages
|
||||
@srcdmandir='$(SOURCEDMANDIR)'; \
|
||||
srcdmanfiles='$(SOURCEDMANPAGES)'; \
|
||||
mkdir $(top_builddir)/$$srcdmandir; \
|
||||
for file in $$srcdmanfiles; do \
|
||||
if test -f $(top_srcdir)/$$file; then \
|
||||
echo "cp $(top_srcdir)/$$file $(top_builddir)/$$srcdmandir/$$file"; \
|
||||
cp $(top_srcdir)/$$file $(top_builddir)/$$srcdmandir/$$file; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
MAN2HTML = roffit --mandir=. < $< >$@
|
||||
|
||||
SUFFIXES = .3 .html
|
||||
|
||||
html: sourced-manpages $(HTMLPAGES)
|
||||
|
||||
.3.html:
|
||||
$(MAN2HTML)
|
||||
|
||||
pdf: sourced-manpages $(PDFPAGES)
|
||||
|
||||
.3.pdf:
|
||||
@(foo=`echo $@ | sed -e 's/\.[0-9]$$//g'`; \
|
||||
groff -Tps -man $< >$$foo.ps; \
|
||||
ps2pdf $$foo.ps $@; \
|
||||
rm $$foo.ps; \
|
||||
echo "converted $< to $@")
|
||||
|
||||
# Make files named *.dist replace the file without .dist extension
|
||||
dist-hook:
|
||||
|
@@ -1,40 +1,22 @@
|
||||
#
|
||||
# c-ares Makefile for djgpp/gcc/Watt-32.
|
||||
# By Gisle Vanem <giva@bgnett.no> 2004.
|
||||
# By Gisle Vanem <gvanem@broadpark.no> 2004.
|
||||
#
|
||||
# $Id$
|
||||
|
||||
|
||||
TOPDIR = ..
|
||||
|
||||
include ../packages/DOS/common.dj
|
||||
DEPEND_PREREQ = ares_config.h
|
||||
|
||||
include ../packages/DOS/common.dj
|
||||
include Makefile.inc
|
||||
|
||||
CFLAGS += -DWATT32 -DHAVE_AF_INET6 -DHAVE_PF_INET6 -DHAVE_IOCTLSOCKET \
|
||||
-DHAVE_IOCTLSOCKET_FIONBIO -DHAVE_STRUCT_IN6_ADDR \
|
||||
-DHAVE_SOCKADDR_IN6_SIN6_SCOPE_ID -DHAVE_SYS_TIME_H \
|
||||
-DHAVE_STRUCT_SOCKADDR_IN6 -DHAVE_STRUCT_ADDRINFO \
|
||||
-DHAVE_ARPA_NAMESER_H -DHAVE_ARPA_INET_H -DHAVE_SYS_SOCKET_H \
|
||||
-DHAVE_SYS_UIO_H -DHAVE_NETINET_IN_H -DHAVE_NETINET_TCP_H \
|
||||
-DNS_INADDRSZ=4 -DHAVE_RECV -DHAVE_SEND -DHAVE_GETTIMEOFDAY \
|
||||
-DSEND_TYPE_ARG1='int' -DSEND_QUAL_ARG2='const' \
|
||||
-DSEND_TYPE_ARG2='void*' -DSEND_TYPE_ARG3='int' \
|
||||
-DSEND_TYPE_ARG4='int' -DSEND_TYPE_RETV='int' \
|
||||
-DRECV_TYPE_ARG1='int' -DRECV_TYPE_ARG2='void*' \
|
||||
-DRECV_TYPE_ARG3='int' -DRECV_TYPE_ARG4='int' \
|
||||
-DRECV_TYPE_RETV='int' -DHAVE_STRUCT_TIMEVAL \
|
||||
-Dselect=select_s -UHAVE_CONFIG_H \
|
||||
-DRECVFROM_TYPE_ARG1='int' -DRECVFROM_TYPE_ARG2='void' \
|
||||
-DRECVFROM_TYPE_ARG3='int' -DRECVFROM_TYPE_ARG4='int' \
|
||||
-DRECVFROM_TYPE_ARG6='int' -DRECVFROM_TYPE_RETV='int' \
|
||||
-DRECVFROM_TYPE_ARG5='struct sockaddr' -DHAVE_RECVFROM \
|
||||
-DRECVFROM_TYPE_ARG2_IS_VOID -DHAVE_STRDUP -DHAVE_NETDB_H \
|
||||
-DHAVE_STRCASECMP -DHAVE_STRNCASECMP -DHAVE_GETHOSTNAME \
|
||||
-DHAVE_LIMITS_H
|
||||
CFLAGS += -DWATT32 -Dselect=select_s
|
||||
|
||||
LDFLAGS = -s
|
||||
|
||||
ifeq ($(USE_DEBUG),1)
|
||||
ifeq ($(USE_CURLDEBUG),1)
|
||||
EX_LIBS = ../lib/libcurl.a
|
||||
OBJ_HACK = $(OBJECTS)
|
||||
else
|
||||
@@ -57,12 +39,15 @@ EX_LIBS += $(WATT32_ROOT)/lib/libwatt.a
|
||||
|
||||
OBJECTS = $(addprefix $(OBJ_DIR)/, $(CSOURCES:.c=.o))
|
||||
|
||||
all: $(OBJ_DIR) libcares.a ahost.exe adig.exe acountry.exe
|
||||
all: $(OBJ_DIR) ares_config.h libcares.a ahost.exe adig.exe acountry.exe
|
||||
@echo Welcome to c-ares.
|
||||
|
||||
libcares.a: $(OBJECTS)
|
||||
ar rs $@ $?
|
||||
|
||||
ares_config.h: config.dos
|
||||
$(COPY) $^ $@
|
||||
|
||||
ahost.exe: ahost.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK)
|
||||
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS)
|
||||
|
||||
@@ -72,12 +57,30 @@ adig.exe: adig.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK)
|
||||
acountry.exe: acountry.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK)
|
||||
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJECTS) libcares.a
|
||||
# clean generated files
|
||||
#
|
||||
genclean:
|
||||
- $(DELETE) ares_config.h
|
||||
|
||||
vclean realclean: clean
|
||||
rm -f ahost.exe adig.exe acountry.exe depend.dj
|
||||
- rmdir $(OBJ_DIR)
|
||||
# clean object files and subdir
|
||||
#
|
||||
objclean: genclean
|
||||
- $(DELETE) $(OBJ_DIR)$(DS)*.o
|
||||
- $(RMDIR) $(OBJ_DIR)
|
||||
|
||||
# clean without removing built library and programs
|
||||
#
|
||||
clean: objclean
|
||||
- $(DELETE) depend.dj
|
||||
|
||||
# clean everything
|
||||
#
|
||||
realclean vclean: clean
|
||||
- $(DELETE) libcares.a
|
||||
- $(DELETE) acountry.exe
|
||||
- $(DELETE) adig.exe
|
||||
- $(DELETE) ahost.exe
|
||||
- $(DELETE) libcares.a
|
||||
|
||||
-include depend.dj
|
||||
|
||||
|
@@ -1,25 +1,179 @@
|
||||
CSOURCES = ares_fds.c ares_getsock.c ares_process.c ares_free_hostent.c \
|
||||
ares_query.c ares__close_sockets.c ares_free_string.c ares_search.c \
|
||||
ares__get_hostent.c ares_gethostbyaddr.c ares_send.c ares__read_line.c \
|
||||
ares_gethostbyname.c ares_strerror.c ares_cancel.c ares_init.c \
|
||||
ares_timeout.c ares_destroy.c ares_mkquery.c ares_version.c \
|
||||
ares_expand_name.c ares_parse_a_reply.c windows_port.c ares_strdup.c \
|
||||
ares_expand_string.c ares_parse_ptr_reply.c ares_parse_aaaa_reply.c \
|
||||
ares_getnameinfo.c inet_net_pton.c bitncmp.c inet_ntop.c ares_writev.c \
|
||||
ares_parse_ns_reply.c ares_llist.c ares__timeval.c ares_strcasecmp.c \
|
||||
ares_library_init.c
|
||||
|
||||
HHEADERS = ares.h ares_private.h setup.h ares_dns.h ares_version.h \
|
||||
nameser.h inet_net_pton.h inet_ntop.h ares_ipv6.h bitncmp.h setup_once.h \
|
||||
ares_llist.h ares_strdup.h ares_strcasecmp.h ares_writev.h ares_build.h \
|
||||
ares_rules.h ares_library_init.h
|
||||
CSOURCES = ares__close_sockets.c \
|
||||
ares__get_hostent.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 \
|
||||
ares_fds.c \
|
||||
ares_free_hostent.c \
|
||||
ares_free_string.c \
|
||||
ares_gethostbyaddr.c \
|
||||
ares_gethostbyname.c \
|
||||
ares_getnameinfo.c \
|
||||
ares_getsock.c \
|
||||
ares_init.c \
|
||||
ares_library_init.c \
|
||||
ares_llist.c \
|
||||
ares_mkquery.c \
|
||||
ares_parse_a_reply.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 \
|
||||
ares_send.c \
|
||||
ares_strcasecmp.c \
|
||||
ares_strdup.c \
|
||||
ares_strerror.c \
|
||||
ares_timeout.c \
|
||||
ares_version.c \
|
||||
ares_writev.c \
|
||||
bitncmp.c \
|
||||
inet_net_pton.c \
|
||||
inet_ntop.c \
|
||||
windows_port.c
|
||||
|
||||
MANPAGES= ares_destroy.3 ares_expand_name.3 ares_expand_string.3 ares_fds.3 \
|
||||
ares_free_hostent.3 ares_free_string.3 ares_gethostbyaddr.3 \
|
||||
ares_gethostbyname.3 ares_init.3 ares_init_options.3 ares_mkquery.3 \
|
||||
ares_parse_a_reply.3 ares_parse_ptr_reply.3 ares_process.3 \
|
||||
ares_query.3 ares_search.3 ares_send.3 ares_strerror.3 ares_timeout.3 \
|
||||
ares_version.3 ares_cancel.3 ares_parse_aaaa_reply.3 ares_getnameinfo.3 \
|
||||
ares_getsock.3 ares_parse_ns_reply.3 ares_dup.3 \
|
||||
ares_destroy_options.3 ares_save_options.3 ares_gethostbyname_file.3 \
|
||||
ares_set_socket_callback.3
|
||||
HHEADERS = ares.h \
|
||||
ares_build.h \
|
||||
ares_data.h \
|
||||
ares_dns.h \
|
||||
ares_ipv6.h \
|
||||
ares_library_init.h \
|
||||
ares_llist.h \
|
||||
ares_private.h \
|
||||
ares_rules.h \
|
||||
ares_strcasecmp.h \
|
||||
ares_strdup.h \
|
||||
ares_version.h \
|
||||
ares_writev.h \
|
||||
bitncmp.h \
|
||||
inet_net_pton.h \
|
||||
inet_ntop.h \
|
||||
nameser.h \
|
||||
ares_setup.h \
|
||||
setup_once.h
|
||||
|
||||
MANPAGES = ares_cancel.3 \
|
||||
ares_destroy.3 \
|
||||
ares_destroy_options.3 \
|
||||
ares_dup.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 \
|
||||
ares_gethostbyname.3 \
|
||||
ares_gethostbyname_file.3 \
|
||||
ares_getnameinfo.3 \
|
||||
ares_getsock.3 \
|
||||
ares_init.3 \
|
||||
ares_init_options.3 \
|
||||
ares_library_cleanup.3 \
|
||||
ares_library_init.3 \
|
||||
ares_mkquery.3 \
|
||||
ares_parse_a_reply.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 \
|
||||
ares_search.3 \
|
||||
ares_send.3 \
|
||||
ares_set_socket_callback.3 \
|
||||
ares_strerror.3 \
|
||||
ares_timeout.3 \
|
||||
ares_version.3
|
||||
|
||||
HTMLPAGES = ares_cancel.html \
|
||||
ares_destroy.html \
|
||||
ares_destroy_options.html \
|
||||
ares_dup.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 \
|
||||
ares_gethostbyname.html \
|
||||
ares_gethostbyname_file.html \
|
||||
ares_getnameinfo.html \
|
||||
ares_getsock.html \
|
||||
ares_init.html \
|
||||
ares_init_options.html \
|
||||
ares_library_cleanup.html \
|
||||
ares_library_init.html \
|
||||
ares_mkquery.html \
|
||||
ares_parse_a_reply.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 \
|
||||
ares_search.html \
|
||||
ares_send.html \
|
||||
ares_set_socket_callback.html \
|
||||
ares_strerror.html \
|
||||
ares_timeout.html \
|
||||
ares_version.html
|
||||
|
||||
PDFPAGES = ares_cancel.pdf \
|
||||
ares_destroy.pdf \
|
||||
ares_destroy_options.pdf \
|
||||
ares_dup.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 \
|
||||
ares_gethostbyname.pdf \
|
||||
ares_gethostbyname_file.pdf \
|
||||
ares_getnameinfo.pdf \
|
||||
ares_getsock.pdf \
|
||||
ares_init.pdf \
|
||||
ares_init_options.pdf \
|
||||
ares_library_cleanup.pdf \
|
||||
ares_library_init.pdf \
|
||||
ares_mkquery.pdf \
|
||||
ares_parse_a_reply.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 \
|
||||
ares_search.pdf \
|
||||
ares_send.pdf \
|
||||
ares_set_socket_callback.pdf \
|
||||
ares_strerror.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
|
@@ -160,7 +160,7 @@ lib: prebuild $(LTARGET)
|
||||
|
||||
nlm: prebuild $(TARGETS)
|
||||
|
||||
prebuild: $(OBJDIR) ares_build.h $(OBJDIR)/version.inc config.h
|
||||
prebuild: $(OBJDIR) ares_build.h $(OBJDIR)/version.inc ares_config.h
|
||||
|
||||
install: $(INSTDIR) all
|
||||
@$(CP) *.nlm $(INSTDIR)
|
||||
@@ -170,7 +170,7 @@ install: $(INSTDIR) all
|
||||
@$(CP) ../RELEASE-NOTES $(INSTDIR)
|
||||
|
||||
clean:
|
||||
-$(RM) $(LTARGET) $(TARGETS) config.h
|
||||
-$(RM) $(LTARGET) $(TARGETS) ares_config.h
|
||||
-$(RM) -r $(OBJDIR)
|
||||
-$(RM) -r arpa
|
||||
|
||||
@@ -269,7 +269,7 @@ ifeq ($(LD),nlmconv)
|
||||
@echo $(DL)output $(notdir $(@:.def=.nlm))$(DL) >> $@
|
||||
endif
|
||||
|
||||
config.h: Makefile.netware
|
||||
ares_config.h: Makefile.netware
|
||||
@echo Creating $@
|
||||
@echo $(DL)/* $@ for NetWare target.$(DL) > $@
|
||||
@echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@
|
||||
|
@@ -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
|
||||
# -MLd - libc, no threads, debug
|
||||
# -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 -D_USE_32BIT_TIME_T -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) -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,21 +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
|
||||
|
||||
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 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
|
||||
Ingmar Runge, Laszlo Tamas Szabo, Yang Tse, Tommie Gannert
|
||||
|
||||
Have fun!
|
||||
|
10
ares/TODO
10
ares/TODO
@@ -6,3 +6,13 @@ ares_gethostbyname
|
||||
- When built to support IPv6, it needs to also support PF_UNSPEC or similar,
|
||||
so that an application can ask for any protocol and then c-ares would return
|
||||
all known resolves and not just explicitly IPv4 _or_ IPv6 resolves.
|
||||
|
||||
ares_process
|
||||
|
||||
- Upon next ABI breakage ares_process() should be changed to return 'int'
|
||||
and return ARES_ENOTINITIALIZED if ares_library_init() has not been called.
|
||||
|
||||
ares_process_fd
|
||||
|
||||
- Upon next ABI breakage ares_process_fd() should be changed to return
|
||||
'int' and return ARES_ENOTINITIALIZED if library has not been initialized.
|
||||
|
@@ -1320,7 +1320,7 @@ AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [
|
||||
AC_REQUIRE([AC_HEADER_TIME])dnl
|
||||
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl
|
||||
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
|
||||
AC_CHECK_HEADERS(sys/types.h sys/time.h time.h)
|
||||
AC_CHECK_HEADERS(sys/types.h sys/time.h time.h sys/socket.h)
|
||||
AC_CACHE_CHECK([for struct timeval], [ac_cv_struct_timeval], [
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
@@ -1350,6 +1350,9 @@ AC_DEFUN([CURL_CHECK_STRUCT_TIMEVAL], [
|
||||
#ifdef HAVE_TIME_H
|
||||
#include <time.h>
|
||||
#endif
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
]],[[
|
||||
struct timeval ts;
|
||||
@@ -1667,6 +1670,52 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CHECK_LIBS_CONNECT
|
||||
dnl -------------------------------------------------
|
||||
dnl Verify if network connect function is already available
|
||||
dnl using current libraries or if another one is required.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_LIBS_CONNECT], [
|
||||
AC_REQUIRE([CARES_INCLUDES_WINSOCK2])dnl
|
||||
AC_MSG_CHECKING([for connect in libraries])
|
||||
tst_connect_save_LIBS="$LIBS"
|
||||
tst_connect_need_LIBS="unknown"
|
||||
for tst_lib in '' '-lsocket' ; do
|
||||
if test "$tst_connect_need_LIBS" = "unknown"; then
|
||||
LIBS="$tst_lib $tst_connect_save_LIBS"
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
$cares_includes_winsock2
|
||||
#ifndef HAVE_WINDOWS_H
|
||||
int connect(int, void*, int);
|
||||
#endif
|
||||
]],[[
|
||||
if(0 != connect(0, 0, 0))
|
||||
return 1;
|
||||
]])
|
||||
],[
|
||||
tst_connect_need_LIBS="$tst_lib"
|
||||
])
|
||||
fi
|
||||
done
|
||||
LIBS="$tst_connect_save_LIBS"
|
||||
#
|
||||
case X-"$tst_connect_need_LIBS" in
|
||||
X-unknown)
|
||||
AC_MSG_RESULT([cannot find connect])
|
||||
AC_MSG_ERROR([cannot find connect function in libraries.])
|
||||
;;
|
||||
X-)
|
||||
AC_MSG_RESULT([yes])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([$tst_connect_need_LIBS])
|
||||
LIBS="$tst_connect_need_LIBS $tst_connect_save_LIBS"
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_DEFINE_UNQUOTED (VARIABLE, [VALUE])
|
||||
dnl -------------------------------------------------
|
||||
dnl Like AC_DEFINE_UNQUOTED this macro will define a C preprocessor
|
||||
|
@@ -10,8 +10,8 @@
|
||||
* CNAME = zz<CC>.countries.nerd.dk with address 127.0.x.y (ver 1) or
|
||||
* CNAME = <a.b.c.d>.zz.countries.nerd.dk with address 127.0.x.y (ver 2)
|
||||
*
|
||||
* The 2 letter country code in <CC> and the ISO-3166 country
|
||||
* number in x.y (number = x*256 + y). Version 2 of the protocol is missing
|
||||
* The 2 letter country code is in <CC> and the ISO-3166 country
|
||||
* number is in x.y (number = x*256 + y). Version 2 of the protocol is missing
|
||||
* the <CC> number.
|
||||
*
|
||||
* Ref: http://countries.nerd.dk/more.html
|
||||
@@ -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;
|
||||
@@ -612,9 +612,14 @@ static void find_country_from_cname(const char *cname, struct in_addr addr)
|
||||
printf("Name for country-number %d not found.\n", cnumber);
|
||||
else
|
||||
{
|
||||
if (ver_1 && *(unsigned short*)&country->short_name != *(unsigned*)&ccode_A2)
|
||||
printf("short-name mismatch; %s vs %s\n", country->short_name, ccode_A2);
|
||||
|
||||
if (ver_1)
|
||||
{
|
||||
if ((country->short_name[0] != ccode_A2[0]) ||
|
||||
(country->short_name[1] != ccode_A2[1]) ||
|
||||
(country->short_name[2] != ccode_A2[2]))
|
||||
printf("short-name mismatch; %s vs %s\n",
|
||||
country->short_name, ccode_A2);
|
||||
}
|
||||
printf("%s (%s), number %d.\n",
|
||||
country->long_name, country->short_name, cnumber);
|
||||
}
|
||||
|
49
ares/adig.c
49
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>
|
||||
@@ -84,6 +84,11 @@
|
||||
#define T_SRV 33 /* server selection */
|
||||
#endif
|
||||
|
||||
/* AIX portability check */
|
||||
#ifndef T_NAPTR
|
||||
#define T_NAPTR 35 /* naming authority pointer */
|
||||
#endif
|
||||
|
||||
struct nv {
|
||||
const char *name;
|
||||
int value;
|
||||
@@ -152,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",
|
||||
@@ -160,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,
|
||||
@@ -214,9 +220,10 @@ int main(int argc, char **argv)
|
||||
if (strcmp(flags[i].name, optarg) == 0)
|
||||
break;
|
||||
}
|
||||
if (i == nflags)
|
||||
if (i < nflags)
|
||||
options.flags |= flags[i].value;
|
||||
else
|
||||
usage();
|
||||
options.flags |= flags[i].value;
|
||||
break;
|
||||
|
||||
case 's':
|
||||
@@ -251,9 +258,10 @@ int main(int argc, char **argv)
|
||||
if (strcasecmp(classes[i].name, optarg) == 0)
|
||||
break;
|
||||
}
|
||||
if (i == nclasses)
|
||||
if (i < nclasses)
|
||||
dnsclass = classes[i].value;
|
||||
else
|
||||
usage();
|
||||
dnsclass = classes[i].value;
|
||||
break;
|
||||
|
||||
case 't':
|
||||
@@ -263,9 +271,10 @@ int main(int argc, char **argv)
|
||||
if (strcasecmp(types[i].name, optarg) == 0)
|
||||
break;
|
||||
}
|
||||
if (i == ntypes)
|
||||
if (i < ntypes)
|
||||
type = types[i].value;
|
||||
else
|
||||
usage();
|
||||
type = types[i].value;
|
||||
break;
|
||||
|
||||
case 'T':
|
||||
@@ -313,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);
|
||||
@@ -543,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:
|
||||
@@ -615,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);
|
||||
|
311
ares/ares.h
311
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) */
|
||||
@@ -94,10 +118,15 @@ extern "C" {
|
||||
#define ARES_ENONAME 19
|
||||
#define ARES_EBADHINTS 20
|
||||
|
||||
/* Uninitialized library error code */
|
||||
#define ARES_ENOTINITIALIZED 21 /* introduced in 1.7.0 */
|
||||
|
||||
/* ares_library_init error codes */
|
||||
#define ARES_ELOADIPHLPAPI 21
|
||||
#define ARES_ELOADADVAPI32 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)
|
||||
@@ -236,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 {
|
||||
@@ -306,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.
|
||||
@@ -326,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
|
||||
@@ -54,14 +54,14 @@ void ares__close_sockets(ares_channel channel, struct server_state *server)
|
||||
if (server->tcp_socket != ARES_SOCKET_BAD)
|
||||
{
|
||||
SOCK_STATE_CALLBACK(channel, server->tcp_socket, 0, 0);
|
||||
closesocket(server->tcp_socket);
|
||||
sclose(server->tcp_socket);
|
||||
server->tcp_socket = ARES_SOCKET_BAD;
|
||||
server->tcp_connection_generation = ++channel->tcp_connection_generation;
|
||||
}
|
||||
if (server->udp_socket != ARES_SOCKET_BAD)
|
||||
{
|
||||
SOCK_STATE_CALLBACK(channel, server->udp_socket, 0, 0);
|
||||
closesocket(server->udp_socket);
|
||||
sclose(server->udp_socket);
|
||||
server->udp_socket = ARES_SOCKET_BAD;
|
||||
}
|
||||
}
|
||||
|
@@ -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,13 +21,13 @@ 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
|
||||
name service channel identified by \fIchannel\fP. \fBares_cancel\fP invokes
|
||||
the callbacks for each pending query on the channel, passing a status of
|
||||
.BR ARES_ETIMEOUT .
|
||||
.BR ARES_ECANCELLED .
|
||||
These calls give the callbacks a chance to clean up any state which
|
||||
might have been stored in their arguments.
|
||||
.SH SEE ALSO
|
||||
@@ -35,5 +35,10 @@ might have been stored in their arguments.
|
||||
.BR ares_destroy (3)
|
||||
.SH NOTES
|
||||
This function was added in c-ares 1.2.0
|
||||
|
||||
c-ares 1.6.0 and earlier pass a status of
|
||||
.BR ARES_ETIMEOUT
|
||||
instead of
|
||||
.BR ARES_ECANCELLED .
|
||||
.SH AUTHOR
|
||||
Dirk Manske
|
||||
|
@@ -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"
|
||||
@@ -36,7 +36,7 @@ void ares_cancel(ares_channel channel)
|
||||
{
|
||||
query = list_node->data;
|
||||
list_node = list_node->next; /* since we're deleting the query */
|
||||
query->callback(query->arg, ARES_ETIMEOUT, 0, NULL, 0);
|
||||
query->callback(query->arg, ARES_ECANCELLED, 0, NULL, 0);
|
||||
ares__free_query(query);
|
||||
}
|
||||
#ifndef NDEBUG
|
||||
|
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"
|
||||
|
@@ -1,6 +1,6 @@
|
||||
.\" $Id$
|
||||
.\"
|
||||
.\" Copyright (C) 2007-2008 by Daniel Stenberg
|
||||
.\" Copyright (C) 2004-2009 by Daniel Stenberg
|
||||
.\"
|
||||
.\" Permission to use, copy, modify, and distribute this
|
||||
.\" software and its documentation for any purpose and without
|
||||
@@ -14,19 +14,19 @@
|
||||
.\" this software for any purpose. It is provided "as is"
|
||||
.\" without express or implied warranty.
|
||||
.\"
|
||||
.TH ARES_DUP 3 "2 Dec 2008"
|
||||
.TH ARES_DUP 3 "26 May 2009"
|
||||
.SH NAME
|
||||
ares_dup \- Duplicate a resolver channel
|
||||
.SH SYNOPSIS
|
||||
.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.
|
||||
|
||||
@@ -35,7 +35,8 @@ with additional options set exactly as the \fIsource\fP channel has them
|
||||
configured.
|
||||
.SH SEE ALSO
|
||||
.BR ares_destroy(3),
|
||||
.BR ares_init(3)
|
||||
.BR ares_init(3),
|
||||
.BR ares_library_init(3)
|
||||
.SH AVAILABILITY
|
||||
ares_dup(3) was added in c-ares 1.6.0
|
||||
.SH AUTHOR
|
||||
|
@@ -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>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
.\" $Id$
|
||||
.\"
|
||||
.\" Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
.\" Copyright (C) 2007-2008 by Daniel Stenberg
|
||||
.\" Copyright (C) 2004-2009 by Daniel Stenberg
|
||||
.\"
|
||||
.\" Permission to use, copy, modify, and distribute this
|
||||
.\" software and its documentation for any purpose and without
|
||||
@@ -15,15 +15,15 @@
|
||||
.\" this software for any purpose. It is provided "as is"
|
||||
.\" without express or implied warranty.
|
||||
.\"
|
||||
.TH ARES_INIT 3 "13 May 2008"
|
||||
.TH ARES_INIT 3 "26 May 2009"
|
||||
.SH NAME
|
||||
ares_init, ares_init_options \- Initialize a resolver channel
|
||||
.SH SYNOPSIS
|
||||
.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.
|
||||
@@ -184,10 +184,16 @@ A configuration file could not be read.
|
||||
.TP 14
|
||||
.B ARES_ENOMEM
|
||||
The process's available memory was exhausted.
|
||||
.TP 14
|
||||
.B ARES_ENOTINITIALIZED
|
||||
c-ares library initialization not yet performed.
|
||||
.SH SEE ALSO
|
||||
.BR ares_destroy(3),
|
||||
.BR ares_dup(3)
|
||||
.BR ares_dup(3),
|
||||
.BR ares_library_init(3)
|
||||
.SH AUTHOR
|
||||
Greg Hudson, MIT Information Systems
|
||||
.br
|
||||
Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
.br
|
||||
Copyright (C) 2004-2009 by Daniel Stenberg.
|
||||
|
107
ares/ares_init.c
107
ares/ares_init.c
@@ -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);
|
||||
@@ -129,6 +131,9 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
||||
curl_memlimit(atoi(env));
|
||||
#endif
|
||||
|
||||
if (ares_library_initialized() != ARES_SUCCESS)
|
||||
return ARES_ENOTINITIALIZED;
|
||||
|
||||
channel = malloc(sizeof(struct ares_channeldata));
|
||||
if (!channel) {
|
||||
*channelptr = NULL;
|
||||
@@ -198,12 +203,15 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
||||
DEBUGF(fprintf(stderr, "Error: init_by_resolv_conf failed: %s\n",
|
||||
ares_strerror(status)));
|
||||
}
|
||||
if (status == ARES_SUCCESS) {
|
||||
status = init_by_defaults(channel);
|
||||
if (status != ARES_SUCCESS)
|
||||
DEBUGF(fprintf(stderr, "Error: init_by_defaults failed: %s\n",
|
||||
ares_strerror(status)));
|
||||
}
|
||||
|
||||
/*
|
||||
* No matter what failed or succeeded, seed defaults to provide
|
||||
* useful behavior for things that we missed.
|
||||
*/
|
||||
status = init_by_defaults(channel);
|
||||
if (status != ARES_SUCCESS)
|
||||
DEBUGF(fprintf(stderr, "Error: init_by_defaults failed: %s\n",
|
||||
ares_strerror(status)));
|
||||
|
||||
/* Generate random key */
|
||||
|
||||
@@ -573,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;
|
||||
|
||||
@@ -582,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;
|
||||
|
||||
@@ -629,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;
|
||||
@@ -787,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;
|
||||
|
||||
@@ -799,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 */
|
||||
@@ -965,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;
|
||||
@@ -1034,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;
|
||||
@@ -1082,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;
|
||||
@@ -1095,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
|
||||
@@ -1122,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)
|
||||
{
|
||||
@@ -1267,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)
|
||||
{
|
||||
@@ -1359,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 */
|
||||
@@ -1418,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)
|
||||
{
|
||||
@@ -1472,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
|
||||
@@ -1486,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;
|
||||
}
|
||||
|
74
ares/ares_library_cleanup.3
Normal file
74
ares/ares_library_cleanup.3
Normal file
@@ -0,0 +1,74 @@
|
||||
.\" $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_LIBRARY_CLEANUP 3 "19 May 2009"
|
||||
.SH NAME
|
||||
ares_library_cleanup \- c-ares library deinitialization
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B void ares_library_cleanup(void)
|
||||
.PP
|
||||
.B cc file.c -lcares
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The
|
||||
.B ares_library_cleanup
|
||||
function uninitializes the c-ares library, freeing all resources
|
||||
previously aquired by \fIares_library_init(3)\fP when the library
|
||||
was initialized.
|
||||
.PP
|
||||
This function must be called when the program using c-ares will
|
||||
no longer need any c-ares function. Once the program has called
|
||||
\fIares_library_cleanup(3)\fP it shall not make any further call to any
|
||||
c-ares function.
|
||||
.PP
|
||||
This function does not cancel any pending c-ares lookups or requests
|
||||
previously done. Program must use \fIares_cancel(3)\fP for this purpose.
|
||||
.PP
|
||||
.B This function is not thread safe.
|
||||
You have to call it once the program is about to terminate, but this call must
|
||||
be done once the program has terminated every single thread that it could have
|
||||
initiated. This is required to avoid potential race conditions in library
|
||||
deinitialization, and also due to the fact that \fIares_library_cleanup(3)\fP
|
||||
might call functions from other libraries that are thread unsafe, and could
|
||||
conflict with any other thread that is already using these other libraries.
|
||||
.PP
|
||||
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.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.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)
|
||||
.SH AUTHOR
|
||||
Yang Tse
|
||||
.PP
|
||||
Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
.br
|
||||
Copyright (C) 2004-2009 by Daniel Stenberg.
|
97
ares/ares_library_init.3
Normal file
97
ares/ares_library_init.3
Normal file
@@ -0,0 +1,97 @@
|
||||
.\" $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_LIBRARY_INIT 3 "19 May 2009"
|
||||
.SH NAME
|
||||
ares_library_init \- c-ares library initialization
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_library_init(int \fIflags\fP)
|
||||
.PP
|
||||
.B cc file.c -lcares
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The
|
||||
.B ares_library_init
|
||||
function performs initializations internally required by the c-ares
|
||||
library that must take place before any other function provided by
|
||||
c-ares can be used in a program.
|
||||
.PP
|
||||
This function must be called one time within the life of a program,
|
||||
before the program actually executes any other c-ares library function.
|
||||
Initializations done by this function remain effective until a
|
||||
call to \fIares_library_cleanup(3)\fP is performed.
|
||||
.PP
|
||||
Successive calls to this function do nothing, only the first call done
|
||||
when c-ares is in an uninitialized state is actually effective.
|
||||
.PP
|
||||
The
|
||||
.I flags
|
||||
parameter is a bit pattern that tells c-ares exactly which features
|
||||
should be initialized, as described below. Set the desired bits by
|
||||
ORing the values together. In normal operation you should specify
|
||||
\fIARES_LIB_INIT_ALL\fP. Don't use any other value unless you are
|
||||
familiar with it and trying to control some internal c-ares feature.
|
||||
.PP
|
||||
.B This function is not thread safe.
|
||||
You have to call it once the program has started, but this call must be done
|
||||
before the program starts any other thread. This is required to avoid
|
||||
potential race conditions in library initialization, and also due to the fact
|
||||
that \fIares_library_init(3)\fP might call functions from other libraries that
|
||||
are thread unsafe, and could conflict with any other thread that is already
|
||||
using these other libraries.
|
||||
.PP
|
||||
Win32/64 application DLLs shall not call \fIares_library_init(3)\fP from the
|
||||
DllMain function. Doing so will produce deadlocks and other problems.
|
||||
.SH FLAGS
|
||||
.TP 5
|
||||
.B ARES_LIB_INIT_ALL
|
||||
Initialize everything possible. This sets all known bits.
|
||||
.TP
|
||||
.B ARES_LIB_INIT_WIN32
|
||||
Initialize Win32/64 specific libraries.
|
||||
.TP
|
||||
.B ARES_LIB_INIT_NONE
|
||||
Initialize nothing extra. This sets no bit.
|
||||
.SH RETURN VALUE
|
||||
Upon successful completion, ares_library_init() will return 0. Otherwise, a
|
||||
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.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.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)
|
||||
.SH AUTHOR
|
||||
Yang Tse
|
||||
.PP
|
||||
Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
.br
|
||||
Copyright (C) 2004-2009 by Daniel Stenberg.
|
@@ -1,6 +1,22 @@
|
||||
/* $Id$ */
|
||||
|
||||
#include "setup.h"
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#include "ares_setup.h"
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_library_init.h"
|
||||
@@ -8,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 */
|
||||
@@ -18,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
|
||||
@@ -26,38 +42,35 @@ 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;
|
||||
return ARES_EADDRGETNETWORKPARAMS;
|
||||
}
|
||||
|
||||
/*
|
||||
* When advapi32.dll is unavailable or advapi32.dll has no SystemFunction036,
|
||||
* also known as RtlGenRandom, which is the case for Windows versions prior
|
||||
* to WinXP then c-ares uses portable rand() function. Then don't error here.
|
||||
*/
|
||||
|
||||
hnd_advapi32 = 0;
|
||||
hnd_advapi32 = LoadLibrary("advapi32.dll");
|
||||
if (!hnd_advapi32)
|
||||
if (hnd_advapi32)
|
||||
{
|
||||
FreeLibrary(hnd_iphlpapi);
|
||||
return ARES_ELOADADVAPI32;
|
||||
ares_fpSystemFunction036 = (fpSystemFunction036_t)
|
||||
GetProcAddress(hnd_advapi32, "SystemFunction036");
|
||||
}
|
||||
|
||||
fpSystemFunction036 = (fpSystemFunction036_t)
|
||||
GetProcAddress(hnd_advapi32, "SystemFunction036");
|
||||
|
||||
/*
|
||||
* Intentionally avoid checking if the address of SystemFunction036, a.k.a.
|
||||
* RtlGenRandom, has been located or not. This function is only available on
|
||||
* WinXP and later. When unavailable c-ares uses portable rand() function.
|
||||
*/
|
||||
|
||||
#endif
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
@@ -65,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)
|
||||
@@ -107,3 +120,14 @@ void ares_library_cleanup(void)
|
||||
ares_init_flags = ARES_LIB_INIT_NONE;
|
||||
}
|
||||
|
||||
|
||||
int ares_library_initialized(void)
|
||||
{
|
||||
#ifdef USE_WINSOCK
|
||||
if (!ares_initialized)
|
||||
return ARES_ENOTINITIALIZED;
|
||||
#endif
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -3,9 +3,25 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include "setup.h"
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#include "ares_setup.h"
|
||||
|
||||
#ifdef USE_WINSOCK
|
||||
|
||||
#include <iphlpapi.h>
|
||||
|
||||
@@ -15,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;
|
||||
}
|
@@ -4,7 +4,7 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2004-2008 by Daniel Stenberg
|
||||
* Copyright (C) 2004-2009 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -30,18 +30,13 @@
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if !defined(WIN32) || defined(WATT32)
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
/* We define closesocket() here so that we can use this function all over
|
||||
the source code for closing sockets. */
|
||||
#define closesocket(x) close(x)
|
||||
#endif
|
||||
|
||||
#ifdef WATT32
|
||||
#include <tcp.h>
|
||||
#include <sys/ioctl.h>
|
||||
#undef closesocket
|
||||
#define closesocket(s) close_s(s)
|
||||
#define writev(s,v,c) writev_s(s,v,c)
|
||||
#define HAVE_WRITEV 1
|
||||
#endif
|
||||
@@ -310,12 +305,14 @@ int ares__timeadd(struct timeval *now,
|
||||
/* return time offset between now and (future) check, in milliseconds */
|
||||
long ares__timeoffset(struct timeval *now,
|
||||
struct timeval *check);
|
||||
/* returns ARES_SUCCESS if library has been initialized */
|
||||
int ares_library_initialized(void);
|
||||
void ares__rc4(rc4_key* key,unsigned char *buffer_ptr, int buffer_len);
|
||||
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);
|
||||
@@ -338,8 +335,8 @@ long ares__tvdiff(struct timeval t1, struct timeval t2);
|
||||
#ifdef CURLDEBUG
|
||||
/* This is low-level hard-hacking memory leak tracking and similar. Using the
|
||||
libcurl lowlevel code from within library is ugly and only works when
|
||||
c-ares is built and linked with a similarly debug-build libcurl, but we do
|
||||
this anyway for convenience. */
|
||||
c-ares is built and linked with a similarly curldebug-enabled libcurl,
|
||||
but we do this anyway for convenience. */
|
||||
#include "../lib/memdebug.h"
|
||||
#endif
|
||||
|
||||
|
@@ -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);
|
||||
|
||||
@@ -896,22 +903,22 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
|
||||
/* Configure it. */
|
||||
if (configure_socket(s, channel) < 0)
|
||||
{
|
||||
closesocket(s);
|
||||
sclose(s);
|
||||
return -1;
|
||||
}
|
||||
|
||||
#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,
|
||||
(void *)&opt, sizeof(opt)) == -1)
|
||||
{
|
||||
closesocket(s);
|
||||
sclose(s);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
@@ -927,7 +934,7 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
|
||||
|
||||
if (err != EINPROGRESS && err != EWOULDBLOCK)
|
||||
{
|
||||
closesocket(s);
|
||||
sclose(s);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -938,7 +945,7 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
|
||||
channel->sock_create_cb_data);
|
||||
if (err < 0)
|
||||
{
|
||||
closesocket(s);
|
||||
sclose(s);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
@@ -963,7 +970,7 @@ static int open_udp_socket(ares_channel channel, struct server_state *server)
|
||||
/* Set the socket non-blocking. */
|
||||
if (configure_socket(s, channel) < 0)
|
||||
{
|
||||
closesocket(s);
|
||||
sclose(s);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -978,7 +985,7 @@ static int open_udp_socket(ares_channel channel, struct server_state *server)
|
||||
|
||||
if (err != EINPROGRESS && err != EWOULDBLOCK)
|
||||
{
|
||||
closesocket(s);
|
||||
sclose(s);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -989,7 +996,7 @@ static int open_udp_socket(ares_channel channel, struct server_state *server)
|
||||
channel->sock_create_cb_data);
|
||||
if (err < 0)
|
||||
{
|
||||
closesocket(s);
|
||||
sclose(s);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
@@ -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$ */
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#include "ares_config.h"
|
||||
#else
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -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,8 +158,14 @@
|
||||
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#ifdef __POCC__
|
||||
# include <sys/types.h>
|
||||
# include <unistd.h>
|
||||
# define ESRCH 3
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Recent autoconf versions define these symbols in config.h. We don't
|
||||
* 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
|
||||
* --enable-debug) so we undef them again here.
|
||||
*/
|
||||
@@ -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"
|
||||
|
||||
@@ -44,9 +44,10 @@ const char *ares_strerror(int code)
|
||||
"Illegal flags specified",
|
||||
"Given hostname is not numeric",
|
||||
"Illegal hints flags specified",
|
||||
"c-ares library initialization not yet performed",
|
||||
"Error loading iphlpapi.dll",
|
||||
"Error loading advapi32.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
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user