Compare commits
665 Commits
curl-7_19_
...
curl-7_19_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
770
CHANGES
770
CHANGES
@@ -6,6 +6,764 @@
|
||||
|
||||
Changelog
|
||||
|
||||
Version 7.19.3 (19 January 2009)
|
||||
|
||||
Daniel Stenberg (16 Jan 2009)
|
||||
- Andrew de los Reyes fixed curlbuild.h for "generic" gcc builds on PPC, both
|
||||
32 bit and 64 bit.
|
||||
|
||||
Daniel Stenberg (15 Jan 2009)
|
||||
- Tim Ansell fixed a compiler warning in lib/cookie.c
|
||||
|
||||
Daniel Stenberg (14 Jan 2009)
|
||||
- Grant Erickson fixed timeouts for TFTP such that specifying a
|
||||
connect-timeout, a max-time or both options work correctly and as expected
|
||||
by passing the correct boolean value to Curl_timeleft via the
|
||||
'duringconnect' parameter.
|
||||
|
||||
With this small change, curl TFTP now behaves as expected (and likely as
|
||||
originally-designed):
|
||||
|
||||
1) For non-existent or unreachable dotted IP addresses:
|
||||
|
||||
a) With no options, follows the default curl 300s timeout...
|
||||
b) With --connect-timeout only, follows that value...
|
||||
c) With --max-time only, follows that value...
|
||||
d) With both --connect-timeout and --max-time, follows the smaller value...
|
||||
|
||||
and times out with a "curl: (7) Couldn't connect to server" error.
|
||||
|
||||
2) For transfers to/from a valid host:
|
||||
|
||||
a) With no options, follows default curl 300s timeout for the
|
||||
first XRQ/DATA/ACK transaction and the default TFTP 3600s
|
||||
timeout for the remainder of the transfer...
|
||||
|
||||
b) With --connect-time only, follows that value for the
|
||||
first XRQ/DATA/ACK transaction and the default TFTP 3600s
|
||||
timeout for the remainder of the transfer...
|
||||
|
||||
c) With --max-time only, follows that value for the first
|
||||
XRQ/DATA/ACK transaction and for the remainder of the
|
||||
transfer...
|
||||
|
||||
d) With both --connect-timeout and --max-time, follows the former
|
||||
for the first XRQ/DATA/ACK transaction and the latter for the
|
||||
remainder of the transfer...
|
||||
|
||||
and times out with a "curl: (28) Timeout was reached" error as
|
||||
appropriate.
|
||||
|
||||
Daniel Stenberg (13 Jan 2009)
|
||||
- Michael Wallner fixed a NULL pointer deref when calling
|
||||
curl_easy_setup(curl, CURLOPT_COOKIELIST, "SESS") on a CURL handle with no
|
||||
cookies data.
|
||||
|
||||
- Stefan Teleman brought a patch to fix the default curlbuild.h file for the
|
||||
SunPro compilers.
|
||||
|
||||
Daniel Stenberg (12 Jan 2009)
|
||||
- Based on bug report #2498665 (http://curl.haxx.se/bug/view.cgi?id=2498665)
|
||||
by Daniel Black, I've now added magic to the configure script that makes it
|
||||
use pkg-config to detect gnutls details as well if the existing method
|
||||
(using libgnutls-config) fails. While doing this, I cleaned up and unified
|
||||
the pkg-config usage when detecting openssl and nss as well.
|
||||
|
||||
Daniel Stenberg (11 Jan 2009)
|
||||
- Karl Moerder brought the patch that creates vc9 Makefiles, and I made
|
||||
'maketgz' now use the actual makefile targets to do the VC8 and VC9
|
||||
makefiles.
|
||||
|
||||
Daniel Stenberg (10 Jan 2009)
|
||||
- Emil Romanus fixed:
|
||||
|
||||
When using the multi interface over HTTP and the server returns a Location
|
||||
header, the running easy handle will get stuck in the CURLM_STATE_PERFORM
|
||||
state, leaving the external event loop stuck waiting for data from the
|
||||
ingoing socket (when using the curl_multi_socket_action stuff). While this
|
||||
bug was pretty hard to find, it seems to require only a one-line fix. The
|
||||
break statement on line 1374 in multi.c caused the function to skip the call
|
||||
to multistate().
|
||||
|
||||
How to reproduce this bug? Well, that's another question. evhiperfifo.c in
|
||||
the examples directory chokes on this bug only _sometimes_, probably
|
||||
depending on how fast the URLs are added. One way of testing the bug out is
|
||||
writing to hiper.fifo from more than one source at the same time.
|
||||
|
||||
Daniel Fandrich (7 Jan 2009)
|
||||
- Unified much of the SessionHandle initialization done in Curl_open() and
|
||||
curl_easy_reset() by creating Curl_init_userdefined(). This had the side
|
||||
effect of fixing curl_easy_reset() so it now also resets
|
||||
CURLOPT_FTP_FILEMETHOD and CURLOPT_SSL_SESSIONID_CACHE
|
||||
|
||||
Daniel Stenberg (7 Jan 2009)
|
||||
- Rob Crittenden did once again provide an NSS update:
|
||||
|
||||
I have to jump through a few hoops now with the NSS library initialization
|
||||
since another part of an application may have already initialized NSS by the
|
||||
time Curl gets invoked. This patch is more careful to only shutdown the NSS
|
||||
library if Curl did the initialization.
|
||||
|
||||
It also adds in a bit of code to set the default ciphers if the app that
|
||||
call NSS_Init* did not call NSS_SetDomesticPolicy() or set specific
|
||||
ciphers. One might argue that this lets other application developers get
|
||||
lazy and/or they aren't using the NSS API correctly, and you'd be right.
|
||||
But still, this will avoid terribly difficult-to-trace crashes and is
|
||||
generally helpful.
|
||||
|
||||
Daniel Stenberg (1 Jan 2009)
|
||||
- 'reconf' is removed since we rather have users use 'buildconf'
|
||||
|
||||
Daniel Stenberg (31 Dec 2008)
|
||||
- Bas Mevissen reported http://curl.haxx.se/bug/view.cgi?id=2479030 pointing
|
||||
out that 'reconf' didn't properly point out the m4 subdirectory when running
|
||||
aclocal.
|
||||
|
||||
Daniel Stenberg (29 Dec 2008)
|
||||
- Phil Lisiecki filed bug report #2413067
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2413067) that identified a problem that
|
||||
would cause libcurl to mark a DNS cache entry "in use" eternally if the
|
||||
subsequence TCP connect failed. It would thus never get pruned and refreshed
|
||||
as it should've been.
|
||||
|
||||
Phil provided his own patch to this problem that while it seemed to work
|
||||
wasn't complete and thus I wrote my own fix to the problem.
|
||||
|
||||
Daniel Stenberg (28 Dec 2008)
|
||||
- Peter Korsgaard fixed building libcurl with "configure --with-ssl
|
||||
--disable-verbose".
|
||||
|
||||
- Anthony Bryan fixed more language and spelling flaws in man pages.
|
||||
|
||||
Daniel Stenberg (22 Dec 2008)
|
||||
- Given a recent enough libssh2, libcurl can now seek/resume with SFTP even
|
||||
on file indexes beyond 2 or 4GB.
|
||||
|
||||
- Anthony Bryan provided a set of patches that cleaned up manual language,
|
||||
corrected spellings and more.
|
||||
|
||||
Daniel Stenberg (20 Dec 2008)
|
||||
- Igor Novoseltsev fixed a bad situation for the multi_socket() API when doing
|
||||
pipelining, as libcurl could then easily get confused and A) work on the
|
||||
handle that was not "first in queue" on a pipeline, or even B) tell the app
|
||||
to REMOVE a socket while it was in use by a second handle in a pipeline. Both
|
||||
errors caused hanging or stalling applications.
|
||||
|
||||
Daniel Stenberg (19 Dec 2008)
|
||||
- curl_multi_timeout() could return a timeout value of 0 even though nothing
|
||||
was actually ready to get done, as the internal time resolution is higher
|
||||
than the returned millisecond timer. Therefore it could cause applications
|
||||
running on fast processors to do short bursts of busy-loops.
|
||||
curl_multi_timeout() will now only return 0 if the timeout is actually
|
||||
alreay triggered.
|
||||
|
||||
- Using the libssh2 0.19 function libssh2_session_block_directions(), libcurl
|
||||
now has an improved ability to do right when the multi interface (both
|
||||
"regular" and multi_socket) is used for SCP and SFTP transfers. This should
|
||||
result in (much) less busy-loop situations and thus less CPU usage with no
|
||||
speed loss.
|
||||
|
||||
Daniel Stenberg (17 Dec 2008)
|
||||
- SCP and SFTP with the multi interface had the same flaw: the 'DONE'
|
||||
operation didn't complete properly if the EAGAIN equivalent was returned but
|
||||
libcurl would simply continue with a half-completed close operation
|
||||
performed. This ruined persistent connection re-use and cause some
|
||||
SSH-protocol errors in general. The correction is unfortunately adding a
|
||||
blocking function - doing it entirely non-blocking should be considered for
|
||||
a better fix.
|
||||
|
||||
Gisle Vanem (16 Dec 2008)
|
||||
- Added the possibility to use the Watt-32 tcp/ip stack under Windows.
|
||||
The change simply involved adding a USE_WATT32 section in the
|
||||
config-win32.h files (under ./lib and ./src). This section disables
|
||||
the use of any Winsock headers.
|
||||
|
||||
Daniel Stenberg (16 Dec 2008)
|
||||
- libssh2_sftp_last_error() was wrongly used at some places in libcurl which
|
||||
made libcurl sometimes not properly abort problematic SFTP transfers.
|
||||
|
||||
Daniel Stenberg (12 Dec 2008)
|
||||
- More work with Igor Novoseltsev to first fix the remaining stuff for
|
||||
removing easy handles from multi handles when the easy handle is/was within
|
||||
a HTTP pipeline. His bug report #2351653
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2351653) was also related and was
|
||||
eventually fixed by a patch by Igor himself.
|
||||
|
||||
Yang Tse (12 Dec 2008)
|
||||
- Patrick Monnerat fixed a build regression, introduced in 7.19.2, affecting
|
||||
OS/400 compilations with IPv6 enabled.
|
||||
|
||||
Daniel Stenberg (12 Dec 2008)
|
||||
- Mark Karpeles filed bug report #2416182 titled "crash in ConnectionExists
|
||||
when using duphandle+curl_mutli"
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2416182) which showed that
|
||||
curl_easy_duphandle() wrongly also copied the pointer to the connection
|
||||
cache, which was plain wrong and caused a segfault if the handle would be
|
||||
used in a different multi handle than the handle it was duplicated from.
|
||||
|
||||
Daniel Stenberg (11 Dec 2008)
|
||||
- Keshav Krity found out that libcurl failed to deal with dotted IPv6
|
||||
addresses if they were very long (>39 letters) due to a too strict address
|
||||
validity parser. It now accepts addresses up to 45 bytes long.
|
||||
|
||||
Daniel Stenberg (11 Dec 2008)
|
||||
- Internet Explorer had a broken HTTP digest authentication before v7 and
|
||||
there are servers "out there" that relies on the client doing this broken
|
||||
Digest authentication. Apache even comes with an option to work with such
|
||||
broken clients.
|
||||
|
||||
The difference is only for URLs that contain a query-part (a '?'-letter and
|
||||
text to the right of it).
|
||||
|
||||
libcurl now supports this quirk, and you enable it by setting the
|
||||
CURLAUTH_DIGEST_IE bit in the bitmask you pass to the CURLOPT_HTTPAUTH or
|
||||
CURLOPT_PROXYAUTH options. They are thus individually controlled to server
|
||||
and proxy.
|
||||
|
||||
(note that there's no way to activate this with the curl tool yet)
|
||||
|
||||
Daniel Fandrich (9 Dec 2008)
|
||||
- Added test cases 1089 and 1090 to test --write-out after a redirect to
|
||||
test a report that the size didn't work, but these test cases pass.
|
||||
|
||||
- Documented CURLOPT_CONNECT_ONLY as being useful only on HTTP URLs.
|
||||
|
||||
Daniel Stenberg (9 Dec 2008)
|
||||
- Ken Hirsch simplified how libcurl does FTPS: now it doesn't assume any
|
||||
particular state for the control connection like it did before for implicit
|
||||
FTPS (libcurl assumed such control connections to be encrypted while some
|
||||
FTPS servers such as FileZilla assumes such connections to be clear
|
||||
mode). Use the CURLOPT_USE_SSL option to set your desired level.
|
||||
|
||||
Daniel Stenberg (8 Dec 2008)
|
||||
- Fred Machado posted about a weird FTP problem on the curl-users list and when
|
||||
researching it, it turned out he got a 550 response back from a SIZE command
|
||||
and then I fell over the text in RFC3659 that says:
|
||||
|
||||
The presence of the 550 error response to a SIZE command MUST NOT be taken
|
||||
by the client as an indication that the file cannot be transferred in the
|
||||
current MODE and TYPE.
|
||||
|
||||
In other words: the change I did on September 30th 2008 and that has been
|
||||
included in the last two releases were a regression and a bad idea. We MUST
|
||||
NOT take a 550 response from SIZE as a hint that the file doesn't exist.
|
||||
|
||||
- Christian Krause filed bug #2221237
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2221237) that identified an infinite
|
||||
loop during GSS authentication given some specific conditions. With his
|
||||
patience and great feedback I managed to narrow down the problem and
|
||||
eventually fix it although I can't test any of this myself!
|
||||
|
||||
Daniel Fandrich (3 Dec 2008)
|
||||
- Fixed the getifaddrs version of Curl_if2ip to work on systems without IPv6
|
||||
support (e.g. Minix)
|
||||
|
||||
Daniel Stenberg (3 Dec 2008)
|
||||
- Igor Novoseltsev filed bug #2351645
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2351645) that identified a problem with
|
||||
the multi interface that occured if you removed an easy handle while in
|
||||
progress and the handle was used in a HTTP pipeline.
|
||||
|
||||
- Pawel Kierski pointed out a mistake in the cookie code that could lead to a
|
||||
bad fclose() after a fatal error had occured.
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2382219)
|
||||
|
||||
Daniel Fandrich (25 Nov 2008)
|
||||
- If a HTTP request is Basic and num is already >=1000, the HTTP test
|
||||
server adds 1 to num to get the data section to return. This allows
|
||||
testing authentication negotiations using the Basic authentication
|
||||
method.
|
||||
|
||||
- Added tests 1087 and 1088 to test Basic authentication on a redirect
|
||||
with and without --location-trusted
|
||||
|
||||
Daniel Stenberg (24 Nov 2008)
|
||||
- Based on a patch by Vlad Grachov, libcurl now uses a new libssh2 0.19
|
||||
function when built to support SCP and SFTP that helps the library to know
|
||||
in which direction a particular libssh2 operation would return EAGAIN so
|
||||
that libcurl knows what socket conditions to wait for before trying the
|
||||
function call again. Previously (and still when using libssh2 0.18 or
|
||||
earlier), libcurl will busy-loop in this situation when the easy interface
|
||||
is used!
|
||||
|
||||
Daniel Fandrich (20 Nov 2008)
|
||||
- Automatically detect OpenBSD's CA cert bundle.
|
||||
|
||||
Daniel Stenberg (19 Nov 2008)
|
||||
- I removed the default use of "Pragma: no-cache" from libcurl when a proxy is
|
||||
used. It has been used since forever but it was never a good idea to use
|
||||
unless explicitly asked for.
|
||||
|
||||
- Josef Wolf's extension that allows a $TESTDIR/gdbinit$testnum file that when
|
||||
you use runtests.pl -g, will be sourced by gdb to allow additional fancy or
|
||||
whatever you see fit
|
||||
|
||||
- Christian Krause reported and fixed a memory leak that would occur with HTTP
|
||||
GSS/kerberos authentication (http://curl.haxx.se/bug/view.cgi?id=2284386)
|
||||
|
||||
- Andreas Wurf and Markus Koetter helped me analyze a problem that Andreas got
|
||||
when uploading files to a single FTP server using multiple easy handle
|
||||
handles with the multi interface. Occasionally a handle would stall in
|
||||
mysterious ways.
|
||||
|
||||
The problem turned out to be a side-effect of the ConnectionExists()
|
||||
function's eagerness to re-use a handle for HTTP pipelining so it would
|
||||
select it even if already being in use, due to an inadequate check for its
|
||||
chances of being used for pipelnining.
|
||||
|
||||
Daniel Fandrich (17 Nov 2008)
|
||||
- Added more compiler warning options for gcc 4.3
|
||||
|
||||
Yang Tse (17 Nov 2008)
|
||||
- Fix a remaining problem in the inet_pton() runtime configure check. And
|
||||
fix internal Curl_inet_pton() failures to reject certain malformed literals.
|
||||
|
||||
- Make configure script check if ioctl with the SIOCGIFADDR command can be
|
||||
used, and define HAVE_IOCTL_SIOCGIFADDR if appropriate.
|
||||
|
||||
Daniel Stenberg (16 Nov 2008)
|
||||
- Christian Krause fixed a build failure when building with gss support
|
||||
enabled and FTP disabled.
|
||||
|
||||
- Added check for NULL returns from strdup() in src/main.c and lib/formdata.c
|
||||
- reported by Jim Meyering also prevent buffer overflow on MSDOS when you do
|
||||
for example -O on a url with a file name part longer than PATH_MAX letters
|
||||
|
||||
- lib/nss.c fixes based on the report by Jim Meyering: I went over and added
|
||||
checks for return codes for all calls to malloc and strdup that were
|
||||
missing. I also changed a few malloc(13) to use arrays on the stack and a
|
||||
few malloc(PATH_MAX) to instead use aprintf() to lower memory use.
|
||||
|
||||
- I fixed a memory leak in Curl_nss_connect() when CURLOPT_ISSUERCERT is
|
||||
in use.
|
||||
|
||||
Daniel Fandrich (14 Nov 2008)
|
||||
- Added .xml as one of the few common file extensions known by the multipart
|
||||
form generator.
|
||||
|
||||
- Added some #ifdefs around header files and change the EAGAIN test to
|
||||
fix compilation on Cell (reported by Jeff Curley).
|
||||
|
||||
Yang Tse (14 Nov 2008)
|
||||
- Fixed several configure script issues affecting checks for inet_ntoa_r(),
|
||||
inet_ntop(), inet_pton(), getifaddrs(), fcntl() and getaddrinfo().
|
||||
|
||||
Yang Tse (13 Nov 2008)
|
||||
- Refactored configure script detection of functions used to set sockets into
|
||||
non-blocking mode, and decouple function detection from function capability.
|
||||
|
||||
Version 7.19.2 (13 November 2008)
|
||||
|
||||
Michal Marek (13 Nov 2008)
|
||||
- Fixed a potential data loss in Curl_client_write() when the transfer is
|
||||
paused.
|
||||
|
||||
Daniel Stenberg (11 Nov 2008)
|
||||
- Rainer Canavan filed bug #2255627
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2255627) which pointed out that a
|
||||
program using libcurl's multi interface to download a HTTPS page with a
|
||||
libcurl built powered by OpenSSL, would easily get silly and instead hand
|
||||
over SSL details as data instead of the actual HTTP headers and body. This
|
||||
happened because libcurl would consider the connection handshake done too
|
||||
early. This problem was introduced at September 22nd 2008 with my fix of the
|
||||
bug #2107377
|
||||
|
||||
The correct fix is now instead done within the GnuTLS-handling code, as both
|
||||
the OpenSSL and the NSS code already deal with this situation in similar
|
||||
fashion. I added test case 560 in an attempt to verify this fix, but
|
||||
unfortunately it didn't trigger it even before this fix!
|
||||
|
||||
Yang Tse (11 Nov 2008)
|
||||
- Related with bug #2230535 (http://curl.haxx.se/bug/view.cgi?id=2230535)
|
||||
Daniel Fandrich noticed that curl_addrinfo was also missing in the build
|
||||
process of other four non-configure platforms. Added now.
|
||||
|
||||
Daniel Fandrich (7 Nov 2008)
|
||||
- The getifaddrs() version of Curl_if2ip() crashed when used on a Linux
|
||||
system with a TEQL load-balancing device configured, which doesn't
|
||||
have an address. Thanks to Adam Sampson for spotting this (bug #2234923).
|
||||
|
||||
Yang Tse (6 Nov 2008)
|
||||
- Merged existing IPv4 and IPv6 Curl_ip2addr functions into a single one
|
||||
which now also takes a protocol address family argument.
|
||||
|
||||
- Bug #2230535 (http://curl.haxx.se/bug/view.cgi?id=2230535) pointed out a
|
||||
problem with MSVC 6 makefile that caused a build failure. It was noted that
|
||||
the curl_addrinfo.obj reference was missing. I took the opportunity to sort
|
||||
the list in which this was missing. Issue submitted by John Wilkinson.
|
||||
|
||||
Version 7.19.1 (5 November 2008)
|
||||
|
||||
Daniel Stenberg (4 Nov 2008)
|
||||
- CURLINFO_FILETIME now works for file:// transfers as well
|
||||
|
||||
Daniel Stenberg (3 Nov 2008)
|
||||
- Bug #2218480 (http://curl.haxx.se/bug/view.cgi?id=2218480) pointed out a
|
||||
problem with my CURLINFO_PRIMARY_IP fix from October 7th that caused a NULL
|
||||
pointer read. I also took the opportunity to clean up this logic (storing of
|
||||
the connection's IP address) somewhat as we had it stored in two different
|
||||
places and ways previously and they are now unified.
|
||||
|
||||
Yang Tse (3 Nov 2008)
|
||||
- Fix undersized IPv6 address internal buffer. IPv6 address strings longer
|
||||
than 35 characters would be truncated.
|
||||
|
||||
Daniel Stenberg (2 Nov 2008)
|
||||
- Daniel Johnson reported and fixed:
|
||||
|
||||
When c-ares isn't enabled, libcurl by default calls getaddrinfo with family
|
||||
set to PF_UNSPEC which causes getaddrinfo to return all available addresses,
|
||||
both IPv4 and IPv6. Libcurl then tries each one until it can connect. If the
|
||||
net connection doesn't support IPv6, libcurl can still fall back to IPv4.
|
||||
|
||||
However, since c-ares doesn't support PF_UNSPEC, when it's used it defaults
|
||||
to using family=PF_INET6 and therefore only returns IPv6 addresses when AAAA
|
||||
records are available, even if IPv4 addresses are also available. The effect
|
||||
is that since my ISP doesn't do IPv6, libcurl can't connect at all to a site
|
||||
that has AAAA records. It will work if I explicitly use CURL_IPRESOLVE_V4 or
|
||||
--ipv4 with the curl tool. I discovered this when curl would fail to connect
|
||||
to seemingly random sites. It turns out they weren't random, they were sites
|
||||
with AAAA records.
|
||||
|
||||
So now libcurl defaults to PF_INET... until c-ares has been tought to offer
|
||||
both.
|
||||
|
||||
Yang Tse (31 Oct 2008)
|
||||
- Tests 558 and 559 are stabilized. These two tests were initially introduced
|
||||
to aid in the location of a seg-fault which was only triggered on non-debug
|
||||
builds done with the icc 9.1 Intel compiler. Test 558 does not trigger the
|
||||
problem, but test 559 does trigger it. As of today, it isn't yet absolutely
|
||||
clear if it is a compiler optimizer issue or a memory corruption one.
|
||||
|
||||
Yang Tse (30 Oct 2008)
|
||||
- Use our Curl_addrinfo structure definition to handle address info data even
|
||||
when a system addrinfo struct is available. Provide and use a wrapper around
|
||||
systems getaddrinfo function, Curl_getaddrinfo_ex which returns a pointer to
|
||||
a list of dynamically allocated Curl_addrinfo structs.
|
||||
|
||||
Configure will check freeaddrinfo and getaddrinfo functions and define
|
||||
preprocessor symbols HAVE_FREEADDRINFO and HAVE_GETADDRINFO when appropriate.
|
||||
|
||||
Daniel Fandrich (29 Oct 2008)
|
||||
- Fixed a bug that caused a few bytes of garbage to be sent after a
|
||||
curl_easy_pause() during a chunky upload. Reported by Steve Roskowski.
|
||||
|
||||
Daniel Fandrich (28 Oct 2008)
|
||||
- Changed the "resolve" test precheck program to verify that an IPv6 socket
|
||||
can be created before resolving the IPv6 name. In the context of running
|
||||
a test, it doesn't make sense to run an IPv6 test when a host is resolvable
|
||||
but IPv6 isn't usable. This should fix failures of test 1085 on hosts with
|
||||
library and DNS support for IPv6 but where actual use of IPv6 has been
|
||||
administratively disabled.
|
||||
|
||||
Daniel Fandrich (24 Oct 2008)
|
||||
- Added experimental support for zlib and OpenSSL on Symbian OS.
|
||||
|
||||
Daniel Fandrich (21 Oct 2008)
|
||||
- Fixed some problems with SFTP range support to fix test cases 634 through
|
||||
637.
|
||||
|
||||
Daniel Fandrich (17 Oct 2008)
|
||||
- Fixed a compile error reported by Albert Chin on AIX and IRIX when using
|
||||
GTLS.
|
||||
|
||||
Daniel Stenberg (16 Oct 2008)
|
||||
- Igor Novoseltsev added CURLOPT_PROXYUSER and CURLOPT_PROXYPASSWORD that then
|
||||
make CURLOPT_PROXYUSERPWD sort of deprecated. The primary motive for adding
|
||||
these new options is that they have no problems with the colon separator
|
||||
that the CURLOPT_PROXYUSERPWD option does.
|
||||
|
||||
Daniel Stenberg (15 Oct 2008)
|
||||
- Pascal Terjan filed bug #2154627
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2154627) which pointed out that libcurl
|
||||
uses strcasecmp() in multiple places where it causes failures when the
|
||||
Turkish locale is used. This is because 'i' and 'I' isn't the same letter so
|
||||
strcasecmp() on those letters are different in Turkish than in English (or
|
||||
just about all other languages). I thus introduced a totally new internal
|
||||
function in libcurl (called Curl_raw_equal) for doing case insentive
|
||||
comparisons for english-(ascii?) style strings that thus will make "file"
|
||||
and "FILE" match even if the Turkish locale is selected.
|
||||
|
||||
Daniel Fandrich (15 Oct 2008)
|
||||
- A <precheck> command is considered to have failed if it returns a non-zero
|
||||
return code. This way, if the precheck command can't be run at all for
|
||||
whatever reason, it's treated as a precheck failure which causes the
|
||||
test to be skipped.
|
||||
|
||||
Daniel Stenberg (15 Oct 2008)
|
||||
- John Wilkinson filed bug #2155496
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2155496) pointing out an error case
|
||||
without a proper human-readable error message. When a read callback returns
|
||||
a too large value (like when trying to return a negative number) it would
|
||||
trigger and the generic error message then makes the proplem slightly
|
||||
different to track down. I've added an error message for this now.
|
||||
|
||||
Daniel Fandrich (9 Oct 2008)
|
||||
- Fixed the --interface option to work with IPv6 connections on glibc
|
||||
systems supporting getifaddrs(). Also fixed a problem where an IPv6
|
||||
address could be chosen instead of an IPv4 one for --interface when it
|
||||
involved a name lookup.
|
||||
|
||||
Daniel Fandrich (8 Oct 2008)
|
||||
- Added tests 1082 through 1085 to test symbolic --interface parameters
|
||||
|
||||
- Added tests 633 through 637 to test the new file range support for SFTP.
|
||||
All but the first test cause an infinite loop or other failure and so
|
||||
are added to DISABLED.
|
||||
|
||||
Daniel Stenberg (8 Oct 2008)
|
||||
- John Wilkinson filed bug #2152270
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2152270) which identified and fixed a
|
||||
CURLINFO_REDIRECT_URL memory leak and an additional wrong-doing:
|
||||
|
||||
Any subsequent transfer with a redirect leaks memory, eventually crashing
|
||||
the process potentially.
|
||||
|
||||
Any subsequent transfer WITHOUT a redirect causes the most recent redirect
|
||||
that DID occur on some previous transfer to still be reported.
|
||||
|
||||
- Igor Novoseltsev filed bug #2111613
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2111613) that eventually identified a
|
||||
flaw in how the multi_socket interface in some cases missed to call the
|
||||
timeout callback when easy interfaces are removed and added within the same
|
||||
millisecond.
|
||||
|
||||
- Igor Novoseltsev brought a patch that introduced two new options to
|
||||
curl_easy_setopt: CURLOPT_USERNAME and CURLOPT_PASSWORD that sort of
|
||||
deprecates the good old CURLOPT_USERPWD since they allow applications to set
|
||||
the user name and password independently and perhaps more importantly allow
|
||||
both to contain colon(s) which CURLOPT_USERPWD doesn't fully support.
|
||||
|
||||
Daniel Fandrich (7 Oct 2008)
|
||||
- Changed the handling of read/write errors in Curl_perform() to allow a
|
||||
a fresh connection to be made in such cases and the request retransmitted.
|
||||
This should fix test case 160. Added test case 1079 in an attempt to
|
||||
test a similar connection dropping scenario, but as a race condition, it's
|
||||
hard to test reliably.
|
||||
|
||||
- Created test cases 1080 and 1081 to reproduce a problem of
|
||||
CURLINFO_REDIRECT_URL leaking memory and returning incorrect results when
|
||||
two URLs are requested. Reported by vmpdemo in bug #2152270
|
||||
|
||||
Daniel Stenberg (7 Oct 2008)
|
||||
- Fixed CURLINFO_PRIMARY_IP: When libcurl created a connection to host A then
|
||||
the app re-used the handle to do a connection to host B and then again
|
||||
re-used the handle to host A, it would not update the info with host A's IP
|
||||
address (due to the connection being re-used) but it would instead report
|
||||
the info from host B.
|
||||
|
||||
Yang Tse (7 Oct 2008)
|
||||
- Added --enable-optimize configure option to enable and disable compiler
|
||||
optimizations to allow decoupled setting from --enable-debug.
|
||||
|
||||
Yang Tse (2 Oct 2008)
|
||||
- Added --enable-warnings configure option to enable and disable strict
|
||||
compiler warnings to allow decoupled setting from --enable-debug.
|
||||
|
||||
runtests.pl will now run with picky compiler warnings enabled unless
|
||||
explicitly disabled.
|
||||
|
||||
Daniel Fandrich (1 Oct 2008)
|
||||
- "make clean" now cleans out the docs and tests directories, too.
|
||||
|
||||
Daniel Stenberg (30 Sep 2008)
|
||||
- The libcurl FTP code now returns CURLE_REMOTE_FILE_NOT_FOUND error when SIZE
|
||||
gets a 550 response back for the cases where a download (or NOBODY) is
|
||||
wanted. It still allows a 550 as response if the SIZE is used as part of an
|
||||
upload process (like if resuming an upload is requested and the file isn't
|
||||
there before the upload). I also modified the FTP test server and a few test
|
||||
cases accordingly to match this modified behavior.
|
||||
|
||||
Daniel Stenberg (29 Sep 2008)
|
||||
- Daniel Egger provided a patch that allows you to disable proxy support in
|
||||
libcurl to somewhat reduce the size of the binary. Run configure
|
||||
--disable-proxy.
|
||||
|
||||
Daniel Fandrich (29 Sep 2008)
|
||||
- Moved all signal-based name resolution timeout handling into a single new
|
||||
Curl_resolv_timeout function to reduce coupling.
|
||||
|
||||
Daniel Stenberg (29 Sep 2008)
|
||||
- Ian Lynagh provided a patch that now makes CURLOPT_RANGE work fine for SFTP
|
||||
downloads!
|
||||
|
||||
- Maxim Ivanov filed bug report #2107803
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2107803) "no CURLINFO_REDIRECT_URL in
|
||||
multi mode" together with a patch that fixed the problem.
|
||||
|
||||
Daniel Stenberg (25 Sep 2008)
|
||||
- Emanuele Bovisio submitted bug report #2126435. We fixed the HTTP Digest
|
||||
auth code to not behave badly when getting a blank realm with
|
||||
realm="". http://curl.haxx.se/bug/view.cgi?id=2126435
|
||||
|
||||
Daniel Fandrich (23 Sep 2008)
|
||||
- Make sure not to dereference the wrong UrlState proto union member when
|
||||
switching from one protocol to another in a single request (e.g.
|
||||
redirecting from HTTP to FTP as in test 1055) by resetting
|
||||
state.expect100header before every request.
|
||||
|
||||
Daniel Stenberg (23 Sep 2008)
|
||||
- Introducing Jamie Lokier's function for date to epoch conversion used in the
|
||||
date parser function. This makes our function less dependent on system-
|
||||
provided functions and instead we do all the magic ourselves. We also no
|
||||
longer depend on the TZ environment variable. Switching to our own converter
|
||||
has some side-effect and they are noted here for future reference (taken
|
||||
from a mail by mr Lokier):
|
||||
|
||||
time_t is not measured in seconds in the ANSI C standard - or even counted
|
||||
uniformly - weird platforms can use other numeric representations of dates
|
||||
in time_t - hence the difftime() function.
|
||||
|
||||
On POSIX time_t is measured in UTC seconds, which means not including leap
|
||||
seconds. But it's mentioned in a few places that some old POSIX-ish
|
||||
environments include leap seconds in their time_t counts...
|
||||
|
||||
I'm pretty sure [the new implementation is] correct on anything truly POSIX.
|
||||
And it's obviously a lot less dependent on platform quirks and corner cases
|
||||
in many ways than the mktime() version.
|
||||
|
||||
- Rob Crittenden brought a patch to "add some locking for thread-safety to NSS
|
||||
implementation".
|
||||
|
||||
Daniel Stenberg (22 Sep 2008)
|
||||
- Made the SOCKS code use the new Curl_read_plain() function to fix the bug
|
||||
Markus Moeller reported: http://curl.haxx.se/mail/archive-2008-09/0016.html
|
||||
|
||||
- recv() errors other than those equal to EAGAIN now cause proper
|
||||
CURLE_RECV_ERROR to get returned. This made test case 160 fail so I've now
|
||||
disabled it until we can figure out another way to exercise that logic.
|
||||
|
||||
- Michael Goffioul filed bug report #2107377 "Problem with multi + GnuTLS +
|
||||
proxy" (http://curl.haxx.se/bug/view.cgi?id=2107377) that showed how a multi
|
||||
interface using program didn't work when built with GnuTLS and a CONNECT
|
||||
request was done over a proxy (basically test 502 over a proxy to a HTTPS
|
||||
site). It turned out the ssl connect function would get called twice which
|
||||
caused the second call to fail.
|
||||
|
||||
Daniel Fandrich (22 Sep 2008)
|
||||
- Fixed test 539 to handle an out of memory condition that shows up now
|
||||
that memdebug.h is included in the test programs.
|
||||
|
||||
Yang Tse (20 Sep 2008)
|
||||
- Fix regression in configure script which affected OpenSSL builds on MSYS.
|
||||
|
||||
Yang Tse (19 Sep 2008)
|
||||
- configure script now checks availability of the alarm() function.
|
||||
|
||||
Daniel Fandrich (18 Sep 2008)
|
||||
- Don't bother to install a SIGALRM handler unless alarm() is available.
|
||||
Also, leave the existing SIGALRM handler alone if the timeout is too small
|
||||
to handle.
|
||||
|
||||
Daniel Fandrich (17 Sep 2008)
|
||||
- Removed reference to curl-ca-bundle.crt in the host verification failure
|
||||
error message.
|
||||
|
||||
Yang Tse (17 Sep 2008)
|
||||
- Improve configure detection of gethostname(), localtime_r(), strstr(),
|
||||
getservbyport_r(), gethostbyaddr_r() and gethostbyname_r().
|
||||
|
||||
Yang Tse (14 Sep 2008)
|
||||
- Improve configure detection of strcasecmp(), strcasestr(), strcmpi(),
|
||||
stricmp(), strlcat(), strncasecmp(), strncmpi() and strnicmp().
|
||||
|
||||
Yang Tse (13 Sep 2008)
|
||||
- Disable tracking of fdopen() calls in the low-level memory leak tracking
|
||||
code when fdopen() is not available, to avoid compiler error.
|
||||
|
||||
Yang Tse (12 Sep 2008)
|
||||
- Further adjust detection of strerror_r() in the configure process, and
|
||||
ensure that errno is not modified inside Curl_strerror().
|
||||
|
||||
Yang Tse (10 Sep 2008)
|
||||
- Improve detection of gmtime_r(), strtoll(), sigaction(), strtok_r(),
|
||||
strdup() and ftruncate() in the configure process.
|
||||
|
||||
Daniel Fandrich (9 Sep 2008)
|
||||
- Mike Revi discovered some swapped speed switches documented in the curl man
|
||||
page.
|
||||
|
||||
- Checked in some documentation and code improvements and fixes that I
|
||||
discovered in the FreeBSD ports system.
|
||||
|
||||
Daniel Stenberg (8 Sep 2008)
|
||||
- Dmitry Kurochkin patched a problem: I have found bug in pipelining through
|
||||
proxy. I have a transparent proxy. When running with http_proxy environment
|
||||
variable not set my test completes fine (it goes through transparent
|
||||
proxy). When I set http_proxy variable my test hangs after the first
|
||||
downloaded is complete. Looks like the second handle never gets out from
|
||||
WAITDO state.
|
||||
|
||||
The fix: It makes checkPendPipeline move 1 handler from pend pipe to send
|
||||
pipe if pipelining is not supported by server but there are no handles in
|
||||
send and recv pipes.
|
||||
|
||||
- Stefan Krause pointed out that libcurl would wrongly send away cookies to
|
||||
sites in cases where the cookie clearly has a very old expiry date. The
|
||||
condition was simply that libcurl's date parser would fail to convert the
|
||||
date and it would then count as a (timed-based) match. Starting now, a
|
||||
missed date due to an unsupported date format or date range will now cause
|
||||
the cookie to not match.
|
||||
|
||||
Daniel Fandrich (5 Sep 2008)
|
||||
- Improved the logic that decides whether to use HTTP 1.1 features or not in a
|
||||
request. Setting a specific version with CURLOPT_HTTP_VERSION overrides
|
||||
all other checks, but otherwise, a 1.0 request will be made if the server
|
||||
is known to support only 1.0 because it previously responded so and the
|
||||
connection was kept alive, or a response to a previous request on this handle
|
||||
came back as 1.0. The latter could take place in cases like redirection or
|
||||
authentication where several requests have to be made before the operation
|
||||
is complete. If any one of the servers in a redirection chain supports only
|
||||
1.0, then remaining requests will be sent in 1.0 mode.
|
||||
|
||||
- Detect cases where an upload must be sent chunked and the server supports
|
||||
only HTTP 1.0 and return CURLE_UPLOAD_FAILED.
|
||||
|
||||
Daniel Stenberg (5 Sep 2008)
|
||||
- Martin Drasar provided the CURLOPT_POSTREDIR patch. It renames
|
||||
CURLOPT_POST301 (but adds a define for backwards compatibility for you who
|
||||
don't define CURL_NO_OLDIES). This option allows you to now also change the
|
||||
libcurl behavior for a HTTP response 302 after a POST to not use GET in the
|
||||
subsequent request (when CURLOPT_FOLLOWLOCATION is enabled). I edited the
|
||||
patch somewhat before commit. The curl tool got a matching --post302
|
||||
option. Test case 1076 was added to verify this.
|
||||
|
||||
- Introducing CURLOPT_CERTINFO and the corresponding CURLINFO_CERTINFO. By
|
||||
enabling this feature with CURLOPT_CERTINFO for a request using SSL (HTTPS
|
||||
or FTPS), libcurl will gather lots of server certificate info and that info
|
||||
can then get extracted by a client after the request has completed with
|
||||
curl_easy_getinfo()'s CURLINFO_CERTINFO option. Linus Nielsen Feltzing
|
||||
helped me test and smoothen out this feature.
|
||||
|
||||
Unfortunately, this feature currently only works with libcurl built to use
|
||||
OpenSSL.
|
||||
|
||||
This feature was sponsored by networking4all.com - thanks!
|
||||
|
||||
- Dmitriy Sergeyev pointed out that curl_easy_pause() didn't unpause properly
|
||||
during certain conditions. I also changed this code to use realloc() based
|
||||
on Daniel Fandrich's suggestion.
|
||||
|
||||
Guenter Knauf (4 Sep 2008)
|
||||
- MingW32 non-configure builds are now largefile feature enabled by default.
|
||||
NetWare LIBC builds are also now largefile feature enabled by default.
|
||||
|
||||
Yang Tse (4 Sep 2008)
|
||||
- Several fixes related with print formatting string directives.
|
||||
|
||||
Daniel Fandrich (3 Sep 2008)
|
||||
- Search for the FreeBSD CA cert file /usr/local/share/certs/ca-root.crt
|
||||
|
||||
Daniel Fandrich (2 Sep 2008)
|
||||
- Fixed an out of memory problem that caused torture test failures in tests
|
||||
706 and 707.
|
||||
|
||||
Daniel Stenberg (2 Sep 2008)
|
||||
- Keith Mok added supported_protocols and supported_features to the pkg-config
|
||||
file for libcurl, and while doing that fix he unified with curl-config.in
|
||||
how the supported protocols and features are extracted and used, so both those
|
||||
tools should now always be synced.
|
||||
|
||||
Version 7.19.0 (1 September 2008)
|
||||
|
||||
Daniel Fandrich (29 Aug 2008)
|
||||
@@ -504,7 +1262,7 @@ Daniel Stenberg (22 Jun 2008)
|
||||
libcurl used Content-Range: instead of Range when doing a range request with
|
||||
--head (CURLOPT_NOBODY). This is now fixed and test case 1032 was added to
|
||||
verify.
|
||||
|
||||
|
||||
Daniel Fandrich (21 Jun 2008)
|
||||
- Stopped using ranges in scanf character sequences (e.g. %[a-z]) since that
|
||||
is not ANSI C, just a common extension. This caused problems on
|
||||
@@ -645,7 +1403,7 @@ Daniel Stenberg (26 May 2008)
|
||||
the new url was but a query string such as "Location: ?moo=foo". Test case
|
||||
1031 was added to verify this fix.
|
||||
|
||||
- Andreas Faerber and Scott McCreary made (lib)curl build for the Haiku OS.
|
||||
- Andreas Faerber and Scott McCreary made (lib)curl build for the Haiku OS.
|
||||
|
||||
Yang Tse (26 May 2008)
|
||||
- David Rosenstrauch reported that header files spnegohelp.h and
|
||||
@@ -758,7 +1516,7 @@ Daniel Stenberg (26 Apr 2008)
|
||||
bug #1944825 (http://curl.haxx.se/bug/view.cgi?id=1944825). I have not
|
||||
personally approached the automake team about either one of these but I
|
||||
figure we need a Solaris 10 guy to do it!
|
||||
|
||||
|
||||
Yang Tse (25 Apr 2008)
|
||||
- Added 'timeout' and 'delay' attributes support for the test harness
|
||||
<command> subsection.
|
||||
@@ -809,7 +1567,7 @@ Michal Marek (7 Apr 2008)
|
||||
- Fix the MIT / Heimdal check for good:
|
||||
Define HAVE_GSSMIT if <gssapi/{gssapi.h,gssapi_generic.h,gssapi_krb5.h}> are
|
||||
available, otherwise define HAVE_GSSHEIMDAL if <gssapi.h> is available.
|
||||
|
||||
|
||||
Only define GSS_C_NT_HOSTBASED_SERVICE to gss_nt_service_name if
|
||||
GSS_C_NT_HOSTBASED_SERVICE isn't declared by the gssapi headers. This should
|
||||
avoid breakage in case we wrongly recognize Heimdal as MIT again.
|
||||
@@ -1014,7 +1772,7 @@ Daniel S (20 Feb 2008)
|
||||
Guenter Knauf (19 Feb 2008)
|
||||
- We do no longer support SSLv2 by default since it has known flaws.
|
||||
Kaspar Brand provided a patch for all supported SSL toolkits.
|
||||
|
||||
|
||||
Daniel Fandrich (19 Feb 2008)
|
||||
- Added test309 to test HTTP redirect to HTTPS URL
|
||||
|
||||
@@ -1037,7 +1795,7 @@ Daniel S (17 Feb 2008)
|
||||
- Based on the same debugging logic, I've also made Curl_http_done() not
|
||||
return CURLE_GOT_NOTHING if called "prematurely". This should have no real
|
||||
effect to anything but the code makes more sense like this.
|
||||
|
||||
|
||||
Daniel S (15 Feb 2008)
|
||||
- Made the gnutls code path not even try to get the server cert if no peer
|
||||
verification is requested. Previously it would even return failure if gnutls
|
||||
|
||||
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.
|
||||
|
||||
|
||||
10
Makefile.am
10
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,7 +25,7 @@ AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
EXTRA_DIST = CHANGES COPYING maketgz reconf Makefile.dist curl-config.in \
|
||||
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
|
||||
|
||||
@@ -77,6 +77,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 +109,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.3
|
||||
|
||||
Public curl releases: 106
|
||||
Command line options: 127
|
||||
curl_easy_setopt() options: 153
|
||||
Public curl releases: 109
|
||||
Command line options: 128
|
||||
curl_easy_setopt() options: 158
|
||||
Public functions in libcurl: 58
|
||||
Known libcurl bindings: 36
|
||||
Contributors: 654
|
||||
Known libcurl bindings: 37
|
||||
Contributors: 683
|
||||
|
||||
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 CURLAUTH_DIGEST_IE bit added for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH
|
||||
o VC9 Makefiles were added to the release package
|
||||
|
||||
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 build failure when disabling FTP but enabling GSS
|
||||
o fixed several calls to memory functions that didn't check return codes
|
||||
o memory leak for SSL connects with libcurl/NSS when CURLOPT_ISSUERCERT was
|
||||
used
|
||||
o re-use of connections with the multi interface when multiple handles used
|
||||
the same server
|
||||
o memory leak with HTTP GSS/kerberos authentication
|
||||
o removed the default use of "Pragma: no-cache"
|
||||
o fix SCP/SFTP busyloop by using a new libssh2 1.0 function
|
||||
o bad fclose() after a fatal error in cookie code
|
||||
o curl_multi_remove_handle() when the handle was in use in a HTTP pipeline
|
||||
o GSS authentication infinite loop problem
|
||||
o 550 response from SIZE no longer treated as missing file
|
||||
o ftps:// control connections now use explicit protection level
|
||||
o dotted IPv6 addresses longer than 39 bytes failed
|
||||
o curl_easy_duphandle() doesn't try to duplicate the connection cache pointer
|
||||
o build failure on OS/400 when enabling IPv6
|
||||
o better detection of SFTP failures
|
||||
o improved connection re-use for subsequent SCP and SFTP transfers
|
||||
o multi interface does less busy-loops for SCP and SFTP transfers with libssh2
|
||||
1.0 or later
|
||||
o curl_multi_timeout() no longer returns timeout 0 when there's still more
|
||||
than 0 but less than 999 microseconds left
|
||||
o the multi_socket API and HTTP pipelining now work a lot better when combined
|
||||
o SFTP seek/resume beyond 32bit file sizes
|
||||
o fixed breakage with --with-ssl --disable-verbose
|
||||
o TTL "leak" in the DNS cache
|
||||
o improved NSS initing
|
||||
o curl_easy_reset now resets more options
|
||||
o rare Location: follow bug with the multi interface
|
||||
o the configure script can now detect gnutls with pkg-config
|
||||
o curlbuild.h was adjusted for SunPro compilers
|
||||
o CURLOPT_COOKIELIST set to "SESS" on an easy handle with no cookies data
|
||||
o fixed timeouts for TFTP
|
||||
o fixed PPC builds
|
||||
|
||||
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
|
||||
|
||||
Yang Tse, Daniel Fandrich, Jim Meyering, Christian Krause, Andreas Wurf,
|
||||
Markus Koetter, Josef Wolf, Vlad Grachov, Pawel Kierski, Igor Novoseltsev,
|
||||
Fred Machado, Ken Hirsch, Keshav Krity, Patrick Monnerat, Mark Karpeles,
|
||||
Anthony Bryan, Peter Korsgaard, Phil Lisiecki, Bas Mevissen, Rob Crittenden,
|
||||
Emil Romanus, Karl Moerder, Daniel Black, Stefan Teleman, Michael Wallner,
|
||||
Grant Erickson, Tim Ansell, Andrew de los Reyes
|
||||
|
||||
Thanks! (and sorry if I forgot to mention someone)
|
||||
|
||||
27
TODO-RELEASE
27
TODO-RELEASE
@@ -1,26 +1,19 @@
|
||||
To be addressed before 7.19.0 (planned release: August 2008)
|
||||
=============================
|
||||
To be addressed in 7.19.3 (planned release: January 2009)
|
||||
=========================
|
||||
|
||||
|
||||
To be addressed before 7.19.1 (planned release: October 2008)
|
||||
=============================
|
||||
To be addressed in 7.19.4 (planned release: March 2009)
|
||||
=========================
|
||||
|
||||
157 - the CERTINFO patch as posted to:
|
||||
http://curl.haxx.se/mail/lib-2008-08/0105.html
|
||||
205 - A. Craig West's CURLOPT_NOPROXY option
|
||||
|
||||
158 - Martin Drasar's CURLOPT_POSTREDIR work:
|
||||
http://curl.haxx.se/mail/lib-2008-08/0170.html
|
||||
206 - A. Craig West's CURLOPT_HTTP_VERSION change for CONNECT
|
||||
|
||||
162 - Craig Perras' note "http upload: how to stop on error"
|
||||
http://curl.haxx.se/mail/archive-2008-08/0138.html
|
||||
208 - Patch to allow GSSAPI authentication to a socks5 server
|
||||
|
||||
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
|
||||
214 - progress bar prefix, second try (for the curl tool)
|
||||
|
||||
164 - Automatic downgrading to HTTP 1.0 (tests 1071 through 1074)
|
||||
215 - Patch for Metalink Support (for the curl tool)
|
||||
|
||||
165 - "Problem with CURLOPT_RESUME_FROM and CURLOPT_APPEND" by Daniele Pinau,
|
||||
recipe: http://curl.haxx.se/mail/lib-2008-08/0439.html
|
||||
216 -
|
||||
|
||||
166 -
|
||||
|
||||
957
acinclude.m4
957
acinclude.m4
File diff suppressed because it is too large
Load Diff
118
ares/CHANGES
118
ares/CHANGES
@@ -1,5 +1,123 @@
|
||||
Changelog for the c-ares project
|
||||
|
||||
* 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,8 @@ 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
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libcares.pc
|
||||
|
||||
@@ -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' \
|
||||
@@ -28,7 +28,8 @@ CFLAGS += -DWATT32 -DHAVE_AF_INET6 -DHAVE_PF_INET6 -DHAVE_IOCTLSOCKET \
|
||||
-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
|
||||
|
||||
LDFLAGS = -s
|
||||
|
||||
|
||||
@@ -3,14 +3,14 @@ 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
|
||||
|
||||
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
|
||||
|
||||
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 +18,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
|
||||
|
||||
@@ -160,7 +160,7 @@ lib: prebuild $(LTARGET)
|
||||
|
||||
nlm: prebuild $(TARGETS)
|
||||
|
||||
prebuild: $(OBJDIR) $(OBJDIR)/version.inc config.h arpa/nameser.h
|
||||
prebuild: $(OBJDIR) $(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) >> $@
|
||||
@@ -302,15 +304,12 @@ ifeq ($(LIBARCH),CLIB)
|
||||
@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) >> $@
|
||||
@@ -324,6 +323,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 +350,17 @@ 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_LL 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_LOCALTIME_R 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
|
||||
@@ -387,6 +389,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) >> $@
|
||||
@@ -408,9 +411,3 @@ ifdef OLD_NOVELLSDK
|
||||
@echo $(DL)#define socklen_t int$(DL) >> $@
|
||||
endif
|
||||
|
||||
arpa/nameser.h: nameser.h
|
||||
@echo Fix missing header $@
|
||||
@-mkdir arpa
|
||||
@$(CP) $< arpa
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -57,6 +57,7 @@ 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 \
|
||||
@@ -73,6 +74,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
|
||||
@@ -122,9 +124,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)
|
||||
@@ -184,6 +188,8 @@ $(OBJ_DIR)\ares__read_line.obj: ares__read_line.c setup.h setup_once.h ares.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
|
||||
|
||||
$(OBJ_DIR)\ares_strcasecmp.obj: ares_strcasecmp.c setup.h setup_once.h ares.h
|
||||
|
||||
$(OBJ_DIR)\ares_strerror.obj: ares_strerror.c setup.h setup_once.h ares.h
|
||||
|
||||
$(OBJ_DIR)\ares_cancel.obj: ares_cancel.c setup.h setup_once.h ares.h \
|
||||
@@ -243,3 +249,6 @@ $(OBJ_DIR)\ares_getopt.obj: ares_getopt.c ares_getopt.h
|
||||
|
||||
$(OBJ_DIR)\ares_llist.obj: ares_llist.c setup.h setup_once.h ares.h \
|
||||
ares_private.h ares_llist.h
|
||||
|
||||
$(OBJ_DIR)\ares_writev.obj: ares_writev.c setup.h setup_once.h ares.h \
|
||||
ares_writev.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,4 @@ original ares.
|
||||
|
||||
You'll find all c-ares details and news here:
|
||||
|
||||
http://daniel.haxx.se/projects/c-ares
|
||||
http://c-ares.haxx.se/
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
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
|
||||
|
||||
Fixed:
|
||||
|
||||
o ares_parse_*_reply() functions now return ARES_EBADRESP instead of
|
||||
ARES_EBADNAME if the name in the response failed to decode
|
||||
|
||||
Thanks go to these friendly people for their efforts and contributions:
|
||||
|
||||
|
||||
and obviously Daniel Stenberg
|
||||
Phil Blundell
|
||||
|
||||
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.
|
||||
@@ -702,6 +702,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 +1433,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 +1640,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,160 +1685,6 @@ 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 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.
|
||||
|
||||
AC_DEFUN([CURL_CC_DEBUG_OPTS],
|
||||
[
|
||||
if test "z$ICC" = "z"; then
|
||||
CURL_DETECT_ICC
|
||||
fi
|
||||
|
||||
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)
|
||||
|
||||
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
|
||||
done
|
||||
CFLAGS=$NEWFLAGS
|
||||
|
||||
])
|
||||
|
||||
|
||||
dnl This macro determines if the specified struct exists in the specified file
|
||||
dnl Syntax:
|
||||
dnl CARES_CHECK_STRUCT(headers, struct name, if found, [if not found])
|
||||
@@ -2026,132 +1730,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
|
||||
@@ -240,7 +256,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 +524,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))
|
||||
{
|
||||
@@ -536,6 +553,7 @@ static void find_country_from_cname(const char *cname, struct in_addr 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 +585,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
|
||||
|
||||
149
ares/adig.c
149
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",
|
||||
@@ -188,11 +214,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 +231,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;
|
||||
@@ -436,13 +466,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 +485,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 +498,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 +521,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 +545,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 +565,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 +577,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 +638,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 +651,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;
|
||||
|
||||
|
||||
|
||||
15
ares/ahost.c
15
ares/ahost.c
@@ -43,6 +43,21 @@
|
||||
#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
|
||||
|
||||
static void callback(void *arg, int status, int timeouts, struct hostent *host);
|
||||
static void usage(void);
|
||||
|
||||
|
||||
60
ares/ares.h
60
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
|
||||
@@ -29,10 +29,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 +52,8 @@
|
||||
# include <winsock2.h>
|
||||
# include <ws2tcpip.h>
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -114,6 +115,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)
|
||||
@@ -179,6 +181,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 +229,21 @@ 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_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,6 +252,8 @@ 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,
|
||||
@@ -247,21 +275,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 +312,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)
|
||||
{
|
||||
|
||||
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
|
||||
@@ -141,11 +149,11 @@ static void addr_callback(void *arg, int status, int timeouts,
|
||||
aquery->timeouts += timeouts;
|
||||
if (status == ARES_SUCCESS)
|
||||
{
|
||||
if (aquery->family == AF_INET)
|
||||
status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addr4,
|
||||
if (aquery->addr.family == AF_INET)
|
||||
status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addrV4,
|
||||
sizeof(struct in_addr), AF_INET, &host);
|
||||
else
|
||||
status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addr6,
|
||||
status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addrV6,
|
||||
sizeof(struct in6_addr), AF_INET6, &host);
|
||||
end_aquery(aquery, status, host);
|
||||
}
|
||||
@@ -164,7 +172,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 +225,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 +252,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 +265,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
|
||||
@@ -68,13 +74,13 @@ static void end_hquery(struct host_query *hquery, int status,
|
||||
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,
|
||||
static void sort_addresses(struct hostent *host, const struct apattern *sortlist,
|
||||
int nsort);
|
||||
static void sort6_addresses(struct hostent *host, struct apattern *sortlist,
|
||||
static void sort6_addresses(struct hostent *host, const struct apattern *sortlist,
|
||||
int nsort);
|
||||
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);
|
||||
static int get6_address_index(struct in6_addr *addr, struct apattern *sortlist,
|
||||
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,
|
||||
@@ -239,8 +245,8 @@ static int fake_hostent(const char *name, int family, ares_host_callback callbac
|
||||
numdots++;
|
||||
}
|
||||
}
|
||||
|
||||
/* if we don't have 3 dots, it is illegal
|
||||
|
||||
/* if we don't have 3 dots, it is illegal
|
||||
* (although inet_addr doesn't think so).
|
||||
*/
|
||||
if (numdots != 3)
|
||||
@@ -283,6 +289,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 +391,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 +421,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 +433,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 +447,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 +477,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 +487,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.
|
||||
@@ -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
|
||||
@@ -210,6 +225,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 +238,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
|
||||
|
||||
133
ares/ares_init.c
133
ares/ares_init.c
@@ -19,11 +19,10 @@
|
||||
#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 +35,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 +67,8 @@
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
#include "inet_net_pton.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;
|
||||
}
|
||||
|
||||
@@ -675,7 +731,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 +979,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 +1009,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 +1039,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 +1054,7 @@ static int init_by_defaults(ares_channel channel)
|
||||
}
|
||||
channel->ndomains = 1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (channel->nsort == -1) {
|
||||
@@ -1164,8 +1224,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 +1234,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 +1244,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 +1353,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 +1428,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 +1465,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
|
||||
@@ -1485,9 +1548,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;
|
||||
}
|
||||
|
||||
@@ -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,20 +17,29 @@
|
||||
|
||||
#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>
|
||||
@@ -74,7 +83,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 +95,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)
|
||||
{
|
||||
@@ -106,7 +116,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
||||
addrs = NULL;
|
||||
aliases = NULL;
|
||||
}
|
||||
|
||||
|
||||
naddrs = 0;
|
||||
naliases = 0;
|
||||
|
||||
@@ -114,7 +124,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 +177,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,22 +17,29 @@
|
||||
|
||||
#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>
|
||||
@@ -77,7 +84,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 +123,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 +176,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
|
||||
|
||||
@@ -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>
|
||||
@@ -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,
|
||||
|
||||
@@ -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"
|
||||
@@ -59,7 +60,7 @@ void ares_search(ares_channel channel, const char *name, int dnsclass,
|
||||
char *s;
|
||||
const char *p;
|
||||
int status, ndots;
|
||||
|
||||
|
||||
/* If name only yields one domain to search, then we don't have
|
||||
* to keep extra state, so just do an ares_query().
|
||||
*/
|
||||
@@ -147,7 +148,7 @@ static void search_callback(void *arg, int status, int timeouts,
|
||||
struct search_query *squery = (struct search_query *) arg;
|
||||
ares_channel channel = squery->channel;
|
||||
char *s;
|
||||
|
||||
|
||||
squery->timeouts += timeouts;
|
||||
|
||||
/* Stop searching unless we got a non-fatal error. */
|
||||
@@ -160,7 +161,7 @@ static void search_callback(void *arg, int status, int timeouts,
|
||||
if (squery->trying_as_is)
|
||||
squery->status_as_is = status;
|
||||
|
||||
/*
|
||||
/*
|
||||
* If we ever get ARES_ENODATA along the way, record that; if the search
|
||||
* should run to the very end and we got at least one ARES_ENODATA,
|
||||
* then callers like ares_gethostbyname() may want to try a T_A search
|
||||
@@ -289,10 +290,10 @@ static int single_domain(ares_channel channel, const char *name, char **s)
|
||||
if (status != ARES_SUCCESS)
|
||||
return status;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
error = ERRNO;
|
||||
switch(error)
|
||||
error = errno;
|
||||
switch(error)
|
||||
{
|
||||
case ENOENT:
|
||||
case ESRCH:
|
||||
@@ -300,7 +301,7 @@ static int single_domain(ares_channel channel, const char *name, char **s)
|
||||
default:
|
||||
DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
|
||||
error, strerror(error)));
|
||||
DEBUGF(fprintf(stderr, "Error opening file: %s\n",
|
||||
DEBUGF(fprintf(stderr, "Error opening file: %s\n",
|
||||
hostaliases));
|
||||
*s = NULL;
|
||||
return ARES_EFILE;
|
||||
|
||||
@@ -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 */
|
||||
@@ -4,12 +4,12 @@
|
||||
#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" {
|
||||
|
||||
77
ares/ares_writev.c
Normal file
77
ares/ares_writev.c
Normal file
@@ -0,0 +1,77 @@
|
||||
|
||||
/* $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 <limits.h>
|
||||
#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}
|
||||
|
||||
@@ -76,9 +76,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 +168,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
|
||||
@@ -207,6 +237,20 @@
|
||||
# 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
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* IPV6 COMPATIBILITY */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
@@ -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_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,44 +158,6 @@ 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
|
||||
|
||||
@@ -421,9 +330,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 +343,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) ])
|
||||
@@ -531,6 +439,7 @@ AC_CHECK_HEADERS(
|
||||
sys/socket.h \
|
||||
sys/ioctl.h \
|
||||
sys/param.h \
|
||||
sys/uio.h \
|
||||
netdb.h \
|
||||
netinet/in.h \
|
||||
netinet/tcp.h \
|
||||
@@ -630,6 +539,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(
|
||||
[
|
||||
@@ -819,35 +751,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 +782,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 +844,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 +874,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);
|
||||
|
||||
1226
ares/m4/cares-compilers.m4
Normal file
1226
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
|
||||
])
|
||||
|
||||
2719
ares/m4/cares-functions.m4
Normal file
2719
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 */
|
||||
|
||||
46
ares/setup.h
46
ares/setup.h
@@ -107,6 +107,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 +135,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)
|
||||
|
||||
@@ -181,6 +181,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 +197,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
|
||||
@@ -233,10 +241,18 @@ SOURCE=..\..\ares_private.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
|
||||
|
||||
@@ -5,20 +5,6 @@
|
||||
/* only do the following on windows
|
||||
*/
|
||||
#if (defined(WIN32) || defined(WATT32)) && !defined(MSDOS)
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#ifdef WATT32
|
||||
#include <sys/socket.h>
|
||||
#else
|
||||
#include "nameser.h"
|
||||
#endif
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
#ifdef __WATCOMC__
|
||||
/*
|
||||
@@ -34,57 +20,4 @@ WINAPI DllMain (HINSTANCE hnd, DWORD reason, LPVOID reserved)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef __MINGW32__
|
||||
int
|
||||
ares_strncasecmp(const char *a, const char *b, int n)
|
||||
{
|
||||
int 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;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ares_strcasecmp(const char *a, const char *b)
|
||||
{
|
||||
return strncasecmp(a, b, strlen(a)+1);
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
ares_writev (ares_socket_t s, const struct iovec *vector, size_t count)
|
||||
{
|
||||
char *buffer, *bp;
|
||||
size_t i, bytes = 0;
|
||||
|
||||
/* Find the total number of bytes to write
|
||||
*/
|
||||
for (i = 0; i < count; i++)
|
||||
bytes += vector[i].iov_len;
|
||||
|
||||
if (bytes == 0) /* not an error */
|
||||
return (0);
|
||||
|
||||
/* Allocate a temporary buffer to hold the data
|
||||
*/
|
||||
buffer = bp = (char*) alloca (bytes);
|
||||
if (!buffer)
|
||||
{
|
||||
SET_ERRNO(ENOMEM);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Copy the data into buffer.
|
||||
*/
|
||||
for (i = 0; i < count; ++i)
|
||||
{
|
||||
memcpy (bp, vector[i].iov_base, vector[i].iov_len);
|
||||
bp += vector[i].iov_len;
|
||||
}
|
||||
return (int)swrite(s, buffer, bytes);
|
||||
}
|
||||
#endif /* WIN32 builds only */
|
||||
|
||||
@@ -6,7 +6,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
|
||||
@@ -191,7 +191,7 @@ else
|
||||
libtoolize=`findtool $LIBTOOLIZE`
|
||||
fi
|
||||
|
||||
lt_pversion=`$libtool --version 2>/dev/null|head -n 2|sed -e 's/^[^0-9]*//g' -e 's/[- ].*//'`
|
||||
lt_pversion=`$libtool --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//g' -e 's/[- ].*//'`
|
||||
if test -z "$lt_pversion"; then
|
||||
echo "buildconf: libtool not found."
|
||||
echo " You need libtool version $LIBTOOL_WANTED_VERSION or newer installed"
|
||||
|
||||
553
configure.ac
553
configure.ac
@@ -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
|
||||
@@ -27,6 +27,8 @@ AC_PREREQ(2.57)
|
||||
dnl We don't know the version number "statically" so we use a dash here
|
||||
AC_INIT([curl], [-], [a suitable curl mailing list => http://curl.haxx.se/mail/])
|
||||
|
||||
CURL_OVERRIDE_AUTOCONF
|
||||
|
||||
dnl configure script copyright
|
||||
AC_COPYRIGHT([Copyright (c) 1998 - 2008 Daniel Stenberg, <daniel@haxx.se>
|
||||
This configure script may be copied, distributed and modified under the
|
||||
@@ -36,6 +38,12 @@ AC_CONFIG_SRCDIR([lib/urldata.h])
|
||||
AM_CONFIG_HEADER(lib/config.h src/config.h include/curl/curlbuild.h)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
CURL_CHECK_OPTION_DEBUG
|
||||
CURL_CHECK_OPTION_OPTIMIZE
|
||||
CURL_CHECK_OPTION_WARNINGS
|
||||
|
||||
CURL_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],
|
||||
@@ -130,7 +138,7 @@ dnl Get system canonical name
|
||||
AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
CURL_CHECK_PROG_CC
|
||||
|
||||
dnl Our curl_off_t internal and external configure settings
|
||||
CURL_CONFIGURE_CURL_OFF_T
|
||||
@@ -147,26 +155,12 @@ AC_SYS_LARGEFILE
|
||||
dnl support building of Windows DLLs
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
|
||||
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],[])
|
||||
CURL_PROCESS_DEBUG_BUILD_OPTS
|
||||
|
||||
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
|
||||
;;
|
||||
@@ -245,30 +239,25 @@ dnl **********************************************************************
|
||||
dnl platform/compiler/architecture specific checks/flags
|
||||
dnl **********************************************************************
|
||||
|
||||
CURL_CHECK_COMPILER
|
||||
CURL_SET_COMPILER_BASIC_OPTS
|
||||
CURL_SET_COMPILER_DEBUG_OPTS
|
||||
CURL_SET_COMPILER_OPTIMIZE_OPTS
|
||||
CURL_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
|
||||
@@ -278,44 +267,6 @@ 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
|
||||
|
||||
@@ -459,6 +410,22 @@ AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
|
||||
AC_SUBST(CURL_DISABLE_LDAPS, [1])
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([whether to support proxies])
|
||||
AC_ARG_ENABLE(proxy,
|
||||
AC_HELP_STRING([--enable-proxy],[Enable proxy support])
|
||||
AC_HELP_STRING([--disable-proxy],[Disable proxy support]),
|
||||
[ case "$enableval" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
|
||||
AC_SUBST(CURL_DISABLE_PROXY, [1])
|
||||
;;
|
||||
*) AC_MSG_RESULT(yes)
|
||||
;;
|
||||
esac ],
|
||||
AC_MSG_RESULT(yes)
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([whether to support dict])
|
||||
AC_ARG_ENABLE(dict,
|
||||
AC_HELP_STRING([--enable-dict],[Enable DICT support])
|
||||
@@ -527,13 +494,6 @@ AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
|
||||
dnl The actual use of the USE_MANUAL variable is done much later in this
|
||||
dnl script to allow other actions to disable it as well.
|
||||
|
||||
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 Checks for libraries.
|
||||
dnl **********************************************************************
|
||||
@@ -686,9 +646,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
|
||||
|
||||
@@ -701,6 +659,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) ])
|
||||
@@ -859,24 +818,20 @@ if test "$ipv6" = "yes"; then
|
||||
curl_ipv6_msg="enabled"
|
||||
fi
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Check how non-blocking sockets are set
|
||||
dnl **********************************************************************
|
||||
AC_ARG_ENABLE(nonblocking,
|
||||
AC_HELP_STRING([--enable-nonblocking],[Enable detecting how to do it])
|
||||
AC_HELP_STRING([--disable-nonblocking],[Disable non-blocking socket detection]),
|
||||
[
|
||||
if test "$enableval" = "no" ; then
|
||||
AC_MSG_WARN([non-blocking sockets disabled])
|
||||
AC_DEFINE(HAVE_DISABLED_NONBLOCKING, 1,
|
||||
[to disable NON-BLOCKING connections])
|
||||
# Check if struct sockaddr_in6 have sin6_scope_id member
|
||||
if test "$ipv6" = yes; then
|
||||
AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
|
||||
AC_TRY_COMPILE([
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h>] ,
|
||||
struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes)
|
||||
if test "$have_sin6_scope_id" = yes; then
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
|
||||
else
|
||||
CURL_CHECK_NONBLOCKING_SOCKET
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
],
|
||||
[
|
||||
CURL_CHECK_NONBLOCKING_SOCKET
|
||||
])
|
||||
fi
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Check if the operating system allows programs to write to their own argv[]
|
||||
@@ -1223,35 +1178,40 @@ if test X"$OPT_SSL" != Xno; then
|
||||
|
||||
if test "$PKGTEST" = "yes"; then
|
||||
|
||||
dnl Detect the pkg-config tool, as it may have extra info about the
|
||||
dnl openssl installation we can use. I *believe* this is what we are
|
||||
dnl expected to do on really recent Redhat Linux hosts.
|
||||
CURL_CHECK_PKGCONFIG(openssl)
|
||||
|
||||
AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
|
||||
if test "$PKGCONFIG" != "no" ; then
|
||||
AC_MSG_CHECKING([OpenSSL options with pkg-config])
|
||||
SSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null`
|
||||
SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null`
|
||||
SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
|
||||
|
||||
$PKGCONFIG --exists openssl
|
||||
SSL_EXISTS=$?
|
||||
LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'`
|
||||
|
||||
if test "$SSL_EXISTS" -eq "0"; then
|
||||
SSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null`
|
||||
SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null`
|
||||
SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
|
||||
|
||||
LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'`
|
||||
|
||||
dnl use the values pkg-config reported
|
||||
LIBS="$LIBS $SSL_LIBS"
|
||||
CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
|
||||
LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
|
||||
AC_MSG_RESULT([found])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
dnl use the values pkg-config reported
|
||||
LIBS="$LIBS $SSL_LIBS"
|
||||
CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
|
||||
LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl This is for Msys/Mingw
|
||||
case $host in
|
||||
*-*-msys* | *-*-mingw*)
|
||||
AC_MSG_CHECKING([for gdi32])
|
||||
my_ac_save_LIBS=$LIBS
|
||||
LIBS="-lgdi32 $LIBS"
|
||||
AC_TRY_LINK([#include <windef.h>
|
||||
#include <wingdi.h>],
|
||||
[GdiFlush();],
|
||||
[ dnl worked!
|
||||
AC_MSG_RESULT([yes])],
|
||||
[ dnl failed, restore LIBS
|
||||
LIBS=$my_ac_save_LIBS
|
||||
AC_MSG_RESULT(no)]
|
||||
)
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_CHECK_LIB(crypto, CRYPTO_lock,[
|
||||
HAVECRYPTO="yes"
|
||||
LIBS="-lcrypto $LIBS"
|
||||
@@ -1571,7 +1531,7 @@ if test X"$OPENSSL_ENABLED" = X"1"; then
|
||||
fi
|
||||
|
||||
dnl ----------------------------------------------------
|
||||
dnl FIX: only check for GnuTLS if OpenSSL is not enabled
|
||||
dnl check for GnuTLS
|
||||
dnl ----------------------------------------------------
|
||||
|
||||
dnl Default to compiler & linker defaults for GnuTLS files & libraries.
|
||||
@@ -1585,29 +1545,51 @@ AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]),
|
||||
if test "$OPENSSL_ENABLED" != "1"; then
|
||||
|
||||
if test X"$OPT_GNUTLS" != Xno; then
|
||||
|
||||
AC_MSG_NOTICE([OPT_GNUTLS is $OPT_GNUTLS])
|
||||
|
||||
addld=""
|
||||
if test "x$OPT_GNUTLS" = "xyes"; then
|
||||
check=`libgnutls-config --version 2>/dev/null`
|
||||
if test -n "$check"; then
|
||||
addlib=`libgnutls-config --libs`
|
||||
addcflags=`libgnutls-config --cflags`
|
||||
version=`libgnutls-config --version`
|
||||
gtlsprefix=`libgnutls-config --prefix`
|
||||
fi
|
||||
check=`libgnutls-config --version 2>/dev/null`
|
||||
if test -n "$check"; then
|
||||
addlib=`libgnutls-config --libs`
|
||||
addcflags=`libgnutls-config --cflags`
|
||||
version=`libgnutls-config --version`
|
||||
gtlslib=`libgnutls-config --prefix`/lib$libsuff
|
||||
fi
|
||||
else
|
||||
addlib=`$OPT_GNUTLS/bin/libgnutls-config --libs`
|
||||
addcflags=`$OPT_GNUTLS/bin/libgnutls-config --cflags`
|
||||
version=`$OPT_GNUTLS/bin/libgnutls-config --version 2>/dev/null`
|
||||
gtlsprefix=$OPT_GNUTLS
|
||||
if test -z "$version"; then
|
||||
version="unknown"
|
||||
fi
|
||||
gtlslib=$OPT_GNUTLS/lib$libsuff
|
||||
fi
|
||||
|
||||
if test -z "$version"; then
|
||||
CURL_CHECK_PKGCONFIG(gnutls)
|
||||
|
||||
if test "$PKGCONFIG" != "no" ; then
|
||||
addlib=`$PKGCONFIG --libs-only-l gnutls`
|
||||
addld=`$PKGCONFIG --libs-only-L gnutls`
|
||||
addcflags=`$PKGCONFIG --cflags-only-I gnutls`
|
||||
version=`$PKGCONFIG --modversion gnutls`
|
||||
gtlslib=`echo $addld | $SED -e 's/-L//'`
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if test -z "$version"; then
|
||||
dnl lots of efforts, still no go
|
||||
version="unknown"
|
||||
fi
|
||||
|
||||
if test -n "$addlib"; then
|
||||
|
||||
CLEANLIBS="$LIBS"
|
||||
CLEANCPPFLAGS="$CPPFLAGS"
|
||||
CLEADLDFLAGS="$LDFLAGS"
|
||||
|
||||
LIBS="$LIBS $addlib"
|
||||
LDFLAGS="$LDFLAGS $addld"
|
||||
if test "$addcflags" != "-I/usr/include"; then
|
||||
CPPFLAGS="$CPPFLAGS $addcflags"
|
||||
fi
|
||||
@@ -1628,14 +1610,16 @@ if test "$OPENSSL_ENABLED" != "1"; then
|
||||
if test "x$USE_GNUTLS" = "xyes"; then
|
||||
AC_MSG_NOTICE([detected GnuTLS version $version])
|
||||
|
||||
dnl when shared libs were found in a path that the run-time
|
||||
dnl linker doesn't search through, we need to add it to
|
||||
dnl LD_LIBRARY_PATH to prevent further configure tests to fail
|
||||
dnl due to this
|
||||
if test -n "$gtlslib"; then
|
||||
dnl when shared libs were found in a path that the run-time
|
||||
dnl linker doesn't search through, we need to add it to
|
||||
dnl LD_LIBRARY_PATH to prevent further configure tests to fail
|
||||
dnl due to this
|
||||
|
||||
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlsprefix/lib$libsuff"
|
||||
export LD_LIBRARY_PATH
|
||||
AC_MSG_NOTICE([Added $gtlsprefix/lib$libsuff to LD_LIBRARY_PATH])
|
||||
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlslib"
|
||||
export LD_LIBRARY_PATH
|
||||
AC_MSG_NOTICE([Added $gtlslib to LD_LIBRARY_PATH])
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
@@ -1660,13 +1644,15 @@ if test "$OPENSSL_ENABLED" != "1" -a "$GNUTLS_ENABLED" != "1"; then
|
||||
|
||||
if test X"$OPT_NSS" != Xno; then
|
||||
if test "x$OPT_NSS" = "xyes"; then
|
||||
check=`pkg-config --version 2>/dev/null`
|
||||
if test -n "$check"; then
|
||||
addlib=`pkg-config --libs nss`
|
||||
addcflags=`pkg-config --cflags nss`
|
||||
version=`pkg-config --modversion nss`
|
||||
nssprefix=`pkg-config --variable=prefix nss`
|
||||
fi
|
||||
|
||||
CURL_CHECK_PKGCONFIG(nss)
|
||||
|
||||
if test "$PKGCONFIG" != "no" ; then
|
||||
addlib=`$PKGCONFIG --libs nss`
|
||||
addcflags=`$PKGCONFIG --cflags nss`
|
||||
version=`$PKGCONFIG --modversion nss`
|
||||
nssprefix=`$PKGCONFIG --variable=prefix nss`
|
||||
fi
|
||||
else
|
||||
# Without pkg-config, we'll kludge in some defaults
|
||||
addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl"
|
||||
@@ -1827,22 +1813,22 @@ then
|
||||
AC_DEFINE(DISABLED_THREADSAFE, 1,
|
||||
[Set to explicitly specify we don't want to use thread-safe functions])
|
||||
else
|
||||
if test "$ipv6" != "yes"; then
|
||||
dnl if test "$ipv6" != "yes"; then
|
||||
dnl dig around for gethostbyname_r()
|
||||
CURL_CHECK_GETHOSTBYNAME_R()
|
||||
dnl the old gethostbyname_r check was done here
|
||||
|
||||
dnl dig around for gethostbyaddr_r()
|
||||
dnl CURL_CHECK_GETHOSTBYADDR_R()
|
||||
fi
|
||||
dnl the old gethostbyaddr_r check was here BUT COMMENTED OUT
|
||||
dnl fi
|
||||
|
||||
dnl poke around for inet_ntoa_r()
|
||||
CURL_CHECK_INET_NTOA_R()
|
||||
dnl the old inet_ntoa_r check was done here
|
||||
|
||||
dnl is there a localtime_r()
|
||||
CURL_CHECK_LOCALTIME_R()
|
||||
dnl the old localtime_r check was done here
|
||||
|
||||
dnl is there a strerror_r()
|
||||
CURL_CHECK_STRERROR_R()
|
||||
dnl the old strerror_r check was done here
|
||||
|
||||
checkfor_gmtime_r="yes"
|
||||
fi
|
||||
@@ -1860,55 +1846,14 @@ if test "x$RECENTAIX" = "xyes"; then
|
||||
AC_DEFINE(_THREAD_SAFE, 1, [define this if you need it to compile thread-safe code])
|
||||
|
||||
dnl is there a localtime_r()
|
||||
CURL_CHECK_LOCALTIME_R()
|
||||
dnl the old localtime_r check was done here
|
||||
|
||||
dnl is there a strerror_r()
|
||||
CURL_CHECK_STRERROR_R()
|
||||
dnl the old strerror_r check was done here
|
||||
|
||||
checkfor_gmtime_r="yes"
|
||||
fi
|
||||
|
||||
if test x$cross_compiling != xyes; then
|
||||
|
||||
if test x$checkfor_gmtime_r = xyes; then
|
||||
|
||||
dnl if gmtime_r was found, verify that it actually works, as (at least) HPUX
|
||||
dnl 10.20 is known to have a buggy one. If it doesn't work, disable use of
|
||||
dnl it.
|
||||
|
||||
AC_MSG_CHECKING([if gmtime_r exists and works])
|
||||
AC_RUN_IFELSE([[
|
||||
#include <time.h>
|
||||
int main(void)
|
||||
{
|
||||
time_t local = 1170352587;
|
||||
struct tm *gmt;
|
||||
struct tm keeper;
|
||||
putenv("TZ=CST6CDT");
|
||||
tzset();
|
||||
gmt = gmtime_r(&local, &keeper);
|
||||
if(gmt) {
|
||||
return 0;
|
||||
}
|
||||
return 1; /* failure */
|
||||
}
|
||||
]],
|
||||
dnl success, do nothing
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_GMTIME_R, 1, [if you have (a working) gmtime_r])
|
||||
,
|
||||
dnl failure, now disable the function
|
||||
AC_MSG_RESULT(no)
|
||||
,
|
||||
dnl not invoked when crosscompiling)
|
||||
echo "hej"
|
||||
)
|
||||
fi
|
||||
else
|
||||
dnl and for crosscompiling
|
||||
AC_CHECK_FUNCS(gmtime_r)
|
||||
fi
|
||||
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Back to "normal" configuring
|
||||
@@ -1927,6 +1872,7 @@ AC_CHECK_HEADERS(
|
||||
sys/select.h \
|
||||
sys/socket.h \
|
||||
sys/ioctl.h \
|
||||
sys/uio.h \
|
||||
assert.h \
|
||||
unistd.h \
|
||||
stdlib.h \
|
||||
@@ -2062,6 +2008,48 @@ CURL_CHECK_FUNC_RECVFROM
|
||||
CURL_CHECK_FUNC_SEND
|
||||
CURL_CHECK_MSG_NOSIGNAL
|
||||
|
||||
CURL_CHECK_FUNC_ALARM
|
||||
CURL_CHECK_FUNC_FCNTL
|
||||
CURL_CHECK_FUNC_FDOPEN
|
||||
CURL_CHECK_FUNC_FREEADDRINFO
|
||||
CURL_CHECK_FUNC_FREEIFADDRS
|
||||
CURL_CHECK_FUNC_FTRUNCATE
|
||||
CURL_CHECK_FUNC_GETADDRINFO
|
||||
CURL_CHECK_FUNC_GETHOSTBYADDR
|
||||
CURL_CHECK_FUNC_GETHOSTBYADDR_R
|
||||
CURL_CHECK_FUNC_GETHOSTBYNAME
|
||||
CURL_CHECK_FUNC_GETHOSTBYNAME_R
|
||||
CURL_CHECK_FUNC_GETHOSTNAME
|
||||
CURL_CHECK_FUNC_GETIFADDRS
|
||||
CURL_CHECK_FUNC_GETSERVBYPORT_R
|
||||
CURL_CHECK_FUNC_GMTIME_R
|
||||
CURL_CHECK_FUNC_INET_NTOA_R
|
||||
CURL_CHECK_FUNC_INET_NTOP
|
||||
CURL_CHECK_FUNC_INET_PTON
|
||||
CURL_CHECK_FUNC_IOCTL
|
||||
CURL_CHECK_FUNC_IOCTLSOCKET
|
||||
CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
|
||||
CURL_CHECK_FUNC_LOCALTIME_R
|
||||
CURL_CHECK_FUNC_SETSOCKOPT
|
||||
CURL_CHECK_FUNC_SIGACTION
|
||||
CURL_CHECK_FUNC_SIGINTERRUPT
|
||||
CURL_CHECK_FUNC_SIGNAL
|
||||
CURL_CHECK_FUNC_SIGSETJMP
|
||||
CURL_CHECK_FUNC_STRCASECMP
|
||||
CURL_CHECK_FUNC_STRCASESTR
|
||||
CURL_CHECK_FUNC_STRCMPI
|
||||
CURL_CHECK_FUNC_STRDUP
|
||||
CURL_CHECK_FUNC_STRERROR_R
|
||||
CURL_CHECK_FUNC_STRICMP
|
||||
CURL_CHECK_FUNC_STRLCAT
|
||||
CURL_CHECK_FUNC_STRNCASECMP
|
||||
CURL_CHECK_FUNC_STRNCMPI
|
||||
CURL_CHECK_FUNC_STRNICMP
|
||||
CURL_CHECK_FUNC_STRSTR
|
||||
CURL_CHECK_FUNC_STRTOK_R
|
||||
CURL_CHECK_FUNC_STRTOLL
|
||||
CURL_CHECK_FUNC_WRITEV
|
||||
|
||||
dnl Checks for library functions.
|
||||
dnl AC_PROG_GCC_TRADITIONAL
|
||||
|
||||
@@ -2077,9 +2065,7 @@ esac
|
||||
AC_CHECK_FUNCS([basename \
|
||||
closesocket \
|
||||
fork \
|
||||
ftruncate \
|
||||
geteuid \
|
||||
gethostbyaddr \
|
||||
getpass_r \
|
||||
getppid \
|
||||
getprotobyname \
|
||||
@@ -2087,28 +2073,13 @@ AC_CHECK_FUNCS([basename \
|
||||
getrlimit \
|
||||
gettimeofday \
|
||||
inet_addr \
|
||||
inet_ntoa \
|
||||
inet_pton \
|
||||
perror \
|
||||
pipe \
|
||||
poll \
|
||||
setlocale \
|
||||
setmode \
|
||||
setrlimit \
|
||||
sigaction \
|
||||
siginterrupt \
|
||||
signal \
|
||||
sigsetjmp \
|
||||
socket \
|
||||
strcasecmp \
|
||||
strcasestr \
|
||||
strcmpi \
|
||||
strdup \
|
||||
stricmp \
|
||||
strlcat \
|
||||
strstr \
|
||||
strtok_r \
|
||||
strtoll \
|
||||
uname \
|
||||
utime
|
||||
],[
|
||||
@@ -2134,25 +2105,6 @@ AC_CHECK_FUNCS([basename \
|
||||
])
|
||||
|
||||
|
||||
dnl sigsetjmp() might be a macro and no function so if it isn't found already
|
||||
dnl we make an extra check here!
|
||||
if test "$ac_cv_func_sigsetjmp" != "yes"; then
|
||||
AC_MSG_CHECKING([for sigsetjmp defined as macro])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#include <setjmp.h>
|
||||
]],[[
|
||||
sigjmp_buf jmpenv;
|
||||
sigsetjmp(jmpenv, 1);
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_SIGSETJMP, 1, [If you have sigsetjmp])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
fi
|
||||
|
||||
AC_CHECK_DECL(basename, ,
|
||||
AC_DEFINE(NEED_BASENAME_PROTO, 1, [If you lack a fine basename() prototype]),
|
||||
#ifdef HAVE_STRING_H
|
||||
@@ -2166,22 +2118,17 @@ AC_CHECK_DECL(basename, ,
|
||||
#endif
|
||||
)
|
||||
|
||||
AC_CHECK_DECL(inet_pton, ,
|
||||
AC_DEFINE(HAVE_NO_INET_PTON_PROTO, 1,
|
||||
[Defined if no inet_pton() prototype available]),
|
||||
[
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
]
|
||||
)
|
||||
|
||||
dnl Check if the getnameinfo function is available
|
||||
dnl and get the types of five of its arguments.
|
||||
CURL_CHECK_FUNC_GETNAMEINFO
|
||||
|
||||
if test "$ipv6" = "yes"; then
|
||||
CURL_CHECK_WORKING_GETADDRINFO
|
||||
if test "$ac_cv_func_getaddrinfo" = "yes"; then
|
||||
AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
|
||||
IPV6_ENABLED=1
|
||||
AC_SUBST(IPV6_ENABLED)
|
||||
fi
|
||||
CURL_CHECK_NI_WITHSCOPEID
|
||||
fi
|
||||
|
||||
@@ -2224,6 +2171,15 @@ if test "$disable_poll" = "no"; then
|
||||
fi dnl poll() was found
|
||||
fi dnl poll()-check is not disabled
|
||||
|
||||
dnl ************************************************************
|
||||
dnl enable non-blocking communications
|
||||
dnl
|
||||
CURL_CHECK_OPTION_NONBLOCKING
|
||||
CURL_CHECK_NONBLOCKING_SOCKET
|
||||
|
||||
dnl ************************************************************
|
||||
dnl nroff tool stuff
|
||||
dnl
|
||||
|
||||
AC_PATH_PROG( PERL, perl, ,
|
||||
$PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
|
||||
@@ -2395,31 +2351,6 @@ AC_HELP_STRING([--disable-sspi],[Disable SSPI]),
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
|
||||
dnl ************************************************************
|
||||
dnl lame option to switch on debug options
|
||||
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)
|
||||
|
||||
CPPFLAGS="$CPPFLAGS -DCURLDEBUG"
|
||||
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)
|
||||
)
|
||||
|
||||
dnl ************************************************************
|
||||
dnl disable cryptographic authentication
|
||||
dnl
|
||||
@@ -2546,6 +2477,90 @@ LIBS=$ALL_LIBS dnl LIBS is a magic variable that's used for every link
|
||||
|
||||
AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
|
||||
|
||||
dnl
|
||||
dnl For keeping supported features and protocols also in pkg-config file
|
||||
dnl since it is more cross-compile frient than curl-config
|
||||
dnl
|
||||
|
||||
if test "x$USE_SSLEAY" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
|
||||
elif test -n "$SSL_ENABLED"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
|
||||
fi
|
||||
if test "@KRB4_ENABLED@" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES KRB4"
|
||||
fi
|
||||
if test "x$IPV6_ENABLED" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
|
||||
fi
|
||||
if test "x$HAVE_LIBZ" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
|
||||
fi
|
||||
if test "x$HAVE_ARES" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
|
||||
fi
|
||||
if test "x$IDN_ENABLED" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
|
||||
fi
|
||||
if test "x$USE_WINDOWS_SSPI" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
|
||||
fi
|
||||
if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
|
||||
fi
|
||||
|
||||
AC_SUBST(SUPPORT_FEATURES)
|
||||
|
||||
dnl For supported protocols in pkg-config file
|
||||
if test "x$CURL_DISABLE_HTTP" != "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
|
||||
if test "x$SSL_ENABLED" = "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
|
||||
fi
|
||||
fi
|
||||
if test "x$CURL_DISABLE_FTP" != "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
|
||||
if test "x$SSL_ENABLED" = "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
|
||||
fi
|
||||
fi
|
||||
if test "x$CURL_DISABLE_FILE" != "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
|
||||
fi
|
||||
if test "x$CURL_DISABLE_TELNET" != "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
|
||||
fi
|
||||
if test "x$CURL_DISABLE_LDAP" != "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
|
||||
fi
|
||||
if test "x$CURL_DISABLE_LDAPS" != "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
|
||||
fi
|
||||
if test "x$CURL_DISABLE_DICT" != "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
|
||||
fi
|
||||
if test "x$CURL_DISABLE_TFTP" != "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
|
||||
fi
|
||||
if test "x$USE_LIBSSH2" = "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
|
||||
fi
|
||||
|
||||
AC_SUBST(SUPPORT_PROTOCOLS)
|
||||
|
||||
dnl squeeze whitespace out of some variables
|
||||
|
||||
squeeze CFLAGS
|
||||
squeeze CPPFLAGS
|
||||
squeeze DEFS
|
||||
squeeze LDFLAGS
|
||||
squeeze LIBS
|
||||
|
||||
squeeze CURL_LIBS
|
||||
squeeze LIBCURL_LIBS
|
||||
squeeze TEST_SERVER_LIBS
|
||||
|
||||
AC_CONFIG_FILES([Makefile \
|
||||
docs/Makefile \
|
||||
docs/examples/Makefile \
|
||||
|
||||
@@ -80,71 +80,15 @@ while test $# -gt 0; do
|
||||
;;
|
||||
|
||||
--feature|--features)
|
||||
if test "@USE_SSLEAY@" = "1"; then
|
||||
echo "SSL"
|
||||
NTLM=1 # OpenSSL implies NTLM
|
||||
elif test -n "@SSL_ENABLED@"; then
|
||||
echo "SSL"
|
||||
fi
|
||||
if test "@KRB4_ENABLED@" = "1"; then
|
||||
echo "KRB4"
|
||||
fi
|
||||
if test "@IPV6_ENABLED@" = "1"; then
|
||||
echo "IPv6"
|
||||
fi
|
||||
if test "@HAVE_LIBZ@" = "1"; then
|
||||
echo "libz"
|
||||
fi
|
||||
if test "@HAVE_ARES@" = "1"; then
|
||||
echo "AsynchDNS"
|
||||
fi
|
||||
if test "@IDN_ENABLED@" = "1"; then
|
||||
echo "IDN"
|
||||
fi
|
||||
if test "@USE_WINDOWS_SSPI@" = "1"; then
|
||||
echo "SSPI"
|
||||
NTLM=1
|
||||
fi
|
||||
if test "$NTLM" = "1"; then
|
||||
echo "NTLM"
|
||||
fi
|
||||
for feature in @SUPPORT_FEATURES@ ""; do
|
||||
test -n "$feature" && echo "$feature"
|
||||
done
|
||||
;;
|
||||
|
||||
--protocols)
|
||||
if test "@CURL_DISABLE_HTTP@" != "1"; then
|
||||
echo "HTTP"
|
||||
if test "@SSL_ENABLED@" = "1"; then
|
||||
echo "HTTPS"
|
||||
fi
|
||||
fi
|
||||
if test "@CURL_DISABLE_FTP@" != "1"; then
|
||||
echo "FTP"
|
||||
if test "@SSL_ENABLED@" = "1"; then
|
||||
echo "FTPS"
|
||||
fi
|
||||
fi
|
||||
if test "@CURL_DISABLE_FILE@" != "1"; then
|
||||
echo "FILE"
|
||||
fi
|
||||
if test "@CURL_DISABLE_TELNET@" != "1"; then
|
||||
echo "TELNET"
|
||||
fi
|
||||
if test "@CURL_DISABLE_LDAP@" != "1"; then
|
||||
echo "LDAP"
|
||||
fi
|
||||
if test "@CURL_DISABLE_LDAPS@" != "1"; then
|
||||
echo "LDAPS"
|
||||
fi
|
||||
if test "@CURL_DISABLE_DICT@" != "1"; then
|
||||
echo "DICT"
|
||||
fi
|
||||
if test "@CURL_DISABLE_TFTP@" != "1"; then
|
||||
echo "TFTP"
|
||||
fi
|
||||
if test "@USE_LIBSSH2@" = "1"; then
|
||||
echo "SCP"
|
||||
echo "SFTP"
|
||||
fi
|
||||
for protocol in @SUPPORT_PROTOCOLS@; do
|
||||
echo "$protocol"
|
||||
done
|
||||
;;
|
||||
--version)
|
||||
echo libcurl @VERSION@
|
||||
|
||||
@@ -181,6 +181,7 @@ Smalltalk
|
||||
http://www.squeaksource.com/CurlPlugin/
|
||||
|
||||
SP-Forth
|
||||
|
||||
SP-Forth binding by ygrek
|
||||
http://www.forth.org.ru/~ac/lib/lin/curl/
|
||||
|
||||
@@ -199,6 +200,11 @@ Visual Basic
|
||||
libcurl-vb by Jeffrey Phillips
|
||||
http://sourceforge.net/projects/libcurl-vb/
|
||||
|
||||
Visual Foxpro
|
||||
|
||||
by Carlos Alloatti
|
||||
http://www.ctl32.com.ar/libcurl.asp
|
||||
|
||||
Q
|
||||
The libcurl module is part of the default install
|
||||
http://q-lang.sourceforge.net/
|
||||
|
||||
60
docs/FAQ
60
docs/FAQ
@@ -1,4 +1,4 @@
|
||||
Updated: Feb 18, 2008 (http://curl.haxx.se/docs/faq.html)
|
||||
Updated: Jan 14, 2009 (http://curl.haxx.se/docs/faq.html)
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
@@ -70,6 +70,7 @@ FAQ
|
||||
4.13 Why is curl -R on Windows one hour off?
|
||||
4.14 Redirects work in browser but not with curl!
|
||||
4.15 FTPS doesn't work
|
||||
4.16 My HTTP POST or PUT requests are slow!
|
||||
|
||||
5. libcurl Issues
|
||||
5.1 Is libcurl thread-safe?
|
||||
@@ -85,6 +86,7 @@ FAQ
|
||||
5.11 How do I make libcurl not receive the whole HTTP response?
|
||||
5.12 Can I make libcurl fake or hide my real IP address?
|
||||
5.13 How do I stop an ongoing transfer?
|
||||
5.14 Using C++ non-static functions for callbacks?
|
||||
|
||||
6. License Issues
|
||||
6.1 I have a GPL program, can I use the libcurl library?
|
||||
@@ -117,10 +119,10 @@ FAQ
|
||||
libcurl
|
||||
|
||||
A free and easy-to-use client-side URL transfer library, supporting FTP,
|
||||
FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE and LDAP. libcurl
|
||||
supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, kerberos,
|
||||
HTTP form based upload, proxies, cookies, user+password authentication,
|
||||
file transfer resume, http proxy tunneling and more!
|
||||
FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE, LDAP and LDAPS.
|
||||
libcurl supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading,
|
||||
kerberos, HTTP form based upload, proxies, cookies, user+password
|
||||
authentication, file transfer resume, http proxy tunneling and more!
|
||||
|
||||
libcurl is highly portable, it builds and works identically on numerous
|
||||
platforms, including Solaris, NetBSD, FreeBSD, OpenBSD, Darwin, HPUX,
|
||||
@@ -135,8 +137,8 @@ FAQ
|
||||
A command line tool for getting or sending files using URL syntax.
|
||||
|
||||
Since curl uses libcurl, it supports a range of common Internet protocols,
|
||||
currently including HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, LDAP, DICT,
|
||||
TELNET and FILE.
|
||||
currently including HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, LDAP, LDAPS,
|
||||
DICT, TELNET and FILE.
|
||||
|
||||
We pronounce curl and cURL with an initial k sound: [kurl].
|
||||
|
||||
@@ -225,11 +227,11 @@ FAQ
|
||||
Project cURL is entirely free and open. No person gets paid for developing
|
||||
(lib)curl. We do this voluntarily on our spare time.
|
||||
|
||||
We get some help from companies. Contactor Data hosts the curl web site,
|
||||
Haxx owns the curl web site's domain and sourceforge.net hosts project
|
||||
services we take advantage from, like the bug tracker. Also, some companies
|
||||
have sponsored certain parts of the development in the past and I hope some
|
||||
will continue to do so in the future.
|
||||
We get some help from companies. CAG Contactor hosts the curl web site, Haxx
|
||||
owns the curl web site's domain and sourceforge.net hosts project services
|
||||
we take advantage from, like the bug tracker. Also, some companies have
|
||||
sponsored certain parts of the development in the past and I hope some will
|
||||
continue to do so in the future.
|
||||
|
||||
If you want to support our project, consider a donation or a banner-program
|
||||
or even better: by helping us coding, documenting, testing etc.
|
||||
@@ -297,7 +299,7 @@ FAQ
|
||||
as used by numerous applications that include libcurl binaries in their
|
||||
distribution packages (like Adobe Acrobat Reader and Google Earth).
|
||||
|
||||
More than 80 known named companies use curl in commercial environments and
|
||||
More than 90 known named companies use curl in commercial environments and
|
||||
products. More than 100 known named open source projects depend on
|
||||
(lib)curl.
|
||||
|
||||
@@ -867,6 +869,20 @@ FAQ
|
||||
mandated by RFC4217. This kind of connection then of course uses the
|
||||
standard FTP port 21 by default.
|
||||
|
||||
4.16 My HTTP POST or PUT requests are slow!
|
||||
|
||||
libcurl makes all POST and PUT requests (except for POST requests with a
|
||||
very tiny request body) use the "Expect: 100-continue" header. This header
|
||||
allows the server to deny the operation early so that libcurl can bail out
|
||||
already before having to send any data. This is useful in authentication
|
||||
cases and others.
|
||||
|
||||
However, many servers don't implement the Expect: stuff properly and if the
|
||||
server doesn't respond (positively) within 1 second libcurl will continue
|
||||
and send off the data anyway.
|
||||
|
||||
You can disable libcurl's use of the Expect: header the same way you disable
|
||||
any header, using -H / CURLOPT_HTTPHEADER, or by forcing it to use HTTP 1.0.
|
||||
|
||||
5. libcurl Issues
|
||||
|
||||
@@ -1070,6 +1086,24 @@ FAQ
|
||||
If you're using the multi interface, you also stop a transfer by removing
|
||||
the particular easy handle from the multi stack.
|
||||
|
||||
5.14 Using C++ non-static functions for callbacks?
|
||||
|
||||
libcurl is a C library, it doesn't know anything about C++ member functions.
|
||||
|
||||
You can overcome this "limitation" with a relative ease using a static
|
||||
member function that is passed a pointer to the class:
|
||||
|
||||
// f is the pointer to your object.
|
||||
static YourClass::staticFunction(void *buffer, size_t sz, size_t n, void *f)
|
||||
{
|
||||
// Call non-static member function.
|
||||
static_cast<YourClass*>(f)->nonStaticFunction();
|
||||
}
|
||||
|
||||
// This is how you pass pointer to the static function:
|
||||
curl_easy_setopt(hcurl, CURLOPT_WRITEFUNCTION, YourClass:staticFunction);
|
||||
curl_easy_setopt(hcurl, CURLOPT_WRITEDATA, this);
|
||||
|
||||
6. License Issues
|
||||
|
||||
Curl and libcurl are released under a MIT/X derivate license. The license is
|
||||
|
||||
45
docs/HISTORY
45
docs/HISTORY
@@ -77,7 +77,7 @@ different bindings exist at the time of this writing.
|
||||
September 2000, kerberos4 support was added.
|
||||
|
||||
In November 2000 started the work on a test suite for curl. It was later
|
||||
re-written from scratch again.
|
||||
re-written from scratch again. The libcurl major SONAME number was set to 1.
|
||||
|
||||
January 2001, Daniel released curl 7.5.2 under a new license again: MIT (or
|
||||
MPL). The MIT license is extremely liberal and can be used combined with GPL
|
||||
@@ -88,7 +88,7 @@ deemed "GPL incompatible".)
|
||||
|
||||
curl supports HTTP 1.1 starting with the release of 7.7, March 22 2001. This
|
||||
also introduced libcurl's ability to do persistent connections. 24000 lines of
|
||||
code.
|
||||
code. The libcurl major SONAME number was bumped to 2 due to this overhaul.
|
||||
|
||||
The first experimental ftps:// support was added in March 2001.
|
||||
|
||||
@@ -129,7 +129,12 @@ December 2003, full-fledged SSL for FTP is supported.
|
||||
|
||||
January 2004: curl 7.11.0 introduced large file support.
|
||||
|
||||
June 2004: curl 7.12.0 introduced IDN support. 10 official web mirrors.
|
||||
June 2004:
|
||||
|
||||
curl 7.12.0 introduced IDN support. 10 official web mirrors.
|
||||
|
||||
This release bumped the major SONAME to 3 due to the removal of the
|
||||
curl_formparse() function
|
||||
|
||||
August 2004:
|
||||
Curl and libcurl 7.12.1
|
||||
@@ -144,10 +149,38 @@ August 2004:
|
||||
|
||||
April 2005:
|
||||
|
||||
GnuTLS can now optionally be used for the secure layer when curl is built.
|
||||
GnuTLS can now optionally be used for the secure layer when curl is built.
|
||||
|
||||
September 2005:
|
||||
|
||||
TFTP support was added.
|
||||
TFTP support was added.
|
||||
|
||||
More than 100,000 unique visitors of the curl web site. 25 mirrors.
|
||||
|
||||
April 2006:
|
||||
|
||||
Added the multi_socket() API
|
||||
|
||||
September 2006:
|
||||
|
||||
The major SONAME number for libcurl was bumped to 4 due to the removal of
|
||||
ftp third party transfer support.
|
||||
|
||||
November 2006:
|
||||
|
||||
Added SCP and SFTP support
|
||||
|
||||
February 2007:
|
||||
|
||||
Added support for the Mozilla NSS library to do the SSL/TLS stuff
|
||||
|
||||
November 2008:
|
||||
|
||||
Command line options: 128
|
||||
curl_easy_setopt() options: 158
|
||||
Public functions in libcurl: 58
|
||||
Known libcurl bindings: 37
|
||||
Contributors: 683
|
||||
|
||||
145,000 unique visitors. >100 GB downloaded.
|
||||
|
||||
More than 100,000 unique visitors of the curl web site. 25 mirrors.
|
||||
|
||||
46
docs/INSTALL
46
docs/INSTALL
@@ -673,8 +673,9 @@ Minix
|
||||
Configure and compile with:
|
||||
|
||||
./configure CONFIG_SHELL=/bin/bigsh CC=cc LD=cc AR=/usr/bin/aal \
|
||||
GREP=grep CPPFLAGS=-D_POSIX_SOURCE=1
|
||||
GREP=grep CPPFLAGS='-D_POSIX_SOURCE=1 -I/usr/local/include'
|
||||
make
|
||||
chmem =256000 src/curl
|
||||
|
||||
GCC
|
||||
---
|
||||
@@ -686,6 +687,7 @@ Minix
|
||||
|
||||
./configure CONFIG_SHELL=/bin/bigsh CC=gcc AR=/usr/gnu/bin/gar GREP=grep
|
||||
make
|
||||
chmem =256000 src/curl
|
||||
|
||||
|
||||
Symbian OS
|
||||
@@ -770,31 +772,49 @@ REDUCING SIZE
|
||||
will not use, here are some other flags that can reduce the size of the
|
||||
library:
|
||||
|
||||
--disable-ares (disables support for the ARES DNS library)
|
||||
--disable-ares (disables support for the C-ARES DNS library)
|
||||
--disable-cookies (disables support for HTTP cookies)
|
||||
--disable-crypto-auth (disables HTTP cryptographic authentication)
|
||||
--disable-ipv6 (disables support for IPv6)
|
||||
--disable-manual (disables support for the built-in documentation)
|
||||
--disable-proxy (disables support for HTTP and SOCKS proxies)
|
||||
--disable-verbose (eliminates debugging strings and error code strings)
|
||||
--enable-hidden-symbols (eliminates unneeded symbols in the shared library)
|
||||
--without-libidn (disables support for the libidn DNS library)
|
||||
--without-ssl (disables support for SSL/TLS)
|
||||
--without-zlib (disables support for on-the-fly decompression)
|
||||
|
||||
The GNU linker has a number of options to reduce the size of the libcurl
|
||||
dynamic libraries on some platforms even further. Specify them by giving
|
||||
the options -Wl,-Bsymbolic and -Wl,-s on the gcc command-line.
|
||||
The GNU compiler and linker have a number of options that can reduce the
|
||||
size of the libcurl dynamic libraries on some platforms even further.
|
||||
Specify them by providing appropriate CFLAGS and LDFLAGS variables on the
|
||||
configure command-line:
|
||||
CFLAGS="-ffunction-sections -fdata-sections" \
|
||||
LDFLAGS="-Wl,-s -Wl,-Bsymbolic -Wl,--gc-sections"
|
||||
|
||||
Be sure also to strip debugging symbols from your binaries after
|
||||
compiling using 'strip' (or the appropriate variant if cross-compiling).
|
||||
If space is really tight, you may be able to remove some unneeded
|
||||
sections of the shared library using the -R option to objcopy (e.g. the
|
||||
.comment section).
|
||||
|
||||
Using these techniques it is possible to create an HTTP-only shared libcurl
|
||||
library for i386 Linux platforms that is only 96 KiB in size (as of libcurl
|
||||
version 7.17.1, using gcc 4.2.2).
|
||||
Using these techniques it is possible to create a basic HTTP-only shared
|
||||
libcurl library for i386 Linux platforms that is only 94 KiB in size, and
|
||||
an FTP-only library that is 87 KiB in size (as of libcurl version 7.19.1,
|
||||
using gcc 4.2.2).
|
||||
|
||||
You may find that statically linking libcurl to your application will
|
||||
result in a lower total size.
|
||||
result in a lower total size than dynamically linking.
|
||||
|
||||
Note that the curl test harness can detect the use of some, but not all, of
|
||||
the --disable statements suggested above. Use will cause tests relying on
|
||||
those features to fail. The test harness can be manually forced to skip
|
||||
the relevant tests by specifying certain key words on the runtests.pl
|
||||
command line. Following is a list of appropriate key words:
|
||||
|
||||
--disable-cookies !cookies
|
||||
--disable-crypto-auth !HTTP\ Digest\ auth !HTTP\ proxy\ Digest\ auth
|
||||
--disable-manual !--manual
|
||||
--disable-proxy !HTTP\ proxy !proxytunnel !SOCKS4 !SOCKS5
|
||||
|
||||
|
||||
PORTS
|
||||
@@ -811,9 +831,15 @@ PORTS
|
||||
- Alpha OpenBSD 3.0
|
||||
- Alpha OpenVMS V7.1-1H2
|
||||
- Alpha Tru64 v5.0 5.1
|
||||
- AVR32 Linux
|
||||
- ARM INTEGRITY
|
||||
- ARM iPhone OS
|
||||
- Cell Linux
|
||||
- Cell Cell OS
|
||||
- HP-PA HP-UX 9.X 10.X 11.X
|
||||
- HP-PA Linux
|
||||
- HP3000 MPE/iX
|
||||
- MicroBlaze uClinux
|
||||
- MIPS IRIX 6.2, 6.5
|
||||
- MIPS Linux
|
||||
- OS/400
|
||||
@@ -833,7 +859,6 @@ PORTS
|
||||
- StrongARM (and other ARM) RISC OS 3.1, 4.02
|
||||
- StrongARM/ARM7/ARM9 Linux 2.4, 2.6
|
||||
- StrongARM NetBSD 1.4.1
|
||||
- ARM INTEGRITY
|
||||
- Symbian OS (P.I.P.S.) 9.x
|
||||
- TPF
|
||||
- Ultrix 4.3a
|
||||
@@ -863,6 +888,7 @@ PORTS
|
||||
- m68k OpenBSD
|
||||
- m88k dg-dgux5.4R3.00
|
||||
- s390 Linux
|
||||
- x86_64 Linux
|
||||
- XScale/PXA250 Linux 2.4
|
||||
- Nios II uClinux
|
||||
|
||||
|
||||
@@ -3,7 +3,24 @@ join in and help us correct one or more of these! Also be sure to check the
|
||||
changelog of the current development status, as one or more of these problems
|
||||
may have been fixed since this was written!
|
||||
|
||||
58. It seems sensible to be able to use CURLOPT_NOBODY and
|
||||
62. CURLOPT_TIMEOUT does not work properly with the regular multi and
|
||||
multi_socket interfaces. The work-around for apps is to simply remove the
|
||||
easy handle once the time is up. See also:
|
||||
http://curl.haxx.se/bug/view.cgi?id=2501457
|
||||
|
||||
61. If an upload using Expect: 100-continue receives an HTTP 417 response,
|
||||
it ought to be automatically resent without the Expect:. A workaround is
|
||||
for the client application to redo the transfer after disabling Expect:.
|
||||
http://curl.haxx.se/mail/archive-2008-02/0043.html
|
||||
|
||||
60. libcurl closes the connection if an HTTP 401 reply is received while it
|
||||
is waiting for the the 100-continue response.
|
||||
http://curl.haxx.se/mail/lib-2008-08/0462.html
|
||||
|
||||
59. If the CURLOPT_PORT option is used on an FTP URL like
|
||||
"ftp://example.com/file;type=A" the ";type=A" is stripped off.
|
||||
|
||||
58. It seems sensible to be able to use CURLOPT_NOBODY and
|
||||
CURLOPT_FAILONERROR with FTP to detect if a file exists or not, but it is
|
||||
not working: http://curl.haxx.se/mail/lib-2008-07/0295.html
|
||||
|
||||
@@ -160,11 +177,6 @@ may have been fixed since this was written!
|
||||
doesn't do a HEAD first to get the initial size. This needs to be done
|
||||
manually for HTTP PUT resume to work, and then '-C [index]'.
|
||||
|
||||
7. CURLOPT_USERPWD and CURLOPT_PROXYUSERPWD have no way of providing user names
|
||||
that contain a colon. This can't be fixed easily in a backwards compatible
|
||||
way without adding new options (and then, they should most probably allow
|
||||
setting user name and password separately).
|
||||
|
||||
6. libcurl ignores empty path parts in FTP URLs, whereas RFC1738 states that
|
||||
such parts should be sent to the server as 'CWD ' (without an argument).
|
||||
The only exception to this rule, is that we knowingly break this if the
|
||||
|
||||
29
docs/THANKS
29
docs/THANKS
@@ -35,6 +35,7 @@ Andreas Faerber
|
||||
Andreas Ntaflos
|
||||
Andreas Olsson
|
||||
Andreas Rieke
|
||||
Andreas Schuldei
|
||||
Andres Garcia
|
||||
Andrew Benham
|
||||
Andrew Biggs
|
||||
@@ -46,15 +47,18 @@ Andrew Wansink
|
||||
Andr<EFBFBD>s Garc<72>a
|
||||
Andy Cedilnik
|
||||
Andy Serpa
|
||||
Andy Tsouladze
|
||||
Angus Mackay
|
||||
Antoine Calando
|
||||
Anton Kalmykov
|
||||
Arkadiusz Miskiewicz
|
||||
Armel Asselin
|
||||
Arnaud Ebalard
|
||||
Arve Knudsen
|
||||
Ates Goral
|
||||
Augustus Saunders
|
||||
Avery Fay
|
||||
Axel Tillequin
|
||||
Bart Whiteley
|
||||
Ben Greear
|
||||
Ben Madsen
|
||||
@@ -100,6 +104,7 @@ Cody Jones
|
||||
Colin Hogben
|
||||
Colin Watson
|
||||
Colm Buckley
|
||||
Constantine Sapuntzakis
|
||||
Cory Nelson
|
||||
Craig Davison
|
||||
Craig Markwardt
|
||||
@@ -126,6 +131,7 @@ Dave Halbakken
|
||||
Dave Hamilton
|
||||
Dave May
|
||||
Dave Vasilevsky
|
||||
David Bau
|
||||
David Byron
|
||||
David Cohen
|
||||
David Eriksson
|
||||
@@ -145,6 +151,7 @@ David Tarendash
|
||||
David Thiel
|
||||
David Wright
|
||||
David Yan
|
||||
Dengminwen
|
||||
Detlef Schmier
|
||||
Diego Casorran
|
||||
Dima Barsky
|
||||
@@ -172,8 +179,10 @@ Dylan Ellicott
|
||||
Dylan Salisbury
|
||||
Early Ehlinger
|
||||
Edin Kadribasic
|
||||
Eduard Bloch
|
||||
Eetu Ojanen
|
||||
Ellis Pritchard
|
||||
Emanuele Bovisio
|
||||
Emil Romanus
|
||||
Emiliano Ida
|
||||
Enrico Scholz
|
||||
@@ -241,6 +250,7 @@ Hamish Mackenzie
|
||||
Hang Kin Lau
|
||||
Hanno Kranzhoff
|
||||
Hans Steegers
|
||||
Hans-Jurgen May
|
||||
Hardeep Singh
|
||||
Harshal Pradhan
|
||||
Heikki Korpela
|
||||
@@ -248,10 +258,12 @@ Henrik Storner
|
||||
Hzhijun
|
||||
Ian Ford
|
||||
Ian Gulliver
|
||||
Ian Lynagh
|
||||
Ian Turner
|
||||
Ian Wilkes
|
||||
Ignacio Vazquez-Abrams
|
||||
Igor Franchuk
|
||||
Igor Novoseltsev
|
||||
Igor Polyakov
|
||||
Ilguiz Latypov
|
||||
Ilja van Sprundel
|
||||
@@ -306,7 +318,9 @@ John Crow
|
||||
John Janssen
|
||||
John Kelly
|
||||
John Lask
|
||||
John Lightsey
|
||||
John McGowan
|
||||
John Wilkinson
|
||||
Johnny Luong
|
||||
Jon Grubbs
|
||||
Jon Travis
|
||||
@@ -338,6 +352,7 @@ Katie Wang
|
||||
Kees Cook
|
||||
Keith MacDonald
|
||||
Keith McGuigan
|
||||
Keith Mok
|
||||
Ken Hirsch
|
||||
Ken Rastatter
|
||||
Kent Boortz
|
||||
@@ -366,6 +381,7 @@ Lau Hang Kin
|
||||
Legoff Vincent
|
||||
Lehel Bernadt
|
||||
Len Krause
|
||||
Lenny Rachitsky
|
||||
Liam Healy
|
||||
Linas Vepstas
|
||||
Ling Thio
|
||||
@@ -396,6 +412,7 @@ Markus Moeller
|
||||
Markus Oberhumer
|
||||
Martijn Koster
|
||||
Martin C. Martin
|
||||
Martin Drasar
|
||||
Martin Hedenfalk
|
||||
Martin Skinner
|
||||
Marty Kuhrt
|
||||
@@ -411,12 +428,14 @@ Matthew Blain
|
||||
Matthew Clarke
|
||||
Maurice Barnum
|
||||
Max Katsev
|
||||
Maxim Ivanov
|
||||
Maxim Perenesenko
|
||||
Mekonikum
|
||||
Mettgut Jamalla
|
||||
Michael Benedict
|
||||
Michael Calmer
|
||||
Michael Curtis
|
||||
Michael Goffioul
|
||||
Michael Jahn
|
||||
Michael Jerris
|
||||
Michael Mealling
|
||||
@@ -430,6 +449,7 @@ Mike Bytnar
|
||||
Mike Dobbs
|
||||
Mike Hommey
|
||||
Mike Protts
|
||||
Mike Revi
|
||||
Miklos Nemeth
|
||||
Mitz Wark
|
||||
Mohamed Lrhazi
|
||||
@@ -464,6 +484,7 @@ Olaf Stueben
|
||||
Olaf St<53>ben
|
||||
Oren Tirosh
|
||||
P R Schaffner
|
||||
Pascal Terjan
|
||||
Patrick Bihan-Faou
|
||||
Patrick Monnerat
|
||||
Patrick Smith
|
||||
@@ -480,6 +501,7 @@ Pete Su
|
||||
Peter Bray
|
||||
Peter Forret
|
||||
Peter Heuchert
|
||||
Peter Lamberg
|
||||
Peter O'Gorman
|
||||
Peter Pentchev
|
||||
Peter Silva
|
||||
@@ -489,7 +511,9 @@ Peter Todd
|
||||
Peter Verhas
|
||||
Peter Wullinger
|
||||
Peteris Krumins
|
||||
Phil Blundell
|
||||
Phil Karn
|
||||
Phil Pellouchoud
|
||||
Philip Gladstone
|
||||
Philip Langdale
|
||||
Philippe Hameau
|
||||
@@ -497,6 +521,7 @@ Philippe Raoult
|
||||
Philippe Vaucher
|
||||
Pierre
|
||||
Pooyan McSporran
|
||||
Pramod Sharma
|
||||
Puneet Pawaia
|
||||
Quagmire
|
||||
Rafa Muyo
|
||||
@@ -541,6 +566,7 @@ Rodney Simmons
|
||||
Roland Blom
|
||||
Roland Krikava
|
||||
Roland Zimmermann
|
||||
Rolland Dudemaine
|
||||
Roman Koifman
|
||||
Ron Zapp
|
||||
Rosimildo da Silva
|
||||
@@ -590,6 +616,7 @@ Steve Lhomme
|
||||
Steve Little
|
||||
Steve Marx
|
||||
Steve Oliphant
|
||||
Steve Roskowski
|
||||
Steven Bazyl
|
||||
Steven G. Johnson
|
||||
Stoned Elipot
|
||||
@@ -636,6 +663,7 @@ Victor Snezhko
|
||||
Vikram Saxena
|
||||
Vilmos Nebehaj
|
||||
Vincent Bronner
|
||||
Vincent Le Normand
|
||||
Vincent Penquerc'h
|
||||
Vincent Sanders
|
||||
Vladimir Lazarenko
|
||||
@@ -651,6 +679,7 @@ Wojciech Zwiefka
|
||||
Xavier Bouchoux
|
||||
Yang Tse
|
||||
Yarram Sunil
|
||||
Yehoshua Hershberg
|
||||
Yuriy Sosov
|
||||
Yves Lejeune
|
||||
Zmey Petroff
|
||||
|
||||
122
docs/TODO
122
docs/TODO
@@ -15,15 +15,13 @@
|
||||
1.1 Zero-copy interface
|
||||
1.2 More data sharing
|
||||
1.3 struct lifreq
|
||||
1.4 Get IP address
|
||||
1.5 c-ares ipv6
|
||||
1.6 configure-based info in public headers
|
||||
1.4 signal-based resolver timeouts
|
||||
|
||||
2. libcurl - multi interface
|
||||
2.1 More non-blocking
|
||||
2.2 Pause transfers
|
||||
2.3 Remove easy interface internally
|
||||
2.4 Avoid having to remove/readd handles
|
||||
2.2 Remove easy interface internally
|
||||
2.3 Avoid having to remove/readd handles
|
||||
2.4 Fix HTTP Pipelining for PUT
|
||||
|
||||
3. Documentation
|
||||
3.1 More and better
|
||||
@@ -38,9 +36,8 @@
|
||||
4.7 ASCII support
|
||||
|
||||
5. HTTP
|
||||
5.1 Other HTTP versions with CONNECT
|
||||
5.2 Better persistency for HTTP 1.0
|
||||
5.3 support FF3 sqlite cookie files
|
||||
5.1 Better persistency for HTTP 1.0
|
||||
5.2 support FF3 sqlite cookie files
|
||||
|
||||
6. TELNET
|
||||
6.1 ditch stdin
|
||||
@@ -50,15 +47,14 @@
|
||||
|
||||
7. SSL
|
||||
7.1 Disable specific versions
|
||||
7.2 Provide mytex locking API
|
||||
7.3 dumpcert
|
||||
7.4 Evaluate SSL patches
|
||||
7.5 Cache OpenSSL contexts
|
||||
7.6 Export session ids
|
||||
7.7 Provide callback for cert verification
|
||||
7.8 Support other SSL libraries
|
||||
7.9 Support SRP on the TLS layer
|
||||
7.10 improve configure --with-ssl
|
||||
7.2 Provide mutex locking API
|
||||
7.3 Evaluate SSL patches
|
||||
7.4 Cache OpenSSL contexts
|
||||
7.5 Export session ids
|
||||
7.6 Provide callback for cert verification
|
||||
7.7 Support other SSL libraries
|
||||
7.8 Support SRP on the TLS layer
|
||||
7.9 improve configure --with-ssl
|
||||
|
||||
8. GnuTLS
|
||||
8.1 Make NTLM work without OpenSSL functions
|
||||
@@ -131,54 +127,26 @@
|
||||
SIOCGIFADDR on newer Solaris versions as they claim the latter is obsolete.
|
||||
To support ipv6 interface addresses for network interfaces properly.
|
||||
|
||||
1.4 Get IP address
|
||||
1.4 signal-based resolver timeouts
|
||||
|
||||
Add the following to curl_easy_getinfo(): GET_HTTP_IP, GET_FTP_IP and
|
||||
GET_FTP_DATA_IP. Return a string with the used IP.
|
||||
libcurl built without an asynchronous resolver library uses alarm() to time
|
||||
out DNS lookups. When a timeout occurs, this causes libcurl to jump from the
|
||||
signal handler back into the library with a sigsetjmp, which effectively
|
||||
causes libcurl to continue running within the signal handler. This is
|
||||
non-portable and could cause problems on some platforms. A discussion on the
|
||||
problem is available at http://curl.haxx.se/mail/lib-2008-09/0197.html
|
||||
|
||||
1.5 c-ares ipv6
|
||||
|
||||
Make libcurl built with c-ares use c-ares' IPv6 abilities. They weren't
|
||||
present when we first added c-ares support but they have been added since!
|
||||
When this is done and works, we can actually start considering making c-ares
|
||||
powered libcurl the default build (which of course would require that we'd
|
||||
bundle the c-ares source code in the libcurl source code releases).
|
||||
|
||||
1.6 configure-based info in public headers
|
||||
|
||||
Make the public headers include the proper system includes based on what was
|
||||
present at the time when configure was run. Currently, the sys/select.h
|
||||
header is for example included by curl/multi.h only on specific platforms we
|
||||
know MUST have it. This is error-prone. We therefore want the header files to
|
||||
adapt to configure results. Those results must be stored in a new header and
|
||||
they must use a curl name space, i.e not be HAVE_* prefix (as that would risk
|
||||
collide with other apps that use libcurl and that runs configure).
|
||||
|
||||
Work on this has been started but hasn't been finished, and the initial patch
|
||||
and some details are found here:
|
||||
http://curl.haxx.se/mail/lib-2006-12/0084.html
|
||||
|
||||
The remaining problems to solve involve the platforms that can't run
|
||||
configure.
|
||||
Also, alarm() provides timeout resolution only to the nearest second. alarm
|
||||
ought to be replaced by setitimer on systems that support it.
|
||||
|
||||
2. libcurl - multi interface
|
||||
|
||||
2.1 More non-blocking
|
||||
|
||||
Make sure we don't ever loop because of non-blocking sockets return
|
||||
Make sure we don't ever loop because of non-blocking sockets returning
|
||||
EWOULDBLOCK or similar. The GnuTLS connection etc.
|
||||
|
||||
2.2 Pause transfers
|
||||
|
||||
Make transfers treated more carefully. We need a way to tell libcurl we have
|
||||
data to write, as the current system expects us to upload data each time the
|
||||
socket is writable and there is no way to say that we want to upload data
|
||||
soon just not right now, without that aborting the upload. The opposite
|
||||
situation should be possible as well, that we tell libcurl we're ready to
|
||||
accept read data. Today libcurl feeds the data as soon as it is available for
|
||||
reading, no matter what.
|
||||
|
||||
2.3 Remove easy interface internally
|
||||
2.2 Remove easy interface internally
|
||||
|
||||
Make curl_easy_perform() a wrapper-function that simply creates a multi
|
||||
handle, adds the easy handle to it, runs curl_multi_perform() until the
|
||||
@@ -187,7 +155,7 @@
|
||||
internally use and assume the multi interface. The select()-loop should use
|
||||
curl_multi_socket().
|
||||
|
||||
2.4 Avoid having to remove/readd handles
|
||||
2.3 Avoid having to remove/readd handles
|
||||
|
||||
curl_multi_handle_control() - this can control the easy handle (while) added
|
||||
to a multi handle in various ways:
|
||||
@@ -204,6 +172,13 @@
|
||||
|
||||
o RESUME?
|
||||
|
||||
2.4 Fix HTTP Pipelining for PUT
|
||||
|
||||
HTTP Pipelining can be a way to greatly enhance performance for multiple
|
||||
serial requests and currently libcurl only supports that for HEAD and GET
|
||||
requests but it should also be possible for PUT.
|
||||
|
||||
|
||||
3. Documentation
|
||||
|
||||
3.1 More and better
|
||||
@@ -256,18 +231,12 @@
|
||||
|
||||
5. HTTP
|
||||
|
||||
5.1 Other HTTP versions with CONNECT
|
||||
|
||||
When doing CONNECT to a HTTP proxy, libcurl always uses HTTP/1.0. This has
|
||||
never been reported as causing trouble to anyone, but should be considered to
|
||||
use the HTTP version the user has chosen.
|
||||
|
||||
5.2 Better persistency for HTTP 1.0
|
||||
5.1 Better persistency for HTTP 1.0
|
||||
|
||||
"Better" support for persistent connections over HTTP 1.0
|
||||
http://curl.haxx.se/bug/feature.cgi?id=1089001
|
||||
|
||||
5.3 support FF3 sqlite cookie files
|
||||
5.2 support FF3 sqlite cookie files
|
||||
|
||||
Firefox 3 is changing from its former format to a a sqlite database instead.
|
||||
We should consider how (lib)curl can/should support this.
|
||||
@@ -304,23 +273,18 @@ to provide the data to send.
|
||||
Provide an option that allows for disabling specific SSL versions, such as
|
||||
SSLv2 http://curl.haxx.se/bug/feature.cgi?id=1767276
|
||||
|
||||
7.2 Provide mytex locking API
|
||||
7.2 Provide mutex locking API
|
||||
|
||||
Provide a libcurl API for setting mutex callbacks in the underlying SSL
|
||||
library, so that the same application code can use mutex-locking
|
||||
independently of OpenSSL or GnutTLS being used.
|
||||
|
||||
7.3 dumpcert
|
||||
|
||||
Anton Fedorov's "dumpcert" patch:
|
||||
http://curl.haxx.se/mail/lib-2004-03/0088.html
|
||||
|
||||
7.4 Evaluate SSL patches
|
||||
7.3 Evaluate SSL patches
|
||||
|
||||
Evaluate/apply Gertjan van Wingerde's SSL patches:
|
||||
http://curl.haxx.se/mail/lib-2004-03/0087.html
|
||||
|
||||
7.5 Cache OpenSSL contexts
|
||||
7.4 Cache OpenSSL contexts
|
||||
|
||||
"Look at SSL cafile - quick traces look to me like these are done on every
|
||||
request as well, when they should only be necessary once per ssl context (or
|
||||
@@ -330,7 +294,7 @@ to provide the data to send.
|
||||
style connections are re-used. It will make us use slightly more memory but
|
||||
it will libcurl do less creations and deletions of SSL contexts.
|
||||
|
||||
7.6 Export session ids
|
||||
7.5 Export session ids
|
||||
|
||||
Add an interface to libcurl that enables "session IDs" to get
|
||||
exported/imported. Cris Bailiff said: "OpenSSL has functions which can
|
||||
@@ -338,24 +302,24 @@ to provide the data to send.
|
||||
the state from such a buffer at a later date - this is used by mod_ssl for
|
||||
apache to implement and SSL session ID cache".
|
||||
|
||||
7.7 Provide callback for cert verification
|
||||
7.6 Provide callback for cert verification
|
||||
|
||||
OpenSSL supports a callback for customised verification of the peer
|
||||
certificate, but this doesn't seem to be exposed in the libcurl APIs. Could
|
||||
it be? There's so much that could be done if it were!
|
||||
|
||||
7.8 Support other SSL libraries
|
||||
7.7 Support other SSL libraries
|
||||
|
||||
Make curl's SSL layer capable of using other free SSL libraries. Such as
|
||||
MatrixSSL (http://www.matrixssl.org/).
|
||||
|
||||
7.9 Support SRP on the TLS layer
|
||||
7.8 Support SRP on the TLS layer
|
||||
|
||||
Peter Sylvester's patch for SRP on the TLS layer. Awaits OpenSSL support for
|
||||
this, no need to support this in libcurl before there's an OpenSSL release
|
||||
that does it.
|
||||
|
||||
7.10 improve configure --with-ssl
|
||||
7.9 improve configure --with-ssl
|
||||
|
||||
make the configure --with-ssl option first check for OpenSSL, then GnuTLS,
|
||||
then NSS...
|
||||
|
||||
@@ -28,7 +28,7 @@ curl-config \- Get information about a libcurl installation
|
||||
.B curl-config [options]
|
||||
.SH DESCRIPTION
|
||||
.B curl-config
|
||||
displays information about a previous curl and libcurl installation.
|
||||
displays information about the curl and libcurl installation.
|
||||
.SH OPTIONS
|
||||
.IP "--ca"
|
||||
Displays the built-in path to the CA cert bundle this libcurl uses.
|
||||
@@ -36,7 +36,7 @@ Displays the built-in path to the CA cert bundle this libcurl uses.
|
||||
Displays the compiler used to build libcurl.
|
||||
.IP "--cflags"
|
||||
Set of compiler options (CFLAGS) to use when compiling files that use
|
||||
libcurl. Currently that is only thw include path to the curl include files.
|
||||
libcurl. Currently that is only the include path to the curl include files.
|
||||
.IP "--checkfor [version]"
|
||||
Specify the oldest possible libcurl version string you want, and this
|
||||
script will return 0 if the current installation is new enough or it
|
||||
@@ -46,7 +46,7 @@ enough. (Added in 7.15.4)
|
||||
Lists what particular main features the installed libcurl was built with. At
|
||||
the time of writing, this list may include SSL, KRB4 or IPv6. Do not assume
|
||||
any particular order. The keywords will be separated by newlines. There may be
|
||||
none, one or several keywords in the list.
|
||||
none, one, or several keywords in the list.
|
||||
.IP "--help"
|
||||
Displays the available options.
|
||||
.IP "--libs"
|
||||
@@ -61,7 +61,7 @@ Lists what particular protocols the installed libcurl was built to support. At
|
||||
the time of writing, this list may include HTTP, HTTPS, FTP, FTPS, FILE,
|
||||
TELNET, LDAP, DICT. Do not assume any particular order. The protocols will
|
||||
be listed using uppercase and are separated by newlines. There may be none,
|
||||
one or several protocols in the list. (Added in 7.13.0)
|
||||
one, or several protocols in the list. (Added in 7.13.0)
|
||||
.IP "--static-libs"
|
||||
Shows the complete set of libs and other linker options you will need in order
|
||||
to link your application with libcurl statically. (Added in 7.17.1)
|
||||
|
||||
336
docs/curl.1
336
docs/curl.1
@@ -34,7 +34,7 @@ protocols (HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT, TELNET, LDAP or
|
||||
FILE). The command is designed to work without user interaction.
|
||||
|
||||
curl offers a busload of useful tricks like proxy support, user
|
||||
authentication, ftp upload, HTTP post, SSL connections, cookies, file transfer
|
||||
authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer
|
||||
resume and more. As you will see below, the number of features will make your
|
||||
head spin!
|
||||
|
||||
@@ -42,7 +42,7 @@ curl is powered by libcurl for all transfer-related features. See
|
||||
.BR libcurl (3)
|
||||
for details.
|
||||
.SH URL
|
||||
The URL syntax is protocol dependent. You'll find a detailed description in
|
||||
The URL syntax is protocol-dependent. You'll find a detailed description in
|
||||
RFC 3986.
|
||||
|
||||
You can specify multiple URLs or parts of URLs by writing part sets within
|
||||
@@ -64,7 +64,7 @@ several ones next to each other:
|
||||
You can specify any amount of URLs on the command line. They will be fetched
|
||||
in a sequential manner in the specified order.
|
||||
|
||||
Since curl 7.15.1 you can also specify step counter for the ranges, so that
|
||||
Since curl 7.15.1 you can also specify a step counter for the ranges, so that
|
||||
you can get every Nth number or letter:
|
||||
|
||||
http://www.numericals.com/file[1-100:10].txt
|
||||
@@ -81,10 +81,10 @@ handshakes. This improves speed. Of course this is only done on files
|
||||
specified on a single command line and cannot be used between separate curl
|
||||
invokes.
|
||||
.SH "PROGRESS METER"
|
||||
curl normally displays a progress meter during operations, indicating amount
|
||||
of transferred data, transfer speeds and estimated time left etc.
|
||||
curl normally displays a progress meter during operations, indicating the amount
|
||||
of transferred data, transfer speeds and estimated time left, etc.
|
||||
|
||||
However, since curl displays data to the terminal by default, if you invoke
|
||||
However, since curl displays this data to the terminal by default, if you invoke
|
||||
curl to do an operation and it is about to write data to the terminal, it
|
||||
\fIdisables\fP the progress meter as otherwise it would mess up the output
|
||||
mixing progress meter and response data.
|
||||
@@ -93,7 +93,7 @@ If you want a progress meter for HTTP POST or PUT requests, you need to
|
||||
redirect the response output to a file, using shell redirect (>), -o [file] or
|
||||
similar.
|
||||
|
||||
It is not the same case for FTP upload as that operation is not spitting out
|
||||
It is not the same case for FTP upload as that operation does not spit out
|
||||
any response data to the terminal.
|
||||
|
||||
If you prefer a progress "bar" instead of the regular meter, \fI-#\fP is your
|
||||
@@ -119,7 +119,7 @@ If this option is set more than once, the last one will be the one that's
|
||||
used.
|
||||
.IP "--anyauth"
|
||||
(HTTP) Tells curl to figure out authentication method by itself, and use the
|
||||
most secure one the remote site claims it supports. This is done by first
|
||||
most secure one the remote site claims to support. This is done by first
|
||||
doing a request and checking the response-headers, thus possibly inducing an
|
||||
extra network round-trip. This is used instead of setting a specific
|
||||
authentication method, which you can do with \fI--basic\fP, \fI--digest\fP,
|
||||
@@ -135,7 +135,7 @@ Pass the data to the HTTP server as a cookie. It is supposedly the
|
||||
data previously received from the server in a "Set-Cookie:" line.
|
||||
The data should be in the format "NAME1=VALUE1; NAME2=VALUE2".
|
||||
|
||||
If no '=' letter is used in the line, it is treated as a filename to use to
|
||||
If no '=' symbol is used in the line, it is treated as a filename to use to
|
||||
read previously stored cookie lines from, which should be used in this session
|
||||
if they match. Using this method also activates the "cookie parser" which will
|
||||
make curl record incoming cookies too, which may be handy if you're using this
|
||||
@@ -158,10 +158,10 @@ sent to stdout to be in text mode for win32 systems.
|
||||
(HTTP) Tells curl to use HTTP Basic authentication. This is the default and
|
||||
this option is usually pointless, unless you use it to override a previously
|
||||
set option that sets a different authentication method (such as \fI--ntlm\fP,
|
||||
\fI--digest\fP and \fI--negotiate\fP).
|
||||
\fI--digest\fP, or \fI--negotiate\fP).
|
||||
.IP "--ciphers <list of ciphers>"
|
||||
(SSL) Specifies which ciphers to use in the connection. The list of ciphers
|
||||
must be using valid ciphers. Read up on SSL cipher list details on this URL:
|
||||
must specify valid ciphers. Read up on SSL cipher list details on this URL:
|
||||
\fIhttp://www.openssl.org/docs/apps/ciphers.html\fP
|
||||
|
||||
NSS ciphers are done differently than OpenSSL and GnuTLS. The full list of
|
||||
@@ -197,9 +197,9 @@ If this option is used several times, the last specified file name will be
|
||||
used.
|
||||
.IP "-C/--continue-at <offset>"
|
||||
Continue/Resume a previous file transfer at the given offset. The given offset
|
||||
is the exact number of bytes that will be skipped counted from the beginning
|
||||
is the exact number of bytes that will be skipped, counting from the beginning
|
||||
of the source file before it is transferred to the destination. If used with
|
||||
uploads, the ftp server command SIZE will not be used by curl.
|
||||
uploads, the FTP server command SIZE will not be used by curl.
|
||||
|
||||
Use "-C -" to tell curl to automatically find out where/how to resume the
|
||||
transfer. It then uses the given output/input files to figure that out.
|
||||
@@ -223,17 +223,17 @@ using the content-type application/x-www-form-urlencoded. Compare to
|
||||
\fI-F/--form\fP.
|
||||
|
||||
\fI-d/--data\fP is the same as \fI--data-ascii\fP. To post data purely binary,
|
||||
you should instead use the \fI--data-binary\fP option. To URL encode the value
|
||||
you should instead use the \fI--data-binary\fP option. To URL-encode the value
|
||||
of a form field you may use \fI--data-urlencode\fP.
|
||||
|
||||
If any of these options is used more than once on the same command line, the
|
||||
data pieces specified will be merged together with a separating
|
||||
&-letter. Thus, using '-d name=daniel -d skill=lousy' would generate a post
|
||||
&-symbol. Thus, using '-d name=daniel -d skill=lousy' would generate a post
|
||||
chunk that looks like \&'name=daniel&skill=lousy'.
|
||||
|
||||
If you start the data with the letter @, the rest should be a file name to
|
||||
read the data from, or - if you want curl to read the data from stdin. The
|
||||
contents of the file must already be url-encoded. Multiple files can also be
|
||||
contents of the file must already be URL-encoded. Multiple files can also be
|
||||
specified. Posting data from a file named 'foobar' would thus be done with
|
||||
\fI--data @foobar\fP.
|
||||
.IP "--data-binary <data>"
|
||||
@@ -245,33 +245,33 @@ is posted in a similar manner as \fI--data-ascii\fP does, except that newlines
|
||||
are preserved and conversions are never done.
|
||||
|
||||
If this option is used several times, the ones following the first will append
|
||||
data. As described in \fI-d/--data\fP.
|
||||
data as described in \fI-d/--data\fP.
|
||||
.IP "--data-urlencode <data>"
|
||||
(HTTP) This posts data, similar to the other --data options with the exception
|
||||
that this performs URL encoding. (Added in 7.18.0)
|
||||
that this performs URL-encoding. (Added in 7.18.0)
|
||||
|
||||
To be CGI compliant, the <data> part should begin with a \fIname\fP followed
|
||||
To be CGI-compliant, the <data> part should begin with a \fIname\fP followed
|
||||
by a separator and a content specification. The <data> part can be passed to
|
||||
curl using one of the following syntaxes:
|
||||
.RS
|
||||
.IP "content"
|
||||
This will make curl URL encode the content and pass that on. Just be careful
|
||||
so that the content doesn't contain any = or @ letters, as that will then make
|
||||
This will make curl URL-encode the content and pass that on. Just be careful
|
||||
so that the content doesn't contain any = or @ symbols, as that will then make
|
||||
the syntax match one of the other cases below!
|
||||
.IP "=content"
|
||||
This will make curl URL encode the content and pass that on. The preceding =
|
||||
letter is not included in the data.
|
||||
This will make curl URL-encode the content and pass that on. The preceding =
|
||||
symbol is not included in the data.
|
||||
.IP "name=content"
|
||||
This will make curl URL encode the content part and pass that on. Note that
|
||||
the name part is expected to be URL encoded already.
|
||||
This will make curl URL-encode the content part and pass that on. Note that
|
||||
the name part is expected to be URL-encoded already.
|
||||
.IP "@filename"
|
||||
This will make curl load data from the given file (including any newlines),
|
||||
URL encode that data and pass it on in the POST.
|
||||
URL-encode that data and pass it on in the POST.
|
||||
.IP "name@filename"
|
||||
This will make curl load data from the given file (including any newlines),
|
||||
URL encode that data and pass it on in the POST. The name part gets an equal
|
||||
URL-encode that data and pass it on in the POST. The name part gets an equal
|
||||
sign appended, resulting in \fIname=urlencoded-file-content\fP. Note that the
|
||||
name is expected to be URL encoded already.
|
||||
name is expected to be URL-encoded already.
|
||||
.RE
|
||||
.IP "--digest"
|
||||
(HTTP) Enables HTTP Digest authentication. This is a authentication that
|
||||
@@ -286,8 +286,8 @@ difference.
|
||||
(FTP) Tell curl to disable the use of the EPRT and LPRT commands when doing
|
||||
active FTP transfers. Curl will normally always first attempt to use EPRT,
|
||||
then LPRT before using PORT, but with this option, it will use PORT right
|
||||
away. EPRT and LPRT are extensions to the original FTP protocol, may not work
|
||||
on all servers but enable more functionality in a better way than the
|
||||
away. EPRT and LPRT are extensions to the original FTP protocol, and may not work
|
||||
on all servers, but they enable more functionality in a better way than the
|
||||
traditional PORT command.
|
||||
|
||||
Since curl 7.19.0, \fB--eprt\fP can be used to explicitly enable EPRT again
|
||||
@@ -304,10 +304,10 @@ Write the protocol headers to the specified file.
|
||||
|
||||
This option is handy to use when you want to store the headers that a HTTP
|
||||
site sends to you. Cookies from the headers could then be read in a second
|
||||
curl invoke by using the \fI-b/--cookie\fP option! The \fI-c/--cookie-jar\fP
|
||||
curl invocation by using the \fI-b/--cookie\fP option! The \fI-c/--cookie-jar\fP
|
||||
option is however a better way to store cookies.
|
||||
|
||||
When used on FTP, the ftp server response lines are considered being "headers"
|
||||
When used in FTP, the FTP server response lines are considered being "headers"
|
||||
and thus are saved there.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
@@ -326,7 +326,7 @@ engines. Note that not all (or none) of the engines may be available at
|
||||
run-time.
|
||||
.IP "--environment"
|
||||
(RISC OS ONLY) Sets a range of environment variables, using the names the -w
|
||||
option supports, to easier allow extraction of useful information after having
|
||||
option supports, to allow easier extraction of useful information after having
|
||||
run curl.
|
||||
.IP "--egd-file <file>"
|
||||
(SSL) Specify the path name to the Entropy Gathering Daemon socket. The socket
|
||||
@@ -358,7 +358,7 @@ file may contain multiple CA certificates. The certificate(s) must be in PEM
|
||||
format. Normally curl is built to use a default file for this, so this option
|
||||
is typically used to alter that default file.
|
||||
|
||||
curl recognizes the environment variable named 'CURL_CA_BUNDLE' if that is
|
||||
curl recognizes the environment variable named 'CURL_CA_BUNDLE' if it is
|
||||
set, and uses the given path as a path to a CA cert bundle. This option
|
||||
overrides that variable.
|
||||
|
||||
@@ -384,7 +384,7 @@ certificates.
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-f/--fail"
|
||||
(HTTP) Fail silently (no output at all) on server errors. This is mostly done
|
||||
like this to better enable scripts etc to better deal with failed attempts. In
|
||||
to better enable scripts etc to better deal with failed attempts. In
|
||||
normal cases when a HTTP server fails to deliver a document, it returns an
|
||||
HTML document stating so (which often also describes why and more). This flag
|
||||
will prevent curl from outputting that and return error 22.
|
||||
@@ -419,6 +419,7 @@ curl does one CWD with the full target directory and then operates on the file
|
||||
\&"normally" (like in the multicwd case). This is somewhat more standards
|
||||
compliant than 'nocwd' but without the full penalty of 'multicwd'.
|
||||
.RE
|
||||
(Added in 7.15.1)
|
||||
.IP "--ftp-pasv"
|
||||
(FTP) Use PASV when transferring. PASV is the internal default behavior, but
|
||||
using this option can be used to override a previous --ftp-port option. (Added
|
||||
@@ -445,7 +446,7 @@ connection if the server doesn't support SSL/TLS. See also
|
||||
\fI--ftp-ssl-control\fP and \fI--ftp-ssl-reqd\fP for different levels of
|
||||
encryption required. (Added in 7.11.0)
|
||||
.IP "--ftp-ssl-control"
|
||||
(FTP) Require SSL/TLS for the ftp login, clear for transfer. Allows secure
|
||||
(FTP) Require SSL/TLS for the FTP login, clear for transfer. Allows secure
|
||||
authentication, but non-encrypted data transfers for efficiency. Fails the
|
||||
transfer if the server doesn't support SSL/TLS. (Added in 7.16.0)
|
||||
.IP "--ftp-ssl-reqd"
|
||||
@@ -467,12 +468,12 @@ shutdown from the server. The active mode initiates the shutdown and
|
||||
waits for a reply from the server.
|
||||
(Added in 7.16.2)
|
||||
.IP "-F/--form <name=content>"
|
||||
(HTTP) This lets curl emulate a filled in form in which a user has pressed the
|
||||
(HTTP) This lets curl emulate a filled-in form in which a user has pressed the
|
||||
submit button. This causes curl to POST data using the Content-Type
|
||||
multipart/form-data according to RFC1867. This enables uploading of binary
|
||||
files etc. To force the 'content' part to be a file, prefix the file name
|
||||
with an @ sign. To just get the content part from a file, prefix the file name
|
||||
with the letter <. The difference between @ and < is then that @ makes a file
|
||||
with the symbol <. The difference between @ and < is then that @ makes a file
|
||||
get attached in the post as a file upload, while the < makes a text field and
|
||||
just get the contents for that text field from a file.
|
||||
|
||||
@@ -517,7 +518,7 @@ contents but they should be encoded according to the URI standard.
|
||||
When used, this option will make all data specified with \fI-d/--data\fP or
|
||||
\fI--data-binary\fP to be used in a HTTP GET request instead of the POST
|
||||
request that otherwise would be used. The data will be appended to the URL
|
||||
with a '?' separator.
|
||||
with a '?' separator.
|
||||
|
||||
If used in combination with -I, the POST data will instead be appended to the
|
||||
URL with a HEAD request.
|
||||
@@ -537,9 +538,9 @@ set headers without knowing perfectly well what you're doing. Remove an
|
||||
internal header by giving a replacement without content on the right side of
|
||||
the colon, as in: -H \&"Host:".
|
||||
|
||||
curl will make sure that each header you add/replace get sent with the proper
|
||||
end of line marker, you should thus \fBnot\fP add that as a part of the header
|
||||
content: do not add newlines or carriage returns they will only mess things up
|
||||
curl will make sure that each header you add/replace is sent with the proper
|
||||
end-of-line marker, you should thus \fBnot\fP add that as a part of the header
|
||||
content: do not add newlines or carriage returns, they will only mess things up
|
||||
for you.
|
||||
|
||||
See also the \fI-A/--user-agent\fP and \fI-e/--referer\fP options.
|
||||
@@ -580,7 +581,7 @@ cookies when they're closed down.
|
||||
(SSL) This option explicitly allows curl to perform "insecure" SSL connections
|
||||
and transfers. All SSL connections are attempted to be made secure by using
|
||||
the CA certificate bundle installed by default. This makes all connections
|
||||
considered "insecure" to fail unless \fI-k/--insecure\fP is used.
|
||||
considered "insecure" fail unless \fI-k/--insecure\fP is used.
|
||||
|
||||
See this online resource for further details:
|
||||
\fBhttp://curl.haxx.se/docs/sslcerts.html\fP
|
||||
@@ -599,16 +600,16 @@ separate file.
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--key-type <type>"
|
||||
(SSL) Private key file type. Specify which type your \fI--key\fP provided
|
||||
private key is. DER, PEM and ENG are supported. If not specified, PEM is
|
||||
private key is. DER, PEM, and ENG are supported. If not specified, PEM is
|
||||
assumed.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--krb <level>"
|
||||
(FTP) Enable Kerberos authentication and use. The level must be entered and
|
||||
should be one of 'clear', 'safe', 'confidential' or 'private'. Should you use
|
||||
should be one of 'clear', 'safe', 'confidential', or 'private'. Should you use
|
||||
a level that is not one of these, 'private' will instead be used.
|
||||
|
||||
This option requires that the library was built with kerberos4 or GSSAPI
|
||||
This option requires a library built with kerberos4 or GSSAPI
|
||||
(GSS-Negotiate) support. This is not very common. Use \fI-V/--version\fP to
|
||||
see if your curl supports it.
|
||||
|
||||
@@ -618,11 +619,11 @@ Specify which config file to read curl arguments from. The config file is a
|
||||
text file in which command line arguments can be written which then will be
|
||||
used as if they were written on the actual command line. Options and their
|
||||
parameters must be specified on the same config file line, separated by
|
||||
white space, colon, the equals sign or any combination thereof (however,
|
||||
whitespace, colon, the equals sign or any combination thereof (however,
|
||||
the preferred separator is the equals sign). If the parameter is to contain
|
||||
white spaces, the parameter must be enclosed within quotes. Within double
|
||||
whitespace, the parameter must be enclosed within quotes. Within double
|
||||
quotes, the following escape sequences are available: \\\\, \\", \\t, \\n,
|
||||
\\r and \\v. A backlash preceding any other letter is ignored. If the
|
||||
\\r and \\v. A backslash preceding any other letter is ignored. If the
|
||||
first column of a config line is a '#' character, the rest of the line will be
|
||||
treated as a comment. Only write one option per physical line in the config
|
||||
file.
|
||||
@@ -645,12 +646,12 @@ the following places in this order:
|
||||
|
||||
1) curl tries to find the "home dir": It first checks for the CURL_HOME and
|
||||
then the HOME environment variables. Failing that, it uses getpwuid() on
|
||||
unix-like systems (which returns the home dir given the current user in your
|
||||
UNIX-like systems (which returns the home dir given the current user in your
|
||||
system). On Windows, it then checks for the APPDATA variable, or as a last
|
||||
resort the '%USERPROFILE%\Application Data'.
|
||||
resort the '%USERPROFILE%\\Application Data'.
|
||||
|
||||
2) On windows, if there is no _curlrc file in the home dir, it checks for one
|
||||
in the same dir the executable curl is placed. On unix-like systems, it will
|
||||
in the same dir the curl executable is placed. On UNIX-like systems, it will
|
||||
simply try to load .curlrc from the determined home dir.
|
||||
|
||||
.nf
|
||||
@@ -671,7 +672,7 @@ This option can be used multiple times to load multiple config files.
|
||||
.IP "--libcurl <file>"
|
||||
Append this option to any ordinary curl command line, and you will get a
|
||||
libcurl-using source code written to the file that does the equivalent
|
||||
operation of what your command line operation does!
|
||||
of what your command-line operation does!
|
||||
|
||||
NOTE: this does not properly support -F and the sending of multipart
|
||||
formposts, so in those cases the output program will be missing necessary
|
||||
@@ -681,18 +682,18 @@ If this option is used several times, the last given file name will be
|
||||
used. (Added in 7.16.1)
|
||||
.IP "--limit-rate <speed>"
|
||||
Specify the maximum transfer rate you want curl to use. This feature is useful
|
||||
if you have a limited pipe and you'd like your transfer not use your entire
|
||||
if you have a limited pipe and you'd like your transfer not to use your entire
|
||||
bandwidth.
|
||||
|
||||
The given speed is measured in bytes/second, unless a suffix is appended.
|
||||
Appending 'k' or 'K' will count the number as kilobytes, 'm' or M' makes it
|
||||
megabytes while 'g' or 'G' makes it gigabytes. Examples: 200K, 3m and 1G.
|
||||
megabytes, while 'g' or 'G' makes it gigabytes. Examples: 200K, 3m and 1G.
|
||||
|
||||
The given rate is the average speed, counted during the entire transfer. It
|
||||
The given rate is the average speed counted during the entire transfer. It
|
||||
means that curl might use higher transfer speeds in short bursts, but over
|
||||
time it uses no more than the given rate.
|
||||
|
||||
If you are also using the \fI-Y/--speed-limit\fP option, that option will take
|
||||
If you also use the \fI-Y/--speed-limit\fP option, that option will take
|
||||
precedence and might cripple the rate-limiting slightly, to help keeping the
|
||||
speed-limit logic working.
|
||||
|
||||
@@ -710,12 +711,12 @@ subdirectories and symbolic links.
|
||||
|
||||
.IP "--local-port <num>[-num]"
|
||||
Set a preferred number or range of local port numbers to use for the
|
||||
connection(s). Note that port numbers by nature is a scarce resource that
|
||||
connection(s). Note that port numbers by nature are a scarce resource that
|
||||
will be busy at times so setting this range to something too narrow might
|
||||
cause unnecessary connection setup failures. (Added in 7.15.2)
|
||||
.IP "-L/--location"
|
||||
(HTTP/HTTPS) If the server reports that the requested page has moved to a
|
||||
different location (indicated with a Location: header and a 3XX response code)
|
||||
different location (indicated with a Location: header and a 3XX response code),
|
||||
this option will make curl redo the request on the new place. If used together
|
||||
with \fI-i/--include\fP or \fI-I/--head\fP, headers from all requested pages
|
||||
will be shown. When authentication is used, curl only sends its credentials to
|
||||
@@ -731,7 +732,7 @@ re-send the following request using the same unmodified method.
|
||||
.IP "--location-trusted"
|
||||
(HTTP/HTTPS) Like \fI-L/--location\fP, but will allow sending the name +
|
||||
password to all hosts that the site may redirect to. This may or may not
|
||||
introduce a security breach if the site redirects you do a site to which
|
||||
introduce a security breach if the site redirects you to a site to which
|
||||
you'll send your authentication info (which is plaintext in the case of HTTP
|
||||
Basic authentication).
|
||||
|
||||
@@ -740,7 +741,7 @@ Specify the maximum size (in bytes) of a file to download. If the file
|
||||
requested is larger than this value, the transfer will not start and curl will
|
||||
return with exit code 63.
|
||||
|
||||
NOTE: The file size is not always known prior to download, and for such files
|
||||
\fBNOTE:\fP The file size is not always known prior to download, and for such files
|
||||
this option has no effect even if the file transfer ends up being larger than
|
||||
this given limit. This concerns both FTP and HTTP transfers.
|
||||
.IP "-m/--max-time <seconds>"
|
||||
@@ -753,35 +754,35 @@ If this option is used several times, the last one will be used.
|
||||
Manual. Display the huge help text.
|
||||
.IP "-n/--netrc"
|
||||
Makes curl scan the \fI.netrc\fP (\fI_netrc\fP on Windows) file in the user's
|
||||
home directory for login name and password. This is typically used for ftp on
|
||||
unix. If used with http, curl will enable user authentication. See
|
||||
home directory for login name and password. This is typically used for FTP on
|
||||
UNIX. If used with HTTP, curl will enable user authentication. See
|
||||
.BR netrc(4)
|
||||
or
|
||||
.BR ftp(1)
|
||||
for details on the file format. Curl will not complain if that file
|
||||
hasn't the right permissions (it should not be world nor group
|
||||
readable). The environment variable "HOME" is used to find the home
|
||||
doesn't have the right permissions (it should not be either world- or
|
||||
group-readable). The environment variable "HOME" is used to find the home
|
||||
directory.
|
||||
|
||||
A quick and very simple example of how to setup a \fI.netrc\fP to allow curl
|
||||
to ftp to the machine host.domain.com with user name \&'myself' and password
|
||||
to FTP to the machine host.domain.com with user name \&'myself' and password
|
||||
\&'secret' should look similar to:
|
||||
|
||||
.B "machine host.domain.com login myself password secret"
|
||||
.IP "--netrc-optional"
|
||||
Very similar to \fI--netrc\fP, but this option makes the .netrc usage
|
||||
\fBoptional\fP and not mandatory as the \fI--netrc\fP does.
|
||||
\fBoptional\fP and not mandatory as the \fI--netrc\fP option does.
|
||||
.IP "--negotiate"
|
||||
(HTTP) Enables GSS-Negotiate authentication. The GSS-Negotiate method was
|
||||
designed by Microsoft and is used in their web applications. It is primarily
|
||||
meant as a support for Kerberos5 authentication but may be also used along
|
||||
with another authentication methods. For more information see IETF draft
|
||||
with another authentication method. For more information see IETF draft
|
||||
draft-brezak-spnego-http-04.txt.
|
||||
|
||||
If you want to enable Negotiate for your proxy authentication, then use
|
||||
\fI--proxy-negotiate\fP.
|
||||
|
||||
This option requires that the library was built with GSSAPI support. This is
|
||||
This option requires a library built with GSSAPI support. This is
|
||||
not very common. Use \fI-V/--version\fP to see if your version supports
|
||||
GSS-Negotiate.
|
||||
|
||||
@@ -807,7 +808,7 @@ Note that this is the negated option name documented. You can thus use
|
||||
\fI--keepalive\fP to enforce keepalive.
|
||||
.IP "--no-sessionid"
|
||||
(SSL) Disable curl's use of SSL session-ID caching. By default all transfers
|
||||
are done using the cache. Note that while nothing ever should get hurt by
|
||||
are done using the cache. Note that while nothing should ever get hurt by
|
||||
attempting to reuse SSL session-IDs, there seem to be broken SSL
|
||||
implementations in the wild that may require you to disable this in order for
|
||||
you to succeed. (Added in 7.16.0)
|
||||
@@ -817,15 +818,15 @@ Note that this is the negated option name documented. You can thus use
|
||||
.IP "--ntlm"
|
||||
(HTTP) Enables NTLM authentication. The NTLM authentication method was
|
||||
designed by Microsoft and is used by IIS web servers. It is a proprietary
|
||||
protocol, reversed engineered by clever people and implemented in curl based
|
||||
protocol, reverse-engineered by clever people and implemented in curl based
|
||||
on their efforts. This kind of behavior should not be endorsed, you should
|
||||
encourage everyone who uses NTLM to switch to a public and documented
|
||||
authentication method instead. Such as Digest.
|
||||
authentication method instead, such as Digest.
|
||||
|
||||
If you want to enable NTLM for your proxy authentication, then use
|
||||
\fI--proxy-ntlm\fP.
|
||||
|
||||
This option requires that the library was built with SSL support. Use
|
||||
This option requires a library built with SSL support. Use
|
||||
\fI-V/--version\fP to see if your curl supports NTLM.
|
||||
|
||||
If this option is used several times, the following occurrences make no
|
||||
@@ -842,7 +843,7 @@ or use several variables like:
|
||||
|
||||
curl http://{site,host}.host[1-5].com -o "#1_#2"
|
||||
|
||||
You may use this option as many times as you have number of URLs.
|
||||
You may use this option as many times as the number of URLs you have.
|
||||
|
||||
See also the \fI--create-dirs\fP option to create the local directories
|
||||
dynamically.
|
||||
@@ -853,23 +854,30 @@ part of the remote file is used, the path is cut off.)
|
||||
The remote file name to use for saving is extracted from the given URL,
|
||||
nothing else.
|
||||
|
||||
You may use this option as many times as you have number of URLs.
|
||||
You may use this option as many times as the number of URLs you have.
|
||||
.IP "--remote-name-all"
|
||||
This option changes the default action for all given URLs to be dealt with as
|
||||
if \fI-O/--remote-name\fP were used for each one. So if you want to disable
|
||||
that for a specific URL after \fI--remote-name-all\fP has been used, you must
|
||||
use "-o -" or \fI--no-remote-name\fP. (Added in 7.19.0)
|
||||
.IP "--pass <phrase>"
|
||||
(SSL/SSH) Pass phrase for the private key
|
||||
(SSL/SSH) Passphrase for the private key
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--post301"
|
||||
Tells curl to respect RFC 2616/10.3.2 and not convert POST requests into GET
|
||||
requests when following a 301 redirection. The non-RFC behaviour is ubiquitous
|
||||
in web browsers, so curl does the conversion by default to maintain
|
||||
consistency. However, a server may requires a POST to remain a POST after such
|
||||
consistency. However, a server may require a POST to remain a POST after such
|
||||
a redirection. This option is meaningful only when using \fI-L/--location\fP
|
||||
(Added in 7.17.1)
|
||||
.IP "--post302"
|
||||
Tells curl to respect RFC 2616/10.3.2 and not convert POST requests into GET
|
||||
requests when following a 302 redirection. The non-RFC behaviour is ubiquitous
|
||||
in web browsers, so curl does the conversion by default to maintain
|
||||
consistency. However, a server may requires a POST to remain a POST after such
|
||||
a redirection. This option is meaningful only when using \fI-L/--location\fP
|
||||
(Added in 7.19.1)
|
||||
.IP "--proxy-anyauth"
|
||||
Tells curl to pick a suitable authentication method when communicating with
|
||||
the given proxy. This might cause an extra request/response round-trip. (Added
|
||||
@@ -900,18 +908,18 @@ separate file.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-P/--ftp-port <address>"
|
||||
(FTP) Reverses the initiator/listener roles when connecting with ftp. This
|
||||
switch makes Curl use the PORT command instead of PASV. In practise, PORT
|
||||
(FTP) Reverses the initiator/listener roles when connecting with FTP. This
|
||||
switch makes Curl use the PORT command instead of PASV. In practice, PORT
|
||||
tells the server to connect to the client's specified address and port, while
|
||||
PASV asks the server for an ip address and port to connect to. <address>
|
||||
PASV asks the server for an IP address and port to connect to. <address>
|
||||
should be one of:
|
||||
.RS
|
||||
.IP interface
|
||||
i.e "eth0" to specify which interface's IP address you want to use (Unix only)
|
||||
i.e "eth0" to specify which interface's IP address you want to use (Unix only)
|
||||
.IP "IP address"
|
||||
i.e "192.168.10.1" to specify exact IP number
|
||||
i.e "192.168.10.1" to specify the exact IP address
|
||||
.IP "host name"
|
||||
i.e "my.host.domain" to specify machine
|
||||
i.e "my.host.domain" to specify the machine
|
||||
.IP "-"
|
||||
make curl pick the same IP address that is already used for the control
|
||||
connection
|
||||
@@ -926,11 +934,11 @@ file will not be read and used. See the \fI-K/--config\fP for details on the
|
||||
default config file search path.
|
||||
.IP "-Q/--quote <command>"
|
||||
(FTP/SFTP) Send an arbitrary command to the remote FTP or SFTP server. Quote
|
||||
commands are sent BEFORE the transfer is taking place (just after the
|
||||
commands are sent BEFORE the transfer takes place (just after the
|
||||
initial PWD command in an FTP transfer, to be exact). To make commands
|
||||
take place after a successful transfer, prefix them with a dash '-'.
|
||||
To make commands get sent after libcurl has changed working directory,
|
||||
just before the transfer command(s), prefix the command with '+' (this
|
||||
To make commands be sent after libcurl has changed the working directory,
|
||||
just before the transfer command(s), prefix the command with a '+' (this
|
||||
is only supported for FTP). You may specify any number of commands. If
|
||||
the server returns failure for one of the commands, the entire operation
|
||||
will be aborted. You must send syntactically correct FTP commands as
|
||||
@@ -975,9 +983,9 @@ See ln.
|
||||
random data. The data is used to seed the random engine for SSL connections.
|
||||
See also the \fI--egd-file\fP option.
|
||||
.IP "-r/--range <range>"
|
||||
(HTTP/FTP/FILE) Retrieve a byte range (i.e a partial document) from a
|
||||
HTTP/1.1, FTP server or a local FILE. Ranges can be specified in a number of
|
||||
ways.
|
||||
(HTTP/FTP/SFTP/FILE) Retrieve a byte range (i.e a partial document) from a
|
||||
HTTP/1.1, FTP or SFTP server or a local FILE. Ranges can be specified
|
||||
in a number of ways.
|
||||
.RS
|
||||
.TP 10
|
||||
.B 0-499
|
||||
@@ -999,22 +1007,23 @@ specifies the first and last byte only(*)(H)
|
||||
specifies 300 bytes from offset 500(H)
|
||||
.TP
|
||||
.B 100-199,500-599
|
||||
specifies two separate 100 bytes ranges(*)(H)
|
||||
specifies two separate 100-byte ranges(*)(H)
|
||||
.RE
|
||||
|
||||
(*) = NOTE that this will cause the server to reply with a multipart
|
||||
response!
|
||||
|
||||
Only digit characters (0-9) are valid in 'start' and 'stop' of range syntax
|
||||
\&'start-stop'. If a non-digit character is given in the range, the server's
|
||||
response will be indeterminable, depending on different server's configuration.
|
||||
Only digit characters (0-9) are valid in the 'start' and 'stop' fields of
|
||||
the \&'start-stop' range syntax. If a non-digit character is given in the range, the server's
|
||||
response will be unspecified, depending on the server's configuration.
|
||||
|
||||
You should also be aware that many HTTP/1.1 servers do not have this feature
|
||||
enabled, so that when you attempt to get a range, you'll instead get the whole
|
||||
document.
|
||||
|
||||
FTP range downloads only support the simple syntax 'start-stop' (optionally
|
||||
with one of the numbers omitted). It depends on the non-RFC command SIZE.
|
||||
FTP and SFTP range downloads only support the simple 'start-stop' syntax
|
||||
(optionally with one of the numbers omitted). FTP use depends on the extended
|
||||
FTP command SIZE.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--raw"
|
||||
@@ -1039,13 +1048,13 @@ retries. (Added in 7.12.3)
|
||||
|
||||
If this option is used multiple times, the last occurrence decide the amount.
|
||||
.IP "--retry-delay <seconds>"
|
||||
Make curl sleep this amount of time between each retry when a transfer has
|
||||
Make curl sleep this amount of time before each retry when a transfer has
|
||||
failed with a transient error (it changes the default backoff time algorithm
|
||||
between retries). This option is only interesting if \fI--retry\fP is also
|
||||
used. Setting this delay to zero will make curl use the default backoff time.
|
||||
(Added in 7.12.3)
|
||||
|
||||
If this option is used multiple times, the last occurrence decide the amount.
|
||||
If this option is used multiple times, the last occurrence determines the amount.
|
||||
.IP "--retry-max-time <seconds>"
|
||||
The retry timer is reset before the first transfer attempt. Retries will be
|
||||
done as usual (see \fI--retry\fP) as long as the timer hasn't reached this
|
||||
@@ -1054,12 +1063,13 @@ will be made and while performing, it may take longer than this given time
|
||||
period. To limit a single request\'s maximum time, use \fI-m/--max-time\fP.
|
||||
Set this option to zero to not timeout retries. (Added in 7.12.3)
|
||||
|
||||
If this option is used multiple times, the last occurrence decide the amount.
|
||||
If this option is used multiple times, the last occurrence determines the
|
||||
amount.
|
||||
.IP "-s/--silent"
|
||||
Silent mode. Don't show progress meter or error messages. Makes
|
||||
Curl mute.
|
||||
.IP "-S/--show-error"
|
||||
When used with -s it makes curl show error message if it fails.
|
||||
When used with -s it makes curl show an error message if it fails.
|
||||
.IP "--socks4 <host[:port]>"
|
||||
Use the specified SOCKS4 proxy. If the port number is not specified, it is
|
||||
assumed at port 1080. (Added in 7.15.2)
|
||||
@@ -1120,7 +1130,7 @@ part in the specified URL, Curl will append the local file name. NOTE that you
|
||||
must use a trailing / on the last directory to really prove to Curl that there
|
||||
is no file name or curl will think that your last directory name is the remote
|
||||
file name to use. That will most likely cause the upload operation to fail. If
|
||||
this is used on a http(s) server, the PUT command will be used.
|
||||
this is used on a HTTP(S) server, the PUT command will be used.
|
||||
|
||||
Use the file name "-" (a single dash) to use stdin instead of a given file.
|
||||
|
||||
@@ -1159,7 +1169,7 @@ If this option is used several times, the last one will be used.
|
||||
Prepends a time stamp to each trace or verbose line that curl displays.
|
||||
(Added in 7.14.0)
|
||||
.IP "-u/--user <user:password>"
|
||||
Specify user and password to use for server authentication. Overrides
|
||||
Specify the user name and password to use for server authentication. Overrides
|
||||
\fI-n/--netrc\fP and \fI--netrc-optional\fP.
|
||||
|
||||
If you just give the user name (without entering a colon) curl will prompt for
|
||||
@@ -1171,7 +1181,7 @@ simply specifying a single colon with this option: "-u :".
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-U/--proxy-user <user:password>"
|
||||
Specify user and password to use for proxy authentication.
|
||||
Specify the user name and password to use for proxy authentication.
|
||||
|
||||
If you use an SSPI-enabled curl binary and do NTLM authentication, you can
|
||||
force curl to pick up the user name and password from your environment by
|
||||
@@ -1185,13 +1195,13 @@ URL(s) in a config file.
|
||||
This option may be used any number of times. To control where this URL is
|
||||
written, use the \fI-o/--output\fP or the \fI-O/--remote-name\fP options.
|
||||
.IP "-v/--verbose"
|
||||
Makes the fetching more verbose/talkative. Mostly usable for debugging. Lines
|
||||
Makes the fetching more verbose/talkative. Mostly useful for debugging. A line
|
||||
starting with '>' means "header data" sent by curl, '<' means "header data"
|
||||
received by curl that is hidden in normal cases and lines starting with '*'
|
||||
received by curl that is hidden in normal cases, and a line starting with '*'
|
||||
means additional info provided by curl.
|
||||
|
||||
Note that if you only want HTTP headers in the output, \fI-i/--include\fP
|
||||
might be option you're looking for.
|
||||
might be the option you're looking for.
|
||||
|
||||
If you think this option still doesn't give you enough details, consider using
|
||||
\fI--trace\fP or \fI--trace-ascii\fP instead.
|
||||
@@ -1212,7 +1222,7 @@ reports to offer. Available features include:
|
||||
.IP "IPv6"
|
||||
You can use IPv6 with this.
|
||||
.IP "krb4"
|
||||
Krb4 for ftp is supported.
|
||||
Krb4 for FTP is supported.
|
||||
.IP "SSL"
|
||||
HTTPS and FTPS are supported.
|
||||
.IP "libz"
|
||||
@@ -1220,7 +1230,7 @@ Automatic decompression of compressed files over HTTP is supported.
|
||||
.IP "NTLM"
|
||||
NTLM authentication is supported.
|
||||
.IP "GSS-Negotiate"
|
||||
Negotiate authentication and krb5 for ftp is supported.
|
||||
Negotiate authentication and krb5 for FTP is supported.
|
||||
.IP "Debug"
|
||||
This curl uses a libcurl built with Debug. This enables more error-tracking
|
||||
and memory debugging etc. For curl-developers only!
|
||||
@@ -1245,19 +1255,19 @@ format from stdin you write "@-".
|
||||
|
||||
The variables present in the output format will be substituted by the value or
|
||||
text that curl thinks fit, as described below. All variables are specified
|
||||
like %{variable_name} and to output a normal % you just write them like
|
||||
as %{variable_name} and to output a normal % you just write them as
|
||||
%%. You can output a newline by using \\n, a carriage return with \\r and a tab
|
||||
space with \\t.
|
||||
|
||||
.B NOTE:
|
||||
The %-letter is a special letter in the win32-environment, where all
|
||||
The %-symbol is a special symbol in the win32-environment, where all
|
||||
occurrences of % must be doubled when using this option.
|
||||
|
||||
Available variables are at this point:
|
||||
The variables available at this point are:
|
||||
.RS
|
||||
.TP 15
|
||||
.B url_effective
|
||||
The URL that was fetched last. This is mostly meaningful if you've told curl
|
||||
The URL that was fetched last. This is most meaningful if you've told curl
|
||||
to follow location: headers.
|
||||
.TP
|
||||
.B http_code
|
||||
@@ -1286,20 +1296,20 @@ The time, in seconds, it took from the start until the SSL/SSH/etc
|
||||
connect/handshake to the remote host was completed. (Added in 7.19.0)
|
||||
.TP
|
||||
.B time_pretransfer
|
||||
The time, in seconds, it took from the start until the file transfer is just
|
||||
The time, in seconds, it took from the start until the file transfer was just
|
||||
about to begin. This includes all pre-transfer commands and negotiations that
|
||||
are specific to the particular protocol(s) involved.
|
||||
.TP
|
||||
.B time_redirect
|
||||
The time, in seconds, it took for all redirection steps include name lookup,
|
||||
connect, pretransfer and transfer before final transaction was
|
||||
connect, pretransfer and transfer before the final transaction was
|
||||
started. time_redirect shows the complete execution time for multiple
|
||||
redirections. (Added in 7.12.3)
|
||||
.TP
|
||||
.B time_starttransfer
|
||||
The time, in seconds, it took from the start until the first byte is just about
|
||||
The time, in seconds, it took from the start until the first byte was just about
|
||||
to be transferred. This includes time_pretransfer and also the time the
|
||||
server needs to calculate the result.
|
||||
server needed to calculate the result.
|
||||
.TP
|
||||
.B size_download
|
||||
The total amount of bytes that were downloaded.
|
||||
@@ -1343,10 +1353,10 @@ means the verification was successful. (Added in 7.19.0)
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-x/--proxy <proxyhost[:port]>"
|
||||
Use specified HTTP proxy. If the port number is not specified, it is assumed
|
||||
Use the specified HTTP proxy. If the port number is not specified, it is assumed
|
||||
at port 1080.
|
||||
|
||||
This option overrides existing environment variables that sets proxy to
|
||||
This option overrides existing environment variables that set the proxy to
|
||||
use. If there's an environment variable setting a proxy, you can set proxy to
|
||||
\&"" to override it.
|
||||
|
||||
@@ -1356,8 +1366,8 @@ operations might not be available. This is not the case if you can tunnel
|
||||
through the proxy, as done with the \fI-p/--proxytunnel\fP option.
|
||||
|
||||
Starting with 7.14.1, the proxy host can be specified the exact same way as
|
||||
the proxy environment variables, include protocol prefix (http://) and
|
||||
embedded user + password.
|
||||
the proxy environment variables, including the protocol prefix (http://) and
|
||||
the embedded user + password.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-X/--request <command>"
|
||||
@@ -1368,21 +1378,21 @@ details and explanations.
|
||||
|
||||
(FTP)
|
||||
Specifies a custom FTP command to use instead of LIST when doing file lists
|
||||
with ftp.
|
||||
with FTP.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-y/--speed-time <time>"
|
||||
If a download is slower than speed-limit bytes per second during a speed-time
|
||||
period, the download gets aborted. If speed-time is used, the default
|
||||
speed-limit will be 1 unless set with -y.
|
||||
speed-limit will be 1 unless set with -Y.
|
||||
|
||||
This option controls transfers and thus will not affect slow connects etc. If
|
||||
this is a concern for you, try the \fI--connect-timeout\fP option.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-Y/--speed-limit <speed>"
|
||||
If a download is slower than this given speed, in bytes per second, for
|
||||
speed-time seconds it gets aborted. speed-time is set with -Y and is 30 if
|
||||
If a download is slower than this given speed (in bytes per second) for
|
||||
speed-time seconds it gets aborted. speed-time is set with -y and is 30 if
|
||||
not set.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
@@ -1410,7 +1420,7 @@ If this option is used several times, the last one will be used.
|
||||
internally preferred: HTTP 1.1.
|
||||
.IP "-1/--tlsv1"
|
||||
(SSL)
|
||||
Forces curl to use TSL version 1 when negotiating with a remote TLS server.
|
||||
Forces curl to use TLS version 1 when negotiating with a remote TLS server.
|
||||
.IP "-2/--sslv2"
|
||||
(SSL)
|
||||
Forces curl to use SSL version 2 when negotiating with a remote SSL server.
|
||||
@@ -1419,11 +1429,11 @@ Forces curl to use SSL version 2 when negotiating with a remote SSL server.
|
||||
Forces curl to use SSL version 3 when negotiating with a remote SSL server.
|
||||
.IP "-4/--ipv4"
|
||||
If libcurl is capable of resolving an address to multiple IP versions (which
|
||||
it is if it is ipv6-capable), this option tells libcurl to resolve names to
|
||||
it is if it is IPv6-capable), this option tells libcurl to resolve names to
|
||||
IPv4 addresses only.
|
||||
.IP "-6/--ipv6"
|
||||
If libcurl is capable of resolving an address to multiple IP versions (which
|
||||
it is if it is ipv6-capable), this option tells libcurl to resolve names to
|
||||
it is if it is IPv6-capable), this option tells libcurl to resolve names to
|
||||
IPv6 addresses only.
|
||||
.IP "-#/--progress-bar"
|
||||
Make curl display progress information as a progress bar instead of the
|
||||
@@ -1435,18 +1445,18 @@ Default config file, see \fI-K/--config\fP for details.
|
||||
|
||||
.SH ENVIRONMENT
|
||||
.IP "http_proxy [protocol://]<host>[:port]"
|
||||
Sets proxy server to use for HTTP.
|
||||
Sets the proxy server to use for HTTP.
|
||||
.IP "HTTPS_PROXY [protocol://]<host>[:port]"
|
||||
Sets proxy server to use for HTTPS.
|
||||
Sets the proxy server to use for HTTPS.
|
||||
.IP "FTP_PROXY [protocol://]<host>[:port]"
|
||||
Sets proxy server to use for FTP.
|
||||
Sets the proxy server to use for FTP.
|
||||
.IP "ALL_PROXY [protocol://]<host>[:port]"
|
||||
Sets proxy server to use if no protocol-specific proxy is set.
|
||||
Sets the proxy server to use if no protocol-specific proxy is set.
|
||||
.IP "NO_PROXY <comma-separated list of hosts>"
|
||||
list of host names that shouldn't go through any proxy. If set to a asterisk
|
||||
\&'*' only, it matches all hosts.
|
||||
.SH EXIT CODES
|
||||
There exists a bunch of different error codes and their corresponding error
|
||||
There are a bunch of different error codes and their corresponding error
|
||||
messages that may appear during bad conditions. At the time of this writing,
|
||||
the exit codes are:
|
||||
.IP 1
|
||||
@@ -1454,7 +1464,7 @@ Unsupported protocol. This build of curl has no support for this protocol.
|
||||
.IP 2
|
||||
Failed to initialize.
|
||||
.IP 3
|
||||
URL malformat. The syntax was not correct.
|
||||
URL malformed. The syntax was not correct.
|
||||
.IP 5
|
||||
Couldn't resolve proxy. The given proxy host could not be resolved.
|
||||
.IP 6
|
||||
@@ -1535,69 +1545,69 @@ Unknown TELNET option specified.
|
||||
.IP 49
|
||||
Malformed telnet option.
|
||||
.IP 51
|
||||
The peer's SSL certificate or SSH MD5 fingerprint was not ok
|
||||
The peer's SSL certificate or SSH MD5 fingerprint was not ok.
|
||||
.IP 52
|
||||
The server didn't reply anything, which here is considered an error.
|
||||
.IP 53
|
||||
SSL crypto engine not found
|
||||
SSL crypto engine not found.
|
||||
.IP 54
|
||||
Cannot set SSL crypto engine as default
|
||||
Cannot set SSL crypto engine as default.
|
||||
.IP 55
|
||||
Failed sending network data
|
||||
Failed sending network data.
|
||||
.IP 56
|
||||
Failure in receiving network data
|
||||
Failure in receiving network data.
|
||||
.IP 58
|
||||
Problem with the local certificate
|
||||
Problem with the local certificate.
|
||||
.IP 59
|
||||
Couldn't use specified SSL cipher
|
||||
Couldn't use specified SSL cipher.
|
||||
.IP 60
|
||||
Peer certificate cannot be authenticated with known CA certificates
|
||||
Peer certificate cannot be authenticated with known CA certificates.
|
||||
.IP 61
|
||||
Unrecognized transfer encoding
|
||||
Unrecognized transfer encoding.
|
||||
.IP 62
|
||||
Invalid LDAP URL
|
||||
Invalid LDAP URL.
|
||||
.IP 63
|
||||
Maximum file size exceeded
|
||||
Maximum file size exceeded.
|
||||
.IP 64
|
||||
Requested FTP SSL level failed
|
||||
Requested FTP SSL level failed.
|
||||
.IP 65
|
||||
Sending the data requires a rewind that failed
|
||||
Sending the data requires a rewind that failed.
|
||||
.IP 66
|
||||
Failed to initialise SSL Engine
|
||||
Failed to initialise SSL Engine.
|
||||
.IP 67
|
||||
User, password or similar was not accepted and curl failed to login
|
||||
The user name, password, or similar was not accepted and curl failed to log in.
|
||||
.IP 68
|
||||
File not found on TFTP server
|
||||
File not found on TFTP server.
|
||||
.IP 69
|
||||
Permission problem on TFTP server
|
||||
Permission problem on TFTP server.
|
||||
.IP 70
|
||||
Out of disk space on TFTP server
|
||||
Out of disk space on TFTP server.
|
||||
.IP 71
|
||||
Illegal TFTP operation
|
||||
Illegal TFTP operation.
|
||||
.IP 72
|
||||
Unknown TFTP transfer ID
|
||||
Unknown TFTP transfer ID.
|
||||
.IP 73
|
||||
File already exists (TFTP)
|
||||
File already exists (TFTP).
|
||||
.IP 74
|
||||
No such user (TFTP)
|
||||
No such user (TFTP).
|
||||
.IP 75
|
||||
Character conversion failed
|
||||
Character conversion failed.
|
||||
.IP 76
|
||||
Character conversion functions required
|
||||
Character conversion functions required.
|
||||
.IP 77
|
||||
Problem with reading the SSL CA cert (path? access rights?)
|
||||
Problem with reading the SSL CA cert (path? access rights?).
|
||||
.IP 78
|
||||
The resource referenced in the URL does not exist
|
||||
The resource referenced in the URL does not exist.
|
||||
.IP 79
|
||||
An unspecified error occurred during the SSH session
|
||||
An unspecified error occurred during the SSH session.
|
||||
.IP 80
|
||||
Failed to shut down the SSL connection
|
||||
Failed to shut down the SSL connection.
|
||||
.IP 82
|
||||
Could not load CRL file, missing or wrong format (added in 7.19.0)
|
||||
Could not load CRL file, missing or wrong format (added in 7.19.0).
|
||||
.IP 83
|
||||
Issuer check failed (added in 7.19.0)
|
||||
Issuer check failed (added in 7.19.0).
|
||||
.IP XX
|
||||
There will appear more error codes here in future releases. The existing ones
|
||||
More error codes will appear here in future releases. The existing ones
|
||||
are meant to never change.
|
||||
.SH AUTHORS / CONTRIBUTORS
|
||||
Daniel Stenberg is the main author, but the whole list of contributors is
|
||||
|
||||
@@ -113,7 +113,7 @@ int main(void)
|
||||
|
||||
/* we can optionally limit the total amount of connections this multi handle
|
||||
uses */
|
||||
curl_multi_setopt(cm, CURLMOPT_MAXCONNECTS, MAX);
|
||||
curl_multi_setopt(cm, CURLMOPT_MAXCONNECTS, (long)MAX);
|
||||
|
||||
for (C = 0; C < MAX; ++C) {
|
||||
init(cm, C);
|
||||
|
||||
@@ -5,13 +5,12 @@ check_PROGRAMS = 10-at-a-time anyauthput cookie_interface \
|
||||
https multi-app multi-debugcallback multi-double \
|
||||
multi-post multi-single persistant post-callback \
|
||||
postit2 sepheaders simple simplepost simplessl \
|
||||
sendrecv httpcustomheader
|
||||
sendrecv httpcustomheader certinfo
|
||||
|
||||
# These examples require external dependencies that may not be commonly
|
||||
# available on POSIX systems, so don't bother attempting to compile them here.
|
||||
COMPLICATED_EXAMPLES = \
|
||||
curlgtk.c curlx.c htmltitle.cc cacertinmem.c ftpuploadresume.c \
|
||||
ghiper.c hiperfifo.c htmltidy.c multithread.c \
|
||||
opensslthreadlock.c sampleconv.c synctime.c threaded-ssl.c
|
||||
|
||||
opensslthreadlock.c sampleconv.c synctime.c threaded-ssl.c evhiperfifo.c
|
||||
|
||||
|
||||
62
docs/examples/certinfo.c
Normal file
62
docs/examples/certinfo.c
Normal file
@@ -0,0 +1,62 @@
|
||||
/*****************************************************************************
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include <curl/types.h>
|
||||
#include <curl/easy.h>
|
||||
|
||||
static size_t wrfu(void *ptr, size_t size, size_t nmemb, void *stream)
|
||||
{
|
||||
return size * nmemb;
|
||||
}
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
|
||||
curl_global_init(CURL_GLOBAL_DEFAULT);
|
||||
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://www.networking4all.com/");
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, wrfu);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L);
|
||||
curl_easy_setopt(curl, CURLOPT_CERTINFO, 1L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
struct curl_certinfo *ci = NULL;
|
||||
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CERTINFO, &ci);
|
||||
|
||||
if(!res && ci) {
|
||||
int i;
|
||||
printf("%d certs!\n", ci->num_of_certs);
|
||||
|
||||
for(i=0; i<ci->num_of_certs; i++) {
|
||||
struct curl_slist *slist;
|
||||
|
||||
for(slist = ci->certinfo[i]; slist; slist = slist->next)
|
||||
printf("%s\n", slist->data);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
|
||||
curl_global_cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -281,7 +281,7 @@ int main(int argc, char **argv) {
|
||||
struct curl_slist * headers=NULL;
|
||||
int badarg=0;
|
||||
|
||||
binaryptr=(char*)malloc(tabLength);
|
||||
binaryptr = malloc(tabLength);
|
||||
|
||||
p.verbose = 0;
|
||||
p.errorbio = BIO_new_fp (stderr, BIO_NOCLOSE);
|
||||
@@ -404,7 +404,7 @@ int main(int argc, char **argv) {
|
||||
/* determine URL to go */
|
||||
|
||||
if (hostporturl) {
|
||||
serverurl=(char*) malloc(9+strlen(hostporturl));
|
||||
serverurl = malloc(9+strlen(hostporturl));
|
||||
sprintf(serverurl,"https://%s",hostporturl);
|
||||
}
|
||||
else if (p.accesstype != 0) { /* see whether we can find an AIA or SIA for a given access type */
|
||||
@@ -442,7 +442,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
/* pass our list of custom made headers */
|
||||
|
||||
contenttype=(char*) malloc(15+strlen(mimetype));
|
||||
contenttype = malloc(15+strlen(mimetype));
|
||||
sprintf(contenttype,"Content-type: %s",mimetype);
|
||||
headers = curl_slist_append(headers,contenttype);
|
||||
curl_easy_setopt(p.curl, CURLOPT_HTTPHEADER, headers);
|
||||
@@ -469,7 +469,7 @@ int main(int argc, char **argv) {
|
||||
i+=lu;
|
||||
if (i== tabLength) {
|
||||
tabLength+=100;
|
||||
binaryptr=(char*)realloc(binaryptr,tabLength); /* should be more careful */
|
||||
binaryptr=realloc(binaryptr,tabLength); /* should be more careful */
|
||||
}
|
||||
}
|
||||
tabLength = i;
|
||||
|
||||
460
docs/examples/evhiperfifo.c
Normal file
460
docs/examples/evhiperfifo.c
Normal file
@@ -0,0 +1,460 @@
|
||||
/*****************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Example application source code using the multi socket interface to
|
||||
* download many files at once.
|
||||
*
|
||||
* This example features the same basic functionality as hiperfifo.c does,
|
||||
* but this uses libev instead of libevent.
|
||||
*
|
||||
* Written by Jeff Pohlmeyer, converted to use libev by Markus Koetter
|
||||
|
||||
Requires libev and a (POSIX?) system that has mkfifo().
|
||||
|
||||
This is an adaptation of libcurl's "hipev.c" and libevent's "event-test.c"
|
||||
sample programs.
|
||||
|
||||
When running, the program creates the named pipe "hiper.fifo"
|
||||
|
||||
Whenever there is input into the fifo, the program reads the input as a list
|
||||
of URL's and creates some new easy handles to fetch each URL via the
|
||||
curl_multi "hiper" API.
|
||||
|
||||
|
||||
Thus, you can try a single URL:
|
||||
% echo http://www.yahoo.com > hiper.fifo
|
||||
|
||||
Or a whole bunch of them:
|
||||
% cat my-url-list > hiper.fifo
|
||||
|
||||
The fifo buffer is handled almost instantly, so you can even add more URL's
|
||||
while the previous requests are still being downloaded.
|
||||
|
||||
Note:
|
||||
For the sake of simplicity, URL length is limited to 1023 char's !
|
||||
|
||||
This is purely a demo app, all retrieved data is simply discarded by the write
|
||||
callback.
|
||||
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/poll.h>
|
||||
#include <curl/curl.h>
|
||||
#include <ev.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define DPRINT(x...) printf(x)
|
||||
|
||||
#define MSG_OUT stdout /* Send info to stdout, change to stderr if you want */
|
||||
|
||||
|
||||
/* Global information, common to all connections */
|
||||
typedef struct _GlobalInfo
|
||||
{
|
||||
struct ev_loop *loop;
|
||||
struct ev_io fifo_event;
|
||||
struct ev_timer timer_event;
|
||||
CURLM *multi;
|
||||
int prev_running;
|
||||
int still_running;
|
||||
FILE* input;
|
||||
} GlobalInfo;
|
||||
|
||||
|
||||
/* Information associated with a specific easy handle */
|
||||
typedef struct _ConnInfo
|
||||
{
|
||||
CURL *easy;
|
||||
char *url;
|
||||
GlobalInfo *global;
|
||||
char error[CURL_ERROR_SIZE];
|
||||
} ConnInfo;
|
||||
|
||||
|
||||
/* Information associated with a specific socket */
|
||||
typedef struct _SockInfo
|
||||
{
|
||||
curl_socket_t sockfd;
|
||||
CURL *easy;
|
||||
int action;
|
||||
long timeout;
|
||||
struct ev_io ev;
|
||||
int evset;
|
||||
GlobalInfo *global;
|
||||
} SockInfo;
|
||||
|
||||
static void timer_cb(EV_P_ struct ev_timer *w, int revents);
|
||||
|
||||
/* Update the event timer after curl_multi library calls */
|
||||
static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
|
||||
{
|
||||
DPRINT("%s %li\n", __PRETTY_FUNCTION__, timeout_ms);
|
||||
ev_timer_stop(g->loop, &g->timer_event);
|
||||
if (timeout_ms > 0)
|
||||
{
|
||||
double t = timeout_ms / 1000;
|
||||
ev_timer_init(&g->timer_event, timer_cb, t, 0.);
|
||||
ev_timer_start(g->loop, &g->timer_event);
|
||||
}else
|
||||
timer_cb(g->loop, &g->timer_event, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Die if we get a bad CURLMcode somewhere */
|
||||
static void mcode_or_die(const char *where, CURLMcode code)
|
||||
{
|
||||
if ( CURLM_OK != code )
|
||||
{
|
||||
const char *s;
|
||||
switch ( code )
|
||||
{
|
||||
case CURLM_CALL_MULTI_PERFORM: s="CURLM_CALL_MULTI_PERFORM"; break;
|
||||
case CURLM_OK: s="CURLM_OK"; break;
|
||||
case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break;
|
||||
case CURLM_BAD_EASY_HANDLE: s="CURLM_BAD_EASY_HANDLE"; break;
|
||||
case CURLM_OUT_OF_MEMORY: s="CURLM_OUT_OF_MEMORY"; break;
|
||||
case CURLM_INTERNAL_ERROR: s="CURLM_INTERNAL_ERROR"; break;
|
||||
case CURLM_UNKNOWN_OPTION: s="CURLM_UNKNOWN_OPTION"; break;
|
||||
case CURLM_LAST: s="CURLM_LAST"; break;
|
||||
default: s="CURLM_unknown";
|
||||
break;
|
||||
case CURLM_BAD_SOCKET: s="CURLM_BAD_SOCKET";
|
||||
fprintf(MSG_OUT, "ERROR: %s returns %s\n", where, s);
|
||||
/* ignore this error */
|
||||
return;
|
||||
}
|
||||
fprintf(MSG_OUT, "ERROR: %s returns %s\n", where, s);
|
||||
exit(code);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Check for completed transfers, and remove their easy handles */
|
||||
static void check_run_count(GlobalInfo *g)
|
||||
{
|
||||
DPRINT("%s prev %i still %i\n", __PRETTY_FUNCTION__,
|
||||
g->prev_running, g->still_running);
|
||||
if ( g->prev_running > g->still_running )
|
||||
{
|
||||
char *eff_url=NULL;
|
||||
CURLMsg *msg;
|
||||
int msgs_left;
|
||||
ConnInfo *conn=NULL;
|
||||
CURL*easy;
|
||||
CURLcode res;
|
||||
|
||||
fprintf(MSG_OUT, "REMAINING: %d\n", g->still_running);
|
||||
/*
|
||||
I am still uncertain whether it is safe to remove an easy
|
||||
handle from inside the curl_multi_info_read loop, so here I
|
||||
will search for completed transfers in the inner "while"
|
||||
loop, and then remove them in the outer "do-while" loop...
|
||||
*/
|
||||
do
|
||||
{
|
||||
easy=NULL;
|
||||
while ( (msg = curl_multi_info_read(g->multi, &msgs_left)) )
|
||||
{
|
||||
if ( msg->msg == CURLMSG_DONE )
|
||||
{
|
||||
easy=msg->easy_handle;
|
||||
res=msg->data.result;
|
||||
}
|
||||
|
||||
if ( easy )
|
||||
{
|
||||
curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn);
|
||||
curl_easy_getinfo(easy, CURLINFO_EFFECTIVE_URL, &eff_url);
|
||||
fprintf(MSG_OUT, "DONE: %s => (%d) %s\n", eff_url, res, conn->error);
|
||||
curl_multi_remove_handle(g->multi, easy);
|
||||
free(conn->url);
|
||||
curl_easy_cleanup(easy);
|
||||
free(conn);
|
||||
}
|
||||
}
|
||||
} while ( easy );
|
||||
}
|
||||
g->prev_running = g->still_running;
|
||||
}
|
||||
|
||||
|
||||
/* Called by libevent when we get action on a multi socket */
|
||||
static void event_cb(EV_P_ struct ev_io *w, int revents)
|
||||
{
|
||||
DPRINT("%s w %p revents %i\n", __PRETTY_FUNCTION__, w, revents);
|
||||
GlobalInfo *g = (GlobalInfo*) w->data;
|
||||
CURLMcode rc;
|
||||
|
||||
int action = (revents&EV_READ?CURL_POLL_IN:0)|
|
||||
(revents&EV_WRITE?CURL_POLL_OUT:0);
|
||||
do
|
||||
{
|
||||
rc = curl_multi_socket_action(g->multi, w->fd, action, &g->still_running);
|
||||
} while ( rc == CURLM_CALL_MULTI_PERFORM );
|
||||
mcode_or_die("event_cb: curl_multi_socket", rc);
|
||||
check_run_count(g);
|
||||
if ( g->still_running <= 0 )
|
||||
{
|
||||
fprintf(MSG_OUT, "last transfer done, kill timeout\n");
|
||||
ev_timer_stop(g->loop, &g->timer_event);
|
||||
}
|
||||
}
|
||||
|
||||
/* Called by libevent when our timeout expires */
|
||||
static void timer_cb(EV_P_ struct ev_timer *w, int revents)
|
||||
{
|
||||
DPRINT("%s w %p revents %i\n", __PRETTY_FUNCTION__, w, revents);
|
||||
|
||||
GlobalInfo *g = (GlobalInfo *)w->data;
|
||||
CURLMcode rc;
|
||||
|
||||
do
|
||||
{
|
||||
rc = curl_multi_socket_action(g->multi, CURL_SOCKET_TIMEOUT, 0, &g->still_running);
|
||||
} while ( rc == CURLM_CALL_MULTI_PERFORM );
|
||||
mcode_or_die("timer_cb: curl_multi_socket", rc);
|
||||
check_run_count(g);
|
||||
}
|
||||
|
||||
/* Clean up the SockInfo structure */
|
||||
static void remsock(SockInfo *f, GlobalInfo *g)
|
||||
{
|
||||
printf("%s \n", __PRETTY_FUNCTION__);
|
||||
if ( f )
|
||||
{
|
||||
if ( f->evset )
|
||||
ev_io_stop(g->loop, &f->ev);
|
||||
free(f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Assign information to a SockInfo structure */
|
||||
static void setsock(SockInfo*f, curl_socket_t s, CURL*e, int act, GlobalInfo*g)
|
||||
{
|
||||
printf("%s \n", __PRETTY_FUNCTION__);
|
||||
|
||||
int kind = (act&CURL_POLL_IN?EV_READ:0)|(act&CURL_POLL_OUT?EV_WRITE:0);
|
||||
|
||||
f->sockfd = s;
|
||||
f->action = act;
|
||||
f->easy = e;
|
||||
if ( f->evset )
|
||||
ev_io_stop(g->loop, &f->ev);
|
||||
ev_io_init(&f->ev, event_cb, f->sockfd, kind);
|
||||
f->ev.data = g;
|
||||
f->evset=1;
|
||||
ev_io_start(g->loop, &f->ev);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Initialize a new SockInfo structure */
|
||||
static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g)
|
||||
{
|
||||
SockInfo *fdp = calloc(sizeof(SockInfo), 1);
|
||||
|
||||
fdp->global = g;
|
||||
setsock(fdp, s, easy, action, g);
|
||||
curl_multi_assign(g->multi, s, fdp);
|
||||
}
|
||||
|
||||
/* CURLMOPT_SOCKETFUNCTION */
|
||||
static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
|
||||
{
|
||||
DPRINT("%s e %p s %i what %i cbp %p sockp %p\n",
|
||||
__PRETTY_FUNCTION__, e, s, what, cbp, sockp);
|
||||
|
||||
GlobalInfo *g = (GlobalInfo*) cbp;
|
||||
SockInfo *fdp = (SockInfo*) sockp;
|
||||
const char *whatstr[]={ "none", "IN", "OUT", "INOUT", "REMOVE"};
|
||||
|
||||
fprintf(MSG_OUT,
|
||||
"socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]);
|
||||
if ( what == CURL_POLL_REMOVE )
|
||||
{
|
||||
fprintf(MSG_OUT, "\n");
|
||||
remsock(fdp, g);
|
||||
} else
|
||||
{
|
||||
if ( !fdp )
|
||||
{
|
||||
fprintf(MSG_OUT, "Adding data: %s\n", whatstr[what]);
|
||||
addsock(s, e, what, g);
|
||||
} else
|
||||
{
|
||||
fprintf(MSG_OUT,
|
||||
"Changing action from %s to %s\n",
|
||||
whatstr[fdp->action], whatstr[what]);
|
||||
setsock(fdp, s, e, what, g);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* CURLOPT_WRITEFUNCTION */
|
||||
static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data)
|
||||
{
|
||||
size_t realsize = size * nmemb;
|
||||
ConnInfo *conn = (ConnInfo*) data;
|
||||
(void)ptr;
|
||||
(void)conn;
|
||||
return realsize;
|
||||
}
|
||||
|
||||
|
||||
/* CURLOPT_PROGRESSFUNCTION */
|
||||
static int prog_cb (void *p, double dltotal, double dlnow, double ult,
|
||||
double uln)
|
||||
{
|
||||
ConnInfo *conn = (ConnInfo *)p;
|
||||
(void)ult;
|
||||
(void)uln;
|
||||
|
||||
fprintf(MSG_OUT, "Progress: %s (%g/%g)\n", conn->url, dlnow, dltotal);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Create a new easy handle, and add it to the global curl_multi */
|
||||
static void new_conn(char *url, GlobalInfo *g )
|
||||
{
|
||||
ConnInfo *conn;
|
||||
CURLMcode rc;
|
||||
|
||||
conn = calloc(1, sizeof(ConnInfo));
|
||||
memset(conn, 0, sizeof(ConnInfo));
|
||||
conn->error[0]='\0';
|
||||
|
||||
conn->easy = curl_easy_init();
|
||||
if ( !conn->easy )
|
||||
{
|
||||
fprintf(MSG_OUT, "curl_easy_init() failed, exiting!\n");
|
||||
exit(2);
|
||||
}
|
||||
conn->global = g;
|
||||
conn->url = strdup(url);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_URL, conn->url);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, &conn);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, 1L);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, 0L);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_PROGRESSFUNCTION, prog_cb);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_PROGRESSDATA, conn);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_TIME, 3L);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_LIMIT, 10L);
|
||||
|
||||
fprintf(MSG_OUT,
|
||||
"Adding easy %p to multi %p (%s)\n", conn->easy, g->multi, url);
|
||||
rc =curl_multi_add_handle(g->multi, conn->easy);
|
||||
mcode_or_die("new_conn: curl_multi_add_handle", rc);
|
||||
|
||||
mcode_or_die("new_conn: curl_multi_socket_all", rc);
|
||||
check_run_count(g);
|
||||
}
|
||||
|
||||
/* This gets called whenever data is received from the fifo */
|
||||
static void fifo_cb(EV_P_ struct ev_io *w, int revents)
|
||||
{
|
||||
char s[1024];
|
||||
long int rv=0;
|
||||
int n=0;
|
||||
GlobalInfo *g = (GlobalInfo *)w->data;
|
||||
|
||||
do
|
||||
{
|
||||
s[0]='\0';
|
||||
rv=fscanf(g->input, "%1023s%n", s, &n);
|
||||
s[n]='\0';
|
||||
if ( n && s[0] )
|
||||
{
|
||||
new_conn(s,g); /* if we read a URL, go get it! */
|
||||
} else break;
|
||||
} while ( rv != EOF );
|
||||
}
|
||||
|
||||
/* Create a named pipe and tell libevent to monitor it */
|
||||
static int init_fifo (GlobalInfo *g)
|
||||
{
|
||||
struct stat st;
|
||||
static const char *fifo = "hiper.fifo";
|
||||
int sockfd;
|
||||
|
||||
fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo);
|
||||
if ( lstat (fifo, &st) == 0 )
|
||||
{
|
||||
if ( (st.st_mode & S_IFMT) == S_IFREG )
|
||||
{
|
||||
errno = EEXIST;
|
||||
perror("lstat");
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
unlink(fifo);
|
||||
if ( mkfifo (fifo, 0600) == -1 )
|
||||
{
|
||||
perror("mkfifo");
|
||||
exit (1);
|
||||
}
|
||||
sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0);
|
||||
if ( sockfd == -1 )
|
||||
{
|
||||
perror("open");
|
||||
exit (1);
|
||||
}
|
||||
g->input = fdopen(sockfd, "r");
|
||||
|
||||
fprintf(MSG_OUT, "Now, pipe some URL's into > %s\n", fifo);
|
||||
ev_io_init(&g->fifo_event, fifo_cb, sockfd, EV_READ);
|
||||
ev_io_start(g->loop, &g->fifo_event);
|
||||
return(0);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GlobalInfo g;
|
||||
CURLMcode rc;
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
memset(&g, 0, sizeof(GlobalInfo));
|
||||
g.loop = ev_default_loop(0);
|
||||
|
||||
init_fifo(&g);
|
||||
g.multi = curl_multi_init();
|
||||
|
||||
ev_timer_init(&g.timer_event, timer_cb, 0., 0.);
|
||||
g.timer_event.data = &g;
|
||||
g.fifo_event.data = &g;
|
||||
curl_multi_setopt(g.multi, CURLMOPT_SOCKETFUNCTION, sock_cb);
|
||||
curl_multi_setopt(g.multi, CURLMOPT_SOCKETDATA, &g);
|
||||
curl_multi_setopt(g.multi, CURLMOPT_TIMERFUNCTION, multi_timer_cb);
|
||||
curl_multi_setopt(g.multi, CURLMOPT_TIMERDATA, &g);
|
||||
do
|
||||
{
|
||||
rc = curl_multi_socket_all(g.multi, &g.still_running);
|
||||
} while ( CURLM_CALL_MULTI_PERFORM == rc );
|
||||
|
||||
ev_loop(g.loop, 0);
|
||||
curl_multi_cleanup(g.multi);
|
||||
return 0;
|
||||
}
|
||||
@@ -27,7 +27,11 @@ int main(void)
|
||||
return 1; /* can't continue */
|
||||
}
|
||||
|
||||
stat("debugit", &file_info); /* to get the file size */
|
||||
/* to get the file size */
|
||||
if(fstat(fileno(fd), &file_info) != 0) {
|
||||
|
||||
return 1; /* can't continue */
|
||||
}
|
||||
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
|
||||
@@ -221,7 +221,7 @@ url_fopen(const char *url,const char *operation)
|
||||
URL_FILE *file;
|
||||
(void)operation;
|
||||
|
||||
file = (URL_FILE *)malloc(sizeof(URL_FILE));
|
||||
file = malloc(sizeof(URL_FILE));
|
||||
if(!file)
|
||||
return NULL;
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ struct MemoryStruct {
|
||||
size_t size;
|
||||
};
|
||||
|
||||
static void *myrealloc(void *ptr, size_t size);
|
||||
|
||||
static void *myrealloc(void *ptr, size_t size)
|
||||
{
|
||||
/* There might be a realloc() out there that doesn't like reallocing
|
||||
@@ -42,7 +44,7 @@ WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
|
||||
size_t realsize = size * nmemb;
|
||||
struct MemoryStruct *mem = (struct MemoryStruct *)data;
|
||||
|
||||
mem->memory = (char *)myrealloc(mem->memory, mem->size + realsize + 1);
|
||||
mem->memory = myrealloc(mem->memory, mem->size + realsize + 1);
|
||||
if (mem->memory) {
|
||||
memcpy(&(mem->memory[mem->size]), ptr, realsize);
|
||||
mem->size += realsize;
|
||||
|
||||
@@ -180,12 +180,17 @@ static void event_cb(int fd, short kind, void *userp)
|
||||
{
|
||||
GlobalInfo *g = (GlobalInfo*) userp;
|
||||
CURLMcode rc;
|
||||
(void)kind; /* unused */
|
||||
|
||||
int action =
|
||||
(kind&EV_READ?CURL_CSELECT_IN:0)|
|
||||
(kind&EV_WRITE?CURL_CSELECT_OUT:0);
|
||||
|
||||
do {
|
||||
rc = curl_multi_socket(g->multi, fd, &g->still_running);
|
||||
rc = curl_multi_socket_action(g->multi, fd, action, &g->still_running);
|
||||
} while (rc == CURLM_CALL_MULTI_PERFORM);
|
||||
mcode_or_die("event_cb: curl_multi_socket", rc);
|
||||
|
||||
mcode_or_die("event_cb: curl_multi_socket_action", rc);
|
||||
|
||||
check_run_count(g);
|
||||
if ( g->still_running <= 0 ) {
|
||||
fprintf(MSG_OUT, "last transfer done, kill timeout\n");
|
||||
@@ -206,9 +211,10 @@ static void timer_cb(int fd, short kind, void *userp)
|
||||
(void)kind;
|
||||
|
||||
do {
|
||||
rc = curl_multi_socket(g->multi, CURL_SOCKET_TIMEOUT, &g->still_running);
|
||||
rc = curl_multi_socket_action(g->multi,
|
||||
CURL_SOCKET_TIMEOUT, 0, &g->still_running);
|
||||
} while (rc == CURLM_CALL_MULTI_PERFORM);
|
||||
mcode_or_die("timer_cb: curl_multi_socket", rc);
|
||||
mcode_or_die("timer_cb: curl_multi_socket_action", rc);
|
||||
check_run_count(g);
|
||||
}
|
||||
|
||||
@@ -337,11 +343,9 @@ static void new_conn(char *url, GlobalInfo *g )
|
||||
"Adding easy %p to multi %p (%s)\n", conn->easy, g->multi, url);
|
||||
rc =curl_multi_add_handle(g->multi, conn->easy);
|
||||
mcode_or_die("new_conn: curl_multi_add_handle", rc);
|
||||
do {
|
||||
rc = curl_multi_socket_all(g->multi, &g->still_running);
|
||||
} while (CURLM_CALL_MULTI_PERFORM == rc);
|
||||
mcode_or_die("new_conn: curl_multi_socket_all", rc);
|
||||
check_run_count(g);
|
||||
|
||||
/* note that the add_handle() will set a time-out to trigger very soon so
|
||||
that the necessary socket_action() call will be called by this app */
|
||||
}
|
||||
|
||||
/* This gets called whenever data is received from the fifo */
|
||||
@@ -400,7 +404,6 @@ static int init_fifo (GlobalInfo *g)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GlobalInfo g;
|
||||
CURLMcode rc;
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
@@ -409,13 +412,16 @@ int main(int argc, char **argv)
|
||||
init_fifo(&g);
|
||||
g.multi = curl_multi_init();
|
||||
evtimer_set(&g.timer_event, timer_cb, &g);
|
||||
|
||||
/* setup the generic multi interface options we want */
|
||||
curl_multi_setopt(g.multi, CURLMOPT_SOCKETFUNCTION, sock_cb);
|
||||
curl_multi_setopt(g.multi, CURLMOPT_SOCKETDATA, &g);
|
||||
curl_multi_setopt(g.multi, CURLMOPT_TIMERFUNCTION, multi_timer_cb);
|
||||
curl_multi_setopt(g.multi, CURLMOPT_TIMERDATA, &g);
|
||||
do {
|
||||
rc = curl_multi_socket_all(g.multi, &g.still_running);
|
||||
} while (CURLM_CALL_MULTI_PERFORM == rc);
|
||||
|
||||
/* we don't call any curl_multi_socket*() function yet as we have no handles
|
||||
added! */
|
||||
|
||||
event_dispatch();
|
||||
curl_multi_cleanup(g.multi);
|
||||
return 0;
|
||||
|
||||
@@ -21,6 +21,7 @@ int main(void)
|
||||
struct curl_slist *chunk = NULL;
|
||||
|
||||
chunk = curl_slist_append(chunk, "Accept: moo");
|
||||
chunk = curl_slist_append(chunk, "Another: yes");
|
||||
|
||||
/* request with the built-in Accept: */
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "localhost");
|
||||
|
||||
@@ -56,7 +56,7 @@ int thread_setup(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
mutex_buf = (MUTEX_TYPE *)malloc(CRYPTO_num_locks( ) * sizeof(MUTEX_TYPE));
|
||||
mutex_buf = malloc(CRYPTO_num_locks( ) * sizeof(MUTEX_TYPE));
|
||||
if (!mutex_buf)
|
||||
return 0;
|
||||
for (i = 0; i < CRYPTO_num_locks( ); i++)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
.\" * $Id$
|
||||
.\" **************************************************************************
|
||||
.\"
|
||||
.TH curl_easy_getinfo 3 "21 Mar 2006" "libcurl 7.15.4" "libcurl Manual"
|
||||
.TH curl_easy_getinfo 3 "16 Oct 2008" "libcurl 7.19.1" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_easy_getinfo - extract information from a curl handle
|
||||
.SH SYNOPSIS
|
||||
@@ -190,6 +190,16 @@ Pass a pointer to a 'char *' to receive a pointer to a string holding the path
|
||||
of the entry path. That is the initial path libcurl ended up in when logging
|
||||
on to the remote FTP server. This stores a NULL as pointer if something is
|
||||
wrong. (Added in 7.15.4)
|
||||
.IP CURLINFO_CERTINFO
|
||||
Pass a pointer to a 'struct curl_certinfo *' and you'll get it set to point to
|
||||
struct that holds a number of linked lists with info about the certificate
|
||||
chain, assuming you had CURLOPT_CERTINFO enabled when the previous request was
|
||||
done. The struct reports how many certs it found and then you can extract info
|
||||
for each of those certs by following the linked lists. The info chain is
|
||||
provided in a series of data in the format "name:content" where the content is
|
||||
for the specific named data. See also the certinfo.c example. NOTE: this
|
||||
option is only available in libcurl built with OpenSSL support. (Added in
|
||||
7.19.1)
|
||||
.SH TIMES
|
||||
.NF
|
||||
An overview of the six time values available from curl_easy_getinfo()
|
||||
|
||||
@@ -12,7 +12,7 @@ curl_easy_pause - pause and unpause a connection
|
||||
Using this function, you can explicitly mark a running connection to get
|
||||
paused, and you can unpause a connection that was previously paused.
|
||||
|
||||
A connection can made to pause by using this function or by letting the read
|
||||
A connection can be paused by using this function or by letting the read
|
||||
or the write callbacks return the proper magic return code
|
||||
(\fICURL_READFUNC_PAUSE\fP and \fICURL_WRITEFUNC_PAUSE\fP). A write callback
|
||||
that returns pause signals to the library that it couldn't take care of any
|
||||
@@ -31,7 +31,7 @@ the connection you want to pause or unpause.
|
||||
The \fBbitmask\fP argument is a set of bits that sets the new state of the
|
||||
connection. The following bits can be used:
|
||||
.IP CURLPAUSE_RECV
|
||||
Pause receiving data. There will be no data received on this conneciton until
|
||||
Pause receiving data. There will be no data received on this connection until
|
||||
this function is called again without this bit set. Thus, the write callback
|
||||
(\fICURLOPT_WRITEFUNCTION\fP) won't be called.
|
||||
.IP CURLPAUSE_SEND
|
||||
@@ -56,7 +56,7 @@ it in an allocated buffer until the reading is again unpaused using this
|
||||
function.
|
||||
|
||||
If the downloaded data is compressed and is asked to get uncompressed
|
||||
automatially on download, libcurl will continue to uncompress the entire
|
||||
automatically on download, libcurl will continue to uncompress the entire
|
||||
downloaded chunk and it will cache the data uncompressed. This has the side-
|
||||
effect that if you download something that is compressed a lot, it can result
|
||||
in a very large data amount needing to be allocated to save the data during
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
.\" * $Id$
|
||||
.\" **************************************************************************
|
||||
.\"
|
||||
.TH curl_easy_setopt 3 "30 Jul 2008" "libcurl 7.19.0" "libcurl Manual"
|
||||
.TH curl_easy_setopt 3 "11 Dec 2008" "libcurl 7.19.3" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_easy_setopt \- set options for a curl easy handle
|
||||
.SH SYNOPSIS
|
||||
@@ -72,7 +72,7 @@ preceding the data (like HTTP).
|
||||
A parameter set to 1 tells the library to shut off the built-in progress meter
|
||||
completely.
|
||||
|
||||
Future versions of libcurl is likely to not have any built-in progress meter
|
||||
Future versions of libcurl are likely to not have any built-in progress meter
|
||||
at all.
|
||||
.IP CURLOPT_NOSIGNAL
|
||||
Pass a long. If it is 1, libcurl will not use any functions that
|
||||
@@ -81,8 +81,10 @@ process. This option is mainly here to allow multi-threaded unix applications
|
||||
to still set/use all timeout options etc, without risking getting signals.
|
||||
(Added in 7.10)
|
||||
|
||||
Consider building libcurl with ares support to enable asynchronous DNS
|
||||
lookups. It enables nice timeouts for name resolves without signals.
|
||||
If this option is set and libcurl has been built with the standard name
|
||||
resolver, timeouts will not occur while the name resolve takes place.
|
||||
Consider building libcurl with c-ares support to enable asynchronous DNS
|
||||
lookups, which enables nice timeouts for name resolves without signals.
|
||||
.PP
|
||||
.SH CALLBACK OPTIONS
|
||||
.IP CURLOPT_WRITEFUNCTION
|
||||
@@ -99,7 +101,7 @@ From 7.18.0, the function can return CURL_WRITEFUNC_PAUSE which then will
|
||||
cause writing to this connection to become paused. See
|
||||
\fIcurl_easy_pause(3)\fP for further details.
|
||||
|
||||
This function may be called with zero bytes data if the transfered file is
|
||||
This function may be called with zero bytes data if the transferred file is
|
||||
empty.
|
||||
|
||||
Set this option to NULL to get the internal default function. The internal
|
||||
@@ -138,7 +140,7 @@ that memory area. Returning 0 will signal end-of-file to the library and cause
|
||||
it to stop the current transfer.
|
||||
|
||||
If you stop the current transfer by returning 0 "pre-maturely" (i.e before the
|
||||
server expected it, like when you've told you will upload N bytes and you
|
||||
server expected it, like when you've said you will upload N bytes and you
|
||||
upload less than N bytes), you may experience that the server "hangs" waiting
|
||||
for the rest of the data that won't come.
|
||||
|
||||
@@ -150,7 +152,7 @@ From 7.18.0, the function can return CURL_READFUNC_PAUSE which then will cause
|
||||
reading from this connection to become paused. See \fIcurl_easy_pause(3)\fP
|
||||
for further details.
|
||||
|
||||
If you set the callback pointer to NULL, or doesn't set it at all, the default
|
||||
If you set the callback pointer to NULL, or don't set it at all, the default
|
||||
internal read function will be used. It is simply doing an fread() on the FILE
|
||||
* stream set with \fICURLOPT_READDATA\fP.
|
||||
.IP CURLOPT_READDATA
|
||||
@@ -162,7 +164,7 @@ read function, this data must be a valid readable FILE *.
|
||||
If you're using libcurl as a win32 DLL, you MUST use a
|
||||
\fICURLOPT_READFUNCTION\fP if you set this option.
|
||||
|
||||
This option is also known with the older name \fICURLOPT_INFILE\fP, the name
|
||||
This option was also known by the older name \fICURLOPT_INFILE\fP, the name
|
||||
\fICURLOPT_READDATA\fP was introduced in 7.9.7.
|
||||
.IP CURLOPT_IOCTLFUNCTION
|
||||
Function pointer that should match the \fIcurl_ioctl_callback\fP prototype
|
||||
@@ -334,7 +336,7 @@ This function will get called on all new connections made to a server, during
|
||||
the SSL negotiation. The SSL_CTX pointer will be a new one every time.
|
||||
|
||||
To use this properly, a non-trivial amount of knowledge of the openssl
|
||||
libraries is necessary. Using this function allows for example to use openssl
|
||||
libraries is necessary. For example, using this function allows you to use openssl
|
||||
callbacks to add additional validation code for certificates, and even to
|
||||
change the actual URI of an HTTPS request (example used in the lib509 test
|
||||
case). See also the example section for a replacement of the key, certificate
|
||||
@@ -419,7 +421,7 @@ response codes will slip through, especially when authentication is involved
|
||||
(response codes 401 and 407).
|
||||
|
||||
You might get some amounts of headers transferred before this situation is
|
||||
detected, like for when a "100-continue" is received as a response to a
|
||||
detected, like when a "100-continue" is received as a response to a
|
||||
POST/PUT and a 401 or 407 is received immediately afterwards.
|
||||
.SH NETWORK OPTIONS
|
||||
.IP CURLOPT_URL
|
||||
@@ -431,9 +433,9 @@ attempt to guess which protocol to use based on the given host name. If the
|
||||
given protocol of the set URL is not supported, libcurl will return on error
|
||||
(\fICURLE_UNSUPPORTED_PROTOCOL\fP) when you call \fIcurl_easy_perform(3)\fP or
|
||||
\fIcurl_multi_perform(3)\fP. Use \fIcurl_version_info(3)\fP for detailed info
|
||||
on which protocols that are supported.
|
||||
on which protocols are supported.
|
||||
|
||||
The string given to CURLOPT_URL must be url-encoded and following the RFC 2396
|
||||
The string given to CURLOPT_URL must be url-encoded and follow RFC 2396
|
||||
(http://curl.haxx.se/rfc/rfc2396.txt).
|
||||
|
||||
\fICURLOPT_URL\fP is the only option that \fBmust\fP be set before
|
||||
@@ -454,7 +456,7 @@ tunnel through the HTTP proxy. Such tunneling is activated with
|
||||
\fICURLOPT_HTTPPROXYTUNNEL\fP.
|
||||
|
||||
libcurl respects the environment variables \fBhttp_proxy\fP, \fBftp_proxy\fP,
|
||||
\fBall_proxy\fP etc, if any of those is set. The \fICURLOPT_PROXY\fP option
|
||||
\fBall_proxy\fP etc, if any of those are set. The \fICURLOPT_PROXY\fP option
|
||||
does however override any possibly set environment variables.
|
||||
|
||||
Setting the proxy string to "" (an empty string) will explicitly disable the
|
||||
@@ -477,23 +479,17 @@ Set the parameter to 1 to make the library tunnel all operations through a
|
||||
given HTTP proxy. There is a big difference between using a proxy and to
|
||||
tunnel through it. If you don't know what this means, you probably don't want
|
||||
this tunneling option.
|
||||
.IP CURLOPT_SOCKS5_RESOLVE_LOCAL
|
||||
Set the parameter to 1 to make the library to resolve the host name locally
|
||||
instead of passing it to the proxy to resolve, when using a SOCKS5 proxy.
|
||||
|
||||
Note that libcurl before 7.18.0 always resolved the host name locally even
|
||||
when SOCKS5 was used. (Added in 7.18.0)
|
||||
.IP CURLOPT_INTERFACE
|
||||
Pass a char * as parameter. This set the interface name to use as outgoing
|
||||
network interface. The name can be an interface name, an IP address or a host
|
||||
Pass a char * as parameter. This sets the interface name to use as outgoing
|
||||
network interface. The name can be an interface name, an IP address, or a host
|
||||
name.
|
||||
.IP CURLOPT_LOCALPORT
|
||||
Pass a long. This sets the local port number of the socket used for
|
||||
connection. This can be used in combination with \fICURLOPT_INTERFACE\fP and
|
||||
you are recommended to use \fICURLOPT_LOCALPORTRANGE\fP as well when this is
|
||||
set. Note that port numbers are only valid 1 - 65535. (Added in 7.15.2)
|
||||
set. Note that the only valid port numbers are 1 - 65535. (Added in 7.15.2)
|
||||
.IP CURLOPT_LOCALPORTRANGE
|
||||
Pass a long. This is the number of attempts libcurl should do to find a
|
||||
Pass a long. This is the number of attempts libcurl should make to find a
|
||||
working local port number. It starts with the given \fICURLOPT_LOCALPORT\fP
|
||||
and adds one to the number for each retry. Setting this to 1 or below will
|
||||
make libcurl do only one try for the exact port number. Note that port numbers
|
||||
@@ -507,8 +503,8 @@ caching, or set to -1 to make the cached entries remain forever. By default,
|
||||
libcurl caches this info for 60 seconds.
|
||||
|
||||
NOTE: the name resolve functions of various libc implementations don't re-read
|
||||
name server information unless explicitly told so (by for example calling
|
||||
\fIres_init(3)\fP. This may cause libcurl to keep using the older server even
|
||||
name server information unless explicitly told so (for example, by calling
|
||||
\fIres_init(3)\fP). This may cause libcurl to keep using the older server even
|
||||
if DHCP has updated the server info, and this may look like a DNS cache issue
|
||||
to the casual libcurl-app user.
|
||||
.IP CURLOPT_DNS_USE_GLOBAL_CACHE
|
||||
@@ -564,8 +560,8 @@ Pass a long, set to one of the values described below.
|
||||
.RS
|
||||
.IP CURL_NETRC_OPTIONAL
|
||||
The use of your \fI~/.netrc\fP file is optional, and information in the URL is
|
||||
to be preferred. The file will be scanned with the host and user name (to
|
||||
find the password only) or with the host only, to find the first user name and
|
||||
to be preferred. The file will be scanned for the host and user name (to
|
||||
find the password only) or for the host only, to find the first user name and
|
||||
password after that \fImachine\fP, which ever information is not specified in
|
||||
the URL.
|
||||
|
||||
@@ -576,7 +572,7 @@ The library will ignore the file and use only the information in the URL.
|
||||
This is the default.
|
||||
.IP CURL_NETRC_REQUIRED
|
||||
This value tells the library that use of the file is required, to ignore the
|
||||
information in the URL, and to search the file with the host only.
|
||||
information in the URL, and to search the file for the host only.
|
||||
.RE
|
||||
Only machine name, user name and password are taken into account
|
||||
(init macros and similar things aren't supported).
|
||||
@@ -590,9 +586,9 @@ option is omitted, and \fICURLOPT_NETRC\fP is set, libcurl will attempt to
|
||||
find a .netrc file in the current user's home directory. (Added in 7.10.9)
|
||||
.IP CURLOPT_USERPWD
|
||||
Pass a char * as parameter, which should be [user name]:[password] to use for
|
||||
the connection. Use \fICURLOPT_HTTPAUTH\fP to decide authentication method.
|
||||
the connection. Use \fICURLOPT_HTTPAUTH\fP to decide the authentication method.
|
||||
|
||||
When using NTLM, you can set domain by prepending it to the user name and
|
||||
When using NTLM, you can set the domain by prepending it to the user name and
|
||||
separating the domain and name with a forward (/) or backward slash (\\). Like
|
||||
this: "domain/user:password" or "domain\\user:password". Some HTTP servers (on
|
||||
Windows) support this style even for Basic authentication.
|
||||
@@ -606,30 +602,74 @@ to prevent accidental information leakage.
|
||||
.IP CURLOPT_PROXYUSERPWD
|
||||
Pass a char * as parameter, which should be [user name]:[password] to use for
|
||||
the connection to the HTTP proxy. Use \fICURLOPT_PROXYAUTH\fP to decide
|
||||
authentication method.
|
||||
the authentication method.
|
||||
.IP CURLOPT_USERNAME
|
||||
Pass a char * as parameter, which should be pointing to the zero terminated
|
||||
user name to use for the transfer.
|
||||
|
||||
\fBCURLOPT_USERNAME\fP sets the user name to be used in protocol
|
||||
authentication. You should not use this option together with the (older)
|
||||
CURLOPT_USERPWD option.
|
||||
|
||||
In order to specify the password to be used in conjunction with the user name
|
||||
use the \fICURLOPT_PASSWORD\fP option. (Added in 7.19.1)
|
||||
.IP CURLOPT_PASSWORD
|
||||
Pass a char * as parameter, which should be pointing to the zero terminated
|
||||
password to use for the transfer.
|
||||
|
||||
The CURLOPT_PASSWORD option should be used in conjunction with
|
||||
the \fICURLOPT_USERNAME\fP option. (Added in 7.19.1)
|
||||
.IP CURLOPT_PROXYUSERNAME
|
||||
Pass a char * as parameter, which should be pointing to the zero terminated
|
||||
user name to use for the transfer while connecting to Proxy.
|
||||
|
||||
The CURLOPT_PROXYUSERNAME option should be used in same way as the
|
||||
\fICURLOPT_PROXYUSERPWD\fP is used. In comparison to \fICURLOPT_PROXYUSERPWD\fP
|
||||
the CURLOPT_PROXYUSERNAME allows the username to contain a colon,
|
||||
like in the following example: "sip:user@example.com".
|
||||
Note the CURLOPT_PROXYUSERNAME option is an alternative way to set the user name
|
||||
while connecting to Proxy. There is no meaning to use it together
|
||||
with the \fICURLOPT_PROXYUSERPWD\fP option.
|
||||
|
||||
In order to specify the password to be used in conjunction with the user name
|
||||
use the \fICURLOPT_PROXYPASSWORD\fP option. (Added in 7.19.1)
|
||||
.IP CURLOPT_PROXYPASSWORD
|
||||
Pass a char * as parameter, which should be pointing to the zero terminated
|
||||
password to use for the transfer while connecting to Proxy.
|
||||
|
||||
The CURLOPT_PROXYPASSWORD option should be used in conjunction with
|
||||
the \fICURLOPT_PROXYUSERNAME\fP option. (Added in 7.19.1)
|
||||
.IP CURLOPT_HTTPAUTH
|
||||
Pass a long as parameter, which is set to a bitmask, to tell libcurl what
|
||||
Pass a long as parameter, which is set to a bitmask, to tell libcurl which
|
||||
authentication method(s) you want it to use. The available bits are listed
|
||||
below. If more than one bit is set, libcurl will first query the site to see
|
||||
what authentication methods it supports and then pick the best one you allow
|
||||
which authentication methods it supports and then pick the best one you allow
|
||||
it to use. For some methods, this will induce an extra network round-trip. Set
|
||||
the actual name and password with the \fICURLOPT_USERPWD\fP option. (Added in
|
||||
7.10.6)
|
||||
the actual name and password with the \fICURLOPT_USERPWD\fP option or
|
||||
with the \fICURLOPT_USERNAME\fP and the \fICURLOPT_USERPASSWORD\fP options.
|
||||
(Added in 7.10.6)
|
||||
.RS
|
||||
.IP CURLAUTH_BASIC
|
||||
HTTP Basic authentication. This is the default choice, and the only method
|
||||
that is in wide-spread use and supported virtually everywhere. This is sending
|
||||
that is in wide-spread use and supported virtually everywhere. This sends
|
||||
the user name and password over the network in plain text, easily captured by
|
||||
others.
|
||||
.IP CURLAUTH_DIGEST
|
||||
HTTP Digest authentication. Digest authentication is defined in RFC2617 and
|
||||
is a more secure way to do authentication over public networks than the
|
||||
regular old-fashioned Basic method.
|
||||
.IP CURLAUTH_DIGEST_IE
|
||||
HTTP Digest authentication with an IE flavor. Digest authentication is
|
||||
defined in RFC2617 and is a more secure way to do authentication over public
|
||||
networks than the regular old-fashioned Basic method. The IE flavor is simply
|
||||
that libcurl will use a special "quirk" that IE is known to have used before
|
||||
version 7 and that some servers require the client to use. (This define was
|
||||
added in 7.19.3)
|
||||
.IP CURLAUTH_GSSNEGOTIATE
|
||||
HTTP GSS-Negotiate authentication. The GSS-Negotiate (also known as plain
|
||||
\&"Negotiate") method was designed by Microsoft and is used in their web
|
||||
applications. It is primarily meant as a support for Kerberos5 authentication
|
||||
but may be also used along with another authentication methods. For more
|
||||
but may also be used along with other authentication methods. For more
|
||||
information see IETF draft draft-brezak-spnego-http-04.txt.
|
||||
|
||||
You need to build libcurl with a suitable GSS-API library for this to work.
|
||||
@@ -650,7 +690,7 @@ libcurl pick any it finds suitable. libcurl will automatically select the one it
|
||||
finds most secure.
|
||||
.RE
|
||||
.IP CURLOPT_PROXYAUTH
|
||||
Pass a long as parameter, which is set to a bitmask, to tell libcurl what
|
||||
Pass a long as parameter, which is set to a bitmask, to tell libcurl which
|
||||
authentication method(s) you want it to use for your proxy authentication. If
|
||||
more than one bit is set, libcurl will first query the site to see what
|
||||
authentication methods it supports and then pick the best one you allow it to
|
||||
@@ -695,13 +735,21 @@ redirections have been followed, the next redirect will cause an error
|
||||
\fICURLOPT_FOLLOWLOCATION\fP is used at the same time. Added in 7.15.1:
|
||||
Setting the limit to 0 will make libcurl refuse any redirect. Set it to -1 for
|
||||
an infinite number of redirects (which is the default)
|
||||
.IP CURLOPT_POST301
|
||||
A parameter set to 1 tells the library to respect RFC 2616/10.3.2 and not
|
||||
convert POST requests into GET requests when following a 301 redirection. The
|
||||
non-RFC behaviour is ubiquitous in web browsers, so the library does the
|
||||
conversion by default to maintain consistency. However, a server may requires
|
||||
a POST to remain a POST after such a redirection. This option is meaningful
|
||||
only when setting \fICURLOPT_FOLLOWLOCATION\fP. (Added in 7.17.1)
|
||||
.IP CURLOPT_POSTREDIR
|
||||
Pass a bitmask to control how libcurl acts on redirects after POSTs that get a
|
||||
301 or 302 response back. A parameter with bit 0 set (value
|
||||
\fBCURL_REDIR_POST_301\fP) tells the library to respect RFC 2616/10.3.2 and
|
||||
not convert POST requests into GET requests when following a 301
|
||||
redirection. Setting bit 1 (value CURL_REDIR_POST_302) makes libcurl maintain
|
||||
the request method after a 302 redirect. CURL_REDIR_POST_ALL is a convenience
|
||||
define that sets both bits.
|
||||
|
||||
The non-RFC behaviour is ubiquitous in web browsers, so the library does the
|
||||
conversion by default to maintain consistency. However, a server may require a
|
||||
POST to remain a POST after such a redirection. This option is meaningful only
|
||||
when setting \fICURLOPT_FOLLOWLOCATION\fP. (Added in 7.17.1) (This option was
|
||||
known as CURLOPT_POST301 up to 7.19.0 as it only supported the 301 way before
|
||||
then)
|
||||
.IP CURLOPT_PUT
|
||||
A parameter set to 1 tells the library to use HTTP PUT to transfer data. The
|
||||
data should be set with \fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE\fP.
|
||||
@@ -799,7 +847,7 @@ copy. In any case, the size must not be changed after
|
||||
.IP CURLOPT_HTTPPOST
|
||||
Tells libcurl you want a multipart/formdata HTTP POST to be made and you
|
||||
instruct what data to pass on to the server. Pass a pointer to a linked list
|
||||
of curl_httppost structs as parameter. . The easiest way to create such a
|
||||
of curl_httppost structs as parameter. The easiest way to create such a
|
||||
list, is to use \fIcurl_formadd(3)\fP as documented. The data in this list
|
||||
must remain intact until you close this curl handle again with
|
||||
\fIcurl_easy_cleanup(3)\fP.
|
||||
@@ -826,10 +874,10 @@ curl_slist\fP structs properly filled in. Use \fIcurl_slist_append(3)\fP to
|
||||
create the list and \fIcurl_slist_free_all(3)\fP to clean up an entire
|
||||
list. If you add a header that is otherwise generated and used by libcurl
|
||||
internally, your added one will be used instead. If you add a header with no
|
||||
contents as in 'Accept:' (no data on the right side of the colon), the
|
||||
content as in 'Accept:' (no data on the right side of the colon), the
|
||||
internally used header will get disabled. Thus, using this option you can add
|
||||
new headers, replace internal headers and remove internal headers. To add a
|
||||
header with no contents, make the contents be two quotes: \&"". The headers
|
||||
header with no content, make the content be two quotes: \&"". The headers
|
||||
included in the linked list must not be CRLF-terminated, because curl adds
|
||||
CRLF after each header item. Failure to comply with this will result in
|
||||
strange bugs because the server will most likely ignore part of the headers
|
||||
@@ -883,7 +931,7 @@ dumped to a file.
|
||||
|
||||
Given an empty or non-existing file or by passing the empty string (""), this
|
||||
option will enable cookies for this curl handle, making it understand and
|
||||
parse received cookies and then use matching cookies in future request.
|
||||
parse received cookies and then use matching cookies in future requests.
|
||||
|
||||
If you use this option multiple times, you just add more files to read.
|
||||
Subsequent files will add more cookies.
|
||||
@@ -904,7 +952,7 @@ about this possibly lethal situation.
|
||||
Pass a long set to 1 to mark this as a new cookie "session". It will force
|
||||
libcurl to ignore all cookies it is about to load that are "session cookies"
|
||||
from the previous session. By default, libcurl always stores and loads all
|
||||
cookies, independent if they are session cookies are not. Session cookies are
|
||||
cookies, independent if they are session cookies or not. Session cookies are
|
||||
cookies without expiry date and they are meant to be alive and existing for
|
||||
this "session" only.
|
||||
.IP CURLOPT_COOKIELIST
|
||||
@@ -918,7 +966,7 @@ all cookies known by cURL to the file specified by \fICURLOPT_COOKIEJAR\fP.
|
||||
(Added in 7.17.1)
|
||||
.IP CURLOPT_HTTPGET
|
||||
Pass a long. If the long is 1, this forces the HTTP request to get back
|
||||
to GET. usable if a POST, HEAD, PUT or a custom request have been used
|
||||
to GET. Usable if a POST, HEAD, PUT, or a custom request has been used
|
||||
previously using the same curl handle.
|
||||
|
||||
When setting \fICURLOPT_HTTPGET\fP to 1, it will automatically set
|
||||
@@ -955,17 +1003,17 @@ option is set to zero. (added in 7.16.2)
|
||||
.SH FTP OPTIONS
|
||||
.IP CURLOPT_FTPPORT
|
||||
Pass a pointer to a zero terminated string as parameter. It will be used to
|
||||
get the IP address to use for the ftp PORT instruction. The PORT instruction
|
||||
get the IP address to use for the FTP PORT instruction. The PORT instruction
|
||||
tells the remote server to connect to our specified IP address. The string may
|
||||
be a plain IP address, a host name, an network interface name (under Unix) or
|
||||
just a '-' letter to let the library use your systems default IP
|
||||
be a plain IP address, a host name, a network interface name (under Unix) or
|
||||
just a '-' symbol to let the library use your system's default IP
|
||||
address. Default FTP operations are passive, and thus won't use PORT.
|
||||
|
||||
You disable PORT again and go back to using the passive version by setting
|
||||
this option to NULL.
|
||||
.IP CURLOPT_QUOTE
|
||||
Pass a pointer to a linked list of FTP or SFTP commands to pass to
|
||||
the server prior to your ftp request. This will be done before any
|
||||
the server prior to your FTP request. This will be done before any
|
||||
other commands are issued (even before the CWD command for FTP). The
|
||||
linked list should be a fully valid list of 'struct curl_slist' structs
|
||||
properly filled in with text strings. Use \fIcurl_slist_append(3)\fP
|
||||
@@ -980,7 +1028,7 @@ rename, rm, rmdir, symlink (see
|
||||
(SFTP support added in 7.16.3)
|
||||
.IP CURLOPT_POSTQUOTE
|
||||
Pass a pointer to a linked list of FTP or SFTP commands to pass to the
|
||||
server after your ftp transfer request. The linked list should be a
|
||||
server after your FTP transfer request. The linked list should be a
|
||||
fully valid list of struct curl_slist structs properly filled in as
|
||||
described for \fICURLOPT_QUOTE\fP. Disable this operation again by
|
||||
setting a NULL to this option.
|
||||
@@ -1003,7 +1051,7 @@ might not include subdirectories and symbolic links.
|
||||
(This option was known as CURLOPT_FTPLISTONLY up to 7.16.4)
|
||||
.IP CURLOPT_APPEND
|
||||
A parameter set to 1 tells the library to append to the remote file instead of
|
||||
overwrite it. This is only useful when uploading to an ftp site.
|
||||
overwrite it. This is only useful when uploading to an FTP site.
|
||||
|
||||
(This option was known as CURLOPT_FTPAPPEND up to 7.16.4)
|
||||
.IP CURLOPT_FTP_USE_EPRT
|
||||
@@ -1054,7 +1102,7 @@ from the 227-response. (Added in 7.14.2)
|
||||
This option has no effect if PORT, EPRT or EPSV is used instead of PASV.
|
||||
.IP CURLOPT_USE_SSL
|
||||
Pass a long using one of the values from below, to make libcurl use your
|
||||
desired level of SSL for the ftp transfer. (Added in 7.11.0)
|
||||
desired level of SSL for the FTP transfer. (Added in 7.11.0)
|
||||
|
||||
(This option was known as CURLOPT_FTP_SSL up to 7.16.4, and the constants
|
||||
were known as CURLFTPSSL_*)
|
||||
@@ -1071,14 +1119,14 @@ Require SSL for all communication or fail with \fICURLE_USE_SSL_FAILED\fP.
|
||||
.IP CURLOPT_FTPSSLAUTH
|
||||
Pass a long using one of the values from below, to alter how libcurl issues
|
||||
\&"AUTH TLS" or "AUTH SSL" when FTP over SSL is activated (see
|
||||
\fICURLOPT_FTP_SSL\fP). (Added in 7.12.2)
|
||||
\fICURLOPT_USE_SSL\fP). (Added in 7.12.2)
|
||||
.RS
|
||||
.IP CURLFTPAUTH_DEFAULT
|
||||
Allow libcurl to decide
|
||||
Allow libcurl to decide.
|
||||
.IP CURLFTPAUTH_SSL
|
||||
Try "AUTH SSL" first, and only if that fails try "AUTH TLS"
|
||||
Try "AUTH SSL" first, and only if that fails try "AUTH TLS".
|
||||
.IP CURLFTPAUTH_TLS
|
||||
Try "AUTH TLS" first, and only if that fails try "AUTH SSL"
|
||||
Try "AUTH TLS" first, and only if that fails try "AUTH SSL".
|
||||
.RE
|
||||
.IP CURLOPT_FTP_SSL_CCC
|
||||
If enabled, this option makes libcurl use CCC (Clear Command Channel). It
|
||||
@@ -1106,7 +1154,7 @@ argument should be one of the following alternatives:
|
||||
.RS
|
||||
.IP CURLFTPMETHOD_MULTICWD
|
||||
libcurl does a single CWD operation for each path part in the given URL. For
|
||||
deep hierarchies this means very many commands. This is how RFC1738 says it
|
||||
deep hierarchies this means many commands. This is how RFC1738 says it
|
||||
should be done. This is the default but the slowest behavior.
|
||||
.IP CURLFTPMETHOD_NOCWD
|
||||
libcurl does no CWD at all. libcurl will do SIZE, RETR, STOR etc and give a
|
||||
@@ -1118,7 +1166,7 @@ compliant than 'nocwd' but without the full penalty of 'multicwd'.
|
||||
.RE
|
||||
.SH PROTOCOL OPTIONS
|
||||
.IP CURLOPT_TRANSFERTEXT
|
||||
A parameter set to 1 tells the library to use ASCII mode for ftp transfers,
|
||||
A parameter set to 1 tells the library to use ASCII mode for FTP transfers,
|
||||
instead of the default binary transfer. For win32 systems it does not set the
|
||||
stdout to binary mode. This option can be usable when transferring text data
|
||||
between systems with different views on certain characters, such as newlines
|
||||
@@ -1126,7 +1174,7 @@ or similar.
|
||||
|
||||
libcurl does not do a complete ASCII conversion when doing ASCII transfers
|
||||
over FTP. This is a known limitation/flaw that nobody has rectified. libcurl
|
||||
simply sets the mode to ascii and performs a standard transfer.
|
||||
simply sets the mode to ASCII and performs a standard transfer.
|
||||
.IP CURLOPT_PROXY_TRANSFER_MODE
|
||||
Pass a long. If the value is set to 1 (one), it tells libcurl to set the
|
||||
transfer mode (binary or ASCII) for FTP transfers done via an HTTP proxy, by
|
||||
@@ -1157,16 +1205,21 @@ you want the transfer to start from. (Added in 7.11.0)
|
||||
.IP CURLOPT_CUSTOMREQUEST
|
||||
Pass a pointer to a zero terminated string as parameter. It will be used
|
||||
instead of GET or HEAD when doing an HTTP request, or instead of LIST or NLST
|
||||
when doing an ftp directory listing. This is useful for doing DELETE or other
|
||||
when doing a FTP directory listing. This is useful for doing DELETE or other
|
||||
more or less obscure HTTP requests. Don't do this at will, make sure your
|
||||
server supports the command first.
|
||||
|
||||
Note that libcurl will still act and assume the keyword it would use if you
|
||||
didn't set your custom one is the one in use and it will act according to
|
||||
that. Thus, changing this to a HEAD when libcurl otherwise would do a GET
|
||||
might cause libcurl to act funny, and similar. To switch to a proper HEAD, use
|
||||
\fICURLOPT_NOBODY\fP, to switch to a proper POST, use \fICURLOPT_POST\fP or
|
||||
\fICURLOPT_POSTFIELDS\fP and so on.
|
||||
When you change the request method by setting \fBCURLOPT_CUSTOMREQUEST\fP to
|
||||
something, you don't actually change how libcurl behaves or acts in regards to
|
||||
the particular request method, it will only change the actual string sent in
|
||||
the request.
|
||||
|
||||
For example: if you tell libcurl to do a HEAD request, but then change the
|
||||
request to a "GET" with \fBCURLOPT_CUSTOMREQUEST\fP you'll still see libcurl
|
||||
act as if it sent a HEAD even when it does send a GET.
|
||||
|
||||
To switch to a proper HEAD, use \fICURLOPT_NOBODY\fP, to switch to a proper
|
||||
POST, use \fICURLOPT_POST\fP or \fICURLOPT_POSTFIELDS\fP and so on.
|
||||
|
||||
Restore to the internal default by setting this to NULL.
|
||||
|
||||
@@ -1247,10 +1300,10 @@ value is treated. You can set this parameter to \fICURL_TIMECOND_IFMODSINCE\fP
|
||||
or \fICURL_TIMECOND_IFUNMODSINCE\fP. This feature applies to HTTP and FTP.
|
||||
|
||||
The last modification time of a file is not always known and in such instances
|
||||
this feature will have no effect even if the given time condition would have
|
||||
not been met.
|
||||
this feature will have no effect even if the given time condition would not have
|
||||
been met.
|
||||
.IP CURLOPT_TIMEVALUE
|
||||
Pass a long as parameter. This should be the time in seconds since 1 jan 1970,
|
||||
Pass a long as parameter. This should be the time in seconds since 1 Jan 1970,
|
||||
and the time will be used in a condition as specified with
|
||||
\fICURLOPT_TIMECONDITION\fP.
|
||||
.SH CONNECTION OPTIONS
|
||||
@@ -1265,8 +1318,10 @@ In unix-like systems, this might cause signals to be used unless
|
||||
\fICURLOPT_NOSIGNAL\fP is set.
|
||||
.IP CURLOPT_TIMEOUT_MS
|
||||
Like \fICURLOPT_TIMEOUT\fP but takes number of milliseconds instead. If
|
||||
libcurl is built to use the standard system name resolver, that part will
|
||||
still use full-second resolution for timeouts. (Added in 7.16.2)
|
||||
libcurl is built to use the standard system name resolver, that portion
|
||||
of the transfer will still use full-second resolution for timeouts with
|
||||
a minimum timeout allowed of one second.
|
||||
(Added in 7.16.2)
|
||||
.IP CURLOPT_LOW_SPEED_LIMIT
|
||||
Pass a long as parameter. It contains the transfer speed in bytes per second
|
||||
that the transfer should be below during \fICURLOPT_LOW_SPEED_TIME\fP seconds
|
||||
@@ -1276,32 +1331,32 @@ Pass a long as parameter. It contains the time in seconds that the transfer
|
||||
should be below the \fICURLOPT_LOW_SPEED_LIMIT\fP for the library to consider
|
||||
it too slow and abort.
|
||||
.IP CURLOPT_MAX_SEND_SPEED_LARGE
|
||||
Pass a curl_off_t as parameter. If an upload exceeds this speed on cumulative
|
||||
average during the transfer, the transfer will pause to keep the average rate
|
||||
less than or equal to the parameter value. Defaults to unlimited
|
||||
speed. (Added in 7.15.5)
|
||||
Pass a curl_off_t as parameter. If an upload exceeds this speed (counted in
|
||||
bytes per second) on cumulative average during the transfer, the transfer will
|
||||
pause to keep the average rate less than or equal to the parameter value.
|
||||
Defaults to unlimited speed. (Added in 7.15.5)
|
||||
.IP CURLOPT_MAX_RECV_SPEED_LARGE
|
||||
Pass a curl_off_t as parameter. If a download exceeds this speed on
|
||||
cumulative average during the transfer, the transfer will pause to keep the
|
||||
average rate less than or equal to the parameter value. Defaults to unlimited
|
||||
speed. (Added in 7.15.5)
|
||||
Pass a curl_off_t as parameter. If a download exceeds this speed (counted in
|
||||
bytes per second) on cumulative average during the transfer, the transfer will
|
||||
pause to keep the average rate less than or equal to the parameter
|
||||
value. Defaults to unlimited speed. (Added in 7.15.5)
|
||||
.IP CURLOPT_MAXCONNECTS
|
||||
Pass a long. The set number will be the persistent connection cache size. The
|
||||
set amount will be the maximum amount of simultaneously open connections that
|
||||
libcurl may cache in this easy handle. Default is 5, and there isn't much
|
||||
point in changing this value unless you are perfectly aware of how this work
|
||||
and changes libcurl's behaviour. This concerns connection using any of the
|
||||
point in changing this value unless you are perfectly aware of how this works
|
||||
and changes libcurl's behaviour. This concerns connections using any of the
|
||||
protocols that support persistent connections.
|
||||
|
||||
When reaching the maximum limit, curl closes the oldest one in the cache to
|
||||
prevent the number of open connections to increase.
|
||||
prevent increasing the number of open connections.
|
||||
|
||||
If you already have performed transfers with this curl handle, setting a
|
||||
smaller MAXCONNECTS than before may cause open connections to get closed
|
||||
unnecessarily.
|
||||
|
||||
Note that if you add this easy handle to a multi handle, this setting is not
|
||||
being acknowledged, but you must instead use \fIcurl_multi_setopt(3)\fP and
|
||||
acknowledged, and you must instead use \fIcurl_multi_setopt(3)\fP and
|
||||
the \fICURLMOPT_MAXCONNECTS\fP option.
|
||||
.IP CURLOPT_CLOSEPOLICY
|
||||
(Obsolete) This option does nothing.
|
||||
@@ -1314,10 +1369,10 @@ what it does. Set this to 0 to have libcurl attempt re-using an existing
|
||||
connection (default behavior).
|
||||
.IP CURLOPT_FORBID_REUSE
|
||||
Pass a long. Set to 1 to make the next transfer explicitly close the
|
||||
connection when done. Normally, libcurl keep all connections alive when done
|
||||
with one transfer in case there comes a succeeding one that can re-use them.
|
||||
connection when done. Normally, libcurl keeps all connections alive when done
|
||||
with one transfer in case a succeeding one follows that can re-use them.
|
||||
This option should be used with caution and only if you understand what it
|
||||
does. Set to 0 to have libcurl keep the connection open for possibly later
|
||||
does. Set to 0 to have libcurl keep the connection open for possible later
|
||||
re-use (default behavior).
|
||||
.IP CURLOPT_CONNECTTIMEOUT
|
||||
Pass a long. It should contain the maximum time in seconds that you allow the
|
||||
@@ -1329,9 +1384,11 @@ timeouts). See also the \fICURLOPT_TIMEOUT\fP option.
|
||||
In unix-like systems, this might cause signals to be used unless
|
||||
\fICURLOPT_NOSIGNAL\fP is set.
|
||||
.IP CURLOPT_CONNECTTIMEOUT_MS
|
||||
Like \fICURLOPT_CONNECTTIMEOUT\fP but takes number of milliseconds instead. If
|
||||
libcurl is built to use the standard system name resolver, that part will
|
||||
still use full-second resolution for timeouts. (Added in 7.16.2)
|
||||
Like \fICURLOPT_CONNECTTIMEOUT\fP but takes the number of milliseconds
|
||||
instead. If libcurl is built to use the standard system name resolver,
|
||||
that portion of the connect will still use full-second resolution for
|
||||
timeouts with a minimum timeout allowed of one second.
|
||||
(Added in 7.16.2)
|
||||
.IP CURLOPT_IPRESOLVE
|
||||
Allows an application to select what kind of IP addresses to use when
|
||||
resolving host names. This is only interesting when using host names that
|
||||
@@ -1340,13 +1397,14 @@ resolve addresses using more than one version of IP. The allowed values are:
|
||||
.IP CURL_IPRESOLVE_WHATEVER
|
||||
Default, resolves addresses to all IP versions that your system allows.
|
||||
.IP CURL_IPRESOLVE_V4
|
||||
Resolve to ipv4 addresses.
|
||||
Resolve to IPv4 addresses.
|
||||
.IP CURL_IPRESOLVE_V6
|
||||
Resolve to ipv6 addresses.
|
||||
Resolve to IPv6 addresses.
|
||||
.RE
|
||||
.IP CURLOPT_CONNECT_ONLY
|
||||
Pass a long. If the parameter equals 1, it tells the library to perform all
|
||||
the required proxy authentication and connection setup, but no data transfer.
|
||||
This option is useful only on HTTP URLs.
|
||||
|
||||
This option is useful with the \fICURLINFO_LASTSOCKET\fP option to
|
||||
\fIcurl_easy_getinfo(3)\fP. The library can set up the connection and then the
|
||||
@@ -1451,14 +1509,14 @@ even indicate an accessible file.
|
||||
Note that option is by default set to the system path where libcurl's cacert
|
||||
bundle is assumed to be stored, as established at build time.
|
||||
|
||||
When built against NSS this is the directory that the NSS certificate
|
||||
When built against NSS, this is the directory that the NSS certificate
|
||||
database resides in.
|
||||
.IP CURLOPT_ISSUERCERT
|
||||
Pass a char * to a zero terminated string naming a file holding a CA
|
||||
certificate in PEM format. If the option is set, an additional check against
|
||||
the peer certificate is performed to verify the issuer is indeed the one
|
||||
associated with the certificate provided by the option. This additional check
|
||||
is useful in multi-level PKI where one need to enforce the peer certificate is
|
||||
is useful in multi-level PKI where one needs to enforce that the peer certificate is
|
||||
from a specific branch of the tree.
|
||||
|
||||
This option makes sense only when used in combination with the
|
||||
@@ -1496,6 +1554,13 @@ A specific error code (CURLE_SSL_CRL_BADFILE) is defined with the option. It
|
||||
is returned when the SSL exchange fails because the CRL file cannot be loaded.
|
||||
Note that a failure in certificate verification due to a revocation information
|
||||
found in the CRL does not trigger this specific error. (Added in 7.19.0)
|
||||
.IP CURLOPT_CERTINFO
|
||||
Pass a long set to 1 to enable libcurl's certificate chain info gatherer. With
|
||||
this enabled, libcurl (if built with OpenSSL) will extract lots of information
|
||||
and data about the certificates in the certificate chain used in the SSL
|
||||
connection. This data is then possible to extract after a transfer using
|
||||
\fIcurl_easy_getinfo(3)\fP and its option \fICURLINFO_CERTINFO\fP. (Added in
|
||||
7.19.1)
|
||||
.IP CURLOPT_RANDOM_FILE
|
||||
Pass a char * to a zero terminated file name. The file will be used to read
|
||||
from to seed the random engine for SSL. The more random the specified file is,
|
||||
@@ -1509,7 +1574,7 @@ Pass a long as parameter.
|
||||
This option determines whether libcurl verifies that the server cert is for
|
||||
the server it is known as.
|
||||
|
||||
When negotiating an SSL connection, the server sends a certificate indicating
|
||||
When negotiating a SSL connection, the server sends a certificate indicating
|
||||
its identity.
|
||||
|
||||
When \fICURLOPT_SSL_VERIFYHOST\fP is 2, that certificate must indicate that
|
||||
@@ -1528,15 +1593,14 @@ certificate.
|
||||
|
||||
The default, since 7.10, is 2.
|
||||
|
||||
The checking this option controls is of the identity that the server
|
||||
\fIclaims\fP. The server could be lying. To control lying, see
|
||||
\fICURLOPT_SSL_VERIFYPEER\fP.
|
||||
This option controls checking the server's claimed identity. The server could
|
||||
be lying. To control lying, see \fICURLOPT_SSL_VERIFYPEER\fP.
|
||||
.IP CURLOPT_SSL_CIPHER_LIST
|
||||
Pass a char *, pointing to a zero terminated string holding the list of
|
||||
ciphers to use for the SSL connection. The list must be syntactically correct,
|
||||
it consists of one or more cipher strings separated by colons. Commas or spaces
|
||||
are also acceptable separators but colons are normally used, \!, \- and \+ can
|
||||
be used as operators.
|
||||
it consists of one or more cipher strings separated by colons. Commas or
|
||||
spaces are also acceptable separators but colons are normally used, \&!, \&-
|
||||
and \&+ can be used as operators.
|
||||
|
||||
For OpenSSL and GnuTLS valid examples of cipher lists include 'RC4-SHA',
|
||||
\'SHA1+DES\', 'TLSv1' and 'DEFAULT'. The default list is normally set when you
|
||||
@@ -1545,7 +1609,7 @@ compile OpenSSL.
|
||||
You'll find more details about cipher lists on this URL:
|
||||
\fIhttp://www.openssl.org/docs/apps/ciphers.html\fP
|
||||
|
||||
For NSS valid examples of cipher lists include 'rsa_rc4_128_md5',
|
||||
For NSS, valid examples of cipher lists include 'rsa_rc4_128_md5',
|
||||
\'rsa_aes_128_sha\', etc. With NSS you don't add/remove ciphers. If one uses
|
||||
this option then all known ciphers are disabled and only those passed in
|
||||
are enabled.
|
||||
@@ -1560,9 +1624,9 @@ cache. Note that while nothing ever should get hurt by attempting to reuse SSL
|
||||
session-IDs, there seem to be broken SSL implementations in the wild that may
|
||||
require you to disable this in order for you to succeed. (Added in 7.16.0)
|
||||
.IP CURLOPT_KRBLEVEL
|
||||
Pass a char * as parameter. Set the kerberos security level for FTP; this
|
||||
also enables kerberos awareness. This is a string, 'clear', 'safe',
|
||||
'confidential' or \&'private'. If the string is set but doesn't match one
|
||||
Pass a char * as parameter. Set the kerberos security level for FTP; this also
|
||||
enables kerberos awareness. This is a string, \&'clear', \&'safe',
|
||||
\&'confidential' or \&'private'. If the string is set but doesn't match one
|
||||
of these, 'private' will be used. Set the string to NULL to disable kerberos
|
||||
support for FTP.
|
||||
|
||||
@@ -1603,7 +1667,7 @@ share handle. See \fIcurl_share_setopt(3)\fP for details.
|
||||
|
||||
If you add a share that is set to share cookies, your easy handle will use
|
||||
that cookie cache and get the cookie engine enabled. If you unshare an object
|
||||
that were using cookies (or change to another object that doesn't share
|
||||
that was using cookies (or change to another object that doesn't share
|
||||
cookies), the easy handle will get its cookie engine disabled.
|
||||
|
||||
Data that the share object is not set to share will be dealt with the usual
|
||||
@@ -1612,12 +1676,12 @@ way, as if no share was used.
|
||||
Pass a long as a parameter, containing the value of the permissions that will
|
||||
be assigned to newly created files on the remote server. The default value is
|
||||
\fI0644\fP, but any valid value can be used. The only protocols that can use
|
||||
this are \fIsftp://\fP, \fIscp://\fP and \fIfile://\fP. (Added in 7.16.4)
|
||||
this are \fIsftp://\fP, \fIscp://\fP, and \fIfile://\fP. (Added in 7.16.4)
|
||||
.IP CURLOPT_NEW_DIRECTORY_PERMS
|
||||
Pass a long as a parameter, containing the value of the permissions that will
|
||||
be assigned to newly created directories on the remote server. The default
|
||||
value is \fI0755\fP, but any valid value can be used. The only protocols that
|
||||
can use this are \fIsftp://\fP, \fIscp://\fP and \fIfile://\fP.
|
||||
can use this are \fIsftp://\fP, \fIscp://\fP, and \fIfile://\fP.
|
||||
(Added in 7.16.4)
|
||||
.SH TELNET OPTIONS
|
||||
.IP CURLOPT_TELNETOPTIONS
|
||||
|
||||
@@ -106,8 +106,9 @@ long which gives the length of the buffer.
|
||||
Tells libcurl to use the \fICURLOPT_READFUNCTION\fP callback to get data. The
|
||||
parameter you pass to \fICURLFORM_STREAM\fP is the pointer passed on to the
|
||||
read callback's fourth argument. If you want the part to look like a file
|
||||
upload one, set the \fICURLFORM_FILENAME\fP parameter as well. (Option added
|
||||
in libcurl 7.18.2)
|
||||
upload one, set the \fICURLFORM_FILENAME\fP parameter as well. Note that when
|
||||
using \fICURLFORM_STREAM\fP, \fICURLFORM_CONTENTSLENGTH\fP must also be set
|
||||
with the total expected length of the part. (Option added in libcurl 7.18.2)
|
||||
.IP CURLFORM_ARRAY
|
||||
Another possibility to send options to curl_formadd() is the
|
||||
\fBCURLFORM_ARRAY\fP option, that passes a struct curl_forms array pointer as
|
||||
|
||||
@@ -13,7 +13,7 @@ curl_formfree - free a previously build multipart/formdata HTTP POST chain
|
||||
.SH DESCRIPTION
|
||||
curl_formfree() is used to clean up data previously built/appended with
|
||||
\fIcurl_formadd(3)\fP. This must be called when the data has been used, which
|
||||
typically means after the \fIcurl_easy_perform(3)\fP has been called.
|
||||
typically means after \fIcurl_easy_perform(3)\fP has been called.
|
||||
.SH RETURN VALUE
|
||||
None
|
||||
.SH "SEE ALSO"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
.\"
|
||||
.TH curl_formget 3 "20 June 2006" "libcurl 7.15.5" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_formget - serialize a previously build multipart/formdata HTTP POST chain
|
||||
curl_formget - serialize a previously built multipart/formdata HTTP POST chain
|
||||
.SH SYNOPSIS
|
||||
.B #include <curl/curl.h>
|
||||
.sp
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
.\"
|
||||
.TH curl_getdate 3 "12 Aug 2005" "libcurl 7.0" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_getdate - Convert an date string to number of seconds since January 1,
|
||||
curl_getdate - Convert a date string to number of seconds since January 1,
|
||||
1970
|
||||
.SH SYNOPSIS
|
||||
.B #include <curl/curl.h>
|
||||
@@ -27,7 +27,7 @@ items:
|
||||
.TP 0.8i
|
||||
.B calendar date items
|
||||
Can be specified several ways. Month names can only be three-letter english
|
||||
abbrivations, numbers can be zero-prefixed and the year may use 2 or 4 digits.
|
||||
abbreviations, numbers can be zero-prefixed and the year may use 2 or 4 digits.
|
||||
Examples: 06 Nov 1994, 06-Nov-94 and Nov-94 6.
|
||||
.TP
|
||||
.B time of the day items
|
||||
@@ -96,5 +96,5 @@ The former version of this function was built with yacc and was not only very
|
||||
large, it was also never quite understood and it wasn't possible to build with
|
||||
non-GNU tools since only GNU Bison could make it thread-safe!
|
||||
|
||||
The rewrite was done for 7.12.2. The new one is much smaller and use simpler
|
||||
The rewrite was done for 7.12.2. The new one is much smaller and uses simpler
|
||||
code.
|
||||
|
||||
@@ -24,7 +24,7 @@ to find the specified name, it returns a null pointer.
|
||||
.SH NOTE
|
||||
Under unix operating systems, there isn't any point in returning an allocated
|
||||
memory, although other systems won't work properly if this isn't done. The
|
||||
unix implementation thus have to suffer slightly from the drawbacks of other
|
||||
unix implementation thus has to suffer slightly from the drawbacks of other
|
||||
systems.
|
||||
.SH "SEE ALSO"
|
||||
.BR getenv "(3C), "
|
||||
|
||||
@@ -23,7 +23,7 @@ effect as one call.
|
||||
The flags option is a bit pattern that tells libcurl exactly what features to
|
||||
init, as described below. Set the desired bits by ORing the values together.
|
||||
In normal operation, you must specify CURL_GLOBAL_ALL. Don't use any other
|
||||
value unless you are familiar with and mean to control internal operations of
|
||||
value unless you are familiar with it and mean to control internal operations of
|
||||
libcurl.
|
||||
|
||||
\fBThis function is not thread safe.\fP You must not call it when any other
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user