Compare commits
1064 Commits
curl-7_19_
...
curl-7_19_
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1b6c683ca6 | ||
![]() |
501e72c3de | ||
![]() |
a450efb483 | ||
![]() |
0cf8d4f8e8 | ||
![]() |
084447e414 | ||
![]() |
4c9c9f0b89 | ||
![]() |
13db2916de | ||
![]() |
2d64cd55a1 | ||
![]() |
60a6af7498 | ||
![]() |
3cb06eb2b2 | ||
![]() |
b8e73495a5 | ||
![]() |
187cfc1594 | ||
![]() |
90cd2a4753 | ||
![]() |
f3e6a582d4 | ||
![]() |
3ae470eedf | ||
![]() |
6595592a71 | ||
![]() |
199389c94a | ||
![]() |
c31438b2f2 | ||
![]() |
843f73ecaa | ||
![]() |
86f043a66c | ||
![]() |
80d2df7789 | ||
![]() |
f882a63cba | ||
![]() |
611b3584d6 | ||
![]() |
a1f13dd31b | ||
![]() |
966e7d0e36 | ||
![]() |
44103abdb7 | ||
![]() |
8f9d4b2b50 | ||
![]() |
78c674a685 | ||
![]() |
197830a57d | ||
![]() |
3d024d5fce | ||
![]() |
5763743614 | ||
![]() |
54da964a99 | ||
![]() |
e25cff9328 | ||
![]() |
36b397be9f | ||
![]() |
468019e947 | ||
![]() |
7e941baa26 | ||
![]() |
63270b0665 | ||
![]() |
bcdbba05d3 | ||
![]() |
51d1f309cd | ||
![]() |
f04720afb8 | ||
![]() |
e6e6c6e635 | ||
![]() |
1f340a262f | ||
![]() |
242a17b9e0 | ||
![]() |
6e1632c606 | ||
![]() |
56dab605f1 | ||
![]() |
3aa3d7e629 | ||
![]() |
75585f771a | ||
![]() |
9a9f35039e | ||
![]() |
e6f84b8cc8 | ||
![]() |
72f15da2ed | ||
![]() |
effbd99384 | ||
![]() |
d1ba4324de | ||
![]() |
c0b5d378dc | ||
![]() |
b8c438f22d | ||
![]() |
a85271ce0a | ||
![]() |
fd5e69f769 | ||
![]() |
ddb0b8d8b8 | ||
![]() |
1345226bc9 | ||
![]() |
fb202e9de7 | ||
![]() |
5dcb5fa862 | ||
![]() |
f77f2709a9 | ||
![]() |
bc852bca48 | ||
![]() |
9314e9e853 | ||
![]() |
838ddf8f55 | ||
![]() |
619869c639 | ||
![]() |
31baaf72b4 | ||
![]() |
c92b996942 | ||
![]() |
e84c7db049 | ||
![]() |
9ef7b6afe2 | ||
![]() |
c5c03ac556 | ||
![]() |
6ca321ca75 | ||
![]() |
9c788a529b | ||
![]() |
6159c356c9 | ||
![]() |
ac9d92587e | ||
![]() |
f32dc6b828 | ||
![]() |
7a928b40f3 | ||
![]() |
172501e10c | ||
![]() |
317e030de0 | ||
![]() |
cfda3e6a48 | ||
![]() |
4d522b8f31 | ||
![]() |
e93c81196f | ||
![]() |
7bdd14a994 | ||
![]() |
afe06b48d6 | ||
![]() |
63c5ed3798 | ||
![]() |
77bb536542 | ||
![]() |
7c6e0d5981 | ||
![]() |
a1708730c3 | ||
![]() |
d33ca87e4c | ||
![]() |
3c509c5f68 | ||
![]() |
a840cc700a | ||
![]() |
b40b989523 | ||
![]() |
5eba93c4e7 | ||
![]() |
915dfb494e | ||
![]() |
a16cca7680 | ||
![]() |
644482fc99 | ||
![]() |
8c08ecfcbf | ||
![]() |
b9920bdd0e | ||
![]() |
bdf71e2685 | ||
![]() |
bd4fd9c28c | ||
![]() |
ff3e574187 | ||
![]() |
4422f80ae7 | ||
![]() |
cc8c2efff2 | ||
![]() |
cdaca293d9 | ||
![]() |
4dbc7850bd | ||
![]() |
8119379d4f | ||
![]() |
9b4253fe67 | ||
![]() |
b5c599c80c | ||
![]() |
9137e717b0 | ||
![]() |
80186aa7f4 | ||
![]() |
6ac739630f | ||
![]() |
80a61616b1 | ||
![]() |
589d2ee7b5 | ||
![]() |
0a294db912 | ||
![]() |
2788aa366c | ||
![]() |
0f29fdaf17 | ||
![]() |
2912d993c2 | ||
![]() |
62ceb118ee | ||
![]() |
0569c9c1be | ||
![]() |
5a91746b80 | ||
![]() |
fdc091a857 | ||
![]() |
8469db016d | ||
![]() |
f6312b16f1 | ||
![]() |
c76e538231 | ||
![]() |
96ea49870c | ||
![]() |
6e8c73fd38 | ||
![]() |
56981a2aaf | ||
![]() |
ec16121fb3 | ||
![]() |
7bd9988c8e | ||
![]() |
068312ecb8 | ||
![]() |
d36a86a12c | ||
![]() |
c174b13f8b | ||
![]() |
6b95c4e358 | ||
![]() |
22e2ecb003 | ||
![]() |
e08296f70c | ||
![]() |
dd50e5bdf2 | ||
![]() |
504ecd5f7a | ||
![]() |
7d1bb21c19 | ||
![]() |
63dc2a843f | ||
![]() |
296baeb096 | ||
![]() |
01dabb774a | ||
![]() |
d0fe4071a9 | ||
![]() |
3d491c470b | ||
![]() |
06462e8a92 | ||
![]() |
dbf371344b | ||
![]() |
e2c6e00570 | ||
![]() |
e4a0001fc6 | ||
![]() |
49400b0c7f | ||
![]() |
5957498c6f | ||
![]() |
b6282b99cb | ||
![]() |
a8483841b5 | ||
![]() |
d068001102 | ||
![]() |
d576be58dc | ||
![]() |
1a2b88964f | ||
![]() |
f7a188a642 | ||
![]() |
befbf2a206 | ||
![]() |
e01b7c1ede | ||
![]() |
dd8d472318 | ||
![]() |
256489639c | ||
![]() |
e323abe5d9 | ||
![]() |
afc00b08d7 | ||
![]() |
af41fb79b5 | ||
![]() |
535b7c5e0f | ||
![]() |
217f7a7ea7 | ||
![]() |
317d351423 | ||
![]() |
d27519c0ca | ||
![]() |
255dc45dc9 | ||
![]() |
f4d8728df9 | ||
![]() |
8611631f5e | ||
![]() |
1e5ed4fa33 | ||
![]() |
0daeab3b8d | ||
![]() |
bd27401311 | ||
![]() |
14df44dd3f | ||
![]() |
1272621ebc | ||
![]() |
0e83482e47 | ||
![]() |
c0d929bed9 | ||
![]() |
828a26286d | ||
![]() |
082b0d822c | ||
![]() |
651b4b9efa | ||
![]() |
ab1e54375f | ||
![]() |
70e2db51e1 | ||
![]() |
0145919a9e | ||
![]() |
2236a247d9 | ||
![]() |
7291f50e8d | ||
![]() |
bc5677a47b | ||
![]() |
137ef36757 | ||
![]() |
33a3753c3f | ||
![]() |
9770899a4b | ||
![]() |
fe8eeb5641 | ||
![]() |
8cd1f1f7f9 | ||
![]() |
b84876ba69 | ||
![]() |
0f1ca2939a | ||
![]() |
4882078469 | ||
![]() |
991b120eee | ||
![]() |
f278d177f9 | ||
![]() |
53b2ff4b04 | ||
![]() |
0c89d71aee | ||
![]() |
b746bf7814 | ||
![]() |
f11969015a | ||
![]() |
f1b820e5fc | ||
![]() |
7356ff0b18 | ||
![]() |
30f7a2ff20 | ||
![]() |
f6b55fae79 | ||
![]() |
8aa88f4d36 | ||
![]() |
ce7b565595 | ||
![]() |
41fd08bb0d | ||
![]() |
d0a930cd44 | ||
![]() |
9bb1854398 | ||
![]() |
f7400212fc | ||
![]() |
6434b42481 | ||
![]() |
dd0b38b32f | ||
![]() |
7816db8e8a | ||
![]() |
9cc6ab3922 | ||
![]() |
2c27e24bb4 | ||
![]() |
c382c550e7 | ||
![]() |
c663494c69 | ||
![]() |
97f27ea585 | ||
![]() |
379bfa5a36 | ||
![]() |
235c0077b8 | ||
![]() |
c621546bd6 | ||
![]() |
aa330b8240 | ||
![]() |
e43606eb4d | ||
![]() |
6a378a28b4 | ||
![]() |
95368d9cb4 | ||
![]() |
74f9c570ea | ||
![]() |
eed4a13b3b | ||
![]() |
7e9f7659b3 | ||
![]() |
4d396169c8 | ||
![]() |
4cd950900b | ||
![]() |
2b96c3f5ce | ||
![]() |
63fad159e8 | ||
![]() |
e5f1480a38 | ||
![]() |
020955ebc2 | ||
![]() |
3733fa02ee | ||
![]() |
7037e4a4b1 | ||
![]() |
0e98f938c4 | ||
![]() |
55d0c29f4a | ||
![]() |
59997ecad5 | ||
![]() |
6e2f0833ad | ||
![]() |
25f626cc52 | ||
![]() |
ece891d6db | ||
![]() |
702355da47 | ||
![]() |
c4fba310d2 | ||
![]() |
e9dd099870 | ||
![]() |
070d89a561 | ||
![]() |
28cc9dd331 | ||
![]() |
7c1fecc94a | ||
![]() |
7a9fab52be | ||
![]() |
8cb8371011 | ||
![]() |
875c55d86b | ||
![]() |
b85154f13f | ||
![]() |
06047d9103 | ||
![]() |
2362637e90 | ||
![]() |
edd02607e2 | ||
![]() |
0211e420ed | ||
![]() |
9a184e0bb1 | ||
![]() |
168fb3a8d8 | ||
![]() |
4c5307b456 | ||
![]() |
626f9bd8c2 | ||
![]() |
a06b36dee0 | ||
![]() |
18e1bee8d5 | ||
![]() |
41f76801eb | ||
![]() |
31a7bfc47f | ||
![]() |
1b6d18fcb0 | ||
![]() |
57c32b709d | ||
![]() |
5f19822e37 | ||
![]() |
9a0c9cd6e1 | ||
![]() |
0ac8e1d80b | ||
![]() |
744e55ec74 | ||
![]() |
74ba4d7950 | ||
![]() |
fa96436661 | ||
![]() |
d15b8273d6 | ||
![]() |
0a5cf3a928 | ||
![]() |
6173e38fdc | ||
![]() |
34cd99d1d9 | ||
![]() |
0922a0fc3f | ||
![]() |
dd53b356ff | ||
![]() |
f1db505778 | ||
![]() |
662727ca3e | ||
![]() |
bdec6f2b20 | ||
![]() |
c86c294f55 | ||
![]() |
a9a03b9708 | ||
![]() |
f4e8c406bb | ||
![]() |
12bfcb501c | ||
![]() |
0fc1782dd4 | ||
![]() |
9274d31690 | ||
![]() |
983a539503 | ||
![]() |
94bb7fe5cb | ||
![]() |
b98e0aa09b | ||
![]() |
49c6d7e32d | ||
![]() |
ee73fc361b | ||
![]() |
e84dbd28db | ||
![]() |
02449d9aa5 | ||
![]() |
2876329f16 | ||
![]() |
a1f455551f | ||
![]() |
042cc1f69e | ||
![]() |
90b804d3fa | ||
![]() |
4bc603a0cc | ||
![]() |
6c3f74b946 | ||
![]() |
8d78a33e60 | ||
![]() |
df07537ccf | ||
![]() |
de25ed3f37 | ||
![]() |
40edf25866 | ||
![]() |
7b7db23633 | ||
![]() |
794b4da840 | ||
![]() |
e9ea3ba4a2 | ||
![]() |
d207ea1652 | ||
![]() |
625d06ac79 | ||
![]() |
3460225590 | ||
![]() |
ea6531cf32 | ||
![]() |
2afb88e2ce | ||
![]() |
6c9f37d263 | ||
![]() |
735955282b | ||
![]() |
dd056e54e2 | ||
![]() |
f5548973ab | ||
![]() |
07dc741e18 | ||
![]() |
8b66981ce0 | ||
![]() |
3a7e8c9f5f | ||
![]() |
fb90b43432 | ||
![]() |
0302c21253 | ||
![]() |
9182a46233 | ||
![]() |
51b46f451f | ||
![]() |
11f3690201 | ||
![]() |
5784a37f91 | ||
![]() |
af91ff0e06 | ||
![]() |
be3a78f583 | ||
![]() |
7f22da5230 | ||
![]() |
5af0629ba5 | ||
![]() |
a776e5ad31 | ||
![]() |
6e422c447a | ||
![]() |
4608d0157e | ||
![]() |
a24fe59ee4 | ||
![]() |
4ad296c60b | ||
![]() |
0517fa153c | ||
![]() |
8f81fd6be5 | ||
![]() |
1472be4d3e | ||
![]() |
8925527fef | ||
![]() |
8cdc220bc0 | ||
![]() |
d315d41a12 | ||
![]() |
4f7687895d | ||
![]() |
07d46886df | ||
![]() |
b79c8f527f | ||
![]() |
0cf10ae4d7 | ||
![]() |
debe0b561d | ||
![]() |
9ddc7ad038 | ||
![]() |
9a4c887c4a | ||
![]() |
de41c6ef43 | ||
![]() |
002cf105c6 | ||
![]() |
fb8fdf9273 | ||
![]() |
517b8ed057 | ||
![]() |
d3d7ed1766 | ||
![]() |
77fd094090 | ||
![]() |
c65f9acdc7 | ||
![]() |
5c4cdcb2d5 | ||
![]() |
b1233c7e4d | ||
![]() |
4ebe4b907b | ||
![]() |
bf44d0f640 | ||
![]() |
73cf99c052 | ||
![]() |
44c02227e9 | ||
![]() |
77da9a0087 | ||
![]() |
42d2353e74 | ||
![]() |
4b441ebac5 | ||
![]() |
01140217f5 | ||
![]() |
71f3877f3a | ||
![]() |
83d135f990 | ||
![]() |
d4ac3d53fc | ||
![]() |
f0332c0b58 | ||
![]() |
bdd4294e79 | ||
![]() |
dcf92bffd2 | ||
![]() |
a2256e899b | ||
![]() |
8b6805572a | ||
![]() |
607253c2d0 | ||
![]() |
09f4a1c5e5 | ||
![]() |
5c9fff9c6e | ||
![]() |
99b4912688 | ||
![]() |
0a6312d66f | ||
![]() |
a97f52db20 | ||
![]() |
5267be57f7 | ||
![]() |
e813bf31d7 | ||
![]() |
1bd0be0361 | ||
![]() |
996c8ca7c2 | ||
![]() |
fec65fbff6 | ||
![]() |
de4610a55f | ||
![]() |
6e34c2d59a | ||
![]() |
34b09398d5 | ||
![]() |
0516ce7786 | ||
![]() |
bb86462ed7 | ||
![]() |
8fa8df95fb | ||
![]() |
82ca52713b | ||
![]() |
f29e383575 | ||
![]() |
5aeef9c1c8 | ||
![]() |
ddd3fe5948 | ||
![]() |
5591550167 | ||
![]() |
6bb9ef8de4 | ||
![]() |
14a6788535 | ||
![]() |
6f86826516 | ||
![]() |
0e6ed13454 | ||
![]() |
b914f45e9e | ||
![]() |
3ed66094e8 | ||
![]() |
718004d9b5 | ||
![]() |
1dc54324f4 | ||
![]() |
89ecf4ac01 | ||
![]() |
d42eac4287 | ||
![]() |
3fa6c51bb1 | ||
![]() |
37c5250e03 | ||
![]() |
0d3bb93ce8 | ||
![]() |
5e74c58b73 | ||
![]() |
7ac16811cc | ||
![]() |
29b6a732f3 | ||
![]() |
3dcd6bc597 | ||
![]() |
1342f5d592 | ||
![]() |
8fbfd5916d | ||
![]() |
1225d36188 | ||
![]() |
a19e02be5e | ||
![]() |
0761e60a4a | ||
![]() |
af96c8304f | ||
![]() |
0de0e95020 | ||
![]() |
35d8fb0501 | ||
![]() |
87c71953be | ||
![]() |
79a91b8168 | ||
![]() |
2f9038bf62 | ||
![]() |
4d50ca4e21 | ||
![]() |
a1077d0970 | ||
![]() |
b9fdc0c251 | ||
![]() |
f471b4836f | ||
![]() |
32b75d1b69 | ||
![]() |
f7e3bd28b4 | ||
![]() |
452e52f958 | ||
![]() |
0090099565 | ||
![]() |
2ed23cb50d | ||
![]() |
a97ab4f933 | ||
![]() |
bc93011554 | ||
![]() |
14b6cc4e22 | ||
![]() |
80ffd3581f | ||
![]() |
dd058b8de6 | ||
![]() |
3c2ad4022c | ||
![]() |
1f4b8da60a | ||
![]() |
9af4cf219e | ||
![]() |
cf4b88fcc4 | ||
![]() |
2215a9a181 | ||
![]() |
aa32f61ce7 | ||
![]() |
8266727062 | ||
![]() |
d839230402 | ||
![]() |
1cc50d31f9 | ||
![]() |
104377d718 | ||
![]() |
83640b2ee5 | ||
![]() |
9aea3e265d | ||
![]() |
59227bf075 | ||
![]() |
f61cfc5931 | ||
![]() |
27b8a5fd84 | ||
![]() |
60ff74140e | ||
![]() |
4f0a7170af | ||
![]() |
6d2ff9d2a7 | ||
![]() |
122b0bfe82 | ||
![]() |
3eae7695fc | ||
![]() |
6efde61227 | ||
![]() |
1c48124db4 | ||
![]() |
e9895ea2e7 | ||
![]() |
eab8c0d754 | ||
![]() |
7ffe62d901 | ||
![]() |
d5bfec70af | ||
![]() |
2a86817349 | ||
![]() |
5be7d88b34 | ||
![]() |
8a335ee7fd | ||
![]() |
216ad2680b | ||
![]() |
e16509d5cf | ||
![]() |
19c9b7c803 | ||
![]() |
ffd08df863 | ||
![]() |
460459e8db | ||
![]() |
07416b61e3 | ||
![]() |
000a13e21a | ||
![]() |
03ca98b0df | ||
![]() |
abb74a1203 | ||
![]() |
77c1d556bb | ||
![]() |
bd55ab05bd | ||
![]() |
2025193b7a | ||
![]() |
418683f537 | ||
![]() |
008b848dcc | ||
![]() |
79b7575fd8 | ||
![]() |
792279581b | ||
![]() |
3ca360391a | ||
![]() |
5f0a3797c9 | ||
![]() |
2d2c53d20e | ||
![]() |
02ca14fd0e | ||
![]() |
0f5895faee | ||
![]() |
c0dfe6e51d | ||
![]() |
1b4af1f8d8 | ||
![]() |
8e255534a1 | ||
![]() |
4607dfe257 | ||
![]() |
6e376532b0 | ||
![]() |
4ed64fd5ee | ||
![]() |
21700ae515 | ||
![]() |
b962ef3154 | ||
![]() |
32f78136b2 | ||
![]() |
01d6133bd7 | ||
![]() |
4b62cd3616 | ||
![]() |
df7b1d8e64 | ||
![]() |
2449e1f5a5 | ||
![]() |
66c0e4ad5f | ||
![]() |
18371aaff9 | ||
![]() |
f36eab2608 | ||
![]() |
66d38261f7 | ||
![]() |
553b4cfd0b | ||
![]() |
edd63a7920 | ||
![]() |
5ce03efc3e | ||
![]() |
4645e8b6b1 | ||
![]() |
42365aa7ef | ||
![]() |
dff4ce92ad | ||
![]() |
e5b0533dab | ||
![]() |
a2a315a6e8 | ||
![]() |
7abdc4b218 | ||
![]() |
479ddb1fee | ||
![]() |
4ee27b4594 | ||
![]() |
58ebde9502 | ||
![]() |
04ee89493e | ||
![]() |
dd3594c6b3 | ||
![]() |
f7ea431516 | ||
![]() |
16a153468d | ||
![]() |
b062212e55 | ||
![]() |
39eb96e9ff | ||
![]() |
4c84f6b423 | ||
![]() |
0b2ae71f8b | ||
![]() |
39d0b57ebf | ||
![]() |
c036f6ae2d | ||
![]() |
e35e2ea6ec | ||
![]() |
f33f8eee26 | ||
![]() |
31a3f064c0 | ||
![]() |
232518a219 | ||
![]() |
bc165078a2 | ||
![]() |
e4dabef0c7 | ||
![]() |
00142d8443 | ||
![]() |
1b0b7fa0e1 | ||
![]() |
67fb731ec4 | ||
![]() |
a30a6f2f20 | ||
![]() |
baeebb2b57 | ||
![]() |
ecc6f550eb | ||
![]() |
640974fb28 | ||
![]() |
3b0c5ae467 | ||
![]() |
0fa14c8662 | ||
![]() |
d17be0df52 | ||
![]() |
53a8a6e5a6 | ||
![]() |
dd2fc45c27 | ||
![]() |
ba9f8c674c | ||
![]() |
c4f4fa4089 | ||
![]() |
32634b0771 | ||
![]() |
c97b66287c | ||
![]() |
cd6fc8a8ef | ||
![]() |
3308781376 | ||
![]() |
40e8b4e527 | ||
![]() |
4741e64c89 | ||
![]() |
0b489c7e61 | ||
![]() |
22d4db1cf2 | ||
![]() |
7383225271 | ||
![]() |
4b3ae5e157 | ||
![]() |
797bc8504c | ||
![]() |
305f4d92ef | ||
![]() |
c36f0e71b6 | ||
![]() |
a028c69f48 | ||
![]() |
4e4b6de5ce | ||
![]() |
9aac2328c6 | ||
![]() |
e5084c1eca | ||
![]() |
9b12f09600 | ||
![]() |
a71762e405 | ||
![]() |
b8f3e5675a | ||
![]() |
820011dedc | ||
![]() |
cdd6054e08 | ||
![]() |
a15b6a6f86 | ||
![]() |
20d3e2b967 | ||
![]() |
608fdce0a0 | ||
![]() |
ecd3251542 | ||
![]() |
999c7126b3 | ||
![]() |
3c50ea961f | ||
![]() |
acc29ff1d9 | ||
![]() |
886bba55ac | ||
![]() |
cd440215a5 | ||
![]() |
73060b4523 | ||
![]() |
c76d939563 | ||
![]() |
3c4b69f95d | ||
![]() |
3f01d9a043 | ||
![]() |
dbc6fe3e84 | ||
![]() |
da6c15163b | ||
![]() |
9818bf7026 | ||
![]() |
73c7acb159 | ||
![]() |
ea8fbb5233 | ||
![]() |
9b033e1b8a | ||
![]() |
a65ce7b107 | ||
![]() |
2249c12a3c | ||
![]() |
b4ac9cd02c | ||
![]() |
3517eba632 | ||
![]() |
2cd44abafc | ||
![]() |
4b486ebbc1 | ||
![]() |
f9f211d2c6 | ||
![]() |
77b30f69e4 | ||
![]() |
17d2a464ad | ||
![]() |
ae6530ee82 | ||
![]() |
a6ba9e5ccd | ||
![]() |
c4cdab969b | ||
![]() |
c331c73ec6 | ||
![]() |
d1f063c62d | ||
![]() |
b686dc4911 | ||
![]() |
78936b2f2a | ||
![]() |
b2ed1e2607 | ||
![]() |
fb8870297d | ||
![]() |
4cbc0f6c2e | ||
![]() |
1b9eff64fa | ||
![]() |
d07d1a6ef8 | ||
![]() |
8bdd60fa71 | ||
![]() |
b872086c74 | ||
![]() |
e0af4a15d0 | ||
![]() |
d31802ed98 | ||
![]() |
87c4136bd4 | ||
![]() |
09e027bc9d | ||
![]() |
707828b71a | ||
![]() |
8f44037133 | ||
![]() |
9717ccb786 | ||
![]() |
6354cbf9d6 | ||
![]() |
95a849efc2 | ||
![]() |
fe083a94b9 | ||
![]() |
6fdcdfa5ea | ||
![]() |
4a4885eead | ||
![]() |
a0ef686c54 | ||
![]() |
2903a5c050 | ||
![]() |
4d50b9f1f1 | ||
![]() |
5e3c2af236 | ||
![]() |
5d791838d2 | ||
![]() |
b80c5cff49 | ||
![]() |
47b5740bdf | ||
![]() |
b8092857d9 | ||
![]() |
3cda1a23ce | ||
![]() |
215677c10b | ||
![]() |
3688cd3fea | ||
![]() |
5ca2a8318d | ||
![]() |
e27ec862c3 | ||
![]() |
d0b8b5a199 | ||
![]() |
efe2ce3647 | ||
![]() |
71f00188fb | ||
![]() |
a1c9cb8860 | ||
![]() |
74e9718370 | ||
![]() |
2d71c9cdfd | ||
![]() |
484d549ece | ||
![]() |
d098ab436d | ||
![]() |
85ffd33f08 | ||
![]() |
c1b8e93083 | ||
![]() |
383d4656aa | ||
![]() |
3e3d10824f | ||
![]() |
128418b214 | ||
![]() |
050a39a7a5 | ||
![]() |
5f085789b9 | ||
![]() |
6a8832d83b | ||
![]() |
fcb498b0d5 | ||
![]() |
0433252e50 | ||
![]() |
5ce6f37e26 | ||
![]() |
02fc7bb5f6 | ||
![]() |
9e1294e866 | ||
![]() |
c2c800d863 | ||
![]() |
625c107c25 | ||
![]() |
33319f5d2d | ||
![]() |
ad3c1c37bb | ||
![]() |
005bf19acf | ||
![]() |
91c77808c4 | ||
![]() |
0ce97f77e0 | ||
![]() |
197ad60d21 | ||
![]() |
dc31387c6f | ||
![]() |
bd64da3785 | ||
![]() |
4fef0d4f14 | ||
![]() |
89d6f580dc | ||
![]() |
23eb74e085 | ||
![]() |
9c86097286 | ||
![]() |
f0bb9c7d8d | ||
![]() |
d4514f9c10 | ||
![]() |
c324033ba4 | ||
![]() |
74a16db975 | ||
![]() |
a10044e110 | ||
![]() |
6cdd067faf | ||
![]() |
0989cd358a | ||
![]() |
6e0739931d | ||
![]() |
b17ca44f0b | ||
![]() |
fd6e025d61 | ||
![]() |
9230708e47 | ||
![]() |
92f3b3895e | ||
![]() |
fa8a78ff01 | ||
![]() |
310d842b70 | ||
![]() |
1498de83d6 | ||
![]() |
e29f62f0a7 | ||
![]() |
39e5fa6ae8 | ||
![]() |
dc289aa4fa | ||
![]() |
6db8f53445 | ||
![]() |
417bac4055 | ||
![]() |
e9c94cdd49 | ||
![]() |
d104216bbe | ||
![]() |
d086fdaf9f | ||
![]() |
8693afdfea | ||
![]() |
a876161ef9 | ||
![]() |
10035c898b | ||
![]() |
71edaf4d01 | ||
![]() |
2b77d50776 | ||
![]() |
6ea91af2f8 | ||
![]() |
b767440399 | ||
![]() |
4174ec7116 | ||
![]() |
068ba17e21 | ||
![]() |
4d10c96aa6 | ||
![]() |
b701ea36a7 | ||
![]() |
198fa5e3c7 | ||
![]() |
507cd13793 | ||
![]() |
6c14c96e71 | ||
![]() |
976963cd21 | ||
![]() |
9391d980c3 | ||
![]() |
bab5183820 | ||
![]() |
0abaf22467 | ||
![]() |
463a8134a1 | ||
![]() |
d22b2d181f | ||
![]() |
5a9bbf639a | ||
![]() |
81e48ada47 | ||
![]() |
598bc44f67 | ||
![]() |
b93f4f623c | ||
![]() |
1054dc5ed1 | ||
![]() |
7fc4e8af0a | ||
![]() |
4198bb88b6 | ||
![]() |
db325d1f43 | ||
![]() |
7ff38c14a9 | ||
![]() |
3f2de3d101 | ||
![]() |
6bd91936ff | ||
![]() |
035a2e5479 | ||
![]() |
6983ba3225 | ||
![]() |
77e028d620 | ||
![]() |
0bb91218c5 | ||
![]() |
231a51fe7a | ||
![]() |
8d0cbaf8df | ||
![]() |
b843c27322 | ||
![]() |
2688cf343b | ||
![]() |
b416b87518 | ||
![]() |
3f1b9f095a | ||
![]() |
8a6eeb82c5 | ||
![]() |
5779283a52 | ||
![]() |
80d0dcc9a3 | ||
![]() |
d51ad518c4 | ||
![]() |
29ba1730ca | ||
![]() |
183210619d | ||
![]() |
feff911fb7 | ||
![]() |
8eee5f3253 | ||
![]() |
3e55fef5e1 | ||
![]() |
63397e380f | ||
![]() |
07c3aaeea1 | ||
![]() |
8254bbae56 | ||
![]() |
e7886aa9b4 | ||
![]() |
fb08868e54 | ||
![]() |
c141d99059 | ||
![]() |
f66e1c49b0 | ||
![]() |
4acbe8f20c | ||
![]() |
2ea70a5c73 | ||
![]() |
eb612bfdfc | ||
![]() |
5e826c78a7 | ||
![]() |
a0d906739d | ||
![]() |
98b13037e7 | ||
![]() |
29f09f71b4 | ||
![]() |
a00b6e258d | ||
![]() |
7ded272b94 | ||
![]() |
1d12b1fa1e | ||
![]() |
54582bdce9 | ||
![]() |
a9a4300a36 | ||
![]() |
f720e0ac0f | ||
![]() |
a8245df745 | ||
![]() |
86c5d02a5e | ||
![]() |
5af597c2fb | ||
![]() |
dd9e0164d5 | ||
![]() |
9d16b4081e | ||
![]() |
545cafce9b | ||
![]() |
fb66d51796 | ||
![]() |
5175664174 | ||
![]() |
a579d67064 | ||
![]() |
be760bed7e | ||
![]() |
357383159e | ||
![]() |
0ea1c28135 | ||
![]() |
36e56f36ad | ||
![]() |
0a9984c27e | ||
![]() |
0ecdcc253b | ||
![]() |
1667890172 | ||
![]() |
9b3f863cf5 | ||
![]() |
2f2ed4e40e | ||
![]() |
3d582304b6 | ||
![]() |
996d45df0a | ||
![]() |
6047635406 | ||
![]() |
e16bccbb91 | ||
![]() |
9786e7faeb | ||
![]() |
fde4b823f1 | ||
![]() |
b7e71a249e | ||
![]() |
bf8d642607 | ||
![]() |
1fab40bb69 | ||
![]() |
ad61b58036 | ||
![]() |
b7722e7037 | ||
![]() |
6c2167b65f | ||
![]() |
18be9882f7 | ||
![]() |
a102c2c22b | ||
![]() |
ae75462254 | ||
![]() |
3ad956e73f | ||
![]() |
d6114165d3 | ||
![]() |
c3a959cc37 | ||
![]() |
ca70beec47 | ||
![]() |
758939215d | ||
![]() |
ab861e56f1 | ||
![]() |
8eb64ad600 | ||
![]() |
d74d3fe851 | ||
![]() |
fefc6a7e6b | ||
![]() |
a119114ad7 | ||
![]() |
430b1a22db | ||
![]() |
a754ea1326 | ||
![]() |
2ecf22e37e | ||
![]() |
9dcd0756ba | ||
![]() |
c455254fd1 | ||
![]() |
bb1f6e6818 | ||
![]() |
0722e91eb9 | ||
![]() |
c859a6f365 | ||
![]() |
ef49850789 | ||
![]() |
4f6f334f41 | ||
![]() |
8cd76d3921 | ||
![]() |
885805b5df | ||
![]() |
d61f260372 | ||
![]() |
d0a48627b2 | ||
![]() |
4b8f13e902 | ||
![]() |
5b9a57f536 | ||
![]() |
ba9963b8fa | ||
![]() |
6887106ff7 | ||
![]() |
98416a4fab | ||
![]() |
fad3288d20 | ||
![]() |
5ecff1e4c3 | ||
![]() |
bfeae0b5f5 | ||
![]() |
1c5336cd57 | ||
![]() |
43c2cf4edb | ||
![]() |
f6d80d66a2 | ||
![]() |
b2ca0babeb | ||
![]() |
ed4ae322f5 | ||
![]() |
4f924ab07e | ||
![]() |
ebadeff0ca | ||
![]() |
830018aa38 | ||
![]() |
8dfddd279b | ||
![]() |
544f2f74df | ||
![]() |
450348d6bd | ||
![]() |
5928ea9c7a | ||
![]() |
4754880099 | ||
![]() |
1fea66e527 | ||
![]() |
806a3163ba | ||
![]() |
08cf6780ba | ||
![]() |
6814907a2c | ||
![]() |
11a8a25528 | ||
![]() |
1b246eecfe | ||
![]() |
95456b8e78 | ||
![]() |
79fc481a2b | ||
![]() |
b9ce871463 | ||
![]() |
0bd78e1cd8 | ||
![]() |
d27f2d8168 | ||
![]() |
407f3f142a | ||
![]() |
61cfbecc74 | ||
![]() |
feeabd08ab | ||
![]() |
31a3432a8e | ||
![]() |
27db045095 | ||
![]() |
db8c75f08d | ||
![]() |
beaada77e6 | ||
![]() |
aefab9293a | ||
![]() |
a6d9310888 | ||
![]() |
bfc09ac211 | ||
![]() |
d930280af5 | ||
![]() |
445e4a9792 | ||
![]() |
aec761916e | ||
![]() |
7d750d2b92 | ||
![]() |
bdf1724412 | ||
![]() |
9cea2dfb8f | ||
![]() |
00dec36c72 | ||
![]() |
26a651f7ae | ||
![]() |
b64f0dace3 | ||
![]() |
a7b95cacb6 | ||
![]() |
ac0e0351a0 | ||
![]() |
2245ac2f88 | ||
![]() |
1bfaf76dd0 | ||
![]() |
88513d2d1a | ||
![]() |
91bc396178 | ||
![]() |
d3fdbe48ae | ||
![]() |
2c086105b1 | ||
![]() |
aed98c5125 | ||
![]() |
2d77f7cd48 | ||
![]() |
d5affe1ada | ||
![]() |
d61688923d | ||
![]() |
4aee6822ca | ||
![]() |
038542ea3e | ||
![]() |
beb14ca6d6 | ||
![]() |
4114129ac0 | ||
![]() |
6d24719167 | ||
![]() |
2393c94363 | ||
![]() |
372203f1fa | ||
![]() |
691468174b | ||
![]() |
6f8d439717 | ||
![]() |
f3ab5d5500 | ||
![]() |
8f467b4288 | ||
![]() |
4adcf7e9ed | ||
![]() |
9f8c40ed78 | ||
![]() |
cda9d7e579 | ||
![]() |
c27d2d4b93 | ||
![]() |
003afef541 | ||
![]() |
09bbca2f61 | ||
![]() |
0a305eb79f | ||
![]() |
aff5408633 | ||
![]() |
31626d4c6f | ||
![]() |
426ec2d399 | ||
![]() |
a632f6d5b1 | ||
![]() |
83c199bb00 | ||
![]() |
2ec6d08613 | ||
![]() |
42271ad463 | ||
![]() |
57ee847ce7 | ||
![]() |
985bd18904 | ||
![]() |
2d1f798d14 | ||
![]() |
9e9f70a693 | ||
![]() |
1b9d311b5c | ||
![]() |
4d437416da | ||
![]() |
267b942383 | ||
![]() |
142cb601f8 | ||
![]() |
21b523fcd3 | ||
![]() |
006cab3e9e | ||
![]() |
4e909ee8b1 | ||
![]() |
95df5d042c | ||
![]() |
22059858fe | ||
![]() |
82107a02f5 | ||
![]() |
515893595d | ||
![]() |
3800be3898 | ||
![]() |
c9ad952604 | ||
![]() |
2a09ffc648 | ||
![]() |
821d8fee3b | ||
![]() |
42224594b6 | ||
![]() |
d369a2b775 | ||
![]() |
a5f4cfc612 | ||
![]() |
23e5402bec | ||
![]() |
391e8afd1f | ||
![]() |
eff2c3a621 | ||
![]() |
de48e4e4df | ||
![]() |
c4a694862c | ||
![]() |
1e076a4ae0 | ||
![]() |
188311863a | ||
![]() |
0eb083e979 | ||
![]() |
abe61b9926 | ||
![]() |
54e49d10d2 | ||
![]() |
ef75829878 | ||
![]() |
a19341b57a | ||
![]() |
c9549391d1 | ||
![]() |
2b767161da | ||
![]() |
7c9631081d | ||
![]() |
b6f29bef06 | ||
![]() |
6abbbaad1b | ||
![]() |
fe5f448015 | ||
![]() |
7beb473a3d | ||
![]() |
19bc92289d | ||
![]() |
4e4f6c1ec8 | ||
![]() |
459e67b2a7 | ||
![]() |
51ba24991c | ||
![]() |
dfa0fd5b33 | ||
![]() |
f7ef60c13f | ||
![]() |
8b2bfa4212 | ||
![]() |
a6c915aab9 | ||
![]() |
a8323cc3f5 | ||
![]() |
aa29735868 | ||
![]() |
a059e9241e | ||
![]() |
acd637160f | ||
![]() |
ddb2783f9a | ||
![]() |
8fa895d65e | ||
![]() |
33b658a341 | ||
![]() |
df725aade2 | ||
![]() |
d84440d53b | ||
![]() |
0c1ae21c11 | ||
![]() |
f30959c6bd | ||
![]() |
d7e406e020 | ||
![]() |
638e3c070c | ||
![]() |
07aeac37fd | ||
![]() |
6ec76e7f9a | ||
![]() |
cb9951dcad | ||
![]() |
0776701396 | ||
![]() |
39de6c784c | ||
![]() |
e5c4482088 | ||
![]() |
975c171d5a | ||
![]() |
7d7f63059a | ||
![]() |
8c6c0a7bcc | ||
![]() |
aa41743ebd | ||
![]() |
ee5f13cb6b | ||
![]() |
974145f61c | ||
![]() |
849318138e | ||
![]() |
6a04c0878b | ||
![]() |
db80e18308 | ||
![]() |
3081207a4c | ||
![]() |
8085c7a450 | ||
![]() |
842de91168 | ||
![]() |
4c621bc697 | ||
![]() |
938458b330 | ||
![]() |
651dad0cc1 | ||
![]() |
f591ab3ba0 | ||
![]() |
09aa4cf2ca | ||
![]() |
61c0bdb09c | ||
![]() |
89367d47a8 | ||
![]() |
7fdfd938e0 | ||
![]() |
e526b5ffeb | ||
![]() |
adb974960d | ||
![]() |
2acc92828f | ||
![]() |
a1d1f43e6a | ||
![]() |
aac739ccd2 | ||
![]() |
c3d1b07c45 | ||
![]() |
77bafd823b | ||
![]() |
624b5f228b | ||
![]() |
6d233becf0 | ||
![]() |
2bcd13aaee | ||
![]() |
20723cb792 | ||
![]() |
b93ad10fa5 | ||
![]() |
28e2007767 | ||
![]() |
802f1e4406 | ||
![]() |
a37cc6cb08 | ||
![]() |
6cea51585f | ||
![]() |
fce9c3a9f1 | ||
![]() |
969903ebf2 | ||
![]() |
7b3f86152a | ||
![]() |
ea1362a936 | ||
![]() |
f62a5b83a9 | ||
![]() |
a834b98232 | ||
![]() |
152cf6325d | ||
![]() |
c98ab69cc7 | ||
![]() |
f7cce15156 | ||
![]() |
3072c5b8a1 | ||
![]() |
ac1ab03cb0 | ||
![]() |
2ef72f7abb | ||
![]() |
eae27d1788 | ||
![]() |
a3787eff19 | ||
![]() |
836d945ece | ||
![]() |
2816902f0e | ||
![]() |
f72a26d340 | ||
![]() |
387521bb6d | ||
![]() |
a4da82a43b | ||
![]() |
bc90fefb5b | ||
![]() |
c3d871aef4 | ||
![]() |
59e378f48f | ||
![]() |
a622fd90b4 | ||
![]() |
861b647e7b | ||
![]() |
70e57dad88 | ||
![]() |
91ff938035 | ||
![]() |
3acd1146f9 | ||
![]() |
45d3bfff28 | ||
![]() |
18110b519c | ||
![]() |
4c9768565e | ||
![]() |
873e734c39 | ||
![]() |
747e0c657d | ||
![]() |
780f13db30 | ||
![]() |
62519bfe05 | ||
![]() |
29f7f468ce | ||
![]() |
9c36a5fd06 | ||
![]() |
4558c8f37a | ||
![]() |
bb67388bbe | ||
![]() |
3dcd2b82c4 | ||
![]() |
c0f3e32447 | ||
![]() |
8733e087d7 | ||
![]() |
9f9e577640 | ||
![]() |
9813cea1d0 | ||
![]() |
304537c24f | ||
![]() |
cc0054a4d5 | ||
![]() |
29ec219b82 | ||
![]() |
0994d7811f | ||
![]() |
934708d950 | ||
![]() |
bbc002a505 | ||
![]() |
c8d4e8b5d0 | ||
![]() |
18a21d5802 | ||
![]() |
fcb63f3039 | ||
![]() |
91d7a6f8a9 | ||
![]() |
238db14002 | ||
![]() |
d0995204da |
23
.cvsignore
23
.cvsignore
@@ -1,17 +1,22 @@
|
||||
compile
|
||||
config.log
|
||||
Makefile
|
||||
libtool
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
aclocal.m4.bak
|
||||
configure
|
||||
config.h
|
||||
config.status
|
||||
curl-config
|
||||
autom4te.cache
|
||||
depcomp
|
||||
compile
|
||||
config.guess
|
||||
config.h
|
||||
config.log
|
||||
config.lt
|
||||
config.status
|
||||
config.sub
|
||||
ltmain.sh
|
||||
configure
|
||||
curl-config
|
||||
depcomp
|
||||
libcurl.pc
|
||||
libtool
|
||||
ltmain.sh
|
||||
vc6curl.ncb
|
||||
vc6curl.opt
|
||||
vc6curl.sln
|
||||
vc6curl.suo
|
||||
|
2
CMake/CMakeConfigurableFile.in
Normal file
2
CMake/CMakeConfigurableFile.in
Normal file
@@ -0,0 +1,2 @@
|
||||
@CMAKE_CONFIGURABLE_FILE_CONTENT@
|
||||
|
34
CMake/CheckTypeSize.c.in
Normal file
34
CMake/CheckTypeSize.c.in
Normal file
@@ -0,0 +1,34 @@
|
||||
#cmakedefine CHECK_TYPE_SIZE_TYPE @CHECK_TYPE_SIZE_TYPE@
|
||||
#ifdef CHECK_TYPE_SIZE_TYPE
|
||||
|
||||
@CHECK_TYPE_SIZE_PREINCLUDE@
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif /* HAVE_SYS_TYPES_H */
|
||||
|
||||
#ifdef HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif /* HAVE_STDINT_H */
|
||||
|
||||
#ifdef HAVE_STDDEF_H
|
||||
# include <stddef.h>
|
||||
#endif /* HAVE_STDDEF_H */
|
||||
|
||||
@CHECK_TYPE_SIZE_PREMAIN@
|
||||
|
||||
#ifdef __CLASSIC_C__
|
||||
int main(){
|
||||
int ac;
|
||||
char*av[];
|
||||
#else
|
||||
int main(int ac, char*av[]){
|
||||
#endif
|
||||
if(ac > 1000){return *av[0];}
|
||||
return sizeof(CHECK_TYPE_SIZE_TYPE);
|
||||
}
|
||||
|
||||
#else /* CHECK_TYPE_SIZE_TYPE */
|
||||
|
||||
# error "CHECK_TYPE_SIZE_TYPE has to specify the type"
|
||||
|
||||
#endif /* CHECK_TYPE_SIZE_TYPE */
|
56
CMake/CheckTypeSize.cmake
Normal file
56
CMake/CheckTypeSize.cmake
Normal file
@@ -0,0 +1,56 @@
|
||||
# - Check sizeof a type
|
||||
# CHECK_TYPE_SIZE(TYPE VARIABLE)
|
||||
# Check if the type exists and determine size of type. if the type
|
||||
# exists, the size will be stored to the variable.
|
||||
#
|
||||
# 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)
|
75
CMake/CurlCheckCSourceCompiles.cmake
Normal file
75
CMake/CurlCheckCSourceCompiles.cmake
Normal file
@@ -0,0 +1,75 @@
|
||||
# - Check if the source code provided in the SOURCE argument compiles.
|
||||
# CURL_CHECK_C_SOURCE_COMPILES(SOURCE VAR)
|
||||
# - macro which checks if the source code compiles
|
||||
# SOURCE - source code to try to compile
|
||||
# VAR - variable to store whether the source code compiled
|
||||
#
|
||||
# The following variables may be set before calling this macro to
|
||||
# modify the way the check is run:
|
||||
#
|
||||
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# 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}")
|
||||
# If the number of arguments is greater than 2 (SOURCE VAR)
|
||||
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
|
||||
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
|
||||
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
|
||||
"-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)
|
||||
|
||||
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}
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
|
||||
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
|
||||
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
|
||||
"${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
|
||||
"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
|
||||
"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)
|
83
CMake/CurlCheckCSourceRuns.cmake
Normal file
83
CMake/CurlCheckCSourceRuns.cmake
Normal file
@@ -0,0 +1,83 @@
|
||||
# - Check if the source code provided in the SOURCE argument compiles and runs.
|
||||
# CURL_CHECK_C_SOURCE_RUNS(SOURCE VAR)
|
||||
# - macro which checks if the source code runs
|
||||
# SOURCE - source code to try to compile
|
||||
# VAR - variable to store size if the type exists.
|
||||
#
|
||||
# The following variables may be set before calling this macro to
|
||||
# modify the way the check is run:
|
||||
#
|
||||
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# 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}")
|
||||
# If the number of arguments is greater than 2 (SOURCE VAR)
|
||||
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
|
||||
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
|
||||
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
|
||||
"-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)
|
||||
|
||||
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
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
|
||||
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
|
||||
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
|
||||
"${CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
|
||||
"${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 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
|
||||
"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
|
||||
"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)
|
690
CMake/CurlTests.c
Normal file
690
CMake/CurlTests.c
Normal file
@@ -0,0 +1,690 @@
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
/* Time with sys/time test */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
if ((struct tm *) 0)
|
||||
return 0;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FCNTL_O_NONBLOCK
|
||||
|
||||
/* headers for FCNTL_O_NONBLOCK test */
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
/* */
|
||||
#if defined(sun) || defined(__sun__) || \
|
||||
defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||
# if defined(__SVR4) || defined(__srv4__)
|
||||
# define PLATFORM_SOLARIS
|
||||
# else
|
||||
# define PLATFORM_SUNOS4
|
||||
# endif
|
||||
#endif
|
||||
#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41)
|
||||
# define PLATFORM_AIX_V3
|
||||
#endif
|
||||
/* */
|
||||
#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3) || defined(__BEOS__)
|
||||
#error "O_NONBLOCK does not work on this platform"
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
/* O_NONBLOCK source test */
|
||||
int flags = 0;
|
||||
if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GETHOSTBYADDR_R_5
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
char * address;
|
||||
int length;
|
||||
int type;
|
||||
struct hostent h;
|
||||
struct hostent_data hdata;
|
||||
int rc;
|
||||
#ifndef gethostbyaddr_r
|
||||
(void)gethostbyaddr_r;
|
||||
#endif
|
||||
rc = gethostbyaddr_r(address, length, type, &h, &hdata);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_GETHOSTBYADDR_R_5_REENTRANT
|
||||
#define _REENTRANT
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
char * address;
|
||||
int length;q
|
||||
int type;
|
||||
struct hostent h;
|
||||
struct hostent_data hdata;
|
||||
int rc;
|
||||
#ifndef gethostbyaddr_r
|
||||
(void)gethostbyaddr_r;
|
||||
#endif
|
||||
rc = gethostbyaddr_r(address, length, type, &h, &hdata);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_GETHOSTBYADDR_R_7
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
char * address;
|
||||
int length;
|
||||
int type;
|
||||
struct hostent h;
|
||||
char buffer[8192];
|
||||
int h_errnop;
|
||||
struct hostent * hp;
|
||||
|
||||
#ifndef gethostbyaddr_r
|
||||
(void)gethostbyaddr_r;
|
||||
#endif
|
||||
hp = gethostbyaddr_r(address, length, type, &h,
|
||||
buffer, 8192, &h_errnop);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_GETHOSTBYADDR_R_7_REENTRANT
|
||||
#define _REENTRANT
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
char * address;
|
||||
int length;
|
||||
int type;
|
||||
struct hostent h;
|
||||
char buffer[8192];
|
||||
int h_errnop;
|
||||
struct hostent * hp;
|
||||
|
||||
#ifndef gethostbyaddr_r
|
||||
(void)gethostbyaddr_r;
|
||||
#endif
|
||||
hp = gethostbyaddr_r(address, length, type, &h,
|
||||
buffer, 8192, &h_errnop);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_GETHOSTBYADDR_R_8
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
char * address;
|
||||
int length;
|
||||
int type;
|
||||
struct hostent h;
|
||||
char buffer[8192];
|
||||
int h_errnop;
|
||||
struct hostent * hp;
|
||||
int rc;
|
||||
|
||||
#ifndef gethostbyaddr_r
|
||||
(void)gethostbyaddr_r;
|
||||
#endif
|
||||
rc = gethostbyaddr_r(address, length, type, &h,
|
||||
buffer, 8192, &hp, &h_errnop);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_GETHOSTBYADDR_R_8_REENTRANT
|
||||
#define _REENTRANT
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
char * address;
|
||||
int length;
|
||||
int type;
|
||||
struct hostent h;
|
||||
char buffer[8192];
|
||||
int h_errnop;
|
||||
struct hostent * hp;
|
||||
int rc;
|
||||
|
||||
#ifndef gethostbyaddr_r
|
||||
(void)gethostbyaddr_r;
|
||||
#endif
|
||||
rc = gethostbyaddr_r(address, length, type, &h,
|
||||
buffer, 8192, &hp, &h_errnop);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_GETHOSTBYNAME_R_3
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
#undef NULL
|
||||
#define NULL (void *)0
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
struct hostent_data data;
|
||||
#ifndef gethostbyname_r
|
||||
(void)gethostbyname_r;
|
||||
#endif
|
||||
gethostbyname_r(NULL, NULL, NULL);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_GETHOSTBYNAME_R_3_REENTRANT
|
||||
#define _REENTRANT
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
#undef NULL
|
||||
#define NULL (void *)0
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
struct hostent_data data;
|
||||
#ifndef gethostbyname_r
|
||||
(void)gethostbyname_r;
|
||||
#endif
|
||||
gethostbyname_r(NULL, NULL, NULL);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_GETHOSTBYNAME_R_5
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#undef NULL
|
||||
#define NULL (void *)0
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
#ifndef gethostbyname_r
|
||||
(void)gethostbyname_r;
|
||||
#endif
|
||||
gethostbyname_r(NULL, NULL, NULL, 0, NULL);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_GETHOSTBYNAME_R_5_REENTRANT
|
||||
#define _REENTRANT
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
#undef NULL
|
||||
#define NULL (void *)0
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
#ifndef gethostbyname_r
|
||||
(void)gethostbyname_r;
|
||||
#endif
|
||||
gethostbyname_r(NULL, NULL, NULL, 0, NULL);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_GETHOSTBYNAME_R_6
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
#undef NULL
|
||||
#define NULL (void *)0
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
#ifndef gethostbyname_r
|
||||
(void)gethostbyname_r;
|
||||
#endif
|
||||
gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_GETHOSTBYNAME_R_6_REENTRANT
|
||||
#define _REENTRANT
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
#undef NULL
|
||||
#define NULL (void *)0
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
#ifndef gethostbyname_r
|
||||
(void)gethostbyname_r;
|
||||
#endif
|
||||
gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_SOCKLEN_T
|
||||
#ifdef _WIN32
|
||||
#include <ws2tcpip.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
int
|
||||
main ()
|
||||
{
|
||||
if ((socklen_t *) 0)
|
||||
return 0;
|
||||
if (sizeof (socklen_t))
|
||||
return 0;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_IN_ADDR_T
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
if ((in_addr_t *) 0)
|
||||
return 0;
|
||||
if (sizeof (in_addr_t))
|
||||
return 0;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_BOOL_T
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDBOOL_H
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
int
|
||||
main ()
|
||||
{
|
||||
if (sizeof (bool *) )
|
||||
return 0;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <float.h>
|
||||
int main() { return 0; }
|
||||
#endif
|
||||
#ifdef RETSIGTYPE_TEST
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
#ifdef signal
|
||||
# undef signal
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
extern "C" void (*signal (int, void (*)(int)))(int);
|
||||
#else
|
||||
void (*signal ()) ();
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_INET_NTOA_R_DECL
|
||||
#include <arpa/inet.h>
|
||||
|
||||
typedef void (*func_type)();
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef inet_ntoa_r
|
||||
func_type func;
|
||||
func = (func_type)inet_ntoa_r;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_INET_NTOA_R_DECL_REENTRANT
|
||||
#define _REENTRANT
|
||||
#include <arpa/inet.h>
|
||||
|
||||
typedef void (*func_type)();
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef inet_ntoa_r
|
||||
func_type func;
|
||||
func = (func_type)&inet_ntoa_r;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_GETADDRINFO
|
||||
#include <netdb.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
int main(void) {
|
||||
struct addrinfo hints, *ai;
|
||||
int error;
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
#ifndef getaddrinfo
|
||||
(void)getaddrinfo;
|
||||
#endif
|
||||
error = getaddrinfo("127.0.0.1", "8080", &hints, &ai);
|
||||
if (error) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_FILE_OFFSET_BITS
|
||||
#ifdef _FILE_OFFSET_BITS
|
||||
#undef _FILE_OFFSET_BITS
|
||||
#endif
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
#include <sys/types.h>
|
||||
/* Check that off_t can represent 2**63 - 1 correctly.
|
||||
We can't simply define LARGE_OFF_T to be 9223372036854775807,
|
||||
since some C++ compilers masquerading as C compilers
|
||||
incorrectly reject 9223372036854775807. */
|
||||
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
|
||||
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
|
||||
&& LARGE_OFF_T % 2147483647 == 1)
|
||||
? 1 : -1];
|
||||
int main () { ; return 0; }
|
||||
#endif
|
||||
#ifdef HAVE_IOCTLSOCKET
|
||||
/* includes start */
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# ifdef HAVE_WINSOCK2_H
|
||||
# include <winsock2.h>
|
||||
# else
|
||||
# ifdef HAVE_WINSOCK_H
|
||||
# include <winsock.h>
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
/* ioctlsocket source code */
|
||||
int socket;
|
||||
unsigned long flags = ioctlsocket(socket, FIONBIO, &flags);
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef HAVE_IOCTLSOCKET_CAMEL
|
||||
/* includes start */
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# ifdef HAVE_WINSOCK2_H
|
||||
# include <winsock2.h>
|
||||
# else
|
||||
# ifdef HAVE_WINSOCK_H
|
||||
# include <winsock.h>
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
/* IoctlSocket source code */
|
||||
if(0 != IoctlSocket(0, 0, 0))
|
||||
return 1;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_IOCTLSOCKET_CAMEL_FIONBIO
|
||||
/* includes start */
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# ifdef HAVE_WINSOCK2_H
|
||||
# include <winsock2.h>
|
||||
# else
|
||||
# ifdef HAVE_WINSOCK_H
|
||||
# include <winsock.h>
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
/* IoctlSocket source code */
|
||||
long flags = 0;
|
||||
if(0 != ioctlsocket(0, FIONBIO, &flags))
|
||||
return 1;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_IOCTLSOCKET_FIONBIO
|
||||
/* includes start */
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# ifdef HAVE_WINSOCK2_H
|
||||
# include <winsock2.h>
|
||||
# else
|
||||
# ifdef HAVE_WINSOCK_H
|
||||
# include <winsock.h>
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
int flags = 0;
|
||||
if(0 != ioctlsocket(0, FIONBIO, &flags))
|
||||
return 1;
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_IOCTL_FIONBIO
|
||||
/* headers for FIONBIO test */
|
||||
/* includes start */
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
#ifdef HAVE_STROPTS_H
|
||||
# include <stropts.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
int flags = 0;
|
||||
if(0 != ioctl(0, FIONBIO, &flags))
|
||||
return 1;
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_IOCTL_SIOCGIFADDR
|
||||
/* headers for FIONBIO test */
|
||||
/* includes start */
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
#ifdef HAVE_STROPTS_H
|
||||
# include <stropts.h>
|
||||
#endif
|
||||
#include <net/if.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
struct ifreq ifr;
|
||||
if(0 != ioctl(0, SIOCGIFADDR, &ifr))
|
||||
return 1;
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_SETSOCKOPT_SO_NONBLOCK
|
||||
/* includes start */
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# ifdef HAVE_WINSOCK2_H
|
||||
# include <winsock2.h>
|
||||
# else
|
||||
# ifdef HAVE_WINSOCK_H
|
||||
# include <winsock.h>
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
/* includes start */
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
/* includes end */
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0))
|
||||
return 1;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_GLIBC_STRERROR_R
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
int
|
||||
main () {
|
||||
char buffer[1024]; /* big enough to play with */
|
||||
char *string =
|
||||
strerror_r(EACCES, buffer, sizeof(buffer));
|
||||
/* this should've returned a string */
|
||||
if(!string || !string[0])
|
||||
return 99;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_POSIX_STRERROR_R
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
int
|
||||
main () {
|
||||
char buffer[1024]; /* big enough to play with */
|
||||
int error =
|
||||
strerror_r(EACCES, buffer, sizeof(buffer));
|
||||
/* This should've returned zero, and written an error string in the
|
||||
buffer.*/
|
||||
if(!buffer[0] || error)
|
||||
return 99;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
19
CMake/FindOpenSSL.cmake
Normal file
19
CMake/FindOpenSSL.cmake
Normal file
@@ -0,0 +1,19 @@
|
||||
# Extension of the standard FindOpenSSL.cmake
|
||||
# Adds OPENSSL_INCLUDE_DIRS and libeay32
|
||||
INCLUDE("${CMAKE_ROOT}/Modules/FindOpenSSL.cmake")
|
||||
|
||||
# Bill Hoffman told that libeay32 is necessary for him:
|
||||
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)
|
||||
SET(OPENSSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
|
||||
ENDIF()
|
8
CMake/FindZLIB.cmake
Normal file
8
CMake/FindZLIB.cmake
Normal file
@@ -0,0 +1,8 @@
|
||||
# Locate zlib
|
||||
INCLUDE("${CMAKE_ROOT}/Modules/FindZLIB.cmake")
|
||||
|
||||
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()
|
250
CMake/OtherTests.cmake
Normal file
250
CMake/OtherTests.cmake
Normal file
@@ -0,0 +1,250 @@
|
||||
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
|
||||
"${headers_hack}\n#include <${header}>")
|
||||
#SET(HEADER_INCLUDES
|
||||
# ${HEADER_INCLUDES}
|
||||
# "${header}")
|
||||
ENDIF(${check})
|
||||
ENDMACRO(add_header_include)
|
||||
|
||||
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}
|
||||
"__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)
|
||||
add_header_include(HAVE_SYS_TYPES_H "sys/types.h")
|
||||
add_header_include(HAVE_SYS_SOCKET_H "sys/socket.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)
|
||||
# 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("
|
||||
${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
|
||||
"${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}")
|
||||
#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")
|
||||
|
||||
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)
|
||||
# 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("
|
||||
${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)
|
||||
#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
|
||||
"${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}")
|
||||
#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")
|
||||
|
||||
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 "__unused1\n#undef inline\n#define __unused2")
|
||||
SET(HEADER_INCLUDES)
|
||||
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)
|
||||
|
||||
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)
|
||||
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)
|
||||
|
||||
|
||||
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(CHECK_TYPE_SIZE_PREINCLUDE
|
||||
"#undef inline")
|
||||
|
||||
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}
|
||||
"sys/socket.h")
|
||||
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}
|
||||
"arpa/inet.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)
|
||||
|
121
CMake/Platforms/WindowsCache.cmake
Normal file
121
CMake/Platforms/WindowsCache.cmake
Normal file
@@ -0,0 +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)
|
||||
|
||||
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_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_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(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)
|
||||
|
31
CMake/Utilities.cmake
Normal file
31
CMake/Utilities.cmake
Normal file
@@ -0,0 +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()
|
||||
|
||||
# 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()
|
||||
|
||||
# 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()
|
843
CMakeLists.txt
Normal file
843
CMakeLists.txt
Normal file
@@ -0,0 +1,843 @@
|
||||
# cURL/libcurl CMake script
|
||||
# by Tetetest and Sukender (Benoit Neil)
|
||||
|
||||
# TODO:
|
||||
# The output .so file lacks the soname number which we currently have within the lib/Makefile.am file
|
||||
# Add full (4 or 5 libs) SSL support
|
||||
# Add INSTALL target (EXTRA_DIST variables in Makefile.am may be moved to Makefile.inc so that CMake/CPack is aware of what's to include).
|
||||
# Add CTests(?)
|
||||
# Check on all possible platforms
|
||||
# Test with as many configurations possible (With or without any option)
|
||||
# Create scripts that help keeping the CMake build system up to date (to reduce maintenance). According to Tetetest:
|
||||
# - lists of headers that 'configure' checks for;
|
||||
# - curl-specific tests (the ones that are in m4/curl-*.m4 files);
|
||||
# - (most obvious thing:) curl version numbers.
|
||||
# Add documentation subproject
|
||||
#
|
||||
# To check:
|
||||
# (From Daniel Stenberg) The cmake build selected to run gcc with -fPIC on my box while the plain configure script did not.
|
||||
# (From Daniel Stenberg) The gcc command line use neither -g nor any -O options. As a developer, I also treasure our configure scripts's --enable-debug option that sets a long range of "picky" compiler options.
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.2 FATAL_ERROR)
|
||||
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}")
|
||||
INCLUDE(Utilities)
|
||||
|
||||
project( CURL C )
|
||||
SET(CURL_MAJOR_VERSION 7)
|
||||
SET(CURL_MINOR_VERSION 19)
|
||||
SET(CURL_PATCH_VERSION 4)
|
||||
|
||||
INCLUDE_REGULAR_EXPRESSION("^.*$") # Sukender: Is it necessary?
|
||||
|
||||
# Setup package meta-data
|
||||
# SET(PACKAGE "curl")
|
||||
SET(CURL_VERSION ${CURL_MAJOR_VERSION}.${CURL_MINOR_VERSION}.${CURL_PATCH_VERSION})
|
||||
# SET(PACKAGE_TARNAME "curl")
|
||||
# SET(PACKAGE_NAME "curl")
|
||||
# SET(PACKAGE_VERSION "-")
|
||||
# SET(PACKAGE_STRING "curl-")
|
||||
# SET(PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/")
|
||||
SET(OPERATING_SYSTEM "${CMAKE_SYSTEM_NAME}")
|
||||
SET(OS "\"${CMAKE_SYSTEM_NAME}\"")
|
||||
|
||||
# Make the base headers visible to everything
|
||||
# IF(NOT ${PROJECT_BINARY_DIR} EQUAL ${PROJECT_SOURCE_DIR})
|
||||
# INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/include)
|
||||
# ENDIF()
|
||||
INCLUDE_DIRECTORIES( ${CURL_SOURCE_DIR}/include )
|
||||
|
||||
IF(WIN32)
|
||||
SET(NATIVE_WINDOWS ON)
|
||||
ENDIF()
|
||||
|
||||
OPTION(BUILD_CURL_EXE "Set to ON to build cURL executable." ON)
|
||||
OPTION(BUILD_CURL_TESTS "Set to ON to build cURL tests." ON)
|
||||
OPTION(CURL_STATICLIB "Set to ON to build libcurl with static linking." OFF)
|
||||
|
||||
OPTION(BUILD_DASHBOARD_REPORTS "Set to ON to activate reporting of cURL builds here http://www.cdash.org/CDashPublic/index.php?project=CURL" OFF)
|
||||
IF(BUILD_DASHBOARD_REPORTS)
|
||||
#INCLUDE(Dart)
|
||||
INCLUDE(CTest)
|
||||
ENDIF(BUILD_DASHBOARD_REPORTS)
|
||||
|
||||
IF(MSVC)
|
||||
OPTION(BUILD_RELEASE_DEBUG_DIRS "Set OFF to build each configuration to a separate directory" OFF)
|
||||
MARK_AS_ADVANCED(BUILD_RELEASE_DEBUG_DIRS)
|
||||
ENDIF()
|
||||
|
||||
OPTION(CURL_HIDDEN_SYMBOLS "Set to ON to hide libcurl internal symbols (=hide all symbols that aren't officially external)." ON)
|
||||
MARK_AS_ADVANCED(CURL_HIDDEN_SYMBOLS)
|
||||
|
||||
# IF(WIN32)
|
||||
# OPTION(CURL_WINDOWS_SSPI "Use windows libraries to allow NTLM authentication without openssl" ON)
|
||||
# MARK_AS_ADVANCED(CURL_WINDOWS_SSPI)
|
||||
# ENDIF()
|
||||
|
||||
OPTION(HTTP_ONLY "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)" OFF)
|
||||
MARK_AS_ADVANCED(HTTP_ONLY)
|
||||
OPTION(CURL_DISABLE_FTP "disables FTP" OFF)
|
||||
MARK_AS_ADVANCED(CURL_DISABLE_FTP)
|
||||
OPTION(CURL_DISABLE_LDAP "disables LDAP" OFF)
|
||||
MARK_AS_ADVANCED(CURL_DISABLE_LDAP)
|
||||
OPTION(CURL_DISABLE_TELNET "disables Telnet" OFF)
|
||||
MARK_AS_ADVANCED(CURL_DISABLE_TELNET)
|
||||
OPTION(CURL_DISABLE_DICT "disables DICT" OFF)
|
||||
MARK_AS_ADVANCED(CURL_DISABLE_DICT)
|
||||
OPTION(CURL_DISABLE_FILE "disables FILE" OFF)
|
||||
MARK_AS_ADVANCED(CURL_DISABLE_FILE)
|
||||
OPTION(CURL_DISABLE_TFTP "disables TFTP" OFF)
|
||||
MARK_AS_ADVANCED(CURL_DISABLE_TFTP)
|
||||
OPTION(CURL_DISABLE_HTTP "disables HTTP" OFF)
|
||||
MARK_AS_ADVANCED(CURL_DISABLE_HTTP)
|
||||
|
||||
OPTION(CURL_DISABLE_LDAPS "to disable LDAPS" OFF)
|
||||
MARK_AS_ADVANCED(CURL_DISABLE_LDAPS)
|
||||
IF(WIN32)
|
||||
OPTION(CURL_LDAP_WIN "Use W$ LDAP implementation" ON)
|
||||
MARK_AS_ADVANCED(CURL_LDAP_WIN)
|
||||
SET(CURL_LDAP_HYBRID OFF)
|
||||
ELSE()
|
||||
OPTION(CURL_LDAP_HYBRID "W$ LDAP with non-W$ compiler" OFF)
|
||||
MARK_AS_ADVANCED(CURL_LDAP_HYBRID)
|
||||
SET(CURL_LDAP_WIN OFF)
|
||||
ENDIF()
|
||||
|
||||
IF(HTTP_ONLY)
|
||||
SET(CURL_DISABLE_FTP ON)
|
||||
SET(CURL_DISABLE_LDAP ON)
|
||||
SET(CURL_DISABLE_TELNET ON)
|
||||
SET(CURL_DISABLE_DICT ON)
|
||||
SET(CURL_DISABLE_FILE ON)
|
||||
SET(CURL_DISABLE_TFTP ON)
|
||||
ENDIF()
|
||||
|
||||
OPTION(CURL_DISABLE_COOKIES "to disable cookies support" OFF)
|
||||
MARK_AS_ADVANCED(CURL_DISABLE_COOKIES)
|
||||
|
||||
OPTION(CURL_DISABLE_CRYPTO_AUTH "to disable cryptographic authentication" OFF)
|
||||
MARK_AS_ADVANCED(CURL_DISABLE_CRYPTO_AUTH)
|
||||
OPTION(CURL_DISABLE_VERBOSE_STRINGS "to disable verbose strings" OFF)
|
||||
MARK_AS_ADVANCED(CURL_DISABLE_VERBOSE_STRINGS)
|
||||
OPTION(DISABLED_THREADSAFE "Set to explicitly specify we don't want to use thread-safe functions" OFF)
|
||||
MARK_AS_ADVANCED(DISABLED_THREADSAFE)
|
||||
OPTION(ENABLE_IPV6 "Define if you want to enable IPv6 support" OFF)
|
||||
MARK_AS_ADVANCED(ENABLE_IPV6)
|
||||
|
||||
IF(WIN32)
|
||||
LIST_SPACES_APPEND_ONCE(CMAKE_C_STANDARD_LIBRARIES wsock32.lib ws2_32.lib) # bufferoverflowu.lib
|
||||
IF(CURL_DISABLE_LDAP)
|
||||
# Remove wldap32.lib from space-separated list
|
||||
STRING(REPLACE " " ";" _LIST ${CMAKE_C_STANDARD_LIBRARIES})
|
||||
LIST(REMOVE_ITEM _LIST "wldap32.lib")
|
||||
TO_LIST_SPACES(_LIST CMAKE_C_STANDARD_LIBRARIES)
|
||||
ELSE()
|
||||
# Append wldap32.lib
|
||||
LIST_SPACES_APPEND_ONCE(CMAKE_C_STANDARD_LIBRARIES wldap32.lib)
|
||||
ENDIF()
|
||||
SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES}" CACHE STRING "" FORCE)
|
||||
ENDIF()
|
||||
|
||||
|
||||
# We need ansi c-flags, especially on HP
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}")
|
||||
SET(CMAKE_REQUIRED_FLAGS ${CMAKE_ANSI_CFLAGS})
|
||||
|
||||
# Disable warnings on Borland to avoid changing 3rd party code.
|
||||
IF(BORLAND)
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-")
|
||||
ENDIF(BORLAND)
|
||||
|
||||
# If we are on AIX, do the _ALL_SOURCE magic
|
||||
IF(${CMAKE_SYSTEM_NAME} MATCHES AIX)
|
||||
SET(_ALL_SOURCE 1)
|
||||
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES AIX)
|
||||
|
||||
# Include all the necessary files for macros
|
||||
INCLUDE (CheckFunctionExists)
|
||||
INCLUDE (CheckIncludeFile)
|
||||
INCLUDE (CheckIncludeFiles)
|
||||
INCLUDE (CheckLibraryExists)
|
||||
INCLUDE (CheckSymbolExists)
|
||||
# if crosscompiling is on, the CHECK_TYPE_SIZE macro coming with cmake uses
|
||||
# TRY_COMPILE instead of TRY_RUN which makes crosscompiling easier, Alex
|
||||
IF(CMAKE_CROSSCOMPILING)
|
||||
INCLUDE ("${CMAKE_MODULE_PATH}/CheckTypeSize.cmake")
|
||||
ELSE(CMAKE_CROSSCOMPILING)
|
||||
INCLUDE (CheckTypeSize)
|
||||
ENDIF(CMAKE_CROSSCOMPILING)
|
||||
|
||||
# On windows preload settings
|
||||
IF(WIN32)
|
||||
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMake/Platforms/WindowsCache.cmake)
|
||||
ENDIF(WIN32)
|
||||
|
||||
# This macro checks if the symbol exists in the library and if it
|
||||
# does, it appends library to the list.
|
||||
SET(CURL_LIBS "")
|
||||
MACRO(CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE)
|
||||
CHECK_LIBRARY_EXISTS("${LIBRARY};${CURL_LIBS}" ${SYMBOL} ""
|
||||
${VARIABLE})
|
||||
IF(${VARIABLE})
|
||||
SET(CURL_LIBS ${CURL_LIBS} ${LIBRARY})
|
||||
ENDIF(${VARIABLE})
|
||||
ENDMACRO(CHECK_LIBRARY_EXISTS_CONCAT)
|
||||
|
||||
# Check for all needed libraries
|
||||
CHECK_LIBRARY_EXISTS_CONCAT("dl" dlopen HAVE_LIBDL)
|
||||
#CHECK_LIBRARY_EXISTS_CONCAT("ucb" gethostname HAVE_LIBUCB)
|
||||
CHECK_LIBRARY_EXISTS_CONCAT("socket" connect HAVE_LIBSOCKET)
|
||||
CHECK_LIBRARY_EXISTS("c" gethostbyname "" NOT_NEED_LIBNSL)
|
||||
|
||||
# Yellowtab Zeta needs different libraries than BeOS 5.
|
||||
IF(BEOS)
|
||||
SET(NOT_NEED_LIBNSL 1)
|
||||
CHECK_LIBRARY_EXISTS_CONCAT("bind" gethostbyname HAVE_LIBBIND)
|
||||
CHECK_LIBRARY_EXISTS_CONCAT("bnetapi" closesocket HAVE_LIBBNETAPI)
|
||||
ENDIF(BEOS)
|
||||
|
||||
IF(NOT NOT_NEED_LIBNSL)
|
||||
CHECK_LIBRARY_EXISTS_CONCAT("nsl" gethostbyname HAVE_LIBNSL)
|
||||
ENDIF(NOT NOT_NEED_LIBNSL)
|
||||
|
||||
CHECK_LIBRARY_EXISTS_CONCAT("ws2_32" getch HAVE_LIBWS2_32)
|
||||
CHECK_LIBRARY_EXISTS_CONCAT("winmm" getch HAVE_LIBWINMM)
|
||||
# IF(NOT CURL_SPECIAL_LIBZ)
|
||||
# CHECK_LIBRARY_EXISTS_CONCAT("z" inflateEnd HAVE_LIBZ)
|
||||
# ENDIF(NOT CURL_SPECIAL_LIBZ)
|
||||
|
||||
OPTION(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ON)
|
||||
MARK_AS_ADVANCED(CMAKE_USE_OPENSSL)
|
||||
IF(CMAKE_USE_OPENSSL)
|
||||
IF(WIN32)
|
||||
FIND_PACKAGE(OpenSSL)
|
||||
IF(OPENSSL_FOUND)
|
||||
SET(USE_SSLEAY TRUE)
|
||||
SET(USE_OPENSSL TRUE)
|
||||
LIST(APPEND CURL_LIBS ${OPENSSL_LIBRARIES} )
|
||||
ENDIF()
|
||||
#FIND_LIBRARY(LIBEAY NAMES libeay32)
|
||||
#LIST(APPEND CURL_LIBS ${LIBEAY} )
|
||||
ELSE(WIN32)
|
||||
CHECK_LIBRARY_EXISTS_CONCAT("crypto" CRYPTO_lock HAVE_LIBCRYPTO)
|
||||
CHECK_LIBRARY_EXISTS_CONCAT("ssl" SSL_connect HAVE_LIBSSL)
|
||||
ENDIF(WIN32)
|
||||
ENDIF(CMAKE_USE_OPENSSL)
|
||||
|
||||
# Check for idn
|
||||
CHECK_LIBRARY_EXISTS_CONCAT("idn" idna_to_ascii_lz HAVE_LIBIDN)
|
||||
|
||||
# Check for LDAP
|
||||
CHECK_LIBRARY_EXISTS_CONCAT("ldap" ldap_init HAVE_LIBLDAP)
|
||||
# if(NOT HAVE_LIBLDAP)
|
||||
# SET(CURL_DISABLE_LDAP ON)
|
||||
# endif(NOT HAVE_LIBLDAP)
|
||||
|
||||
# Check for symbol dlopen (same as HAVE_LIBDL)
|
||||
CHECK_LIBRARY_EXISTS("${CURL_LIBS}" dlopen "" HAVE_DLOPEN)
|
||||
|
||||
# For other tests to use the same libraries
|
||||
SET(CMAKE_REQUIRED_LIBRARIES ${CURL_LIBS})
|
||||
|
||||
OPTION(CURL_ZLIB "Set to ON to enable building cURL with zlib support." ON)
|
||||
SET(HAVE_LIBZ OFF)
|
||||
SET(HAVE_ZLIB_H OFF)
|
||||
SET(HAVE_ZLIB OFF)
|
||||
IF(CURL_ZLIB) # AND CURL_CONFIG_HAS_BEEN_RUN_BEFORE
|
||||
FIND_PACKAGE(ZLIB)
|
||||
IF(ZLIB_FOUND)
|
||||
SET(HAVE_ZLIB_H ON)
|
||||
SET(HAVE_ZLIB ON)
|
||||
SET(HAVE_LIBZ ON)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# If we have features.h, then do the _BSD_SOURCE magic
|
||||
CHECK_INCLUDE_FILE("features.h" HAVE_FEATURES_H)
|
||||
|
||||
# Check if header file exists and add it to the list.
|
||||
MACRO(CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE)
|
||||
CHECK_INCLUDE_FILES("${CURL_INCLUDES};${FILE}" ${VARIABLE})
|
||||
IF(${VARIABLE})
|
||||
SET(CURL_INCLUDES ${CURL_INCLUDES} ${FILE})
|
||||
SET(CURL_TEST_DEFINES "${CURL_TEST_DEFINES} -D${VARIABLE}")
|
||||
ENDIF(${VARIABLE})
|
||||
ENDMACRO(CHECK_INCLUDE_FILE_CONCAT)
|
||||
|
||||
|
||||
# Check for header files
|
||||
IF(NOT UNIX)
|
||||
CHECK_INCLUDE_FILE_CONCAT("ws2tcpip.h" HAVE_WS2TCPIP_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("winsock2.h" HAVE_WINSOCK2_H)
|
||||
ENDIF(NOT UNIX)
|
||||
CHECK_INCLUDE_FILE_CONCAT("stdio.h" HAVE_STDIO_H)
|
||||
IF(NOT UNIX)
|
||||
CHECK_INCLUDE_FILE_CONCAT("windows.h" HAVE_WINDOWS_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("winsock.h" HAVE_WINSOCK_H)
|
||||
ENDIF(NOT UNIX)
|
||||
|
||||
CHECK_INCLUDE_FILE_CONCAT("inttypes.h" HAVE_INTTYPES_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("sys/filio.h" HAVE_SYS_FILIO_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("sys/ioctl.h" HAVE_SYS_IOCTL_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("sys/param.h" HAVE_SYS_PARAM_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("sys/poll.h" HAVE_SYS_POLL_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("sys/resource.h" HAVE_SYS_RESOURCE_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("sys/select.h" HAVE_SYS_SELECT_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("sys/socket.h" HAVE_SYS_SOCKET_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("sys/sockio.h" HAVE_SYS_SOCKIO_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("sys/stat.h" HAVE_SYS_STAT_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("sys/time.h" HAVE_SYS_TIME_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("sys/types.h" HAVE_SYS_TYPES_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("sys/uio.h" HAVE_SYS_UIO_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("sys/un.h" HAVE_SYS_UN_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("sys/utime.h" HAVE_SYS_UTIME_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("alloca.h" HAVE_ALLOCA_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("arpa/inet.h" HAVE_ARPA_INET_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("arpa/tftp.h" HAVE_ARPA_TFTP_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("assert.h" HAVE_ASSERT_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("crypto.h" HAVE_CRYPTO_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("des.h" HAVE_DES_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("err.h" HAVE_ERR_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("errno.h" HAVE_ERRNO_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("fcntl.h" HAVE_FCNTL_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("gssapi/gssapi.h" HAVE_GSSAPI_GSSAPI_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("gssapi/gssapi_generic.h" HAVE_GSSAPI_GSSAPI_GENERIC_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("gssapi/gssapi_krb5.h" HAVE_GSSAPI_GSSAPI_KRB5_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("idn-free.h" HAVE_IDN_FREE_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("ifaddrs.h" HAVE_IFADDRS_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("io.h" HAVE_IO_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("krb.h" HAVE_KRB_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("libgen.h" HAVE_LIBGEN_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("libssh2.h" HAVE_LIBSSH2_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("limits.h" HAVE_LIMITS_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("locale.h" HAVE_LOCALE_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("net/if.h" HAVE_NET_IF_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("netdb.h" HAVE_NETDB_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("netinet/in.h" HAVE_NETINET_IN_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("netinet/tcp.h" HAVE_NETINET_TCP_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("openssl/crypto.h" HAVE_OPENSSL_CRYPTO_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("openssl/engine.h" HAVE_OPENSSL_ENGINE_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("openssl/err.h" HAVE_OPENSSL_ERR_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("openssl/pem.h" HAVE_OPENSSL_PEM_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("openssl/pkcs12.h" HAVE_OPENSSL_PKCS12_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("openssl/rsa.h" HAVE_OPENSSL_RSA_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("openssl/ssl.h" HAVE_OPENSSL_SSL_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("openssl/x509.h" HAVE_OPENSSL_X509_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("pem.h" HAVE_PEM_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("poll.h" HAVE_POLL_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("pwd.h" HAVE_PWD_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("rsa.h" HAVE_RSA_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("setjmp.h" HAVE_SETJMP_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("sgtty.h" HAVE_SGTTY_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("signal.h" HAVE_SIGNAL_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("ssl.h" HAVE_SSL_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("stdbool.h" HAVE_STDBOOL_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("stdint.h" HAVE_STDINT_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("stdio.h" HAVE_STDIO_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("stdlib.h" HAVE_STDLIB_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("string.h" HAVE_STRING_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("strings.h" HAVE_STRINGS_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("stropts.h" HAVE_STROPTS_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("termio.h" HAVE_TERMIO_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("termios.h" HAVE_TERMIOS_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("time.h" HAVE_TIME_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("tld.h" HAVE_TLD_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("unistd.h" HAVE_UNISTD_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("utime.h" HAVE_UTIME_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("x509.h" HAVE_X509_H)
|
||||
|
||||
CHECK_INCLUDE_FILE_CONCAT("process.h" HAVE_PROCESS_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("stddef.h" HAVE_STDDEF_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("dlfcn.h" HAVE_DLFCN_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("malloc.h" HAVE_MALLOC_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("memory.h" HAVE_MEMORY_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("ldap.h" HAVE_LDAP_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("netinet/if_ether.h" HAVE_NETINET_IF_ETHER_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("stdint.h" HAVE_STDINT_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("sockio.h" HAVE_SOCKIO_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("sys/utsname.h" HAVE_SYS_UTSNAME_H)
|
||||
CHECK_INCLUDE_FILE_CONCAT("idna.h" HAVE_IDNA_H)
|
||||
|
||||
IF(CMAKE_USE_OPENSSL)
|
||||
CHECK_INCLUDE_FILE_CONCAT("openssl/rand.h" HAVE_OPENSSL_RAND_H)
|
||||
ENDIF(CMAKE_USE_OPENSSL)
|
||||
|
||||
|
||||
CHECK_TYPE_SIZE(size_t SIZEOF_SIZE_T)
|
||||
CHECK_TYPE_SIZE(ssize_t SIZEOF_SSIZE_T)
|
||||
CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG)
|
||||
CHECK_TYPE_SIZE("long" SIZEOF_LONG)
|
||||
CHECK_TYPE_SIZE("int" SIZEOF_INT)
|
||||
CHECK_TYPE_SIZE("__int64" SIZEOF___INT64)
|
||||
CHECK_TYPE_SIZE("long double" SIZEOF_LONG_DOUBLE)
|
||||
CHECK_TYPE_SIZE("time_t" SIZEOF_TIME_T)
|
||||
IF(NOT HAVE_SIZEOF_SSIZE_T)
|
||||
IF(SIZEOF_LONG EQUAL SIZEOF_SIZE_T)
|
||||
SET(ssize_t long)
|
||||
ENDIF(SIZEOF_LONG EQUAL SIZEOF_SIZE_T)
|
||||
IF(NOT ssize_t AND SIZEOF___INT64 EQUAL SIZEOF_SIZE_T)
|
||||
SET(ssize_t __int64)
|
||||
ENDIF(NOT ssize_t AND SIZEOF___INT64 EQUAL SIZEOF_SIZE_T)
|
||||
ENDIF(NOT HAVE_SIZEOF_SSIZE_T)
|
||||
|
||||
# Different sizeofs, etc.
|
||||
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
|
||||
set(CURL_SIZEOF_LONG ${SIZEOF_LONG})
|
||||
|
||||
if(SIZEOF_LONG EQUAL 8)
|
||||
set(CURL_TYPEOF_CURL_OFF_T long)
|
||||
set(CURL_SIZEOF_CURL_OFF_T 8)
|
||||
set(CURL_FORMAT_CURL_OFF_T "ld")
|
||||
set(CURL_FORMAT_CURL_OFF_TU "lu")
|
||||
set(CURL_FORMAT_OFF_T "%ld")
|
||||
set(CURL_SUFFIX_CURL_OFF_T L)
|
||||
set(CURL_SUFFIX_CURL_OFF_TU LU)
|
||||
endif(SIZEOF_LONG EQUAL 8)
|
||||
|
||||
if(SIZEOF_LONG_LONG EQUAL 8)
|
||||
set(CURL_TYPEOF_CURL_OFF_T "long long")
|
||||
set(CURL_SIZEOF_CURL_OFF_T 8)
|
||||
set(CURL_FORMAT_CURL_OFF_T "lld")
|
||||
set(CURL_FORMAT_CURL_OFF_TU "llu")
|
||||
set(CURL_FORMAT_OFF_T "%lld")
|
||||
set(CURL_SUFFIX_CURL_OFF_T LL)
|
||||
set(CURL_SUFFIX_CURL_OFF_TU LLU)
|
||||
endif(SIZEOF_LONG_LONG EQUAL 8)
|
||||
|
||||
if(NOT CURL_TYPEOF_CURL_OFF_T)
|
||||
set(CURL_TYPEOF_CURL_OFF_T ${ssize_t})
|
||||
set(CURL_SIZEOF_CURL_OFF_T ${SIZEOF_SSIZE_T})
|
||||
# TODO: need adjustment here.
|
||||
set(CURL_FORMAT_CURL_OFF_T "ld")
|
||||
set(CURL_FORMAT_CURL_OFF_TU "lu")
|
||||
set(CURL_FORMAT_OFF_T "%ld")
|
||||
set(CURL_SUFFIX_CURL_OFF_T L)
|
||||
set(CURL_SUFFIX_CURL_OFF_TU LU)
|
||||
endif(NOT CURL_TYPEOF_CURL_OFF_T)
|
||||
|
||||
IF(HAVE_SIZEOF_LONG_LONG)
|
||||
SET(HAVE_LONGLONG 1)
|
||||
SET(HAVE_LL 1)
|
||||
ENDIF(HAVE_SIZEOF_LONG_LONG)
|
||||
|
||||
FIND_FILE(RANDOM_FILE urandom /dev)
|
||||
MARK_AS_ADVANCED(RANDOM_FILE)
|
||||
|
||||
# Check for some functions that are used
|
||||
CHECK_SYMBOL_EXISTS(basename "${CURL_INCLUDES}" HAVE_BASENAME)
|
||||
CHECK_SYMBOL_EXISTS(socket "${CURL_INCLUDES}" HAVE_SOCKET)
|
||||
CHECK_SYMBOL_EXISTS(poll "${CURL_INCLUDES}" HAVE_POLL)
|
||||
CHECK_SYMBOL_EXISTS(select "${CURL_INCLUDES}" HAVE_SELECT)
|
||||
CHECK_SYMBOL_EXISTS(strdup "${CURL_INCLUDES}" HAVE_STRDUP)
|
||||
CHECK_SYMBOL_EXISTS(strstr "${CURL_INCLUDES}" HAVE_STRSTR)
|
||||
CHECK_SYMBOL_EXISTS(strtok_r "${CURL_INCLUDES}" HAVE_STRTOK_R)
|
||||
CHECK_SYMBOL_EXISTS(strftime "${CURL_INCLUDES}" HAVE_STRFTIME)
|
||||
CHECK_SYMBOL_EXISTS(uname "${CURL_INCLUDES}" HAVE_UNAME)
|
||||
CHECK_SYMBOL_EXISTS(strcasecmp "${CURL_INCLUDES}" HAVE_STRCASECMP)
|
||||
CHECK_SYMBOL_EXISTS(stricmp "${CURL_INCLUDES}" HAVE_STRICMP)
|
||||
CHECK_SYMBOL_EXISTS(strcmpi "${CURL_INCLUDES}" HAVE_STRCMPI)
|
||||
CHECK_SYMBOL_EXISTS(strncmpi "${CURL_INCLUDES}" HAVE_STRNCMPI)
|
||||
CHECK_SYMBOL_EXISTS(alarm "${CURL_INCLUDES}" HAVE_ALARM)
|
||||
IF(NOT HAVE_STRNCMPI)
|
||||
SET(HAVE_STRCMPI)
|
||||
ENDIF(NOT HAVE_STRNCMPI)
|
||||
CHECK_SYMBOL_EXISTS(gethostbyaddr "${CURL_INCLUDES}" HAVE_GETHOSTBYADDR)
|
||||
CHECK_SYMBOL_EXISTS(gethostbyaddr_r "${CURL_INCLUDES}" HAVE_GETHOSTBYADDR_R)
|
||||
CHECK_SYMBOL_EXISTS(gettimeofday "${CURL_INCLUDES}" HAVE_GETTIMEOFDAY)
|
||||
CHECK_SYMBOL_EXISTS(inet_addr "${CURL_INCLUDES}" HAVE_INET_ADDR)
|
||||
CHECK_SYMBOL_EXISTS(inet_ntoa "${CURL_INCLUDES}" HAVE_INET_NTOA)
|
||||
CHECK_SYMBOL_EXISTS(inet_ntoa_r "${CURL_INCLUDES}" HAVE_INET_NTOA_R)
|
||||
CHECK_SYMBOL_EXISTS(tcsetattr "${CURL_INCLUDES}" HAVE_TCSETATTR)
|
||||
CHECK_SYMBOL_EXISTS(tcgetattr "${CURL_INCLUDES}" HAVE_TCGETATTR)
|
||||
CHECK_SYMBOL_EXISTS(perror "${CURL_INCLUDES}" HAVE_PERROR)
|
||||
CHECK_SYMBOL_EXISTS(closesocket "${CURL_INCLUDES}" HAVE_CLOSESOCKET)
|
||||
CHECK_SYMBOL_EXISTS(setvbuf "${CURL_INCLUDES}" HAVE_SETVBUF)
|
||||
CHECK_SYMBOL_EXISTS(sigsetjmp "${CURL_INCLUDES}" HAVE_SIGSETJMP)
|
||||
CHECK_SYMBOL_EXISTS(getpass_r "${CURL_INCLUDES}" HAVE_GETPASS_R)
|
||||
CHECK_SYMBOL_EXISTS(strlcat "${CURL_INCLUDES}" HAVE_STRLCAT)
|
||||
CHECK_SYMBOL_EXISTS(getpwuid "${CURL_INCLUDES}" HAVE_GETPWUID)
|
||||
CHECK_SYMBOL_EXISTS(geteuid "${CURL_INCLUDES}" HAVE_GETEUID)
|
||||
CHECK_SYMBOL_EXISTS(utime "${CURL_INCLUDES}" HAVE_UTIME)
|
||||
IF(CMAKE_USE_OPENSSL)
|
||||
CHECK_SYMBOL_EXISTS(RAND_status "${CURL_INCLUDES}" HAVE_RAND_STATUS)
|
||||
CHECK_SYMBOL_EXISTS(RAND_screen "${CURL_INCLUDES}" HAVE_RAND_SCREEN)
|
||||
CHECK_SYMBOL_EXISTS(RAND_egd "${CURL_INCLUDES}" HAVE_RAND_EGD)
|
||||
CHECK_SYMBOL_EXISTS(CRYPTO_cleanup_all_ex_data "${CURL_INCLUDES}"
|
||||
HAVE_CRYPTO_CLEANUP_ALL_EX_DATA)
|
||||
IF(HAVE_LIBCRYPTO AND HAVE_LIBSSL)
|
||||
SET(USE_OPENSSL 1)
|
||||
SET(USE_SSLEAY 1)
|
||||
ENDIF(HAVE_LIBCRYPTO AND HAVE_LIBSSL)
|
||||
ENDIF(CMAKE_USE_OPENSSL)
|
||||
CHECK_SYMBOL_EXISTS(gmtime_r "${CURL_INCLUDES}" HAVE_GMTIME_R)
|
||||
CHECK_SYMBOL_EXISTS(localtime_r "${CURL_INCLUDES}" HAVE_LOCALTIME_R)
|
||||
|
||||
CHECK_SYMBOL_EXISTS(gethostbyname "${CURL_INCLUDES}" HAVE_GETHOSTBYNAME)
|
||||
CHECK_SYMBOL_EXISTS(gethostbyname_r "${CURL_INCLUDES}" HAVE_GETHOSTBYNAME_R)
|
||||
|
||||
CHECK_SYMBOL_EXISTS(signal "${CURL_INCLUDES}" HAVE_SIGNAL_FUNC)
|
||||
CHECK_SYMBOL_EXISTS(SIGALRM "${CURL_INCLUDES}" HAVE_SIGNAL_MACRO)
|
||||
IF(HAVE_SIGNAL_FUNC AND HAVE_SIGNAL_MACRO)
|
||||
SET(HAVE_SIGNAL 1)
|
||||
ENDIF(HAVE_SIGNAL_FUNC AND HAVE_SIGNAL_MACRO)
|
||||
CHECK_SYMBOL_EXISTS(uname "${CURL_INCLUDES}" HAVE_UNAME)
|
||||
CHECK_SYMBOL_EXISTS(strtoll "${CURL_INCLUDES}" HAVE_STRTOLL)
|
||||
CHECK_SYMBOL_EXISTS(_strtoi64 "${CURL_INCLUDES}" HAVE__STRTOI64)
|
||||
CHECK_SYMBOL_EXISTS(strerror_r "${CURL_INCLUDES}" HAVE_STRERROR_R)
|
||||
CHECK_SYMBOL_EXISTS(siginterrupt "${CURL_INCLUDES}" HAVE_SIGINTERRUPT)
|
||||
CHECK_SYMBOL_EXISTS(perror "${CURL_INCLUDES}" HAVE_PERROR)
|
||||
CHECK_SYMBOL_EXISTS(fork "${CURL_INCLUDES}" HAVE_FORK)
|
||||
CHECK_SYMBOL_EXISTS(freeaddrinfo "${CURL_INCLUDES}" HAVE_FREEADDRINFO)
|
||||
CHECK_SYMBOL_EXISTS(freeifaddrs "${CURL_INCLUDES}" HAVE_FREEIFADDRS)
|
||||
CHECK_SYMBOL_EXISTS(pipe "${CURL_INCLUDES}" HAVE_PIPE)
|
||||
CHECK_SYMBOL_EXISTS(ftruncate "${CURL_INCLUDES}" HAVE_FTRUNCATE)
|
||||
CHECK_SYMBOL_EXISTS(getprotobyname "${CURL_INCLUDES}" HAVE_GETPROTOBYNAME)
|
||||
CHECK_SYMBOL_EXISTS(getrlimit "${CURL_INCLUDES}" HAVE_GETRLIMIT)
|
||||
CHECK_SYMBOL_EXISTS(idn_free "${CURL_INCLUDES}" HAVE_IDN_FREE)
|
||||
CHECK_SYMBOL_EXISTS(idna_strerror "${CURL_INCLUDES}" HAVE_IDNA_STRERROR)
|
||||
CHECK_SYMBOL_EXISTS(tld_strerror "${CURL_INCLUDES}" HAVE_TLD_STRERROR)
|
||||
CHECK_SYMBOL_EXISTS(setlocale "${CURL_INCLUDES}" HAVE_SETLOCALE)
|
||||
CHECK_SYMBOL_EXISTS(setrlimit "${CURL_INCLUDES}" HAVE_SETRLIMIT)
|
||||
CHECK_SYMBOL_EXISTS(fcntl "${CURL_INCLUDES}" HAVE_FCNTL)
|
||||
CHECK_SYMBOL_EXISTS(ioctl "${CURL_INCLUDES}" HAVE_IOCTL)
|
||||
CHECK_SYMBOL_EXISTS(setsockopt "${CURL_INCLUDES}" HAVE_SETSOCKOPT)
|
||||
|
||||
# symbol exists in win32, but function does not.
|
||||
CHECK_FUNCTION_EXISTS(inet_pton HAVE_INET_PTON)
|
||||
|
||||
# sigaction and sigsetjmp are special. Use special mechanism for
|
||||
# detecting those, but only if previous attempt failed.
|
||||
IF(HAVE_SIGNAL_H)
|
||||
CHECK_SYMBOL_EXISTS(sigaction "signal.h" HAVE_SIGACTION)
|
||||
ENDIF(HAVE_SIGNAL_H)
|
||||
|
||||
IF(NOT HAVE_SIGSETJMP)
|
||||
IF(HAVE_SETJMP_H)
|
||||
CHECK_SYMBOL_EXISTS(sigsetjmp "setjmp.h" HAVE_MACRO_SIGSETJMP)
|
||||
IF(HAVE_MACRO_SIGSETJMP)
|
||||
SET(HAVE_SIGSETJMP 1)
|
||||
ENDIF(HAVE_MACRO_SIGSETJMP)
|
||||
ENDIF(HAVE_SETJMP_H)
|
||||
ENDIF(NOT HAVE_SIGSETJMP)
|
||||
|
||||
# If there is no stricmp(), do not allow LDAP to parse URLs
|
||||
if(NOT HAVE_STRICMP)
|
||||
SET(HAVE_LDAP_URL_PARSE 1)
|
||||
endif(NOT HAVE_STRICMP)
|
||||
|
||||
# For other curl specific tests, use this macro.
|
||||
MACRO(CURL_INTERNAL_TEST CURL_TEST)
|
||||
IF("${CURL_TEST}" MATCHES "^${CURL_TEST}$")
|
||||
SET(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||
"-D${CURL_TEST} ${CURL_TEST_DEFINES} ${CMAKE_REQUIRED_FLAGS}")
|
||||
IF(CMAKE_REQUIRED_LIBRARIES)
|
||||
SET(CURL_TEST_ADD_LIBRARIES
|
||||
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
|
||||
ENDIF(CMAKE_REQUIRED_LIBRARIES)
|
||||
|
||||
MESSAGE(STATUS "Performing Curl Test ${CURL_TEST}")
|
||||
TRY_COMPILE(${CURL_TEST}
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMake/CurlTests.c
|
||||
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
|
||||
"${CURL_TEST_ADD_LIBRARIES}"
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
IF(${CURL_TEST})
|
||||
SET(${CURL_TEST} 1 CACHE INTERNAL "Curl test ${FUNCTION}")
|
||||
MESSAGE(STATUS "Performing Curl Test ${CURL_TEST} - Success")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Performing Curl Test ${CURL_TEST} passed with the following output:\n"
|
||||
"${OUTPUT}\n")
|
||||
ELSE(${CURL_TEST})
|
||||
MESSAGE(STATUS "Performing Curl Test ${CURL_TEST} - Failed")
|
||||
SET(${CURL_TEST} "" CACHE INTERNAL "Curl test ${FUNCTION}")
|
||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Performing Curl Test ${CURL_TEST} failed with the following output:\n"
|
||||
"${OUTPUT}\n")
|
||||
ENDIF(${CURL_TEST})
|
||||
ENDIF("${CURL_TEST}" MATCHES "^${CURL_TEST}$")
|
||||
ENDMACRO(CURL_INTERNAL_TEST)
|
||||
|
||||
MACRO(CURL_INTERNAL_TEST_RUN CURL_TEST)
|
||||
IF("${CURL_TEST}_COMPILE" MATCHES "^${CURL_TEST}_COMPILE$")
|
||||
SET(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||
"-D${CURL_TEST} ${CMAKE_REQUIRED_FLAGS}")
|
||||
IF(CMAKE_REQUIRED_LIBRARIES)
|
||||
SET(CURL_TEST_ADD_LIBRARIES
|
||||
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
|
||||
ENDIF(CMAKE_REQUIRED_LIBRARIES)
|
||||
|
||||
MESSAGE(STATUS "Performing Curl Test ${CURL_TEST}")
|
||||
TRY_RUN(${CURL_TEST} ${CURL_TEST}_COMPILE
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMake/CurlTests.c
|
||||
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
|
||||
"${CURL_TEST_ADD_LIBRARIES}"
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
IF(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST})
|
||||
SET(${CURL_TEST} 1 CACHE INTERNAL "Curl test ${FUNCTION}")
|
||||
MESSAGE(STATUS "Performing Curl Test ${CURL_TEST} - Success")
|
||||
ELSE(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST})
|
||||
MESSAGE(STATUS "Performing Curl Test ${CURL_TEST} - Failed")
|
||||
SET(${CURL_TEST} "" CACHE INTERNAL "Curl test ${FUNCTION}")
|
||||
FILE(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
|
||||
"Performing Curl Test ${CURL_TEST} failed with the following output:\n"
|
||||
"${OUTPUT}")
|
||||
IF(${CURL_TEST}_COMPILE)
|
||||
FILE(APPEND
|
||||
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
|
||||
"There was a problem running this test\n")
|
||||
ENDIF(${CURL_TEST}_COMPILE)
|
||||
FILE(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
|
||||
"\n\n")
|
||||
ENDIF(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST})
|
||||
ENDIF("${CURL_TEST}_COMPILE" MATCHES "^${CURL_TEST}_COMPILE$")
|
||||
ENDMACRO(CURL_INTERNAL_TEST_RUN)
|
||||
|
||||
# Do curl specific tests
|
||||
FOREACH(CURL_TEST
|
||||
HAVE_FCNTL_O_NONBLOCK
|
||||
HAVE_IOCTLSOCKET
|
||||
HAVE_IOCTLSOCKET_CAMEL
|
||||
HAVE_IOCTLSOCKET_CAMEL_FIONBIO
|
||||
HAVE_IOCTLSOCKET_FIONBIO
|
||||
HAVE_IOCTL_FIONBIO
|
||||
HAVE_IOCTL_SIOCGIFADDR
|
||||
HAVE_SETSOCKOPT_SO_NONBLOCK
|
||||
HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
|
||||
TIME_WITH_SYS_TIME
|
||||
HAVE_O_NONBLOCK
|
||||
HAVE_GETHOSTBYADDR_R_5
|
||||
HAVE_GETHOSTBYADDR_R_7
|
||||
HAVE_GETHOSTBYADDR_R_8
|
||||
HAVE_GETHOSTBYADDR_R_5_REENTRANT
|
||||
HAVE_GETHOSTBYADDR_R_7_REENTRANT
|
||||
HAVE_GETHOSTBYADDR_R_8_REENTRANT
|
||||
HAVE_GETHOSTBYNAME_R_3
|
||||
HAVE_GETHOSTBYNAME_R_5
|
||||
HAVE_GETHOSTBYNAME_R_6
|
||||
HAVE_GETHOSTBYNAME_R_3_REENTRANT
|
||||
HAVE_GETHOSTBYNAME_R_5_REENTRANT
|
||||
HAVE_GETHOSTBYNAME_R_6_REENTRANT
|
||||
HAVE_SOCKLEN_T
|
||||
HAVE_IN_ADDR_T
|
||||
HAVE_BOOL_T
|
||||
STDC_HEADERS
|
||||
RETSIGTYPE_TEST
|
||||
HAVE_INET_NTOA_R_DECL
|
||||
HAVE_INET_NTOA_R_DECL_REENTRANT
|
||||
HAVE_GETADDRINFO
|
||||
HAVE_FILE_OFFSET_BITS
|
||||
)
|
||||
CURL_INTERNAL_TEST(${CURL_TEST})
|
||||
ENDFOREACH(CURL_TEST)
|
||||
IF(HAVE_FILE_OFFSET_BITS)
|
||||
SET(_FILE_OFFSET_BITS 64)
|
||||
ENDIF(HAVE_FILE_OFFSET_BITS)
|
||||
|
||||
FOREACH(CURL_TEST
|
||||
HAVE_GLIBC_STRERROR_R
|
||||
HAVE_POSIX_STRERROR_R
|
||||
)
|
||||
CURL_INTERNAL_TEST_RUN(${CURL_TEST})
|
||||
ENDFOREACH(CURL_TEST)
|
||||
|
||||
# Check for reentrant
|
||||
FOREACH(CURL_TEST
|
||||
HAVE_GETHOSTBYADDR_R_5
|
||||
HAVE_GETHOSTBYADDR_R_7
|
||||
HAVE_GETHOSTBYADDR_R_8
|
||||
HAVE_GETHOSTBYNAME_R_3
|
||||
HAVE_GETHOSTBYNAME_R_5
|
||||
HAVE_GETHOSTBYNAME_R_6
|
||||
HAVE_INET_NTOA_R_DECL_REENTRANT)
|
||||
IF(NOT ${CURL_TEST})
|
||||
IF(${CURL_TEST}_REENTRANT)
|
||||
SET(NEED_REENTRANT 1)
|
||||
ENDIF(${CURL_TEST}_REENTRANT)
|
||||
ENDIF(NOT ${CURL_TEST})
|
||||
ENDFOREACH(CURL_TEST)
|
||||
|
||||
IF(NEED_REENTRANT)
|
||||
FOREACH(CURL_TEST
|
||||
HAVE_GETHOSTBYADDR_R_5
|
||||
HAVE_GETHOSTBYADDR_R_7
|
||||
HAVE_GETHOSTBYADDR_R_8
|
||||
HAVE_GETHOSTBYNAME_R_3
|
||||
HAVE_GETHOSTBYNAME_R_5
|
||||
HAVE_GETHOSTBYNAME_R_6)
|
||||
SET(${CURL_TEST} 0)
|
||||
IF(${CURL_TEST}_REENTRANT)
|
||||
SET(${CURL_TEST} 1)
|
||||
ENDIF(${CURL_TEST}_REENTRANT)
|
||||
ENDFOREACH(CURL_TEST)
|
||||
ENDIF(NEED_REENTRANT)
|
||||
|
||||
IF(HAVE_INET_NTOA_R_DECL_REENTRANT)
|
||||
SET(HAVE_INET_NTOA_R_DECL 1)
|
||||
SET(NEED_REENTRANT 1)
|
||||
ENDIF(HAVE_INET_NTOA_R_DECL_REENTRANT)
|
||||
|
||||
# Some other minor tests
|
||||
|
||||
IF(NOT HAVE_IN_ADDR_T)
|
||||
SET(in_addr_t "unsigned long")
|
||||
ENDIF(NOT HAVE_IN_ADDR_T)
|
||||
|
||||
# Fix libz / zlib.h
|
||||
|
||||
IF(NOT CURL_SPECIAL_LIBZ)
|
||||
IF(NOT HAVE_LIBZ)
|
||||
SET(HAVE_ZLIB_H 0)
|
||||
ENDIF(NOT HAVE_LIBZ)
|
||||
|
||||
IF(NOT HAVE_ZLIB_H)
|
||||
SET(HAVE_LIBZ 0)
|
||||
ENDIF(NOT HAVE_ZLIB_H)
|
||||
ENDIF(NOT CURL_SPECIAL_LIBZ)
|
||||
|
||||
IF(_FILE_OFFSET_BITS)
|
||||
SET(_FILE_OFFSET_BITS 64)
|
||||
ENDIF(_FILE_OFFSET_BITS)
|
||||
SET(CMAKE_REQUIRED_FLAGS "-D_FILE_OFFSET_BITS=64")
|
||||
SET(CMAKE_EXTRA_INCLUDE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/curl/curl.h")
|
||||
CHECK_TYPE_SIZE("curl_off_t" SIZEOF_CURL_OFF_T)
|
||||
SET(CMAKE_EXTRA_INCLUDE_FILES)
|
||||
SET(CMAKE_REQUIRED_FLAGS)
|
||||
|
||||
|
||||
# Check for nonblocking
|
||||
SET(HAVE_DISABLED_NONBLOCKING 1)
|
||||
IF(HAVE_FIONBIO OR
|
||||
HAVE_IOCTLSOCKET OR
|
||||
HAVE_IOCTLSOCKET_CASE OR
|
||||
HAVE_O_NONBLOCK)
|
||||
SET(HAVE_DISABLED_NONBLOCKING)
|
||||
ENDIF(HAVE_FIONBIO OR
|
||||
HAVE_IOCTLSOCKET OR
|
||||
HAVE_IOCTLSOCKET_CASE OR
|
||||
HAVE_O_NONBLOCK)
|
||||
|
||||
IF(RETSIGTYPE_TEST)
|
||||
SET(RETSIGTYPE void)
|
||||
ELSE(RETSIGTYPE_TEST)
|
||||
SET(RETSIGTYPE int)
|
||||
ENDIF(RETSIGTYPE_TEST)
|
||||
|
||||
IF(CMAKE_COMPILER_IS_GNUCC AND APPLE)
|
||||
INCLUDE(CheckCCompilerFlag)
|
||||
CHECK_C_COMPILER_FLAG(-Wno-long-double HAVE_C_FLAG_Wno_long_double)
|
||||
IF(HAVE_C_FLAG_Wno_long_double)
|
||||
# The Mac version of GCC warns about use of long double. Disable it.
|
||||
GET_SOURCE_FILE_PROPERTY(MPRINTF_COMPILE_FLAGS mprintf.c COMPILE_FLAGS)
|
||||
IF(MPRINTF_COMPILE_FLAGS)
|
||||
SET(MPRINTF_COMPILE_FLAGS "${MPRINTF_COMPILE_FLAGS} -Wno-long-double")
|
||||
ELSE(MPRINTF_COMPILE_FLAGS)
|
||||
SET(MPRINTF_COMPILE_FLAGS "-Wno-long-double")
|
||||
ENDIF(MPRINTF_COMPILE_FLAGS)
|
||||
SET_SOURCE_FILES_PROPERTIES(mprintf.c PROPERTIES
|
||||
COMPILE_FLAGS ${MPRINTF_COMPILE_FLAGS})
|
||||
ENDIF(HAVE_C_FLAG_Wno_long_double)
|
||||
ENDIF(CMAKE_COMPILER_IS_GNUCC AND APPLE)
|
||||
|
||||
INCLUDE(CMake/OtherTests.cmake)
|
||||
|
||||
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
|
||||
|
||||
# For windows, do not allow the compiler to use default target (Vista).
|
||||
IF(WIN32)
|
||||
ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501)
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF(MSVC)
|
||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
ENDIF(MSVC)
|
||||
|
||||
# Sets up the dependencies (zlib, OpenSSL, etc.) of a cURL subproject according to options.
|
||||
# TODO This is far to be complete!
|
||||
FUNCTION(SETUP_CURL_DEPENDENCIES TARGET_NAME)
|
||||
IF(CURL_ZLIB AND ZLIB_FOUND)
|
||||
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
IF(CURL_ZLIB AND ZLIB_FOUND)
|
||||
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${ZLIB_LIBRARIES})
|
||||
#ADD_DEFINITIONS( -DHAVE_ZLIB_H -DHAVE_ZLIB -DHAVE_LIBZ )
|
||||
ENDIF()
|
||||
|
||||
IF(CMAKE_USE_OPENSSL AND OPENSSL_FOUND)
|
||||
INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
|
||||
ENDIF()
|
||||
IF(CURL_SSL AND CURL_CONFIG_HAS_BEEN_RUN_BEFORE)
|
||||
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${OPENSSL_LIBRARIES})
|
||||
#ADD_DEFINITIONS( -DUSE_SSLEAY )
|
||||
ENDIF()
|
||||
ENDFUNCTION()
|
||||
|
||||
# Ugly (but functional) way to include "Makefile.inc" by transforming it (= regenerate it).
|
||||
FUNCTION(TRANSFORM_MAKEFILE_INC INPUT_FILE OUTPUT_FILE)
|
||||
FILE(READ ${INPUT_FILE} MAKEFILE_INC_TEXT)
|
||||
STRING(REPLACE "$(top_srcdir)" "\${CURL_SOURCE_DIR}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||
STRING(REPLACE "$(top_builddir)" "\${CURL_BINARY_DIR}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||
|
||||
STRING(REGEX REPLACE "\\\\\n" "<22>!<21>" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||
STRING(REGEX REPLACE "([a-zA-Z_][a-zA-Z0-9_]*)[\t ]*=[\t ]*([^\n]*\n)" "SET(\\1 \\2)\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||
STRING(REPLACE "<22>!<21>" "\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||
|
||||
STRING(REGEX REPLACE "\\$\\(([a-zA-Z_][a-zA-Z0-9_]*)\\)" "\${\\1}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace $() with ${}
|
||||
STRING(REGEX REPLACE "@([a-zA-Z_][a-zA-Z0-9_]*)@" "\${\\1}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace @@ with ${}, even if that may not be read by CMake scripts.
|
||||
FILE(WRITE ${OUTPUT_FILE} ${MAKEFILE_INC_TEXT})
|
||||
|
||||
### BUGGY METHOD 1
|
||||
# FILE(STRINGS Makefile.inc MAKEFILE_INC_TEXT)
|
||||
# STRING(REPLACE "# ./lib/Makefile.inc" "" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||
# STRING(REPLACE " " " " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace tabs with spaces
|
||||
|
||||
# #STRING(REGEX MATCH "CSOURCES *=" AAA ${MAKEFILE_INC_TEXT})
|
||||
# #MESSAGE(STATUS ${AAA})
|
||||
|
||||
# STRING(REPLACE "CSOURCES =" "" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||
# STRING(REPLACE "HHEADERS =" "" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||
|
||||
# STRING(REGEX REPLACE "[^ ]+\\.c" "" ${HEADERS_VAR} ${MAKEFILE_INC_TEXT}) # Remove source files and store into headers var
|
||||
# STRING(REGEX REPLACE " +" " " ${HEADERS_VAR} ${${HEADERS_VAR}})
|
||||
# STRING(REGEX REPLACE " " ";" ${HEADERS_VAR} ${${HEADERS_VAR}})
|
||||
|
||||
# STRING(REGEX REPLACE "[^ ]+\\.h" "" ${SOURCES_VAR} ${MAKEFILE_INC_TEXT}) # Remove headers and store into source files var
|
||||
# STRING(REGEX REPLACE " +" " " ${SOURCES_VAR} ${${SOURCES_VAR}})
|
||||
# STRING(REGEX REPLACE " " ";" ${SOURCES_VAR} ${${SOURCES_VAR}})
|
||||
|
||||
# SET(${HEADERS_VAR} ${${HEADERS_VAR}} PARENT_SCOPE)
|
||||
# SET(${SOURCES_VAR} ${${SOURCES_VAR}} PARENT_SCOPE)
|
||||
|
||||
### BUGGY METHOD 2
|
||||
# FILE(READ Makefile.inc MAKEFILE_INC_TEXT)
|
||||
# #STRING(REPLACE "\t" " " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace tabs with spaces
|
||||
# #STRING(REGEX REPLACE "\n+" "\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Remove empty lines (allow a simplification in the script)
|
||||
# STRING(REGEX REPLACE "([A-Z]+)[\t ]*=[\t ]*" "SET(\\1 " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||
# #STRING(REGEX REPLACE "^(.*)[\t ]*[^\\]$" ")" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||
# STRING(REGEX REPLACE "([^\\])\n" "\\1)\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||
# # STRING(REGEX REPLACE "CSOURCES *=" "SET(libCurl_SRCS " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||
# # STRING(REGEX REPLACE "HHEADERS *=" "SET(libCurl_HEADERS " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||
# FILE(WRITE Makefile.inc.cmake ${MAKEFILE_INC_TEXT})
|
||||
ENDFUNCTION()
|
||||
|
||||
ADD_SUBDIRECTORY(lib)
|
||||
IF(BUILD_CURL_EXE)
|
||||
ADD_SUBDIRECTORY(src)
|
||||
ENDIF()
|
||||
IF(BUILD_CURL_TESTS)
|
||||
ADD_SUBDIRECTORY(tests)
|
||||
ENDIF()
|
||||
|
||||
# This needs to be run very last so other parts of the scripts can take advantage of this.
|
||||
IF(NOT CURL_CONFIG_HAS_BEEN_RUN_BEFORE)
|
||||
SET(CURL_CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before")
|
||||
ENDIF()
|
2
COPYING
2
COPYING
@@ -1,6 +1,6 @@
|
||||
COPYRIGHT AND PERMISSION NOTICE
|
||||
|
||||
Copyright (c) 1996 - 2008, Daniel Stenberg, <daniel@haxx.se>.
|
||||
Copyright (c) 1996 - 2009, Daniel Stenberg, <daniel@haxx.se>.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
13
CTestConfig.cmake
Normal file
13
CTestConfig.cmake
Normal file
@@ -0,0 +1,13 @@
|
||||
## This file should be placed in the root directory of your project.
|
||||
## Then modify the CMakeLists.txt file in the root directory of your
|
||||
## project to incorporate the testing dashboard.
|
||||
## # The following are required to uses Dart and the Cdash dashboard
|
||||
## ENABLE_TESTING()
|
||||
## INCLUDE(Dart)
|
||||
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_CDASH TRUE)
|
78
MacOSX-Framework
Executable file
78
MacOSX-Framework
Executable file
@@ -0,0 +1,78 @@
|
||||
#!/bin/bash
|
||||
# This script performs all of the steps needed to build a
|
||||
# universal binary libcurl.framework for Mac OS X 10.4 or greater.
|
||||
|
||||
VERSION=`/usr/bin/sed -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' include/curl/curlver.h`
|
||||
|
||||
SDK32='/Developer/SDKs/MacOSX10.4u.sdk'
|
||||
|
||||
MINVER32='-mmacosx-version-min=10.4'
|
||||
|
||||
ARCHES32='-arch ppc -arch i386'
|
||||
|
||||
SDK64='/Developer/SDKs/MacOSX10.5.sdk'
|
||||
|
||||
MINVER64='-mmacosx-version-min=10.5'
|
||||
|
||||
ARCHES64='-arch ppc64 -arch x86_64'
|
||||
|
||||
if test -d $SDK32; then
|
||||
echo "----Configuring libcurl for 32 bit universal framework..."
|
||||
./configure --disable-dependency-tracking --disable-static --with-gssapi \
|
||||
CFLAGS="-Os -isysroot $SDK32 $ARCHES32 $MINVER32" \
|
||||
LDFLAGS="-Wl,-syslibroot,$SDK32 $ARCHES32 $MINVER32 -Wl,-headerpad_max_install_names" \
|
||||
CC=$CC
|
||||
|
||||
echo "----Building 32 bit libcurl..."
|
||||
make
|
||||
|
||||
echo "----Creating 32 bit framework..."
|
||||
rm -r libcurl.framework
|
||||
mkdir -p libcurl.framework/Versions/A/Resources
|
||||
cp lib/.libs/libcurl.dylib libcurl.framework/Versions/A/libcurl
|
||||
install_name_tool -id @executable_path/../Frameworks/libcurl.framework/Versions/A/libcurl libcurl.framework/Versions/A/libcurl
|
||||
/usr/bin/sed -e "s/7\.12\.3/$VERSION/" lib/libcurl.plist >libcurl.framework/Versions/A/Resources/Info.plist
|
||||
mkdir -p libcurl.framework/Versions/A/Headers/curl
|
||||
cp include/curl/*.h libcurl.framework/Versions/A/Headers/curl
|
||||
pushd libcurl.framework
|
||||
ln -fs Versions/A/libcurl libcurl
|
||||
ln -fs Versions/A/Resources Resources
|
||||
ln -fs Versions/A/Headers Headers
|
||||
cd Versions
|
||||
ln -fs A Current
|
||||
|
||||
if test -d $SDK64; then
|
||||
popd
|
||||
make clean
|
||||
echo "----Configuring libcurl for 64 bit universal framework..."
|
||||
./configure --disable-dependency-tracking --disable-static --with-gssapi \
|
||||
CFLAGS="-Os -isysroot $SDK64 $ARCHES64 $MINVER64" \
|
||||
LDFLAGS="-Wl,-syslibroot,$SDK64 $ARCHES64 $MINVER64 -Wl,-headerpad_max_install_names" \
|
||||
CC=$CC
|
||||
|
||||
echo "----Building 64 bit libcurl..."
|
||||
make
|
||||
|
||||
echo "----Appending 64 bit framework to 32 bit framework..."
|
||||
cp lib/.libs/libcurl.dylib libcurl.framework/Versions/A/libcurl64
|
||||
install_name_tool -id @executable_path/../Frameworks/libcurl.framework/Versions/A/libcurl libcurl.framework/Versions/A/libcurl64
|
||||
cp libcurl.framework/Versions/A/libcurl libcurl.framework/Versions/A/libcurl32
|
||||
lipo libcurl.framework/Versions/A/libcurl32 libcurl.framework/Versions/A/libcurl64 -create -output libcurl.framework/Versions/A/libcurl
|
||||
rm libcurl.framework/Versions/A/libcurl32 libcurl.framework/Versions/A/libcurl64
|
||||
cp libcurl.framework/Versions/A/Headers/curl/curlbuild.h libcurl.framework/Versions/A/Headers/curl/curlbuild32.h
|
||||
cp include/curl/curlbuild.h libcurl.framework/Versions/A/Headers/curl/curlbuild64.h
|
||||
cat >libcurl.framework/Versions/A/Headers/curl/curlbuild.h <<EOF
|
||||
#ifdef __LP64__
|
||||
#include "curl/curlbuild64.h"
|
||||
#else
|
||||
#include "curl/curlbuild32.h"
|
||||
#endif
|
||||
EOF
|
||||
fi
|
||||
|
||||
lipo -info libcurl.framework/Versions/A/libcurl
|
||||
echo "libcurl.framework is built and can now be included in other projects."
|
||||
echo "Copy libcurl.framework to your bundle's Contents/Frameworks folder, ~/Library/Frameworks or /Library/Frameworks."
|
||||
else
|
||||
echo "Building libcurl.framework requires Mac OS X 10.4 or later with the MacOSX10.4u SDK installed."
|
||||
fi
|
20
Makefile.am
20
Makefile.am
@@ -5,7 +5,7 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
@@ -25,9 +25,15 @@ AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
EXTRA_DIST = CHANGES COPYING maketgz reconf Makefile.dist curl-config.in \
|
||||
curl-style.el sample.emacs RELEASE-NOTES buildconf buildconf.bat \
|
||||
libcurl.pc.in vc6curl.dsw
|
||||
CMAKE_DIST = CMakeLists.txt CMake/CheckTypeSize.c.in CMake/CheckTypeSize.cmake \
|
||||
CMake/CMakeConfigurableFile.in CMake/CurlCheckCSourceCompiles.cmake \
|
||||
CMake/CurlCheckCSourceRuns.cmake CMake/CurlTests.c CMake/FindOpenSSL.cmake \
|
||||
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)
|
||||
|
||||
bin_SCRIPTS = curl-config
|
||||
|
||||
@@ -77,6 +83,10 @@ endif
|
||||
examples:
|
||||
@(cd docs/examples; $(MAKE) check)
|
||||
|
||||
clean-local:
|
||||
@(cd tests; $(MAKE) clean)
|
||||
@(cd docs; $(MAKE) clean)
|
||||
|
||||
#
|
||||
# Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros
|
||||
# must contain the following line:
|
||||
@@ -105,7 +115,7 @@ rpm:
|
||||
mv $$RPM_TOPDIR/SRPMS/$(RPMDIST)-*.src.rpm .
|
||||
|
||||
#
|
||||
# Build a Solaris pkkgadd format file
|
||||
# Build a Solaris pkgadd format file
|
||||
# run 'make pkgadd' once you've done './configure' and 'make' to make a Solaris pkgadd format
|
||||
# file (which ends up back in this directory).
|
||||
# The pkgadd file is in 'pkgtrans' format, so to install on Solaris, do
|
||||
|
@@ -5,7 +5,7 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
@@ -256,11 +256,18 @@ linux: all
|
||||
|
||||
linux-ssl: ssl
|
||||
|
||||
|
||||
vc8:
|
||||
@echo "generate VC8 makefiles"
|
||||
@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
|
||||
@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"
|
||||
@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
|
||||
@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
|
||||
@echo "generate a fresh ca-bundle.crt"
|
||||
@perl $< -b -l -u lib/ca-bundle.crt
|
||||
|
119
RELEASE-NOTES
119
RELEASE-NOTES
@@ -1,88 +1,67 @@
|
||||
Curl and libcurl 7.19.0
|
||||
Curl and libcurl 7.19.5
|
||||
|
||||
Public curl releases: 106
|
||||
Command line options: 127
|
||||
curl_easy_setopt() options: 153
|
||||
Public curl releases: 111
|
||||
Command line options: 132
|
||||
curl_easy_setopt() options: 163
|
||||
Public functions in libcurl: 58
|
||||
Known libcurl bindings: 36
|
||||
Contributors: 654
|
||||
Known libcurl bindings: 38
|
||||
Contributors: 715
|
||||
|
||||
This release includes the following changes:
|
||||
|
||||
o curl_off_t gets its size/typedef somewhat differently than before. This _may_
|
||||
cause an ABI change for you. See lib/README.curl_off_t for a full explanation.
|
||||
|
||||
o Added CURLINFO_PRIMARY_IP
|
||||
o Added CURLOPT_CRLFILE and CURLE_SSL_CRL_BADFILE
|
||||
o Added CURLOPT_ISSUERCERT and CURLE_SSL_ISSUER_ERROR
|
||||
o curl's option parser for boolean options reworked
|
||||
o Added --remote-name-all
|
||||
o Now builds for the INTEGRITY operating system
|
||||
o Added CURLINFO_APPCONNECT_TIME
|
||||
o Added test selection by key word in runtests.pl
|
||||
o the curl tool's -w option support the %{ssl_verify_result} variable
|
||||
o Added CURLOPT_ADDRESS_SCOPE and scope parsing of the URL according to RFC4007
|
||||
o Support --append on SFTP uploads (not with OpenSSH, though)
|
||||
o Added curlbuild.h and curlrules.h to the external library interface
|
||||
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
|
||||
|
||||
This release includes the following bugfixes:
|
||||
|
||||
o Fixed curl-config --ca
|
||||
o Fixed the multi interface connection re-use with NSS-built libcurl
|
||||
o connection re-use when using the multi interface with pipelining enabled
|
||||
o curl_multi_socket() socket callback fix for close/re-create sockets case
|
||||
o SCP or SFTP over socks proxy crashed
|
||||
o RC4-MD5 cipher now works with NSS-built libcurl
|
||||
o range requests with --head are now done correctly
|
||||
o fallback to gettimeofday when monotonic clock is unavailable at run-time
|
||||
o range numbers could be made to wrongly get output as signed
|
||||
o unexpected 1xx responses hung transfers
|
||||
o FTP transfers segfault when using different CURLOPT_FTP_FILEMETHOD
|
||||
o c-ares powered libcurls can resolve/use IPv6 addresses
|
||||
o poll not working on Windows Vista due to POLLPRI being incorrectly used
|
||||
o user-agent in CONNECT with non-HTTP protocols
|
||||
o CURL_READFUNC_PAUSE problems fixed
|
||||
o --use-ascii now works on Symbian OS, MS-DOS and OS/2
|
||||
o CURLINFO_SSL_VERIFYRESULT is fixed
|
||||
o FTP URLs and IPv6 URLs mangled when sent to proxy with CURLOPT_PORT set
|
||||
o a user name in a proxy URL without a password was parsed incorrectly
|
||||
o library will now be built with _REENTRANT symbol defined only if needed
|
||||
o no longer link with gdi32 on Windows cross-compiled targets
|
||||
o HTTP PUT with -C - sent bad Content-Range: header
|
||||
o HTTP PUT or POST with redirect could lead to hang
|
||||
o re-use of connections with failed SSL connects in the multi interface
|
||||
o NTLM over proxy state was wrongly cleared when host connection was closed
|
||||
o Windows SSPI DLL loading is now done in curl_global_init()
|
||||
o runtests.pl has an improved find-stunnel-and-invoke
|
||||
o FTP sessions could go out of sync on a long header boundary condition
|
||||
o potential buffer overflows in the MS-DOS command-line port fixed
|
||||
o --stderr is now honoured with the -v option
|
||||
o memory leak in libcurl on Windows built with OpenSSL
|
||||
o improved curl_m*printf() integral data type size and signedness handling
|
||||
o error when --dump-header - used with more than one URL
|
||||
o proxy closing connect during CONNECT with auth with the multi interface
|
||||
o CURLOPT_UPLOAD sets HTTP method back to GET or HEAD when passed in a 0
|
||||
o shared cookies could get locked twice
|
||||
o deal with closed connection while doing POST/PUT
|
||||
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
|
||||
|
||||
This release includes the following known bugs:
|
||||
|
||||
o see docs/KNOWN_BUGS (http://curl.haxx.se/docs/knownbugs.html)
|
||||
|
||||
Other curl-related news:
|
||||
|
||||
o
|
||||
|
||||
This release would not have looked like this without help, code, reports and
|
||||
advice from friends like these:
|
||||
|
||||
Lenny Rachitsky, Axel Tillequin, Arnaud Ebalard, Yang Tse, Dan Fandrich,
|
||||
Rob Crittenden, Dengminwen, Christopher Palow, Hans-Jurgen May,
|
||||
Phil Pellouchoud, Eduard Bloch, John Lightsey, Stephen Collyer, Tor Arntsen,
|
||||
Rolland Dudemaine, Phil Blundell, Scott Barrett, Andreas Schuldei,
|
||||
Peter Lamberg, David Bau, Pramod Sharma, Yehoshua Hershberg,
|
||||
Constantine Sapuntzakis, Lars Nilsson, Andy Tsouladze, Jamie Lokier,
|
||||
Vincent Le Normand
|
||||
|
||||
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
|
||||
|
||||
Thanks! (and sorry if I forgot to mention someone)
|
||||
|
29
TODO-RELEASE
29
TODO-RELEASE
@@ -1,26 +1,9 @@
|
||||
To be addressed before 7.19.0 (planned release: August 2008)
|
||||
=============================
|
||||
To be addressed in 7.19.6 (planned release: July 2009)
|
||||
=========================
|
||||
|
||||
226 - Active Mode FTPS Data Port Range
|
||||
|
||||
To be addressed before 7.19.1 (planned release: October 2008)
|
||||
=============================
|
||||
235 - KNOWN_BUG #65
|
||||
Code adjustment for FTP over socks proxy remains
|
||||
|
||||
157 - the CERTINFO patch as posted to:
|
||||
http://curl.haxx.se/mail/lib-2008-08/0105.html
|
||||
|
||||
158 - Martin Drasar's CURLOPT_POSTREDIR work:
|
||||
http://curl.haxx.se/mail/lib-2008-08/0170.html
|
||||
|
||||
162 - Craig Perras' note "http upload: how to stop on error"
|
||||
http://curl.haxx.se/mail/archive-2008-08/0138.html
|
||||
|
||||
163 - Detecting illegal attempts at chunked transfers on HTTP 1.0
|
||||
(tests 1069, 1072, 1073)
|
||||
http://curl.haxx.se/mail/archive-2008-08/0435.html
|
||||
|
||||
164 - Automatic downgrading to HTTP 1.0 (tests 1071 through 1074)
|
||||
|
||||
165 - "Problem with CURLOPT_RESUME_FROM and CURLOPT_APPEND" by Daniele Pinau,
|
||||
recipe: http://curl.haxx.se/mail/lib-2008-08/0439.html
|
||||
|
||||
166 -
|
||||
240 -
|
||||
|
1416
acinclude.m4
1416
acinclude.m4
File diff suppressed because it is too large
Load Diff
@@ -1,24 +1,26 @@
|
||||
configure
|
||||
autom4te.cache
|
||||
*.lo
|
||||
.deps
|
||||
.libs
|
||||
Makefile
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
adig
|
||||
ahost
|
||||
config.log
|
||||
config.status
|
||||
aclocal.m4
|
||||
.deps
|
||||
Makefile.in
|
||||
ares_build.h
|
||||
ares_version.h.dist
|
||||
autom4te.cache
|
||||
config.guess
|
||||
config.h
|
||||
config.h.in
|
||||
config.log
|
||||
config.lt
|
||||
config.status
|
||||
config.sub
|
||||
libtool
|
||||
ltmain.sh
|
||||
stamp-h1
|
||||
*.lo
|
||||
.libs
|
||||
configure
|
||||
depcomp
|
||||
libcares.la
|
||||
missing
|
||||
ares_version.h.dist
|
||||
libcares.pc
|
||||
libtool
|
||||
ltmain.sh
|
||||
missing
|
||||
stamp-h*
|
||||
|
145
ares/CHANGES
145
ares/CHANGES
@@ -1,5 +1,150 @@
|
||||
Changelog for the c-ares project
|
||||
|
||||
* 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 2 2009 (Yang Tse)
|
||||
- Use a build-time configured ares_socklen_t data type instead of socklen_t.
|
||||
|
||||
* April 21 2009 (Yang Tse)
|
||||
- Moved potential inclusion of system's malloc.h and memory.h header files to
|
||||
setup_once.h. Inclusion of each header file is based on the definition of
|
||||
NEED_MALLOC_H and NEED_MEMORY_H respectively.
|
||||
|
||||
* March 11 2009 (Yang Tse)
|
||||
- Japheth Cleaver fixed acountry.c replacing u_long with unsigned long.
|
||||
|
||||
* February 20 2009 (Yang Tse)
|
||||
- Do not halt compilation when using VS2008 to build a Windows 2000 target.
|
||||
|
||||
* February 3 2009 (Phil Blundell)
|
||||
- If the server returns garbage or nothing at all in response to an AAAA query,
|
||||
go on and ask for A records anyway.
|
||||
|
||||
* January 31 2009 (Daniel Stenberg)
|
||||
- ares_gethostbyname() now accepts 'AF_UNSPEC' as a family for resolving
|
||||
either AF_INET6 or AF_INET. It works by accepting any of the looksups in the
|
||||
hosts file, and it resolves the AAAA field with a fallback to A.
|
||||
|
||||
* January 14 2009 (Daniel Stenberg)
|
||||
- ares.h no longer uses the HAVE_STRUCT_IN6_ADDR define check, but instead it
|
||||
now declares the private struct ares_in6_addr for all systems instead of
|
||||
relying on one possibly not present in the system.
|
||||
|
||||
* January 13 2009 (Phil Blundell)
|
||||
- ares__send_query() now varies the retry timeout pseudo-randomly to avoid
|
||||
packet storms when several queries were started at the same time.
|
||||
|
||||
* January 11 2009 (Daniel Stenberg)
|
||||
- Phil Blundell added the internal function ares__expand_name_for_response()
|
||||
that is now used by the ares_parse_*_reply() functions instead of the
|
||||
ares_expand_name() simply to easier return ARES_EBADRESP for the cases where
|
||||
the name expansion fails as in responses that really isn't expected.
|
||||
|
||||
Version 1.6.0 (Dec 9, 2008)
|
||||
|
||||
* December 9 2008 (Gisle Vanem)
|
||||
|
||||
Fixes for Win32 targets using the Watt-32 tcp/ip stack.
|
||||
|
||||
* Dec 4 2008 (Daniel Stenberg)
|
||||
|
||||
Gregor Jasny provided the patch that introduces ares_set_socket_callback(),
|
||||
and I edited it to also get duped by ares_dup().
|
||||
|
||||
* Dec 3 2008 (Daniel Stenberg)
|
||||
|
||||
API changes:
|
||||
|
||||
I made sure the public ares_config struct looks like before and yet it
|
||||
supports the ROTATE option thanks to c-ares now storing the "optmask"
|
||||
internally. Thus we should be ABI compatible with the past release(s)
|
||||
now. My efforts mentioned below should not break backwards ABI compliance.
|
||||
|
||||
Here's how I suggest we proceed with the API:
|
||||
|
||||
ares_init() will be primary "channel creator" function.
|
||||
|
||||
ares_init_options() will continue to work exactly like now and before. For
|
||||
starters, it will be the (only) way to set the existing options.
|
||||
|
||||
ares_save_options() will continue to work like today, but will ONLY save
|
||||
options that you can set today (including ARES_OPT_ROTATE actually) but new
|
||||
options that we add may not be saved with this.
|
||||
|
||||
Instead we introduce:
|
||||
|
||||
ares_dup() that instead can make a new channel and clone the config used
|
||||
from an existing channel. It will then clone all config options, including
|
||||
future new things we add.
|
||||
|
||||
ares_set_*() style functions that set (new) config options. As a start we
|
||||
simply add these for new functionality, but over time we can also introduce
|
||||
them for existing "struct ares_options" so that we can eventually deprecate
|
||||
the two ares_*_options() functions.
|
||||
|
||||
ares_get_*() style functions for extracting info from a channel handle that
|
||||
should be used instead of ares_save_options().
|
||||
|
||||
* Nov 26 2008 (Yang Tse)
|
||||
- Brad Spencer provided changes to allow buildconf to work on OS X.
|
||||
|
||||
- Gerald Combs fixed a bug in ares_parse_ptr_reply() which would cause a
|
||||
buffer to shrink instead of expand if a reply contained 8 or more records.
|
||||
|
||||
* Nov 25 2008 (Yang Tse)
|
||||
- In preparation for the upcomming IPv6 nameservers patch, the internal
|
||||
ares_addr union is now changed into an internal struct which also holds
|
||||
the address family.
|
||||
|
||||
* Nov 19 2008 (Daniel Stenberg)
|
||||
- Brad Spencer brought the new function ares_gethostbyname_file() which simply
|
||||
resolves a host name from the given file, using the regular hosts syntax.
|
||||
|
||||
* Nov 1 2008 (Daniel Stenberg)
|
||||
- Carlo Contavalli added support for the glibc "rotate" option, as documented
|
||||
in man resolv.conf:
|
||||
|
||||
causes round robin selection of nameservers from among those listed. This
|
||||
has the effect of spreading the query load among all listed servers, rather
|
||||
than having all clients try the first listed server first every time.
|
||||
|
||||
You can enable it with ARES_OPT_ROTATE
|
||||
|
||||
* Oct 21 2008 (Yang Tse)
|
||||
Charles Hardin added handling of EINPROGRESS for UDP connects.
|
||||
|
||||
* Oct 18 2008 (Daniel Stenberg)
|
||||
Charles Hardin made adig support a regular numerical dotted IP address for the
|
||||
-s option as well.
|
||||
|
||||
* Oct 7 2008 (Yang Tse)
|
||||
- Added --enable-optimize configure option to enable and disable compiler
|
||||
optimizations to allow decoupled setting from --enable-debug.
|
||||
|
||||
* Oct 2 2008 (Yang Tse)
|
||||
- Added --enable-warnings configure option to enable and disable strict
|
||||
compiler warnings to allow decoupled setting from --enable-debug.
|
||||
|
||||
* Sep 17 2008 (Yang Tse)
|
||||
- Code reorganization to allow internal/private use of "nameser.h" to any
|
||||
system that lacks arpa/nameser.h or arpa/nameser_compat.h header files.
|
||||
|
||||
* Sep 16 2008 (Yang Tse)
|
||||
- Code reorganization to allow internal/private use of ares_writev to any
|
||||
system that lacks the writev function.
|
||||
|
||||
* Sep 15 2008 (Yang Tse)
|
||||
- Code reorganization to allow internal/private use of ares_strcasecmp to any
|
||||
system that lacks the strcasecmp function.
|
||||
|
||||
- Improve configure detection of some string functions.
|
||||
|
||||
* Sep 11 2008 (Yang Tse)
|
||||
- Code reorganization to allow internal/private use of ares_strdup to any
|
||||
system that lacks the strdup function.
|
||||
|
||||
Version 1.5.3 (Aug 29, 2008)
|
||||
|
||||
* Aug 25 2008 (Yang Tse)
|
||||
|
@@ -45,7 +45,10 @@ noinst_PROGRAMS =$(PROGS)
|
||||
# regular sources and headers
|
||||
EXTRA_DIST = AUTHORS CHANGES README.cares Makefile.inc Makefile.dj \
|
||||
Makefile.m32 Makefile.netware Makefile.vc6 $(man_MANS) $(MSVCFILES) \
|
||||
config-win32.h RELEASE-NOTES libcares.pc.in buildconf get_ver.awk maketgz
|
||||
config-win32.h RELEASE-NOTES libcares.pc.in buildconf get_ver.awk maketgz \
|
||||
TODO ares_build.h.in buildconf.bat
|
||||
|
||||
DISTCLEANFILES = ares_build.h
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libcares.pc
|
||||
@@ -84,8 +87,9 @@ if NO_UNDEFINED
|
||||
UNDEF = -no-undefined
|
||||
endif
|
||||
|
||||
EXPORT_SYMBOLS = -export-symbols-regex '^ares_[[:alnum:]].*'
|
||||
|
||||
libcares_la_LDFLAGS = $(UNDEF) $(VER)
|
||||
libcares_la_LDFLAGS = $(UNDEF) $(VER) $(EXPORT_SYMBOLS)
|
||||
|
||||
# Makefile.inc provides the CSOURCES and HHEADERS defines
|
||||
include Makefile.inc
|
||||
@@ -95,7 +99,8 @@ libcares_la_SOURCES = $(CSOURCES) $(HHEADERS)
|
||||
# where to install the c-ares headers
|
||||
libcares_ladir = $(includedir)
|
||||
# what headers to install on 'make install':
|
||||
libcares_la_HEADERS = ares.h ares_version.h ares_dns.h
|
||||
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)
|
||||
|
@@ -11,10 +11,10 @@ include ../packages/DOS/common.dj
|
||||
include Makefile.inc
|
||||
|
||||
CFLAGS += -DWATT32 -DHAVE_AF_INET6 -DHAVE_PF_INET6 -DHAVE_IOCTLSOCKET \
|
||||
-DHAVE_STRUCT_IN6_ADDR -DHAVE_SOCKADDR_IN6_SIN6_SCOPE_ID \
|
||||
-DHAVE_SYS_TIME_H -DHAVE_STRUCT_SOCKADDR_IN6 -DHAVE_STRUCT_ADDRINFO \
|
||||
-DHAVE_SIGNAL_H -DHAVE_SIG_ATOMIC_T -DRETSIGTYPE='void' \
|
||||
-DHAVE_PROCESS_H -DHAVE_ARPA_NAMESER_H -DHAVE_SYS_SOCKET_H \
|
||||
-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' \
|
||||
@@ -23,12 +23,14 @@ CFLAGS += -DWATT32 -DHAVE_AF_INET6 -DHAVE_PF_INET6 -DHAVE_IOCTLSOCKET \
|
||||
-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 -Dsocklen_t=int -UHAVE_CONFIG_H \
|
||||
-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
|
||||
-DRECVFROM_TYPE_ARG2_IS_VOID -DHAVE_STRDUP -DHAVE_NETDB_H \
|
||||
-DHAVE_STRCASECMP -DHAVE_STRNCASECMP -DHAVE_GETHOSTNAME \
|
||||
-DHAVE_LIMITS_H
|
||||
|
||||
LDFLAGS = -s
|
||||
|
||||
|
@@ -3,14 +3,16 @@ 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_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_parse_ns_reply.c ares_llist.c ares__timeval.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
|
||||
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
|
||||
|
||||
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 \
|
||||
@@ -18,5 +20,6 @@ MANPAGES= ares_destroy.3 ares_expand_name.3 ares_expand_string.3 ares_fds.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_destroy_options.3 ares_save_options.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
|
||||
|
@@ -40,7 +40,7 @@ tags:
|
||||
%.exe: %.o ares_getopt.o $(LIB)
|
||||
$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||
|
||||
$(OBJLIB): ares.h ares_dns.h ares_private.h
|
||||
$(OBJLIB): ares.h ares_dns.h ares_private.h ares_build.h ares_rules.h
|
||||
|
||||
.c.o:
|
||||
$(CC) $(CFLAGS) -c $<
|
||||
@@ -55,7 +55,8 @@ install:
|
||||
${RANLIB} ${DESTDIR}${libdir}/$(LIB)
|
||||
chmod u-w ${DESTDIR}${libdir}/$(LIB)
|
||||
${INSTALL} -m 444 ${srcdir}/ares.h ${DESTDIR}${includedir}
|
||||
${INSTALL} -m 444 ${srcdir}/ares_version.h ${DESTDIR}${includedir}
|
||||
${INSTALL} -m 444 ${srcdir}/ares_build.h ${DESTDIR}${includedir}
|
||||
${INSTALL} -m 444 ${srcdir}/ares_rules.h ${DESTDIR}${includedir}
|
||||
(for man in $(MANPAGES); do \
|
||||
${INSTALL} -m 444 ${srcdir}/$${man} ${DESTDIR}${mandir}/man3; \
|
||||
done)
|
||||
|
@@ -160,7 +160,7 @@ lib: prebuild $(LTARGET)
|
||||
|
||||
nlm: prebuild $(TARGETS)
|
||||
|
||||
prebuild: $(OBJDIR) $(OBJDIR)/version.inc config.h arpa/nameser.h
|
||||
prebuild: $(OBJDIR) ares_build.h $(OBJDIR)/version.inc config.h
|
||||
|
||||
install: $(INSTDIR) all
|
||||
@$(CP) *.nlm $(INSTDIR)
|
||||
@@ -282,6 +282,8 @@ config.h: Makefile.netware
|
||||
@echo $(DL)#define PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/"$(DL) >> $@
|
||||
ifeq ($(LIBARCH),CLIB)
|
||||
@echo $(DL)#define OS "i586-pc-clib-NetWare"$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRICMP 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRNICMP 1$(DL) >> $@
|
||||
@echo $(DL)#define NETDB_USE_INTERNET 1$(DL) >> $@
|
||||
@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
|
||||
@echo $(DL)#define RECV_TYPE_ARG2 char *$(DL) >> $@
|
||||
@@ -301,18 +303,13 @@ ifeq ($(LIBARCH),CLIB)
|
||||
@echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@
|
||||
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
|
||||
@echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@
|
||||
@echo $(DL)#define socklen_t int$(DL) >> $@
|
||||
@echo $(DL)#define strncasecmp strnicmp$(DL) >> $@
|
||||
@echo $(DL)#define strcasecmp stricmp$(DL) >> $@
|
||||
else
|
||||
@echo $(DL)#define OS "i586-pc-libc-NetWare"$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_DLOPEN 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_FTRUNCATE 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_INET_PTON 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@
|
||||
@@ -324,6 +321,9 @@ else
|
||||
@echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_AF_INET6 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_PF_INET6 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_FREEADDRINFO 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_GETADDRINFO 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRUCT_IN6_ADDR 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRUCT_SOCKADDR_IN6 1$(DL) >> $@
|
||||
@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
|
||||
@@ -348,17 +348,18 @@ else
|
||||
@echo $(DL)#define SIZEOF_STRUCT_IN6_ADDR 16$(DL) >> $@
|
||||
endif
|
||||
@echo $(DL)#define HAVE_ARPA_INET_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_ARPA_NAMESER_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_ERR_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_FIONBIO 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_GETHOSTBYADDR 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_GETHOSTBYNAME 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_GETHOSTNAME 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_GETPROTOBYNAME 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_GMTIME_R 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_INET_ADDR 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_INET_NTOA 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_IOCTL 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_IOCTL_FIONBIO 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_LL 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_LOCALTIME_R 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
|
||||
@@ -387,6 +388,7 @@ endif
|
||||
@echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_UTIME 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_UTIME_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_WRITEV 1$(DL) >> $@
|
||||
@echo $(DL)#define RETSIGTYPE void$(DL) >> $@
|
||||
@echo $(DL)#define SIZEOF_STRUCT_IN_ADDR 4$(DL) >> $@
|
||||
@echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
|
||||
@@ -404,13 +406,24 @@ endif
|
||||
@echo $(DL)#else$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_VARIADIC_MACROS_C99 1$(DL) >> $@
|
||||
@echo $(DL)#endif$(DL) >> $@
|
||||
ifdef OLD_NOVELLSDK
|
||||
@echo $(DL)#define socklen_t int$(DL) >> $@
|
||||
|
||||
FORCE: ;
|
||||
|
||||
ares_build.h: Makefile.netware FORCE
|
||||
@echo Creating $@
|
||||
@echo $(DL)/* $@ intended for NetWare target.$(DL) > $@
|
||||
@echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@
|
||||
@echo $(DL)** All your changes will be lost!!$(DL) >> $@
|
||||
@echo $(DL)*/$(DL) >> $@
|
||||
@echo $(DL)#ifndef __CARES_BUILD_H$(DL) >> $@
|
||||
@echo $(DL)#define __CARES_BUILD_H$(DL) >> $@
|
||||
ifeq ($(LIBARCH),CLIB)
|
||||
@echo $(DL)#define CARES_TYPEOF_ARES_SOCKLEN_T int$(DL) >> $@
|
||||
@echo $(DL)#define CARES_SIZEOF_ARES_SOCKLEN_T 4$(DL) >> $@
|
||||
else
|
||||
@echo $(DL)#define CARES_TYPEOF_ARES_SOCKLEN_T unsigned int$(DL) >> $@
|
||||
@echo $(DL)#define CARES_SIZEOF_ARES_SOCKLEN_T 4$(DL) >> $@
|
||||
endif
|
||||
|
||||
arpa/nameser.h: nameser.h
|
||||
@echo Fix missing header $@
|
||||
@-mkdir arpa
|
||||
@$(CP) $< arpa
|
||||
|
||||
|
||||
@echo $(DL)#define CARES_SIZEOF_LONG 4$(DL) >> $@
|
||||
@echo $(DL)typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t;$(DL) >> $@
|
||||
@echo $(DL)#endif /* __CARES_BUILD_H */$(DL) >> $@
|
||||
|
@@ -26,7 +26,7 @@ OBJ_DIR = VC6_obj
|
||||
DEF_FILE = cares.def
|
||||
|
||||
!if "$(USE_WATT32)" == "1"
|
||||
CFLAGS = $(CFLAGS) -UWIN32 -DWATT32 -I$(WATT_ROOT)\inc
|
||||
CFLAGS = $(CFLAGS) -UWIN32 -DWATT32 -D_USE_32BIT_TIME_T -I$(WATT_ROOT)\inc
|
||||
EX_LIBS = $(WATT_ROOT)\lib\wattcpvc_imp.lib
|
||||
|
||||
!else
|
||||
@@ -43,6 +43,8 @@ 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 \
|
||||
@@ -57,9 +59,11 @@ OBJECTS = $(OBJ_DIR)\ares_fds.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 \
|
||||
@@ -73,6 +77,7 @@ OBJECTS = $(OBJ_DIR)\ares_fds.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
|
||||
@@ -106,6 +111,8 @@ $(DEF_FILE): $(OBJECTS) Makefile.VC6
|
||||
@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 >> $@
|
||||
@@ -122,9 +129,11 @@ $(DEF_FILE): $(OBJECTS) Makefile.VC6
|
||||
@echo ares_inet_net_pton >> $@
|
||||
@echo ares_inet_ntop >> $@
|
||||
@echo ares_inet_pton >> $@
|
||||
@echo ares_writev >> $@
|
||||
@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)
|
||||
@@ -150,96 +159,116 @@ vclean realclean: clean
|
||||
# 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_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.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.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.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.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
|
||||
$(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.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.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
|
||||
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_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_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
|
||||
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_strerror.obj: ares_strerror.c setup.h setup_once.h ares.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_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_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_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_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_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.h ares_dns.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_version.obj: ares_version.c setup.h setup_once.h ares_version.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
|
||||
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
|
||||
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.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
|
||||
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
|
||||
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_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
|
||||
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
|
||||
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_ipv6.h inet_net_pton.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\bitncmp.obj: bitncmp.c bitncmp.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_ipv6.h inet_ntop.h ares_build.h ares_rules.h
|
||||
|
||||
$(OBJ_DIR)\ares_getopt.obj: ares_getopt.c ares_getopt.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_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
|
||||
|
@@ -11,7 +11,7 @@ c-ares is not API compatible with ares: a new name makes that more obvious to
|
||||
the public.
|
||||
|
||||
The full source code is available in the 'c-ares' release archives, and in the
|
||||
'ares' subdir of the curl CVS source repostitory.
|
||||
'ares' subdir of the curl CVS source repository.
|
||||
|
||||
If you find bugs, correct flaws, have questions or have comments in general in
|
||||
regard to c-ares (or by all means the original ares too), get in touch with us
|
||||
@@ -22,4 +22,42 @@ original ares.
|
||||
|
||||
You'll find all c-ares details and news here:
|
||||
|
||||
http://daniel.haxx.se/projects/c-ares
|
||||
http://c-ares.haxx.se/
|
||||
|
||||
|
||||
NOTES FOR C-ARES HACKERS
|
||||
|
||||
The following notes apply to c-ares version 1.6.1 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.
|
||||
|
||||
* The distributed ares_build.h file is generated as a copy of ares_build.h.dist
|
||||
when the c-ares source code distribution archive file is originally created.
|
||||
|
||||
* If you check out from CVS on a non-configure platform, you must run the
|
||||
appropriate buildconf* script to set up ares_build.h and other local files
|
||||
before being able of compiling the library.
|
||||
|
||||
* On systems capable of running the configure script, the configure process
|
||||
will overwrite the distributed ares_build.h file with one that is suitable
|
||||
and specific to the library being configured and built, this new file is
|
||||
generated from the ares_build.h.in template file.
|
||||
|
||||
* If you intend to distribute an already compiled c-ares library you _MUST_
|
||||
also distribute along with it the generated ares_build.h which has been
|
||||
used to compile it. Otherwise the library will be of no use for the users of
|
||||
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,
|
||||
and must not be modified by anyone. Configure script generates it for you.
|
||||
|
||||
* We cannot assume anything else but very basic compiler features being
|
||||
present. While c-ares requires an ANSI C compiler to build, some of the
|
||||
earlier ANSI compilers clearly can't deal with some preprocessor operators.
|
||||
|
||||
* Newlines must remain unix-style for older compilers' sake.
|
||||
|
||||
* Comments must be written in the old-style /* unnested C-fashion */
|
||||
|
||||
|
@@ -1,10 +1,21 @@
|
||||
This is what's new and changed in the c-ares 1.5.4 release:
|
||||
This is what's new and changed in the c-ares 1.6.1 release:
|
||||
|
||||
o
|
||||
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
|
||||
|
||||
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_'
|
||||
|
||||
Thanks go to these friendly people for their efforts and contributions:
|
||||
|
||||
|
||||
and obviously Daniel Stenberg
|
||||
Phil Blundell, Japheth Cleaver, Yang Tse, Gregor Jasny
|
||||
|
||||
Have fun!
|
||||
|
8
ares/TODO
Normal file
8
ares/TODO
Normal file
@@ -0,0 +1,8 @@
|
||||
TODO
|
||||
====
|
||||
|
||||
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.
|
@@ -1,52 +1,5 @@
|
||||
|
||||
|
||||
dnl CURL_CHECK_COMPILER_HALT_ON_ERROR
|
||||
dnl -------------------------------------------------
|
||||
dnl Verifies if the compiler actually halts after the
|
||||
dnl compilation phase without generating any object
|
||||
dnl code file, when the source compiles with errors.
|
||||
|
||||
AC_DEFUN([CURL_CHECK_COMPILER_HALT_ON_ERROR], [
|
||||
AC_MSG_CHECKING([if compiler halts on compilation errors])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
]],[[
|
||||
force compilation error
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([compiler does not halt on compilation errors.])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
|
||||
dnl -------------------------------------------------
|
||||
dnl Verifies if the compiler actually halts after the
|
||||
dnl compilation phase without generating any object
|
||||
dnl code file, when the source code tries to define a
|
||||
dnl type for a constant array with negative dimension.
|
||||
|
||||
AC_DEFUN([CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE], [
|
||||
AC_REQUIRE([CURL_CHECK_COMPILER_HALT_ON_ERROR])dnl
|
||||
AC_MSG_CHECKING([if compiler halts on negative sized arrays])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
typedef char bad_t[sizeof(char) == sizeof(int) ? -1 : -1 ];
|
||||
]],[[
|
||||
bad_t dummy;
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([compiler does not halt on negative sized arrays.])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_DEF (SYMBOL, [INCLUDES], [SILENT])
|
||||
dnl -------------------------------------------------
|
||||
dnl Use the C preprocessor to find out if the given object-style symbol
|
||||
@@ -96,6 +49,72 @@ CURL_DEF_TOKEN $1
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_DEF_CC (SYMBOL, [INCLUDES], [SILENT])
|
||||
dnl -------------------------------------------------
|
||||
dnl Use the C compiler to find out only if the given symbol is defined
|
||||
dnl or not, this can not find out its expansion. This macro will not use
|
||||
dnl default includes even if no INCLUDES argument is given. This macro
|
||||
dnl will run silently when invoked with three arguments.
|
||||
|
||||
AC_DEFUN([CURL_CHECK_DEF_CC], [
|
||||
AS_VAR_PUSHDEF([ac_HaveDef], [curl_cv_have_def_$1])dnl
|
||||
ifelse($3,,[AC_MSG_CHECKING([for compiler definition of $1])])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_SOURCE(
|
||||
ifelse($2,,,[$2])[[
|
||||
int main (void)
|
||||
{
|
||||
#ifdef $1
|
||||
return 0;
|
||||
#else
|
||||
force compilation error
|
||||
#endif
|
||||
}
|
||||
]])
|
||||
],[
|
||||
tst_symbol_defined="yes"
|
||||
],[
|
||||
tst_symbol_defined="no"
|
||||
])
|
||||
if test "$tst_symbol_defined" = "yes"; then
|
||||
AS_VAR_SET(ac_HaveDef, yes)
|
||||
ifelse($3,,[AC_MSG_RESULT([yes])])
|
||||
else
|
||||
AS_VAR_SET(ac_HaveDef, no)
|
||||
ifelse($3,,[AC_MSG_RESULT([no])])
|
||||
fi
|
||||
AS_VAR_POPDEF([ac_HaveDef])dnl
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CHECK_LIB_XNET
|
||||
dnl -------------------------------------------------
|
||||
dnl Verify if X/Open network library is required.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_LIB_XNET], [
|
||||
AC_MSG_CHECKING([if X/Open network library is required])
|
||||
tst_lib_xnet_required="no"
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_SOURCE([[
|
||||
int main (void)
|
||||
{
|
||||
#if defined(__hpux) && defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 600)
|
||||
return 0;
|
||||
#elif defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)
|
||||
return 0;
|
||||
#else
|
||||
force compilation error
|
||||
#endif
|
||||
}
|
||||
]])
|
||||
],[
|
||||
tst_lib_xnet_required="yes"
|
||||
LIBS="$LIBS -lxnet"
|
||||
])
|
||||
AC_MSG_RESULT([$tst_lib_xnet_required])
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CHECK_AIX_ALL_SOURCE
|
||||
dnl -------------------------------------------------
|
||||
dnl Provides a replacement of traditional AC_AIX with
|
||||
@@ -360,91 +379,55 @@ AC_DEFUN([CURL_CHECK_HEADER_MALLOC], [
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_TYPE_SOCKLEN_T
|
||||
dnl CURL_CHECK_HEADER_MEMORY
|
||||
dnl -------------------------------------------------
|
||||
dnl Check for existing socklen_t type, and provide
|
||||
dnl an equivalent type if socklen_t not available
|
||||
dnl Check for compilable and valid memory.h header,
|
||||
dnl and check if it is needed even with stdlib.h for
|
||||
dnl memory related functions.
|
||||
|
||||
AC_DEFUN([CURL_CHECK_TYPE_SOCKLEN_T], [
|
||||
AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl
|
||||
AC_CHECK_TYPE([socklen_t], ,[
|
||||
dnl socklen_t not available
|
||||
AC_CACHE_CHECK([for socklen_t equivalent],
|
||||
[curl_cv_socklen_t_equiv], [
|
||||
curl_cv_socklen_t_equiv="unknown"
|
||||
for arg1 in 'int' 'SOCKET'; do
|
||||
for arg2 in "struct sockaddr" void; do
|
||||
for t in int size_t unsigned long "unsigned long"; do
|
||||
if test "$curl_cv_socklen_t_equiv" = "unknown"; then
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#undef inline
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#ifdef HAVE_WINSOCK_H
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
#endif
|
||||
#define GETPEERNCALLCONV PASCAL
|
||||
#else
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#define GETPEERNCALLCONV
|
||||
#endif
|
||||
extern int GETPEERNCALLCONV getpeername($arg1, $arg2 *, $t *);
|
||||
]],[[
|
||||
$t len=0;
|
||||
getpeername(0,0,&len);
|
||||
]])
|
||||
],[
|
||||
curl_cv_socklen_t_equiv="$t"
|
||||
])
|
||||
fi
|
||||
done
|
||||
done
|
||||
done
|
||||
AC_DEFUN([CURL_CHECK_HEADER_MEMORY], [
|
||||
AC_CACHE_CHECK([for memory.h], [ac_cv_header_memory_h], [
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#include <memory.h>
|
||||
]],[[
|
||||
void *p = malloc(10);
|
||||
void *q = calloc(10,10);
|
||||
free(p);
|
||||
free(q);
|
||||
]])
|
||||
],[
|
||||
ac_cv_header_memory_h="yes"
|
||||
],[
|
||||
ac_cv_header_memory_h="no"
|
||||
])
|
||||
case "$curl_cv_socklen_t_equiv" in
|
||||
unknown)
|
||||
AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
|
||||
;;
|
||||
*)
|
||||
AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv,
|
||||
[Type to use in place of socklen_t when system does not provide it.])
|
||||
])
|
||||
if test "$ac_cv_header_memory_h" = "yes"; then
|
||||
AC_DEFINE_UNQUOTED(HAVE_MEMORY_H, 1,
|
||||
[Define to 1 if you have the memory.h header file.])
|
||||
#
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#include <stdlib.h>
|
||||
]],[[
|
||||
void *p = malloc(10);
|
||||
void *q = calloc(10,10);
|
||||
free(p);
|
||||
free(q);
|
||||
]])
|
||||
],[
|
||||
curl_cv_need_header_memory_h="no"
|
||||
],[
|
||||
curl_cv_need_header_memory_h="yes"
|
||||
])
|
||||
#
|
||||
case "$curl_cv_need_header_memory_h" in
|
||||
yes)
|
||||
AC_DEFINE_UNQUOTED(NEED_MEMORY_H, 1,
|
||||
[Define to 1 if you need the memory.h header file even with stdlib.h])
|
||||
;;
|
||||
esac
|
||||
],[
|
||||
#undef inline
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#ifdef HAVE_WS2TCPIP_H
|
||||
#include <ws2tcpip.h>
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#endif
|
||||
])
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
@@ -461,7 +444,6 @@ dnl argument in GETNAMEINFO_QUAL_ARG1.
|
||||
|
||||
AC_DEFUN([CURL_CHECK_FUNC_GETNAMEINFO], [
|
||||
AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl
|
||||
AC_REQUIRE([CURL_CHECK_TYPE_SOCKLEN_T])dnl
|
||||
AC_CHECK_HEADERS(sys/types.h sys/socket.h netdb.h)
|
||||
#
|
||||
AC_MSG_CHECKING([for getnameinfo])
|
||||
@@ -702,6 +684,9 @@ AC_DEFUN([CURL_CHECK_NI_WITHSCOPEID], [
|
||||
[ac_cv_working_ni_withscopeid], [
|
||||
AC_RUN_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDIO_H
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
@@ -1430,154 +1415,6 @@ AC_DEFUN([TYPE_SIG_ATOMIC_T], [
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_NONBLOCKING_SOCKET
|
||||
dnl -------------------------------------------------
|
||||
dnl Check for how to set a socket to non-blocking state. There seems to exist
|
||||
dnl four known different ways, with the one used almost everywhere being POSIX
|
||||
dnl and XPG3, while the other different ways for different systems (old BSD,
|
||||
dnl Windows and Amiga).
|
||||
dnl
|
||||
dnl There are two known platforms (AIX 3.x and SunOS 4.1.x) where the
|
||||
dnl O_NONBLOCK define is found but does not work. This condition is attempted
|
||||
dnl to get caught in this script by using an excessive number of #ifdefs...
|
||||
|
||||
AC_DEFUN([CURL_CHECK_NONBLOCKING_SOCKET], [
|
||||
AC_MSG_CHECKING([non-blocking sockets style])
|
||||
nonblock="unknown"
|
||||
#
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
/* headers for O_NONBLOCK test */
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
/* */
|
||||
#if defined(sun) || defined(__sun__) || \
|
||||
defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||
# if defined(__SVR4) || defined(__srv4__)
|
||||
# define PLATFORM_SOLARIS
|
||||
# else
|
||||
# define PLATFORM_SUNOS4
|
||||
# endif
|
||||
#endif
|
||||
#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41)
|
||||
# define PLATFORM_AIX_V3
|
||||
#endif
|
||||
/* */
|
||||
#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3) || defined(__BEOS__)
|
||||
#error "O_NONBLOCK does not work on this platform"
|
||||
#endif
|
||||
]],[[
|
||||
/* O_NONBLOCK source test */
|
||||
int socket;
|
||||
int flags = fcntl(socket, F_SETFL, flags | O_NONBLOCK);
|
||||
]])
|
||||
],[
|
||||
dnl the O_NONBLOCK test was fine
|
||||
nonblock="O_NONBLOCK"
|
||||
AC_DEFINE(HAVE_O_NONBLOCK, 1,
|
||||
[use O_NONBLOCK for non-blocking sockets])
|
||||
])
|
||||
#
|
||||
if test "$nonblock" = "unknown"; then
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
/* headers for FIONBIO test */
|
||||
#include <unistd.h>
|
||||
#include <stropts.h>
|
||||
]],[[
|
||||
/* FIONBIO source test (old-style unix) */
|
||||
int socket;
|
||||
int flags = ioctl(socket, FIONBIO, &flags);
|
||||
]])
|
||||
],[
|
||||
dnl FIONBIO test was good
|
||||
nonblock="FIONBIO"
|
||||
AC_DEFINE(HAVE_FIONBIO, 1,
|
||||
[use FIONBIO for non-blocking sockets])
|
||||
])
|
||||
fi
|
||||
#
|
||||
if test "$nonblock" = "unknown"; then
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
/* headers for ioctlsocket test (Windows) */
|
||||
#undef inline
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#ifdef HAVE_WINSOCK_H
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
]],[[
|
||||
/* ioctlsocket source code (Windows) */
|
||||
SOCKET sd;
|
||||
unsigned long flags = 0;
|
||||
sd = socket(0, 0, 0);
|
||||
ioctlsocket(sd, FIONBIO, &flags);
|
||||
]])
|
||||
],[
|
||||
dnl ioctlsocket test was good
|
||||
nonblock="ioctlsocket"
|
||||
AC_DEFINE(HAVE_IOCTLSOCKET, 1,
|
||||
[use ioctlsocket() for non-blocking sockets])
|
||||
])
|
||||
fi
|
||||
#
|
||||
if test "$nonblock" = "unknown"; then
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
/* headers for IoctlSocket test (Amiga?) */
|
||||
#include <sys/ioctl.h>
|
||||
]],[[
|
||||
/* IoctlSocket source code (Amiga?) */
|
||||
int socket;
|
||||
int flags = IoctlSocket(socket, FIONBIO, (long)1);
|
||||
]])
|
||||
],[
|
||||
dnl Ioctlsocket test was good
|
||||
nonblock="IoctlSocket"
|
||||
AC_DEFINE(HAVE_IOCTLSOCKET_CASE, 1,
|
||||
[use Ioctlsocket() for non-blocking sockets])
|
||||
])
|
||||
fi
|
||||
#
|
||||
if test "$nonblock" = "unknown"; then
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
/* headers for SO_NONBLOCK test (BeOS) */
|
||||
#include <socket.h>
|
||||
]],[[
|
||||
/* SO_NONBLOCK source code (BeOS) */
|
||||
long b = 1;
|
||||
int socket;
|
||||
int flags = setsockopt(socket, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b));
|
||||
]])
|
||||
],[
|
||||
dnl the SO_NONBLOCK test was good
|
||||
nonblock="SO_NONBLOCK"
|
||||
AC_DEFINE(HAVE_SO_NONBLOCK, 1,
|
||||
[use SO_NONBLOCK for non-blocking sockets])
|
||||
])
|
||||
fi
|
||||
#
|
||||
AC_MSG_RESULT($nonblock)
|
||||
#
|
||||
if test "$nonblock" = "unknown"; then
|
||||
AC_DEFINE(HAVE_DISABLED_NONBLOCKING, 1,
|
||||
[disabled non-blocking sockets])
|
||||
AC_MSG_WARN([non-block sockets disabled])
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl TYPE_IN_ADDR_T
|
||||
dnl -------------------------------------------------
|
||||
dnl Check for in_addr_t: it is used to receive the return code of inet_addr()
|
||||
@@ -1785,6 +1622,9 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
|
||||
AC_MSG_CHECKING([if monotonic clock_gettime works])
|
||||
AC_RUN_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
@@ -1827,157 +1667,165 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
|
||||
])
|
||||
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl CURL_DETECT_ICC ([ACTION-IF-YES])
|
||||
dnl
|
||||
dnl check if this is the Intel ICC compiler, and if so run the ACTION-IF-YES
|
||||
dnl sets the $ICC variable to "yes" or "no"
|
||||
dnl **********************************************************************
|
||||
AC_DEFUN([CURL_DETECT_ICC],
|
||||
[
|
||||
ICC="no"
|
||||
AC_MSG_CHECKING([for icc in use])
|
||||
if test "$GCC" = "yes"; then
|
||||
dnl check if this is icc acting as gcc in disguise
|
||||
AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER],
|
||||
dnl action if the text is found, this it has not been replaced by the
|
||||
dnl cpp
|
||||
ICC="no",
|
||||
dnl the text was not found, it was replaced by the cpp
|
||||
ICC="yes"
|
||||
AC_MSG_RESULT([yes])
|
||||
[$1]
|
||||
)
|
||||
fi
|
||||
if test "$ICC" = "no"; then
|
||||
# this is not ICC
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
dnl CARES_DEFINE_UNQUOTED (VARIABLE, [VALUE])
|
||||
dnl -------------------------------------------------
|
||||
dnl Like AC_DEFINE_UNQUOTED this macro will define a C preprocessor
|
||||
dnl symbol that can be further used in custom template configuration
|
||||
dnl files. This macro, unlike AC_DEFINE_UNQUOTED, does not use a third
|
||||
dnl argument for the description. Symbol definitions done with this
|
||||
dnl macro are intended to be exclusively used in handcrafted *.h.in
|
||||
dnl template files. Contrary to what AC_DEFINE_UNQUOTED does, this one
|
||||
dnl prevents autoheader generation and insertion of symbol template
|
||||
dnl stub and definition into the first configuration header file. Do
|
||||
dnl not use this macro as a replacement for AC_DEFINE_UNQUOTED, each
|
||||
dnl one serves different functional needs.
|
||||
|
||||
AC_DEFUN([CARES_DEFINE_UNQUOTED], [
|
||||
cat >>confdefs.h <<_EOF
|
||||
[@%:@define] $1 ifelse($#, 2, [$2], 1)
|
||||
_EOF
|
||||
])
|
||||
|
||||
dnl We create a function for detecting which compiler we use and then set as
|
||||
dnl pendantic compiler options as possible for that particular compiler. The
|
||||
dnl options are only used for debug-builds.
|
||||
|
||||
dnl This is a copy of the original found in curl's configure script. Don't
|
||||
dnl modify this one, edit the one in curl and copy it back here when that one
|
||||
dnl is changed.
|
||||
dnl CARES_CONFIGURE_LONG
|
||||
dnl -------------------------------------------------
|
||||
dnl Find out the size of long as reported by sizeof() and define
|
||||
dnl CARES_SIZEOF_LONG as appropriate to be used in template file
|
||||
dnl ares_build.h.in to properly configure the library.
|
||||
dnl The size of long is a build time characteristic and as such
|
||||
dnl must be recorded in ares_build.h
|
||||
|
||||
AC_DEFUN([CURL_CC_DEBUG_OPTS],
|
||||
[
|
||||
if test "z$ICC" = "z"; then
|
||||
CURL_DETECT_ICC
|
||||
fi
|
||||
AC_DEFUN([CARES_CONFIGURE_LONG], [
|
||||
if test -z "$ac_cv_sizeof_long" ||
|
||||
test "$ac_cv_sizeof_long" -eq "0"; then
|
||||
AC_MSG_ERROR([cannot find out size of long.])
|
||||
fi
|
||||
CARES_DEFINE_UNQUOTED([CARES_SIZEOF_LONG], [$ac_cv_sizeof_long])
|
||||
])
|
||||
|
||||
if test "$GCC" = "yes"; then
|
||||
|
||||
dnl figure out gcc version!
|
||||
AC_MSG_CHECKING([gcc version])
|
||||
gccver=`$CC -dumpversion`
|
||||
num1=`echo $gccver | cut -d . -f1`
|
||||
num2=`echo $gccver | cut -d . -f2`
|
||||
gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
|
||||
AC_MSG_RESULT($gccver)
|
||||
dnl CARES_CONFIGURE_ARES_SOCKLEN_T
|
||||
dnl -------------------------------------------------
|
||||
dnl Find out suitable ares_socklen_t data type definition and size, making
|
||||
dnl appropriate definitions for template file ares_build.h.in
|
||||
dnl to properly configure and use the library.
|
||||
dnl
|
||||
dnl The need for the ares_socklen_t definition arises mainly to properly
|
||||
dnl interface HP-UX systems which on one hand have a typedef'ed socklen_t
|
||||
dnl data type which is 32 or 64-Bit wide depending on the data model being
|
||||
dnl used, and that on the other hand is only actually used when interfacing
|
||||
dnl the X/Open sockets provided in the xnet library.
|
||||
|
||||
if test "$ICC" = "yes"; then
|
||||
dnl this is icc, not gcc.
|
||||
|
||||
dnl ICC warnings we ignore:
|
||||
dnl * 269 warns on our "%Od" printf formatters for curl_off_t output:
|
||||
dnl "invalid format string conversion"
|
||||
dnl * 279 warns on static conditions in while expressions
|
||||
dnl * 981 warns on "operands are evaluated in unspecified order"
|
||||
dnl * 1418 "external definition with no prior declaration"
|
||||
dnl * 1419 warns on "external declaration in primary source file"
|
||||
dnl which we know and do on purpose.
|
||||
|
||||
WARN="-wd279,269,981,1418,1419"
|
||||
|
||||
if test "$gccnum" -gt "600"; then
|
||||
dnl icc 6.0 and older doesn't have the -Wall flag
|
||||
WARN="-Wall $WARN"
|
||||
fi
|
||||
else dnl $ICC = yes
|
||||
dnl this is a set of options we believe *ALL* gcc versions support:
|
||||
WARN="-W -Wall -Wwrite-strings -pedantic -Wpointer-arith -Wnested-externs -Winline -Wmissing-prototypes"
|
||||
|
||||
dnl -Wcast-align is a bit too annoying on all gcc versions ;-)
|
||||
|
||||
if test "$gccnum" -ge "207"; then
|
||||
dnl gcc 2.7 or later
|
||||
WARN="$WARN -Wmissing-declarations"
|
||||
fi
|
||||
|
||||
if test "$gccnum" -gt "295"; then
|
||||
dnl only if the compiler is newer than 2.95 since we got lots of
|
||||
dnl "`_POSIX_C_SOURCE' is not defined" in system headers with
|
||||
dnl gcc 2.95.4 on FreeBSD 4.9!
|
||||
WARN="$WARN -Wundef -Wno-long-long -Wsign-compare -Wshadow -Wno-multichar"
|
||||
fi
|
||||
|
||||
if test "$gccnum" -ge "296"; then
|
||||
dnl gcc 2.96 or later
|
||||
WARN="$WARN -Wfloat-equal"
|
||||
fi
|
||||
|
||||
if test "$gccnum" -gt "296"; then
|
||||
dnl this option does not exist in 2.96
|
||||
WARN="$WARN -Wno-format-nonliteral"
|
||||
fi
|
||||
|
||||
dnl -Wunreachable-code seems totally unreliable on my gcc 3.3.2 on
|
||||
dnl on i686-Linux as it gives us heaps with false positives.
|
||||
dnl Also, on gcc 4.0.X it is totally unbearable and complains all
|
||||
dnl over making it unusable for generic purposes. Let's not use it.
|
||||
|
||||
if test "$gccnum" -ge "303"; then
|
||||
dnl gcc 3.3 and later
|
||||
WARN="$WARN -Wendif-labels -Wstrict-prototypes"
|
||||
fi
|
||||
|
||||
if test "$gccnum" -ge "304"; then
|
||||
# try these on gcc 3.4
|
||||
WARN="$WARN -Wdeclaration-after-statement"
|
||||
fi
|
||||
|
||||
for flag in $CPPFLAGS; do
|
||||
case "$flag" in
|
||||
-I*)
|
||||
dnl Include path, provide a -isystem option for the same dir
|
||||
dnl to prevent warnings in those dirs. The -isystem was not very
|
||||
dnl reliable on earlier gcc versions.
|
||||
add=`echo $flag | sed 's/^-I/-isystem /g'`
|
||||
WARN="$WARN $add"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
fi dnl $ICC = no
|
||||
|
||||
CFLAGS="$CFLAGS $WARN"
|
||||
|
||||
AC_MSG_NOTICE([Added this set of compiler options: $WARN])
|
||||
|
||||
else dnl $GCC = yes
|
||||
|
||||
AC_MSG_NOTICE([Added no extra compiler options])
|
||||
|
||||
fi dnl $GCC = yes
|
||||
|
||||
dnl strip off optimizer flags
|
||||
NEWFLAGS=""
|
||||
for flag in $CFLAGS; do
|
||||
case "$flag" in
|
||||
-O*)
|
||||
dnl echo "cut off $flag"
|
||||
;;
|
||||
*)
|
||||
NEWFLAGS="$NEWFLAGS $flag"
|
||||
;;
|
||||
esac
|
||||
AC_DEFUN([CARES_CONFIGURE_ARES_SOCKLEN_T], [
|
||||
AC_REQUIRE([CARES_INCLUDES_WS2TCPIP])dnl
|
||||
AC_REQUIRE([CARES_INCLUDES_SYS_SOCKET])dnl
|
||||
AC_REQUIRE([CARES_PREPROCESS_CALLCONV])dnl
|
||||
#
|
||||
AC_MSG_CHECKING([for ares_socklen_t data type])
|
||||
cares_typeof_ares_socklen_t="unknown"
|
||||
for arg1 in int SOCKET; do
|
||||
for arg2 in 'struct sockaddr' void; do
|
||||
for t in socklen_t int size_t 'unsigned int' long 'unsigned long' void; do
|
||||
if test "$cares_typeof_ares_socklen_t" = "unknown"; then
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
$cares_includes_ws2tcpip
|
||||
$cares_includes_sys_socket
|
||||
$cares_preprocess_callconv
|
||||
extern int FUNCALLCONV getpeername($arg1, $arg2 *, $t *);
|
||||
]],[[
|
||||
$t *lenptr = 0;
|
||||
if(0 != getpeername(0, 0, lenptr))
|
||||
return 1;
|
||||
]])
|
||||
],[
|
||||
cares_typeof_ares_socklen_t="$t"
|
||||
])
|
||||
fi
|
||||
done
|
||||
done
|
||||
CFLAGS=$NEWFLAGS
|
||||
|
||||
done
|
||||
for t in socklen_t int; do
|
||||
if test "$cares_typeof_ares_socklen_t" = "void"; then
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
$cares_includes_sys_socket
|
||||
typedef $t ares_socklen_t;
|
||||
]],[[
|
||||
ares_socklen_t dummy;
|
||||
]])
|
||||
],[
|
||||
cares_typeof_ares_socklen_t="$t"
|
||||
])
|
||||
fi
|
||||
done
|
||||
AC_MSG_RESULT([$cares_typeof_ares_socklen_t])
|
||||
if test "$cares_typeof_ares_socklen_t" = "void" ||
|
||||
test "$cares_typeof_ares_socklen_t" = "unknown"; then
|
||||
AC_MSG_ERROR([cannot find data type for ares_socklen_t.])
|
||||
fi
|
||||
#
|
||||
AC_MSG_CHECKING([size of ares_socklen_t])
|
||||
cares_sizeof_ares_socklen_t="unknown"
|
||||
cares_pull_headers_socklen_t="unknown"
|
||||
if test "$ac_cv_header_ws2tcpip_h" = "yes"; then
|
||||
tst_pull_header_checks='none ws2tcpip'
|
||||
tst_size_checks='4'
|
||||
else
|
||||
tst_pull_header_checks='none systypes syssocket'
|
||||
tst_size_checks='4 8 2'
|
||||
fi
|
||||
for tst_size in $tst_size_checks; do
|
||||
for tst_pull_headers in $tst_pull_header_checks; do
|
||||
if test "$cares_sizeof_ares_socklen_t" = "unknown"; then
|
||||
case $tst_pull_headers in
|
||||
ws2tcpip)
|
||||
tmp_includes="$cares_includes_ws2tcpip"
|
||||
;;
|
||||
systypes)
|
||||
tmp_includes="$cares_includes_sys_types"
|
||||
;;
|
||||
syssocket)
|
||||
tmp_includes="$cares_includes_sys_socket"
|
||||
;;
|
||||
*)
|
||||
tmp_includes=""
|
||||
;;
|
||||
esac
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
$tmp_includes
|
||||
typedef $cares_typeof_ares_socklen_t ares_socklen_t;
|
||||
typedef char dummy_arr[sizeof(ares_socklen_t) == $tst_size ? 1 : -1];
|
||||
]],[[
|
||||
ares_socklen_t dummy;
|
||||
]])
|
||||
],[
|
||||
cares_sizeof_ares_socklen_t="$tst_size"
|
||||
cares_pull_headers_socklen_t="$tst_pull_headers"
|
||||
])
|
||||
fi
|
||||
done
|
||||
done
|
||||
AC_MSG_RESULT([$cares_sizeof_ares_socklen_t])
|
||||
if test "$cares_sizeof_ares_socklen_t" = "unknown"; then
|
||||
AC_MSG_ERROR([cannot find out size of ares_socklen_t.])
|
||||
fi
|
||||
#
|
||||
case $cares_pull_headers_socklen_t in
|
||||
ws2tcpip)
|
||||
CARES_DEFINE_UNQUOTED([CARES_PULL_WS2TCPIP_H])
|
||||
;;
|
||||
systypes)
|
||||
CARES_DEFINE_UNQUOTED([CARES_PULL_SYS_TYPES_H])
|
||||
;;
|
||||
syssocket)
|
||||
CARES_DEFINE_UNQUOTED([CARES_PULL_SYS_TYPES_H])
|
||||
CARES_DEFINE_UNQUOTED([CARES_PULL_SYS_SOCKET_H])
|
||||
;;
|
||||
esac
|
||||
CARES_DEFINE_UNQUOTED([CARES_TYPEOF_ARES_SOCKLEN_T], [$cares_typeof_ares_socklen_t])
|
||||
CARES_DEFINE_UNQUOTED([CARES_SIZEOF_ARES_SOCKLEN_T], [$cares_sizeof_ares_socklen_t])
|
||||
])
|
||||
|
||||
|
||||
@@ -2026,132 +1874,3 @@ AC_DEFUN([CARES_CHECK_CONSTANT], [
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CHECK_GETSERVBYPORT_R
|
||||
dnl -------------------------------------------------
|
||||
dnl Test if the getservbyport_r function is available,
|
||||
dnl and find out how many parameters it takes.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_GETSERVBYPORT_R], [
|
||||
AC_CHECK_HEADERS(sys/types.h netdb.h)
|
||||
#
|
||||
AC_MSG_CHECKING([for getservbyport_r])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_FUNC_LINK_TRY([getservbyport_r])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
cares_cv_getservbyport_r="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
cares_cv_getservbyport_r="no"
|
||||
])
|
||||
#
|
||||
if test "$cares_cv_getservbyport_r" != "yes"; then
|
||||
AC_MSG_CHECKING([deeper for getservbyport_r])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
]],[[
|
||||
getservbyport_r();
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
cares_cv_getservbyport_r="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([but still no])
|
||||
cares_cv_getservbyport_r="no"
|
||||
])
|
||||
fi
|
||||
#
|
||||
if test "$cares_cv_getservbyport_r" = "yes"; then
|
||||
AC_MSG_CHECKING([how many arguments getservbyport_r takes])
|
||||
cares_cv_getservbyport_r_nargs="unknown"
|
||||
#
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
extern int
|
||||
getservbyport_r(int, const char*, struct servent*,
|
||||
char*, size_t, struct servent**);
|
||||
]],[[
|
||||
int p1, res;
|
||||
size_t p5;
|
||||
char *p2, p4[4096];
|
||||
struct servent *p3, *p6;
|
||||
res = getservbyport_r(p1, p2, p3, p4, p5, &p6);
|
||||
]])
|
||||
],[
|
||||
cares_cv_getservbyport_r_nargs="6"
|
||||
])
|
||||
#
|
||||
if test "$cares_cv_getservbyport_r_nargs" = "unknown"; then
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
extern struct servent*
|
||||
getservbyport_r(int, const char*, struct servent*,
|
||||
char*, int);
|
||||
]],[[
|
||||
int p1, p5;
|
||||
char *p2, p4[4096];
|
||||
struct servent *p3, res;
|
||||
res = getservbyport_r(p1, p2, p3, p4, p5);
|
||||
]])
|
||||
],[
|
||||
cares_cv_getservbyport_r_nargs="5"
|
||||
])
|
||||
fi
|
||||
#
|
||||
if test "$cares_cv_getservbyport_r_nargs" = "unknown"; then
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
extern int
|
||||
getservbyport_r(int, const char*, struct servent*,
|
||||
struct servent_data*);
|
||||
]],[[
|
||||
int p1, res;
|
||||
char *p2;
|
||||
struct servent *p3;
|
||||
struct servent_data *p4;
|
||||
res = getservbyport_r(p1, p2, p3, p4);
|
||||
]])
|
||||
],[
|
||||
cares_cv_getservbyport_r_nargs="4"
|
||||
])
|
||||
fi
|
||||
#
|
||||
AC_MSG_RESULT([$cares_cv_getservbyport_r_nargs])
|
||||
#
|
||||
if test "$cares_cv_getservbyport_r_nargs" = "unknown"; then
|
||||
AC_MSG_WARN([HAVE_GETSERVBYPORT_R will not be defined])
|
||||
else
|
||||
AC_DEFINE(HAVE_GETSERVBYPORT_R, 1,
|
||||
[Specifies whether getservbyport_r is present])
|
||||
AC_DEFINE_UNQUOTED(GETSERVBYPORT_R_ARGS, $cares_cv_getservbyport_r_nargs,
|
||||
[Specifies the number of arguments to getservbyport_r])
|
||||
if test "$cares_cv_getservbyport_r_nargs" = "4" ; then
|
||||
AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, sizeof(struct servent_data),
|
||||
[Specifies the size of the buffer to pass to getservbyport_r])
|
||||
else
|
||||
AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, 4096,
|
||||
[Specifies the size of the buffer to pass to getservbyport_r])
|
||||
fi
|
||||
fi
|
||||
#
|
||||
fi
|
||||
])
|
||||
|
@@ -50,6 +50,7 @@
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include <winsock.h>
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
@@ -60,6 +61,21 @@
|
||||
#include "inet_net_pton.h"
|
||||
#include "inet_ntop.h"
|
||||
|
||||
#ifndef HAVE_STRDUP
|
||||
# include "ares_strdup.h"
|
||||
# define strdup(ptr) ares_strdup(ptr)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRCASECMP
|
||||
# include "ares_strcasecmp.h"
|
||||
# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
# include "ares_strcasecmp.h"
|
||||
# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
|
||||
#endif
|
||||
|
||||
#ifndef INADDR_NONE
|
||||
#define INADDR_NONE 0xffffffff
|
||||
#endif
|
||||
@@ -100,6 +116,13 @@ int main(int argc, char **argv)
|
||||
WSAStartup(wVersionRequested, &wsaData);
|
||||
#endif
|
||||
|
||||
status = ares_library_init(ARES_LIB_INIT_ALL);
|
||||
if (status != ARES_SUCCESS)
|
||||
{
|
||||
fprintf(stderr, "ares_library_init: %s\n", ares_strerror(status));
|
||||
return 1;
|
||||
}
|
||||
|
||||
while ((ch = ares_getopt(argc, argv, "dvh?")) != -1)
|
||||
switch (ch)
|
||||
{
|
||||
@@ -162,6 +185,8 @@ int main(int argc, char **argv)
|
||||
wait_ares(channel);
|
||||
ares_destroy(channel);
|
||||
|
||||
ares_library_cleanup();
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
WSACleanup();
|
||||
#endif
|
||||
@@ -240,7 +265,7 @@ struct search_list {
|
||||
const char *long_name; /* normal country name */
|
||||
};
|
||||
|
||||
const struct search_list *list_lookup(int number, const struct search_list *list, int num)
|
||||
static const struct search_list *list_lookup(int number, const struct search_list *list, int num)
|
||||
{
|
||||
while (num > 0 && list->long_name)
|
||||
{
|
||||
@@ -508,7 +533,8 @@ static int is_addr(char *str, char **end)
|
||||
{
|
||||
int a0, a1, a2, a3, num, rc = 0, length = 0;
|
||||
|
||||
if ((num = sscanf(str,"%3d.%3d.%3d.%3d%n",&a0,&a1,&a2,&a3,&length)) == 4 &&
|
||||
num = sscanf(str,"%3d.%3d.%3d.%3d%n",&a0,&a1,&a2,&a3,&length);
|
||||
if( (num == 4) &&
|
||||
BYTE_OK(a0) && BYTE_OK(a1) && BYTE_OK(a2) && BYTE_OK(a3) &&
|
||||
length >= (3+4))
|
||||
{
|
||||
@@ -530,12 +556,13 @@ static void find_country_from_cname(const char *cname, struct in_addr addr)
|
||||
const struct search_list *country;
|
||||
char ccode_A2[3], *ccopy, *dot_4;
|
||||
int cnumber, z0, z1, ver_1, ver_2;
|
||||
u_long ip;
|
||||
unsigned long ip;
|
||||
|
||||
ip = ntohl(addr.s_addr);
|
||||
z0 = tolower(cname[0]);
|
||||
z1 = tolower(cname[1]);
|
||||
ccopy = strdup(cname);
|
||||
dot_4 = NULL;
|
||||
|
||||
ver_1 = (z0 == 'z' && z1 == 'z' && !strcasecmp(cname+4,nerd_ver1));
|
||||
ver_2 = (is_addr(ccopy,&dot_4) && !strcasecmp(dot_4,nerd_ver2));
|
||||
@@ -567,8 +594,8 @@ static void find_country_from_cname(const char *cname, struct in_addr addr)
|
||||
|
||||
if (ver_1)
|
||||
{
|
||||
ccode_A2[0] = tolower(cname[2]);
|
||||
ccode_A2[1] = tolower(cname[3]);
|
||||
ccode_A2[0] = (char)tolower(cname[2]);
|
||||
ccode_A2[1] = (char)tolower(cname[3]);
|
||||
ccode_A2[2] = '\0';
|
||||
}
|
||||
else
|
||||
|
158
ares/adig.c
158
ares/adig.c
@@ -17,26 +17,35 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <arpa/nameser.h>
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <netdb.h>
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -48,8 +57,24 @@
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "inet_ntop.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_getopt.h"
|
||||
|
||||
#ifndef HAVE_STRDUP
|
||||
# include "ares_strdup.h"
|
||||
# define strdup(ptr) ares_strdup(ptr)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRCASECMP
|
||||
# include "ares_strcasecmp.h"
|
||||
# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
# include "ares_strcasecmp.h"
|
||||
# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
|
||||
#endif
|
||||
|
||||
#ifdef WATT32
|
||||
#undef WIN32 /* Redefined in MingW headers */
|
||||
#endif
|
||||
@@ -127,6 +152,7 @@ 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",
|
||||
@@ -161,6 +187,13 @@ int main(int argc, char **argv)
|
||||
WSAStartup(wVersionRequested, &wsaData);
|
||||
#endif
|
||||
|
||||
status = ares_library_init(ARES_LIB_INIT_ALL);
|
||||
if (status != ARES_SUCCESS)
|
||||
{
|
||||
fprintf(stderr, "ares_library_init: %s\n", ares_strerror(status));
|
||||
return 1;
|
||||
}
|
||||
|
||||
options.flags = ARES_FLAG_NOCHECKRESP;
|
||||
options.servers = NULL;
|
||||
options.nservers = 0;
|
||||
@@ -188,11 +221,15 @@ int main(int argc, char **argv)
|
||||
|
||||
case 's':
|
||||
/* Add a server, and specify servers in the option mask. */
|
||||
hostent = gethostbyname(optarg);
|
||||
if (!hostent || hostent->h_addrtype != AF_INET)
|
||||
if (ares_inet_pton(AF_INET, optarg, &inaddr) <= 0)
|
||||
{
|
||||
fprintf(stderr, "adig: server %s not found.\n", optarg);
|
||||
return 1;
|
||||
hostent = gethostbyname(optarg);
|
||||
if (!hostent || hostent->h_addrtype != AF_INET)
|
||||
{
|
||||
fprintf(stderr, "adig: server %s not found.\n", optarg);
|
||||
return 1;
|
||||
}
|
||||
memcpy(&inaddr, hostent->h_addr, sizeof(struct in_addr));
|
||||
}
|
||||
options.servers = realloc(options.servers, (options.nservers + 1)
|
||||
* sizeof(struct in_addr));
|
||||
@@ -201,7 +238,7 @@ int main(int argc, char **argv)
|
||||
fprintf(stderr, "Out of memory!\n");
|
||||
return 1;
|
||||
}
|
||||
memcpy(&options.servers[options.nservers], hostent->h_addr,
|
||||
memcpy(&options.servers[options.nservers], &inaddr,
|
||||
sizeof(struct in_addr));
|
||||
options.nservers++;
|
||||
optmask |= ARES_OPT_SERVERS;
|
||||
@@ -295,6 +332,8 @@ int main(int argc, char **argv)
|
||||
|
||||
ares_destroy(channel);
|
||||
|
||||
ares_library_cleanup();
|
||||
|
||||
#ifdef USE_WINSOCK
|
||||
WSACleanup();
|
||||
#endif
|
||||
@@ -436,13 +475,16 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
const unsigned char *abuf, int alen)
|
||||
{
|
||||
const unsigned char *p;
|
||||
char *name;
|
||||
int type, dnsclass, ttl, dlen, status;
|
||||
long len;
|
||||
char addr[46];
|
||||
union {
|
||||
unsigned char * as_uchar;
|
||||
char * as_char;
|
||||
} name;
|
||||
|
||||
/* Parse the RR name. */
|
||||
status = ares_expand_name(aptr, abuf, alen, &name, &len);
|
||||
status = ares_expand_name(aptr, abuf, alen, &name.as_char, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
aptr += len;
|
||||
@@ -452,7 +494,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
*/
|
||||
if (aptr + RRFIXEDSZ > abuf + alen)
|
||||
{
|
||||
ares_free_string(name);
|
||||
ares_free_string(name.as_char);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -465,16 +507,16 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
aptr += RRFIXEDSZ;
|
||||
if (aptr + dlen > abuf + alen)
|
||||
{
|
||||
ares_free_string(name);
|
||||
ares_free_string(name.as_char);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Display the RR name, class, and type. */
|
||||
printf("\t%-15s.\t%d", name, ttl);
|
||||
printf("\t%-15s.\t%d", name.as_char, ttl);
|
||||
if (dnsclass != C_IN)
|
||||
printf("\t%s", class_name(dnsclass));
|
||||
printf("\t%s", type_name(type));
|
||||
ares_free_string(name);
|
||||
ares_free_string(name.as_char);
|
||||
|
||||
/* Display the RR data. Don't touch aptr. */
|
||||
switch (type)
|
||||
@@ -488,11 +530,11 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
case T_NS:
|
||||
case T_PTR:
|
||||
/* For these types, the RR data is just a domain name. */
|
||||
status = ares_expand_name(aptr, abuf, alen, &name, &len);
|
||||
status = ares_expand_name(aptr, abuf, alen, &name.as_char, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t%s.", name);
|
||||
ares_free_string(name);
|
||||
printf("\t%s.", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
break;
|
||||
|
||||
case T_HINFO:
|
||||
@@ -512,17 +554,17 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
case T_MINFO:
|
||||
/* The RR data is two domain names. */
|
||||
p = aptr;
|
||||
status = ares_expand_name(p, abuf, alen, &name, &len);
|
||||
status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t%s.", name);
|
||||
ares_free_string(name);
|
||||
printf("\t%s.", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
p += len;
|
||||
status = ares_expand_name(p, abuf, alen, &name, &len);
|
||||
status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t%s.", name);
|
||||
ares_free_string(name);
|
||||
printf("\t%s.", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
break;
|
||||
|
||||
case T_MX:
|
||||
@@ -532,11 +574,11 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
if (dlen < 2)
|
||||
return NULL;
|
||||
printf("\t%d", DNS__16BIT(aptr));
|
||||
status = ares_expand_name(aptr + 2, abuf, alen, &name, &len);
|
||||
status = ares_expand_name(aptr + 2, abuf, alen, &name.as_char, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t%s.", name);
|
||||
ares_free_string(name);
|
||||
printf("\t%s.", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
break;
|
||||
|
||||
case T_SOA:
|
||||
@@ -544,17 +586,17 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
* numbers giving the serial number and some timeouts.
|
||||
*/
|
||||
p = aptr;
|
||||
status = ares_expand_name(p, abuf, alen, &name, &len);
|
||||
status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t%s.\n", name);
|
||||
ares_free_string(name);
|
||||
printf("\t%s.\n", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
p += len;
|
||||
status = ares_expand_name(p, abuf, alen, &name, &len);
|
||||
status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t\t\t\t\t\t%s.\n", name);
|
||||
ares_free_string(name);
|
||||
printf("\t\t\t\t\t\t%s.\n", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
p += len;
|
||||
if (p + 20 > aptr + dlen)
|
||||
return NULL;
|
||||
@@ -605,11 +647,11 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
printf(" %d", DNS__16BIT(aptr + 2));
|
||||
printf(" %d", DNS__16BIT(aptr + 4));
|
||||
|
||||
status = ares_expand_name(aptr + 6, abuf, alen, &name, &len);
|
||||
status = ares_expand_name(aptr + 6, abuf, alen, &name.as_char, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t%s.", name);
|
||||
ares_free_string(name);
|
||||
printf("\t%s.", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
break;
|
||||
|
||||
case T_NAPTR:
|
||||
@@ -618,32 +660,32 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
printf(" %d\n", DNS__16BIT(aptr + 2)); /* preference */
|
||||
|
||||
p = aptr + 4;
|
||||
status = ares_expand_string(p, abuf, alen, (unsigned char **)&name, &len);
|
||||
status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t\t\t\t\t\t%s\n", name);
|
||||
ares_free_string(name);
|
||||
printf("\t\t\t\t\t\t%s\n", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
p += len;
|
||||
|
||||
status = ares_expand_string(p, abuf, alen, (unsigned char **)&name, &len);
|
||||
status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t\t\t\t\t\t%s\n", name);
|
||||
ares_free_string(name);
|
||||
printf("\t\t\t\t\t\t%s\n", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
p += len;
|
||||
|
||||
status = ares_expand_string(p, abuf, alen, (unsigned char **)&name, &len);
|
||||
status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t\t\t\t\t\t%s\n", name);
|
||||
ares_free_string(name);
|
||||
printf("\t\t\t\t\t\t%s\n", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
p += len;
|
||||
|
||||
status = ares_expand_string(p, abuf, alen, (unsigned char **)&name, &len);
|
||||
status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t\t\t\t\t\t%s", name);
|
||||
ares_free_string(name);
|
||||
printf("\t\t\t\t\t\t%s", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
break;
|
||||
|
||||
|
||||
|
25
ares/ahost.c
25
ares/ahost.c
@@ -42,6 +42,22 @@
|
||||
#include "inet_ntop.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_getopt.h"
|
||||
#include "ares_ipv6.h"
|
||||
|
||||
#ifndef HAVE_STRDUP
|
||||
# include "ares_strdup.h"
|
||||
# define strdup(ptr) ares_strdup(ptr)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRCASECMP
|
||||
# include "ares_strcasecmp.h"
|
||||
# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
# include "ares_strcasecmp.h"
|
||||
# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
|
||||
#endif
|
||||
|
||||
static void callback(void *arg, int status, int timeouts, struct hostent *host);
|
||||
static void usage(void);
|
||||
@@ -61,6 +77,13 @@ int main(int argc, char **argv)
|
||||
WSAStartup(wVersionRequested, &wsaData);
|
||||
#endif
|
||||
|
||||
status = ares_library_init(ARES_LIB_INIT_ALL);
|
||||
if (status != ARES_SUCCESS)
|
||||
{
|
||||
fprintf(stderr, "ares_library_init: %s\n", ares_strerror(status));
|
||||
return 1;
|
||||
}
|
||||
|
||||
while ((c = ares_getopt(argc,argv,"dt:h")) != -1)
|
||||
{
|
||||
switch (c)
|
||||
@@ -131,6 +154,8 @@ int main(int argc, char **argv)
|
||||
|
||||
ares_destroy(channel);
|
||||
|
||||
ares_library_cleanup();
|
||||
|
||||
#ifdef USE_WINSOCK
|
||||
WSACleanup();
|
||||
#endif
|
||||
|
80
ares/ares.h
80
ares/ares.h
@@ -1,7 +1,7 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2007 by Daniel Stenberg
|
||||
* Copyright (C) 2007-2009 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -19,6 +19,10 @@
|
||||
#ifndef ARES__H
|
||||
#define ARES__H
|
||||
|
||||
#include "ares_version.h" /* c-ares version defines */
|
||||
#include "ares_build.h" /* c-ares build definitions */
|
||||
#include "ares_rules.h" /* c-ares rules enforcement */
|
||||
|
||||
/*
|
||||
* Define WIN32 when build target is Win32 API
|
||||
*/
|
||||
@@ -29,10 +33,11 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#if defined(_AIX) || (defined(NETWARE) && defined(__NOVELL_LIBC__))
|
||||
/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
|
||||
libc5-based Linux systems. Only include it on system that are known to
|
||||
require it! */
|
||||
#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
|
||||
defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY)
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
|
||||
@@ -51,8 +56,8 @@
|
||||
# include <winsock2.h>
|
||||
# include <ws2tcpip.h>
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -89,6 +94,11 @@ extern "C" {
|
||||
#define ARES_ENONAME 19
|
||||
#define ARES_EBADHINTS 20
|
||||
|
||||
/* ares_library_init error codes */
|
||||
#define ARES_ELOADIPHLPAPI 21
|
||||
#define ARES_ELOADADVAPI32 22
|
||||
#define ARES_EADDRGetNetworkParams 23
|
||||
|
||||
/* Flag values */
|
||||
#define ARES_FLAG_USEVC (1 << 0)
|
||||
#define ARES_FLAG_PRIMARY (1 << 1)
|
||||
@@ -114,6 +124,7 @@ extern "C" {
|
||||
#define ARES_OPT_SOCK_SNDBUF (1 << 11)
|
||||
#define ARES_OPT_SOCK_RCVBUF (1 << 12)
|
||||
#define ARES_OPT_TIMEOUTMS (1 << 13)
|
||||
#define ARES_OPT_ROTATE (1 << 14)
|
||||
|
||||
/* Nameinfo flag values */
|
||||
#define ARES_NI_NOFQDN (1 << 0)
|
||||
@@ -156,6 +167,11 @@ extern "C" {
|
||||
#define ARES_GETSOCK_WRITABLE(bits,num) (bits & (1 << ((num) + \
|
||||
ARES_GETSOCK_MAXNUM)))
|
||||
|
||||
/* c-ares library initialization flag values */
|
||||
#define ARES_LIB_INIT_NONE (0)
|
||||
#define ARES_LIB_INIT_WIN32 (1 << 0)
|
||||
#define ARES_LIB_INIT_ALL (ARES_LIB_INIT_WIN32)
|
||||
|
||||
|
||||
/*
|
||||
* Typedef our socket type
|
||||
@@ -179,6 +195,23 @@ typedef void (*ares_sock_state_cb)(void *data,
|
||||
|
||||
struct apattern;
|
||||
|
||||
/* NOTE about the ares_options struct to users and developers.
|
||||
|
||||
This struct will remain looking like this. It will not be extended nor
|
||||
shrunk in future releases, but all new options will be set by ares_set_*()
|
||||
options instead of with the ares_init_options() function.
|
||||
|
||||
Eventually (in a galaxy far far away), all options will be settable by
|
||||
ares_set_*() options and the ares_init_options() function will become
|
||||
deprecated.
|
||||
|
||||
When new options are added to c-ares, they are not added to this
|
||||
struct. And they are not "saved" with the ares_save_options() function but
|
||||
instead we encourage the use of the ares_dup() function. Needless to say,
|
||||
if you add config options to c-ares you need to make sure ares_dup()
|
||||
duplicates this new option.
|
||||
|
||||
*/
|
||||
struct ares_options {
|
||||
int flags;
|
||||
int timeout; /* in seconds or milliseconds, depending on options */
|
||||
@@ -210,14 +243,25 @@ 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 int (*ares_sock_create_callback)(ares_socket_t socket_fd,
|
||||
int type, void *data);
|
||||
|
||||
int ares_library_init(int flags);
|
||||
void ares_library_cleanup(void);
|
||||
const char *ares_version(int *version);
|
||||
|
||||
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);
|
||||
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,
|
||||
@@ -226,10 +270,12 @@ 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,
|
||||
socklen_t salen, int flags,
|
||||
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);
|
||||
@@ -247,21 +293,29 @@ int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
|
||||
int ares_expand_string(const unsigned char *encoded, const unsigned char *abuf,
|
||||
int alen, unsigned char **s, long *enclen);
|
||||
|
||||
#if !defined(HAVE_STRUCT_IN6_ADDR) && !defined(s6_addr)
|
||||
struct in6_addr {
|
||||
/*
|
||||
* NOTE: before c-ares 1.6.1 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
|
||||
* system's one.
|
||||
*/
|
||||
struct ares_in6_addr {
|
||||
union {
|
||||
unsigned char _S6_u8[16];
|
||||
} _S6_un;
|
||||
};
|
||||
#define s6_addr _S6_un._S6_u8
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 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 in_addr ipaddr;
|
||||
int ttl;
|
||||
};
|
||||
struct addr6ttl {
|
||||
struct in6_addr ip6addr;
|
||||
struct ares_in6_addr ip6addr;
|
||||
int ttl;
|
||||
};
|
||||
|
||||
@@ -276,12 +330,12 @@ 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);
|
||||
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);
|
||||
struct hostent **host);
|
||||
void ares_free_string(void *str);
|
||||
void ares_free_hostent(struct hostent *host);
|
||||
const char *ares_strerror(int code);
|
||||
|
@@ -18,11 +18,19 @@
|
||||
#include "setup.h"
|
||||
|
||||
#if !defined(WIN32) || defined(WATT32)
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -30,8 +38,8 @@
|
||||
#include <ctype.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
int ares__get_hostent(FILE *fp, int family, struct hostent **host)
|
||||
{
|
||||
@@ -39,7 +47,7 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host)
|
||||
int status, linesize, end_at_hostname, naliases;
|
||||
struct in_addr addr;
|
||||
struct in6_addr addr6;
|
||||
int addrlen = sizeof(struct in_addr);
|
||||
size_t addrlen = sizeof(struct in_addr);
|
||||
struct hostent *hostent = NULL;
|
||||
|
||||
while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS)
|
||||
@@ -60,17 +68,21 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host)
|
||||
*p = 0;
|
||||
addr.s_addr = inet_addr(line);
|
||||
if (addr.s_addr == INADDR_NONE)
|
||||
{
|
||||
if (ares_inet_pton(AF_INET6, line, &addr6) > 0)
|
||||
{
|
||||
if (family != AF_INET6)
|
||||
continue;
|
||||
addrlen = sizeof(struct in6_addr);
|
||||
}
|
||||
else
|
||||
continue;
|
||||
}
|
||||
{
|
||||
/* 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 */
|
||||
continue;
|
||||
|
||||
/* Get the canonical hostname. */
|
||||
@@ -150,7 +162,7 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host)
|
||||
hostent->h_aliases[naliases] = NULL;
|
||||
|
||||
hostent->h_addrtype = family;
|
||||
hostent->h_length = addrlen;
|
||||
hostent->h_length = (int)addrlen;
|
||||
if (family == AF_INET)
|
||||
memcpy(hostent->h_addr_list[0], &addr, addrlen);
|
||||
else if (family == AF_INET6)
|
||||
|
253
ares/ares_build.h.dist
Normal file
253
ares/ares_build.h.dist
Normal file
@@ -0,0 +1,253 @@
|
||||
#ifndef __CARES_BUILD_H
|
||||
#define __CARES_BUILD_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 2009 by Daniel Stenberg et al
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software and its
|
||||
* documentation for any purpose and without fee is hereby granted, provided
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* ================================================================ */
|
||||
/* NOTES FOR CONFIGURE CAPABLE SYSTEMS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* NOTE 1:
|
||||
* -------
|
||||
*
|
||||
* See file ares_build.h.in, run configure, and forget that this file
|
||||
* exists it is only used for non-configure systems.
|
||||
* But you can keep reading if you want ;-)
|
||||
*
|
||||
*/
|
||||
|
||||
/* ================================================================ */
|
||||
/* NOTES FOR NON-CONFIGURE SYSTEMS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* NOTE 1:
|
||||
* -------
|
||||
*
|
||||
* Nothing in this file is intended to be modified or adjusted by the
|
||||
* c-ares library user nor by the c-ares library builder.
|
||||
*
|
||||
* If you think that something actually needs to be changed, adjusted
|
||||
* or fixed in this file, then, report it on the c-ares development
|
||||
* mailing list: http://cool.haxx.se/mailman/listinfo/c-ares/
|
||||
*
|
||||
* Try to keep one section per platform, compiler and architecture,
|
||||
* otherwise, if an existing section is reused for a different one and
|
||||
* later on the original is adjusted, probably the piggybacking one can
|
||||
* be adversely changed.
|
||||
*
|
||||
* In order to differentiate between platforms/compilers/architectures
|
||||
* use only compiler built in predefined preprocessor symbols.
|
||||
*
|
||||
* This header file shall only export symbols which are 'cares' or 'CARES'
|
||||
* prefixed, otherwise public name space would be polluted.
|
||||
*
|
||||
* NOTE 2:
|
||||
* -------
|
||||
*
|
||||
* Right now you might be staring at file ares_build.h.dist or ares_build.h,
|
||||
* this is due to the following reason: file ares_build.h.dist is renamed
|
||||
* to ares_build.h when the c-ares source code distribution archive file is
|
||||
* created.
|
||||
*
|
||||
* File ares_build.h.dist is not included in the distribution archive.
|
||||
* File ares_build.h is not present in the CVS tree.
|
||||
*
|
||||
* The distributed ares_build.h file is only intended to be used on systems
|
||||
* which can not run the also distributed configure script.
|
||||
*
|
||||
* On systems capable of running the configure script, the configure process
|
||||
* will overwrite the distributed ares_build.h file with one that is suitable
|
||||
* and specific to the library being configured and built, which is generated
|
||||
* from the ares_build.h.in template file.
|
||||
*
|
||||
* If you check out from CVS on a non-configure platform, you must run the
|
||||
* appropriate buildconf* script to set up ares_build.h and other local files.
|
||||
*
|
||||
*/
|
||||
|
||||
/* ================================================================ */
|
||||
/* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */
|
||||
/* ================================================================ */
|
||||
|
||||
#ifdef CARES_SIZEOF_LONG
|
||||
# error "CARES_SIZEOF_LONG shall not be defined except in ares_build.h"
|
||||
Error Compilation_aborted_CARES_SIZEOF_LONG_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CARES_TYPEOF_ARES_SOCKLEN_T
|
||||
# error "CARES_TYPEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
|
||||
Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CARES_SIZEOF_ARES_SOCKLEN_T
|
||||
# error "CARES_SIZEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
|
||||
Error Compilation_aborted_CARES_SIZEOF_ARES_SOCKLEN_T_already_defined
|
||||
#endif
|
||||
|
||||
/* ================================================================ */
|
||||
/* EXTERNAL INTERFACE SETTINGS FOR NON-CONFIGURE SYSTEMS ONLY */
|
||||
/* ================================================================ */
|
||||
|
||||
#if defined(__DJGPP__) || defined(__GO32__)
|
||||
# define CARES_SIZEOF_LONG 4
|
||||
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__SALFORDC__)
|
||||
# define CARES_SIZEOF_LONG 4
|
||||
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__BORLANDC__)
|
||||
# define CARES_SIZEOF_LONG 4
|
||||
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__TURBOC__)
|
||||
# define CARES_SIZEOF_LONG 4
|
||||
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# define CARES_SIZEOF_LONG 4
|
||||
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__POCC__)
|
||||
# define CARES_SIZEOF_LONG 4
|
||||
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__LCC__)
|
||||
# define CARES_SIZEOF_LONG 4
|
||||
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__SYMBIAN32__)
|
||||
# define CARES_SIZEOF_LONG 4
|
||||
# define CARES_TYPEOF_ARES_SOCKLEN_T unsigned int
|
||||
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__MWERKS__)
|
||||
# define CARES_SIZEOF_LONG 4
|
||||
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||
|
||||
#elif defined(_WIN32_WCE)
|
||||
# define CARES_SIZEOF_LONG 4
|
||||
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__MINGW32__)
|
||||
# define CARES_SIZEOF_LONG 4
|
||||
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__VMS)
|
||||
# define CARES_SIZEOF_LONG 4
|
||||
# define CARES_TYPEOF_ARES_SOCKLEN_T unsigned int
|
||||
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||
|
||||
#elif defined(__OS400__)
|
||||
# if defined(__ILEC400__)
|
||||
# define CARES_SIZEOF_LONG 4
|
||||
# define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
|
||||
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||
# define CARES_PULL_SYS_TYPES_H 1
|
||||
# define CARES_PULL_SYS_SOCKET_H 1
|
||||
# endif
|
||||
|
||||
#elif defined(__MVS__)
|
||||
# if defined(__IBMC__) || defined(__IBMCPP__)
|
||||
# if defined(_ILP32)
|
||||
# define CARES_SIZEOF_LONG 4
|
||||
# elif defined(_LP64)
|
||||
# define CARES_SIZEOF_LONG 8
|
||||
# endif
|
||||
# define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
|
||||
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||
# define CARES_PULL_SYS_TYPES_H 1
|
||||
# define CARES_PULL_SYS_SOCKET_H 1
|
||||
# endif
|
||||
|
||||
#elif defined(__370__)
|
||||
# if defined(__IBMC__) || defined(__IBMCPP__)
|
||||
# if defined(_ILP32)
|
||||
# define CARES_SIZEOF_LONG 4
|
||||
# elif defined(_LP64)
|
||||
# define CARES_SIZEOF_LONG 8
|
||||
# endif
|
||||
# define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
|
||||
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||
# define CARES_PULL_SYS_TYPES_H 1
|
||||
# define CARES_PULL_SYS_SOCKET_H 1
|
||||
# endif
|
||||
|
||||
#elif defined(TPF)
|
||||
# define CARES_SIZEOF_LONG 8
|
||||
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||
|
||||
/* ===================================== */
|
||||
/* KEEP MSVC THE PENULTIMATE ENTRY */
|
||||
/* ===================================== */
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
# define CARES_SIZEOF_LONG 4
|
||||
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||
|
||||
/* ===================================== */
|
||||
/* KEEP GENERIC GCC THE LAST ENTRY */
|
||||
/* ===================================== */
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
# if defined(__i386__) || defined(__ppc__)
|
||||
# define CARES_SIZEOF_LONG 4
|
||||
# elif defined(__x86_64__) || defined(__ppc64__)
|
||||
# define CARES_SIZEOF_LONG 8
|
||||
# endif
|
||||
# define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
|
||||
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||
# define CARES_PULL_SYS_TYPES_H 1
|
||||
# define CARES_PULL_SYS_SOCKET_H 1
|
||||
|
||||
#else
|
||||
# error "Unknown non-configure build target!"
|
||||
Error Compilation_aborted_Unknown_non_configure_build_target
|
||||
#endif
|
||||
|
||||
/* CARES_PULL_SYS_TYPES_H is defined above when inclusion of header file */
|
||||
/* sys/types.h is required here to properly make type definitions below. */
|
||||
#ifdef CARES_PULL_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
/* CARES_PULL_SYS_SOCKET_H is defined above when inclusion of header file */
|
||||
/* sys/socket.h is required here to properly make type definitions below. */
|
||||
#ifdef CARES_PULL_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
/* Data type definition of ares_socklen_t. */
|
||||
|
||||
#ifdef CARES_TYPEOF_ARES_SOCKLEN_T
|
||||
typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t;
|
||||
#endif
|
||||
|
||||
#endif /* __CARES_BUILD_H */
|
111
ares/ares_build.h.in
Normal file
111
ares/ares_build.h.in
Normal file
@@ -0,0 +1,111 @@
|
||||
#ifndef __CARES_BUILD_H
|
||||
#define __CARES_BUILD_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 2009 by Daniel Stenberg et al
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software and its
|
||||
* documentation for any purpose and without fee is hereby granted, provided
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* ================================================================ */
|
||||
/* NOTES FOR CONFIGURE CAPABLE SYSTEMS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* NOTE 1:
|
||||
* -------
|
||||
*
|
||||
* Nothing in this file is intended to be modified or adjusted by the
|
||||
* c-ares library user nor by the c-ares library builder.
|
||||
*
|
||||
* If you think that something actually needs to be changed, adjusted
|
||||
* or fixed in this file, then, report it on the c-ares development
|
||||
* mailing list: http://cool.haxx.se/mailman/listinfo/c-ares/
|
||||
*
|
||||
* This header file shall only export symbols which are 'cares' or 'CARES'
|
||||
* prefixed, otherwise public name space would be polluted.
|
||||
*
|
||||
* NOTE 2:
|
||||
* -------
|
||||
*
|
||||
* Right now you might be staring at file ares_build.h.in or ares_build.h,
|
||||
* this is due to the following reason:
|
||||
*
|
||||
* On systems capable of running the configure script, the configure process
|
||||
* will overwrite the distributed ares_build.h file with one that is suitable
|
||||
* and specific to the library being configured and built, which is generated
|
||||
* from the ares_build.h.in template file.
|
||||
*
|
||||
*/
|
||||
|
||||
/* ================================================================ */
|
||||
/* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */
|
||||
/* ================================================================ */
|
||||
|
||||
#ifdef CARES_SIZEOF_LONG
|
||||
# error "CARES_SIZEOF_LONG shall not be defined except in ares_build.h"
|
||||
Error Compilation_aborted_CARES_SIZEOF_LONG_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CARES_TYPEOF_ARES_SOCKLEN_T
|
||||
# error "CARES_TYPEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
|
||||
Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_already_defined
|
||||
#endif
|
||||
|
||||
#ifdef CARES_SIZEOF_ARES_SOCKLEN_T
|
||||
# error "CARES_SIZEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
|
||||
Error Compilation_aborted_CARES_SIZEOF_ARES_SOCKLEN_T_already_defined
|
||||
#endif
|
||||
|
||||
/* ================================================================ */
|
||||
/* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */
|
||||
/* ================================================================ */
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file ws2tcpip.h must be included by the external interface. */
|
||||
#undef CARES_PULL_WS2TCPIP_H
|
||||
#ifdef CARES_PULL_WS2TCPIP_H
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# include <winsock2.h>
|
||||
# include <ws2tcpip.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file sys/types.h must be included by the external interface. */
|
||||
#undef CARES_PULL_SYS_TYPES_H
|
||||
#ifdef CARES_PULL_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
/* Configure process defines this to 1 when it finds out that system */
|
||||
/* header file sys/socket.h must be included by the external interface. */
|
||||
#undef CARES_PULL_SYS_SOCKET_H
|
||||
#ifdef CARES_PULL_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
#undef CARES_SIZEOF_LONG
|
||||
|
||||
/* Integral data type used for ares_socklen_t. */
|
||||
#undef CARES_TYPEOF_ARES_SOCKLEN_T
|
||||
|
||||
/* The size of `ares_socklen_t', as computed by sizeof. */
|
||||
#undef CARES_SIZEOF_ARES_SOCKLEN_T
|
||||
|
||||
/* Data type definition of ares_socklen_t. */
|
||||
typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t;
|
||||
|
||||
#endif /* __CARES_BUILD_H */
|
43
ares/ares_dup.3
Normal file
43
ares/ares_dup.3
Normal file
@@ -0,0 +1,43 @@
|
||||
.\" $Id$
|
||||
.\"
|
||||
.\" Copyright (C) 2007-2008 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_DUP 3 "2 Dec 2008"
|
||||
.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)
|
||||
.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
|
||||
name service channel. The caller should invoke \fIares_destroy(3)\fP on the
|
||||
handle when the channel is no longer needed.
|
||||
|
||||
The \fBares_dup_options\fP function also initializes a name service channel,
|
||||
with additional options set exactly as the \fIsource\fP channel has them
|
||||
configured.
|
||||
.SH SEE ALSO
|
||||
.BR ares_destroy(3),
|
||||
.BR ares_init(3)
|
||||
.SH AVAILABILITY
|
||||
ares_dup(3) was added in c-ares 1.6.0
|
||||
.SH AUTHOR
|
||||
Daniel Stenberg
|
||||
|
@@ -17,14 +17,19 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/nameser.h>
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.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>
|
||||
@@ -172,3 +177,14 @@ static int name_length(const unsigned char *encoded, const unsigned char *abuf,
|
||||
*/
|
||||
return (n) ? n - 1 : n;
|
||||
}
|
||||
|
||||
/* Like ares_expand_name but returns EBADRESP in case of invalid input. */
|
||||
int ares__expand_name_for_response(const unsigned char *encoded,
|
||||
const unsigned char *abuf, int alen,
|
||||
char **s, long *enclen)
|
||||
{
|
||||
int status = ares_expand_name(encoded, abuf, alen, s, enclen);
|
||||
if (status == ARES_EBADNAME)
|
||||
status = ARES_EBADRESP;
|
||||
return status;
|
||||
}
|
||||
|
@@ -17,11 +17,16 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/nameser.h>
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
@@ -16,16 +16,25 @@
|
||||
*/
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/nameser.h>
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.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 <stdio.h>
|
||||
@@ -33,8 +42,8 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
#ifdef WATT32
|
||||
#undef WIN32
|
||||
@@ -43,8 +52,7 @@
|
||||
struct addr_query {
|
||||
/* Arguments passed to ares_gethostbyaddr() */
|
||||
ares_channel channel;
|
||||
union ares_addr addr;
|
||||
int family;
|
||||
struct ares_addr addr;
|
||||
ares_host_callback callback;
|
||||
void *arg;
|
||||
|
||||
@@ -57,8 +65,8 @@ static void addr_callback(void *arg, int status, int timeouts,
|
||||
unsigned char *abuf, int alen);
|
||||
static void end_aquery(struct addr_query *aquery, int status,
|
||||
struct hostent *host);
|
||||
static int file_lookup(union ares_addr *addr, int family, struct hostent **host);
|
||||
static void ptr_rr_name(char *name, int family, union ares_addr *addr);
|
||||
static int file_lookup(struct ares_addr *addr, struct hostent **host);
|
||||
static void ptr_rr_name(char *name, const struct ares_addr *addr);
|
||||
|
||||
void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen,
|
||||
int family, ares_host_callback callback, void *arg)
|
||||
@@ -86,10 +94,10 @@ void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen,
|
||||
}
|
||||
aquery->channel = channel;
|
||||
if (family == AF_INET)
|
||||
memcpy(&aquery->addr.addr4, addr, sizeof(struct in_addr));
|
||||
memcpy(&aquery->addr.addrV4, addr, sizeof(struct in_addr));
|
||||
else
|
||||
memcpy(&aquery->addr.addr6, addr, sizeof(struct in6_addr));
|
||||
aquery->family = family;
|
||||
memcpy(&aquery->addr.addrV6, addr, sizeof(struct in6_addr));
|
||||
aquery->addr.family = family;
|
||||
aquery->callback = callback;
|
||||
aquery->arg = arg;
|
||||
aquery->remaining_lookups = channel->lookups;
|
||||
@@ -110,13 +118,13 @@ static void next_lookup(struct addr_query *aquery)
|
||||
switch (*p)
|
||||
{
|
||||
case 'b':
|
||||
ptr_rr_name(name, aquery->family, &aquery->addr);
|
||||
ptr_rr_name(name, &aquery->addr);
|
||||
aquery->remaining_lookups = p + 1;
|
||||
ares_query(aquery->channel, name, C_IN, T_PTR, addr_callback,
|
||||
aquery);
|
||||
return;
|
||||
case 'f':
|
||||
status = file_lookup(&aquery->addr, aquery->family, &host);
|
||||
status = file_lookup(&aquery->addr, &host);
|
||||
|
||||
/* this status check below previously checked for !ARES_ENOTFOUND,
|
||||
but we should not assume that this single error code is the one
|
||||
@@ -137,16 +145,23 @@ static void addr_callback(void *arg, int status, int timeouts,
|
||||
{
|
||||
struct addr_query *aquery = (struct addr_query *) arg;
|
||||
struct hostent *host;
|
||||
size_t addrlen;
|
||||
|
||||
aquery->timeouts += timeouts;
|
||||
if (status == ARES_SUCCESS)
|
||||
{
|
||||
if (aquery->family == AF_INET)
|
||||
status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addr4,
|
||||
sizeof(struct in_addr), AF_INET, &host);
|
||||
if (aquery->addr.family == AF_INET)
|
||||
{
|
||||
addrlen = sizeof(struct in_addr);
|
||||
status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addrV4,
|
||||
(int)addrlen, AF_INET, &host);
|
||||
}
|
||||
else
|
||||
status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addr6,
|
||||
sizeof(struct in6_addr), AF_INET6, &host);
|
||||
{
|
||||
addrlen = sizeof(struct in6_addr);
|
||||
status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addrV6,
|
||||
(int)addrlen, AF_INET6, &host);
|
||||
}
|
||||
end_aquery(aquery, status, host);
|
||||
}
|
||||
else if (status == ARES_EDESTRUCTION)
|
||||
@@ -164,7 +179,7 @@ static void end_aquery(struct addr_query *aquery, int status,
|
||||
free(aquery);
|
||||
}
|
||||
|
||||
static int file_lookup(union ares_addr *addr, int family, struct hostent **host)
|
||||
static int file_lookup(struct ares_addr *addr, struct hostent **host)
|
||||
{
|
||||
FILE *fp;
|
||||
int status;
|
||||
@@ -217,21 +232,21 @@ static int file_lookup(union ares_addr *addr, int family, struct hostent **host)
|
||||
return ARES_EFILE;
|
||||
}
|
||||
}
|
||||
while ((status = ares__get_hostent(fp, family, host)) == ARES_SUCCESS)
|
||||
while ((status = ares__get_hostent(fp, addr->family, host)) == ARES_SUCCESS)
|
||||
{
|
||||
if (family != (*host)->h_addrtype)
|
||||
if (addr->family != (*host)->h_addrtype)
|
||||
{
|
||||
ares_free_hostent(*host);
|
||||
continue;
|
||||
}
|
||||
if (family == AF_INET)
|
||||
if (addr->family == AF_INET)
|
||||
{
|
||||
if (memcmp((*host)->h_addr, &addr->addr4, sizeof(struct in_addr)) == 0)
|
||||
if (memcmp((*host)->h_addr, &addr->addrV4, sizeof(struct in_addr)) == 0)
|
||||
break;
|
||||
}
|
||||
else if (family == AF_INET6)
|
||||
else if (addr->family == AF_INET6)
|
||||
{
|
||||
if (memcmp((*host)->h_addr, &addr->addr6, sizeof(struct in6_addr)) == 0)
|
||||
if (memcmp((*host)->h_addr, &addr->addrV6, sizeof(struct in6_addr)) == 0)
|
||||
break;
|
||||
}
|
||||
ares_free_hostent(*host);
|
||||
@@ -244,11 +259,11 @@ static int file_lookup(union ares_addr *addr, int family, struct hostent **host)
|
||||
return status;
|
||||
}
|
||||
|
||||
static void ptr_rr_name(char *name, int family, union ares_addr *addr)
|
||||
static void ptr_rr_name(char *name, const struct ares_addr *addr)
|
||||
{
|
||||
if (family == AF_INET)
|
||||
if (addr->family == AF_INET)
|
||||
{
|
||||
unsigned long laddr = ntohl(addr->addr4.s_addr);
|
||||
unsigned long laddr = ntohl(addr->addrV4.s_addr);
|
||||
int a1 = (int)((laddr >> 24) & 0xff);
|
||||
int a2 = (int)((laddr >> 16) & 0xff);
|
||||
int a3 = (int)((laddr >> 8) & 0xff);
|
||||
@@ -257,14 +272,17 @@ static void ptr_rr_name(char *name, int family, union ares_addr *addr)
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned char *bytes = (unsigned char *)&addr->addr6.s6_addr;
|
||||
unsigned char *bytes = (unsigned char *)&addr->addrV6.s6_addr;
|
||||
/* There are too many arguments to do this in one line using
|
||||
* minimally C89-compliant compilers */
|
||||
sprintf(name,
|
||||
"%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x."
|
||||
"%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.ip6.arpa",
|
||||
"%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.",
|
||||
bytes[15]&0xf, bytes[15] >> 4, bytes[14]&0xf, bytes[14] >> 4,
|
||||
bytes[13]&0xf, bytes[13] >> 4, bytes[12]&0xf, bytes[12] >> 4,
|
||||
bytes[11]&0xf, bytes[11] >> 4, bytes[10]&0xf, bytes[10] >> 4,
|
||||
bytes[9]&0xf, bytes[9] >> 4, bytes[8]&0xf, bytes[8] >> 4,
|
||||
bytes[9]&0xf, bytes[9] >> 4, bytes[8]&0xf, bytes[8] >> 4);
|
||||
sprintf(name+strlen(name),
|
||||
"%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.ip6.arpa",
|
||||
bytes[7]&0xf, bytes[7] >> 4, bytes[6]&0xf, bytes[6] >> 4,
|
||||
bytes[5]&0xf, bytes[5] >> 4, bytes[4]&0xf, bytes[4] >> 4,
|
||||
bytes[3]&0xf, bytes[3] >> 4, bytes[2]&0xf, bytes[2] >> 4,
|
||||
|
@@ -17,19 +17,25 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.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>
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -41,9 +47,9 @@
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "bitncmp.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
#ifdef WATT32
|
||||
#undef WIN32
|
||||
@@ -55,7 +61,8 @@ struct host_query {
|
||||
char *name;
|
||||
ares_host_callback callback;
|
||||
void *arg;
|
||||
int family;
|
||||
int sent_family; /* this family is what was is being used */
|
||||
int want_family; /* this family is what is asked for in the API */
|
||||
const char *remaining_lookups;
|
||||
int timeouts;
|
||||
};
|
||||
@@ -65,29 +72,34 @@ static void host_callback(void *arg, int status, int timeouts,
|
||||
unsigned char *abuf, int alen);
|
||||
static void end_hquery(struct host_query *hquery, int status,
|
||||
struct hostent *host);
|
||||
static int fake_hostent(const char *name, int family, ares_host_callback callback,
|
||||
void *arg);
|
||||
static int fake_hostent(const char *name, int family,
|
||||
ares_host_callback callback, void *arg);
|
||||
static int file_lookup(const char *name, int family, struct hostent **host);
|
||||
static void sort_addresses(struct hostent *host, struct apattern *sortlist,
|
||||
int nsort);
|
||||
static void sort6_addresses(struct hostent *host, struct apattern *sortlist,
|
||||
int nsort);
|
||||
static int get_address_index(struct in_addr *addr, struct apattern *sortlist,
|
||||
int nsort);
|
||||
static int get6_address_index(struct in6_addr *addr, struct apattern *sortlist,
|
||||
int nsort);
|
||||
static void sort_addresses(struct hostent *host,
|
||||
const struct apattern *sortlist, int nsort);
|
||||
static void sort6_addresses(struct hostent *host,
|
||||
const struct apattern *sortlist, int nsort);
|
||||
static int get_address_index(const struct in_addr *addr,
|
||||
const struct apattern *sortlist, int nsort);
|
||||
static int get6_address_index(const struct in6_addr *addr,
|
||||
const struct apattern *sortlist, int nsort);
|
||||
|
||||
void ares_gethostbyname(ares_channel channel, const char *name, int family,
|
||||
ares_host_callback callback, void *arg)
|
||||
{
|
||||
struct host_query *hquery;
|
||||
|
||||
/* Right now we only know how to look up Internet addresses. */
|
||||
if (family != AF_INET && family != AF_INET6)
|
||||
{
|
||||
callback(arg, ARES_ENOTIMP, 0, NULL);
|
||||
return;
|
||||
}
|
||||
/* Right now we only know how to look up Internet addresses - and unspec
|
||||
means try both basically. */
|
||||
switch (family) {
|
||||
case AF_INET:
|
||||
case AF_INET6:
|
||||
case AF_UNSPEC:
|
||||
break;
|
||||
default:
|
||||
callback(arg, ARES_ENOTIMP, 0, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fake_hostent(name, family, callback, arg))
|
||||
return;
|
||||
@@ -101,13 +113,13 @@ void ares_gethostbyname(ares_channel channel, const char *name, int family,
|
||||
}
|
||||
hquery->channel = channel;
|
||||
hquery->name = strdup(name);
|
||||
hquery->family = family;
|
||||
if (!hquery->name)
|
||||
{
|
||||
free(hquery);
|
||||
callback(arg, ARES_ENOMEM, 0, NULL);
|
||||
return;
|
||||
}
|
||||
hquery->want_family = family;
|
||||
hquery->sent_family = -1; /* nothing is sent yet */
|
||||
if (!hquery->name) {
|
||||
free(hquery);
|
||||
callback(arg, ARES_ENOMEM, 0, NULL);
|
||||
return;
|
||||
}
|
||||
hquery->callback = callback;
|
||||
hquery->arg = arg;
|
||||
hquery->remaining_lookups = channel->lookups;
|
||||
@@ -130,17 +142,23 @@ static void next_lookup(struct host_query *hquery, int status_code)
|
||||
case 'b':
|
||||
/* DNS lookup */
|
||||
hquery->remaining_lookups = p + 1;
|
||||
if (hquery->family == AF_INET6)
|
||||
if ((hquery->want_family == AF_INET6) ||
|
||||
(hquery->want_family == AF_UNSPEC)) {
|
||||
/* if inet6 or unspec, start out with AAAA */
|
||||
hquery->sent_family = AF_INET6;
|
||||
ares_search(hquery->channel, hquery->name, C_IN, T_AAAA,
|
||||
host_callback, hquery);
|
||||
else
|
||||
}
|
||||
else {
|
||||
hquery->sent_family = AF_INET;
|
||||
ares_search(hquery->channel, hquery->name, C_IN, T_A, host_callback,
|
||||
hquery);
|
||||
}
|
||||
return;
|
||||
|
||||
case 'f':
|
||||
/* Host file lookup */
|
||||
status = file_lookup(hquery->name, hquery->family, &host);
|
||||
status = file_lookup(hquery->name, hquery->want_family, &host);
|
||||
|
||||
/* this status check below previously checked for !ARES_ENOTFOUND,
|
||||
but we should not assume that this single error code is the one
|
||||
@@ -167,33 +185,34 @@ static void host_callback(void *arg, int status, int timeouts,
|
||||
hquery->timeouts += timeouts;
|
||||
if (status == ARES_SUCCESS)
|
||||
{
|
||||
if (hquery->family == AF_INET)
|
||||
if (hquery->sent_family == AF_INET)
|
||||
{
|
||||
status = ares_parse_a_reply(abuf, alen, &host, NULL, NULL);
|
||||
if (host && channel->nsort)
|
||||
sort_addresses(host, channel->sortlist, channel->nsort);
|
||||
}
|
||||
else if (hquery->family == AF_INET6)
|
||||
else if (hquery->sent_family == AF_INET6)
|
||||
{
|
||||
status = ares_parse_aaaa_reply(abuf, alen, &host, NULL, NULL);
|
||||
if (status == ARES_ENODATA)
|
||||
{
|
||||
/* The query returned something (e.g. CNAME) but there were no
|
||||
AAAA records. Try looking up A instead. */
|
||||
hquery->family = AF_INET;
|
||||
ares_search(hquery->channel, hquery->name, C_IN, T_A, host_callback,
|
||||
hquery);
|
||||
return;
|
||||
}
|
||||
if (status == ARES_ENODATA || status == ARES_EBADRESP) {
|
||||
/* The query returned something but either there were no AAAA records (e.g. just CNAME)
|
||||
or the response was malformed. Try looking up A instead.
|
||||
We should possibly limit this attempt-next logic to AF_UNSPEC lookups only. */
|
||||
hquery->sent_family = AF_INET;
|
||||
ares_search(hquery->channel, hquery->name, C_IN, T_A,
|
||||
host_callback, hquery);
|
||||
return;
|
||||
}
|
||||
if (host && channel->nsort)
|
||||
sort6_addresses(host, channel->sortlist, channel->nsort);
|
||||
}
|
||||
end_hquery(hquery, status, host);
|
||||
}
|
||||
else if (status == ARES_ENODATA && hquery->family == AF_INET6)
|
||||
else if ((status == ARES_ENODATA || status == ARES_EBADRESP || status == ARES_ETIMEOUT) && hquery->sent_family == AF_INET6)
|
||||
{
|
||||
/* There was no AAAA. Now lookup an A */
|
||||
hquery->family = AF_INET;
|
||||
/* The AAAA query yielded no useful result. Now look up an A instead.
|
||||
We should possibly limit this attempt-next logic to AF_UNSPEC lookups only. */
|
||||
hquery->sent_family = AF_INET;
|
||||
ares_search(hquery->channel, hquery->name, C_IN, T_A, host_callback,
|
||||
hquery);
|
||||
}
|
||||
@@ -256,12 +275,12 @@ static int fake_hostent(const char *name, int family, ares_host_callback callbac
|
||||
|
||||
if (family == AF_INET)
|
||||
{
|
||||
hostent.h_length = sizeof(struct in_addr);
|
||||
hostent.h_length = (int)sizeof(struct in_addr);
|
||||
addrs[0] = (char *)∈
|
||||
}
|
||||
else if (family == AF_INET6)
|
||||
{
|
||||
hostent.h_length = sizeof(struct in6_addr);
|
||||
hostent.h_length = (int)sizeof(struct in6_addr);
|
||||
addrs[0] = (char *)&in6;
|
||||
}
|
||||
/* Duplicate the name, to avoid a constness violation. */
|
||||
@@ -283,6 +302,33 @@ static int fake_hostent(const char *name, int family, ares_host_callback callbac
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* This is an API method */
|
||||
int ares_gethostbyname_file(ares_channel channel, const char *name,
|
||||
int family, struct hostent **host)
|
||||
{
|
||||
int result;
|
||||
|
||||
/* We only take the channel to ensure that ares_init() been called. */
|
||||
if(channel == NULL)
|
||||
{
|
||||
/* Anything will do, really. This seems fine, and is consistent with
|
||||
other error cases. */
|
||||
*host = NULL;
|
||||
return ARES_ENOTFOUND;
|
||||
}
|
||||
|
||||
/* Just chain to the internal implementation we use here; it's exactly
|
||||
* what we want.
|
||||
*/
|
||||
result = file_lookup(name, family, host);
|
||||
if(result != ARES_SUCCESS)
|
||||
{
|
||||
/* We guarantee a NULL hostent on failure. */
|
||||
*host = NULL;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static int file_lookup(const char *name, int family, struct hostent **host)
|
||||
{
|
||||
FILE *fp;
|
||||
@@ -358,7 +404,7 @@ static int file_lookup(const char *name, int family, struct hostent **host)
|
||||
return status;
|
||||
}
|
||||
|
||||
static void sort_addresses(struct hostent *host, struct apattern *sortlist,
|
||||
static void sort_addresses(struct hostent *host, const struct apattern *sortlist,
|
||||
int nsort)
|
||||
{
|
||||
struct in_addr a1, a2;
|
||||
@@ -388,7 +434,8 @@ static void sort_addresses(struct hostent *host, struct apattern *sortlist,
|
||||
/* Find the first entry in sortlist which matches addr. Return nsort
|
||||
* if none of them match.
|
||||
*/
|
||||
static int get_address_index(struct in_addr *addr, struct apattern *sortlist,
|
||||
static int get_address_index(const struct in_addr *addr,
|
||||
const struct apattern *sortlist,
|
||||
int nsort)
|
||||
{
|
||||
int i;
|
||||
@@ -399,13 +446,13 @@ static int get_address_index(struct in_addr *addr, struct apattern *sortlist,
|
||||
continue;
|
||||
if (sortlist[i].type == PATTERN_MASK)
|
||||
{
|
||||
if ((addr->s_addr & sortlist[i].mask.addr.addr4.s_addr)
|
||||
== sortlist[i].addr.addr4.s_addr)
|
||||
if ((addr->s_addr & sortlist[i].mask.addr4.s_addr)
|
||||
== sortlist[i].addrV4.s_addr)
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!ares_bitncmp(&addr->s_addr, &sortlist[i].addr.addr4.s_addr,
|
||||
if (!ares_bitncmp(&addr->s_addr, &sortlist[i].addrV4.s_addr,
|
||||
sortlist[i].mask.bits))
|
||||
break;
|
||||
}
|
||||
@@ -413,7 +460,7 @@ static int get_address_index(struct in_addr *addr, struct apattern *sortlist,
|
||||
return i;
|
||||
}
|
||||
|
||||
static void sort6_addresses(struct hostent *host, struct apattern *sortlist,
|
||||
static void sort6_addresses(struct hostent *host, const struct apattern *sortlist,
|
||||
int nsort)
|
||||
{
|
||||
struct in6_addr a1, a2;
|
||||
@@ -443,8 +490,9 @@ static void sort6_addresses(struct hostent *host, struct apattern *sortlist,
|
||||
/* Find the first entry in sortlist which matches addr. Return nsort
|
||||
* if none of them match.
|
||||
*/
|
||||
static int get6_address_index(struct in6_addr *addr, struct apattern *sortlist,
|
||||
int nsort)
|
||||
static int get6_address_index(const struct in6_addr *addr,
|
||||
const struct apattern *sortlist,
|
||||
int nsort)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -452,7 +500,7 @@ static int get6_address_index(struct in6_addr *addr, struct apattern *sortlist,
|
||||
{
|
||||
if (sortlist[i].family != AF_INET6)
|
||||
continue;
|
||||
if (!ares_bitncmp(&addr->s6_addr, &sortlist[i].addr.addr6.s6_addr, sortlist[i].mask.bits))
|
||||
if (!ares_bitncmp(&addr->s6_addr, &sortlist[i].addrV6.s6_addr, sortlist[i].mask.bits))
|
||||
break;
|
||||
}
|
||||
return i;
|
||||
|
84
ares/ares_gethostbyname_file.3
Normal file
84
ares/ares_gethostbyname_file.3
Normal file
@@ -0,0 +1,84 @@
|
||||
.\" $Id$
|
||||
.\"
|
||||
.\" 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_GETHOSTBYNAME 3 "25 July 1998"
|
||||
.SH NAME
|
||||
ares_gethostbyname_file \- Lookup a name in the system's hosts file
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B void ares_gethostbyname_file(ares_channel \fIchannel\fP, const char *\fIname\fP,
|
||||
.B int \fIfamily\fP, struct hostent **host)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.B ares_gethostbyname_file
|
||||
function performs a host lookup by name against the system's hosts file (or equivalent local hostname database).
|
||||
The
|
||||
.IR channel
|
||||
parameter is required, but no asynchronous queries are performed. Instead, the
|
||||
lookup is done via the same mechanism used to perform 'f' lookups
|
||||
(see the
|
||||
.I lookups
|
||||
options field in \fIares_init_options(3)\fP).
|
||||
The parameter
|
||||
.I name
|
||||
gives the hostname as a NUL-terminated C string, and
|
||||
.I family
|
||||
gives the desired type of address for the resulting host entry.
|
||||
.PP
|
||||
The return value indicates whether the query succeeded and, if not, how it
|
||||
failed. It may have any of the following values:
|
||||
.TP 19
|
||||
.B ARES_SUCCESS
|
||||
The host lookup completed successfully and
|
||||
.I host
|
||||
now points to the result (and must be freed with \fIares_free_hostent(3)\fP).
|
||||
.TP 19
|
||||
.B ARES_ENOTFOUND
|
||||
The hostname
|
||||
.I name
|
||||
was not found.
|
||||
.TP 19
|
||||
.B ARES_EFILE
|
||||
There was a file I/O error while performing the lookup.
|
||||
.TP 19
|
||||
.B ARES_ENOMEM
|
||||
Memory was exhausted.
|
||||
.PP
|
||||
On successful completion of the query, the pointer pointed to by
|
||||
.I host
|
||||
points to a
|
||||
.B struct hostent
|
||||
containing the address of the host returned by the lookup. The user must
|
||||
free the memory pointed to by
|
||||
.IR host
|
||||
when finished with it by calling \fIares_free_hostent(3)\fP. If the lookup did
|
||||
not complete successfully,
|
||||
.I host
|
||||
will be
|
||||
.BR NULL .
|
||||
.SH AVAILABILITY
|
||||
Added in c-ares 1.5.4
|
||||
.SH SEE ALSO
|
||||
.BR ares_gethostbyname (3),
|
||||
.BR ares_free_hostent (3),
|
||||
.BR ares_init_options (3)
|
||||
.SH AUTHOR
|
||||
Brad Spencer
|
||||
.br
|
||||
Copyright 1998 by the Massachusetts Institute of Technology.
|
@@ -14,7 +14,7 @@
|
||||
.\" this software for any purpose. It is provided "as is"
|
||||
.\" without express or implied warranty.
|
||||
.\"
|
||||
.TH ARES_GETNAMEINFO 3 "16 May 2005"
|
||||
.TH ARES_GETNAMEINFO 3 "1 May 2009"
|
||||
.SH NAME
|
||||
ares_getnameinfo \- Address-to-nodename translation in protocol-independent manner
|
||||
.SH SYNOPSIS
|
||||
@@ -25,7 +25,7 @@ ares_getnameinfo \- Address-to-nodename translation in protocol-independent mann
|
||||
.B int \fItimeouts\fP, char *\fInode\fP, char *\fIservice\fP)
|
||||
.PP
|
||||
.B void ares_getnameinfo(ares_channel \fIchannel\fP, const struct sockaddr *\fIsa\fP,
|
||||
.B socklen_t \fIsalen\fP, int \fIflags\fP, ares_nameinfo_callback \fIcallback\fP,
|
||||
.B ares_socklen_t \fIsalen\fP, int \fIflags\fP, ares_nameinfo_callback \fIcallback\fP,
|
||||
.B void *\fIarg\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
|
@@ -16,17 +16,32 @@
|
||||
*/
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <arpa/nameser.h>
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#ifdef HAVE_GETSERVBYPORT_R
|
||||
# if !defined(GETSERVBYPORT_R_ARGS) || \
|
||||
(GETSERVBYPORT_R_ARGS < 4) || (GETSERVBYPORT_R_ARGS > 6)
|
||||
# error "you MUST specifiy a valid number of arguments for getservbyport_r"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#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_NET_IF_H
|
||||
@@ -42,9 +57,9 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
#include "ares_ipv6.h"
|
||||
#include "inet_ntop.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
#ifdef WATT32
|
||||
#undef WIN32
|
||||
@@ -77,7 +92,8 @@ static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int scopeid,
|
||||
#endif
|
||||
static char *ares_striendstr(const char *s1, const char *s2);
|
||||
|
||||
void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t salen,
|
||||
void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa,
|
||||
ares_socklen_t salen,
|
||||
int flags, ares_nameinfo_callback callback, void *arg)
|
||||
{
|
||||
struct sockaddr_in *addr = NULL;
|
||||
@@ -210,6 +226,7 @@ static void nameinfo_callback(void *arg, int status, int timeouts, struct hosten
|
||||
We do this by determining our own domain name, then searching the string
|
||||
for this domain name and removing it.
|
||||
*/
|
||||
#ifdef HAVE_GETHOSTNAME
|
||||
if (niquery->flags & ARES_NI_NOFQDN)
|
||||
{
|
||||
char buf[255];
|
||||
@@ -222,6 +239,7 @@ static void nameinfo_callback(void *arg, int status, int timeouts, struct hosten
|
||||
*end = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
niquery->callback(niquery->arg, ARES_SUCCESS, niquery->timeouts, (char *)(host->h_name),
|
||||
service);
|
||||
return;
|
||||
|
@@ -33,6 +33,12 @@
|
||||
|
||||
int ares_getopt(int nargc, char * const nargv[], const char *ostr);
|
||||
|
||||
#if defined(WATT32)
|
||||
#undef optarg
|
||||
#undef optind
|
||||
#undef opterr
|
||||
#endif
|
||||
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
extern int opterr;
|
||||
|
@@ -154,7 +154,7 @@ recursion for you. Recursion must be handled by the application calling ares
|
||||
if \fIARES_FLAG_NORECURSE\fP is set.
|
||||
.TP 23
|
||||
.B ARES_FLAG_STAYOPEN
|
||||
Do not close communciations sockets when the number of active queries
|
||||
Do not close communications sockets when the number of active queries
|
||||
drops to zero.
|
||||
.TP 23
|
||||
.B ARES_FLAG_NOSEARCH
|
||||
@@ -185,7 +185,8 @@ A configuration file could not be read.
|
||||
.B ARES_ENOMEM
|
||||
The process's available memory was exhausted.
|
||||
.SH SEE ALSO
|
||||
.BR ares_destroy (3)
|
||||
.BR ares_destroy(3),
|
||||
.BR ares_dup(3)
|
||||
.SH AUTHOR
|
||||
Greg Hudson, MIT Information Systems
|
||||
.br
|
||||
|
184
ares/ares_init.c
184
ares/ares_init.c
@@ -1,7 +1,7 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2007-2008 by Daniel Stenberg
|
||||
* Copyright (C) 2007-2009 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -19,11 +19,9 @@
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#include <iphlpapi.h>
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#else
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
@@ -36,20 +34,30 @@
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/nameser.h>
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.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_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_PROCESS_H
|
||||
#include <process.h> /* Some have getpid() here */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -58,8 +66,9 @@
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_library_init.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
#ifdef WATT32
|
||||
#undef WIN32 /* Redefined in MingW/MSVC headers */
|
||||
@@ -135,6 +144,7 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
||||
channel->timeout = -1;
|
||||
channel->tries = -1;
|
||||
channel->ndots = -1;
|
||||
channel->rotate = -1;
|
||||
channel->udp_port = -1;
|
||||
channel->tcp_port = -1;
|
||||
channel->socket_send_buffer_size = -1;
|
||||
@@ -149,7 +159,10 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
||||
channel->servers = NULL;
|
||||
channel->sock_state_cb = NULL;
|
||||
channel->sock_state_cb_data = NULL;
|
||||
channel->sock_create_cb = NULL;
|
||||
channel->sock_create_cb_data = NULL;
|
||||
|
||||
channel->last_server = 0;
|
||||
channel->last_timeout_processed = (time_t)now.tv_sec;
|
||||
|
||||
/* Initialize our lists of queries */
|
||||
@@ -168,7 +181,7 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
||||
*/
|
||||
|
||||
if (status == ARES_SUCCESS) {
|
||||
status = init_by_options(channel, options, optmask);
|
||||
status = init_by_options(channel, options, optmask);
|
||||
if (status != ARES_SUCCESS)
|
||||
DEBUGF(fprintf(stderr, "Error: init_by_options failed: %s\n",
|
||||
ares_strerror(status)));
|
||||
@@ -246,6 +259,40 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
|
||||
/* ares_dup() duplicates a channel handle with all its options and returns a
|
||||
new channel handle */
|
||||
int ares_dup(ares_channel *dest, ares_channel src)
|
||||
{
|
||||
struct ares_options opts;
|
||||
int rc;
|
||||
int optmask;
|
||||
|
||||
*dest = NULL; /* in case of failure return NULL explicitly */
|
||||
|
||||
/* First get the options supported by the old ares_save_options() function,
|
||||
which is most of them */
|
||||
rc = ares_save_options(src, &opts, &optmask);
|
||||
if(rc)
|
||||
return rc;
|
||||
|
||||
/* Then create the new channel with those options */
|
||||
rc = ares_init_options(dest, &opts, optmask);
|
||||
|
||||
/* destroy the options copy to not leak any memory */
|
||||
ares_destroy_options(&opts);
|
||||
|
||||
if(rc)
|
||||
return rc;
|
||||
|
||||
/* Now clone the options that ares_save_options() doesn't support. */
|
||||
(*dest)->sock_create_cb = src->sock_create_cb;
|
||||
(*dest)->sock_create_cb_data = src->sock_create_cb_data;
|
||||
|
||||
|
||||
return ARES_SUCCESS; /* everything went fine */
|
||||
|
||||
}
|
||||
|
||||
/* Save options from initialized channel */
|
||||
int ares_save_options(ares_channel channel, struct ares_options *options,
|
||||
int *optmask)
|
||||
@@ -258,10 +305,14 @@ int ares_save_options(ares_channel channel, struct ares_options *options,
|
||||
if (!ARES_CONFIG_CHECK(channel))
|
||||
return ARES_ENODATA;
|
||||
|
||||
/* Traditionally the optmask wasn't saved in the channel struct so it was
|
||||
recreated here. ROTATE is the first option that has no struct field of
|
||||
its own in the public config struct */
|
||||
(*optmask) = (ARES_OPT_FLAGS|ARES_OPT_TRIES|ARES_OPT_NDOTS|
|
||||
ARES_OPT_UDP_PORT|ARES_OPT_TCP_PORT|ARES_OPT_SOCK_STATE_CB|
|
||||
ARES_OPT_SERVERS|ARES_OPT_DOMAINS|ARES_OPT_LOOKUPS|
|
||||
ARES_OPT_SORTLIST|ARES_OPT_TIMEOUTMS);
|
||||
ARES_OPT_SORTLIST|ARES_OPT_TIMEOUTMS) |
|
||||
(channel->optmask & ARES_OPT_ROTATE);
|
||||
|
||||
/* Copy easy stuff */
|
||||
options->flags = channel->flags;
|
||||
@@ -343,6 +394,8 @@ static int init_by_options(ares_channel channel,
|
||||
channel->tries = options->tries;
|
||||
if ((optmask & ARES_OPT_NDOTS) && channel->ndots == -1)
|
||||
channel->ndots = options->ndots;
|
||||
if ((optmask & ARES_OPT_ROTATE) && channel->rotate == -1)
|
||||
channel->rotate = 1;
|
||||
if ((optmask & ARES_OPT_UDP_PORT) && channel->udp_port == -1)
|
||||
channel->udp_port = options->udp_port;
|
||||
if ((optmask & ARES_OPT_TCP_PORT) && channel->tcp_port == -1)
|
||||
@@ -413,11 +466,14 @@ static int init_by_options(ares_channel channel,
|
||||
return ARES_ENOMEM;
|
||||
for (i = 0; i < options->nsort; i++)
|
||||
{
|
||||
memcpy(&(channel->sortlist[i]), &(options->sortlist[i]), sizeof(struct apattern));
|
||||
memcpy(&(channel->sortlist[i]), &(options->sortlist[i]),
|
||||
sizeof(struct apattern));
|
||||
}
|
||||
channel->nsort = options->nsort;
|
||||
}
|
||||
|
||||
channel->optmask = optmask;
|
||||
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -503,11 +559,8 @@ static int get_res_interfaces_nt(HKEY hKey, const char *subkey, char **obuf)
|
||||
|
||||
static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size)
|
||||
{
|
||||
FIXED_INFO *fi = alloca (sizeof(*fi));
|
||||
FIXED_INFO *fi, *newfi;
|
||||
DWORD size = sizeof (*fi);
|
||||
typedef DWORD (WINAPI* get_net_param_func) (FIXED_INFO*, DWORD*);
|
||||
get_net_param_func fpGetNetworkParams; /* available only on Win-98/2000+ */
|
||||
HMODULE handle;
|
||||
IP_ADDR_STRING *ipAddr;
|
||||
int i, count = 0;
|
||||
int debug = 0;
|
||||
@@ -516,23 +569,21 @@ static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size)
|
||||
char *ret = ret_buf;
|
||||
HRESULT res;
|
||||
|
||||
fi = malloc(size);
|
||||
if (!fi)
|
||||
return (0);
|
||||
|
||||
handle = LoadLibrary ("iphlpapi.dll");
|
||||
if (!handle)
|
||||
return (0);
|
||||
|
||||
fpGetNetworkParams = (get_net_param_func) GetProcAddress (handle, "GetNetworkParams");
|
||||
if (!fpGetNetworkParams)
|
||||
goto quit;
|
||||
return 0;
|
||||
|
||||
res = (*fpGetNetworkParams) (fi, &size);
|
||||
if ((res != ERROR_BUFFER_OVERFLOW) && (res != ERROR_SUCCESS))
|
||||
goto quit;
|
||||
|
||||
fi = alloca (size);
|
||||
if (!fi || (*fpGetNetworkParams) (fi, &size) != ERROR_SUCCESS)
|
||||
newfi = realloc(fi, size);
|
||||
if (!newfi)
|
||||
goto quit;
|
||||
|
||||
fi = newfi;
|
||||
res = (*fpGetNetworkParams) (fi, &size);
|
||||
if (res != ERROR_SUCCESS)
|
||||
goto quit;
|
||||
|
||||
if (debug)
|
||||
@@ -565,14 +616,14 @@ static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size)
|
||||
}
|
||||
|
||||
quit:
|
||||
if (handle)
|
||||
FreeLibrary (handle);
|
||||
if (fi)
|
||||
free(fi);
|
||||
|
||||
if (debug && left <= ip_size)
|
||||
printf ("Too many nameservers. Truncating to %d addressess", count);
|
||||
if (ret > ret_buf)
|
||||
ret[-1] = '\0';
|
||||
return (count);
|
||||
return count;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -675,7 +726,7 @@ DhcpNameServer
|
||||
{
|
||||
if (bytes)
|
||||
{
|
||||
line = (char *)malloc(bytes+1);
|
||||
line = malloc(bytes+1);
|
||||
if (RegQueryValueEx(mykey, NAMESERVER, NULL, &data_type,
|
||||
(unsigned char *)line, &bytes) ==
|
||||
ERROR_SUCCESS)
|
||||
@@ -923,6 +974,8 @@ static int init_by_defaults(ares_channel channel)
|
||||
channel->tries = DEFAULT_TRIES;
|
||||
if (channel->ndots == -1)
|
||||
channel->ndots = 1;
|
||||
if (channel->rotate == -1)
|
||||
channel->rotate = 0;
|
||||
if (channel->udp_port == -1)
|
||||
channel->udp_port = htons(NAMESERVER_PORT);
|
||||
if (channel->tcp_port == -1)
|
||||
@@ -951,8 +1004,10 @@ static int init_by_defaults(ares_channel channel)
|
||||
*/
|
||||
size_t len = 64;
|
||||
int res;
|
||||
channel->ndomains = 0; /* default to none */
|
||||
|
||||
hostname = (char *)malloc(len);
|
||||
#ifdef HAVE_GETHOSTNAME
|
||||
hostname = malloc(len);
|
||||
if(!hostname) {
|
||||
rc = ARES_ENOMEM;
|
||||
goto error;
|
||||
@@ -979,7 +1034,6 @@ static int init_by_defaults(ares_channel channel)
|
||||
|
||||
} while(0);
|
||||
|
||||
channel->ndomains = 0; /* default to none */
|
||||
if (strchr(hostname, '.')) {
|
||||
/* a dot was found */
|
||||
|
||||
@@ -995,6 +1049,7 @@ static int init_by_defaults(ares_channel channel)
|
||||
}
|
||||
channel->ndomains = 1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (channel->nsort == -1) {
|
||||
@@ -1164,8 +1219,8 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
|
||||
/* Lets see if it is CIDR */
|
||||
/* First we'll try IPv6 */
|
||||
if ((bits = ares_inet_net_pton(AF_INET6, ipbufpfx[0] ? ipbufpfx : ipbuf,
|
||||
&pat.addr.addr6,
|
||||
sizeof(pat.addr.addr6))) > 0)
|
||||
&pat.addrV6,
|
||||
sizeof(pat.addrV6))) > 0)
|
||||
{
|
||||
pat.type = PATTERN_CIDR;
|
||||
pat.mask.bits = (unsigned short)bits;
|
||||
@@ -1174,8 +1229,8 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
|
||||
return ARES_ENOMEM;
|
||||
}
|
||||
if (ipbufpfx[0] &&
|
||||
(bits = ares_inet_net_pton(AF_INET, ipbufpfx, &pat.addr.addr4,
|
||||
sizeof(pat.addr.addr4))) > 0)
|
||||
(bits = ares_inet_net_pton(AF_INET, ipbufpfx, &pat.addrV4,
|
||||
sizeof(pat.addrV4))) > 0)
|
||||
{
|
||||
pat.type = PATTERN_CIDR;
|
||||
pat.mask.bits = (unsigned short)bits;
|
||||
@@ -1184,13 +1239,13 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
|
||||
return ARES_ENOMEM;
|
||||
}
|
||||
/* See if it is just a regular IP */
|
||||
else if (ip_addr(ipbuf, (int)(q-str), &pat.addr.addr4) == 0)
|
||||
else if (ip_addr(ipbuf, (int)(q-str), &pat.addrV4) == 0)
|
||||
{
|
||||
if (ipbufpfx[0])
|
||||
{
|
||||
memcpy(ipbuf, str, (int)(q-str));
|
||||
ipbuf[(int)(q-str)] = '\0';
|
||||
if (ip_addr(ipbuf, (int)(q - str), &pat.mask.addr.addr4) != 0)
|
||||
if (ip_addr(ipbuf, (int)(q - str), &pat.mask.addr4) != 0)
|
||||
natural_mask(&pat);
|
||||
}
|
||||
else
|
||||
@@ -1293,6 +1348,9 @@ static int set_options(ares_channel channel, const char *str)
|
||||
val = try_option(p, q, "retry:");
|
||||
if (val && channel->tries == -1)
|
||||
channel->tries = atoi(val);
|
||||
val = try_option(p, q, "rotate");
|
||||
if (val && channel->rotate == -1)
|
||||
channel->rotate = 1;
|
||||
p = q;
|
||||
while (ISSPACE(*p))
|
||||
p++;
|
||||
@@ -1365,7 +1423,7 @@ static char *try_config(char *s, const char *opt)
|
||||
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;
|
||||
return ((size_t)(q - p) >= len && !strncmp(p, opt, len)) ? &p[len] : NULL;
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
@@ -1402,17 +1460,17 @@ static void natural_mask(struct apattern *pat)
|
||||
/* Store a host-byte-order copy of pat in a struct in_addr. Icky,
|
||||
* but portable.
|
||||
*/
|
||||
addr.s_addr = ntohl(pat->addr.addr4.s_addr);
|
||||
addr.s_addr = ntohl(pat->addrV4.s_addr);
|
||||
|
||||
/* This is out of date in the CIDR world, but some people might
|
||||
* still rely on it.
|
||||
*/
|
||||
if (IN_CLASSA(addr.s_addr))
|
||||
pat->mask.addr.addr4.s_addr = htonl(IN_CLASSA_NET);
|
||||
pat->mask.addr4.s_addr = htonl(IN_CLASSA_NET);
|
||||
else if (IN_CLASSB(addr.s_addr))
|
||||
pat->mask.addr.addr4.s_addr = htonl(IN_CLASSB_NET);
|
||||
pat->mask.addr4.s_addr = htonl(IN_CLASSB_NET);
|
||||
else
|
||||
pat->mask.addr.addr4.s_addr = htonl(IN_CLASSC_NET);
|
||||
pat->mask.addr4.s_addr = htonl(IN_CLASSC_NET);
|
||||
}
|
||||
#endif
|
||||
/* initialize an rc4 key. If possible a cryptographically secure random key
|
||||
@@ -1427,15 +1485,13 @@ static void randomize_key(unsigned char* key,int key_data_len)
|
||||
int randomized = 0;
|
||||
int counter=0;
|
||||
#ifdef WIN32
|
||||
HMODULE lib=LoadLibrary("ADVAPI32.DLL");
|
||||
if (lib) {
|
||||
BOOLEAN (APIENTRY *pfn)(void*, ULONG) =
|
||||
(BOOLEAN (APIENTRY *)(void*,ULONG))GetProcAddress(lib,"SystemFunction036");
|
||||
if (pfn && pfn(key,key_data_len) )
|
||||
randomized = 1;
|
||||
|
||||
FreeLibrary(lib);
|
||||
}
|
||||
BOOLEAN res;
|
||||
if (fpSystemFunction036)
|
||||
{
|
||||
res = (*fpSystemFunction036) (key, key_data_len);
|
||||
if (res)
|
||||
randomized = 1;
|
||||
}
|
||||
#else /* !WIN32 */
|
||||
#ifdef RANDOM_FILE
|
||||
FILE *f = fopen(RANDOM_FILE, "rb");
|
||||
@@ -1485,9 +1541,17 @@ static int init_id_key(rc4_key* key,int key_data_len)
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
|
||||
short ares__generate_new_id(rc4_key* key)
|
||||
unsigned short ares__generate_new_id(rc4_key* key)
|
||||
{
|
||||
short r=0;
|
||||
unsigned short r=0;
|
||||
ares__rc4(key, (unsigned char *)&r, sizeof(r));
|
||||
return r;
|
||||
}
|
||||
|
||||
void ares_set_socket_callback(ares_channel channel,
|
||||
ares_sock_create_callback cb,
|
||||
void *data)
|
||||
{
|
||||
channel->sock_create_cb = cb;
|
||||
channel->sock_create_cb_data = data;
|
||||
}
|
||||
|
@@ -49,7 +49,7 @@ struct addrinfo
|
||||
int ai_family;
|
||||
int ai_socktype;
|
||||
int ai_protocol;
|
||||
socklen_t ai_addrlen; /* Follow rfc3493 struct addrinfo */
|
||||
ares_socklen_t ai_addrlen; /* Follow rfc3493 struct addrinfo */
|
||||
char *ai_canonname;
|
||||
struct sockaddr *ai_addr;
|
||||
struct addrinfo *ai_next;
|
||||
|
109
ares/ares_library_init.c
Normal file
109
ares/ares_library_init.c
Normal file
@@ -0,0 +1,109 @@
|
||||
/* $Id$ */
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_library_init.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
/* library-private global and unique instance vars */
|
||||
|
||||
#ifdef WIN32
|
||||
fpGetNetworkParams_t fpGetNetworkParams = ZERO_NULL;
|
||||
fpSystemFunction036_t fpSystemFunction036 = ZERO_NULL;
|
||||
#endif
|
||||
|
||||
/* library-private global vars with source visibility restricted to this file */
|
||||
|
||||
static unsigned int ares_initialized;
|
||||
static int ares_init_flags;
|
||||
|
||||
#ifdef WIN32
|
||||
static HMODULE hnd_iphlpapi;
|
||||
static HMODULE hnd_advapi32;
|
||||
#endif
|
||||
|
||||
|
||||
static int ares_win32_init(void)
|
||||
{
|
||||
#ifdef WIN32
|
||||
|
||||
hnd_iphlpapi = 0;
|
||||
hnd_iphlpapi = LoadLibrary("iphlpapi.dll");
|
||||
if (!hnd_iphlpapi)
|
||||
return ARES_ELOADIPHLPAPI;
|
||||
|
||||
fpGetNetworkParams = (fpGetNetworkParams_t)
|
||||
GetProcAddress(hnd_iphlpapi, "GetNetworkParams");
|
||||
if (!fpGetNetworkParams)
|
||||
{
|
||||
FreeLibrary(hnd_iphlpapi);
|
||||
return ARES_EADDRGetNetworkParams;
|
||||
}
|
||||
|
||||
hnd_advapi32 = 0;
|
||||
hnd_advapi32 = LoadLibrary("advapi32.dll");
|
||||
if (!hnd_advapi32)
|
||||
{
|
||||
FreeLibrary(hnd_iphlpapi);
|
||||
return ARES_ELOADADVAPI32;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
static void ares_win32_cleanup(void)
|
||||
{
|
||||
#ifdef WIN32
|
||||
if (hnd_advapi32)
|
||||
FreeLibrary(hnd_advapi32);
|
||||
if (hnd_iphlpapi)
|
||||
FreeLibrary(hnd_iphlpapi);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int ares_library_init(int flags)
|
||||
{
|
||||
int res;
|
||||
|
||||
if (ares_initialized)
|
||||
return ARES_SUCCESS;
|
||||
ares_initialized++;
|
||||
|
||||
if (flags & ARES_LIB_INIT_WIN32)
|
||||
{
|
||||
res = ares_win32_init();
|
||||
if (res != ARES_SUCCESS)
|
||||
return res;
|
||||
}
|
||||
|
||||
ares_init_flags = flags;
|
||||
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
void ares_library_cleanup(void)
|
||||
{
|
||||
if (!ares_initialized)
|
||||
return;
|
||||
ares_initialized--;
|
||||
|
||||
if (ares_init_flags & ARES_LIB_INIT_WIN32)
|
||||
ares_win32_cleanup();
|
||||
|
||||
ares_init_flags = ARES_LIB_INIT_NONE;
|
||||
}
|
||||
|
24
ares/ares_library_init.h
Normal file
24
ares/ares_library_init.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef HEADER_CARES_LIBRARY_INIT_H
|
||||
#define HEADER_CARES_LIBRARY_INIT_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
#include <iphlpapi.h>
|
||||
|
||||
typedef DWORD (WINAPI *fpGetNetworkParams_t) (FIXED_INFO*, DWORD*);
|
||||
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;
|
||||
|
||||
#endif /* WIN32 */
|
||||
|
||||
#endif /* HEADER_CARES_LIBRARY_INIT_H */
|
||||
|
@@ -17,14 +17,19 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/nameser.h>
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.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>
|
||||
|
@@ -17,25 +17,37 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.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 <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/nameser.h>
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#ifdef HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_private.h"
|
||||
@@ -74,7 +86,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
||||
|
||||
/* Expand the name from the question, and skip past the question. */
|
||||
aptr = abuf + HFIXEDSZ;
|
||||
status = ares_expand_name(aptr, abuf, alen, &hostname, &len);
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &hostname, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return status;
|
||||
if (aptr + len + QFIXEDSZ > abuf + alen)
|
||||
@@ -86,7 +98,8 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
||||
|
||||
if (host)
|
||||
{
|
||||
/* Allocate addresses and aliases; ancount gives an upper bound for both. */
|
||||
/* Allocate addresses and aliases; ancount gives an upper bound for
|
||||
both. */
|
||||
addrs = malloc(ancount * sizeof(struct in_addr));
|
||||
if (!addrs)
|
||||
{
|
||||
@@ -114,7 +127,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
||||
for (i = 0; i < (int)ancount; i++)
|
||||
{
|
||||
/* Decode the RR up to the data field. */
|
||||
status = ares_expand_name(aptr, abuf, alen, &rr_name, &len);
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
aptr += len;
|
||||
@@ -167,7 +180,8 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
||||
naliases++;
|
||||
|
||||
/* Decode the RR data and replace the hostname with it. */
|
||||
status = ares_expand_name(aptr, abuf, alen, &rr_data, &len);
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
|
||||
&len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
free(hostname);
|
||||
|
@@ -17,27 +17,37 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.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>
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#ifdef HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "inet_net_pton.h"
|
||||
@@ -77,7 +87,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
|
||||
/* Expand the name from the question, and skip past the question. */
|
||||
aptr = abuf + HFIXEDSZ;
|
||||
status = ares_expand_name(aptr, abuf, alen, &hostname, &len);
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &hostname, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return status;
|
||||
if (aptr + len + QFIXEDSZ > abuf + alen)
|
||||
@@ -116,7 +126,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
for (i = 0; i < (int)ancount; i++)
|
||||
{
|
||||
/* Decode the RR up to the data field. */
|
||||
status = ares_expand_name(aptr, abuf, alen, &rr_name, &len);
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
aptr += len;
|
||||
@@ -169,7 +179,8 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
naliases++;
|
||||
|
||||
/* Decode the RR data and replace the hostname with it. */
|
||||
status = ares_expand_name(aptr, abuf, alen, &rr_data, &len);
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
|
||||
&len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
free(hostname);
|
||||
|
@@ -20,17 +20,25 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/nameser.h>
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.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>
|
||||
@@ -65,7 +73,7 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen,
|
||||
|
||||
/* Expand the name from the question, and skip past the question. */
|
||||
aptr = abuf + HFIXEDSZ;
|
||||
status = ares_expand_name( aptr, abuf, alen, &hostname, &len );
|
||||
status = ares__expand_name_for_response( aptr, abuf, alen, &hostname, &len);
|
||||
if ( status != ARES_SUCCESS )
|
||||
return status;
|
||||
if ( aptr + len + QFIXEDSZ > abuf + alen )
|
||||
@@ -88,7 +96,7 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen,
|
||||
for ( i = 0; i < ( int ) ancount; i++ )
|
||||
{
|
||||
/* Decode the RR up to the data field. */
|
||||
status = ares_expand_name( aptr, abuf, alen, &rr_name, &len );
|
||||
status = ares__expand_name_for_response( aptr, abuf, alen, &rr_name, &len );
|
||||
if ( status != ARES_SUCCESS )
|
||||
break;
|
||||
aptr += len;
|
||||
@@ -105,7 +113,8 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen,
|
||||
if ( rr_class == C_IN && rr_type == T_NS )
|
||||
{
|
||||
/* Decode the RR data and add it to the nameservers list */
|
||||
status = ares_expand_name( aptr, abuf, alen, &rr_data, &len );
|
||||
status = ares__expand_name_for_response( aptr, abuf, alen, &rr_data,
|
||||
&len);
|
||||
if ( status != ARES_SUCCESS )
|
||||
{
|
||||
break;
|
||||
|
@@ -17,19 +17,26 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.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_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/nameser.h>
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -48,6 +55,7 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
||||
char *ptrname, *hostname, *rr_name, *rr_data;
|
||||
struct hostent *hostent;
|
||||
int aliascnt = 0;
|
||||
int alias_alloc = 8;
|
||||
char ** aliases;
|
||||
|
||||
/* Set *host to NULL for all failure cases. */
|
||||
@@ -65,7 +73,7 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
||||
|
||||
/* Expand the name from the question, and skip past the question. */
|
||||
aptr = abuf + HFIXEDSZ;
|
||||
status = ares_expand_name(aptr, abuf, alen, &ptrname, &len);
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &ptrname, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return status;
|
||||
if (aptr + len + QFIXEDSZ > abuf + alen)
|
||||
@@ -77,7 +85,7 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
||||
|
||||
/* Examine each answer resource record (RR) in turn. */
|
||||
hostname = NULL;
|
||||
aliases = (char **) malloc(8 * sizeof(char *));
|
||||
aliases = malloc(alias_alloc * sizeof(char *));
|
||||
if (!aliases)
|
||||
{
|
||||
free(ptrname);
|
||||
@@ -86,7 +94,7 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
||||
for (i = 0; i < (int)ancount; i++)
|
||||
{
|
||||
/* Decode the RR up to the data field. */
|
||||
status = ares_expand_name(aptr, abuf, alen, &rr_name, &len);
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
aptr += len;
|
||||
@@ -104,7 +112,8 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
||||
&& strcasecmp(rr_name, ptrname) == 0)
|
||||
{
|
||||
/* Decode the RR data and set hostname to it. */
|
||||
status = ares_expand_name(aptr, abuf, alen, &rr_data, &len);
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
|
||||
&len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
if (hostname)
|
||||
@@ -118,14 +127,23 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
||||
}
|
||||
strncpy(aliases[aliascnt], rr_data, strlen(rr_data)+1);
|
||||
aliascnt++;
|
||||
if ((aliascnt%8)==0)
|
||||
aliases = (char **) realloc(aliases, (aliascnt/16+1) * sizeof(char *));
|
||||
if (aliascnt >= alias_alloc) {
|
||||
char **ptr;
|
||||
alias_alloc *= 2;
|
||||
ptr = realloc(aliases, alias_alloc * sizeof(char *));
|
||||
if(!ptr) {
|
||||
status = ARES_ENOMEM;
|
||||
break;
|
||||
}
|
||||
aliases = ptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (rr_class == C_IN && rr_type == T_CNAME)
|
||||
{
|
||||
/* Decode the RR data and replace ptrname with it. */
|
||||
status = ares_expand_name(aptr, abuf, alen, &rr_data, &len);
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
|
||||
&len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
free(ptrname);
|
||||
|
@@ -43,6 +43,7 @@
|
||||
#undef closesocket
|
||||
#define closesocket(s) close_s(s)
|
||||
#define writev(s,v,c) writev_s(s,v,c)
|
||||
#define HAVE_WRITEV 1
|
||||
#endif
|
||||
|
||||
#ifdef NETWARE
|
||||
@@ -94,6 +95,36 @@
|
||||
#include "ares_ipv6.h"
|
||||
#include "ares_llist.h"
|
||||
|
||||
#ifndef HAVE_STRDUP
|
||||
# include "ares_strdup.h"
|
||||
# define strdup(ptr) ares_strdup(ptr)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRCASECMP
|
||||
# include "ares_strcasecmp.h"
|
||||
# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
# include "ares_strcasecmp.h"
|
||||
# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_WRITEV
|
||||
# include "ares_writev.h"
|
||||
# define writev(s,ptr,cnt) ares_writev(s,ptr,cnt)
|
||||
#endif
|
||||
|
||||
struct ares_addr {
|
||||
int family;
|
||||
union {
|
||||
struct in_addr addr4;
|
||||
struct in6_addr addr6;
|
||||
} addr;
|
||||
};
|
||||
#define addrV4 addr.addr4
|
||||
#define addrV6 addr.addr6
|
||||
|
||||
struct query;
|
||||
|
||||
struct send_request {
|
||||
@@ -174,8 +205,8 @@ struct query {
|
||||
void *arg;
|
||||
|
||||
/* Query status */
|
||||
int try;
|
||||
int server;
|
||||
int try; /* Number of times we tried this query already. */
|
||||
int server; /* Server this query has last been sent to. */
|
||||
struct query_server_info *server_info; /* per-server state */
|
||||
int using_tcp;
|
||||
int error_status;
|
||||
@@ -192,17 +223,17 @@ struct query_server_info {
|
||||
#define PATTERN_MASK 0x1
|
||||
#define PATTERN_CIDR 0x2
|
||||
|
||||
union ares_addr {
|
||||
struct in_addr addr4;
|
||||
struct in6_addr addr6;
|
||||
};
|
||||
|
||||
struct apattern {
|
||||
union ares_addr addr;
|
||||
union
|
||||
{
|
||||
union ares_addr addr;
|
||||
unsigned short bits;
|
||||
struct in_addr addr4;
|
||||
struct in6_addr addr6;
|
||||
} addr;
|
||||
union
|
||||
{
|
||||
struct in_addr addr4;
|
||||
struct in6_addr addr6;
|
||||
unsigned short bits;
|
||||
} mask;
|
||||
int family;
|
||||
unsigned short type;
|
||||
@@ -221,6 +252,7 @@ struct ares_channeldata {
|
||||
int timeout; /* in milliseconds */
|
||||
int tries;
|
||||
int ndots;
|
||||
int rotate; /* if true, all servers specified are used */
|
||||
int udp_port;
|
||||
int tcp_port;
|
||||
int socket_send_buffer_size;
|
||||
@@ -231,6 +263,8 @@ struct ares_channeldata {
|
||||
int nsort;
|
||||
char *lookups;
|
||||
|
||||
int optmask; /* the option bitfield passed in at init time */
|
||||
|
||||
/* Server addresses and communications state */
|
||||
struct server_state *servers;
|
||||
int nservers;
|
||||
@@ -247,6 +281,9 @@ struct ares_channeldata {
|
||||
just to draw the line somewhere. */
|
||||
time_t last_timeout_processed;
|
||||
|
||||
/* Last server we sent a query to. */
|
||||
int last_server;
|
||||
|
||||
/* Circular, doubly-linked list of queries, bucketed various ways.... */
|
||||
/* All active queries in a single list: */
|
||||
struct list_node all_queries;
|
||||
@@ -259,6 +296,9 @@ struct ares_channeldata {
|
||||
|
||||
ares_sock_state_cb sock_state_cb;
|
||||
void *sock_state_cb_data;
|
||||
|
||||
ares_sock_create_callback sock_create_cb;
|
||||
void *sock_create_cb_data;
|
||||
};
|
||||
|
||||
/* return true if now is exactly check time or later */
|
||||
@@ -277,8 +317,11 @@ 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);
|
||||
void ares__free_query(struct query *query);
|
||||
short ares__generate_new_id(rc4_key* key);
|
||||
unsigned short ares__generate_new_id(rc4_key* key);
|
||||
struct timeval ares__tvnow(void);
|
||||
int ares__expand_name_for_response(const unsigned char *encoded,
|
||||
const unsigned char *abuf, int alen,
|
||||
char **s, long *enclen);
|
||||
#if 0 /* Not used */
|
||||
long ares__tvdiff(struct timeval t1, struct timeval t2);
|
||||
#endif
|
||||
|
@@ -1,7 +1,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
|
||||
@@ -18,47 +18,45 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
|
||||
#else
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_UIO_H
|
||||
#include <sys/uio.h>
|
||||
# include <sys/uio.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h> /* <netinet/tcp.h> may need it */
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_TCP_H
|
||||
#include <netinet/tcp.h> /* for TCP_NODELAY */
|
||||
# include <netinet/tcp.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
#include <arpa/nameser.h>
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
# include <sys/time.h>
|
||||
#endif
|
||||
#endif /* WIN32 && !WATT32 */
|
||||
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
# include <strings.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
#include <sys/ioctl.h>
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
#ifdef NETWARE
|
||||
#include <sys/filio.h>
|
||||
# include <sys/filio.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
@@ -106,7 +104,7 @@ static void end_query(ares_channel channel, struct query *query, int status,
|
||||
int ares__timedout(struct timeval *now,
|
||||
struct timeval *check)
|
||||
{
|
||||
int secs = (now->tv_sec - check->tv_sec);
|
||||
long secs = (now->tv_sec - check->tv_sec);
|
||||
|
||||
if(secs > 0)
|
||||
return 1; /* yes, timed out */
|
||||
@@ -431,7 +429,7 @@ static void read_udp_packets(ares_channel channel, fd_set *read_fds,
|
||||
unsigned char buf[PACKETSZ + 1];
|
||||
#ifdef HAVE_RECVFROM
|
||||
struct sockaddr_in from;
|
||||
socklen_t fromlen;
|
||||
ares_socklen_t fromlen;
|
||||
#endif
|
||||
|
||||
if(!read_fds && (read_fd == ARES_SOCKET_BAD))
|
||||
@@ -672,30 +670,33 @@ static void skip_server(ares_channel channel, struct query *query,
|
||||
static void next_server(ares_channel channel, struct query *query,
|
||||
struct timeval *now)
|
||||
{
|
||||
/* Advance to the next server or try. */
|
||||
query->server++;
|
||||
for (; query->try < channel->tries; query->try++)
|
||||
/* We need to try each server channel->tries times. We have channel->nservers
|
||||
* servers to try. In total, we need to do channel->nservers * channel->tries
|
||||
* attempts. Use query->try to remember how many times we already attempted
|
||||
* this query. Use modular arithmetic to find the next server to try. */
|
||||
while (++(query->try) < (channel->nservers * channel->tries))
|
||||
{
|
||||
for (; query->server < channel->nservers; query->server++)
|
||||
struct server_state *server;
|
||||
|
||||
/* Move on to the next server. */
|
||||
query->server = (query->server + 1) % channel->nservers;
|
||||
server = &channel->servers[query->server];
|
||||
|
||||
/* We don't want to use this server if (1) we decided this
|
||||
* connection is broken, and thus about to be closed, (2)
|
||||
* we've decided to skip this server because of earlier
|
||||
* errors we encountered, or (3) we already sent this query
|
||||
* over this exact connection.
|
||||
*/
|
||||
if (!server->is_broken &&
|
||||
!query->server_info[query->server].skip_server &&
|
||||
!(query->using_tcp &&
|
||||
(query->server_info[query->server].tcp_connection_generation ==
|
||||
server->tcp_connection_generation)))
|
||||
{
|
||||
struct server_state *server = &channel->servers[query->server];
|
||||
/* We don't want to use this server if (1) we decided this
|
||||
* connection is broken, and thus about to be closed, (2)
|
||||
* we've decided to skip this server because of earlier
|
||||
* errors we encountered, or (3) we already sent this query
|
||||
* over this exact connection.
|
||||
*/
|
||||
if (!server->is_broken &&
|
||||
!query->server_info[query->server].skip_server &&
|
||||
!(query->using_tcp &&
|
||||
(query->server_info[query->server].tcp_connection_generation ==
|
||||
server->tcp_connection_generation)))
|
||||
{
|
||||
ares__send_query(channel, query, now);
|
||||
return;
|
||||
}
|
||||
ares__send_query(channel, query, now);
|
||||
return;
|
||||
}
|
||||
query->server = 0;
|
||||
|
||||
/* You might think that with TCP we only need one try. However,
|
||||
* even when using TCP, servers can time-out our connection just
|
||||
@@ -704,6 +705,8 @@ static void next_server(ares_channel channel, struct query *query,
|
||||
* tickle a bug that drops our request.
|
||||
*/
|
||||
}
|
||||
|
||||
/* If we are here, all attempts to perform query failed. */
|
||||
end_query(channel, query, query->error_status, NULL, 0);
|
||||
}
|
||||
|
||||
@@ -712,6 +715,7 @@ void ares__send_query(ares_channel channel, struct query *query,
|
||||
{
|
||||
struct send_request *sendreq;
|
||||
struct server_state *server;
|
||||
int timeplus;
|
||||
|
||||
server = &channel->servers[query->server];
|
||||
if (query->using_tcp)
|
||||
@@ -775,10 +779,11 @@ void ares__send_query(ares_channel channel, struct query *query,
|
||||
return;
|
||||
}
|
||||
}
|
||||
timeplus = channel->timeout << (query->try / channel->nservers);
|
||||
timeplus = (timeplus * (9 + (rand () & 7))) / 16;
|
||||
query->timeout = *now;
|
||||
ares__timeadd(&query->timeout,
|
||||
(query->try == 0) ? channel->timeout
|
||||
: channel->timeout << query->try / channel->nservers);
|
||||
timeplus);
|
||||
/* Keep track of queries bucketed by timeout, so we can process
|
||||
* timeout events quickly.
|
||||
*/
|
||||
@@ -803,68 +808,51 @@ void ares__send_query(ares_channel channel, struct query *query,
|
||||
static int setsocknonblock(ares_socket_t sockfd, /* operate on this */
|
||||
int nonblock /* TRUE or FALSE */)
|
||||
{
|
||||
#undef SETBLOCK
|
||||
#define SETBLOCK 0
|
||||
#ifdef HAVE_O_NONBLOCK
|
||||
#if defined(USE_BLOCKING_SOCKETS)
|
||||
|
||||
return 0; /* returns success */
|
||||
|
||||
#elif defined(HAVE_FCNTL_O_NONBLOCK)
|
||||
|
||||
/* most recent unix versions */
|
||||
int flags;
|
||||
|
||||
flags = fcntl(sockfd, F_GETFL, 0);
|
||||
if (FALSE != nonblock)
|
||||
return fcntl(sockfd, F_SETFL, flags | O_NONBLOCK);
|
||||
else
|
||||
return fcntl(sockfd, F_SETFL, flags & (~O_NONBLOCK));
|
||||
#undef SETBLOCK
|
||||
#define SETBLOCK 1
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_FIONBIO) && (SETBLOCK == 0)
|
||||
#elif defined(HAVE_IOCTL_FIONBIO)
|
||||
|
||||
/* older unix versions */
|
||||
int flags;
|
||||
|
||||
flags = nonblock;
|
||||
return ioctl(sockfd, FIONBIO, &flags);
|
||||
#undef SETBLOCK
|
||||
#define SETBLOCK 2
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_IOCTLSOCKET) && (SETBLOCK == 0)
|
||||
#elif defined(HAVE_IOCTLSOCKET_FIONBIO)
|
||||
|
||||
#ifdef WATT32
|
||||
char flags;
|
||||
#else
|
||||
/* Windows? */
|
||||
/* Windows */
|
||||
unsigned long flags;
|
||||
#endif
|
||||
flags = nonblock;
|
||||
|
||||
return ioctlsocket(sockfd, FIONBIO, &flags);
|
||||
#undef SETBLOCK
|
||||
#define SETBLOCK 3
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_IOCTLSOCKET_CASE) && (SETBLOCK == 0)
|
||||
/* presumably for Amiga */
|
||||
#elif defined(HAVE_IOCTLSOCKET_CAMEL_FIONBIO)
|
||||
|
||||
/* Amiga */
|
||||
return IoctlSocket(sockfd, FIONBIO, (long)nonblock);
|
||||
#undef SETBLOCK
|
||||
#define SETBLOCK 4
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SO_NONBLOCK) && (SETBLOCK == 0)
|
||||
#elif defined(HAVE_SETSOCKOPT_SO_NONBLOCK)
|
||||
|
||||
/* BeOS */
|
||||
long b = nonblock ? 1 : 0;
|
||||
return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b));
|
||||
#undef SETBLOCK
|
||||
#define SETBLOCK 5
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DISABLED_NONBLOCKING
|
||||
return 0; /* returns success */
|
||||
#undef SETBLOCK
|
||||
#define SETBLOCK 6
|
||||
#endif
|
||||
|
||||
#if (SETBLOCK == 0)
|
||||
#error "no non-blocking method was found/used/set"
|
||||
#else
|
||||
# error "no non-blocking method was found/used/set"
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -908,10 +896,11 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
|
||||
/* Configure it. */
|
||||
if (configure_socket(s, channel) < 0)
|
||||
{
|
||||
close(s);
|
||||
closesocket(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
|
||||
@@ -922,23 +911,37 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
|
||||
if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY,
|
||||
(void *)&opt, sizeof(opt)) == -1)
|
||||
{
|
||||
close(s);
|
||||
closesocket(s);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Connect to the server. */
|
||||
memset(&sockin, 0, sizeof(sockin));
|
||||
sockin.sin_family = AF_INET;
|
||||
sockin.sin_addr = server->addr;
|
||||
sockin.sin_port = (unsigned short)(channel->tcp_port & 0xffff);
|
||||
if (connect(s, (struct sockaddr *) &sockin, sizeof(sockin)) == -1) {
|
||||
int err = SOCKERRNO;
|
||||
if (connect(s, (struct sockaddr *) &sockin, sizeof(sockin)) == -1)
|
||||
{
|
||||
int err = SOCKERRNO;
|
||||
|
||||
if (err != EINPROGRESS && err != EWOULDBLOCK) {
|
||||
closesocket(s);
|
||||
return -1;
|
||||
if (err != EINPROGRESS && err != EWOULDBLOCK)
|
||||
{
|
||||
closesocket(s);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (channel->sock_create_cb)
|
||||
{
|
||||
int err = channel->sock_create_cb(s, SOCK_STREAM,
|
||||
channel->sock_create_cb_data);
|
||||
if (err < 0)
|
||||
{
|
||||
closesocket(s);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SOCK_STATE_CALLBACK(channel, s, 1, 0);
|
||||
server->tcp_buffer_pos = 0;
|
||||
@@ -960,7 +963,7 @@ static int open_udp_socket(ares_channel channel, struct server_state *server)
|
||||
/* Set the socket non-blocking. */
|
||||
if (configure_socket(s, channel) < 0)
|
||||
{
|
||||
close(s);
|
||||
closesocket(s);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -971,8 +974,24 @@ static int open_udp_socket(ares_channel channel, struct server_state *server)
|
||||
sockin.sin_port = (unsigned short)(channel->udp_port & 0xffff);
|
||||
if (connect(s, (struct sockaddr *) &sockin, sizeof(sockin)) == -1)
|
||||
{
|
||||
closesocket(s);
|
||||
return -1;
|
||||
int err = SOCKERRNO;
|
||||
|
||||
if (err != EINPROGRESS && err != EWOULDBLOCK)
|
||||
{
|
||||
closesocket(s);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (channel->sock_create_cb)
|
||||
{
|
||||
int err = channel->sock_create_cb(s, SOCK_DGRAM,
|
||||
channel->sock_create_cb_data);
|
||||
if (err < 0)
|
||||
{
|
||||
closesocket(s);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
SOCK_STATE_CALLBACK(channel, s, 1, 0);
|
||||
|
@@ -17,14 +17,19 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/nameser.h>
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.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>
|
||||
@@ -65,7 +70,7 @@ void ares__rc4(rc4_key* key, unsigned char *buffer_ptr, int buffer_len)
|
||||
key->y = y;
|
||||
}
|
||||
|
||||
static struct query* find_query_by_id(ares_channel channel, int id)
|
||||
static struct query* find_query_by_id(ares_channel channel, unsigned short id)
|
||||
{
|
||||
unsigned short qid;
|
||||
struct list_node* list_head;
|
||||
@@ -90,15 +95,15 @@ static struct query* find_query_by_id(ares_channel channel, int id)
|
||||
performed per id generation. In practice this search should happen only
|
||||
once per newly generated id
|
||||
*/
|
||||
static int generate_unique_id(ares_channel channel)
|
||||
static unsigned short generate_unique_id(ares_channel channel)
|
||||
{
|
||||
int id;
|
||||
unsigned short id;
|
||||
|
||||
do {
|
||||
id = ares__generate_new_id(&channel->id_key);
|
||||
} while (find_query_by_id(channel,id));
|
||||
id = ares__generate_new_id(&channel->id_key);
|
||||
} while (find_query_by_id(channel, id));
|
||||
|
||||
return id;
|
||||
return (unsigned short)id;
|
||||
}
|
||||
|
||||
void ares_query(ares_channel channel, const char *name, int dnsclass,
|
||||
|
145
ares/ares_rules.h
Normal file
145
ares/ares_rules.h
Normal file
@@ -0,0 +1,145 @@
|
||||
#ifndef __CARES_RULES_H
|
||||
#define __CARES_RULES_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 2009 by Daniel Stenberg et al
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software and its
|
||||
* documentation for any purpose and without fee is hereby granted, provided
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* ================================================================ */
|
||||
/* COMPILE TIME SANITY CHECKS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* NOTE 1:
|
||||
* -------
|
||||
*
|
||||
* All checks done in this file are intentionally placed in a public
|
||||
* header file which is pulled by ares.h when an application is
|
||||
* being built using an already built c-ares library. Additionally
|
||||
* this file is also included and used when building the library.
|
||||
*
|
||||
* If compilation fails on this file it is certainly sure that the
|
||||
* problem is elsewhere. It could be a problem in the ares_build.h
|
||||
* header file, or simply that you are using different compilation
|
||||
* settings than those used to build the library.
|
||||
*
|
||||
* Nothing in this file is intended to be modified or adjusted by the
|
||||
* c-ares library user nor by the c-ares library builder.
|
||||
*
|
||||
* Do not deactivate any check, these are done to make sure that the
|
||||
* library is properly built and used.
|
||||
*
|
||||
* You can find further help on the c-ares development mailing list:
|
||||
* http://cool.haxx.se/mailman/listinfo/c-ares/
|
||||
*
|
||||
* NOTE 2
|
||||
* ------
|
||||
*
|
||||
* Some of the following compile time checks are based on the fact
|
||||
* 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:
|
||||
*
|
||||
* "negative subscript or subscript is too large"
|
||||
* "array must have at least one element"
|
||||
* "-1 is an illegal array size"
|
||||
* "size of array is negative"
|
||||
*
|
||||
* If you are building an application which tries to use an already
|
||||
* built c-ares library and you are getting this kind of errors on
|
||||
* this file, it is a clear indication that there is a mismatch between
|
||||
* how the library was built and how you are trying to use it for your
|
||||
* application. Your already compiled or binary library provider is the
|
||||
* only one who can give you the details you need to properly use it.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Verify that some macros are actually defined.
|
||||
*/
|
||||
|
||||
#ifndef CARES_SIZEOF_LONG
|
||||
# error "CARES_SIZEOF_LONG definition is missing!"
|
||||
Error Compilation_aborted_CARES_SIZEOF_LONG_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CARES_TYPEOF_ARES_SOCKLEN_T
|
||||
# error "CARES_TYPEOF_ARES_SOCKLEN_T definition is missing!"
|
||||
Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_is_missing
|
||||
#endif
|
||||
|
||||
#ifndef CARES_SIZEOF_ARES_SOCKLEN_T
|
||||
# error "CARES_SIZEOF_ARES_SOCKLEN_T definition is missing!"
|
||||
Error Compilation_aborted_CARES_SIZEOF_ARES_SOCKLEN_T_is_missing
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Macros private to this header file.
|
||||
*/
|
||||
|
||||
#define CareschkszEQ(t, s) sizeof(t) == s ? 1 : -1
|
||||
|
||||
#define CareschkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1
|
||||
|
||||
/*
|
||||
* Verify that the size previously defined and expected for long
|
||||
* is the same as the one reported by sizeof() at compile time.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__cares_rule_01__
|
||||
[CareschkszEQ(long, CARES_SIZEOF_LONG)];
|
||||
|
||||
/*
|
||||
* Verify that the size previously defined and expected for
|
||||
* ares_socklen_t is actually the the same as the one reported
|
||||
* by sizeof() at compile time.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__cares_rule_02__
|
||||
[CareschkszEQ(ares_socklen_t, CARES_SIZEOF_ARES_SOCKLEN_T)];
|
||||
|
||||
/*
|
||||
* Verify at compile time that the size of ares_socklen_t as reported
|
||||
* by sizeof() is greater or equal than the one reported for int for
|
||||
* the current compilation.
|
||||
*/
|
||||
|
||||
typedef char
|
||||
__cares_rule_03__
|
||||
[CareschkszGE(ares_socklen_t, int)];
|
||||
|
||||
/* ================================================================ */
|
||||
/* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* Get rid of macros private to this header file.
|
||||
*/
|
||||
|
||||
#undef CareschkszEQ
|
||||
#undef CareschkszGE
|
||||
|
||||
/*
|
||||
* Get rid of macros not intended to exist beyond this point.
|
||||
*/
|
||||
|
||||
#undef CARES_PULL_WS2TCPIP_H
|
||||
#undef CARES_PULL_SYS_TYPES_H
|
||||
#undef CARES_PULL_SYS_SOCKET_H
|
||||
|
||||
#undef CARES_TYPEOF_ARES_SOCKLEN_T
|
||||
|
||||
#endif /* __CARES_RULES_H */
|
@@ -24,9 +24,7 @@ ares_save_options \- Save configuration values obtained from initialized ares_ch
|
||||
.B void ares_save_options(ares_channel \fIchannel\fP, struct ares_options *\fIoptions\fP, int *\fIoptmask\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.B ares_save_options
|
||||
function saves the channel data identified by
|
||||
The \fBares_save_options(3)\fP function saves the channel data identified by
|
||||
.IR channel ,
|
||||
into the options struct identified by
|
||||
.IR options ,
|
||||
@@ -38,11 +36,18 @@ 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 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
|
||||
functioning, but it can only return config data that can be represented in
|
||||
this config struct, which may no longer be the complete set of config
|
||||
options. \fBares_dup(3)\fP will not have that restriction.
|
||||
.SH SEE ALSO
|
||||
.BR ares_destroy_options (3),
|
||||
.BR ares_init_options (3)
|
||||
.BR ares_init_options (3),
|
||||
.BR ares_dup (3)
|
||||
.SH AVAILABILITY
|
||||
ares_save_options(3) was added in c-ares 1.4.0
|
||||
.SH AUTHOR
|
||||
Brad House
|
||||
.br
|
||||
|
@@ -16,14 +16,15 @@
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
@@ -291,7 +292,7 @@ static int single_domain(ares_channel channel, const char *name, char **s)
|
||||
}
|
||||
else
|
||||
{
|
||||
error = ERRNO;
|
||||
error = errno;
|
||||
switch(error)
|
||||
{
|
||||
case ENOENT:
|
||||
|
@@ -17,14 +17,19 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/nameser.h>
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.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>
|
||||
@@ -93,7 +98,13 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
|
||||
|
||||
/* Initialize query status. */
|
||||
query->try = 0;
|
||||
query->server = 0;
|
||||
|
||||
/* Choose the server to send the query to. If rotation is enabled, keep track
|
||||
* of the next server we want to use. */
|
||||
query->server = channel->last_server;
|
||||
if (channel->rotate == 1)
|
||||
channel->last_server = (channel->last_server + 1) % channel->nservers;
|
||||
|
||||
for (i = 0; i < channel->nservers; i++)
|
||||
{
|
||||
query->server_info[i].skip_server = 0;
|
||||
|
24
ares/ares_set_socket_callback.3
Normal file
24
ares/ares_set_socket_callback.3
Normal file
@@ -0,0 +1,24 @@
|
||||
.\" $Id$
|
||||
.\"
|
||||
.TH ARES_SET_SOCKET_CALLBACK 3 "2 Dec 2008"
|
||||
.SH NAME
|
||||
ares_set_socket_callback \- Set a socket creation callback
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
int ares_set_socket_callback(ares_channel \fIchannel\fP,
|
||||
ares_sock_create_callback \fIcallback\fP,
|
||||
void *\fIuserdata\fP)
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
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
|
||||
things are fine, or use the standard ares error codes to signal errors
|
||||
back. Returned errors will abort the ares operation.
|
||||
.SH SEE ALSO
|
||||
.BR ares_init_options (3)
|
||||
.SH AVAILABILITY
|
||||
ares_set_socket_callback(3) was added in c-ares 1.6.0
|
||||
.SH AUTHOR
|
||||
Gregor Jasny
|
||||
|
67
ares/ares_strcasecmp.c
Normal file
67
ares/ares_strcasecmp.c
Normal file
@@ -0,0 +1,67 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_strcasecmp.h"
|
||||
|
||||
#ifndef HAVE_STRCASECMP
|
||||
int ares_strcasecmp(const char *a, const char *b)
|
||||
{
|
||||
#if defined(HAVE_STRCMPI)
|
||||
return strcmpi(a, b);
|
||||
#elif defined(HAVE_STRICMP)
|
||||
return stricmp(a, b);
|
||||
#else
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < (size_t)-1; i++) {
|
||||
int c1 = ISUPPER(a[i]) ? tolower(a[i]) : a[i];
|
||||
int c2 = ISUPPER(b[i]) ? tolower(b[i]) : b[i];
|
||||
if (c1 != c2)
|
||||
return c1-c2;
|
||||
if (!c1)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
int ares_strncasecmp(const char *a, const char *b, size_t n)
|
||||
{
|
||||
#if defined(HAVE_STRNCMPI)
|
||||
return strncmpi(a, b, n);
|
||||
#elif defined(HAVE_STRNICMP)
|
||||
return strnicmp(a, b, n);
|
||||
#else
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
int c1 = ISUPPER(a[i]) ? tolower(a[i]) : a[i];
|
||||
int c2 = ISUPPER(b[i]) ? tolower(b[i]) : b[i];
|
||||
if (c1 != c2)
|
||||
return c1-c2;
|
||||
if (!c1)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
31
ares/ares_strcasecmp.h
Normal file
31
ares/ares_strcasecmp.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef HEADER_CARES_STRCASECMP_H
|
||||
#define HEADER_CARES_STRCASECMP_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#ifndef HAVE_STRCASECMP
|
||||
extern int ares_strcasecmp(const char *a, const char *b);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
extern int ares_strncasecmp(const char *a, const char *b, size_t n);
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CARES_STRCASECMP_H */
|
43
ares/ares_strdup.c
Normal file
43
ares/ares_strdup.c
Normal file
@@ -0,0 +1,43 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_strdup.h"
|
||||
|
||||
#ifndef HAVE_STRDUP
|
||||
char *ares_strdup(const char *s1)
|
||||
{
|
||||
size_t sz;
|
||||
char * s2;
|
||||
|
||||
if(s1) {
|
||||
sz = strlen(s1);
|
||||
if(sz < (size_t)-1) {
|
||||
sz++;
|
||||
if(sz < ((size_t)-1) / sizeof(char)) {
|
||||
s2 = malloc(sz * sizeof(char));
|
||||
if(s2) {
|
||||
memcpy(s2, s1, sz * sizeof(char));
|
||||
return s2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return (char *)NULL;
|
||||
}
|
||||
#endif
|
27
ares/ares_strdup.h
Normal file
27
ares/ares_strdup.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef HEADER_CARES_STRDUP_H
|
||||
#define HEADER_CARES_STRDUP_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#ifndef HAVE_STRDUP
|
||||
extern char *ares_strdup(const char *s1);
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CARES_STRDUP_H */
|
@@ -43,7 +43,10 @@ const char *ares_strerror(int code)
|
||||
"Misformatted string",
|
||||
"Illegal flags specified",
|
||||
"Given hostname is not numeric",
|
||||
"Illegal hints flags specified"
|
||||
"Illegal hints flags specified",
|
||||
"Error loading iphlpapi.dll",
|
||||
"Error loading advapi32.dll",
|
||||
"Could not find GetNetworkParams function"
|
||||
};
|
||||
|
||||
if(code >= 0 && code < (int)(sizeof(errtext) / sizeof(*errtext)))
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/* $Id$ */
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_version.h"
|
||||
#include "ares.h"
|
||||
|
||||
const char *ares_version(int *version)
|
||||
{
|
||||
|
@@ -4,22 +4,19 @@
|
||||
#define ARES__VERSION_H
|
||||
|
||||
#define ARES_VERSION_MAJOR 1
|
||||
#define ARES_VERSION_MINOR 5
|
||||
#define ARES_VERSION_PATCH 4
|
||||
#define ARES_VERSION_MINOR 6
|
||||
#define ARES_VERSION_PATCH 1
|
||||
#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
|
||||
(ARES_VERSION_MINOR<<8)|\
|
||||
(ARES_VERSION_PATCH))
|
||||
#define ARES_VERSION_STR "1.5.4-CVS"
|
||||
#define ARES_VERSION_STR "1.6.1-CVS"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
const char *ares_version(int *version);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#if (ARES_VERSION >= 0x010601)
|
||||
# define CARES_HAVE_ARES_LIBRARY_INIT 1
|
||||
# define CARES_HAVE_ARES_LIBRARY_CLEANUP 1
|
||||
#else
|
||||
# undef CARES_HAVE_ARES_LIBRARY_INIT
|
||||
# undef CARES_HAVE_ARES_LIBRARY_CLEANUP
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
80
ares/ares_writev.c
Normal file
80
ares/ares_writev.c
Normal file
@@ -0,0 +1,80 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#ifdef HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
#ifndef HAVE_WRITEV
|
||||
ssize_t ares_writev(ares_socket_t s, const struct iovec *iov, int iovcnt)
|
||||
{
|
||||
char *buffer, *bp;
|
||||
int i;
|
||||
size_t bytes = 0;
|
||||
ssize_t result;
|
||||
|
||||
/* Validate iovcnt */
|
||||
if (iovcnt <= 0)
|
||||
{
|
||||
SET_ERRNO(EINVAL);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Validate and find the sum of the iov_len values in the iov array */
|
||||
for (i = 0; i < iovcnt; i++)
|
||||
{
|
||||
if (iov[i].iov_len > INT_MAX - bytes)
|
||||
{
|
||||
SET_ERRNO(EINVAL);
|
||||
return (-1);
|
||||
}
|
||||
bytes += iov[i].iov_len;
|
||||
}
|
||||
|
||||
if (bytes == 0)
|
||||
return (0);
|
||||
|
||||
/* Allocate a temporary buffer to hold the data */
|
||||
buffer = malloc(bytes);
|
||||
if (!buffer)
|
||||
{
|
||||
SET_ERRNO(ENOMEM);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Copy the data into buffer */
|
||||
for (bp = buffer, i = 0; i < iovcnt; ++i)
|
||||
{
|
||||
memcpy (bp, iov[i].iov_base, iov[i].iov_len);
|
||||
bp += iov[i].iov_len;
|
||||
}
|
||||
|
||||
/* Send buffer contents */
|
||||
result = swrite(s, buffer, bytes);
|
||||
|
||||
free(buffer);
|
||||
|
||||
return (result);
|
||||
}
|
||||
#endif
|
||||
|
37
ares/ares_writev.h
Normal file
37
ares/ares_writev.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef HEADER_CARES_WRITEV_H
|
||||
#define HEADER_CARES_WRITEV_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares.h"
|
||||
|
||||
#ifndef HAVE_WRITEV
|
||||
|
||||
/* Structure for scatter/gather I/O. */
|
||||
struct iovec
|
||||
{
|
||||
void *iov_base; /* Pointer to data. */
|
||||
size_t iov_len; /* Length of data. */
|
||||
};
|
||||
|
||||
extern ssize_t ares_writev(ares_socket_t s, const struct iovec *iov, int iovcnt);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CARES_WRITEV_H */
|
@@ -1,6 +1,44 @@
|
||||
#!/bin/sh
|
||||
|
||||
${LIBTOOLIZE:-libtoolize} --copy --automake --force
|
||||
# The logic for finding the right libtoolize is taken from libcurl's buildconf
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# findtool works as 'which' but we use a different name to make it more
|
||||
# obvious we aren't using 'which'! ;-)
|
||||
#
|
||||
findtool(){
|
||||
file="$1"
|
||||
|
||||
old_IFS=$IFS; IFS=':'
|
||||
for path in $PATH
|
||||
do
|
||||
IFS=$old_IFS
|
||||
# echo "checks for $file in $path" >&2
|
||||
if test -f "$path/$file"; then
|
||||
echo "$path/$file"
|
||||
return
|
||||
fi
|
||||
done
|
||||
IFS=$old_IFS
|
||||
}
|
||||
|
||||
# this approach that tries 'glibtool' first is some kind of work-around for
|
||||
# some BSD-systems I believe that use to provide the GNU libtool named
|
||||
# glibtool, with 'libtool' being something completely different.
|
||||
libtool=`findtool glibtool 2>/dev/null`
|
||||
if test ! -x "$libtool"; then
|
||||
libtool=`findtool ${LIBTOOL:-libtool}`
|
||||
fi
|
||||
|
||||
if test -z "$LIBTOOLIZE"; then
|
||||
# set the LIBTOOLIZE here so that glibtoolize is used if glibtool was found
|
||||
# $libtool is already the full path
|
||||
libtoolize="${libtool}ize"
|
||||
else
|
||||
libtoolize=`findtool $LIBTOOLIZE`
|
||||
fi
|
||||
|
||||
${libtoolize} --copy --automake --force
|
||||
${ACLOCAL:-aclocal} -I m4 $ACLOCAL_FLAGS
|
||||
${AUTOHEADER:-autoheader}
|
||||
${AUTOCONF:-autoconf}
|
||||
|
8
ares/buildconf.bat
Normal file
8
ares/buildconf.bat
Normal file
@@ -0,0 +1,8 @@
|
||||
@echo off
|
||||
REM set up a CVS tree to build when there's no autotools
|
||||
REM $Revision$
|
||||
REM $Date$
|
||||
|
||||
REM create ares_build.h
|
||||
copy /Y ares_build.h.dist ares_build.h
|
||||
|
@@ -29,6 +29,9 @@
|
||||
#define HAVE_GETOPT_H 1
|
||||
#endif
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define if you have the <signal.h> header file. */
|
||||
#define HAVE_SIGNAL_H 1
|
||||
|
||||
@@ -76,9 +79,30 @@
|
||||
/* FUNCTIONS */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Define if you have the ioctlsocket function. */
|
||||
/* Define if you have the ioctlsocket function. */
|
||||
#define HAVE_IOCTLSOCKET 1
|
||||
|
||||
/* Define if you have a working ioctlsocket FIONBIO function. */
|
||||
#define HAVE_IOCTLSOCKET_FIONBIO 1
|
||||
|
||||
/* Define if you have the strcasecmp function. */
|
||||
/* #define HAVE_STRCASECMP 1 */
|
||||
|
||||
/* Define if you have the strdup function. */
|
||||
#define HAVE_STRDUP 1
|
||||
|
||||
/* Define if you have the stricmp function. */
|
||||
#define HAVE_STRICMP 1
|
||||
|
||||
/* Define if you have the strncasecmp function. */
|
||||
/* #define HAVE_STRNCASECMP 1 */
|
||||
|
||||
/* Define if you have the strnicmp function. */
|
||||
#define HAVE_STRNICMP 1
|
||||
|
||||
/* Define if you have the gethostname function. */
|
||||
#define HAVE_GETHOSTNAME 1
|
||||
|
||||
/* Define if you have the recv function. */
|
||||
#define HAVE_RECV 1
|
||||
|
||||
@@ -147,6 +171,15 @@
|
||||
#define SOCKET int
|
||||
#define NS_INADDRSZ 4
|
||||
#define HAVE_ARPA_NAMESER_H 1
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
#define HAVE_NETDB_H 1
|
||||
#define HAVE_NETINET_IN_H 1
|
||||
#define HAVE_SYS_SOCKET_H 1
|
||||
#define HAVE_NETINET_TCP_H 1
|
||||
#define HAVE_AF_INET6 1
|
||||
#define HAVE_PF_INET6 1
|
||||
#define HAVE_STRUCT_IN6_ADDR 1
|
||||
#define HAVE_STRUCT_SOCKADDR_IN6 1
|
||||
#undef HAVE_WINSOCK_H
|
||||
#undef HAVE_WINSOCK2_H
|
||||
#undef HAVE_WS2TCPIP_H
|
||||
@@ -193,17 +226,47 @@
|
||||
#define _CRT_NONSTDC_NO_DEPRECATE 1
|
||||
#endif
|
||||
|
||||
/* VS2008 does not support Windows build targets prior to WinXP, */
|
||||
/* so, if no build target has been defined we will target WinXP. */
|
||||
/* Officially, Microsoft's Windows SDK versions 6.X do not support Windows
|
||||
2000 as a supported build target. VS2008 default installations provide an
|
||||
embedded Windows SDK v6.0A along with the claim that Windows 2000 is a
|
||||
valid build target for VS2008. Popular belief is that binaries built using
|
||||
Windows SDK versions 6.X and Windows 2000 as a build target are functional */
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1500)
|
||||
# define VS2008_MINIMUM_TARGET 0x0500
|
||||
#endif
|
||||
|
||||
/* When no build target is specified VS2008 default build target is Windows
|
||||
Vista, which leaves out even Winsows XP. If no build target has been given
|
||||
for VS2008 we will target the minimum Officially supported build target,
|
||||
which happens to be Windows XP. */
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1500)
|
||||
# define VS2008_DEFAULT_TARGET 0x0501
|
||||
#endif
|
||||
|
||||
/* VS2008 default target settings and minimum build target check */
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1500)
|
||||
# ifndef _WIN32_WINNT
|
||||
# define _WIN32_WINNT 0x0501
|
||||
# define _WIN32_WINNT VS2008_DEFAULT_TARGET
|
||||
# endif
|
||||
# ifndef WINVER
|
||||
# define WINVER 0x0501
|
||||
# define WINVER VS2008_DEFAULT_TARGET
|
||||
# endif
|
||||
# if (_WIN32_WINNT < 0x0501) || (WINVER < 0x0501)
|
||||
# error VS2008 does not support Windows build targets prior to WinXP
|
||||
# if (_WIN32_WINNT < VS2008_MINIMUM_TARGET) || (WINVER < VS2008_MINIMUM_TARGET)
|
||||
# error VS2008 does not support Windows build targets prior to Windows 2000
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is quite */
|
||||
/* convoluted, compiler dependant and in some cases even build target dependat. */
|
||||
#if defined(HAVE_WS2TCPIP_H)
|
||||
# if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
|
||||
# define HAVE_FREEADDRINFO 1
|
||||
# define HAVE_GETADDRINFO 1
|
||||
# define HAVE_GETNAMEINFO 1
|
||||
# elif defined(_MSC_VER) && (_MSC_VER >= 1200)
|
||||
# define HAVE_FREEADDRINFO 1
|
||||
# define HAVE_GETADDRINFO 1
|
||||
# define HAVE_GETNAMEINFO 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
@@ -4,10 +4,18 @@ dnl Version not hardcoded here. Fetched later from ares_version.h
|
||||
AC_INIT([c-ares], [-],
|
||||
[c-ares mailing list => http://cool.haxx.se/mailman/listinfo/c-ares])
|
||||
|
||||
CARES_OVERRIDE_AUTOCONF
|
||||
|
||||
AC_CONFIG_SRCDIR([ares_ipv6.h])
|
||||
AM_CONFIG_HEADER([config.h])
|
||||
AM_CONFIG_HEADER([config.h ares_build.h])
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
CARES_CHECK_OPTION_DEBUG
|
||||
CARES_CHECK_OPTION_OPTIMIZE
|
||||
CARES_CHECK_OPTION_WARNINGS
|
||||
|
||||
CARES_CHECK_PATH_SEPARATOR
|
||||
|
||||
dnl SED is mandatory for configure process and libtool.
|
||||
dnl Set it now, allowing it to be changed later.
|
||||
AC_PATH_PROG([SED], [sed], [not_found],
|
||||
@@ -64,7 +72,7 @@ AC_CANONICAL_HOST
|
||||
dnl Get system canonical name
|
||||
AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
|
||||
|
||||
AC_PROG_CC
|
||||
CARES_CHECK_PROG_CC
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_INSTALL
|
||||
|
||||
@@ -86,64 +94,15 @@ esac
|
||||
dnl support building of Windows DLLs
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
|
||||
dnl ************************************************************
|
||||
dnl Option to switch on debug options. This makes an assumption that
|
||||
dnl this is built as an 'ares' subdir in the curl source tree. Subject for
|
||||
dnl improval in the future!
|
||||
dnl
|
||||
AC_MSG_CHECKING([whether to enable debug options])
|
||||
AC_ARG_ENABLE(debug,
|
||||
AC_HELP_STRING([--enable-debug],[Enable pedantic debug options])
|
||||
AC_HELP_STRING([--disable-debug],[Disable debug options]),
|
||||
[ case "$enableval" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
*) AC_MSG_RESULT(yes)
|
||||
CARES_PROCESS_DEBUG_BUILD_OPTS
|
||||
|
||||
dnl when doing the debug stuff, use static library only
|
||||
AC_DISABLE_SHARED
|
||||
AM_CONDITIONAL(DEBUGBUILD, test x$want_debug = xyes)
|
||||
AM_CONDITIONAL(CURLDEBUG, test x$want_debug = xyes)
|
||||
|
||||
debugbuild="yes"
|
||||
|
||||
dnl the entire --enable-debug is a hack that lives and runs on top of
|
||||
dnl libcurl stuff so this BUILDING_LIBCURL is not THAT much uglier
|
||||
AC_DEFINE(BUILDING_LIBCURL, 1, [when building as static part of libcurl])
|
||||
|
||||
CPPFLAGS="$CPPFLAGS -DCURLDEBUG -I$srcdir/../include"
|
||||
CFLAGS="$CFLAGS -g"
|
||||
|
||||
dnl set compiler "debug" options to become more picky, and remove
|
||||
dnl optimize options from CFLAGS
|
||||
CURL_CC_DEBUG_OPTS
|
||||
|
||||
;;
|
||||
esac ],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
AM_CONDITIONAL(DEBUGBUILD, test x$debugbuild = xyes)
|
||||
AM_CONDITIONAL(CURLDEBUG, test x$debugbuild = xyes)
|
||||
|
||||
dnl skip libtool C++ and Fortran compiler checks
|
||||
m4_ifdef([AC_PROG_CXX], [m4_undefine([AC_PROG_CXX])])
|
||||
m4_defun([AC_PROG_CXX],[])
|
||||
m4_ifdef([AC_PROG_CXXCPP], [m4_undefine([AC_PROG_CXXCPP])])
|
||||
m4_defun([AC_PROG_CXXCPP],[true])
|
||||
m4_ifdef([AC_PROG_F77], [m4_undefine([AC_PROG_F77])])
|
||||
m4_defun([AC_PROG_F77],[])
|
||||
|
||||
dnl skip libtool C++ and Fortran linker checks
|
||||
m4_ifdef([AC_LIBTOOL_CXX], [m4_undefine([AC_LIBTOOL_CXX])])
|
||||
m4_defun([AC_LIBTOOL_CXX],[])
|
||||
m4_ifdef([AC_LIBTOOL_CXXCPP], [m4_undefine([AC_LIBTOOL_CXXCPP])])
|
||||
m4_defun([AC_LIBTOOL_CXXCPP],[true])
|
||||
m4_ifdef([AC_LIBTOOL_F77], [m4_undefine([AC_LIBTOOL_F77])])
|
||||
m4_defun([AC_LIBTOOL_F77],[])
|
||||
|
||||
dnl force libtool to build static libraries with PIC on AMD64-linux
|
||||
AC_MSG_CHECKING([if arch-OS host is AMD64-linux (to build static libraries with PIC)])
|
||||
dnl force libtool to build static libraries with PIC on AMD64-Linux & FreeBSD
|
||||
AC_MSG_CHECKING([if arch-OS host is AMD64-Linux/FreeBSD (to build static libraries with PIC)])
|
||||
case $host in
|
||||
x86_64*linux*)
|
||||
x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
|
||||
AC_MSG_RESULT([yes])
|
||||
with_pic=yes
|
||||
;;
|
||||
@@ -167,41 +126,29 @@ esac
|
||||
AC_MSG_RESULT($need_no_undefined)
|
||||
AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl check if this is the Intel ICC compiler, and if so make it stricter
|
||||
dnl (convert warning 147 into an error) so that it properly can detect the
|
||||
dnl gethostbyname_r() version
|
||||
dnl **********************************************************************
|
||||
CURL_DETECT_ICC([CFLAGS="$CFLAGS -we 147"])
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl platform/compiler/architecture specific checks/flags
|
||||
dnl **********************************************************************
|
||||
|
||||
CARES_CHECK_COMPILER
|
||||
CARES_SET_COMPILER_BASIC_OPTS
|
||||
CARES_SET_COMPILER_DEBUG_OPTS
|
||||
CARES_SET_COMPILER_OPTIMIZE_OPTS
|
||||
CARES_SET_COMPILER_WARNING_OPTS
|
||||
|
||||
case $host in
|
||||
#
|
||||
x86_64*linux*)
|
||||
x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
|
||||
#
|
||||
dnl find out if icc is being used
|
||||
if test "z$ICC" = "z"; then
|
||||
CURL_DETECT_ICC
|
||||
fi
|
||||
#
|
||||
if test "$ICC" = "yes"; then
|
||||
dnl figure out icc version
|
||||
AC_MSG_CHECKING([icc version])
|
||||
iccver=`$CC -dumpversion`
|
||||
iccnhi=`echo $iccver | cut -d . -f1`
|
||||
iccnlo=`echo $iccver | cut -d . -f2`
|
||||
iccnum=`(expr $iccnhi "*" 100 + $iccnlo) 2>/dev/null`
|
||||
AC_MSG_RESULT($iccver)
|
||||
if test "$compiler_id" = "INTEL_UNIX_C"; then
|
||||
#
|
||||
if test "$iccnum" -ge "900" && test "$iccnum" -lt "1000"; then
|
||||
if test "$compiler_num" -ge "900" &&
|
||||
test "$compiler_num" -lt "1000"; then
|
||||
dnl icc 9.X specific
|
||||
CFLAGS="$CFLAGS -i-dynamic"
|
||||
fi
|
||||
#
|
||||
if test "$iccnum" -ge "1000"; then
|
||||
if test "$compiler_num" -ge "1000"; then
|
||||
dnl icc 10.X or later
|
||||
CFLAGS="$CFLAGS -shared-intel"
|
||||
fi
|
||||
@@ -211,46 +158,8 @@ case $host in
|
||||
#
|
||||
esac
|
||||
|
||||
AC_MSG_CHECKING([whether we are using the IBM C compiler])
|
||||
CURL_CHECK_DEF([__IBMC__], [], [silent])
|
||||
if test "$curl_cv_have_def___IBMC__" = "yes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
dnl Ensure that compiler optimizations are always thread-safe.
|
||||
CFLAGS="$CFLAGS -qthreaded"
|
||||
dnl Disable type based strict aliasing optimizations, using worst
|
||||
dnl case aliasing assumptions when compiling. Type based aliasing
|
||||
dnl would restrict the lvalues that could be safely used to access
|
||||
dnl a data object.
|
||||
CFLAGS="$CFLAGS -qnoansialias"
|
||||
dnl Force compiler to stop after the compilation phase, without
|
||||
dnl generating an object code file when compilation has errors.
|
||||
CFLAGS="$CFLAGS -qhalt=e"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([whether we are using the DEC/Compaq C compiler])
|
||||
CURL_CHECK_DEF([__DECC], [], [silent])
|
||||
CURL_CHECK_DEF([__DECC_VER], [], [silent])
|
||||
if test "$curl_cv_have_def___DECC" = "yes" &&
|
||||
test "$curl_cv_have_def___DECC_VER" = "yes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
dnl Select strict ANSI C compiler mode
|
||||
CFLAGS="$CFLAGS -std1"
|
||||
dnl Turn off optimizer ANSI C aliasing rules
|
||||
CFLAGS="$CFLAGS -noansi_alias"
|
||||
dnl Select a higher warning level than default level2
|
||||
CFLAGS="$CFLAGS -msg_enable level3"
|
||||
dnl Generate warnings for missing function prototypes
|
||||
CFLAGS="$CFLAGS -warnprotos"
|
||||
dnl Change some warnings into fatal errors
|
||||
CFLAGS="$CFLAGS -msg_fatal toofewargs,toomanyargs"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
CURL_CHECK_COMPILER_HALT_ON_ERROR
|
||||
CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
|
||||
CARES_CHECK_COMPILER_HALT_ON_ERROR
|
||||
CARES_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Compilation based checks should not be done before this point.
|
||||
@@ -282,6 +191,8 @@ dnl **********************************************************************
|
||||
dnl Checks for libraries.
|
||||
dnl **********************************************************************
|
||||
|
||||
CARES_CHECK_LIB_XNET
|
||||
|
||||
dnl gethostbyname without lib or in the nsl lib?
|
||||
AC_CHECK_FUNC(gethostbyname,
|
||||
[HAVE_GETHOSTBYNAME="1"
|
||||
@@ -421,9 +332,7 @@ then
|
||||
fi
|
||||
|
||||
|
||||
if test "$HAVE_GETHOSTBYNAME" = "1"; then
|
||||
AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [If you have gethostbyname])
|
||||
else
|
||||
if test "$HAVE_GETHOSTBYNAME" != "1"; then
|
||||
AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
|
||||
fi
|
||||
|
||||
@@ -436,6 +345,7 @@ if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
|
||||
,
|
||||
-lnsl)
|
||||
fi
|
||||
ac_cv_func_strcasecmp="no"
|
||||
|
||||
dnl socket lib?
|
||||
AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
|
||||
@@ -522,6 +432,7 @@ dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
|
||||
CURL_CHECK_HEADER_MALLOC
|
||||
CURL_CHECK_HEADER_MEMORY
|
||||
|
||||
dnl check for a few basic system headers we need
|
||||
AC_CHECK_HEADERS(
|
||||
@@ -531,6 +442,7 @@ AC_CHECK_HEADERS(
|
||||
sys/socket.h \
|
||||
sys/ioctl.h \
|
||||
sys/param.h \
|
||||
sys/uio.h \
|
||||
netdb.h \
|
||||
netinet/in.h \
|
||||
netinet/tcp.h \
|
||||
@@ -539,6 +451,7 @@ AC_CHECK_HEADERS(
|
||||
strings.h \
|
||||
stdbool.h \
|
||||
time.h \
|
||||
limits.h \
|
||||
arpa/nameser.h \
|
||||
arpa/nameser_compat.h \
|
||||
arpa/inet.h,
|
||||
@@ -578,7 +491,9 @@ AC_HEADER_TIME
|
||||
CURL_CHECK_STRUCT_TIMEVAL
|
||||
|
||||
AC_CHECK_SIZEOF(size_t)
|
||||
AC_CHECK_SIZEOF(int)
|
||||
AC_CHECK_SIZEOF(long)
|
||||
CARES_CONFIGURE_LONG
|
||||
AC_CHECK_SIZEOF(time_t)
|
||||
|
||||
AC_CHECK_TYPE(long long,
|
||||
@@ -614,8 +529,7 @@ AC_CHECK_TYPE([bool],[
|
||||
#endif
|
||||
])
|
||||
|
||||
# Check for socklen_t or equivalent
|
||||
CURL_CHECK_TYPE_SOCKLEN_T
|
||||
CARES_CONFIGURE_ARES_SOCKLEN_T
|
||||
|
||||
TYPE_IN_ADDR_T
|
||||
|
||||
@@ -630,6 +544,29 @@ CURL_CHECK_FUNC_RECVFROM
|
||||
CURL_CHECK_FUNC_SEND
|
||||
CURL_CHECK_MSG_NOSIGNAL
|
||||
|
||||
CARES_CHECK_FUNC_FCNTL
|
||||
CARES_CHECK_FUNC_FREEADDRINFO
|
||||
CARES_CHECK_FUNC_GETADDRINFO
|
||||
CARES_CHECK_FUNC_GETHOSTBYADDR
|
||||
CARES_CHECK_FUNC_GETHOSTBYNAME
|
||||
CARES_CHECK_FUNC_GETHOSTNAME
|
||||
CARES_CHECK_FUNC_GETSERVBYPORT_R
|
||||
CARES_CHECK_FUNC_INET_NTOP
|
||||
CARES_CHECK_FUNC_INET_PTON
|
||||
CARES_CHECK_FUNC_IOCTL
|
||||
CARES_CHECK_FUNC_IOCTLSOCKET
|
||||
CARES_CHECK_FUNC_IOCTLSOCKET_CAMEL
|
||||
CARES_CHECK_FUNC_SETSOCKOPT
|
||||
CARES_CHECK_FUNC_STRCASECMP
|
||||
CARES_CHECK_FUNC_STRCMPI
|
||||
CARES_CHECK_FUNC_STRDUP
|
||||
CARES_CHECK_FUNC_STRICMP
|
||||
CARES_CHECK_FUNC_STRNCASECMP
|
||||
CARES_CHECK_FUNC_STRNCMPI
|
||||
CARES_CHECK_FUNC_STRNICMP
|
||||
CARES_CHECK_FUNC_WRITEV
|
||||
|
||||
|
||||
dnl check for AF_INET6
|
||||
CARES_CHECK_CONSTANT(
|
||||
[
|
||||
@@ -811,7 +748,7 @@ AC_CHECK_FUNCS([bitncmp \
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
eval "ac_cv_func_$func=yes"
|
||||
AC_DEFINE_UNQUOTED([AS_TR_CPP([HAVE_$func])], [1],
|
||||
AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$func]), [1],
|
||||
[Define to 1 if you have the $func function.])
|
||||
],[
|
||||
AC_MSG_RESULT([but still no])
|
||||
@@ -819,35 +756,6 @@ AC_CHECK_FUNCS([bitncmp \
|
||||
])
|
||||
|
||||
|
||||
dnl check for inet_pton
|
||||
AC_CHECK_FUNCS(inet_pton)
|
||||
dnl Some systems have it, but not IPv6
|
||||
if test "$ac_cv_func_inet_pton" = "yes" ; then
|
||||
AC_MSG_CHECKING(if inet_pton supports IPv6)
|
||||
AC_TRY_RUN(
|
||||
[
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
int main()
|
||||
{
|
||||
struct in6_addr addr6;
|
||||
if (inet_pton(AF_INET6, "::1", &addr6) < 1)
|
||||
exit(1);
|
||||
else
|
||||
exit(0);
|
||||
}
|
||||
], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE_UNQUOTED(HAVE_INET_PTON_IPV6,1,[Define to 1 if inet_pton supports IPv6.])
|
||||
], AC_MSG_RESULT(no),AC_MSG_RESULT(no))
|
||||
fi
|
||||
dnl Check for inet_net_pton
|
||||
AC_CHECK_FUNCS(inet_net_pton)
|
||||
dnl Again, some systems have it, but not IPv6
|
||||
@@ -879,39 +787,6 @@ int main()
|
||||
fi
|
||||
|
||||
|
||||
dnl Check for inet_ntop
|
||||
AC_CHECK_FUNCS(inet_ntop)
|
||||
dnl Again, some systems have it, but not IPv6
|
||||
if test "$ac_cv_func_inet_ntop" = "yes" ; then
|
||||
AC_MSG_CHECKING(if inet_ntop supports IPv6)
|
||||
AC_TRY_RUN(
|
||||
[
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
int main()
|
||||
{
|
||||
struct in6_addr addr6;
|
||||
char buf[128];
|
||||
if (inet_ntop(AF_INET6, &addr6, buf, 128) == 0 && errno == EAFNOSUPPORT)
|
||||
exit(1);
|
||||
else
|
||||
exit(0);
|
||||
}
|
||||
], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE_UNQUOTED(HAVE_INET_NTOP_IPV6,1,
|
||||
[Define to 1 if inet_ntop supports IPv6.])
|
||||
], AC_MSG_RESULT(no),AC_MSG_RESULT(no))
|
||||
fi
|
||||
|
||||
AC_CHECK_SIZEOF(struct in6_addr, ,
|
||||
[
|
||||
#undef inline
|
||||
@@ -974,12 +849,6 @@ dnl and get the types of five of its arguments.
|
||||
CURL_CHECK_FUNC_GETNAMEINFO
|
||||
|
||||
|
||||
dnl God bless non-standardized functions! We need to see which getservbyport_r
|
||||
dnl variant is available
|
||||
CARES_CHECK_GETSERVBYPORT_R
|
||||
|
||||
CURL_CHECK_NONBLOCKING_SOCKET
|
||||
|
||||
AC_C_BIGENDIAN(
|
||||
[AC_DEFINE(ARES_BIG_ENDIAN, 1,
|
||||
[define this if ares is built for a big endian system])],
|
||||
@@ -1010,8 +879,21 @@ if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
|
||||
[a suitable file/device to read random data from])
|
||||
fi
|
||||
|
||||
CARES_CHECK_OPTION_NONBLOCKING
|
||||
CARES_CHECK_NONBLOCKING_SOCKET
|
||||
|
||||
CARES_PRIVATE_LIBS="$LIBS"
|
||||
AC_SUBST(CARES_PRIVATE_LIBS)
|
||||
|
||||
dnl squeeze whitespace out of some variables
|
||||
|
||||
squeeze CFLAGS
|
||||
squeeze CPPFLAGS
|
||||
squeeze DEFS
|
||||
squeeze LDFLAGS
|
||||
squeeze LIBS
|
||||
|
||||
squeeze CARES_PRIVATE_LIBS
|
||||
|
||||
AC_CONFIG_FILES([Makefile libcares.pc])
|
||||
AC_OUTPUT
|
||||
|
@@ -19,23 +19,22 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
#include <arpa/nameser.h>
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <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 <ctype.h>
|
||||
@@ -47,8 +46,7 @@
|
||||
#include "ares_ipv6.h"
|
||||
#include "inet_net_pton.h"
|
||||
|
||||
#if !defined(HAVE_INET_NET_PTON) || !defined(HAVE_INET_NET_PTON_IPV6) || \
|
||||
!defined(HAVE_INET_PTON) || !defined(HAVE_INET_PTON_IPV6)
|
||||
#if !defined(HAVE_INET_NET_PTON) || !defined(HAVE_INET_NET_PTON_IPV6)
|
||||
|
||||
/*
|
||||
* static int
|
||||
@@ -425,7 +423,7 @@ ares_inet_net_pton(int af, const char *src, void *dst, size_t size)
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_INET_PTON) || !defined(HAVE_INET_PTON_IPV6)
|
||||
#ifndef HAVE_INET_PTON
|
||||
int ares_inet_pton(int af, const char *src, void *dst)
|
||||
{
|
||||
int size, result;
|
||||
|
@@ -18,7 +18,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#if defined(HAVE_INET_PTON) && defined(HAVE_INET_PTON_IPV6)
|
||||
#ifdef HAVE_INET_PTON
|
||||
#define ares_inet_pton(x,y,z) inet_pton(x,y,z)
|
||||
#else
|
||||
int ares_inet_pton(int af, const char *src, void *dst);
|
||||
|
@@ -18,21 +18,22 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
#include <arpa/nameser.h>
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <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 <ctype.h>
|
||||
@@ -45,7 +46,7 @@
|
||||
#include "inet_ntop.h"
|
||||
|
||||
|
||||
#if !defined(HAVE_INET_NTOP) || !defined(HAVE_INET_NTOP_IPV6)
|
||||
#ifndef HAVE_INET_NTOP
|
||||
|
||||
#ifdef SPRINTF_CHAR
|
||||
# define SPRINTF(x) strlen(sprintf/**/x)
|
||||
|
@@ -18,7 +18,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#if defined(HAVE_INET_NTOP) && defined(HAVE_INET_NTOP_IPV6)
|
||||
#ifdef HAVE_INET_NTOP
|
||||
#define ares_inet_ntop(w,x,y,z) inet_ntop(w,x,y,z)
|
||||
#else
|
||||
const char *ares_inet_ntop(int af, const void *src, char *dst, size_t size);
|
||||
|
5
ares/m4/.cvsignore
Normal file
5
ares/m4/.cvsignore
Normal file
@@ -0,0 +1,5 @@
|
||||
libtool.m4
|
||||
ltoptions.m4
|
||||
ltsugar.m4
|
||||
ltversion.m4
|
||||
lt~obsolete.m4
|
1290
ares/m4/cares-compilers.m4
Normal file
1290
ares/m4/cares-compilers.m4
Normal file
File diff suppressed because it is too large
Load Diff
214
ares/m4/cares-confopts.m4
Normal file
214
ares/m4/cares-confopts.m4
Normal file
@@ -0,0 +1,214 @@
|
||||
#***************************************************************************
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (C) 2008 by Daniel Stenberg et al
|
||||
#
|
||||
# Permission to use, copy, modify, and distribute this software and its
|
||||
# documentation for any purpose and without fee is hereby granted, provided
|
||||
# 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.
|
||||
#
|
||||
#***************************************************************************
|
||||
|
||||
# File version for 'aclocal' use. Keep it a single number.
|
||||
# serial 3
|
||||
|
||||
|
||||
dnl CARES_CHECK_OPTION_DEBUG
|
||||
dnl -------------------------------------------------
|
||||
dnl Verify if configure has been invoked with option
|
||||
dnl --enable-debug or --disable-debug, and set shell
|
||||
dnl variable want_debug value as appropriate.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_OPTION_DEBUG], [
|
||||
AC_BEFORE([$0],[CARES_CHECK_OPTION_WARNINGS])dnl
|
||||
AC_BEFORE([$0],[CARES_CHECK_PROG_CC])dnl
|
||||
AC_MSG_CHECKING([whether to enable debug build options])
|
||||
OPT_DEBUG_BUILD="default"
|
||||
AC_ARG_ENABLE(debug,
|
||||
AC_HELP_STRING([--enable-debug],[Enable debug build options])
|
||||
AC_HELP_STRING([--disable-debug],[Disable debug build options]),
|
||||
OPT_DEBUG_BUILD=$enableval)
|
||||
case "$OPT_DEBUG_BUILD" in
|
||||
no)
|
||||
dnl --disable-debug option used
|
||||
want_debug="no"
|
||||
;;
|
||||
default)
|
||||
dnl configure option not specified
|
||||
want_debug="no"
|
||||
;;
|
||||
*)
|
||||
dnl --enable-debug option used
|
||||
want_debug="yes"
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT([$want_debug])
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CHECK_OPTION_NONBLOCKING
|
||||
dnl -------------------------------------------------
|
||||
dnl Verify if configure has been invoked with option
|
||||
dnl --enable-nonblocking or --disable-nonblocking, and
|
||||
dnl set shell variable want_nonblocking as appropriate.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_OPTION_NONBLOCKING], [
|
||||
AC_BEFORE([$0],[CARES_CHECK_NONBLOCKING_SOCKET])dnl
|
||||
AC_MSG_CHECKING([whether to enable non-blocking communications])
|
||||
OPT_NONBLOCKING="default"
|
||||
AC_ARG_ENABLE(nonblocking,
|
||||
AC_HELP_STRING([--enable-nonblocking],[Enable non-blocking communications])
|
||||
AC_HELP_STRING([--disable-nonblocking],[Disable non-blocking communications]),
|
||||
OPT_NONBLOCKING=$enableval)
|
||||
case "$OPT_NONBLOCKING" in
|
||||
no)
|
||||
dnl --disable-nonblocking option used
|
||||
want_nonblocking="no"
|
||||
;;
|
||||
default)
|
||||
dnl configure option not specified
|
||||
want_nonblocking="yes"
|
||||
;;
|
||||
*)
|
||||
dnl --enable-nonblocking option used
|
||||
want_nonblocking="yes"
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT([$want_nonblocking])
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CHECK_OPTION_OPTIMIZE
|
||||
dnl -------------------------------------------------
|
||||
dnl Verify if configure has been invoked with option
|
||||
dnl --enable-optimize or --disable-optimize, and set
|
||||
dnl shell variable want_optimize value as appropriate.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_OPTION_OPTIMIZE], [
|
||||
AC_REQUIRE([CARES_CHECK_OPTION_DEBUG])dnl
|
||||
AC_BEFORE([$0],[CARES_CHECK_PROG_CC])dnl
|
||||
AC_MSG_CHECKING([whether to enable compiler optimizer])
|
||||
OPT_COMPILER_OPTIMIZE="default"
|
||||
AC_ARG_ENABLE(optimize,
|
||||
AC_HELP_STRING([--enable-optimize(=OPT)],[Enable compiler optimizations (default=-O2)])
|
||||
AC_HELP_STRING([--disable-optimize],[Disable compiler optimizations]),
|
||||
OPT_COMPILER_OPTIMIZE=$enableval)
|
||||
case "$OPT_COMPILER_OPTIMIZE" in
|
||||
no)
|
||||
dnl --disable-optimize option used. We will handle this as
|
||||
dnl a request to disable compiler optimizations if possible.
|
||||
dnl If the compiler is known CFLAGS and CPPFLAGS will be
|
||||
dnl overridden, otherwise this can not be honored.
|
||||
want_optimize="no"
|
||||
AC_MSG_RESULT([no])
|
||||
;;
|
||||
default)
|
||||
dnl configure's optimize option not specified. Initially we will
|
||||
dnl handle this as a a request contrary to configure's setting
|
||||
dnl for --enable-debug. IOW, initially, for debug-enabled builds
|
||||
dnl this will be handled as a request to disable optimizations if
|
||||
dnl possible, and for debug-disabled builds this will be handled
|
||||
dnl initially as a request to enable optimizations if possible.
|
||||
dnl Finally, if the compiler is known and CFLAGS and CPPFLAGS do
|
||||
dnl not have any optimizer flag the request will be honored, in
|
||||
dnl any other case the request can not be honored.
|
||||
dnl IOW, existing optimizer flags defined in CFLAGS or CPPFLAGS
|
||||
dnl will always take precedence over any initial assumption.
|
||||
if test "$want_debug" = "yes"; then
|
||||
want_optimize="assume_no"
|
||||
AC_MSG_RESULT([not specified (assuming no)])
|
||||
else
|
||||
want_optimize="assume_yes"
|
||||
AC_MSG_RESULT([not specified (assuming yes)])
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
dnl --enable-optimize option used. We will handle this as
|
||||
dnl a request to enable compiler optimizations if possible.
|
||||
dnl If the compiler is known CFLAGS and CPPFLAGS will be
|
||||
dnl overridden, otherwise this can not be honored.
|
||||
want_optimize="yes"
|
||||
AC_MSG_RESULT([yes])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CHECK_OPTION_WARNINGS
|
||||
dnl -------------------------------------------------
|
||||
dnl Verify if configure has been invoked with option
|
||||
dnl --enable-warnings or --disable-warnings, and set
|
||||
dnl shell variable want_warnings as appropriate.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_OPTION_WARNINGS], [
|
||||
AC_REQUIRE([CARES_CHECK_OPTION_DEBUG])dnl
|
||||
AC_BEFORE([$0],[CARES_CHECK_PROG_CC])dnl
|
||||
AC_MSG_CHECKING([whether to enable strict compiler warnings])
|
||||
OPT_COMPILER_WARNINGS="default"
|
||||
AC_ARG_ENABLE(warnings,
|
||||
AC_HELP_STRING([--enable-warnings],[Enable strict compiler warnings])
|
||||
AC_HELP_STRING([--disable-warnings],[Disable strict compiler warnings]),
|
||||
OPT_COMPILER_WARNINGS=$enableval)
|
||||
case "$OPT_COMPILER_WARNINGS" in
|
||||
no)
|
||||
dnl --disable-warnings option used
|
||||
want_warnings="no"
|
||||
;;
|
||||
default)
|
||||
dnl configure option not specified, so
|
||||
dnl use same setting as --enable-debug
|
||||
want_warnings="$want_debug"
|
||||
;;
|
||||
*)
|
||||
dnl --enable-warnings option used
|
||||
want_warnings="yes"
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT([$want_warnings])
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CHECK_NONBLOCKING_SOCKET
|
||||
dnl -------------------------------------------------
|
||||
dnl Check for how to set a socket into non-blocking state.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_NONBLOCKING_SOCKET], [
|
||||
AC_REQUIRE([CARES_CHECK_OPTION_NONBLOCKING])dnl
|
||||
AC_REQUIRE([CARES_CHECK_FUNC_FCNTL])dnl
|
||||
AC_REQUIRE([CARES_CHECK_FUNC_IOCTL])dnl
|
||||
AC_REQUIRE([CARES_CHECK_FUNC_IOCTLSOCKET])dnl
|
||||
AC_REQUIRE([CARES_CHECK_FUNC_IOCTLSOCKET_CAMEL])dnl
|
||||
AC_REQUIRE([CARES_CHECK_FUNC_SETSOCKOPT])dnl
|
||||
#
|
||||
tst_method="unknown"
|
||||
if test "$want_nonblocking" = "yes"; then
|
||||
AC_MSG_CHECKING([how to set a socket into non-blocking mode])
|
||||
if test "x$ac_cv_func_fcntl_o_nonblock" = "xyes"; then
|
||||
tst_method="fcntl O_NONBLOCK"
|
||||
elif test "x$ac_cv_func_ioctl_fionbio" = "xyes"; then
|
||||
tst_method="ioctl FIONBIO"
|
||||
elif test "x$ac_cv_func_ioctlsocket_fionbio" = "xyes"; then
|
||||
tst_method="ioctlsocket FIONBIO"
|
||||
elif test "x$ac_cv_func_ioctlsocket_camel_fionbio" = "xyes"; then
|
||||
tst_method="IoctlSocket FIONBIO"
|
||||
elif test "x$ac_cv_func_setsockopt_so_nonblock" = "xyes"; then
|
||||
tst_method="setsockopt SO_NONBLOCK"
|
||||
fi
|
||||
AC_MSG_RESULT([$tst_method])
|
||||
if test "$tst_method" = "unknown"; then
|
||||
AC_MSG_WARN([cannot determine non-blocking socket method.])
|
||||
fi
|
||||
fi
|
||||
if test "$tst_method" = "unknown"; then
|
||||
AC_DEFINE_UNQUOTED(USE_BLOCKING_SOCKETS, 1,
|
||||
[Define to disable non-blocking sockets.])
|
||||
AC_MSG_WARN([non-blocking sockets disabled.])
|
||||
fi
|
||||
])
|
||||
|
2754
ares/m4/cares-functions.m4
Normal file
2754
ares/m4/cares-functions.m4
Normal file
File diff suppressed because it is too large
Load Diff
103
ares/m4/cares-override.m4
Normal file
103
ares/m4/cares-override.m4
Normal file
@@ -0,0 +1,103 @@
|
||||
#***************************************************************************
|
||||
# $Id$
|
||||
#***************************************************************************
|
||||
|
||||
# File version for 'aclocal' use. Keep it a single number.
|
||||
# serial 2
|
||||
|
||||
dnl CARES_OVERRIDE_AUTOCONF
|
||||
dnl -------------------------------------------------
|
||||
dnl Placing a call to this macro in configure.ac after
|
||||
dnl the one to AC_INIT will make macros in this file
|
||||
dnl visible to the rest of the compilation overriding
|
||||
dnl those from Autoconf.
|
||||
|
||||
AC_DEFUN([CARES_OVERRIDE_AUTOCONF], [
|
||||
AC_BEFORE([$0],[AC_PROG_LIBTOOL])
|
||||
# using cares-override.m4
|
||||
])
|
||||
|
||||
dnl Override some Libtool tests
|
||||
dnl -------------------------------------------------
|
||||
dnl This is done to prevent Libtool 1.5.X from doing
|
||||
dnl unnecesary C++, Fortran and Java tests and reduce
|
||||
dnl resulting configure script by nearly 300 Kb.
|
||||
|
||||
m4_define([AC_LIBTOOL_LANG_CXX_CONFIG],[:])
|
||||
m4_define([AC_LIBTOOL_LANG_F77_CONFIG],[:])
|
||||
m4_define([AC_LIBTOOL_LANG_GCJ_CONFIG],[:])
|
||||
|
||||
dnl Override Autoconf's AC_LANG_PROGRAM (C)
|
||||
dnl -------------------------------------------------
|
||||
dnl This is done to prevent compiler warning
|
||||
dnl 'function declaration isn't a prototype'
|
||||
dnl in function main. This requires at least
|
||||
dnl a c89 compiler and does not suport K&R.
|
||||
|
||||
m4_define([AC_LANG_PROGRAM(C)],
|
||||
[$1
|
||||
int main (void)
|
||||
{
|
||||
$2
|
||||
;
|
||||
return 0;
|
||||
}])
|
||||
|
||||
dnl Override Autoconf's AC_LANG_CALL (C)
|
||||
dnl -------------------------------------------------
|
||||
dnl This is a backport of Autoconf's 2.60 with the
|
||||
dnl embedded comments that hit the resulting script
|
||||
dnl removed. This is done to reduce configure size
|
||||
dnl and use fixed macro across Autoconf versions.
|
||||
|
||||
m4_define([AC_LANG_CALL(C)],
|
||||
[AC_LANG_PROGRAM([$1
|
||||
m4_if([$2], [main], ,
|
||||
[
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char $2 ();])], [return $2 ();])])
|
||||
|
||||
dnl Override Autoconf's AC_LANG_FUNC_LINK_TRY (C)
|
||||
dnl -------------------------------------------------
|
||||
dnl This is a backport of Autoconf's 2.60 with the
|
||||
dnl embedded comments that hit the resulting script
|
||||
dnl removed. This is done to reduce configure size
|
||||
dnl and use fixed macro across Autoconf versions.
|
||||
|
||||
m4_define([AC_LANG_FUNC_LINK_TRY(C)],
|
||||
[AC_LANG_PROGRAM(
|
||||
[
|
||||
#define $1 innocuous_$1
|
||||
#ifdef __STDC__
|
||||
# include <limits.h>
|
||||
#else
|
||||
# include <assert.h>
|
||||
#endif
|
||||
#undef $1
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char $1 ();
|
||||
#if defined __stub_$1 || defined __stub___$1
|
||||
choke me
|
||||
#endif
|
||||
], [return $1 ();])])
|
||||
|
||||
dnl Override Autoconf's PATH_SEPARATOR check
|
||||
dnl -------------------------------------------------
|
||||
dnl This is done to ensure that the same check is
|
||||
dnl used across different Autoconf versions and to
|
||||
dnl allow us to use this macro early enough in the
|
||||
dnl configure script.
|
||||
|
||||
m4_define([_AS_PATH_SEPARATOR_PREPARE],
|
||||
[CARES_CHECK_PATH_SEPARATOR
|
||||
m4_define([$0],[])])
|
||||
|
||||
m4_define([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
|
||||
[CARES_CHECK_PATH_SEPARATOR
|
||||
m4_define([$0],[])])
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#***************************************************************************
|
||||
|
||||
# File version for 'aclocal' use. Keep it a single number.
|
||||
# serial 2
|
||||
# serial 3
|
||||
|
||||
dnl Note 1
|
||||
dnl ------
|
||||
@@ -333,9 +333,6 @@ dnl makes several _r functions compiler visible.
|
||||
dnl Internal macro for CARES_CONFIGURE_REENTRANT.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_NEED_REENTRANT_FUNCTIONS_R], [
|
||||
#
|
||||
tmp_need_reentrant="no"
|
||||
#
|
||||
if test "$tmp_need_reentrant" = "no"; then
|
||||
CARES_CHECK_NEED_REENTRANT_GMTIME_R
|
||||
fi
|
||||
@@ -366,6 +363,24 @@ AC_DEFUN([CARES_CHECK_NEED_REENTRANT_FUNCTIONS_R], [
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CHECK_NEED_REENTRANT_SYSTEM
|
||||
dnl -------------------------------------------------
|
||||
dnl Checks if the preprocessor _REENTRANT definition
|
||||
dnl must be unconditionally done for this platform.
|
||||
dnl Internal macro for CARES_CONFIGURE_REENTRANT.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_NEED_REENTRANT_SYSTEM], [
|
||||
case $host in
|
||||
*-*-solaris*)
|
||||
tmp_need_reentrant="yes"
|
||||
;;
|
||||
*)
|
||||
tmp_need_reentrant="no"
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT
|
||||
dnl -------------------------------------------------
|
||||
dnl This macro ensures that configuration tests done
|
||||
@@ -421,7 +436,10 @@ AC_DEFUN([CARES_CONFIGURE_REENTRANT], [
|
||||
#
|
||||
if test "$tmp_reentrant_initially_defined" = "no"; then
|
||||
AC_MSG_CHECKING([if _REENTRANT is actually needed])
|
||||
CARES_CHECK_NEED_REENTRANT_FUNCTIONS_R
|
||||
CARES_CHECK_NEED_REENTRANT_SYSTEM
|
||||
if test "$tmp_need_reentrant" = "no"; then
|
||||
CARES_CHECK_NEED_REENTRANT_FUNCTIONS_R
|
||||
fi
|
||||
if test "$tmp_need_reentrant" = "yes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
|
74
ares/m4/cares-system.m4
Normal file
74
ares/m4/cares-system.m4
Normal file
@@ -0,0 +1,74 @@
|
||||
#***************************************************************************
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (C) 2008 by Daniel Stenberg et al
|
||||
#
|
||||
# Permission to use, copy, modify, and distribute this software and its
|
||||
# documentation for any purpose and without fee is hereby granted, provided
|
||||
# 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.
|
||||
#
|
||||
#***************************************************************************
|
||||
|
||||
# File version for 'aclocal' use. Keep it a single number.
|
||||
# serial 2
|
||||
|
||||
|
||||
dnl CARES_CHECK_PATH_SEPARATOR
|
||||
dnl -------------------------------------------------
|
||||
dnl Check and compute the path separator for us. This
|
||||
dnl path separator is the symbol used to diferentiate
|
||||
dnl or separate paths inside the PATH environment var.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_PATH_SEPARATOR], [
|
||||
if test -z "$cares_cv_PATH_SEPARATOR"; then
|
||||
if test -z "$PATH"; then
|
||||
AC_MSG_ERROR([PATH not set. Cannot continue without PATH being set.])
|
||||
fi
|
||||
dnl Directory count in PATH when using a colon separator.
|
||||
tst_dirs_col=0
|
||||
tst_save_IFS=$IFS; IFS=':'
|
||||
for tst_dir in $PATH; do
|
||||
IFS=$tst_save_IFS
|
||||
test -d "$tst_dir" && tst_dirs_col=`expr $tst_dirs_col + 1`
|
||||
done
|
||||
IFS=$tst_save_IFS
|
||||
dnl Directory count in PATH when using a semicolon separator.
|
||||
tst_dirs_sem=0
|
||||
tst_save_IFS=$IFS; IFS=';'
|
||||
for tst_dir in $PATH; do
|
||||
IFS=$tst_save_IFS
|
||||
test -d "$tst_dir" && tst_dirs_sem=`expr $tst_dirs_sem + 1`
|
||||
done
|
||||
IFS=$tst_save_IFS
|
||||
if test $tst_dirs_sem -eq $tst_dirs_col; then
|
||||
dnl When both counting methods give the same result we do not want to
|
||||
dnl chose one over the other, and consider auto-detection not possible.
|
||||
if test -z "$PATH_SEPARATOR"; then
|
||||
dnl Stop dead until user provides PATH_SEPARATOR definition.
|
||||
AC_MSG_ERROR([PATH_SEPARATOR not set. Cannot continue without it.])
|
||||
fi
|
||||
else
|
||||
dnl Separator with the greater directory count is the auto-detected one.
|
||||
if test $tst_dirs_sem -gt $tst_dirs_col; then
|
||||
tst_auto_separator=';'
|
||||
else
|
||||
tst_auto_separator=':'
|
||||
fi
|
||||
if test -z "$PATH_SEPARATOR"; then
|
||||
dnl Simply use the auto-detected one when not already set.
|
||||
PATH_SEPARATOR="$tst_auto_separator"
|
||||
fi
|
||||
fi
|
||||
cares_cv_PATH_SEPARATOR="$PATH_SEPARATOR"
|
||||
fi
|
||||
AC_SUBST([PATH_SEPARATOR])
|
||||
AC_SUBST([PATH])
|
||||
])
|
||||
|
||||
|
100
ares/nameser.h
100
ares/nameser.h
@@ -3,39 +3,22 @@
|
||||
#ifndef ARES_NAMESER_H
|
||||
#define ARES_NAMESER_H
|
||||
|
||||
/* Windows-only header file provided by liren@vivisimo.com to make his Windows
|
||||
port build */
|
||||
/* header file provided by liren@vivisimo.com */
|
||||
|
||||
#ifndef NETWARE
|
||||
#include <process.h> /* for the _getpid() proto */
|
||||
#endif /* !NETWARE */
|
||||
#include <sys/types.h>
|
||||
#ifndef HAVE_ARPA_NAMESER_H
|
||||
|
||||
#ifndef NETWARE
|
||||
|
||||
/* Structure for scatter/gather I/O. */
|
||||
struct iovec
|
||||
{
|
||||
void *iov_base; /* Pointer to data. */
|
||||
size_t iov_len; /* Length of data. */
|
||||
};
|
||||
|
||||
#ifndef __WATCOMC__
|
||||
#define getpid() _getpid()
|
||||
#endif
|
||||
|
||||
int ares_writev (SOCKET s, const struct iovec *vector, size_t count);
|
||||
#define writev(s,vect,count) ares_writev(s,vect,count)
|
||||
|
||||
#endif /* !NETWARE */
|
||||
|
||||
#define NS_CMPRSFLGS 0xc0
|
||||
#define NS_IN6ADDRSZ 16
|
||||
#define NS_INT16SZ 2
|
||||
#define NS_INADDRSZ 4
|
||||
|
||||
/* Flag bits indicating name compression. */
|
||||
#define INDIR_MASK NS_CMPRSFLGS
|
||||
#define NS_PACKETSZ 512 /* maximum packet size */
|
||||
#define NS_MAXDNAME 256 /* maximum domain name */
|
||||
#define NS_MAXCDNAME 255 /* maximum compressed domain name */
|
||||
#define NS_MAXLABEL 63
|
||||
#define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */
|
||||
#define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */
|
||||
#define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */
|
||||
#define NS_INT16SZ 2
|
||||
#define NS_INADDRSZ 4
|
||||
#define NS_IN6ADDRSZ 16
|
||||
#define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */
|
||||
#define NS_DEFAULTPORT 53 /* For both TCP and UDP. */
|
||||
|
||||
typedef enum __ns_class {
|
||||
ns_c_invalid = 0, /* Cookie. */
|
||||
@@ -49,8 +32,6 @@ typedef enum __ns_class {
|
||||
ns_c_max = 65536
|
||||
} ns_class;
|
||||
|
||||
#define C_IN ns_c_in
|
||||
|
||||
typedef enum __ns_type {
|
||||
ns_t_invalid = 0, /* Cookie. */
|
||||
ns_t_a = 1, /* Host address. */
|
||||
@@ -94,6 +75,8 @@ typedef enum __ns_type {
|
||||
ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */
|
||||
ns_t_sink = 40, /* Kitchen sink (experimentatl) */
|
||||
ns_t_opt = 41, /* EDNS0 option (meta-RR) */
|
||||
ns_t_apl = 42, /* Address prefix list (RFC3123) */
|
||||
ns_t_tkey = 249, /* Transaction key */
|
||||
ns_t_tsig = 250, /* Transaction signature. */
|
||||
ns_t_ixfr = 251, /* Incremental zone transfer. */
|
||||
ns_t_axfr = 252, /* Transfer zone of authority. */
|
||||
@@ -104,19 +87,6 @@ typedef enum __ns_type {
|
||||
ns_t_max = 65536
|
||||
} ns_type;
|
||||
|
||||
#define T_PTR ns_t_ptr
|
||||
#define T_A ns_t_a
|
||||
|
||||
|
||||
#define NS_DEFAULTPORT 53 /* For both TCP and UDP. */
|
||||
#define NAMESERVER_PORT NS_DEFAULTPORT
|
||||
|
||||
#define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */
|
||||
#define HFIXEDSZ NS_HFIXEDSZ
|
||||
|
||||
#define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */
|
||||
#define QFIXEDSZ NS_QFIXEDSZ
|
||||
|
||||
typedef enum __ns_opcode {
|
||||
ns_o_query = 0, /* Standard query. */
|
||||
ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */
|
||||
@@ -127,25 +97,6 @@ typedef enum __ns_opcode {
|
||||
ns_o_max = 6
|
||||
} ns_opcode;
|
||||
|
||||
#define QUERY ns_o_query
|
||||
|
||||
#define NS_MAXLABEL 63
|
||||
#define MAXLABEL NS_MAXLABEL
|
||||
|
||||
#define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */
|
||||
#define RRFIXEDSZ NS_RRFIXEDSZ
|
||||
|
||||
#define T_CNAME ns_t_cname
|
||||
|
||||
#define NS_MAXDNAME 256 /* maximum domain name */
|
||||
#define MAXDNAME NS_MAXDNAME
|
||||
|
||||
#define NS_MAXCDNAME 255 /* maximum compressed domain name */
|
||||
#define MAXCDNAME NS_MAXCDNAME
|
||||
|
||||
#define NS_PACKETSZ 512 /* maximum packet size */
|
||||
#define PACKETSZ NS_PACKETSZ
|
||||
|
||||
typedef enum __ns_rcode {
|
||||
ns_r_noerror = 0, /* No error occurred. */
|
||||
ns_r_formerr = 1, /* Format error. */
|
||||
@@ -166,6 +117,22 @@ typedef enum __ns_rcode {
|
||||
ns_r_badtime = 18
|
||||
} ns_rcode;
|
||||
|
||||
#endif /* HAVE_ARPA_NAMESER_H */
|
||||
|
||||
#ifndef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
|
||||
#define PACKETSZ NS_PACKETSZ
|
||||
#define MAXDNAME NS_MAXDNAME
|
||||
#define MAXCDNAME NS_MAXCDNAME
|
||||
#define MAXLABEL NS_MAXLABEL
|
||||
#define HFIXEDSZ NS_HFIXEDSZ
|
||||
#define QFIXEDSZ NS_QFIXEDSZ
|
||||
#define RRFIXEDSZ NS_RRFIXEDSZ
|
||||
#define INDIR_MASK NS_CMPRSFLGS
|
||||
#define NAMESERVER_PORT NS_DEFAULTPORT
|
||||
|
||||
#define QUERY ns_o_query
|
||||
|
||||
#define SERVFAIL ns_r_servfail
|
||||
#define NOTIMP ns_r_notimpl
|
||||
#define REFUSED ns_r_refused
|
||||
@@ -174,6 +141,7 @@ typedef enum __ns_rcode {
|
||||
#define FORMERR ns_r_formerr
|
||||
#define NXDOMAIN ns_r_nxdomain
|
||||
|
||||
#define C_IN ns_c_in
|
||||
#define C_CHAOS ns_c_chaos
|
||||
#define C_HS ns_c_hs
|
||||
#define C_NONE ns_c_none
|
||||
@@ -221,4 +189,6 @@ typedef enum __ns_rcode {
|
||||
#define T_MAILA ns_t_maila
|
||||
#define T_ANY ns_t_any
|
||||
|
||||
#endif /* HAVE_ARPA_NAMESER_COMPAT_H */
|
||||
|
||||
#endif /* ARES_NAMESER_H */
|
||||
|
80
ares/setup.h
80
ares/setup.h
@@ -3,7 +3,7 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 2004 - 2008 by Daniel Stenberg et al
|
||||
/* Copyright (C) 2004 - 2009 by Daniel Stenberg et al
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software and its
|
||||
* documentation for any purpose and without fee is hereby granted, provided
|
||||
@@ -39,6 +39,15 @@
|
||||
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
/* ================================================================ */
|
||||
/* Definition of preprocessor macros/symbols which modify compiler */
|
||||
/* behaviour or generated code characteristics must be done here, */
|
||||
/* as appropriate, before any system header file is included. It is */
|
||||
/* also possible to have them defined in the config file included */
|
||||
/* before this point. As a result of all this we frown inclusion of */
|
||||
/* system header files in our config files, avoid this at any cost. */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* Tru64 needs _REENTRANT set for a few function prototypes and
|
||||
* things to appear in the system header files. Unixware needs it
|
||||
@@ -51,6 +60,29 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* ================================================================ */
|
||||
/* If you need to include a system header file for your platform, */
|
||||
/* please, do it beyond the point further indicated in this file. */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* c-ares external interface definitions are also used internally,
|
||||
* and might also include required system header files to define them.
|
||||
*/
|
||||
|
||||
#include <ares_build.h>
|
||||
|
||||
/*
|
||||
* Compile time sanity checks must also be done when building the library.
|
||||
*/
|
||||
|
||||
#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 */
|
||||
/* ================================================================ */
|
||||
|
||||
/*
|
||||
* Include header files for windows builds before redefining anything.
|
||||
* Use this preproessor block only to include or exclude windows.h,
|
||||
@@ -107,6 +139,18 @@
|
||||
#define ssize_t int
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_SYS_TIME_H) && !defined(_MSC_VER) && !defined(__WATCOMC__)
|
||||
#define HAVE_SYS_TIME_H
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_UNISTD_H) && !defined(_MSC_VER)
|
||||
#define HAVE_UNISTD_H 1
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_SYS_UIO_H) && !defined(WIN32) && !defined(MSDOS)
|
||||
#define HAVE_SYS_UIO_H
|
||||
#endif
|
||||
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
/*
|
||||
@@ -123,40 +167,6 @@
|
||||
#undef VERSION
|
||||
#undef PACKAGE
|
||||
|
||||
/*
|
||||
* Assume a few thing unless they're set by configure
|
||||
*/
|
||||
|
||||
#if !defined(HAVE_SYS_TIME_H) && !defined(_MSC_VER) && !defined(__WATCOMC__)
|
||||
#define HAVE_SYS_TIME_H
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_UNISTD_H) && !defined(_MSC_VER)
|
||||
#define HAVE_UNISTD_H 1
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_SYS_UIO_H) && !defined(WIN32) && !defined(MSDOS)
|
||||
#define HAVE_SYS_UIO_H
|
||||
#endif
|
||||
|
||||
#if (defined(WIN32) || defined(WATT32)) && \
|
||||
!(defined(__MINGW32__) || defined(NETWARE) || defined(__DJGPP__))
|
||||
/* protos for the functions we provide in windows_port.c */
|
||||
int ares_strncasecmp(const char *s1, const char *s2, int n);
|
||||
int ares_strcasecmp(const char *s1, const char *s2);
|
||||
|
||||
/* use this define magic to prevent us from adding symbol names to the library
|
||||
that is a high-risk to collide with another libraries' attempts to do the
|
||||
same */
|
||||
#define strncasecmp(a,b,c) ares_strncasecmp(a,b,c)
|
||||
#define strcasecmp(a,b) ares_strcasecmp(a,b)
|
||||
#ifdef _MSC_VER
|
||||
# if _MSC_VER >= 1400
|
||||
# define strdup(a) _strdup(a)
|
||||
# endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* IPv6 compatibility */
|
||||
#if !defined(HAVE_AF_INET6)
|
||||
#if defined(HAVE_PF_INET6)
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 2004 - 2008 by Daniel Stenberg et al
|
||||
/* Copyright (C) 2004 - 2009 by Daniel Stenberg et al
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software and its
|
||||
* documentation for any purpose and without fee is hereby granted, provided
|
||||
@@ -42,6 +42,14 @@
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#ifdef NEED_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#ifdef NEED_MEMORY_H
|
||||
#include <memory.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
@@ -91,23 +99,6 @@ struct timeval {
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Windows build targets have socklen_t definition in
|
||||
* ws2tcpip.h but some versions of ws2tcpip.h do not
|
||||
* have the definition. It seems that when the socklen_t
|
||||
* definition is missing from ws2tcpip.h the definition
|
||||
* for INET_ADDRSTRLEN is also missing, and that when one
|
||||
* definition is present the other one also is available.
|
||||
*/
|
||||
|
||||
#if defined(WIN32) && !defined(HAVE_CONFIG_H)
|
||||
# if ( defined(_MSC_VER) && !defined(INET_ADDRSTRLEN) ) || \
|
||||
(!defined(_MSC_VER) && !defined(HAVE_WS2TCPIP_H) )
|
||||
# define socklen_t int
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__minix)
|
||||
/* Minix doesn't support recv on TCP sockets */
|
||||
#define sread(x,y,z) (ssize_t)read((RECV_TYPE_ARG1)(x), \
|
||||
@@ -436,88 +427,5 @@ typedef int sig_atomic_t;
|
||||
#define ZERO_NULL 0
|
||||
|
||||
|
||||
#if defined (__LP64__) && defined(__hpux) && !defined(_XOPEN_SOURCE_EXTENDED)
|
||||
#include <sys/socket.h>
|
||||
/* HP-UX has this oddity where it features a few functions that don't work
|
||||
with socklen_t so we need to convert to ints
|
||||
|
||||
This is due to socklen_t being a 64bit int under 64bit ABI, but the
|
||||
pre-xopen (default) interfaces require an int, which is 32bits.
|
||||
|
||||
Therefore, Anytime socklen_t is passed by pointer, the libc function
|
||||
truncates the 64bit socklen_t value by treating it as a 32bit value.
|
||||
|
||||
|
||||
Note that some socket calls are allowed to have a NULL pointer for
|
||||
the socklen arg.
|
||||
*/
|
||||
|
||||
inline static int Curl_hp_getsockname(int s, struct sockaddr *name,
|
||||
socklen_t *namelen)
|
||||
{
|
||||
int rc;
|
||||
if(namelen) {
|
||||
int len = *namelen;
|
||||
rc = getsockname(s, name, &len);
|
||||
*namelen = len;
|
||||
}
|
||||
else
|
||||
rc = getsockname(s, name, 0);
|
||||
return rc;
|
||||
}
|
||||
|
||||
inline static int Curl_hp_getsockopt(int s, int level, int optname,
|
||||
void *optval, socklen_t *optlen)
|
||||
{
|
||||
int rc;
|
||||
if(optlen) {
|
||||
int len = *optlen;
|
||||
rc = getsockopt(s, level, optname, optval, &len);
|
||||
*optlen = len;
|
||||
}
|
||||
else
|
||||
rc = getsockopt(s, level, optname, optval, 0);
|
||||
return rc;
|
||||
}
|
||||
|
||||
inline static int Curl_hp_accept(int sockfd, struct sockaddr *addr,
|
||||
socklen_t *addrlen)
|
||||
{
|
||||
int rc;
|
||||
if(addrlen) {
|
||||
int len = *addrlen;
|
||||
rc = accept(sockfd, addr, &len);
|
||||
*addrlen = len;
|
||||
}
|
||||
else
|
||||
rc = accept(sockfd, addr, 0);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
inline static ssize_t Curl_hp_recvfrom(int s, void *buf, size_t len, int flags,
|
||||
struct sockaddr *from,
|
||||
socklen_t *fromlen)
|
||||
{
|
||||
ssize_t rc;
|
||||
if(fromlen) {
|
||||
int fromlen32 = *fromlen;
|
||||
rc = recvfrom(s, buf, len, flags, from, &fromlen32);
|
||||
*fromlen = fromlen32;
|
||||
}
|
||||
else {
|
||||
rc = recvfrom(s, buf, len, flags, from, 0);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
#define getsockname(a,b,c) Curl_hp_getsockname((a),(b),(c))
|
||||
#define getsockopt(a,b,c,d,e) Curl_hp_getsockopt((a),(b),(c),(d),(e))
|
||||
#define accept(a,b,c) Curl_hp_accept((a),(b),(c))
|
||||
#define recvfrom(a,b,c,d,e,f) Curl_hp_recvfrom((a),(b),(c),(d),(e),(f))
|
||||
|
||||
#endif /* HPUX work-around */
|
||||
|
||||
|
||||
#endif /* __SETUP_ONCE_H */
|
||||
|
||||
|
@@ -41,8 +41,8 @@ RSC=rc.exe
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -65,8 +65,8 @@ LINK32=link.exe
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
|
@@ -41,8 +41,8 @@ RSC=rc.exe
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -65,8 +65,8 @@ LINK32=link.exe
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
|
@@ -41,8 +41,8 @@ RSC=rc.exe
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -65,8 +65,8 @@ LINK32=link.exe
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
|
@@ -145,6 +145,10 @@ SOURCE=..\..\ares_init.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_library_init.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_llist.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -181,6 +185,10 @@ SOURCE=..\..\ares_send.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_strcasecmp.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_strerror.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -193,6 +201,10 @@ SOURCE=..\..\ares_version.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_writev.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\bitncmp.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -217,6 +229,10 @@ SOURCE=..\..\ares.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_build.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_dns.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -225,6 +241,10 @@ SOURCE=..\..\ares_ipv6.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_library_init.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_llist.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -233,10 +253,22 @@ SOURCE=..\..\ares_private.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_rules.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_strcasecmp.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_version.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_writev.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\bitncmp.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user