Compare commits
725 Commits
curl-7_17_
...
curl-7_18_
Author | SHA1 | Date | |
---|---|---|---|
![]() |
323273382c | ||
![]() |
6f0a2608b4 | ||
![]() |
ea86edbd82 | ||
![]() |
e7b5a8e6cb | ||
![]() |
27eaf0cf02 | ||
![]() |
c84904d8c8 | ||
![]() |
01e1c85304 | ||
![]() |
4774582dfb | ||
![]() |
1ed09ff7a4 | ||
![]() |
d89cf27d65 | ||
![]() |
35d5ba2626 | ||
![]() |
e5f0c38fa9 | ||
![]() |
47925f3dd7 | ||
![]() |
82c5950c7e | ||
![]() |
1806879bb2 | ||
![]() |
998b046d70 | ||
![]() |
ec4f6e93c2 | ||
![]() |
b49dcfb52b | ||
![]() |
c62d55342d | ||
![]() |
f7815fa93c | ||
![]() |
6e305e11e3 | ||
![]() |
b97606f0b0 | ||
![]() |
f26154bfa9 | ||
![]() |
d220ac8582 | ||
![]() |
c57e748107 | ||
![]() |
d6f8f16068 | ||
![]() |
466429efb0 | ||
![]() |
89977c73d1 | ||
![]() |
a9a05a32bd | ||
![]() |
2045c79e37 | ||
![]() |
e60b5245d3 | ||
![]() |
90bbabce56 | ||
![]() |
ddfbe8b649 | ||
![]() |
d001f6a396 | ||
![]() |
d31da176eb | ||
![]() |
e664cd5826 | ||
![]() |
b8abeab6d3 | ||
![]() |
4aa176c127 | ||
![]() |
498e939f0e | ||
![]() |
9a22b893b6 | ||
![]() |
76d0d40946 | ||
![]() |
791ad1210e | ||
![]() |
100945694a | ||
![]() |
abe2e6ecf7 | ||
![]() |
d8efc99217 | ||
![]() |
0163b5b8be | ||
![]() |
baee3996ab | ||
![]() |
8ad1928d93 | ||
![]() |
24bf52bc69 | ||
![]() |
862049c490 | ||
![]() |
a8fc98aa30 | ||
![]() |
d70f33748c | ||
![]() |
b006c31b7b | ||
![]() |
ae45a462e0 | ||
![]() |
3cb0dd6685 | ||
![]() |
c2a84aa6f0 | ||
![]() |
9346e55d5a | ||
![]() |
8fc2f8ef62 | ||
![]() |
512b9ac194 | ||
![]() |
560a82aeaf | ||
![]() |
7358db5c27 | ||
![]() |
e059efda1b | ||
![]() |
164a985115 | ||
![]() |
ade57a781c | ||
![]() |
9f12ed83f2 | ||
![]() |
8aabd9839b | ||
![]() |
882fbb0433 | ||
![]() |
15eee5dbbb | ||
![]() |
cfc1d037ff | ||
![]() |
c24ed07596 | ||
![]() |
08aab6a620 | ||
![]() |
2748c64d60 | ||
![]() |
c4f1ab3cc5 | ||
![]() |
5e06ec8409 | ||
![]() |
04d0a84ae5 | ||
![]() |
c1dfe2c529 | ||
![]() |
7f88e8badb | ||
![]() |
2f66ff2e4f | ||
![]() |
76c251513e | ||
![]() |
80afddacc8 | ||
![]() |
7543c9df50 | ||
![]() |
83fb13329d | ||
![]() |
e06c923605 | ||
![]() |
ab1169895f | ||
![]() |
01e81c7e10 | ||
![]() |
7bf1142ae0 | ||
![]() |
af9f7a952b | ||
![]() |
514592b892 | ||
![]() |
d72efff878 | ||
![]() |
e4c60e2030 | ||
![]() |
ed80eb5b0f | ||
![]() |
60dd765b3d | ||
![]() |
b380dd030f | ||
![]() |
19479ea021 | ||
![]() |
d708ef6731 | ||
![]() |
d1238baecb | ||
![]() |
0510759bc4 | ||
![]() |
6d5cca5ed0 | ||
![]() |
e2b82b4325 | ||
![]() |
cf4570a06f | ||
![]() |
6df5dddd90 | ||
![]() |
d4e9b141db | ||
![]() |
ec0665a931 | ||
![]() |
836fa69e2e | ||
![]() |
9026dc2da4 | ||
![]() |
98c9af4c59 | ||
![]() |
e481d679b2 | ||
![]() |
eb68aa38e3 | ||
![]() |
082237e2b5 | ||
![]() |
dd08a7a4f6 | ||
![]() |
a60c9ef88e | ||
![]() |
4e3d235e04 | ||
![]() |
19da3606f9 | ||
![]() |
fc9e0d2249 | ||
![]() |
21a0f09081 | ||
![]() |
b84b71f524 | ||
![]() |
3d29bda9f8 | ||
![]() |
459c664043 | ||
![]() |
45edad84cb | ||
![]() |
fd31f7e7e5 | ||
![]() |
7b2531da24 | ||
![]() |
848a13654d | ||
![]() |
1cca8f5a30 | ||
![]() |
12ffcf0b45 | ||
![]() |
852989856d | ||
![]() |
7dfdbf8fbe | ||
![]() |
1eebb90030 | ||
![]() |
ab71654078 | ||
![]() |
7a6cff4b3a | ||
![]() |
c3ba2198b1 | ||
![]() |
ff748f1a41 | ||
![]() |
b8193b6321 | ||
![]() |
113d0937de | ||
![]() |
d0a506661f | ||
![]() |
4e71173928 | ||
![]() |
e0f0a2ccee | ||
![]() |
96edebf4d9 | ||
![]() |
3783b455c0 | ||
![]() |
7ee5238f5e | ||
![]() |
b398169567 | ||
![]() |
1960eebc2d | ||
![]() |
ad1dd08693 | ||
![]() |
95fd093c4a | ||
![]() |
ed1ad28e29 | ||
![]() |
7076505c24 | ||
![]() |
5825cf9457 | ||
![]() |
ff40415aee | ||
![]() |
f48eb36f75 | ||
![]() |
768e3e796e | ||
![]() |
3869d4a3a7 | ||
![]() |
a87c468c5c | ||
![]() |
7abf50a5c0 | ||
![]() |
d3f46eb61b | ||
![]() |
72c58b0d1d | ||
![]() |
6c89e1b311 | ||
![]() |
09777a4fc2 | ||
![]() |
0331071346 | ||
![]() |
614ae7b2bc | ||
![]() |
af41ada7aa | ||
![]() |
6a33a4456e | ||
![]() |
e0c2a39ad4 | ||
![]() |
cda1f2be58 | ||
![]() |
79e06c4147 | ||
![]() |
ead2618c31 | ||
![]() |
84eb9fee76 | ||
![]() |
79300cdcd9 | ||
![]() |
a9591ad1b7 | ||
![]() |
098106b54c | ||
![]() |
74bb59fa57 | ||
![]() |
c97d112b30 | ||
![]() |
2dc20b84c1 | ||
![]() |
39b689f966 | ||
![]() |
6fd3ff4032 | ||
![]() |
ab8d1464a7 | ||
![]() |
bf90d11a31 | ||
![]() |
a08b6ae813 | ||
![]() |
74c500b6ec | ||
![]() |
26aeadbc3e | ||
![]() |
d0a4b50e19 | ||
![]() |
ebaf06a741 | ||
![]() |
34d837c2dd | ||
![]() |
7607d5145b | ||
![]() |
12a90289ed | ||
![]() |
592697583d | ||
![]() |
b50a96982e | ||
![]() |
aa2a54c10a | ||
![]() |
532d4b5106 | ||
![]() |
5788719988 | ||
![]() |
ac0b911eda | ||
![]() |
10232bfe9e | ||
![]() |
a9c1ca9fc5 | ||
![]() |
d051dd8087 | ||
![]() |
bf52cef16f | ||
![]() |
16a9c5e02b | ||
![]() |
fef1a90938 | ||
![]() |
27870d48ff | ||
![]() |
2f66f3ce08 | ||
![]() |
369df58a0d | ||
![]() |
3d08b352a2 | ||
![]() |
d13be06aaa | ||
![]() |
f1c69192da | ||
![]() |
a2314225e0 | ||
![]() |
1e482fe6a8 | ||
![]() |
80e7f9b9de | ||
![]() |
d219269f1b | ||
![]() |
0ff0512aff | ||
![]() |
bdd731177e | ||
![]() |
abd1c526f0 | ||
![]() |
a050a5fa9b | ||
![]() |
7f7b643c0d | ||
![]() |
cd2814725a | ||
![]() |
342fa1cf06 | ||
![]() |
b425e851fb | ||
![]() |
7c6a026230 | ||
![]() |
2c9763da3e | ||
![]() |
a782c3e368 | ||
![]() |
95bd901efe | ||
![]() |
98c9a5b7f6 | ||
![]() |
516192e7f2 | ||
![]() |
c37cdbe2cf | ||
![]() |
c0a30b04c2 | ||
![]() |
86cbb23282 | ||
![]() |
e9a460411f | ||
![]() |
a57098ea9b | ||
![]() |
6f3166c15b | ||
![]() |
1380c9af9f | ||
![]() |
942daece00 | ||
![]() |
040a4443a1 | ||
![]() |
641d5c4111 | ||
![]() |
ad4a9955c5 | ||
![]() |
553ed99e3b | ||
![]() |
b74cdee6ab | ||
![]() |
f3c0afa5b8 | ||
![]() |
a69ba639ba | ||
![]() |
fc9ad03e66 | ||
![]() |
b9d66dca51 | ||
![]() |
ecf1c6ca5d | ||
![]() |
9b48991ebd | ||
![]() |
7a8a20416f | ||
![]() |
458925ae0b | ||
![]() |
e44dc92197 | ||
![]() |
9bb51d767e | ||
![]() |
82e095a275 | ||
![]() |
0e40261a11 | ||
![]() |
8e9e33ae52 | ||
![]() |
40e1a016f9 | ||
![]() |
1cf559492a | ||
![]() |
4957a838ef | ||
![]() |
91aeebed26 | ||
![]() |
b16ea66cec | ||
![]() |
80cec5a62a | ||
![]() |
6c2c281a7e | ||
![]() |
0836893335 | ||
![]() |
590f0358d8 | ||
![]() |
115446be37 | ||
![]() |
d83606ee3a | ||
![]() |
8f4fda1d6f | ||
![]() |
18cbb4d7d6 | ||
![]() |
22e84d92b7 | ||
![]() |
3d74649908 | ||
![]() |
ed63d9d4de | ||
![]() |
8adc7038fe | ||
![]() |
b12fef3f31 | ||
![]() |
6cc8df95dd | ||
![]() |
f105e23444 | ||
![]() |
7513d29a48 | ||
![]() |
97a41f3646 | ||
![]() |
84de433e62 | ||
![]() |
724ad15dad | ||
![]() |
79aa6c841e | ||
![]() |
058e764af8 | ||
![]() |
0d09f342c4 | ||
![]() |
9682c2037e | ||
![]() |
74241e7d85 | ||
![]() |
3154f04fb9 | ||
![]() |
6982ed4db7 | ||
![]() |
9dd3e4d481 | ||
![]() |
1d95109ffa | ||
![]() |
e9bb7b7712 | ||
![]() |
5e9c564883 | ||
![]() |
3bb4602227 | ||
![]() |
064eebeaf1 | ||
![]() |
4ae644e427 | ||
![]() |
d208e56b16 | ||
![]() |
e6170eb20d | ||
![]() |
2c80bcbc81 | ||
![]() |
b60dbfa9e9 | ||
![]() |
9019fc5671 | ||
![]() |
5db0f70491 | ||
![]() |
53a549000c | ||
![]() |
55700cb01f | ||
![]() |
f9a6062081 | ||
![]() |
0cae201044 | ||
![]() |
9df37b93df | ||
![]() |
7b5c86033a | ||
![]() |
ade0890746 | ||
![]() |
7a5596bf02 | ||
![]() |
d2125cf501 | ||
![]() |
c9eb41c056 | ||
![]() |
0d722204c3 | ||
![]() |
e829d5643f | ||
![]() |
1093287494 | ||
![]() |
6398f71cc4 | ||
![]() |
e2b50b203d | ||
![]() |
ab0de23d83 | ||
![]() |
ec54fbd9ed | ||
![]() |
074bd2a19b | ||
![]() |
fb23b85770 | ||
![]() |
3458ce9ae5 | ||
![]() |
ba3e7a8656 | ||
![]() |
240bae4eb2 | ||
![]() |
4180ca7638 | ||
![]() |
0e73361a06 | ||
![]() |
23547fa2a0 | ||
![]() |
550d6f74b9 | ||
![]() |
f7b71c2abe | ||
![]() |
0da90b5d91 | ||
![]() |
f20c94ced9 | ||
![]() |
3e635a2334 | ||
![]() |
e78652d850 | ||
![]() |
48918c3047 | ||
![]() |
dc42d6fb8d | ||
![]() |
d2ad98d8c5 | ||
![]() |
d25aab2704 | ||
![]() |
cfaf88aab4 | ||
![]() |
ecc75be6f3 | ||
![]() |
13ebf61850 | ||
![]() |
b3fafe9b3a | ||
![]() |
c66943bd89 | ||
![]() |
11fae450fa | ||
![]() |
cf9259dd92 | ||
![]() |
6634e3c3a3 | ||
![]() |
533ae704a1 | ||
![]() |
fcc320ee40 | ||
![]() |
dc9fe9c361 | ||
![]() |
75c369dcca | ||
![]() |
019f6a1926 | ||
![]() |
44fba11b34 | ||
![]() |
df07c87b89 | ||
![]() |
8f9e0357dd | ||
![]() |
736af32b49 | ||
![]() |
6942d313ff | ||
![]() |
940c075bd8 | ||
![]() |
08e5c0812f | ||
![]() |
a8c71961e0 | ||
![]() |
d6f47cc60c | ||
![]() |
63d595a047 | ||
![]() |
15e56c3284 | ||
![]() |
fc1443dcfc | ||
![]() |
59e3651af3 | ||
![]() |
4c841a1f0c | ||
![]() |
339ebdf08b | ||
![]() |
f01d324c83 | ||
![]() |
405e192b8c | ||
![]() |
1a340de0e5 | ||
![]() |
05c191199d | ||
![]() |
1fd7085ef1 | ||
![]() |
c3a7a757f7 | ||
![]() |
dca46e6470 | ||
![]() |
7edd13822c | ||
![]() |
a2bff51ede | ||
![]() |
5dc1240c49 | ||
![]() |
c764331dd9 | ||
![]() |
586444b6b8 | ||
![]() |
ce1649564c | ||
![]() |
d76a74cc5e | ||
![]() |
1b701c746f | ||
![]() |
15bf168527 | ||
![]() |
20e9fc73e2 | ||
![]() |
bad6410d08 | ||
![]() |
fecb67b246 | ||
![]() |
2c0956200f | ||
![]() |
acd9d72466 | ||
![]() |
cd63a461d7 | ||
![]() |
7bd098f670 | ||
![]() |
4b5c504bd4 | ||
![]() |
ffae4f6b48 | ||
![]() |
454e840590 | ||
![]() |
ed0a413711 | ||
![]() |
ff812ccdc9 | ||
![]() |
03bbf4de48 | ||
![]() |
a62e155ca4 | ||
![]() |
b620e62f0f | ||
![]() |
b3186dee17 | ||
![]() |
ea3f63281c | ||
![]() |
7b9435890d | ||
![]() |
1bfbd25027 | ||
![]() |
ceb5a8ca7b | ||
![]() |
ddc98c6fc9 | ||
![]() |
ff6ff66e50 | ||
![]() |
a7b98f5f6b | ||
![]() |
6bae091c1b | ||
![]() |
33d68653f0 | ||
![]() |
267836e83c | ||
![]() |
87fdfe770d | ||
![]() |
8fca5c2e69 | ||
![]() |
5f2055729e | ||
![]() |
c6df788866 | ||
![]() |
e67b2524d1 | ||
![]() |
d7bcc26179 | ||
![]() |
69e540dfa6 | ||
![]() |
2198869eb1 | ||
![]() |
fb07259e0d | ||
![]() |
9d28a0252c | ||
![]() |
d54c14ccf9 | ||
![]() |
41def4be6e | ||
![]() |
2d38d0d515 | ||
![]() |
e796c79d18 | ||
![]() |
c93ba48da2 | ||
![]() |
e322513698 | ||
![]() |
6fa72e6417 | ||
![]() |
c914e6ea5d | ||
![]() |
79cb74f03a | ||
![]() |
34cf35051a | ||
![]() |
9bd28a021f | ||
![]() |
5ee3f41e0d | ||
![]() |
64e88ff6a7 | ||
![]() |
acd7c94598 | ||
![]() |
bdb2beb8e4 | ||
![]() |
727e23322f | ||
![]() |
ef0ed9b720 | ||
![]() |
a674654f83 | ||
![]() |
3caeb0a91f | ||
![]() |
a4eddf0d0d | ||
![]() |
fcf9029179 | ||
![]() |
e40327ba00 | ||
![]() |
bdd0e3d3f5 | ||
![]() |
e9490fdbd9 | ||
![]() |
bd40b3ff3f | ||
![]() |
8c66811e09 | ||
![]() |
daadcfd1de | ||
![]() |
62df0ff025 | ||
![]() |
01d95b56a0 | ||
![]() |
f6adae8d35 | ||
![]() |
bcaadb4284 | ||
![]() |
8d963aa0e2 | ||
![]() |
0530b0a5ca | ||
![]() |
5396121595 | ||
![]() |
bcfc7d90d1 | ||
![]() |
47246eb401 | ||
![]() |
3620e71010 | ||
![]() |
c522f349fe | ||
![]() |
6893fcaa9b | ||
![]() |
301ae1ae1b | ||
![]() |
ddaa78f08b | ||
![]() |
3d55877764 | ||
![]() |
3ee32d7920 | ||
![]() |
b3de497d83 | ||
![]() |
ed6466d176 | ||
![]() |
991505e077 | ||
![]() |
56f17d2c9f | ||
![]() |
19ae96f4d0 | ||
![]() |
53108806af | ||
![]() |
1d620a3df4 | ||
![]() |
69f685056d | ||
![]() |
9c7d4394f9 | ||
![]() |
bcc3c9279a | ||
![]() |
5d63404966 | ||
![]() |
a8ae8087c4 | ||
![]() |
502da27d65 | ||
![]() |
4ab8ebb232 | ||
![]() |
f866af912d | ||
![]() |
4f00a8db73 | ||
![]() |
5004529685 | ||
![]() |
2b63eb8511 | ||
![]() |
f09fe4b49f | ||
![]() |
22c76df44d | ||
![]() |
35be09cf58 | ||
![]() |
3564aec388 | ||
![]() |
a042090467 | ||
![]() |
148d727525 | ||
![]() |
08adf67969 | ||
![]() |
e2c817731a | ||
![]() |
8df7e0bdba | ||
![]() |
14ff7e75e0 | ||
![]() |
d270d6518a | ||
![]() |
18faa50940 | ||
![]() |
0ce484eed9 | ||
![]() |
bce5ae9a07 | ||
![]() |
15f832d1c2 | ||
![]() |
c249a8aa1b | ||
![]() |
fc794ae012 | ||
![]() |
07227e8089 | ||
![]() |
32cc75d6cb | ||
![]() |
1c0a19ad53 | ||
![]() |
de23b98522 | ||
![]() |
5e1c9e90d9 | ||
![]() |
59b4bdf78d | ||
![]() |
34d02d1969 | ||
![]() |
2408b236ca | ||
![]() |
4acd437952 | ||
![]() |
314f62958d | ||
![]() |
c616d56e96 | ||
![]() |
f111c9edae | ||
![]() |
7138296633 | ||
![]() |
195e94c0fa | ||
![]() |
cadd08f36a | ||
![]() |
7306b7829b | ||
![]() |
423309541a | ||
![]() |
9c6533d287 | ||
![]() |
b430576436 | ||
![]() |
65008a4e55 | ||
![]() |
3df484088f | ||
![]() |
2912189875 | ||
![]() |
fcb2595ed6 | ||
![]() |
0878af3ec0 | ||
![]() |
fe0d7aee49 | ||
![]() |
2e42b0a252 | ||
![]() |
fcc485092a | ||
![]() |
a4945fe687 | ||
![]() |
88d89b2177 | ||
![]() |
61a2d5ea75 | ||
![]() |
c479c64333 | ||
![]() |
7a2177dc42 | ||
![]() |
bf6e2f28ba | ||
![]() |
f5da1e5484 | ||
![]() |
fd8d862c37 | ||
![]() |
083d3190e5 | ||
![]() |
6787d1ed35 | ||
![]() |
d9023c16ab | ||
![]() |
193d33fd4a | ||
![]() |
a46b40b7fd | ||
![]() |
0b9b8acb08 | ||
![]() |
bf98b635cd | ||
![]() |
7795eb6db8 | ||
![]() |
31674559d3 | ||
![]() |
04e4d9a0b3 | ||
![]() |
f277124a0f | ||
![]() |
6adf5880f5 | ||
![]() |
4e8c4fc80b | ||
![]() |
fc1d1ea934 | ||
![]() |
9cd30c2012 | ||
![]() |
d639ed1aaf | ||
![]() |
c3a02f5407 | ||
![]() |
674845f239 | ||
![]() |
07a1857d59 | ||
![]() |
f4ffa85f60 | ||
![]() |
bcd7d03b3b | ||
![]() |
82c9379b6c | ||
![]() |
c1730dc50a | ||
![]() |
20695098c8 | ||
![]() |
ee52ae001c | ||
![]() |
26115aac5d | ||
![]() |
ca6b27aed2 | ||
![]() |
4fabe22173 | ||
![]() |
7b1a22147e | ||
![]() |
dc24540ed1 | ||
![]() |
92eae30f4d | ||
![]() |
79ef08f631 | ||
![]() |
e3c5f8374b | ||
![]() |
6dc68b4193 | ||
![]() |
afab4d888f | ||
![]() |
c751dfd65d | ||
![]() |
dbca1347f1 | ||
![]() |
3b6315ce1f | ||
![]() |
3c1db5f250 | ||
![]() |
562e9b7bf3 | ||
![]() |
a83e72692f | ||
![]() |
bd99a7dc8c | ||
![]() |
db2d52a792 | ||
![]() |
24602edc17 | ||
![]() |
b0b40d9a00 | ||
![]() |
71b105ceb1 | ||
![]() |
ccb4956145 | ||
![]() |
3d09cb0a88 | ||
![]() |
a03c2d825b | ||
![]() |
06fb242e23 | ||
![]() |
a086952244 | ||
![]() |
2b314064ae | ||
![]() |
439990be88 | ||
![]() |
41d8186c7e | ||
![]() |
6e9276229f | ||
![]() |
636f5eb882 | ||
![]() |
963ef5414c | ||
![]() |
975812d246 | ||
![]() |
089668ec73 | ||
![]() |
cc0ce38acc | ||
![]() |
8cdff55b80 | ||
![]() |
662bee7193 | ||
![]() |
f8172f85b1 | ||
![]() |
7d3ea12b62 | ||
![]() |
59dc9085d1 | ||
![]() |
4e4f33a297 | ||
![]() |
8fa599215b | ||
![]() |
31e2409d6b | ||
![]() |
15c304225f | ||
![]() |
e1998e3b58 | ||
![]() |
5c447f2499 | ||
![]() |
9d0ffb9cc6 | ||
![]() |
2be50baf97 | ||
![]() |
a1772ca406 | ||
![]() |
30eda92a53 | ||
![]() |
1f058f1014 | ||
![]() |
84d0477cb9 | ||
![]() |
1c93e75375 | ||
![]() |
380ed8bebf | ||
![]() |
98e8978857 | ||
![]() |
56ddfbea6e | ||
![]() |
45a2240ead | ||
![]() |
f75ba55b51 | ||
![]() |
46e6115d72 | ||
![]() |
800a72878a | ||
![]() |
649f7b7fd3 | ||
![]() |
c1b734a3e1 | ||
![]() |
cf806748ec | ||
![]() |
b28dc011e0 | ||
![]() |
ee4fef3768 | ||
![]() |
058a023fae | ||
![]() |
0c367fef94 | ||
![]() |
a418d290f1 | ||
![]() |
08cb30801c | ||
![]() |
788de4f7ba | ||
![]() |
ebce0a16f6 | ||
![]() |
df546bd58c | ||
![]() |
05221e9056 | ||
![]() |
e963714de6 | ||
![]() |
dc11239ff1 | ||
![]() |
d59841618d | ||
![]() |
8d3964782a | ||
![]() |
162c039e9d | ||
![]() |
13648f8ccd | ||
![]() |
5b809a3104 | ||
![]() |
3daa54d636 | ||
![]() |
8f1829d1d2 | ||
![]() |
6efb6addf2 | ||
![]() |
d789097af0 | ||
![]() |
4bd2d49ca1 | ||
![]() |
ecfede9b3c | ||
![]() |
cb04619de2 | ||
![]() |
61e2e86aef | ||
![]() |
9b86eecb94 | ||
![]() |
35212da048 | ||
![]() |
755e743cdd | ||
![]() |
1a323390ec | ||
![]() |
23559fd118 | ||
![]() |
d994a873a4 | ||
![]() |
b6575ce0b0 | ||
![]() |
e2b2a84497 | ||
![]() |
86956c2261 | ||
![]() |
ef6dfdc7fd | ||
![]() |
f3b85ef79d | ||
![]() |
1d7e42ee9f | ||
![]() |
6dfb5b4e1f | ||
![]() |
930085751c | ||
![]() |
258c4686b2 | ||
![]() |
600d0b1303 | ||
![]() |
2f928797cf | ||
![]() |
f3f06e823c | ||
![]() |
58292f49c5 | ||
![]() |
5376d1047c | ||
![]() |
1746b57161 | ||
![]() |
0561bffab3 | ||
![]() |
968e943eac | ||
![]() |
5be00c95a7 | ||
![]() |
c80b9c3778 | ||
![]() |
536f98a766 | ||
![]() |
c4e5613a7d | ||
![]() |
bff962398d | ||
![]() |
2b15823dab | ||
![]() |
59dcc7e191 | ||
![]() |
ea3fe98867 | ||
![]() |
4f05613fbb | ||
![]() |
22e52ddd6e | ||
![]() |
1125d45397 | ||
![]() |
44d408204a | ||
![]() |
50feea3eef | ||
![]() |
ca95f58ac0 | ||
![]() |
ed636cbe44 | ||
![]() |
738e4f410c | ||
![]() |
4e731a0189 | ||
![]() |
5cf6a539fe | ||
![]() |
17fde12fb8 | ||
![]() |
5c8b973d4f | ||
![]() |
b22e03b2b2 | ||
![]() |
a2926ebe7c | ||
![]() |
c508d70258 | ||
![]() |
f5971f54ff | ||
![]() |
c5b16d4468 | ||
![]() |
3c71a1bab7 | ||
![]() |
3ec322685b | ||
![]() |
9a39839a43 | ||
![]() |
e87c996fe0 | ||
![]() |
32195c673d | ||
![]() |
b99a61c5b0 | ||
![]() |
c960cd41e8 | ||
![]() |
a29471d0f7 | ||
![]() |
ba6f20a244 | ||
![]() |
61572a1f97 | ||
![]() |
dee3844f13 | ||
![]() |
cbd1a77ec2 | ||
![]() |
33f7ac06c3 | ||
![]() |
70f10f1ac9 | ||
![]() |
775b60fa09 | ||
![]() |
66e4d391d3 | ||
![]() |
caf880be18 | ||
![]() |
c8355c27e9 | ||
![]() |
c2d7e2ae17 | ||
![]() |
98ecad0da6 | ||
![]() |
bbc4e05434 | ||
![]() |
ad6e28073c | ||
![]() |
af29dcbafb | ||
![]() |
b9a7f4e502 | ||
![]() |
51009a40b4 | ||
![]() |
2ec8f77f21 | ||
![]() |
7f62028d66 | ||
![]() |
d34fe06fb0 | ||
![]() |
2f3d520571 | ||
![]() |
48dd0c5673 | ||
![]() |
8be493296d | ||
![]() |
6f33531861 | ||
![]() |
16897354bc | ||
![]() |
823a0454a6 | ||
![]() |
6790c559af | ||
![]() |
c56c4a0a47 | ||
![]() |
45064c5778 | ||
![]() |
7aba59f577 | ||
![]() |
59b05ac383 | ||
![]() |
9b15f1be26 | ||
![]() |
38cd2d781f | ||
![]() |
2f285b3f16 | ||
![]() |
57d2fb41d0 | ||
![]() |
0f77fe55b6 | ||
![]() |
68ee002ad0 | ||
![]() |
1fc3b18592 | ||
![]() |
5a5287ef2a |
938
CHANGES
938
CHANGES
@@ -6,6 +6,944 @@
|
||||
|
||||
Changelog
|
||||
|
||||
|
||||
Version 7.18.2 (4 June 2008)
|
||||
|
||||
Daniel Fandrich (3 Jun 2008)
|
||||
- Fixed a problem where telnet data would be lost if an EWOULDBLOCK
|
||||
condition were encountered.
|
||||
|
||||
Marty Kuhrt (1 Jun 2008)
|
||||
- Updated main.c to return CURLE_OK if PARAM_HELP_REQUESTED was returned
|
||||
from getparameter instead of CURLE_FAILED_INIT. No point in returning
|
||||
an error if --help or --version were requested.
|
||||
|
||||
Daniel Stenberg (28 May 2008)
|
||||
- Emil Romanus found a problem and helped me repeat it. It occured when using
|
||||
the curl_multi_socket() API with HTTP pipelining enabled and could lead to
|
||||
the pipeline basically stalling for a very long period of time until it took
|
||||
off again.
|
||||
|
||||
- Jeff Weber reported memory leaks with aborted SCP and SFTP transfers and
|
||||
provided excellent repeat recipes. I fixed the cases I managed to reproduce
|
||||
but Jeff still got some (SCP) problems even after these fixes:
|
||||
http://curl.haxx.se/mail/lib-2008-05/0342.html
|
||||
|
||||
Daniel Stenberg (26 May 2008)
|
||||
- Bug report #1973352 (http://curl.haxx.se/bug/view.cgi?id=1973352) identified
|
||||
how the HTTP redirect following code didn't properly follow to a new URL if
|
||||
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.
|
||||
|
||||
Yang Tse (26 May 2008)
|
||||
- David Rosenstrauch reported that header files spnegohelp.h and
|
||||
openssl/objects.h were needed to compile SPNEGO support.
|
||||
|
||||
Daniel Fandrich (22 May 2008)
|
||||
- Made sure to pass longs in to curl_easy_setopt where necessary in the
|
||||
example programs and libtest code.
|
||||
|
||||
Daniel Stenberg (19 May 2008)
|
||||
- When trying to repeat a multi interface problem I fell over a few multi
|
||||
interface problems:
|
||||
|
||||
o with pipelining disabled, the state should never be set to WAITDO but
|
||||
rather go straight to DO
|
||||
|
||||
o we had multiple states for which the internal function returned no socket
|
||||
at all to wait for, with the effect that libcurl calls the socket callback
|
||||
(when curl_multi_socket() is used) with REMOVE prematurely (as it would be
|
||||
added again within very shortly)
|
||||
|
||||
o when in DO and DOING states, the HTTP and HTTPS protocol handler functions
|
||||
didn't return that the socket should be waited for writing, but instead it
|
||||
was treated as if no socket was needing monitoring so again REMOVE was
|
||||
called prematurely.
|
||||
|
||||
Daniel Stenberg (13 May 2008)
|
||||
- Added test case 556 that uses curl_easy_send() and curl_easy_recv()
|
||||
|
||||
Daniel Stenberg (9 May 2008)
|
||||
- Introducing curl_easy_send() and curl_easy_recv(). They can be used to send
|
||||
and receive data over a connection previously setup with curl_easy_perform()
|
||||
and its CURLOPT_CONNECT_ONLY option. The sendrecv.c example was added to
|
||||
show how they can be used.
|
||||
|
||||
Yang Tse (9 May 2008)
|
||||
- Internal time differences now use monotonic time source if available.
|
||||
This also implies the removal of the winmm.lib dependency for WIN32.
|
||||
|
||||
Daniel Stenberg (9 May 2008)
|
||||
- Stefan Krause reported a busy-looping case when using the multi interface
|
||||
and doing CONNECT to a proxy. The app would then busy-loop until the proxy
|
||||
completed its response.
|
||||
|
||||
Michal Marek (9 May 2008)
|
||||
- Make Curl_write and it's callees accept a const pointer, in preparation
|
||||
of tetetest's patch for curl_easy_send()
|
||||
|
||||
Daniel Stenberg (7 May 2008)
|
||||
- Liam Healy filed the debian bug report #480044
|
||||
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=480044) identifying a
|
||||
segfault when using krb5 ftp, but the krb4 code had the same problem.
|
||||
|
||||
Yang Tse (7 May 2008)
|
||||
- Christopher Palow provided the patch (edited by me) that introduces the
|
||||
use of microsecond resolution keys for internal splay trees.
|
||||
|
||||
Daniel Stenberg (4 May 2008)
|
||||
- Yuriy Sosov pointed out a configure fix for detecting c-ares when that is
|
||||
built debug-enabled.
|
||||
|
||||
Daniel Stenberg (3 May 2008)
|
||||
- Ben Van Hof filed bug report #1945240: "libcurl sometimes sends body twice
|
||||
when using CURL_AUTH_ANY" (http://curl.haxx.se/bug/view.cgi?id=1945240).
|
||||
The problem was that when libcurl rewound a stream meant for upload when it
|
||||
would prepare for a second request, it could accidentally continue the
|
||||
sending of the rewound data on the first request instead of on the second.
|
||||
Ben also provided test case 1030 that verifies this fix.
|
||||
|
||||
Daniel Stenberg (3 May 2008)
|
||||
- Jean-Francois Bertrand reported a libcurl crash with CURLOPT_TCP_NODELAY
|
||||
since libcurl used getprotobyname() and that isn't thread-safe. We now
|
||||
switched to use IPPROTO_TCP unconditionally, but perhaps the proper fix is
|
||||
to detect the thread-safe version of the function and use that.
|
||||
http://curl.haxx.se/mail/lib-2008-05/0011.html
|
||||
|
||||
Daniel Stenberg (1 May 2008)
|
||||
- Bart Whiteley provided a patch that made libcurl work properly when an app
|
||||
uses the CURLOPT_OPENSOCKETFUNCTION callback to create a unix domain socket
|
||||
to a http server.
|
||||
|
||||
Daniel Stenberg (29 Apr 2008)
|
||||
- To make it easier for applications that want lots of magic stuff done on
|
||||
redirections and thus cannot use CURLOPT_FOLLOWLOCATION easily, we now
|
||||
introduce the new CURLINFO_REDIRECT_URL option that lets applications
|
||||
extract the URL libcurl would've redirected to if it had been told to. This
|
||||
then enables the application to continue to that URL as it thinks is
|
||||
suitable, without having to re-implement the magic of creating the new URL
|
||||
from the Location: header etc. Test 1029 verifies it.
|
||||
|
||||
Yang Tse (29 Apr 2008)
|
||||
- Improved easy interface resolving timeout handling in c-ares enabled builds
|
||||
|
||||
Daniel Fandrich (28 Apr 2008)
|
||||
- Added test 1028 to test an HTTP redirect to a FTP URL.
|
||||
|
||||
Daniel Stenberg (28 Apr 2008)
|
||||
- Norbert Frese filed bug report #1951588: "Problem with curlftpfs and
|
||||
libcurl" (http://curl.haxx.se/bug/view.cgi?id=1951588) which seems to be an
|
||||
identical report to what Denis Golovan reported in
|
||||
http://curl.haxx.se/mail/lib-2008-02/0108.html The FTP code didn't reset the
|
||||
user/password pointers properly even though there might've been a new
|
||||
struct/cconnection getting used.
|
||||
|
||||
Daniel Stenberg (26 Apr 2008)
|
||||
- Reverted back to use automake 1.9.6 in the next release (from automake
|
||||
1.10.1) since it *still* suffers from Solaris-related bugs. Our previous
|
||||
automake 1.10 problem was reported in bug #1701360
|
||||
(http://curl.haxx.se/bug/view.cgi?id=1701360) and this recent problem was
|
||||
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.
|
||||
|
||||
Daniel Fandrich (24 Apr 2008)
|
||||
- Made --stderr able to redirect all stderr messages.
|
||||
|
||||
Yang Tse (23 Apr 2008)
|
||||
- Improve synchronization between test harness runtests.pl script
|
||||
and test harness servers to minimize risk of false test failures.
|
||||
|
||||
Daniel Fandrich (22 Apr 2008)
|
||||
- Added support for running on Symbian OS.
|
||||
|
||||
Daniel Fandrich (18 Apr 2008)
|
||||
- Added test cases 1026 and 1027 to do some rudimentary tests on the --manual
|
||||
and --help options.
|
||||
|
||||
Michal Marek (14 Apr 2008)
|
||||
- allow disabling the typechecker by defining CURL_DISABLE_TYPECHECK, as
|
||||
discussed in http://curl.haxx.se/mail/lib-2008-04/0291.html
|
||||
|
||||
Daniel Stenberg (14 Apr 2008)
|
||||
- Stefan Krause reported a case where the OpenSSL handshake phase wasn't
|
||||
properly acknowledging the timeout values, like if you pulled the network
|
||||
plug in the midst of it.
|
||||
|
||||
- Andre Guibert de Bruet fixed a second case of not checking the malloc()
|
||||
return code in the Negotiate code.
|
||||
|
||||
- Sandor Feldi reported bug #1942022
|
||||
(http://curl.haxx.se/bug/view.cgi?id=1942022) pointing out a mistake in the
|
||||
lib/Makefile.vc[68] makefiles' release-ssl-dll target.
|
||||
|
||||
- Brock Noland reported that curl behaved differently depending on which order
|
||||
you used -i and -I.
|
||||
|
||||
Daniel Stenberg (12 Apr 2008)
|
||||
- Andre Guibert de Bruet found and fixed a case where malloc() was called but
|
||||
was not checked for a NULL return, in the Negotiate code.
|
||||
|
||||
Daniel Fandrich (9 Apr 2008)
|
||||
- Added test cases 1024 & 1025 to test a scenario similar to the one reported
|
||||
by Ben Combee where libcurl would send the wrong cookie to a redirected
|
||||
server. libcurl was doing the right thing in these test cases.
|
||||
|
||||
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.
|
||||
|
||||
Daniel Stenberg (5 Apr 2008)
|
||||
- Alexey Simak fixed curl_easy_reset() to reset the max redirect limit properly
|
||||
|
||||
- Based on the Debian bug report #474224 that complained about the FTP error
|
||||
message when libcurl doesn't get a 220 back immediately on connect, I now
|
||||
changed it to be more specific on what the problem is. Also worth noticing:
|
||||
while the bug report contains an example where the response is:
|
||||
|
||||
421 There are too many connected users, please try again later
|
||||
|
||||
we cannot assume that the error message will always be this readable nor
|
||||
that it fits within a particular boundary etc.
|
||||
|
||||
Daniel Fandrich (3 Apr 2008)
|
||||
- Added test627 to test SFTP with CURLOPT_NOBODY
|
||||
|
||||
Daniel Stenberg (3 Apr 2008)
|
||||
- Setting CURLOPT_NOBODY to FALSE will now switch the HTTP request method to
|
||||
GET simply because previously when you set CURLOPT_NOBODY to TRUE first and
|
||||
then FALSE you'd end up in a broken state where a HTTP request would do a
|
||||
HEAD by still act a lot like for a GET and hang waiting for the content etc.
|
||||
|
||||
- Scott Barrett added support for CURLOPT_NOBODY over SFTP
|
||||
|
||||
Daniel Fandrich (3 Apr 2008)
|
||||
- Made sure that curl_global_init is called in all the multithreaded
|
||||
example programs.
|
||||
|
||||
Michal Marek (31 Mar 2008)
|
||||
- Removed the generated ca-bundle.h file. The verbatim value of $ca and
|
||||
$capath is known to configure, so it can be defined in config.h instead.
|
||||
|
||||
Daniel Stenberg (31 Mar 2008)
|
||||
- Added CURLFORM_STREAM as a supported option to curl_formadd() to allow an
|
||||
application to provide data for a multipart with the read callback. Note
|
||||
that the size needs to be provided with CURLFORM_CONTENTSLENGTH when the
|
||||
stream option is used. This feature is verified by the new test case
|
||||
554. This feature was sponsored by Xponaut.
|
||||
|
||||
Daniel Fandrich (30 Mar 2008)
|
||||
- Changed the makefile so the doc/examples/ programs are never built in a
|
||||
normal build/install (only with the 'make check' target), so that a
|
||||
build failure in the examples isn't fatal.
|
||||
|
||||
Version 7.18.1 (30 March 2008)
|
||||
|
||||
Daniel Stenberg (28 Mar 2008)
|
||||
- Stephen Collyer pointed out that configure --with-libssh2 without a given
|
||||
path didn't work properly.
|
||||
|
||||
Daniel Stenberg (27 Mar 2008)
|
||||
- As found out and reported by Dan Petitt, libcurl didn't show progress/call
|
||||
the progress callback for the first (potentially huge) piece of body data
|
||||
sent together with the POST request headers in the initial send().
|
||||
|
||||
Daniel Stenberg (25 Mar 2008)
|
||||
- Made setting the CURLOPT_SSL_CTX_FUNCTION option return a failure in case
|
||||
libcurl wasn't built to use OpenSSL as that is a prerequisite for this
|
||||
option to function!
|
||||
|
||||
Daniel Stenberg (22 Mar 2008)
|
||||
- Fixed the problem with doing a zero byte SCP transfer, verified with test
|
||||
case 617 (which was added by Daniel Fandrich 5 Mar 2008).
|
||||
|
||||
Daniel Fandrich (20 Mar 2008)
|
||||
- Fixed a problem where curl-config --protocols could erroneously show LDAPS
|
||||
support when curl didn't even have regular LDAP support. It looks like
|
||||
this could happen when the --enable-ldaps configure switch is given but
|
||||
configure couldn't find the LDAP headers or libraries.
|
||||
|
||||
Michal Marek (20 Mar 2008)
|
||||
- Added --with-ca-path=DIRECTORY configure option to use an openSSL CApath by
|
||||
default instead of a ca bundle. The configure script will also look for a
|
||||
ca path if no ca bundle is found and no option given.
|
||||
|
||||
- Fixed detection of previously installed curl-ca-bundle.crt
|
||||
|
||||
Daniel Fandrich (18 Mar 2008)
|
||||
- Added test 626 to reproduce an infinite loop when given an invalid
|
||||
SFTP quote command reported by Vincent Le Normand, and fixed it.
|
||||
|
||||
Michal Marek (18 Mar 2008)
|
||||
- Added curl_easy_getinfo typechecker.
|
||||
|
||||
- Added macros for curl_share_setopt and curl_multi_setopt to check at least
|
||||
the correct number of arguments.
|
||||
|
||||
Daniel Fandrich (13 Mar 2008)
|
||||
- Added tests 622-625 to test SFTP/SCP uploads. Test 625 was an attempt to
|
||||
reproduce the --ftp-create-dirs problem reported by Brian Ulm, but that
|
||||
seems to need a call curl_easy_reset() which this test case doesn't do.
|
||||
|
||||
Daniel Stenberg (13 Mar 2008)
|
||||
- Brian Ulm figured out that if you did an SFTP upload with
|
||||
CURLOPT_FTP_CREATE_MISSING_DIRS to create a directory, and then re-used the
|
||||
handle and uploaded another file to another directory that needed to be
|
||||
created, the second upload would fail. Another case of a state variable that
|
||||
wasn't properly reset between requests.
|
||||
|
||||
- I rewrote the 100-continue code to use a single state variable instead of
|
||||
the previous two ones. I think it made the logic somewhat clearer.
|
||||
|
||||
Daniel Stenberg (11 Mar 2008)
|
||||
- Dmitry Popov filed bug report #1911069
|
||||
(http://curl.haxx.se/bug/view.cgi?id=1911069) that identified a race
|
||||
condition in the name resolver code when the DNS cache is shared between
|
||||
multiple easy handles, each running in simultaneous threads that could cause
|
||||
crashes.
|
||||
|
||||
- Added a macro for curl_easy_setopt() that accepts three arguments and simply
|
||||
does nothing with them, just to make sure libcurl users always use three
|
||||
arguments to this function. Due to its use of ... for the third argument, it
|
||||
is otherwise hard to detect abuse.
|
||||
|
||||
Michal Marek (11 Mar 2008)
|
||||
- Added a type checking macro for curl_easy_setopt(), needs gcc-4.3 and only
|
||||
works in C mode atm (http://curl.haxx.se/mail/lib-2008-02/0267.html ,
|
||||
http://curl.haxx.se/mail/lib-2008-02/0292.html )
|
||||
|
||||
Daniel Fandrich (10 Mar 2008)
|
||||
- Added tests 618-621 to test SFTP/SCP transfers of more than one file
|
||||
(test 620 tests the just-fixed problem reported by Brian Ulm).
|
||||
|
||||
Daniel Stenberg (9 Mar 2008)
|
||||
- Brian Ulm reported a crash when doing a second SFTP transfer on a re-used
|
||||
easy handle if curl_easy_reset() was used between them. I fixed it and Brian
|
||||
verified that it cured his problem.
|
||||
|
||||
- Brian Ulm reported that if you first tried to download a non-existing SFTP
|
||||
file and then fetched an existing one and re-used the handle, libcurl would
|
||||
still report the second one as non-existing as well! I fixed it and Brian
|
||||
verified that it cured his problem.
|
||||
|
||||
Michal Marek (6 Mar 2008)
|
||||
- Fix the gssapi configure check to detect newer MIT Kerberos (patch by
|
||||
Michael Calmer)
|
||||
|
||||
Yang Tse (6 Mar 2008)
|
||||
- Fix regression on Curl_socket_ready() and Curl_poll() so that these will
|
||||
again fail on select/poll errors different than EINTR.
|
||||
|
||||
Daniel Fandrich (5 Mar 2008)
|
||||
- Fixed the test harness so it will write out zero-length data files.
|
||||
|
||||
- Added tests 616 and 617 to see how SFTP and SCP cope with zero-length
|
||||
files, as questioned by Mike Protts. SFTP does for me but SCP doesn't
|
||||
so test 617 is disabled for now.
|
||||
|
||||
Daniel S (4 Mar 2008)
|
||||
- Mike Protts brought a patch that makes resumed transfers work with SFTP.
|
||||
|
||||
Daniel S (1 Mar 2008)
|
||||
- Anatoli Tubman found and fixed a crash with Negotiate authentication used on
|
||||
a re-used connection where both requests used Negotiate.
|
||||
|
||||
Guenter Knauf (26 Feb 2008)
|
||||
- Kaspar Brand provided a patch to support server name indication (RFC 4366).
|
||||
|
||||
Daniel S (25 Feb 2008)
|
||||
- Kaspar Brand made GnuTLS-built libcurl properly acknowledge the option that
|
||||
forces it to prefer SSLv3.
|
||||
|
||||
Daniel S (23 Feb 2008)
|
||||
- Sam Listopad provided a patch in feature-request #1900014
|
||||
http://curl.haxx.se/bug/feature.cgi?id=1900014 that makes libcurl (built to
|
||||
use OpenSSL) support a full chain of certificates in a given PKCS12
|
||||
certificate.
|
||||
|
||||
Daniel S (22 Feb 2008)
|
||||
- Georg Lippitsch made the src/Makefile.vc6 makefile use the same memory model
|
||||
options as the lib/Makefile.vc6 already did.
|
||||
|
||||
Daniel S (21 Feb 2008)
|
||||
- Zmey Petroff found a crash when libcurl accessed a NULL pointer, which
|
||||
happened if you set the connection cache size to 1 and for example failed to
|
||||
login to an FTP site. Bug report #1896698
|
||||
(http://curl.haxx.se/bug/view.cgi?id=1896698)
|
||||
|
||||
Daniel S (20 Feb 2008)
|
||||
- Fixed test case 405 to not fail when libcurl is built with GnuTLS
|
||||
|
||||
- Based on initial work done by Gautam Kachroo to address a bug, we now keep
|
||||
better control at the exact state of the connection's SSL status so that we
|
||||
know exactly when it has completed the SSL negotiation or not so that there
|
||||
won't be accidental re-uses of connections that are wrongly believed to be
|
||||
in SSL-completed-negotiate state.
|
||||
|
||||
- We no longer support setting the CURLOPT_URL option from inside a callback
|
||||
such as the CURLOPT_SSL_CTX_FUNCTION one treat that as if it was a Location:
|
||||
following. The patch that introduced this feature was done for 7.11.0, but
|
||||
this code and functionality has been broken since about 7.15.4 (March 2006)
|
||||
with the introduction of non-blocking OpenSSL "connects".
|
||||
|
||||
It was a hack to begin with and since it doesn't work and hasn't worked
|
||||
correctly for a long time and nobody has even noticed, I consider it a very
|
||||
suitable subject for plain removal. And so it was done.
|
||||
|
||||
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
|
||||
|
||||
Daniel S (18 Feb 2008)
|
||||
- We're no longer providing a very old ca-bundle in the curl tarball. You can
|
||||
get a fresh one downloaded and created with 'make ca-bundle' or you can get
|
||||
one from here => http://curl.haxx.se/docs/caextract.html if you want a fresh
|
||||
new one extracted from Mozilla's recent list of ca certs.
|
||||
|
||||
The configure option --with-ca-bundle now lets you specify what file to use
|
||||
as default ca bundle for your build. If not specified, the configure script
|
||||
will check a few known standard places for a global ca cert to use.
|
||||
|
||||
Daniel S (17 Feb 2008)
|
||||
- Jerome Muffat-Meridol helped me fix Curl_done() to close the current
|
||||
connection by force when it was called before the entire request is
|
||||
completed, simply because we can't know if the connection really can be
|
||||
re-used safely at that point.
|
||||
|
||||
- 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
|
||||
failed to get the server cert even though no verification was asked for.
|
||||
Public server showing the problem: https://www.net222.caisse-epargne.fr
|
||||
|
||||
- Fix my Curl_timeleft() leftover mistake in the gnutls code
|
||||
|
||||
- Pooyan McSporran found and fixed a flaw where you first would do a normal
|
||||
http request and then you'd reuse the handle and replace the Accept: header,
|
||||
as then libcurl would send two Accept: headers!
|
||||
|
||||
Daniel S (11 Feb 2008)
|
||||
- Yang Tse pointed out a few remaining quirks from my timeout refactoring from
|
||||
Feb 7 that didn't abort properly on timeouts. These are actually old
|
||||
problems but now they should be fixed.
|
||||
|
||||
Yang Tse (10 Feb 2008)
|
||||
- Bug report #1888932 (http://curl.haxx.se/bug/view.cgi?id=1888932) points out
|
||||
and provides test program that demonstrates that libcurl might not set error
|
||||
description message for error CURLE_COULDNT_RESOLVE_HOST for Windows threaded
|
||||
name resolver builds. Fixed now.
|
||||
|
||||
Daniel Fandrich (8 Feb 2007)
|
||||
- Added key words to all SSL-using tests so they can be skipped if necessary.
|
||||
Removed a few unnecessary requires SSL statements.
|
||||
|
||||
Daniel S (8 Feb 2008)
|
||||
- Mike Hommey filed and fixed bug report #1889856
|
||||
(http://curl.haxx.se/bug/view.cgi?id=1889856): When using the gnutls ssl
|
||||
layer, cleaning-up and reinitializing curl ends up with https requests
|
||||
failing with "ASN1 parser: Element was not found" errors. Obviously a
|
||||
regression added in 7.16.3.
|
||||
|
||||
Yang Tse (8 Feb 2008)
|
||||
- Improved test harness SCP/SFTP start up server verification, doing a real
|
||||
connection to the sftp server, authenticating and running a simple sftp
|
||||
pwd command using the test harness generated configuration and key files.
|
||||
|
||||
Daniel S (8 Feb 2008)
|
||||
- G<>nter Knauf added lib/mk-ca-bundle.pl which gets the Firefox ca bundle and
|
||||
creates a suitable ca-bundle.crt file in PEM format for use with curl. The
|
||||
recommended way to run it is to use 'make ca-bundle' in the build tree root.
|
||||
|
||||
Daniel Fandrich (7 Feb 2007)
|
||||
- Added tests 1022 and 1023 to validate output of curl-config --version and
|
||||
--vernum
|
||||
|
||||
Daniel S (7 Feb 2008)
|
||||
- Refactored a lot of timeout code into a few functions in an attempt to make
|
||||
them all use the same (hopefully correct) logic to make it less error-prone
|
||||
and easier to introduce library-wide where it should be used.
|
||||
|
||||
Yang Tse (6 Feb 2008)
|
||||
- Fix an issue in strdup replacement function when dealing with absolutely
|
||||
huge strings. Only systems without a standard strdup would be affected.
|
||||
|
||||
Daniel S (3 Feb 2008)
|
||||
- Dmitry Kurochkin cleaned up the pipelining code and removed the need for and
|
||||
use of the "is_in_pipeline" struct field.
|
||||
|
||||
- I wrote up and added the threaded-ssl.c example source code that shows how
|
||||
to do multi-threaded downloads of HTTPS files with a libcurl that is built
|
||||
with OpenSSL. It uses pthreads for the threading.
|
||||
|
||||
Daniel S (31 Jan 2008)
|
||||
- Niklas Angebrand made the cookie support in libcurl properly deal with the
|
||||
"HttpOnly" feature introduced by Microsoft and apparently also supported by
|
||||
Firefox: http://msdn2.microsoft.com/en-us/library/ms533046.aspx . HttpOnly
|
||||
is now supported when received from servers in HTTP headers, when written to
|
||||
cookie jars and when read from existing cookie jars.
|
||||
|
||||
I modified test case 31 and 46 to also do some basic HttpOnly testing.
|
||||
|
||||
- Dmitry Kurochkin moved several struct fields from the connectdata struct to
|
||||
the SingleRequest one to make pipelining better. It is a bit tricky to keep
|
||||
them in the right place, to keep things related to the actual request or to
|
||||
the actual connection in the right place.
|
||||
|
||||
Daniel S (29 Jan 2008)
|
||||
- Dmitry Kurochkin fixed Curl_done() for pipelining, as it could previously
|
||||
crash!
|
||||
|
||||
- Michal Marek fixed minor mistake in test case 553 that prevented it from
|
||||
working on other IP-addresses or port numbers.
|
||||
|
||||
Version 7.18.0 (28 January 2008)
|
||||
|
||||
Daniel S (27 Jan 2008)
|
||||
- Dmitry Kurochkin: In "real world" testing I found more bugs in
|
||||
pipelining. Broken connection is not restored and we get into infinite
|
||||
loop. It happens because of wrong is_in_pipeline values.
|
||||
|
||||
Daniel S (26 Jan 2008)
|
||||
- Kevin Reed filed bug report #1879375
|
||||
(http://curl.haxx.se/bug/view.cgi?id=1879375) which describes how libcurl
|
||||
got lost in this scenario: proxy tunnel (or HTTPS over proxy), ask to do any
|
||||
proxy authentication and the proxy replies with an auth (like NTLM) and then
|
||||
closes the connection after that initial informational response.
|
||||
|
||||
libcurl would not properly re-initialize the connection to the proxy and
|
||||
continue the auth negotiation like supposed. It does now however, as it will
|
||||
now detect if one or more authentication methods were available and asked
|
||||
for, and will thus retry the connection and continue from there.
|
||||
|
||||
- I made the progress callback get called properly during proxy CONNECT.
|
||||
|
||||
Daniel S (23 Jan 2008)
|
||||
- Igor Franchuk pointed out that CURLOPT_COOKIELIST set to "ALL" leaked
|
||||
memory, and so did "SESS". Fixed now.
|
||||
|
||||
Yang Tse (22 Jan 2008)
|
||||
- Check poll.h at configuration time, and use it when sys/poll.h unavailable
|
||||
|
||||
Daniel S (22 Jan 2008)
|
||||
- Dmitry Kurochkin removed the cancelled state for pipelining, as we agreed
|
||||
that it is bad anyway. Starting now, removing a handle that is in used in a
|
||||
pipeline will break the pipeline - it'll be set back up again but still...
|
||||
|
||||
Yang Tse (21 Jan 2008)
|
||||
- Disable ldap support for cygwin builds, since it breaks whole build process.
|
||||
Fixing it will affect other platforms, so it is postponed for another release.
|
||||
|
||||
Daniel S (18 Jan 2008)
|
||||
- Lau Hang Kin found and fixed a problem with the multi interface when doing
|
||||
CONNECT over a proxy. curl_multi_fdset() didn't report back the socket
|
||||
properly during that state, due to a missing case in the switch in the
|
||||
multi_getsock() function.
|
||||
|
||||
Yang Tse (17 Jan 2008)
|
||||
- Don't abort tests 518 and 537 when unable to raise the open-file soft limit.
|
||||
|
||||
Daniel S (16 Jan 2008)
|
||||
- Nathan Coulter's patch that makes runtests.pl respect the PATH when figuring
|
||||
out what valgrind to run.
|
||||
|
||||
Yang Tse (16 Jan 2008)
|
||||
- Improved handling of out of memory in the command line tool that afected
|
||||
data url encoded HTTP POSTs when reading it from a file.
|
||||
|
||||
Daniel S (16 Jan 2008)
|
||||
- Dmitry Kurochkin worked a lot on improving the HTTP Pipelining support that
|
||||
previously had a number of flaws, perhaps most notably when an application
|
||||
fired up N transfers at once as then they wouldn't pipeline at all that
|
||||
nicely as anyone would think... Test case 530 was also updated to take the
|
||||
improved functionality into account.
|
||||
|
||||
- Calls to Curl_failf() are not supposed to provide a trailing newline as the
|
||||
function itself adds that. Fixed on 50 or something strings!
|
||||
|
||||
Daniel S (15 Jan 2008)
|
||||
- I made the torture test on test 530 go through. This was actually due to
|
||||
silly code left from when we switched to let the multi handle "hold" the dns
|
||||
cache when using the multi interface... Of course this only triggered when a
|
||||
certain function call returned error at the correct moment.
|
||||
|
||||
Daniel S (14 Jan 2008)
|
||||
- Joe Malicki filed bug report #1871269
|
||||
(http://curl.haxx.se/bug/view.cgi?id=1871269) and we could fix his hang-
|
||||
problem that occurred when doing a large HTTP POST request with the
|
||||
response-body read from a callback.
|
||||
|
||||
Daniel S (12 Jan 2008)
|
||||
- I re-arranged the curl --help output. All the options are now sorted on
|
||||
their long option names and all descriptions are one-liners.
|
||||
|
||||
- Eric Landes provided the patch (edited by me) that introduces the
|
||||
--keepalive-time to curl to set the keepalive probe interval. I also took
|
||||
the opportunity to rename the recently added no-keep-alive option to
|
||||
no-keepalive to keep a consistent naming and to avoid getting two dashes in
|
||||
these option names. Eric also provided an update to the man page for the new
|
||||
option.
|
||||
|
||||
Daniel S (11 Jan 2008)
|
||||
- Daniel Egger made CURLOPT_RANGE work on file:// URLs the very same way it
|
||||
already worked for FTP:// URLs.
|
||||
|
||||
- I made the curl tool switch from using CURLOPT_IOCTLFUNCTION to now use the
|
||||
spanking new CURLOPT_SEEKFUNCTION simply to take advantage of the improved
|
||||
performance for the upload resume cases where you want to upload the last
|
||||
few bytes of a very large file. To implement this decently, I had to switch
|
||||
the client code for uploading from fopen()/fread() to plain open()/read() so
|
||||
that we can use lseek() to do >32bit seeks (as fseek() doesn't allow that)
|
||||
on systems that offer support for that.
|
||||
|
||||
Daniel S (10 Jan 2008)
|
||||
- Michal Marek made curl-config --libs not include /usr/lib64 in the output
|
||||
(it already before skipped /usr/lib). /usr/lib64 is the default library
|
||||
directory on many 64bit systems and it's unlikely that anyone would use the
|
||||
path privately on systems where it's not.
|
||||
|
||||
- Georg Lippitsch brought CURLOPT_SEEKFUNCTION and CURLOPT_SEEKDATA to allow
|
||||
libcurl to seek in a given input stream. This is particularly important when
|
||||
doing upload resumes when there's already a huge part of the file present
|
||||
remotely. Before, and still if this callback isn't used, libcurl will read
|
||||
and through away the entire file up to the point to where the resuming
|
||||
begins (which of course can be a slow opereration depending on file size,
|
||||
I/O bandwidth and more). This new function will also be preferred to get
|
||||
used instead of the CURLOPT_IOCTLFUNCTION for seeking back in a stream when
|
||||
doing multi-stage HTTP auth with POST/PUT.
|
||||
|
||||
- Nikitinskit Dmitriy filed bug report #1868255
|
||||
(http://curl.haxx.se/bug/view.cgi?id=1868255) with a patch. It identifies
|
||||
and fixes a problem with parsing WWW-Authenticate: headers with additional
|
||||
spaces in the line that the parser wasn't written to deal with.
|
||||
|
||||
Daniel S (8 Jan 2008)
|
||||
- Introducing curl_easy_pause() and new magic return codes for both the read
|
||||
and the write callbacks that now can make a connection's reading and/or
|
||||
writing get paused.
|
||||
|
||||
Daniel S (6 Jan 2008)
|
||||
- Jeff Johnson filed bug report #1863171
|
||||
(http://curl.haxx.se/bug/view.cgi?id=1863171) where he pointed out that
|
||||
libcurl's date parser didn't accept a +1300 time zone which actually is used
|
||||
fairly often (like New Zealand's Dailight Savings Time), so I modified the
|
||||
parser to now accept up to and including -1400 to +1400.
|
||||
|
||||
Daniel S (5 Jan 2008)
|
||||
- Based on further discussion on curl-library, I reverted yesterday's SOCKS5
|
||||
code to instead introduce support for a new proxy type called
|
||||
CURLPROXY_SOCKS5_HOSTNAME that is used to send the host name to the proxy
|
||||
instead of IP address and there's thus no longer any need for a new
|
||||
curl_easy_setopt() option.
|
||||
|
||||
The default SOCKS5 proxy is again back to sending the IP address to the
|
||||
proxy. The new curl command line option for enabling sending host name to a
|
||||
SOCKS5 proxy is now --socks5-hostname.
|
||||
|
||||
Daniel S (4 Jan 2008)
|
||||
- Based on Maxim Perenesenko's patch, we now do SOCKS5 operations and let the
|
||||
proxy do the host name resolving and only if --socks5ip (or
|
||||
CURLOPT_SOCKS5_RESOLVE_LOCAL) is used we resolve the host name locally and
|
||||
pass on the IP address only to the proxy.
|
||||
|
||||
Yang Tse (3 Jan 2008)
|
||||
- Modified test harness to allow SCP, SFTP and SOCKS4 tests to run with
|
||||
OpenSSH 2.9.9, SunSSH 1.0 or later versions. SOCKS5 tests need OpenSSH
|
||||
3.7, SunSSH 1.0 or later.
|
||||
|
||||
Daniel S (2 Jan 2008)
|
||||
- I fixed two cases of missing return code checks when handling chunked
|
||||
decoding where a write error (or abort return from a callback) didn't stop
|
||||
libcurl's processing.
|
||||
|
||||
- I removed the socklen_t use from the public curl/curl.h header and instead
|
||||
made it an unsigned int. The type was only used in the curl_sockaddr struct
|
||||
definition (only used by the curl_opensocket_callback). On all platforms I
|
||||
could find information about, socklen_t is 32 unsigned bits large so I don't
|
||||
think this will break the API or ABI. The main reason for this change is of
|
||||
course for all the platforms that don't have a socklen_t definition in their
|
||||
headers to build fine again. Providing our own configure magic and custom
|
||||
definition of socklen_t on those systems proved to work but was a lot of
|
||||
cruft, code and extra magic needed - when this very small change of type
|
||||
seems harmless and still solves the missing socklen_t problem.
|
||||
|
||||
- Richard Atterer brought a patch that added support for SOCKS4a proxies,
|
||||
which is an inofficial PROXY4 variant that sends the hostname to the proxy
|
||||
instead of the resolved address (which is already supported by SOCKS5).
|
||||
--socks4a is the curl command line option for it and CURLOPT_PROXYTYPE can
|
||||
now be set to CURLPROXY_SOCKS4A as well.
|
||||
|
||||
Daniel S (1 Jan 2008)
|
||||
- Mohun Biswas pointed out that --libcurl generated a source code with an int
|
||||
function but without a return statement. While fixing that, I also took care
|
||||
about adding some better comments for the generated code.
|
||||
|
||||
Daniel S (27 Dec 2007)
|
||||
- Dmitry Kurochkin mentioned a flaw
|
||||
(http://curl.haxx.se/mail/lib-2007-12/0252.html) in detect_proxy() which
|
||||
failed to set the bits.proxy variable properly when an environment variable
|
||||
told libcurl to use a http proxy.
|
||||
|
||||
Daniel S (26 Dec 2007)
|
||||
- In an attempt to repeat the problem in bug report #1850730
|
||||
(http://curl.haxx.se/bug/view.cgi?id=1850730) I wrote up test case 552. The
|
||||
test is doing a 70K POST with a read callback and an ioctl callback over a
|
||||
proxy requiring Digest auth. The test case code is more or less identical to
|
||||
the test recipe code provided by Spacen Jasset (who submitted the bug
|
||||
report).
|
||||
|
||||
Daniel S (25 Dec 2007)
|
||||
- Gary Maxwell filed bug report #1856628
|
||||
(http://curl.haxx.se/bug/view.cgi?id=1856628) and provided a fix for the
|
||||
(small) memory leak in the SSL session ID caching code. It happened when a
|
||||
previous entry in the cache was re-used.
|
||||
|
||||
Daniel Fandrich (19 Dec 2007)
|
||||
- Ensure that nroff doesn't put anything but ASCII characters into the
|
||||
--manual text.
|
||||
|
||||
Yang Tse (18 Dec 2007)
|
||||
- MSVC 9.0 (VS2008) does not support Windows build targets prior to WinXP,
|
||||
and makes wrong asumptions of build target when it isn't specified. So,
|
||||
if no build target has been defined we will target WinXP when building
|
||||
curl/libcurl with MSVC 9.0 (VS2008).
|
||||
|
||||
- (http://curl.haxx.se/mail/archive-2007-12/0039.html) reported and fixed
|
||||
a file truncation problem on Windows build targets triggered when retrying
|
||||
a download with curl.
|
||||
|
||||
Daniel S (17 Dec 2007)
|
||||
- Mateusz Loskot pointed out that MSVC 9.0 (VS2008) has the pollfd struct and
|
||||
defines in winsock2.h somehow differently than previous versions and that
|
||||
curl 7.17.1 would fail to compile out of the box.
|
||||
|
||||
Daniel S (13 Dec 2007)
|
||||
- David Wright filed bug report #1849764
|
||||
(http://curl.haxx.se/bug/view.cgi?id=1849764) with an included fix. He
|
||||
identified a problem for re-used connections that previously had sent
|
||||
Expect: 100-continue and in some situations the subsequent POST (that didn't
|
||||
use Expect:) still had the internal flag set for its use. David's fix (that
|
||||
makes the setting of the flag in every single request unconditionally) is
|
||||
fine and is now used!
|
||||
|
||||
Daniel S (12 Dec 2007)
|
||||
- Gilles Blanc made the curl tool enable SO_KEEPALIVE for the connections and
|
||||
added the --no-keep-alive option that can disable that on demand.
|
||||
|
||||
Daniel S (9 Dec 2007)
|
||||
- Andrew Moise filed bug report #1847501
|
||||
(http://curl.haxx.se/bug/view.cgi?id=1847501) and pointed out a memcpy()
|
||||
that should be memmove() in the convert_lineends() function.
|
||||
|
||||
Daniel S (8 Dec 2007)
|
||||
- Renamed all internal static functions that had Curl_ prefixes to no longer
|
||||
have them. The Curl_ prefix is exclusively used for library internal global
|
||||
symbols. Static functions can be named anything, except for using Curl_ or
|
||||
curl_ prefixes. This is for consistency and for easier maintainance and
|
||||
overview.
|
||||
|
||||
- Cleaned up and reformatted the TODO document to look like the FAQ and
|
||||
CONTRIBUTE, which makes nicer web pages
|
||||
|
||||
- Added test cases 549 and 550 that test CURLOPT_PROXY_TRANSFER_MODE.
|
||||
|
||||
- Added keywords on a bunch of test cases
|
||||
|
||||
- Fixed an OOM problem in the curl code that would lead to fclose on a bad
|
||||
handle and crash
|
||||
|
||||
Daniel S (5 Dec 2007)
|
||||
- Spacen Jasset reported a problem with doing POST (with data read with a
|
||||
callback) over a proxy when NTLM is used as auth with the proxy. The bug
|
||||
also concerned Digest and was limited to using callback only. Spacen worked
|
||||
with us to provide a useful patch. I added the test case 547 and 548 to
|
||||
verify two variations of POST over proxy with NTLM.
|
||||
|
||||
Daniel S (3 Dec 2007)
|
||||
- Ray Pekowski filed bug report #1842029
|
||||
(http://curl.haxx.se/bug/view.cgi?id=1842029) in which he identified a
|
||||
problem with SSL session caching that prevent it from working, and provided
|
||||
the associated fix!
|
||||
|
||||
- Now libcurl (built with OpenSSL) doesn't return error anymore if the remote
|
||||
SSL-based server doesn't present a certificate when the request is told to
|
||||
ignore certificate verification anyway.
|
||||
|
||||
- Michal Marek introduced CURLOPT_PROXY_TRANSFER_MODE which is used to control
|
||||
the appending of the "type=" thing on FTP URLs when they are passed to a
|
||||
HTTP proxy. Some proxies just don't like that appending (which is done
|
||||
unconditionally in 7.17.1), and some proxies treat binary/ascii transfers
|
||||
better with the appending done!
|
||||
|
||||
Daniel S (29 Nov 2007)
|
||||
- A bug report on the curl-library list showed a HTTP Digest session going on
|
||||
with a 700+ letter nonce. Previously libcurl only support 127 letter ones
|
||||
and now I bumped it to 1023.
|
||||
|
||||
- Fixed the resumed FTP upload loop to not require that the read callback
|
||||
returns a full buffer on each invoke.
|
||||
|
||||
Daniel S (25 Nov 2007)
|
||||
- Added test case 1015 that tests --data-urlencode in multiple ways
|
||||
|
||||
- Fixed --data-urlencode for when no @ or = are used
|
||||
|
||||
- Extended the user-agent buffer curl uses, since we can hit the 128 byte
|
||||
border with plenty development libraries used. Like my current set: "curl
|
||||
7.17.2-CVS (i686-pc-linux-gnu) libcurl/7.17.2-CVS OpenSSL/0.9.8g
|
||||
zlib/1.2.3.3 c-ares/1.5.2-CVS libidn/1.1 libssh2/0.19.0-CVS"
|
||||
|
||||
Daniel S (24 Nov 2007)
|
||||
- Internal rearrangements, so that the previous struct HandleData is no more.
|
||||
It is now known as SingleRequest and the Curl_transfer_keeper struct within
|
||||
that was remove entirely. This has the upside that there are less duplicate
|
||||
struct members that made it hard to see and remember what struct that was
|
||||
used to store what data. The transfer_keeper thing was once stored on a
|
||||
per-connection basis and then it made sense to have the duplicate info but
|
||||
since it was moved to the SessionHandle (in 7.16.0) it just added weirdness.
|
||||
The SingleRequest struct is used by data that only is valid for this single
|
||||
request.
|
||||
|
||||
Yang Tse (22 Nov 2007)
|
||||
- Provide a socklen_t definition in curl.h for Win32 API build targets
|
||||
which don't have one.
|
||||
|
||||
Daniel S (22 Nov 2007)
|
||||
- Alessandro Vesely helped me improve the --data-urlencode's syntax, parser
|
||||
and documentation.
|
||||
|
||||
Daniel S (21 Nov 2007)
|
||||
- While inspecting the Negotiate code, I noticed how the proxy auth was using
|
||||
the same state struct as the host auth, so both could never be used at the
|
||||
same time! I fixed it (without being able to check) to use two separate
|
||||
structs to allow authentication using Negotiate on host and proxy
|
||||
simultaneously.
|
||||
|
||||
Daniel S (20 Nov 2007)
|
||||
- Emil Romanus pointed out a bug that made an easy handle get the cookie
|
||||
engine activated when set to use a share (even if the share doesn't share
|
||||
cookies). I fixed it.
|
||||
|
||||
- Fixed a very long-lasting mprintf() bug that occurred when we did "%.*s%s",
|
||||
since the second %s would then wrongly used the numerical precision argument
|
||||
instead and crash.
|
||||
|
||||
- Introduced --data-urlencode to the curl tool for easier url encoding of the
|
||||
data sent in a post.
|
||||
|
||||
Daniel S (18 Nov 2007)
|
||||
- Rob Crittenden fixed SSL connections with NSS done with the multi-interface
|
||||
|
||||
Daniel S (17 Nov 2007)
|
||||
- Michal Marek made the test suite remember what test servers that fail to
|
||||
start so that subsequent tries are simply skipped.
|
||||
|
||||
- Andres Garcia made the examples build fine on Windows (mingw + msys) when
|
||||
the lib was built staticly.
|
||||
|
||||
Daniel S (16 Nov 2007)
|
||||
- Ates Goral identified a problem in http.c:add_buffer_send() when a debug
|
||||
callback was used, as it could wrongly pass on a bad size for the outgoing
|
||||
HTTP header. The bad size would be a very large value as it was a wrapped
|
||||
size_t content. This happened when the whole HTTP request failed to get sent
|
||||
in one single send. http://curl.haxx.se/mail/lib-2007-11/0165.html
|
||||
|
||||
Daniel S (15 Nov 2007)
|
||||
- Fixed yet another remaining problem with doing SFTP directory listings on a
|
||||
re-used persistent connection. Mentioned by Immanuel Gregoire on the mailing
|
||||
list.
|
||||
|
||||
- Michal Marek fixed the test suite to better deal with the case when the HTTP
|
||||
ipv6 server can't run.
|
||||
|
||||
Yang Tse (14 Nov 2007)
|
||||
- Fix a variable potential wrapping in add_buffer() when using absolutely
|
||||
huge send buffer sizes.
|
||||
|
||||
Daniel S (13 Nov 2007)
|
||||
- Fixed a remaining problem with doing SFTP directory listings on a re-used
|
||||
persistent connection. Mentioned by Immanuel Gregoire on the mailing list.
|
||||
|
||||
Daniel S (12 Nov 2007)
|
||||
- Bug report #1830637 (http://curl.haxx.se/bug/view.cgi?id=1830637), which was
|
||||
forwarded from the Gentoo bug tracker by Daniel Black and was originally
|
||||
submitted by Robin Johnson, pointed out that libcurl would do bad memory
|
||||
references when it failed and bailed out before the handler thing was
|
||||
setup. My fix is not done like the provided patch does it, but instead I
|
||||
make sure that there's never any chance for a NULL pointer in that struct
|
||||
member.
|
||||
|
||||
Yang Tse (10 Nov 2007)
|
||||
- Vikram Saxena (http://curl.haxx.se/mail/lib-2007-11/0096.html) pointed out
|
||||
that the pollfd struct was being multi defined when using VS2008. This is
|
||||
now fixed in /curl/lib/select.h
|
||||
|
||||
Daniel S (8 Nov 2007)
|
||||
- Bug report #1823487 (http://curl.haxx.se/bug/view.cgi?id=1823487) pointed
|
||||
out that SFTP requests didn't use persistent connections. Neither did SCP
|
||||
ones. I gave the SSH code a good beating and now both SCP and SFTP should
|
||||
use persistent connections fine. I also did a bunch of indent changes as
|
||||
well as a bug fix for the "keyboard interactive" auth.
|
||||
|
||||
Dan F (6 Nov 2007)
|
||||
- Improved telnet support by drastically reducing the number of write
|
||||
callbacks needed to pass a buffer to the user. Instead one per byte it
|
||||
is now as little as one per segment.
|
||||
|
||||
Yang Tse (6 Nov 2007)
|
||||
- Bug report #1824894 (http://curl.haxx.se/bug/view.cgi?id=1824894) pointed
|
||||
out a problem in curl.h when building C++ apps with MSVC. To fix it, the
|
||||
inclusion of header files in curl.h is moved outside of the C++ extern "C"
|
||||
linkage block.
|
||||
|
||||
Daniel S (1 Nov 2007)
|
||||
- Toby Peterson patched a memory problem in the command line tool that
|
||||
happened when a user had a home dir as an empty string. curl would then do
|
||||
free() on a wrong area.
|
||||
|
||||
Dan F (1 Nov 2007)
|
||||
- Fixed curl-config --features to not display libz when it wasn't used
|
||||
due to a missing header file.
|
||||
|
||||
Dan F (31 October 2007)
|
||||
- Fixed the output of curl-config --protocols which showed SCP and SFTP
|
||||
always, except when --without-libssh2 was given
|
||||
|
||||
- Added test cases 1013 and 1014 to check that curl-config --protocols and
|
||||
curl-config --features matches the output of curl --version
|
||||
|
||||
Dan F (30 October 2007)
|
||||
- Fixed an OOM problem with file: URLs
|
||||
|
||||
- Moved Curl_file_connect into the protocol handler struct
|
||||
|
||||
Dan F (29 October 2007)
|
||||
- Added test case 546 to check that subsequent FTP transfers work after a
|
||||
failed one using the multi interface
|
||||
|
||||
Daniel S (29 October 2007)
|
||||
- Based on one of those bug reports that are intercepted by a distro's bug
|
||||
tracker (https://bugzilla.redhat.com/show_bug.cgi?id=316191), I now made
|
||||
curl-config --features and --protocols show the correct output when built
|
||||
with NSS.
|
||||
|
||||
Version 7.17.1 (29 October 2007)
|
||||
|
||||
Dan F (25 October 2007)
|
||||
|
@@ -10864,7 +10864,7 @@ Version 6.2
|
||||
the configure script to leave SSL alone. The previous functionality has
|
||||
been retained. Troy Engel helped test this new one.
|
||||
|
||||
Version 6.1
|
||||
Version 6.1 (October 17 1999)
|
||||
|
||||
Daniel (17 October 1999):
|
||||
- I ifdef'ed or commented all the zlib stuff in the sources and configure
|
||||
@@ -10939,7 +10939,7 @@ Version 6.1beta
|
||||
- Made the -F option allow stdin when specifying files. By using '-' instead
|
||||
of file name, the data will be read from stdin.
|
||||
|
||||
Version 6.0
|
||||
Version 6.0 (September 14 1999)
|
||||
|
||||
Daniel (13 September 1999)
|
||||
- Added -X/--http-request <request> to enable any HTTP command to be sent.
|
||||
@@ -11201,7 +11201,7 @@ Version 5.9.1
|
||||
with form posting where the variable shouldn't have any content, as in curl
|
||||
-F "form=" www.site.com. It was now fixed.
|
||||
|
||||
Version 5.9
|
||||
Version 5.9 (May 22 1999)
|
||||
|
||||
Daniel (22 May 1999)
|
||||
- I've got a bug report from Aaron Scarisbrick in which he states he has some
|
||||
@@ -11939,7 +11939,7 @@ Version 4.8.1
|
||||
had nothing but header. Appearantly Solaris deals with negative sizes in
|
||||
fwrite() calls a lot better than Linux does... =B-]
|
||||
|
||||
Version 4.8
|
||||
Version 4.8 (Aug 31, 1998)
|
||||
Daniel Stenberg
|
||||
- Continue FTP file transfer. -c is the switch. Note that you need to
|
||||
specify a file name if you wanna resume a download (you can't resume a
|
||||
|
2
COPYING
2
COPYING
@@ -1,6 +1,6 @@
|
||||
COPYRIGHT AND PERMISSION NOTICE
|
||||
|
||||
Copyright (c) 1996 - 2007, Daniel Stenberg, <daniel@haxx.se>.
|
||||
Copyright (c) 1996 - 2008, Daniel Stenberg, <daniel@haxx.se>.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
9
CVS-INFO
9
CVS-INFO
@@ -12,8 +12,8 @@ inner sanctum.
|
||||
|
||||
Compile and build instructions follow below.
|
||||
|
||||
CHANGES.0 contains ancient changes.
|
||||
CHANGES.$year contains changes for the particular year.
|
||||
CHANGES.0 contains ancient changes
|
||||
CHANGES contains the most recent changes
|
||||
|
||||
Makefile.dist is included as the root Makefile in distribution archives
|
||||
|
||||
@@ -49,9 +49,8 @@ installed:
|
||||
|
||||
If you don't have nroff and perl and you for some reason don't want to
|
||||
install them, you can rename the source file src/hugehelp.c.cvs to
|
||||
src/hugehelp.c and avoid having to generate this file. This will of course
|
||||
give you an older version of the file that isn't up-to-date. That file was
|
||||
checked in once and won't be updated very regularly.
|
||||
src/hugehelp.c and avoid having to generate this file. This will give you
|
||||
a stubbed version of the file that doesn't contain actual content.
|
||||
|
||||
MAC OS X
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2008, 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
|
||||
@@ -72,7 +72,7 @@ test-torture:
|
||||
endif
|
||||
|
||||
examples:
|
||||
@(cd docs/examples; $(MAKE) all)
|
||||
@(cd docs/examples; $(MAKE) check)
|
||||
|
||||
#
|
||||
# Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros
|
||||
@@ -131,3 +131,7 @@ install-data-hook:
|
||||
uninstall-hook:
|
||||
cd include && $(MAKE) uninstall
|
||||
cd docs && $(MAKE) uninstall
|
||||
|
||||
ca-bundle: lib/mk-ca-bundle.pl
|
||||
@echo "generate a fresh ca-bundle.crt"
|
||||
@perl $< -b -l -u lib/ca-bundle.crt
|
||||
|
@@ -5,7 +5,7 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2008, 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
|
||||
@@ -128,6 +128,12 @@ vc:
|
||||
cd ..\src
|
||||
nmake /f Makefile.$(VC)
|
||||
|
||||
vc-x64:
|
||||
cd lib
|
||||
MACHINE=x64 nmake /f Makefile.$(VC) cfg=release
|
||||
cd ..\src
|
||||
MACHINE=x64 nmake /f Makefile.$(VC)
|
||||
|
||||
vc-zlib:
|
||||
cd lib
|
||||
nmake /f Makefile.$(VC) cfg=release-zlib
|
||||
@@ -251,6 +257,12 @@ 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
|
||||
@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
|
||||
|
||||
ca-bundle: lib/mk-ca-bundle.pl
|
||||
@echo "generate a fresh ca-bundle.crt"
|
||||
@perl $< -b -l -u lib/ca-bundle.crt
|
||||
|
||||
|
||||
|
@@ -1,53 +1,46 @@
|
||||
Curl and libcurl 7.17.1
|
||||
Curl and libcurl 7.18.2
|
||||
|
||||
Public curl release number: 102
|
||||
Releases counted from the very beginning: 128
|
||||
Available command line options: 121
|
||||
Available curl_easy_setopt() options: 147
|
||||
Number of public functions in libcurl: 55
|
||||
Amount of public web site mirrors: 43
|
||||
Number of known libcurl bindings: 36
|
||||
Number of contributors: 588
|
||||
Public curl releases: 105
|
||||
Command line options: 126
|
||||
curl_easy_setopt() options: 150
|
||||
Public functions in libcurl: 58
|
||||
Public web site mirrors: 37
|
||||
Known libcurl bindings: 36
|
||||
Contributors: 636
|
||||
|
||||
This release includes the following changes:
|
||||
|
||||
o automatically append ";type=<a|i>" when using HTTP proxies for FTP urls
|
||||
o improved NSS support
|
||||
o added --proxy-negotiate
|
||||
o added --post301 and CURLOPT_POST301
|
||||
o builds with c-ares 1.5.0
|
||||
o added CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 and --hostpubmd5
|
||||
o renamed CURLE_SSL_PEER_CERTIFICATE to CURLE_PEER_FAILED_VERIFICATION
|
||||
o added CURLOPT_OPENSOCKETFUNCTION and CURLOPT_OPENSOCKETDATA
|
||||
o CULROPT_COOKIELIST supports "FLUSH"
|
||||
o added CURLOPT_COPYPOSTFIELDS
|
||||
o added --static-libs to curl-config
|
||||
o CURLFORM_STREAM was added
|
||||
o CURLOPT_NOBODY is now supported over SFTP
|
||||
o curl can now run on Symbian OS
|
||||
o curl -w redirect_url and CURLINFO_REDIRECT_URL
|
||||
o added curl_easy_send() and curl_easy_recv()
|
||||
|
||||
This release includes the following bugfixes:
|
||||
|
||||
o curl-config --protocols now properly reports LDAPS, SCP and SFTP
|
||||
o ldapv3 support on Windows
|
||||
o ldap builds with the MSVC makefiles
|
||||
o no HOME and no key given caused SSH auth failure
|
||||
o Negotiate authentication over proxy
|
||||
o --ftp-method nocwd on directory listings
|
||||
o FTP, CURLOPT_NOBODY enabled and CURLOPT_HEADER disabled now does TYPE
|
||||
before SIZE
|
||||
o re-used handle transfers with SFTP
|
||||
o curl_easy_escape() problem with byte values >= 128
|
||||
o handles chunked-encoded CONNECT responses
|
||||
o misuse of ares_timeout() result
|
||||
o --local-port on TFTP transfers
|
||||
o CURLOPT_POSTFIELDS could fail to send binary data
|
||||
o specifying a proxy with a trailing slash didn't work (unless it also
|
||||
contained a port number)
|
||||
o redirect from HTTP to FTP or TFTP memory problems and leaks
|
||||
o re-used connections a bit too much when using non-SSL protocols tunneled
|
||||
over a HTTP proxy
|
||||
o embed the manifest in VC8 builds
|
||||
o use valgrind in the tests even when the lib is built shared with libtool
|
||||
o libcurl built with NSS can now ignore the peer verification even when the
|
||||
ca cert bundle is absent
|
||||
o CURLOPT_NOBODY first set to TRUE and then FALSE for HTTP no longer causes
|
||||
the confusion that could lead to a hung transfer
|
||||
o curl_easy_reset() resets the max redirect limit properly
|
||||
o configure now correctly recognizes Heimdal and MIT gssapi libraries
|
||||
o malloc() failure check in Negotiate
|
||||
o -i and -I together now work the same no matter what order they're used
|
||||
o the typechecker can be bypassed by defining CURL_DISABLE_TYPECHECK
|
||||
o a pointer mixup could make the FTP code send bad user+password under rare
|
||||
circumstances (found when using curlftpfs)
|
||||
o CURLOPT_OPENSOCKETFUNCTION can now be used to create a unix domain socket
|
||||
o CURLOPT_TCP_NODELAY crash due to getprotobyname() use
|
||||
o libcurl sometimes sent body twice when using CURLAUTH_ANY
|
||||
o configure detecting debug-enabled c-ares
|
||||
o microsecond resolution keys for internal splay trees
|
||||
o krb4 and krb5 ftp segfault
|
||||
o multi interface busy loop for CONNECT requests
|
||||
o internal time differences now use monotonic time source if available
|
||||
o several curl_multi_socket() fixes
|
||||
o builds fine for Haiku OS
|
||||
o follow redirect with only a new query string
|
||||
o SCP and SFTP memory leaks on aborted transfers
|
||||
o curl_multi_socket() and HTTP pipelining transfer stalls
|
||||
o lost telnet data on an EWOULDBLOCK condition
|
||||
|
||||
This release includes the following known bugs:
|
||||
|
||||
@@ -55,18 +48,21 @@ This release includes the following known bugs:
|
||||
|
||||
Other curl-related news:
|
||||
|
||||
o
|
||||
o pycurl 7.18.1 was released: http://pycurl.sf.net/
|
||||
o brand new curl Haskell binding:
|
||||
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/curl
|
||||
|
||||
New curl mirrors:
|
||||
|
||||
o http://curl.wetzlmayr.at/ is a new web mirror in Nuremberg, Germany
|
||||
o
|
||||
|
||||
This release would not have looked like this without help, code, reports and
|
||||
advice from friends like these:
|
||||
|
||||
Dan Fandrich, Michal Marek, G<EFBFBD>nter Knauf, Rob Crittenden, Immanuel Gregoire,
|
||||
Mark Davies, Max Katsev, Philip Langdale, Alex Fishman, Johnny Luong,
|
||||
Alexey Pesternikov, Yang Tse, Kim Rinnewitz, Michael Wallner,
|
||||
Patrick Monnerat, Vladimir Lazarenko
|
||||
|
||||
Michal Marek, Daniel Fandrich, Scott Barrett, Alexey Simak, Daniel Black,
|
||||
Rafa Muyo, Andre Guibert de Bruet, Brock Noland, Sandor Feldi, Stefan Krause,
|
||||
David Shaw, Norbert Frese, Bart Whiteley, Jean-Francois Bertrand, Ben Van Hof,
|
||||
Yuriy Sosov, Christopher Palow, Yang Tse, Liam Healy, Nikolai Kondrashov,
|
||||
David Rosenstrauch, Andreas Faerber, Scott McCreary, Jeff Weber, Emil Romanus
|
||||
|
||||
Thanks! (and sorry if I forgot to mention someone)
|
||||
|
17
TODO-RELEASE
17
TODO-RELEASE
@@ -1,4 +1,17 @@
|
||||
To be addressed before 7.17.1 (planned release: late October 2007)
|
||||
To be addressed before 7.18.2 (planned release: June 2008)
|
||||
=============================
|
||||
|
||||
106 -
|
||||
To be addressed before 7.18.3 (planned release: August 2008)
|
||||
=============================
|
||||
|
||||
139 - Christopher Palow's CURLM_EASY_HANDLE_EXISTS patch
|
||||
|
||||
140 - Arnaud Ebalard and Axel Tillequin's CRL support and issuer check patches
|
||||
|
||||
141 - The sponsored feature CURLINFO_PRIMARY_IP that returns the IP address
|
||||
as a string for the most recently used connection.
|
||||
|
||||
144 - Help apps use 64bit/LFS libcurl!
|
||||
|
||||
145 -
|
||||
|
||||
|
1408
acinclude.m4
1408
acinclude.m4
File diff suppressed because it is too large
Load Diff
@@ -21,3 +21,4 @@ depcomp
|
||||
libcares.la
|
||||
missing
|
||||
ares_version.h.dist
|
||||
libcares.pc
|
||||
|
@@ -25,4 +25,10 @@ Vlad Dinulescu
|
||||
Brad House
|
||||
Shmulik Regev
|
||||
Ashish Sharma
|
||||
Brad Spencer
|
||||
Steinar H. Gunderson
|
||||
Robin Cornelius
|
||||
Erik Kline
|
||||
Alexey Simak
|
||||
Eino Tuominen
|
||||
Doug Goldstein
|
||||
Sebastian at basti79.de
|
||||
|
66
ares/CHANGES
66
ares/CHANGES
@@ -1,5 +1,67 @@
|
||||
Changelog for the c-ares project
|
||||
|
||||
* May 30 2008 (Yang Tse)
|
||||
|
||||
- Brad House fixed a missing header file inclusion in adig sample program.
|
||||
|
||||
Version 1.5.2 (May 29, 2008)
|
||||
|
||||
* May 13 2008 (Daniel Stenberg)
|
||||
|
||||
- Introducing millisecond resolution support for the timeout option. See
|
||||
ares_init_options()'s ARES_OPT_TIMEOUTMS.
|
||||
|
||||
* May 9 2008 (Yang Tse)
|
||||
|
||||
- Use monotonic time source if available, for private function ares__tvnow()
|
||||
|
||||
* May 7 2008 (Daniel Stenberg)
|
||||
|
||||
- Sebastian made c-ares able to return all PTR-records when doing reverse
|
||||
lookups. It is not common practice to have multiple PTR-Records for a single
|
||||
IP, but its perfectly legal and some sites have those.
|
||||
|
||||
- Doug Goldstein provided a configure patch: updates autoconf 2.13 usage to
|
||||
autoconf 2.57 usage (which is the version you have specified as the minimum
|
||||
version). It's a minor change but it does clean up some warnings with newer
|
||||
autoconf (specifically 2.62).
|
||||
|
||||
* May 5 2008 (Yang Tse)
|
||||
|
||||
- Improved parsing of resolver configuration files.
|
||||
|
||||
* April 4 2008 (Daniel Stenberg)
|
||||
|
||||
- Eino Tuominen improved the code when a file is used to seed the randomizer.
|
||||
|
||||
- Alexey Simak made adig support NAPTR records
|
||||
|
||||
- Alexey Simak fixed the VC dsp file by adding the missing source file
|
||||
ares_expand_string.c
|
||||
|
||||
* December 11 2007 (Gisle Vanem)
|
||||
|
||||
- Added another sample application; acountry.c which converts an
|
||||
IPv4-address(es) and/or host-name(s) to country-name and country-code.
|
||||
This uses the service of the DNSBL at countries.nerd.dk.
|
||||
|
||||
* December 3 2007 (Daniel Stenberg)
|
||||
|
||||
- Brad Spencer fixed the configure script to assume that there's no
|
||||
/dev/urandom when built cross-compiled as then the script cannot check for
|
||||
it.
|
||||
|
||||
- Erik Kline cleaned up ares_gethostbyaddr.c:next_lookup() somewhat
|
||||
|
||||
Version 1.5.1 (Nov 21, 2007)
|
||||
|
||||
* November 21 2007 (Daniel Stenberg)
|
||||
|
||||
- Robin Cornelius pointed out that ares_llist.h was missing in the release
|
||||
archive for 1.5.0
|
||||
|
||||
Version 1.5.0 (Nov 21, 2007)
|
||||
|
||||
* October 2 2007 (Daniel Stenberg)
|
||||
|
||||
- ares_strerror() segfaulted if the input error number was out of the currently
|
||||
@@ -49,7 +111,7 @@
|
||||
* July 14 2007 (Daniel Stenberg)
|
||||
|
||||
- Vlad Dinulescu fixed two outstanding valgrind reports:
|
||||
|
||||
|
||||
1. In ares_query.c , in find_query_by_id we compare q->qid (which is a short
|
||||
int variable) with qid, which is declared as an int variable. Moreover,
|
||||
DNS_HEADER_SET_QID is used to set the value of qid, but DNS_HEADER_SET_QID
|
||||
@@ -135,7 +197,7 @@ Version 1.4.0 (June 8, 2007)
|
||||
|
||||
- Brad House added ares_save_options() and ares_destroy_options() that can be
|
||||
used to keep options for later re-usal when ares_init_options() is used.
|
||||
|
||||
|
||||
Problem: Calling ares_init() for each lookup can be unnecessarily resource
|
||||
intensive. On windows, it must LoadLibrary() or search the registry
|
||||
on each call to ares_init(). On unix, it must read and parse
|
||||
|
35
ares/FILES
35
ares/FILES
@@ -1,35 +0,0 @@
|
||||
*.c
|
||||
*.h
|
||||
*.3
|
||||
NEWS
|
||||
README
|
||||
README.cares
|
||||
CHANGES
|
||||
FILES
|
||||
maketgz
|
||||
aclocal.m4
|
||||
acinclude.m4
|
||||
Makefile.in
|
||||
Makefile.dj
|
||||
Makefile.m32
|
||||
Makefile.netware
|
||||
Makefile.vc6
|
||||
install-sh
|
||||
mkinstalldirs
|
||||
configure
|
||||
configure.ac
|
||||
config.guess
|
||||
config.sub
|
||||
vc/adig/adig.dep
|
||||
vc/adig/adig.dsp
|
||||
vc/adig/adig.mak
|
||||
vc/adig/adig.plg
|
||||
vc/vc.dsw
|
||||
vc/ahost/ahost.dep
|
||||
vc/ahost/ahost.dsp
|
||||
vc/ahost/ahost.mak
|
||||
vc/ahost/ahost.plg
|
||||
vc/areslib/areslib.dep
|
||||
vc/areslib/areslib.dsp
|
||||
vc/areslib/areslib.mak
|
||||
vc/areslib/areslib.plg
|
@@ -4,15 +4,25 @@ lib_LTLIBRARIES = libcares.la
|
||||
|
||||
man_MANS = $(MANPAGES)
|
||||
|
||||
MSVCFILES = vc/adig/adig.dep vc/adig/adig.dsp vc/vc.dsw vc/ahost/ahost.dep \
|
||||
vc/ahost/ahost.dsp vc/areslib/areslib.dep vc/areslib/areslib.dsp \
|
||||
vc/areslib/areslib.dsw
|
||||
MSVCFILES = vc/vc.dsw vc/acountry/acountry.dsp vc/adig/adig.dsp \
|
||||
vc/ahost/ahost.dsp vc/areslib/areslib.dsp vc/areslib/areslib.dsw
|
||||
|
||||
if DEBUGBUILD
|
||||
PROGS =
|
||||
else
|
||||
PROGS = ahost adig acountry
|
||||
endif
|
||||
|
||||
noinst_PROGRAMS =$(PROGS)
|
||||
|
||||
# adig and ahost are just sample programs and thus not mentioned with the
|
||||
# regular sources and headers
|
||||
EXTRA_DIST = CHANGES README.cares Makefile.inc adig.c ahost.c $(man_MANS) \
|
||||
$(MSVCFILES) AUTHORS config-win32.h RELEASE-NOTES libcares.pc.in
|
||||
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
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libcares.pc
|
||||
|
||||
VER=-version-info 2:0:0
|
||||
# This flag accepts an argument of the form current[:revision[:age]]. So,
|
||||
@@ -61,6 +71,15 @@ libcares_ladir = $(includedir)
|
||||
# what headers to install on 'make install':
|
||||
libcares_la_HEADERS = ares.h ares_version.h ares_dns.h
|
||||
|
||||
ahost_SOURCES = ahost.c ares_getopt.c ares_getopt.h
|
||||
ahost_LDADD = $(top_builddir)/$(lib_LTLIBRARIES)
|
||||
|
||||
adig_SOURCES = adig.c ares_getopt.c ares_getopt.h
|
||||
adig_LDADD = $(top_builddir)/$(lib_LTLIBRARIES)
|
||||
|
||||
acountry_SOURCES = acountry.c ares_getopt.c ares_getopt.h
|
||||
acountry_LDADD = $(top_builddir)/$(lib_LTLIBRARIES)
|
||||
|
||||
# Make files named *.dist replace the file without .dist extension
|
||||
dist-hook:
|
||||
find $(distdir) -name "*.dist" -exec rm {} \;
|
||||
|
@@ -10,19 +10,20 @@ include ../packages/DOS/common.dj
|
||||
|
||||
include Makefile.inc
|
||||
|
||||
CFLAGS += -DWATT32 -DHAVE_AF_INET6 -DHAVE_PF_INET6 -DHAVE_FIONBIO \
|
||||
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_SYS_UIO_H -DHAVE_NETINET_IN_H \
|
||||
-DHAVE_NETINET_TCP_H -DNS_INADDRSZ=4 -DHAVE_RECV -DHAVE_SEND \
|
||||
-DHAVE_SIGNAL_H -DHAVE_SIG_ATOMIC_T -DRETSIGTYPE='void' \
|
||||
-DHAVE_PROCESS_H -DHAVE_ARPA_NAMESER_H -DHAVE_SYS_SOCKET_H \
|
||||
-DHAVE_SYS_UIO_H -DHAVE_NETINET_IN_H -DHAVE_NETINET_TCP_H \
|
||||
-DNS_INADDRSZ=4 -DHAVE_RECV -DHAVE_SEND -DHAVE_GETTIMEOFDAY \
|
||||
-DSEND_TYPE_ARG1='int' -DSEND_QUAL_ARG2='const' \
|
||||
-DSEND_TYPE_ARG2='void*' -DSEND_TYPE_ARG3='int' \
|
||||
-DSEND_TYPE_ARG4='int' -DSEND_TYPE_RETV='int' \
|
||||
-DRECV_TYPE_ARG1='int' -DRECV_TYPE_ARG2='void*' \
|
||||
-DRECV_TYPE_ARG3='int' -DRECV_TYPE_ARG4='int' \
|
||||
-DRECV_TYPE_RETV='int' -DHAVE_STRUCT_TIMEVAL \
|
||||
-Dselect=select_s -UHAVE_CONFIG_H
|
||||
-Dselect=select_s -Dsocklen_t=int -UHAVE_CONFIG_H
|
||||
|
||||
LDFLAGS = -s
|
||||
|
||||
@@ -49,7 +50,7 @@ EX_LIBS += $(WATT32_ROOT)/lib/libwatt.a
|
||||
|
||||
OBJECTS = $(addprefix $(OBJ_DIR)/, $(CSOURCES:.c=.o))
|
||||
|
||||
all: $(OBJ_DIR) libcares.a ahost.exe adig.exe
|
||||
all: $(OBJ_DIR) libcares.a ahost.exe adig.exe acountry.exe
|
||||
@echo Welcome to c-ares.
|
||||
|
||||
libcares.a: $(OBJECTS)
|
||||
@@ -61,11 +62,14 @@ ahost.exe: ahost.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK)
|
||||
adig.exe: adig.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK)
|
||||
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS)
|
||||
|
||||
acountry.exe: acountry.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK)
|
||||
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJECTS) libcares.a
|
||||
|
||||
vclean realclean: clean
|
||||
rm -f ahost.exe adig.exe depend.dj
|
||||
rm -f ahost.exe adig.exe acountry.exe depend.dj
|
||||
- rmdir $(OBJ_DIR)
|
||||
|
||||
-include depend.dj
|
||||
|
@@ -6,11 +6,11 @@ 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_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_parse_ns_reply.c ares_llist.c ares__timeval.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
|
||||
setup_once.h ares_llist.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 \
|
||||
|
@@ -32,7 +32,7 @@ $(LIB): $(OBJLIB)
|
||||
|
||||
all: $(LIB) demos
|
||||
|
||||
demos: adig.exe ahost.exe
|
||||
demos: adig.exe ahost.exe acountry.exe
|
||||
|
||||
tags:
|
||||
etags *.[ch]
|
||||
@@ -61,7 +61,7 @@ install:
|
||||
done)
|
||||
|
||||
clean:
|
||||
$(RM) ares_getopt.o $(OBJLIB) $(LIB) adig.exe ahost.exe
|
||||
$(RM) ares_getopt.o $(OBJLIB) $(LIB) adig.exe ahost.exe acountry.exe
|
||||
|
||||
distclean: clean
|
||||
$(RM) config.cache config.log config.status Makefile
|
||||
|
@@ -14,14 +14,14 @@ NDKBASE = c:/novell
|
||||
endif
|
||||
|
||||
ifndef INSTDIR
|
||||
INSTDIR = ../curl-$(LIBCURL_VERSION_STR)-bin-nw
|
||||
INSTDIR = ../ares-$(LIBCARES_VERSION_STR)-bin-nw
|
||||
endif
|
||||
|
||||
# Edit the vars below to change NLM target settings.
|
||||
TARGETS = adig.nlm ahost.nlm
|
||||
TARGETS = adig.nlm ahost.nlm acountry.nlm
|
||||
LTARGET = libcares.$(LIBEXT)
|
||||
VERSION = $(LIBCARES_VERSION)
|
||||
COPYR = Copyright (C) 1996 - 2007, Daniel Stenberg, <daniel@haxx.se>
|
||||
COPYR = Copyright (C) 1996 - 2008, Daniel Stenberg, <daniel@haxx.se>
|
||||
DESCR = cURL $(subst .def,,$(notdir $@)) $(LIBCARES_VERSION_STR) - http://curl.haxx.se
|
||||
MTSAFE = YES
|
||||
STACK = 64000
|
||||
@@ -63,14 +63,15 @@ else
|
||||
CC = gcc
|
||||
endif
|
||||
# a native win32 awk can be downloaded from here:
|
||||
# http://www.gknw.net/development/prgtools/awk-20050424.zip
|
||||
# http://www.gknw.net/development/prgtools/awk-20070501.zip
|
||||
AWK = awk
|
||||
YACC = bison -y
|
||||
CP = cp -afv
|
||||
MKDIR = mkdir
|
||||
# RM = rm -f
|
||||
# if you want to mark the target as MTSAFE you will need a tool for
|
||||
# generating the xdc data for the linker; here's a minimal tool:
|
||||
# http://www.gknw.com/development/prgtools/mkxdc.zip
|
||||
# http://www.gknw.net/development/prgtools/mkxdc.zip
|
||||
MPKXDC = mkxdc
|
||||
|
||||
# Global flags for all compilers
|
||||
@@ -161,10 +162,6 @@ nlm: prebuild $(TARGETS)
|
||||
|
||||
prebuild: $(OBJDIR) $(OBJDIR)/version.inc config.h arpa/nameser.h
|
||||
|
||||
dist: all
|
||||
-$(RM) $(OBJLIB) $(OBJDIR)/*.map $(OBJDIR)/*.ncv
|
||||
-$(RM) $(OBJDIR)/*.def $(OBJDIR)/*.xdc $(OBJDIR)/version.inc
|
||||
|
||||
install: $(INSTDIR) all
|
||||
@$(CP) *.nlm $(INSTDIR)
|
||||
@$(CP) ../CHANGES $(INSTDIR)
|
||||
@@ -190,11 +187,8 @@ endif
|
||||
@-$(RM) $@
|
||||
@$(LD) $(LDFLAGS) $<
|
||||
|
||||
$(INSTDIR):
|
||||
@mkdir $(INSTDIR)
|
||||
|
||||
$(OBJDIR):
|
||||
@mkdir $(OBJDIR)
|
||||
$(OBJDIR) $(INSTDIR):
|
||||
@$(MKDIR) $@
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
# @echo Compiling $<
|
||||
@@ -202,7 +196,7 @@ $(OBJDIR)/%.o: %.c
|
||||
|
||||
$(OBJDIR)/version.inc: ares_version.h $(OBJDIR)
|
||||
@echo Creating $@
|
||||
@$(AWK) -f ../packages/NetWare/get_ver.awk $< > $@
|
||||
@$(AWK) -f get_ver.awk $< > $@
|
||||
|
||||
$(OBJDIR)/%.xdc: Makefile.netware
|
||||
@echo Creating $@
|
||||
@@ -269,8 +263,9 @@ ifdef IMPORTS
|
||||
@echo $(DL)import $(IMPORTS)$(DL) >> $@
|
||||
endif
|
||||
ifeq ($(LD),nlmconv)
|
||||
@echo $(DL)input $(OBJEXE)$(DL) >> $@
|
||||
@echo $(DL)input $(PRELUDE)$(DL) >> $@
|
||||
@echo $(DL)input $(OBJEXE)$(DL) >> $@
|
||||
@echo $(DL)input $(@:.def=.o)$(DL) >> $@
|
||||
@echo $(DL)output $(notdir $(@:.def=.nlm))$(DL) >> $@
|
||||
endif
|
||||
|
||||
@@ -300,7 +295,6 @@ ifeq ($(LIBARCH),CLIB)
|
||||
@echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@
|
||||
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
|
||||
@echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@
|
||||
@echo $(DL)#define DL_LDAP_FILE "ldapsdk.nlm"$(DL) >> $@
|
||||
@echo $(DL)#define socklen_t int$(DL) >> $@
|
||||
@echo $(DL)#define strncasecmp strnicmp$(DL) >> $@
|
||||
@echo $(DL)#define strcasecmp stricmp$(DL) >> $@
|
||||
@@ -338,7 +332,6 @@ else
|
||||
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
|
||||
@echo $(DL)#define SEND_TYPE_RETV ssize_t$(DL) >> $@
|
||||
@echo $(DL)#define SIZEOF_STRUCT_IN6_ADDR 16$(DL) >> $@
|
||||
@echo $(DL)#define DL_LDAP_FILE "lldapsdk.nlm"$(DL) >> $@
|
||||
endif
|
||||
@echo $(DL)#define HAVE_ARPA_INET_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_ARPA_NAMESER_H 1$(DL) >> $@
|
||||
|
@@ -62,6 +62,7 @@ OBJECTS = $(OBJ_DIR)\ares_fds.obj \
|
||||
$(OBJ_DIR)\ares_init.obj \
|
||||
$(OBJ_DIR)\ares_llist.obj \
|
||||
$(OBJ_DIR)\ares_timeout.obj \
|
||||
$(OBJ_DIR)\ares__timeval.obj \
|
||||
$(OBJ_DIR)\ares_destroy.obj \
|
||||
$(OBJ_DIR)\ares_mkquery.obj \
|
||||
$(OBJ_DIR)\ares_version.obj \
|
||||
@@ -76,7 +77,7 @@ OBJECTS = $(OBJ_DIR)\ares_fds.obj \
|
||||
$(OBJ_DIR)\inet_net_pton.obj \
|
||||
$(OBJ_DIR)\inet_ntop.obj
|
||||
|
||||
all: $(OBJ_DIR) cares.lib cares.dll cares_imp.lib ahost.exe adig.exe
|
||||
all: $(OBJ_DIR) cares.lib cares.dll cares_imp.lib ahost.exe adig.exe acountry.exe
|
||||
@echo Welcome to c-ares library and examples
|
||||
|
||||
$(OBJ_DIR):
|
||||
@@ -122,7 +123,6 @@ $(DEF_FILE): $(OBJECTS) Makefile.VC6
|
||||
@echo ares_inet_pton >> $@
|
||||
@echo ares_writev >> $@
|
||||
@echo ares_getnameinfo >> $@
|
||||
@echo ares_gettimeofday >> $@
|
||||
@echo ares_parse_aaaa_reply >> $@
|
||||
|
||||
ahost.exe: $(OBJ_DIR) $(OBJ_DIR)\ahost.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib
|
||||
@@ -131,11 +131,15 @@ ahost.exe: $(OBJ_DIR) $(OBJ_DIR)\ahost.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.
|
||||
adig.exe: $(OBJ_DIR) $(OBJ_DIR)\adig.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib
|
||||
link $(LDFLAGS) -out:$@ $(OBJ_DIR)\adig.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib $(EX_LIBS)
|
||||
|
||||
acountry.exe: $(OBJ_DIR) $(OBJ_DIR)\acountry.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib
|
||||
link $(LDFLAGS) -out:$@ $(OBJ_DIR)\acountry.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib $(EX_LIBS)
|
||||
|
||||
clean:
|
||||
- del $(OBJ_DIR)\*.obj *.ilk *.pdb *.pbt *.pbi *.pbo *._xe *.map
|
||||
|
||||
vclean realclean: clean
|
||||
- del $(DEF_FILE) cares.lib cares_imp.* cares.dll ahost.exe adig.exe
|
||||
- del $(DEF_FILE) cares.lib cares_imp.* cares.dll
|
||||
- del ahost.exe adig.exe acountry.exe
|
||||
- rd $(OBJ_DIR)
|
||||
|
||||
.c{$(OBJ_DIR)}.obj:
|
||||
@@ -190,6 +194,9 @@ $(OBJ_DIR)\ares_init.obj: ares_init.c setup.h setup_once.h nameser.h ares.h \
|
||||
$(OBJ_DIR)\ares_timeout.obj: ares_timeout.c setup.h setup_once.h ares.h \
|
||||
ares_private.h ares_ipv6.h
|
||||
|
||||
$(OBJ_DIR)\ares__timeval.obj: ares__timeval.c setup.h setup_once.h ares.h \
|
||||
ares_private.h ares_ipv6.h
|
||||
|
||||
$(OBJ_DIR)\ares_destroy.obj: ares_destroy.c setup.h setup_once.h ares.h \
|
||||
ares_private.h ares_ipv6.h
|
||||
|
||||
|
@@ -1,9 +1,10 @@
|
||||
This is what's new and changed in the c-ares 1.4.1 release:
|
||||
This is what's new and changed in the c-ares 1.5.3 release:
|
||||
|
||||
o
|
||||
o adig sample application compilation failure on some systems
|
||||
|
||||
Thanks go to these friendly people for their efforts and contributions:
|
||||
|
||||
|
||||
Brad House
|
||||
and obviously Daniel Stenberg
|
||||
|
||||
Have fun!
|
||||
|
File diff suppressed because it is too large
Load Diff
592
ares/acountry.c
Normal file
592
ares/acountry.c
Normal file
@@ -0,0 +1,592 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* IP-address/hostname to country converter.
|
||||
*
|
||||
* Problem; you want to know where IP a.b.c.d is located.
|
||||
*
|
||||
* Use ares_gethostbyname ("d.c.b.a.zz.countries.nerd.dk")
|
||||
* and get the CNAME (host->h_name). Result will be:
|
||||
* CNAME = zz<CC>.countries.nerd.dk with address 127.0.x.y (ver 1) or
|
||||
* CNAME = <a.b.c.d>.zz.countries.nerd.dk with address 127.0.x.y (ver 2)
|
||||
*
|
||||
* The 2 letter country code in <CC> and the ISO-3166 country
|
||||
* number in x.y (number = x*256 + y). Version 2 of the protocol is missing
|
||||
* the <CC> number.
|
||||
*
|
||||
* Ref: http://countries.nerd.dk/more.html
|
||||
*
|
||||
* Written by G. Vanem <gvanem@broadpark.no> 2006, 2007
|
||||
*
|
||||
* NB! This program may not be big-endian aware.
|
||||
*
|
||||
* 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 <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#if defined(WIN32)
|
||||
#include <winsock.h>
|
||||
#else
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_getopt.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "inet_ntop.h"
|
||||
|
||||
static const char *usage = "acountry [-vh?] {host|addr} ...\n";
|
||||
static const char nerd_fmt[] = "%u.%u.%u.%u.zz.countries.nerd.dk";
|
||||
static const char *nerd_ver1 = nerd_fmt + 14;
|
||||
static const char *nerd_ver2 = nerd_fmt + 11;
|
||||
static int verbose = 0;
|
||||
|
||||
#define TRACE(fmt) do { \
|
||||
if (verbose > 0) \
|
||||
printf fmt ; \
|
||||
} while (0)
|
||||
|
||||
static void wait_ares(ares_channel channel);
|
||||
static void callback(void *arg, int status, int timeouts, struct hostent *host);
|
||||
static void callback2(void *arg, int status, int timeouts, struct hostent *host);
|
||||
static void find_country_from_cname(const char *cname, struct in_addr addr);
|
||||
|
||||
static void Abort(const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
vfprintf(stderr, fmt, args);
|
||||
va_end(args);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
ares_channel channel;
|
||||
int ch, status;
|
||||
|
||||
#ifdef WIN32
|
||||
WORD wVersionRequested = MAKEWORD(USE_WINSOCK,USE_WINSOCK);
|
||||
WSADATA wsaData;
|
||||
WSAStartup(wVersionRequested, &wsaData);
|
||||
#endif
|
||||
|
||||
while ((ch = ares_getopt(argc, argv, "dvh?")) != -1)
|
||||
switch (ch)
|
||||
{
|
||||
case 'd':
|
||||
#ifdef WATT32
|
||||
dbug_init();
|
||||
#endif
|
||||
break;
|
||||
case 'v':
|
||||
verbose++;
|
||||
break;
|
||||
case 'h':
|
||||
case '?':
|
||||
default:
|
||||
Abort(usage);
|
||||
}
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
if (argc < 1)
|
||||
Abort(usage);
|
||||
|
||||
status = ares_init(&channel);
|
||||
if (status != ARES_SUCCESS)
|
||||
{
|
||||
fprintf(stderr, "ares_init: %s\n", ares_strerror(status));
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Initiate the queries, one per command-line argument. */
|
||||
for ( ; *argv; argv++)
|
||||
{
|
||||
struct in_addr addr;
|
||||
char buf[100];
|
||||
|
||||
/* If this fails, assume '*argv' is a host-name that
|
||||
* must be resolved first
|
||||
*/
|
||||
if (ares_inet_pton(AF_INET, *argv, &addr) != 1)
|
||||
{
|
||||
ares_gethostbyname(channel, *argv, AF_INET, callback2, &addr);
|
||||
wait_ares(channel);
|
||||
if (addr.s_addr == INADDR_NONE)
|
||||
{
|
||||
printf("Failed to lookup %s\n", *argv);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(buf, nerd_fmt,
|
||||
(unsigned int)(addr.s_addr >> 24),
|
||||
(unsigned int)((addr.s_addr >> 16) & 255),
|
||||
(unsigned int)((addr.s_addr >> 8) & 255),
|
||||
(unsigned int)(addr.s_addr & 255));
|
||||
TRACE(("Looking up %s...", buf));
|
||||
fflush(stdout);
|
||||
ares_gethostbyname(channel, buf, AF_INET, callback, buf);
|
||||
}
|
||||
|
||||
wait_ares(channel);
|
||||
ares_destroy(channel);
|
||||
|
||||
#ifdef WIN32
|
||||
WSACleanup();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Wait for the queries to complete.
|
||||
*/
|
||||
static void wait_ares(ares_channel channel)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
struct timeval *tvp, tv;
|
||||
fd_set read_fds, write_fds;
|
||||
int nfds;
|
||||
|
||||
FD_ZERO(&read_fds);
|
||||
FD_ZERO(&write_fds);
|
||||
nfds = ares_fds(channel, &read_fds, &write_fds);
|
||||
if (nfds == 0)
|
||||
break;
|
||||
tvp = ares_timeout(channel, NULL, &tv);
|
||||
select(nfds, &read_fds, &write_fds, NULL, tvp);
|
||||
ares_process(channel, &read_fds, &write_fds);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This is the callback used when we have the IP-address of interest.
|
||||
* Extract the CNAME and figure out the country-code from it.
|
||||
*/
|
||||
static void callback(void *arg, int status, int timeouts, struct hostent *host)
|
||||
{
|
||||
const char *name = (const char*)arg;
|
||||
const char *cname;
|
||||
char buf[20];
|
||||
|
||||
(void)timeouts;
|
||||
|
||||
if (!host || status != ARES_SUCCESS)
|
||||
{
|
||||
printf("Failed to lookup %s: %s\n", name, ares_strerror(status));
|
||||
return;
|
||||
}
|
||||
|
||||
TRACE(("\nFound address %s, name %s\n",
|
||||
ares_inet_ntop(AF_INET,(const char*)host->h_addr,buf,sizeof(buf)),
|
||||
host->h_name));
|
||||
|
||||
cname = host->h_name; /* CNAME gets put here */
|
||||
if (!cname)
|
||||
printf("Failed to get CNAME for %s\n", name);
|
||||
else
|
||||
find_country_from_cname(cname, *(struct in_addr*)host->h_addr);
|
||||
}
|
||||
|
||||
/*
|
||||
* This is the callback used to obtain the IP-address of the host of interest.
|
||||
*/
|
||||
static void callback2(void *arg, int status, int timeouts, struct hostent *host)
|
||||
{
|
||||
struct in_addr *addr = (struct in_addr*) arg;
|
||||
|
||||
(void)timeouts;
|
||||
if (!host || status != ARES_SUCCESS)
|
||||
memset(addr, INADDR_NONE, sizeof(*addr));
|
||||
else
|
||||
memcpy(addr, host->h_addr, sizeof(*addr));
|
||||
}
|
||||
|
||||
struct search_list {
|
||||
int country_number; /* ISO-3166 country number */
|
||||
char short_name[3]; /* A2 short country code */
|
||||
const char *long_name; /* normal country name */
|
||||
};
|
||||
|
||||
const struct search_list *list_lookup(int number, const struct search_list *list, int num)
|
||||
{
|
||||
while (num > 0 && list->long_name)
|
||||
{
|
||||
if (list->country_number == number)
|
||||
return (list);
|
||||
num--;
|
||||
list++;
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Ref: ftp://ftp.ripe.net/iso3166-countrycodes.txt
|
||||
*/
|
||||
static const struct search_list country_list[] = {
|
||||
{ 4, "af", "Afghanistan" },
|
||||
{ 248, "ax", "<EFBFBD>land Island" },
|
||||
{ 8, "al", "Albania" },
|
||||
{ 12, "dz", "Algeria" },
|
||||
{ 16, "as", "American Samoa" },
|
||||
{ 20, "ad", "Andorra" },
|
||||
{ 24, "ao", "Angola" },
|
||||
{ 660, "ai", "Anguilla" },
|
||||
{ 10, "aq", "Antarctica" },
|
||||
{ 28, "ag", "Antigua & Barbuda" },
|
||||
{ 32, "ar", "Argentina" },
|
||||
{ 51, "am", "Armenia" },
|
||||
{ 533, "aw", "Aruba" },
|
||||
{ 36, "au", "Australia" },
|
||||
{ 40, "at", "Austria" },
|
||||
{ 31, "az", "Azerbaijan" },
|
||||
{ 44, "bs", "Bahamas" },
|
||||
{ 48, "bh", "Bahrain" },
|
||||
{ 50, "bd", "Bangladesh" },
|
||||
{ 52, "bb", "Barbados" },
|
||||
{ 112, "by", "Belarus" },
|
||||
{ 56, "be", "Belgium" },
|
||||
{ 84, "bz", "Belize" },
|
||||
{ 204, "bj", "Benin" },
|
||||
{ 60, "bm", "Bermuda" },
|
||||
{ 64, "bt", "Bhutan" },
|
||||
{ 68, "bo", "Bolivia" },
|
||||
{ 70, "ba", "Bosnia & Herzegowina" },
|
||||
{ 72, "bw", "Botswana" },
|
||||
{ 74, "bv", "Bouvet Island" },
|
||||
{ 76, "br", "Brazil" },
|
||||
{ 86, "io", "British Indian Ocean Territory" },
|
||||
{ 96, "bn", "Brunei Darussalam" },
|
||||
{ 100, "bg", "Bulgaria" },
|
||||
{ 854, "bf", "Burkina Faso" },
|
||||
{ 108, "bi", "Burundi" },
|
||||
{ 116, "kh", "Cambodia" },
|
||||
{ 120, "cm", "Cameroon" },
|
||||
{ 124, "ca", "Canada" },
|
||||
{ 132, "cv", "Cape Verde" },
|
||||
{ 136, "ky", "Cayman Islands" },
|
||||
{ 140, "cf", "Central African Republic" },
|
||||
{ 148, "td", "Chad" },
|
||||
{ 152, "cl", "Chile" },
|
||||
{ 156, "cn", "China" },
|
||||
{ 162, "cx", "Christmas Island" },
|
||||
{ 166, "cc", "Cocos Islands" },
|
||||
{ 170, "co", "Colombia" },
|
||||
{ 174, "km", "Comoros" },
|
||||
{ 178, "cg", "Congo" },
|
||||
{ 180, "cd", "Congo" },
|
||||
{ 184, "ck", "Cook Islands" },
|
||||
{ 188, "cr", "Costa Rica" },
|
||||
{ 384, "ci", "Cote d'Ivoire" },
|
||||
{ 191, "hr", "Croatia" },
|
||||
{ 192, "cu", "Cuba" },
|
||||
{ 196, "cy", "Cyprus" },
|
||||
{ 203, "cz", "Czech Republic" },
|
||||
{ 208, "dk", "Denmark" },
|
||||
{ 262, "dj", "Djibouti" },
|
||||
{ 212, "dm", "Dominica" },
|
||||
{ 214, "do", "Dominican Republic" },
|
||||
{ 218, "ec", "Ecuador" },
|
||||
{ 818, "eg", "Egypt" },
|
||||
{ 222, "sv", "El Salvador" },
|
||||
{ 226, "gq", "Equatorial Guinea" },
|
||||
{ 232, "er", "Eritrea" },
|
||||
{ 233, "ee", "Estonia" },
|
||||
{ 231, "et", "Ethiopia" },
|
||||
{ 238, "fk", "Falkland Islands" },
|
||||
{ 234, "fo", "Faroe Islands" },
|
||||
{ 242, "fj", "Fiji" },
|
||||
{ 246, "fi", "Finland" },
|
||||
{ 250, "fr", "France" },
|
||||
{ 249, "fx", "France, Metropolitan" },
|
||||
{ 254, "gf", "French Guiana" },
|
||||
{ 258, "pf", "French Polynesia" },
|
||||
{ 260, "tf", "French Southern Territories" },
|
||||
{ 266, "ga", "Gabon" },
|
||||
{ 270, "gm", "Gambia" },
|
||||
{ 268, "ge", "Georgia" },
|
||||
{ 276, "de", "Germany" },
|
||||
{ 288, "gh", "Ghana" },
|
||||
{ 292, "gi", "Gibraltar" },
|
||||
{ 300, "gr", "Greece" },
|
||||
{ 304, "gl", "Greenland" },
|
||||
{ 308, "gd", "Grenada" },
|
||||
{ 312, "gp", "Guadeloupe" },
|
||||
{ 316, "gu", "Guam" },
|
||||
{ 320, "gt", "Guatemala" },
|
||||
{ 324, "gn", "Guinea" },
|
||||
{ 624, "gw", "Guinea-Bissau" },
|
||||
{ 328, "gy", "Guyana" },
|
||||
{ 332, "ht", "Haiti" },
|
||||
{ 334, "hm", "Heard & Mc Donald Islands" },
|
||||
{ 336, "va", "Vatican City" },
|
||||
{ 340, "hn", "Honduras" },
|
||||
{ 344, "hk", "Hong kong" },
|
||||
{ 348, "hu", "Hungary" },
|
||||
{ 352, "is", "Iceland" },
|
||||
{ 356, "in", "India" },
|
||||
{ 360, "id", "Indonesia" },
|
||||
{ 364, "ir", "Iran" },
|
||||
{ 368, "iq", "Iraq" },
|
||||
{ 372, "ie", "Ireland" },
|
||||
{ 376, "il", "Israel" },
|
||||
{ 380, "it", "Italy" },
|
||||
{ 388, "jm", "Jamaica" },
|
||||
{ 392, "jp", "Japan" },
|
||||
{ 400, "jo", "Jordan" },
|
||||
{ 398, "kz", "Kazakhstan" },
|
||||
{ 404, "ke", "Kenya" },
|
||||
{ 296, "ki", "Kiribati" },
|
||||
{ 408, "kp", "Korea (north)" },
|
||||
{ 410, "kr", "Korea (south)" },
|
||||
{ 414, "kw", "Kuwait" },
|
||||
{ 417, "kg", "Kyrgyzstan" },
|
||||
{ 418, "la", "Laos" },
|
||||
{ 428, "lv", "Latvia" },
|
||||
{ 422, "lb", "Lebanon" },
|
||||
{ 426, "ls", "Lesotho" },
|
||||
{ 430, "lr", "Liberia" },
|
||||
{ 434, "ly", "Libya" },
|
||||
{ 438, "li", "Liechtenstein" },
|
||||
{ 440, "lt", "Lithuania" },
|
||||
{ 442, "lu", "Luxembourg" },
|
||||
{ 446, "mo", "Macao" },
|
||||
{ 807, "mk", "Macedonia" },
|
||||
{ 450, "mg", "Madagascar" },
|
||||
{ 454, "mw", "Malawi" },
|
||||
{ 458, "my", "Malaysia" },
|
||||
{ 462, "mv", "Maldives" },
|
||||
{ 466, "ml", "Mali" },
|
||||
{ 470, "mt", "Malta" },
|
||||
{ 584, "mh", "Marshall Islands" },
|
||||
{ 474, "mq", "Martinique" },
|
||||
{ 478, "mr", "Mauritania" },
|
||||
{ 480, "mu", "Mauritius" },
|
||||
{ 175, "yt", "Mayotte" },
|
||||
{ 484, "mx", "Mexico" },
|
||||
{ 583, "fm", "Micronesia" },
|
||||
{ 498, "md", "Moldova" },
|
||||
{ 492, "mc", "Monaco" },
|
||||
{ 496, "mn", "Mongolia" },
|
||||
{ 500, "ms", "Montserrat" },
|
||||
{ 504, "ma", "Morocco" },
|
||||
{ 508, "mz", "Mozambique" },
|
||||
{ 104, "mm", "Myanmar" },
|
||||
{ 516, "na", "Namibia" },
|
||||
{ 520, "nr", "Nauru" },
|
||||
{ 524, "np", "Nepal" },
|
||||
{ 528, "nl", "Netherlands" },
|
||||
{ 530, "an", "Netherlands Antilles" },
|
||||
{ 540, "nc", "New Caledonia" },
|
||||
{ 554, "nz", "New Zealand" },
|
||||
{ 558, "ni", "Nicaragua" },
|
||||
{ 562, "ne", "Niger" },
|
||||
{ 566, "ng", "Nigeria" },
|
||||
{ 570, "nu", "Niue" },
|
||||
{ 574, "nf", "Norfolk Island" },
|
||||
{ 580, "mp", "Northern Mariana Islands" },
|
||||
{ 578, "no", "Norway" },
|
||||
{ 512, "om", "Oman" },
|
||||
{ 586, "pk", "Pakistan" },
|
||||
{ 585, "pw", "Palau" },
|
||||
{ 275, "ps", "Palestinian Territory" },
|
||||
{ 591, "pa", "Panama" },
|
||||
{ 598, "pg", "Papua New Guinea" },
|
||||
{ 600, "py", "Paraguay" },
|
||||
{ 604, "pe", "Peru" },
|
||||
{ 608, "ph", "Philippines" },
|
||||
{ 612, "pn", "Pitcairn" },
|
||||
{ 616, "pl", "Poland" },
|
||||
{ 620, "pt", "Portugal" },
|
||||
{ 630, "pr", "Puerto Rico" },
|
||||
{ 634, "qa", "Qatar" },
|
||||
{ 638, "re", "Reunion" },
|
||||
{ 642, "ro", "Romania" },
|
||||
{ 643, "ru", "Russia" },
|
||||
{ 646, "rw", "Rwanda" },
|
||||
{ 659, "kn", "Saint Kitts & Nevis" },
|
||||
{ 662, "lc", "Saint Lucia" },
|
||||
{ 670, "vc", "Saint Vincent" },
|
||||
{ 882, "ws", "Samoa" },
|
||||
{ 674, "sm", "San Marino" },
|
||||
{ 678, "st", "Sao Tome & Principe" },
|
||||
{ 682, "sa", "Saudi Arabia" },
|
||||
{ 686, "sn", "Senegal" },
|
||||
{ 891, "cs", "Serbia and Montenegro" },
|
||||
{ 690, "sc", "Seychelles" },
|
||||
{ 694, "sl", "Sierra Leone" },
|
||||
{ 702, "sg", "Singapore" },
|
||||
{ 703, "sk", "Slovakia" },
|
||||
{ 705, "si", "Slovenia" },
|
||||
{ 90, "sb", "Solomon Islands" },
|
||||
{ 706, "so", "Somalia" },
|
||||
{ 710, "za", "South Africa" },
|
||||
{ 239, "gs", "South Georgia" },
|
||||
{ 724, "es", "Spain" },
|
||||
{ 144, "lk", "Sri Lanka" },
|
||||
{ 654, "sh", "St. Helena" },
|
||||
{ 666, "pm", "St. Pierre & Miquelon" },
|
||||
{ 736, "sd", "Sudan" },
|
||||
{ 740, "sr", "Suriname" },
|
||||
{ 744, "sj", "Svalbard & Jan Mayen Islands" },
|
||||
{ 748, "sz", "Swaziland" },
|
||||
{ 752, "se", "Sweden" },
|
||||
{ 756, "ch", "Switzerland" },
|
||||
{ 760, "sy", "Syrian Arab Republic" },
|
||||
{ 626, "tl", "Timor-Leste" },
|
||||
{ 158, "tw", "Taiwan" },
|
||||
{ 762, "tj", "Tajikistan" },
|
||||
{ 834, "tz", "Tanzania" },
|
||||
{ 764, "th", "Thailand" },
|
||||
{ 768, "tg", "Togo" },
|
||||
{ 772, "tk", "Tokelau" },
|
||||
{ 776, "to", "Tonga" },
|
||||
{ 780, "tt", "Trinidad & Tobago" },
|
||||
{ 788, "tn", "Tunisia" },
|
||||
{ 792, "tr", "Turkey" },
|
||||
{ 795, "tm", "Turkmenistan" },
|
||||
{ 796, "tc", "Turks & Caicos Islands" },
|
||||
{ 798, "tv", "Tuvalu" },
|
||||
{ 800, "ug", "Uganda" },
|
||||
{ 804, "ua", "Ukraine" },
|
||||
{ 784, "ae", "United Arab Emirates" },
|
||||
{ 826, "gb", "United Kingdom" },
|
||||
{ 840, "us", "United States" },
|
||||
{ 581, "um", "United States Minor Outlying Islands" },
|
||||
{ 858, "uy", "Uruguay" },
|
||||
{ 860, "uz", "Uzbekistan" },
|
||||
{ 548, "vu", "Vanuatu" },
|
||||
{ 862, "ve", "Venezuela" },
|
||||
{ 704, "vn", "Vietnam" },
|
||||
{ 92, "vg", "Virgin Islands (British)" },
|
||||
{ 850, "vi", "Virgin Islands (US)" },
|
||||
{ 876, "wf", "Wallis & Futuna Islands" },
|
||||
{ 732, "eh", "Western Sahara" },
|
||||
{ 887, "ye", "Yemen" },
|
||||
{ 894, "zm", "Zambia" },
|
||||
{ 716, "zw", "Zimbabwe" }
|
||||
};
|
||||
|
||||
/*
|
||||
* Check if start of 'str' is simply an IPv4 address.
|
||||
*/
|
||||
#define BYTE_OK(x) ((x) >= 0 && (x) <= 255)
|
||||
|
||||
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 &&
|
||||
BYTE_OK(a0) && BYTE_OK(a1) && BYTE_OK(a2) && BYTE_OK(a3) &&
|
||||
length >= (3+4))
|
||||
{
|
||||
rc = 1;
|
||||
*end = str + length;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
* Find the country-code and name from the CNAME. E.g.:
|
||||
* version 1: CNAME = zzno.countries.nerd.dk with address 127.0.2.66
|
||||
* yields ccode_A" = "no" and cnumber 578 (2.66).
|
||||
* version 2: CNAME = <a.b.c.d>.zz.countries.nerd.dk with address 127.0.2.66
|
||||
* yields cnumber 578 (2.66). ccode_A is "";
|
||||
*/
|
||||
static void find_country_from_cname(const char *cname, struct in_addr addr)
|
||||
{
|
||||
const struct search_list *country;
|
||||
char ccode_A2[3], *ccopy, *dot_4;
|
||||
int cnumber, z0, z1, ver_1, ver_2;
|
||||
u_long ip;
|
||||
|
||||
ip = ntohl(addr.s_addr);
|
||||
z0 = tolower(cname[0]);
|
||||
z1 = tolower(cname[1]);
|
||||
ccopy = strdup(cname);
|
||||
|
||||
ver_1 = (z0 == 'z' && z1 == 'z' && !strcasecmp(cname+4,nerd_ver1));
|
||||
ver_2 = (is_addr(ccopy,&dot_4) && !strcasecmp(dot_4,nerd_ver2));
|
||||
|
||||
if (ver_1)
|
||||
{
|
||||
const char *dot = strchr(cname, '.');
|
||||
if ((z0 != 'z' && z1 != 'z') || dot != cname+4)
|
||||
{
|
||||
printf("Unexpected CNAME %s (ver_1)\n", cname);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (ver_2)
|
||||
{
|
||||
z0 = tolower(dot_4[1]);
|
||||
z1 = tolower(dot_4[2]);
|
||||
if (z0 != 'z' && z1 != 'z')
|
||||
{
|
||||
printf("Unexpected CNAME %s (ver_2)\n", cname);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Unexpected CNAME %s (ver?)\n", cname);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ver_1)
|
||||
{
|
||||
ccode_A2[0] = tolower(cname[2]);
|
||||
ccode_A2[1] = tolower(cname[3]);
|
||||
ccode_A2[2] = '\0';
|
||||
}
|
||||
else
|
||||
ccode_A2[0] = '\0';
|
||||
|
||||
cnumber = ip & 0xFFFF;
|
||||
|
||||
TRACE(("Found country-code `%s', number %d\n",
|
||||
ver_1 ? ccode_A2 : "<n/a>", cnumber));
|
||||
|
||||
country = list_lookup(cnumber, country_list,
|
||||
sizeof(country_list) / sizeof(country_list[0]));
|
||||
if (!country)
|
||||
printf("Name for country-number %d not found.\n", cnumber);
|
||||
else
|
||||
{
|
||||
if (ver_1 && *(unsigned short*)&country->short_name != *(unsigned*)&ccode_A2)
|
||||
printf("short-name mismatch; %s vs %s\n", country->short_name, ccode_A2);
|
||||
|
||||
printf("%s (%s), number %d.\n",
|
||||
country->long_name, country->short_name, cnumber);
|
||||
}
|
||||
free(ccopy);
|
||||
}
|
||||
|
44
ares/adig.c
44
ares/adig.c
@@ -27,11 +27,17 @@
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <arpa/nameser.h>
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -110,6 +116,7 @@ static const struct nv types[] = {
|
||||
{ "AXFR", T_AXFR },
|
||||
{ "MAILB", T_MAILB },
|
||||
{ "MAILA", T_MAILA },
|
||||
{ "NAPTR", T_NAPTR },
|
||||
{ "ANY", T_ANY }
|
||||
};
|
||||
static const int ntypes = sizeof(types) / sizeof(types[0]);
|
||||
@@ -303,6 +310,8 @@ static void callback(void *arg, int status, int timeouts,
|
||||
unsigned int qdcount, ancount, nscount, arcount, i;
|
||||
const unsigned char *aptr;
|
||||
|
||||
(void) timeouts;
|
||||
|
||||
/* Display the query name if given. */
|
||||
if (name)
|
||||
printf("Answer for query %s:\n", name);
|
||||
@@ -603,6 +612,41 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
ares_free_string(name);
|
||||
break;
|
||||
|
||||
case T_NAPTR:
|
||||
|
||||
printf("\t%d", DNS__16BIT(aptr)); /* order */
|
||||
printf(" %d\n", DNS__16BIT(aptr + 2)); /* preference */
|
||||
|
||||
p = aptr + 4;
|
||||
status = ares_expand_string(p, abuf, alen, (unsigned char **)&name, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t\t\t\t\t\t%s\n", name);
|
||||
ares_free_string(name);
|
||||
p += len;
|
||||
|
||||
status = ares_expand_string(p, abuf, alen, (unsigned char **)&name, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t\t\t\t\t\t%s\n", name);
|
||||
ares_free_string(name);
|
||||
p += len;
|
||||
|
||||
status = ares_expand_string(p, abuf, alen, (unsigned char **)&name, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t\t\t\t\t\t%s\n", name);
|
||||
ares_free_string(name);
|
||||
p += len;
|
||||
|
||||
status = ares_expand_string(p, abuf, alen, (unsigned char **)&name, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t\t\t\t\t\t%s", name);
|
||||
ares_free_string(name);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
printf("\t[Unknown RR; cannot parse]");
|
||||
break;
|
||||
|
12
ares/ahost.c
12
ares/ahost.c
@@ -29,6 +29,9 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -40,13 +43,6 @@
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_getopt.h"
|
||||
|
||||
#ifndef HAVE_STRUCT_IN6_ADDR
|
||||
struct in6_addr
|
||||
{
|
||||
unsigned char s6_addr[16];
|
||||
};
|
||||
#endif
|
||||
|
||||
static void callback(void *arg, int status, int timeouts, struct hostent *host);
|
||||
static void usage(void);
|
||||
|
||||
@@ -146,6 +142,8 @@ static void callback(void *arg, int status, int timeouts, struct hostent *host)
|
||||
{
|
||||
char **p;
|
||||
|
||||
(void)timeouts;
|
||||
|
||||
if (status != ARES_SUCCESS)
|
||||
{
|
||||
fprintf(stderr, "%s: %s\n", (char *) arg, ares_strerror(status));
|
||||
|
52
ares/ares.h
52
ares/ares.h
@@ -1,6 +1,7 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2007 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -18,6 +19,14 @@
|
||||
#ifndef ARES__H
|
||||
#define ARES__H
|
||||
|
||||
/*
|
||||
* Define WIN32 when build target is Win32 API
|
||||
*/
|
||||
|
||||
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
|
||||
#define WIN32
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#if defined(_AIX) || (defined(NETWARE) && defined(__NOVELL_LIBC__))
|
||||
@@ -35,8 +44,12 @@
|
||||
#include <sys/socket.h>
|
||||
#include <tcp.h>
|
||||
#elif defined(WIN32)
|
||||
#include <winsock2.h>
|
||||
#include <windows.h>
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# include <winsock2.h>
|
||||
# include <ws2tcpip.h>
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
@@ -100,6 +113,7 @@ extern "C" {
|
||||
#define ARES_OPT_SORTLIST (1 << 10)
|
||||
#define ARES_OPT_SOCK_SNDBUF (1 << 11)
|
||||
#define ARES_OPT_SOCK_RCVBUF (1 << 12)
|
||||
#define ARES_OPT_TIMEOUTMS (1 << 13)
|
||||
|
||||
/* Nameinfo flag values */
|
||||
#define ARES_NI_NOFQDN (1 << 0)
|
||||
@@ -167,7 +181,7 @@ struct apattern;
|
||||
|
||||
struct ares_options {
|
||||
int flags;
|
||||
int timeout;
|
||||
int timeout; /* in seconds or milliseconds, depending on options */
|
||||
int tries;
|
||||
int ndots;
|
||||
unsigned short udp_port;
|
||||
@@ -232,10 +246,38 @@ int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
|
||||
int alen, char **s, long *enclen);
|
||||
int ares_expand_string(const unsigned char *encoded, const unsigned char *abuf,
|
||||
int alen, unsigned char **s, long *enclen);
|
||||
|
||||
#if !defined(HAVE_STRUCT_IN6_ADDR) && !defined(s6_addr)
|
||||
struct in6_addr {
|
||||
union {
|
||||
unsigned char _S6_u8[16];
|
||||
} _S6_un;
|
||||
};
|
||||
#define s6_addr _S6_un._S6_u8
|
||||
#endif
|
||||
|
||||
struct addrttl {
|
||||
struct in_addr ipaddr;
|
||||
int ttl;
|
||||
};
|
||||
struct addr6ttl {
|
||||
struct in6_addr ip6addr;
|
||||
int ttl;
|
||||
};
|
||||
|
||||
/*
|
||||
** Parse the buffer, starting at *abuf and of length alen bytes, previously
|
||||
** obtained from an ares_search call. Put the results in *host, if nonnull.
|
||||
** Also, if addrttls is nonnull, put up to *naddrttls IPv4 addresses along with
|
||||
** their TTLs in that array, and set *naddrttls to the number of addresses
|
||||
** so written.
|
||||
*/
|
||||
int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
||||
struct hostent **host);
|
||||
struct hostent **host,
|
||||
struct addrttl *addrttls, int *naddrttls);
|
||||
int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
struct hostent **host);
|
||||
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,
|
||||
|
97
ares/ares__timeval.c
Normal file
97
ares/ares__timeval.c
Normal file
@@ -0,0 +1,97 @@
|
||||
/* $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.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
#if defined(WIN32) && !defined(MSDOS)
|
||||
|
||||
struct timeval ares__tvnow(void)
|
||||
{
|
||||
/*
|
||||
** GetTickCount() is available on _all_ Windows versions from W95 up
|
||||
** to nowadays. Returns milliseconds elapsed since last system boot,
|
||||
** increases monotonically and wraps once 49.7 days have elapsed.
|
||||
*/
|
||||
struct timeval now;
|
||||
DWORD milliseconds = GetTickCount();
|
||||
now.tv_sec = milliseconds / 1000;
|
||||
now.tv_usec = (milliseconds % 1000) * 1000;
|
||||
return now;
|
||||
}
|
||||
|
||||
#elif defined(HAVE_CLOCK_GETTIME_MONOTONIC)
|
||||
|
||||
struct timeval ares__tvnow(void)
|
||||
{
|
||||
/*
|
||||
** clock_gettime() is granted to be increased monotonically when the
|
||||
** monotonic clock is queried. Time starting point is unspecified, it
|
||||
** could be the system start-up time, the Epoch, or something else,
|
||||
** in any case the time starting point does not change once that the
|
||||
** system has started up.
|
||||
*/
|
||||
struct timeval now;
|
||||
struct timespec tsnow;
|
||||
(void)clock_gettime(CLOCK_MONOTONIC, &tsnow);
|
||||
now.tv_sec = tsnow.tv_sec;
|
||||
now.tv_usec = tsnow.tv_nsec / 1000;
|
||||
return now;
|
||||
}
|
||||
|
||||
#elif defined(HAVE_GETTIMEOFDAY)
|
||||
|
||||
struct timeval ares__tvnow(void)
|
||||
{
|
||||
/*
|
||||
** gettimeofday() is not granted to be increased monotonically, due to
|
||||
** clock drifting and external source time synchronization it can jump
|
||||
** forward or backward in time.
|
||||
*/
|
||||
struct timeval now;
|
||||
(void)gettimeofday(&now, NULL);
|
||||
return now;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
struct timeval ares__tvnow(void)
|
||||
{
|
||||
/*
|
||||
** time() returns the value of time in seconds since the Epoch.
|
||||
*/
|
||||
struct timeval now;
|
||||
now.tv_sec = (long)time(NULL);
|
||||
now.tv_usec = 0;
|
||||
return now;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if 0 /* Not used */
|
||||
/*
|
||||
* Make sure that the first argument is the more recent time, as otherwise
|
||||
* we'll get a weird negative time-diff back...
|
||||
*
|
||||
* Returns: the time difference in number of milliseconds.
|
||||
*/
|
||||
long ares__tvdiff(struct timeval newer, struct timeval older)
|
||||
{
|
||||
return (newer.tv_sec-older.tv_sec)*1000+
|
||||
(newer.tv_usec-older.tv_usec)/1000;
|
||||
}
|
||||
#endif
|
||||
|
@@ -58,6 +58,7 @@ static void addr_callback(void *arg, int status, int timeouts,
|
||||
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);
|
||||
|
||||
void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen,
|
||||
int family, ares_host_callback callback, void *arg)
|
||||
@@ -101,48 +102,26 @@ static void next_lookup(struct addr_query *aquery)
|
||||
{
|
||||
const char *p;
|
||||
char name[128];
|
||||
int a1, a2, a3, a4, status;
|
||||
int status;
|
||||
struct hostent *host;
|
||||
unsigned long addr;
|
||||
|
||||
for (p = aquery->remaining_lookups; *p; p++)
|
||||
{
|
||||
switch (*p)
|
||||
{
|
||||
case 'b':
|
||||
if (aquery->family == AF_INET)
|
||||
{
|
||||
addr = ntohl(aquery->addr.addr4.s_addr);
|
||||
a1 = (int)((addr >> 24) & 0xff);
|
||||
a2 = (int)((addr >> 16) & 0xff);
|
||||
a3 = (int)((addr >> 8) & 0xff);
|
||||
a4 = (int)(addr & 0xff);
|
||||
sprintf(name, "%d.%d.%d.%d.in-addr.arpa", a4, a3, a2, a1);
|
||||
aquery->remaining_lookups = p + 1;
|
||||
ares_query(aquery->channel, name, C_IN, T_PTR, addr_callback,
|
||||
aquery);
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned char *bytes;
|
||||
bytes = (unsigned char *)&aquery->addr.addr6.s6_addr;
|
||||
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",
|
||||
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[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,
|
||||
bytes[1]&0xf, bytes[1] >> 4, bytes[0]&0xf, bytes[0] >> 4);
|
||||
aquery->remaining_lookups = p + 1;
|
||||
ares_query(aquery->channel, name, C_IN, T_PTR, addr_callback,
|
||||
aquery);
|
||||
}
|
||||
ptr_rr_name(name, aquery->family, &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);
|
||||
if (status != ARES_ENOTFOUND)
|
||||
|
||||
/* this status check below previously checked for !ARES_ENOTFOUND,
|
||||
but we should not assume that this single error code is the one
|
||||
that can occur, as that is in fact no longer the case */
|
||||
if (status == ARES_SUCCESS)
|
||||
{
|
||||
end_aquery(aquery, status, host);
|
||||
return;
|
||||
@@ -264,3 +243,31 @@ static int file_lookup(union ares_addr *addr, int family, struct hostent **host)
|
||||
*host = NULL;
|
||||
return status;
|
||||
}
|
||||
|
||||
static void ptr_rr_name(char *name, int family, union ares_addr *addr)
|
||||
{
|
||||
if (family == AF_INET)
|
||||
{
|
||||
unsigned long laddr = ntohl(addr->addr4.s_addr);
|
||||
int a1 = (int)((laddr >> 24) & 0xff);
|
||||
int a2 = (int)((laddr >> 16) & 0xff);
|
||||
int a3 = (int)((laddr >> 8) & 0xff);
|
||||
int a4 = (int)(laddr & 0xff);
|
||||
sprintf(name, "%d.%d.%d.%d.in-addr.arpa", a4, a3, a2, a1);
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned char *bytes = (unsigned char *)&addr->addr6.s6_addr;
|
||||
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",
|
||||
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[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,
|
||||
bytes[1]&0xf, bytes[1] >> 4, bytes[0]&0xf, bytes[0] >> 4);
|
||||
}
|
||||
}
|
||||
|
@@ -36,6 +36,9 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
@@ -57,7 +60,7 @@ struct host_query {
|
||||
int timeouts;
|
||||
};
|
||||
|
||||
static void next_lookup(struct host_query *hquery, int status);
|
||||
static void next_lookup(struct host_query *hquery, int status_code);
|
||||
static void host_callback(void *arg, int status, int timeouts,
|
||||
unsigned char *abuf, int alen);
|
||||
static void end_hquery(struct host_query *hquery, int status,
|
||||
@@ -111,13 +114,14 @@ void ares_gethostbyname(ares_channel channel, const char *name, int family,
|
||||
hquery->timeouts = 0;
|
||||
|
||||
/* Start performing lookups according to channel->lookups. */
|
||||
next_lookup(hquery, ARES_SUCCESS);
|
||||
next_lookup(hquery, ARES_ECONNREFUSED /* initial error code */);
|
||||
}
|
||||
|
||||
static void next_lookup(struct host_query *hquery, int status)
|
||||
static void next_lookup(struct host_query *hquery, int status_code)
|
||||
{
|
||||
const char *p;
|
||||
struct hostent *host;
|
||||
int status = status_code;
|
||||
|
||||
for (p = hquery->remaining_lookups; *p; p++)
|
||||
{
|
||||
@@ -137,11 +141,16 @@ static void next_lookup(struct host_query *hquery, int status)
|
||||
case 'f':
|
||||
/* Host file lookup */
|
||||
status = file_lookup(hquery->name, hquery->family, &host);
|
||||
if (status != ARES_ENOTFOUND)
|
||||
|
||||
/* this status check below previously checked for !ARES_ENOTFOUND,
|
||||
but we should not assume that this single error code is the one
|
||||
that can occur, as that is in fact no longer the case */
|
||||
if (status == ARES_SUCCESS)
|
||||
{
|
||||
end_hquery(hquery, status, host);
|
||||
return;
|
||||
}
|
||||
status = status_code; /* Use original status code */
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -153,20 +162,20 @@ static void host_callback(void *arg, int status, int timeouts,
|
||||
{
|
||||
struct host_query *hquery = (struct host_query *) arg;
|
||||
ares_channel channel = hquery->channel;
|
||||
struct hostent *host;
|
||||
struct hostent *host = NULL;
|
||||
|
||||
hquery->timeouts += timeouts;
|
||||
if (status == ARES_SUCCESS)
|
||||
{
|
||||
if (hquery->family == AF_INET)
|
||||
{
|
||||
status = ares_parse_a_reply(abuf, alen, &host);
|
||||
status = ares_parse_a_reply(abuf, alen, &host, NULL, NULL);
|
||||
if (host && channel->nsort)
|
||||
sort_addresses(host, channel->sortlist, channel->nsort);
|
||||
}
|
||||
else if (hquery->family == AF_INET6)
|
||||
{
|
||||
status = ares_parse_aaaa_reply(abuf, alen, &host);
|
||||
status = ares_parse_aaaa_reply(abuf, alen, &host, NULL, NULL);
|
||||
if (host && channel->nsort)
|
||||
sort6_addresses(host, channel->sortlist, channel->nsort);
|
||||
}
|
||||
|
@@ -82,7 +82,7 @@ ares_getopt(int nargc, char * const nargv[], const char *ostr)
|
||||
}
|
||||
} /* option letter okay? */
|
||||
if ((optopt = (int)*place++) == (int)':' ||
|
||||
!(oli = strchr(ostr, optopt))) {
|
||||
(oli = strchr(ostr, optopt)) == NULL) {
|
||||
/*
|
||||
* if the user didn't specify '-' as an option,
|
||||
* assume it means EOF.
|
||||
|
@@ -1,6 +1,7 @@
|
||||
.\" $Id$
|
||||
.\"
|
||||
.\" Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
.\" Copyright (C) 2007-2008 by Daniel Stenberg
|
||||
.\"
|
||||
.\" Permission to use, copy, modify, and distribute this
|
||||
.\" software and its documentation for any purpose and without
|
||||
@@ -14,7 +15,7 @@
|
||||
.\" this software for any purpose. It is provided "as is"
|
||||
.\" without express or implied warranty.
|
||||
.\"
|
||||
.TH ARES_INIT 3 "7 December 2004"
|
||||
.TH ARES_INIT 3 "13 May 2008"
|
||||
.SH NAME
|
||||
ares_init, ares_init_options \- Initialize a resolver channel
|
||||
.SH SYNOPSIS
|
||||
@@ -49,10 +50,22 @@ description of possible flag values.
|
||||
.B ARES_OPT_TIMEOUT
|
||||
.B int \fItimeout\fP;
|
||||
.br
|
||||
The number of seconds each name server is given to respond to a query
|
||||
on the first try. (After the first try, the timeout algorithm becomes
|
||||
more complicated, but scales linearly with the value of
|
||||
\fItimeout\fP.) The default is five seconds.
|
||||
The number of seconds each name server is given to respond to a query on the
|
||||
first try. (After the first try, the timeout algorithm becomes more
|
||||
complicated, but scales linearly with the value of \fItimeout\fP.) The
|
||||
default is five seconds. This option is being deprecated by
|
||||
\fIARES_OPT_TIMEOUTMS\fP starting in c-ares 1.5.2.
|
||||
.TP 18
|
||||
.B ARES_OPT_TIMEOUTMS
|
||||
.B int \fItimeout\fP;
|
||||
.br
|
||||
The number of milliseconds each name server is given to respond to a query on
|
||||
the first try. (After the first try, the timeout algorithm becomes more
|
||||
complicated, but scales linearly with the value of \fItimeout\fP.) The
|
||||
default is five seconds. Note that this option is specified with the same
|
||||
struct field as the former \fIARES_OPT_TIMEOUT\fP, it is but the option bits
|
||||
that tell c-ares how to interpret the number. This option was added in c-ares
|
||||
1.5.2.
|
||||
.TP 18
|
||||
.B ARES_OPT_TRIES
|
||||
.B int \fItries\fP;
|
||||
|
@@ -1,6 +1,7 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2007-2008 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -107,6 +108,7 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
||||
int i;
|
||||
int status = ARES_SUCCESS;
|
||||
struct server_state *server;
|
||||
struct timeval now;
|
||||
|
||||
#ifdef CURLDEBUG
|
||||
const char *env = getenv("CARES_MEMDEBUG");
|
||||
@@ -124,6 +126,8 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
||||
return ARES_ENOMEM;
|
||||
}
|
||||
|
||||
now = ares__tvnow();
|
||||
|
||||
/* Set everything to distinguished values so we know they haven't
|
||||
* been set yet.
|
||||
*/
|
||||
@@ -146,7 +150,7 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
||||
channel->sock_state_cb = NULL;
|
||||
channel->sock_state_cb_data = NULL;
|
||||
|
||||
channel->last_timeout_processed = (long)time(NULL);
|
||||
channel->last_timeout_processed = (time_t)now.tv_sec;
|
||||
|
||||
/* Initialize our lists of queries */
|
||||
ares__init_list_head(&(channel->all_queries));
|
||||
@@ -254,13 +258,16 @@ int ares_save_options(ares_channel channel, struct ares_options *options,
|
||||
if (!ARES_CONFIG_CHECK(channel))
|
||||
return ARES_ENODATA;
|
||||
|
||||
(*optmask) = (ARES_OPT_FLAGS|ARES_OPT_TIMEOUT|ARES_OPT_TRIES|ARES_OPT_NDOTS|
|
||||
(*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_SORTLIST|ARES_OPT_TIMEOUTMS);
|
||||
|
||||
/* Copy easy stuff */
|
||||
options->flags = channel->flags;
|
||||
|
||||
/* We return full millisecond resolution but that's only because we don't
|
||||
set the ARES_OPT_TIMEOUT anymore, only the new ARES_OPT_TIMEOUTMS */
|
||||
options->timeout = channel->timeout;
|
||||
options->tries = channel->tries;
|
||||
options->ndots = channel->ndots;
|
||||
@@ -328,8 +335,10 @@ static int init_by_options(ares_channel channel,
|
||||
/* Easy stuff. */
|
||||
if ((optmask & ARES_OPT_FLAGS) && channel->flags == -1)
|
||||
channel->flags = options->flags;
|
||||
if ((optmask & ARES_OPT_TIMEOUT) && channel->timeout == -1)
|
||||
if ((optmask & ARES_OPT_TIMEOUTMS) && channel->timeout == -1)
|
||||
channel->timeout = options->timeout;
|
||||
else if ((optmask & ARES_OPT_TIMEOUT) && channel->timeout == -1)
|
||||
channel->timeout = options->timeout * 1000;
|
||||
if ((optmask & ARES_OPT_TRIES) && channel->tries == -1)
|
||||
channel->tries = options->tries;
|
||||
if ((optmask & ARES_OPT_NDOTS) && channel->ndots == -1)
|
||||
@@ -1245,16 +1254,61 @@ static int set_options(ares_channel channel, const char *str)
|
||||
static char *try_config(char *s, const char *opt)
|
||||
{
|
||||
size_t len;
|
||||
ssize_t i;
|
||||
ssize_t j;
|
||||
char *p;
|
||||
|
||||
len = strlen(opt);
|
||||
if (strncmp(s, opt, len) != 0 || !ISSPACE(s[len]))
|
||||
if (!s || !opt)
|
||||
/* no line or no option */
|
||||
return NULL;
|
||||
s += len;
|
||||
while (ISSPACE(*s))
|
||||
s++;
|
||||
return s;
|
||||
}
|
||||
|
||||
/* trim line comment */
|
||||
for (i = 0; s[i] && s[i] != '#'; ++i);
|
||||
s[i] = '\0';
|
||||
|
||||
/* trim trailing whitespace */
|
||||
for (j = i-1; j >= 0 && ISSPACE(s[j]); --j);
|
||||
s[++j] = '\0';
|
||||
|
||||
/* skip leading whitespace */
|
||||
for (i = 0; s[i] && ISSPACE(s[i]); ++i);
|
||||
p = &s[i];
|
||||
|
||||
if (!*p)
|
||||
/* empty line */
|
||||
return NULL;
|
||||
|
||||
if ((len = strlen(opt)) == 0)
|
||||
/* empty option */
|
||||
return NULL;
|
||||
|
||||
if (strncmp(p, opt, len) != 0)
|
||||
/* line and option do not match */
|
||||
return NULL;
|
||||
|
||||
/* skip over given option name */
|
||||
p += len;
|
||||
|
||||
if (!*p)
|
||||
/* no option value */
|
||||
return NULL;
|
||||
|
||||
if ((opt[len-1] != ':') && (opt[len-1] != '=') && !ISSPACE(*p))
|
||||
/* whitespace between option name and value is mandatory
|
||||
for given option names which do not end with ':' or '=' */
|
||||
return NULL;
|
||||
|
||||
/* skip over whitespace */
|
||||
while (*p && ISSPACE(*p))
|
||||
p++;
|
||||
|
||||
if (!*p)
|
||||
/* no option value */
|
||||
return NULL;
|
||||
|
||||
/* return pointer to option value */
|
||||
return p;
|
||||
}
|
||||
#endif
|
||||
|
||||
static const char *try_option(const char *p, const char *q, const char *opt)
|
||||
@@ -1333,13 +1387,9 @@ static void randomize_key(unsigned char* key,int key_data_len)
|
||||
}
|
||||
#else /* !WIN32 */
|
||||
#ifdef RANDOM_FILE
|
||||
char buffer[256];
|
||||
FILE *f = fopen(RANDOM_FILE, "rb");
|
||||
if(f) {
|
||||
size_t i;
|
||||
size_t rc = fread(buffer, key_data_len, 1, f);
|
||||
for(i=0; i<rc && counter < key_data_len; i++)
|
||||
key[counter++]=buffer[i];
|
||||
counter = fread(key, 1, key_data_len, f);
|
||||
fclose(f);
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,6 +1,7 @@
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
/* Copyright (C) 2005 by Dominick Meglio
|
||||
*
|
||||
* 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
|
||||
@@ -21,11 +22,13 @@
|
||||
#define PF_INET6 AF_INET6
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRUCT_IN6_ADDR
|
||||
struct in6_addr
|
||||
{
|
||||
unsigned char s6_addr[16];
|
||||
#if !defined(HAVE_STRUCT_IN6_ADDR) && !defined(s6_addr)
|
||||
struct in6_addr {
|
||||
union {
|
||||
unsigned char _S6_u8[16];
|
||||
} _S6_un;
|
||||
};
|
||||
#define s6_addr _S6_un._S6_u8
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRUCT_SOCKADDR_IN6
|
||||
@@ -40,7 +43,7 @@ struct sockaddr_in6
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRUCT_ADDRINFO
|
||||
struct addrinfo
|
||||
struct addrinfo
|
||||
{
|
||||
int ai_flags;
|
||||
int ai_family;
|
||||
|
@@ -22,24 +22,39 @@ ares_parse_a_reply \- Parse a reply to a DNS query of type A into a hostent
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_parse_a_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP,
|
||||
.B struct hostent **\fIhost\fP);
|
||||
.B struct hostent **\fIhost\fP,
|
||||
.B struct addrttl *\fIaddrttls\fB, int *\fInaddrttls\fB);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.B ares_parse_a_reply
|
||||
function parses the response to a query of type A into a
|
||||
.BR "struct hostent" .
|
||||
.BR "struct hostent"
|
||||
and/or an array of
|
||||
.BR "struct addrttls" .
|
||||
The parameters
|
||||
.I abuf
|
||||
and
|
||||
.I alen
|
||||
give the contents of the response. The result is stored in allocated
|
||||
memory and a pointer to it stored into the variable pointed to by
|
||||
.IR host .
|
||||
.IR host ,
|
||||
if host is nonnull.
|
||||
It is the caller's responsibility to free the resulting host structure
|
||||
using
|
||||
.BR ares_free_hostent (3)
|
||||
when it is no longer needed.
|
||||
.PP
|
||||
If
|
||||
.IR addrttls
|
||||
and
|
||||
.IR naddrttls
|
||||
are both nonnull,
|
||||
then up to *naddrttls
|
||||
.BR "struct addrttl"
|
||||
records are stored in the array pointed to by addrttls,
|
||||
and then *naddrttls is set to the number of records so stored.
|
||||
Note that the memory for these records is supplied by the caller.
|
||||
.SH RETURN VALUES
|
||||
.B ares_parse_a_reply
|
||||
can return any of the following values:
|
||||
|
@@ -29,27 +29,38 @@
|
||||
#include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
||||
struct hostent **host)
|
||||
struct hostent **host,
|
||||
struct addrttl *addrttls, int *naddrttls)
|
||||
{
|
||||
unsigned int qdcount, ancount;
|
||||
int status, i, rr_type, rr_class, rr_len, naddrs;
|
||||
int status, i, rr_type, rr_class, rr_len, rr_ttl, naddrs;
|
||||
int cname_ttl = INT_MAX; /* the TTL imposed by the CNAME chain */
|
||||
int naliases;
|
||||
long len;
|
||||
const unsigned char *aptr;
|
||||
char *hostname, *rr_name, *rr_data, **aliases;
|
||||
struct in_addr *addrs;
|
||||
struct hostent *hostent;
|
||||
const int max_addr_ttls = (addrttls && naddrttls) ? *naddrttls : 0;
|
||||
|
||||
/* Set *host to NULL for all failure cases. */
|
||||
*host = NULL;
|
||||
if (host)
|
||||
*host = NULL;
|
||||
/* Same with *naddrttls. */
|
||||
if (naddrttls)
|
||||
*naddrttls = 0;
|
||||
|
||||
/* Give up if abuf doesn't have room for a header. */
|
||||
if (alen < HFIXEDSZ)
|
||||
@@ -73,20 +84,29 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
||||
}
|
||||
aptr += len + QFIXEDSZ;
|
||||
|
||||
/* Allocate addresses and aliases; ancount gives an upper bound for both. */
|
||||
addrs = malloc(ancount * sizeof(struct in_addr));
|
||||
if (!addrs)
|
||||
if (host)
|
||||
{
|
||||
free(hostname);
|
||||
return ARES_ENOMEM;
|
||||
/* Allocate addresses and aliases; ancount gives an upper bound for both. */
|
||||
addrs = malloc(ancount * sizeof(struct in_addr));
|
||||
if (!addrs)
|
||||
{
|
||||
free(hostname);
|
||||
return ARES_ENOMEM;
|
||||
}
|
||||
aliases = malloc((ancount + 1) * sizeof(char *));
|
||||
if (!aliases)
|
||||
{
|
||||
free(hostname);
|
||||
free(addrs);
|
||||
return ARES_ENOMEM;
|
||||
}
|
||||
}
|
||||
aliases = malloc((ancount + 1) * sizeof(char *));
|
||||
if (!aliases)
|
||||
else
|
||||
{
|
||||
free(hostname);
|
||||
free(addrs);
|
||||
return ARES_ENOMEM;
|
||||
addrs = NULL;
|
||||
aliases = NULL;
|
||||
}
|
||||
|
||||
naddrs = 0;
|
||||
naliases = 0;
|
||||
|
||||
@@ -106,13 +126,33 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
||||
rr_type = DNS_RR_TYPE(aptr);
|
||||
rr_class = DNS_RR_CLASS(aptr);
|
||||
rr_len = DNS_RR_LEN(aptr);
|
||||
rr_ttl = DNS_RR_TTL(aptr);
|
||||
aptr += RRFIXEDSZ;
|
||||
|
||||
if (rr_class == C_IN && rr_type == T_A
|
||||
&& rr_len == sizeof(struct in_addr)
|
||||
&& strcasecmp(rr_name, hostname) == 0)
|
||||
{
|
||||
memcpy(&addrs[naddrs], aptr, sizeof(struct in_addr));
|
||||
if (addrs)
|
||||
{
|
||||
if (aptr + sizeof(struct in_addr) > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
memcpy(&addrs[naddrs], aptr, sizeof(struct in_addr));
|
||||
}
|
||||
if (naddrs < max_addr_ttls)
|
||||
{
|
||||
struct addrttl * const at = &addrttls[naddrs];
|
||||
if (aptr + sizeof(struct in_addr) > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
memcpy(&at->ipaddr, aptr, sizeof(struct in_addr));
|
||||
at->ttl = rr_ttl;
|
||||
}
|
||||
naddrs++;
|
||||
status = ARES_SUCCESS;
|
||||
}
|
||||
@@ -120,7 +160,10 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
||||
if (rr_class == C_IN && rr_type == T_CNAME)
|
||||
{
|
||||
/* Record the RR name as an alias. */
|
||||
aliases[naliases] = rr_name;
|
||||
if (aliases)
|
||||
aliases[naliases] = rr_name;
|
||||
else
|
||||
free(rr_name);
|
||||
naliases++;
|
||||
|
||||
/* Decode the RR data and replace the hostname with it. */
|
||||
@@ -129,6 +172,10 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
||||
break;
|
||||
free(hostname);
|
||||
hostname = rr_data;
|
||||
|
||||
/* Take the min of the TTLs we see in the CNAME chain. */
|
||||
if (cname_ttl > rr_ttl)
|
||||
cname_ttl = rr_ttl;
|
||||
}
|
||||
else
|
||||
free(rr_name);
|
||||
@@ -145,32 +192,51 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
||||
status = ARES_ENODATA;
|
||||
if (status == ARES_SUCCESS)
|
||||
{
|
||||
/* We got our answer. Allocate memory to build the host entry. */
|
||||
aliases[naliases] = NULL;
|
||||
hostent = malloc(sizeof(struct hostent));
|
||||
if (hostent)
|
||||
/* We got our answer. */
|
||||
if (naddrttls)
|
||||
{
|
||||
hostent->h_addr_list = malloc((naddrs + 1) * sizeof(char *));
|
||||
if (hostent->h_addr_list)
|
||||
const int n = naddrs < max_addr_ttls ? naddrs : max_addr_ttls;
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
/* Fill in the hostent and return successfully. */
|
||||
hostent->h_name = hostname;
|
||||
hostent->h_aliases = aliases;
|
||||
hostent->h_addrtype = AF_INET;
|
||||
hostent->h_length = sizeof(struct in_addr);
|
||||
for (i = 0; i < naddrs; i++)
|
||||
hostent->h_addr_list[i] = (char *) &addrs[i];
|
||||
hostent->h_addr_list[naddrs] = NULL;
|
||||
*host = hostent;
|
||||
return ARES_SUCCESS;
|
||||
/* Ensure that each A TTL is no larger than the CNAME TTL. */
|
||||
if (addrttls[i].ttl > cname_ttl)
|
||||
addrttls[i].ttl = cname_ttl;
|
||||
}
|
||||
free(hostent);
|
||||
*naddrttls = n;
|
||||
}
|
||||
status = ARES_ENOMEM;
|
||||
if (aliases)
|
||||
aliases[naliases] = NULL;
|
||||
if (host)
|
||||
{
|
||||
/* Allocate memory to build the host entry. */
|
||||
hostent = malloc(sizeof(struct hostent));
|
||||
if (hostent)
|
||||
{
|
||||
hostent->h_addr_list = malloc((naddrs + 1) * sizeof(char *));
|
||||
if (hostent->h_addr_list)
|
||||
{
|
||||
/* Fill in the hostent and return successfully. */
|
||||
hostent->h_name = hostname;
|
||||
hostent->h_aliases = aliases;
|
||||
hostent->h_addrtype = AF_INET;
|
||||
hostent->h_length = sizeof(struct in_addr);
|
||||
for (i = 0; i < naddrs; i++)
|
||||
hostent->h_addr_list[i] = (char *) &addrs[i];
|
||||
hostent->h_addr_list[naddrs] = NULL;
|
||||
*host = hostent;
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
free(hostent);
|
||||
}
|
||||
status = ARES_ENOMEM;
|
||||
}
|
||||
}
|
||||
if (aliases)
|
||||
{
|
||||
for (i = 0; i < naliases; i++)
|
||||
free(aliases[i]);
|
||||
free(aliases);
|
||||
}
|
||||
for (i = 0; i < naliases; i++)
|
||||
free(aliases[i]);
|
||||
free(aliases);
|
||||
free(addrs);
|
||||
free(hostname);
|
||||
return status;
|
||||
|
@@ -22,24 +22,39 @@ ares_parse_aaaa_reply \- Parse a reply to a DNS query of type AAAA into a hosten
|
||||
.B #include <ares.h>
|
||||
.PP
|
||||
.B int ares_parse_aaaa_reply(const unsigned char *\fIabuf\fP, int \fIalen\fP,
|
||||
.B struct hostent **\fIhost\fP);
|
||||
.B struct hostent **\fIhost\fP,
|
||||
.B struct addrttl *\fIaddrttls\fB, int *\fInaddrttls\fB);
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.B ares_parse_aaaa_reply
|
||||
function parses the response to a query of type AAAA into a
|
||||
.BR "struct hostent" .
|
||||
.BR "struct hostent"
|
||||
and/or an array of
|
||||
.BR "struct addrttls" .
|
||||
The parameters
|
||||
.I abuf
|
||||
and
|
||||
.I alen
|
||||
give the contents of the response. The result is stored in allocated
|
||||
memory and a pointer to it stored into the variable pointed to by
|
||||
.IR host .
|
||||
.IR host ,
|
||||
if host is nonnull.
|
||||
It is the caller's responsibility to free the resulting host structure
|
||||
using
|
||||
.BR ares_free_hostent (3)
|
||||
when it is no longer needed.
|
||||
.PP
|
||||
If
|
||||
.IR addrttls
|
||||
and
|
||||
.IR naddrttls
|
||||
are both nonnull,
|
||||
then up to *naddrttls
|
||||
.BR "struct addr6ttl"
|
||||
records are stored in the array pointed to by addrttls,
|
||||
and then *naddrttls is set to the number of records so stored.
|
||||
Note that the memory for these records is supplied by the caller.
|
||||
.SH RETURN VALUES
|
||||
.B ares_parse_aaaa_reply
|
||||
can return any of the following values:
|
||||
|
@@ -31,28 +31,39 @@
|
||||
#include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
struct hostent **host)
|
||||
struct hostent **host, struct addr6ttl *addrttls,
|
||||
int *naddrttls)
|
||||
{
|
||||
unsigned int qdcount, ancount;
|
||||
int status, i, rr_type, rr_class, rr_len, naddrs;
|
||||
int status, i, rr_type, rr_class, rr_len, rr_ttl, naddrs;
|
||||
int cname_ttl = INT_MAX; /* the TTL imposed by the CNAME chain */
|
||||
int naliases;
|
||||
long len;
|
||||
const unsigned char *aptr;
|
||||
char *hostname, *rr_name, *rr_data, **aliases;
|
||||
struct in6_addr *addrs;
|
||||
struct hostent *hostent;
|
||||
const int max_addr_ttls = (addrttls && naddrttls) ? *naddrttls : 0;
|
||||
|
||||
/* Set *host to NULL for all failure cases. */
|
||||
*host = NULL;
|
||||
if (host)
|
||||
*host = NULL;
|
||||
/* Same with *naddrttls. */
|
||||
if (naddrttls)
|
||||
*naddrttls = 0;
|
||||
|
||||
/* Give up if abuf doesn't have room for a header. */
|
||||
if (alen < HFIXEDSZ)
|
||||
@@ -77,18 +88,26 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
aptr += len + QFIXEDSZ;
|
||||
|
||||
/* Allocate addresses and aliases; ancount gives an upper bound for both. */
|
||||
addrs = malloc(ancount * sizeof(struct in6_addr));
|
||||
if (!addrs)
|
||||
if (host)
|
||||
{
|
||||
free(hostname);
|
||||
return ARES_ENOMEM;
|
||||
addrs = malloc(ancount * sizeof(struct in6_addr));
|
||||
if (!addrs)
|
||||
{
|
||||
free(hostname);
|
||||
return ARES_ENOMEM;
|
||||
}
|
||||
aliases = malloc((ancount + 1) * sizeof(char *));
|
||||
if (!aliases)
|
||||
{
|
||||
free(hostname);
|
||||
free(addrs);
|
||||
return ARES_ENOMEM;
|
||||
}
|
||||
}
|
||||
aliases = malloc((ancount + 1) * sizeof(char *));
|
||||
if (!aliases)
|
||||
else
|
||||
{
|
||||
free(hostname);
|
||||
free(addrs);
|
||||
return ARES_ENOMEM;
|
||||
addrs = NULL;
|
||||
aliases = NULL;
|
||||
}
|
||||
naddrs = 0;
|
||||
naliases = 0;
|
||||
@@ -109,13 +128,33 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
rr_type = DNS_RR_TYPE(aptr);
|
||||
rr_class = DNS_RR_CLASS(aptr);
|
||||
rr_len = DNS_RR_LEN(aptr);
|
||||
rr_ttl = DNS_RR_TTL(aptr);
|
||||
aptr += RRFIXEDSZ;
|
||||
|
||||
if (rr_class == C_IN && rr_type == T_AAAA
|
||||
&& rr_len == sizeof(struct in6_addr)
|
||||
&& strcasecmp(rr_name, hostname) == 0)
|
||||
{
|
||||
memcpy(&addrs[naddrs], aptr, sizeof(struct in6_addr));
|
||||
if (addrs)
|
||||
{
|
||||
if (aptr + sizeof(struct in6_addr) > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
memcpy(&addrs[naddrs], aptr, sizeof(struct in6_addr));
|
||||
}
|
||||
if (naddrs < max_addr_ttls)
|
||||
{
|
||||
struct addr6ttl * const at = &addrttls[naddrs];
|
||||
if (aptr + sizeof(struct in6_addr) > abuf + alen)
|
||||
{
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
memcpy(&at->ip6addr, aptr, sizeof(struct in6_addr));
|
||||
at->ttl = rr_ttl;
|
||||
}
|
||||
naddrs++;
|
||||
status = ARES_SUCCESS;
|
||||
}
|
||||
@@ -123,7 +162,10 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
if (rr_class == C_IN && rr_type == T_CNAME)
|
||||
{
|
||||
/* Record the RR name as an alias. */
|
||||
aliases[naliases] = rr_name;
|
||||
if (aliases)
|
||||
aliases[naliases] = rr_name;
|
||||
else
|
||||
free(rr_name);
|
||||
naliases++;
|
||||
|
||||
/* Decode the RR data and replace the hostname with it. */
|
||||
@@ -132,6 +174,10 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
break;
|
||||
free(hostname);
|
||||
hostname = rr_data;
|
||||
|
||||
/* Take the min of the TTLs we see in the CNAME chain. */
|
||||
if (cname_ttl > rr_ttl)
|
||||
cname_ttl = rr_ttl;
|
||||
}
|
||||
else
|
||||
free(rr_name);
|
||||
@@ -148,32 +194,51 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
status = ARES_ENODATA;
|
||||
if (status == ARES_SUCCESS)
|
||||
{
|
||||
/* We got our answer. Allocate memory to build the host entry. */
|
||||
aliases[naliases] = NULL;
|
||||
hostent = malloc(sizeof(struct hostent));
|
||||
if (hostent)
|
||||
/* We got our answer. */
|
||||
if (naddrttls)
|
||||
{
|
||||
hostent->h_addr_list = malloc((naddrs + 1) * sizeof(char *));
|
||||
if (hostent->h_addr_list)
|
||||
const int n = naddrs < max_addr_ttls ? naddrs : max_addr_ttls;
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
/* Fill in the hostent and return successfully. */
|
||||
hostent->h_name = hostname;
|
||||
hostent->h_aliases = aliases;
|
||||
hostent->h_addrtype = AF_INET6;
|
||||
hostent->h_length = sizeof(struct in6_addr);
|
||||
for (i = 0; i < naddrs; i++)
|
||||
hostent->h_addr_list[i] = (char *) &addrs[i];
|
||||
hostent->h_addr_list[naddrs] = NULL;
|
||||
*host = hostent;
|
||||
return ARES_SUCCESS;
|
||||
/* Ensure that each A TTL is no larger than the CNAME TTL. */
|
||||
if (addrttls[i].ttl > cname_ttl)
|
||||
addrttls[i].ttl = cname_ttl;
|
||||
}
|
||||
free(hostent);
|
||||
*naddrttls = n;
|
||||
}
|
||||
if (aliases)
|
||||
aliases[naliases] = NULL;
|
||||
if (host)
|
||||
{
|
||||
/* Allocate memory to build the host entry. */
|
||||
hostent = malloc(sizeof(struct hostent));
|
||||
if (hostent)
|
||||
{
|
||||
hostent->h_addr_list = malloc((naddrs + 1) * sizeof(char *));
|
||||
if (hostent->h_addr_list)
|
||||
{
|
||||
/* Fill in the hostent and return successfully. */
|
||||
hostent->h_name = hostname;
|
||||
hostent->h_aliases = aliases;
|
||||
hostent->h_addrtype = AF_INET6;
|
||||
hostent->h_length = sizeof(struct in6_addr);
|
||||
for (i = 0; i < naddrs; i++)
|
||||
hostent->h_addr_list[i] = (char *) &addrs[i];
|
||||
hostent->h_addr_list[naddrs] = NULL;
|
||||
*host = hostent;
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
free(hostent);
|
||||
}
|
||||
status = ARES_ENOMEM;
|
||||
}
|
||||
status = ARES_ENOMEM;
|
||||
}
|
||||
for (i = 0; i < naliases; i++)
|
||||
free(aliases[i]);
|
||||
free(aliases);
|
||||
if (aliases)
|
||||
{
|
||||
for (i = 0; i < naliases; i++)
|
||||
free(aliases[i]);
|
||||
free(aliases);
|
||||
}
|
||||
free(addrs);
|
||||
free(hostname);
|
||||
return status;
|
||||
|
@@ -28,6 +28,9 @@
|
||||
#include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -44,6 +47,8 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
||||
const unsigned char *aptr;
|
||||
char *ptrname, *hostname, *rr_name, *rr_data;
|
||||
struct hostent *hostent;
|
||||
int aliascnt = 0;
|
||||
char ** aliases;
|
||||
|
||||
/* Set *host to NULL for all failure cases. */
|
||||
*host = NULL;
|
||||
@@ -72,6 +77,12 @@ 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 *));
|
||||
if (!aliases)
|
||||
{
|
||||
free(ptrname);
|
||||
return ARES_ENOMEM;
|
||||
}
|
||||
for (i = 0; i < (int)ancount; i++)
|
||||
{
|
||||
/* Decode the RR up to the data field. */
|
||||
@@ -99,6 +110,16 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
||||
if (hostname)
|
||||
free(hostname);
|
||||
hostname = rr_data;
|
||||
aliases[aliascnt] = malloc((strlen(rr_data)+1) * sizeof(char *));
|
||||
if (!aliases[aliascnt])
|
||||
{
|
||||
status = ARES_ENOMEM;
|
||||
break;
|
||||
}
|
||||
strncpy(aliases[aliascnt], rr_data, strlen(rr_data)+1);
|
||||
aliascnt++;
|
||||
if ((aliascnt%8)==0)
|
||||
aliases = (char **) realloc(aliases, (aliascnt/16+1) * sizeof(char *));
|
||||
}
|
||||
|
||||
if (rr_class == C_IN && rr_type == T_CNAME)
|
||||
@@ -134,17 +155,20 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
||||
hostent->h_addr_list[0] = malloc(addrlen);
|
||||
if (hostent->h_addr_list[0])
|
||||
{
|
||||
hostent->h_aliases = malloc(sizeof (char *));
|
||||
hostent->h_aliases = malloc((aliascnt+1) * sizeof (char *));
|
||||
if (hostent->h_aliases)
|
||||
{
|
||||
/* Fill in the hostent and return successfully. */
|
||||
hostent->h_name = hostname;
|
||||
hostent->h_aliases[0] = NULL;
|
||||
for (i=0 ; i<aliascnt ; i++)
|
||||
hostent->h_aliases[i] = aliases[i];
|
||||
hostent->h_aliases[aliascnt] = NULL;
|
||||
hostent->h_addrtype = family;
|
||||
hostent->h_length = addrlen;
|
||||
memcpy(hostent->h_addr_list[0], addr, addrlen);
|
||||
hostent->h_addr_list[1] = NULL;
|
||||
*host = hostent;
|
||||
free(aliases);
|
||||
free(ptrname);
|
||||
return ARES_SUCCESS;
|
||||
}
|
||||
@@ -156,6 +180,10 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
||||
}
|
||||
status = ARES_ENOMEM;
|
||||
}
|
||||
for (i=0 ; i<aliascnt ; i++)
|
||||
if (aliases[i])
|
||||
free(aliases[i]);
|
||||
free(aliases);
|
||||
if (hostname)
|
||||
free(hostname);
|
||||
free(ptrname);
|
||||
|
@@ -4,6 +4,7 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2004-2008 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -18,6 +19,14 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Define WIN32 when build target is Win32 API
|
||||
*/
|
||||
|
||||
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
|
||||
#define WIN32
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -40,7 +49,7 @@
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#define DEFAULT_TIMEOUT 5
|
||||
#define DEFAULT_TIMEOUT 5000 /* milliseconds */
|
||||
#define DEFAULT_TRIES 4
|
||||
#ifndef INADDR_NONE
|
||||
#define INADDR_NONE 0xffffffff
|
||||
@@ -141,7 +150,7 @@ struct server_state {
|
||||
struct query {
|
||||
/* Query ID from qbuf, for faster lookup, and current timeout */
|
||||
unsigned short qid;
|
||||
time_t timeout;
|
||||
struct timeval timeout;
|
||||
|
||||
/*
|
||||
* Links for the doubly-linked lists in which we insert a query.
|
||||
@@ -209,7 +218,7 @@ typedef struct rc4_key
|
||||
struct ares_channeldata {
|
||||
/* Configuration data */
|
||||
int flags;
|
||||
int timeout;
|
||||
int timeout; /* in milliseconds */
|
||||
int tries;
|
||||
int ndots;
|
||||
int udp_port;
|
||||
@@ -234,7 +243,8 @@ struct ares_channeldata {
|
||||
/* Generation number to use for the next TCP socket open/close */
|
||||
int tcp_connection_generation;
|
||||
|
||||
/* The time at which we last called process_timeouts() */
|
||||
/* The time at which we last called process_timeouts(). Uses integer seconds
|
||||
just to draw the line somewhere. */
|
||||
time_t last_timeout_processed;
|
||||
|
||||
/* Circular, doubly-linked list of queries, bucketed various ways.... */
|
||||
@@ -251,13 +261,27 @@ struct ares_channeldata {
|
||||
void *sock_state_cb_data;
|
||||
};
|
||||
|
||||
/* return true if now is exactly check time or later */
|
||||
int ares__timedout(struct timeval *now,
|
||||
struct timeval *check);
|
||||
/* add the specific number of milliseconds to the time in the first argument */
|
||||
int ares__timeadd(struct timeval *now,
|
||||
int millisecs);
|
||||
/* return time offset between now and (future) check, in milliseconds */
|
||||
int ares__timeoffset(struct timeval *now,
|
||||
struct timeval *check);
|
||||
void ares__rc4(rc4_key* key,unsigned char *buffer_ptr, int buffer_len);
|
||||
void ares__send_query(ares_channel channel, struct query *query, time_t now);
|
||||
void ares__send_query(ares_channel channel, struct query *query,
|
||||
struct timeval *now);
|
||||
void ares__close_sockets(ares_channel channel, struct server_state *server);
|
||||
int ares__get_hostent(FILE *fp, int family, struct hostent **host);
|
||||
int ares__read_line(FILE *fp, char **buf, int *bufsize);
|
||||
void ares__free_query(struct query *query);
|
||||
short ares__generate_new_id(rc4_key* key);
|
||||
struct timeval ares__tvnow(void);
|
||||
#if 0 /* Not used */
|
||||
long ares__tvdiff(struct timeval t1, struct timeval t2);
|
||||
#endif
|
||||
|
||||
#define ARES_SWAP_BYTE(a,b) \
|
||||
{ unsigned char swapByte = *(a); *(a) = *(b); *(b) = swapByte; }
|
||||
|
@@ -1,6 +1,7 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2004-2008 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -42,8 +43,14 @@
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#endif /* WIN32 && !WATT32 */
|
||||
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
@@ -68,21 +75,25 @@
|
||||
|
||||
static int try_again(int errnum);
|
||||
static void write_tcp_data(ares_channel channel, fd_set *write_fds,
|
||||
ares_socket_t write_fd, time_t now);
|
||||
ares_socket_t write_fd, struct timeval *now);
|
||||
static void read_tcp_data(ares_channel channel, fd_set *read_fds,
|
||||
ares_socket_t read_fd, time_t now);
|
||||
ares_socket_t read_fd, struct timeval *now);
|
||||
static void read_udp_packets(ares_channel channel, fd_set *read_fds,
|
||||
ares_socket_t read_fd, time_t now);
|
||||
ares_socket_t read_fd, struct timeval *now);
|
||||
static void advance_tcp_send_queue(ares_channel channel, int whichserver,
|
||||
ssize_t num_bytes);
|
||||
static void process_timeouts(ares_channel channel, time_t now);
|
||||
static void process_broken_connections(ares_channel channel, time_t now);
|
||||
static void process_timeouts(ares_channel channel, struct timeval *now);
|
||||
static void process_broken_connections(ares_channel channel,
|
||||
struct timeval *now);
|
||||
static void process_answer(ares_channel channel, unsigned char *abuf,
|
||||
int alen, int whichserver, int tcp, time_t now);
|
||||
static void handle_error(ares_channel channel, int whichserver, time_t now);
|
||||
int alen, int whichserver, int tcp,
|
||||
struct timeval *now);
|
||||
static void handle_error(ares_channel channel, int whichserver,
|
||||
struct timeval *now);
|
||||
static void skip_server(ares_channel channel, struct query *query,
|
||||
int whichserver);
|
||||
static void next_server(ares_channel channel, struct query *query, time_t now);
|
||||
static void next_server(ares_channel channel, struct query *query,
|
||||
struct timeval *now);
|
||||
static int configure_socket(int s, ares_channel channel);
|
||||
static int open_tcp_socket(ares_channel channel, struct server_state *server);
|
||||
static int open_udp_socket(ares_channel channel, struct server_state *server);
|
||||
@@ -91,19 +102,59 @@ static int same_questions(const unsigned char *qbuf, int qlen,
|
||||
static void end_query(ares_channel channel, struct query *query, int status,
|
||||
unsigned char *abuf, int alen);
|
||||
|
||||
/* return true if now is exactly check time or later */
|
||||
int ares__timedout(struct timeval *now,
|
||||
struct timeval *check)
|
||||
{
|
||||
int secs = (now->tv_sec - check->tv_sec);
|
||||
|
||||
if(secs > 0)
|
||||
return 1; /* yes, timed out */
|
||||
if(secs < 0)
|
||||
return 0; /* nope, not timed out */
|
||||
|
||||
/* if the full seconds were identical, check the sub second parts */
|
||||
return (now->tv_usec - check->tv_usec >= 0);
|
||||
}
|
||||
|
||||
/* add the specific number of milliseconds to the time in the first argument */
|
||||
int ares__timeadd(struct timeval *now,
|
||||
int millisecs)
|
||||
{
|
||||
now->tv_sec += millisecs/1000;
|
||||
now->tv_usec += (millisecs%1000)*1000;
|
||||
|
||||
if(now->tv_usec >= 1000000) {
|
||||
++(now->tv_sec);
|
||||
now->tv_usec -= 1000000;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* return time offset between now and (future) check, in milliseconds */
|
||||
int ares__timeoffset(struct timeval *now,
|
||||
struct timeval *check)
|
||||
{
|
||||
int secs = (check->tv_sec - now->tv_sec); /* this many seconds */
|
||||
int us = (check->tv_usec - now->tv_usec); /* this many microseconds */
|
||||
|
||||
return secs*1000 + us/1000; /* return them combined as milliseconds */
|
||||
}
|
||||
|
||||
|
||||
/* Something interesting happened on the wire, or there was a timeout.
|
||||
* See what's up and respond accordingly.
|
||||
*/
|
||||
void ares_process(ares_channel channel, fd_set *read_fds, fd_set *write_fds)
|
||||
{
|
||||
time_t now;
|
||||
struct timeval now = ares__tvnow();
|
||||
|
||||
time(&now);
|
||||
write_tcp_data(channel, write_fds, ARES_SOCKET_BAD, now);
|
||||
read_tcp_data(channel, read_fds, ARES_SOCKET_BAD, now);
|
||||
read_udp_packets(channel, read_fds, ARES_SOCKET_BAD, now);
|
||||
process_timeouts(channel, now);
|
||||
process_broken_connections(channel, now);
|
||||
write_tcp_data(channel, write_fds, ARES_SOCKET_BAD, &now);
|
||||
read_tcp_data(channel, read_fds, ARES_SOCKET_BAD, &now);
|
||||
read_udp_packets(channel, read_fds, ARES_SOCKET_BAD, &now);
|
||||
process_timeouts(channel, &now);
|
||||
process_broken_connections(channel, &now);
|
||||
}
|
||||
|
||||
/* Something interesting happened on the wire, or there was a timeout.
|
||||
@@ -114,13 +165,12 @@ void ares_process_fd(ares_channel channel,
|
||||
file descriptors */
|
||||
ares_socket_t write_fd)
|
||||
{
|
||||
time_t now;
|
||||
struct timeval now = ares__tvnow();
|
||||
|
||||
time(&now);
|
||||
write_tcp_data(channel, NULL, write_fd, now);
|
||||
read_tcp_data(channel, NULL, read_fd, now);
|
||||
read_udp_packets(channel, NULL, read_fd, now);
|
||||
process_timeouts(channel, now);
|
||||
write_tcp_data(channel, NULL, write_fd, &now);
|
||||
read_tcp_data(channel, NULL, read_fd, &now);
|
||||
read_udp_packets(channel, NULL, read_fd, &now);
|
||||
process_timeouts(channel, &now);
|
||||
}
|
||||
|
||||
|
||||
@@ -155,7 +205,7 @@ static int try_again(int errnum)
|
||||
static void write_tcp_data(ares_channel channel,
|
||||
fd_set *write_fds,
|
||||
ares_socket_t write_fd,
|
||||
time_t now)
|
||||
struct timeval *now)
|
||||
{
|
||||
struct server_state *server;
|
||||
struct send_request *sendreq;
|
||||
@@ -174,7 +224,8 @@ static void write_tcp_data(ares_channel channel,
|
||||
/* Make sure server has data to send and is selected in write_fds or
|
||||
write_fd. */
|
||||
server = &channel->servers[i];
|
||||
if (!server->qhead || server->tcp_socket == ARES_SOCKET_BAD || server->is_broken)
|
||||
if (!server->qhead || server->tcp_socket == ARES_SOCKET_BAD ||
|
||||
server->is_broken)
|
||||
continue;
|
||||
|
||||
if(write_fds) {
|
||||
@@ -278,7 +329,7 @@ static void advance_tcp_send_queue(ares_channel channel, int whichserver,
|
||||
* a packet if we finish reading one.
|
||||
*/
|
||||
static void read_tcp_data(ares_channel channel, fd_set *read_fds,
|
||||
ares_socket_t read_fd, time_t now)
|
||||
ares_socket_t read_fd, struct timeval *now)
|
||||
{
|
||||
struct server_state *server;
|
||||
int i;
|
||||
@@ -374,7 +425,7 @@ static void read_tcp_data(ares_channel channel, fd_set *read_fds,
|
||||
|
||||
/* If any UDP sockets select true for reading, process them. */
|
||||
static void read_udp_packets(ares_channel channel, fd_set *read_fds,
|
||||
ares_socket_t read_fd, time_t now)
|
||||
ares_socket_t read_fd, struct timeval *now)
|
||||
{
|
||||
struct server_state *server;
|
||||
int i;
|
||||
@@ -425,7 +476,7 @@ static void read_udp_packets(ares_channel channel, fd_set *read_fds,
|
||||
}
|
||||
|
||||
/* If any queries have timed out, note the timeout and move them on. */
|
||||
static void process_timeouts(ares_channel channel, time_t now)
|
||||
static void process_timeouts(ares_channel channel, struct timeval *now)
|
||||
{
|
||||
time_t t; /* the time of the timeouts we're processing */
|
||||
struct query *query;
|
||||
@@ -438,14 +489,14 @@ static void process_timeouts(ares_channel channel, time_t now)
|
||||
* only a handful of requests that fall into the "now" bucket, so
|
||||
* this should be quite quick.
|
||||
*/
|
||||
for (t = channel->last_timeout_processed; t <= now; t++)
|
||||
for (t = channel->last_timeout_processed; t <= now->tv_sec; t++)
|
||||
{
|
||||
list_head = &(channel->queries_by_timeout[t % ARES_TIMEOUT_TABLE_SIZE]);
|
||||
for (list_node = list_head->next; list_node != list_head; )
|
||||
{
|
||||
query = list_node->data;
|
||||
list_node = list_node->next; /* in case the query gets deleted */
|
||||
if (query->timeout != 0 && now >= query->timeout)
|
||||
if (query->timeout.tv_sec && ares__timedout(now, &query->timeout))
|
||||
{
|
||||
query->error_status = ARES_ETIMEOUT;
|
||||
++query->timeouts;
|
||||
@@ -453,12 +504,13 @@ static void process_timeouts(ares_channel channel, time_t now)
|
||||
}
|
||||
}
|
||||
}
|
||||
channel->last_timeout_processed = now;
|
||||
channel->last_timeout_processed = now->tv_sec;
|
||||
}
|
||||
|
||||
/* Handle an answer from a server. */
|
||||
static void process_answer(ares_channel channel, unsigned char *abuf,
|
||||
int alen, int whichserver, int tcp, time_t now)
|
||||
int alen, int whichserver, int tcp,
|
||||
struct timeval *now)
|
||||
{
|
||||
int tc, rcode;
|
||||
unsigned short id;
|
||||
@@ -536,7 +588,8 @@ static void process_answer(ares_channel channel, unsigned char *abuf,
|
||||
}
|
||||
|
||||
/* Close all the connections that are no longer usable. */
|
||||
static void process_broken_connections(ares_channel channel, time_t now)
|
||||
static void process_broken_connections(ares_channel channel,
|
||||
struct timeval *now)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < channel->nservers; i++)
|
||||
@@ -549,7 +602,8 @@ static void process_broken_connections(ares_channel channel, time_t now)
|
||||
}
|
||||
}
|
||||
|
||||
static void handle_error(ares_channel channel, int whichserver, time_t now)
|
||||
static void handle_error(ares_channel channel, int whichserver,
|
||||
struct timeval *now)
|
||||
{
|
||||
struct server_state *server;
|
||||
struct query *query;
|
||||
@@ -600,7 +654,8 @@ static void skip_server(ares_channel channel, struct query *query,
|
||||
}
|
||||
}
|
||||
|
||||
static void next_server(ares_channel channel, struct query *query, time_t now)
|
||||
static void next_server(ares_channel channel, struct query *query,
|
||||
struct timeval *now)
|
||||
{
|
||||
/* Advance to the next server or try. */
|
||||
query->server++;
|
||||
@@ -637,7 +692,8 @@ static void next_server(ares_channel channel, struct query *query, time_t now)
|
||||
end_query(channel, query, query->error_status, NULL, 0);
|
||||
}
|
||||
|
||||
void ares__send_query(ares_channel channel, struct query *query, time_t now)
|
||||
void ares__send_query(ares_channel channel, struct query *query,
|
||||
struct timeval *now)
|
||||
{
|
||||
struct send_request *sendreq;
|
||||
struct server_state *server;
|
||||
@@ -704,16 +760,17 @@ void ares__send_query(ares_channel channel, struct query *query, time_t now)
|
||||
return;
|
||||
}
|
||||
}
|
||||
query->timeout = now
|
||||
+ ((query->try == 0) ? channel->timeout
|
||||
: channel->timeout << query->try / channel->nservers);
|
||||
query->timeout = *now;
|
||||
ares__timeadd(&query->timeout,
|
||||
(query->try == 0) ? channel->timeout
|
||||
: channel->timeout << query->try / channel->nservers);
|
||||
/* Keep track of queries bucketed by timeout, so we can process
|
||||
* timeout events quickly.
|
||||
*/
|
||||
ares__remove_from_list(&(query->queries_by_timeout));
|
||||
ares__insert_in_list(
|
||||
&(query->queries_by_timeout),
|
||||
&(channel->queries_by_timeout[query->timeout %
|
||||
&(channel->queries_by_timeout[query->timeout.tv_sec %
|
||||
ARES_TIMEOUT_TABLE_SIZE]));
|
||||
|
||||
/* Keep track of queries bucketed by server, so we can process server
|
||||
|
@@ -39,7 +39,7 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
|
||||
{
|
||||
struct query *query;
|
||||
int i;
|
||||
time_t now;
|
||||
struct timeval now;
|
||||
|
||||
/* Verify that the query is at least long enough to hold the header. */
|
||||
if (qlen < HFIXEDSZ || qlen >= (1 << 16))
|
||||
@@ -74,7 +74,7 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
|
||||
|
||||
/* Compute the query ID. Start with no timeout. */
|
||||
query->qid = (unsigned short)DNS_HEADER_QID(qbuf);
|
||||
query->timeout = 0;
|
||||
query->timeout.tv_sec = query->timeout.tv_usec = 0;
|
||||
|
||||
/* Form the TCP query buffer by prepending qlen (as two
|
||||
* network-order bytes) to qbuf.
|
||||
@@ -107,17 +107,17 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
|
||||
ares__init_list_node(&(query->queries_by_timeout), query);
|
||||
ares__init_list_node(&(query->queries_to_server), query);
|
||||
ares__init_list_node(&(query->all_queries), query);
|
||||
|
||||
|
||||
/* Chain the query into the list of all queries. */
|
||||
ares__insert_in_list(&(query->all_queries), &(channel->all_queries));
|
||||
/* Keep track of queries bucketed by qid, so we can process DNS
|
||||
* responses quickly.
|
||||
*/
|
||||
ares__insert_in_list(
|
||||
&(query->queries_by_qid),
|
||||
&(channel->queries_by_qid[query->qid % ARES_QID_TABLE_SIZE]));
|
||||
&(query->queries_by_qid),
|
||||
&(channel->queries_by_qid[query->qid % ARES_QID_TABLE_SIZE]));
|
||||
|
||||
/* Perform the first query action. */
|
||||
time(&now);
|
||||
ares__send_query(channel, query, now);
|
||||
now = ares__tvnow();
|
||||
ares__send_query(channel, query, &now);
|
||||
}
|
||||
|
@@ -37,16 +37,16 @@ struct timeval *ares_timeout(ares_channel channel, struct timeval *maxtv,
|
||||
struct query *query;
|
||||
struct list_node* list_head;
|
||||
struct list_node* list_node;
|
||||
time_t now;
|
||||
time_t offset, min_offset; /* these use time_t since some 32 bit systems
|
||||
still use 64 bit time_t! (like VS2005) */
|
||||
struct timeval now;
|
||||
struct timeval nextstop;
|
||||
long offset, min_offset;
|
||||
|
||||
/* No queries, no timeout (and no fetch of the current time). */
|
||||
if (ares__is_list_empty(&(channel->all_queries)))
|
||||
return maxtv;
|
||||
|
||||
/* Find the minimum timeout for the current set of queries. */
|
||||
time(&now);
|
||||
now = ares__tvnow();
|
||||
min_offset = -1;
|
||||
|
||||
list_head = &(channel->all_queries);
|
||||
@@ -54,23 +54,26 @@ struct timeval *ares_timeout(ares_channel channel, struct timeval *maxtv,
|
||||
list_node = list_node->next)
|
||||
{
|
||||
query = list_node->data;
|
||||
if (query->timeout == 0)
|
||||
if (query->timeout.tv_sec == 0)
|
||||
continue;
|
||||
offset = query->timeout - now;
|
||||
offset = ares__timeoffset(&now, &query->timeout);
|
||||
if (offset < 0)
|
||||
offset = 0;
|
||||
if (min_offset == -1 || offset < min_offset)
|
||||
min_offset = offset;
|
||||
}
|
||||
|
||||
/* If we found a minimum timeout and it's sooner than the one
|
||||
* specified in maxtv (if any), return it. Otherwise go with
|
||||
* maxtv.
|
||||
if(min_offset != -1) {
|
||||
nextstop.tv_sec = min_offset/1000;
|
||||
nextstop.tv_usec = (min_offset%1000)*1000;
|
||||
}
|
||||
|
||||
/* If we found a minimum timeout and it's sooner than the one specified in
|
||||
* maxtv (if any), return it. Otherwise go with maxtv.
|
||||
*/
|
||||
if (min_offset != -1 && (!maxtv || min_offset <= maxtv->tv_sec))
|
||||
if (min_offset != -1 && (!maxtv || ares__timedout(maxtv, &nextstop)))
|
||||
{
|
||||
tvbuf->tv_sec = (long)min_offset;
|
||||
tvbuf->tv_usec = 0;
|
||||
*tvbuf = nextstop;
|
||||
return tvbuf;
|
||||
}
|
||||
else
|
||||
|
@@ -5,11 +5,11 @@
|
||||
|
||||
#define ARES_VERSION_MAJOR 1
|
||||
#define ARES_VERSION_MINOR 5
|
||||
#define ARES_VERSION_PATCH 0
|
||||
#define ARES_VERSION_PATCH 3
|
||||
#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
|
||||
(ARES_VERSION_MINOR<<8)|\
|
||||
(ARES_VERSION_PATCH))
|
||||
#define ARES_VERSION_STR "1.5.0-CVS"
|
||||
#define ARES_VERSION_STR "1.5.3-CVS"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@@ -3,7 +3,8 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
/* Copyright (C) 2005 by Dominick Meglio
|
||||
*
|
||||
* 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
|
||||
|
@@ -159,24 +159,58 @@
|
||||
/* Define this if you have struct timeval */
|
||||
#define HAVE_STRUCT_TIMEVAL 1
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* COMPILER SPECIFIC */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Define to avoid VS2005 complaining about portable C functions */
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
|
||||
#define _CRT_SECURE_NO_DEPRECATE 1
|
||||
#define _CRT_NONSTDC_NO_DEPRECATE 1
|
||||
#endif
|
||||
|
||||
/* VS2008 does not support Windows build targets prior to WinXP, */
|
||||
/* so, if no build target has been defined we will target WinXP. */
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1500)
|
||||
# ifndef _WIN32_WINNT
|
||||
# define _WIN32_WINNT 0x0501
|
||||
# endif
|
||||
# ifndef WINVER
|
||||
# define WINVER 0x0501
|
||||
# endif
|
||||
# if (_WIN32_WINNT < 0x0501) || (WINVER < 0x0501)
|
||||
# error VS2008 does not support Windows build targets prior to WinXP
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* IPV6 COMPATIBILITY */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/* Define this if you have address family AF_INET6 */
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#define HAVE_AF_INET6 1
|
||||
#endif
|
||||
|
||||
/* Define this if you have protocol family PF_INET6 */
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#define HAVE_PF_INET6 1
|
||||
#endif
|
||||
|
||||
/* Define this if you have struct in6_addr */
|
||||
#ifdef HAVE_WS2TCPIP_H
|
||||
#define HAVE_STRUCT_IN6_ADDR 1
|
||||
#endif
|
||||
|
||||
/* Define this if you have struct sockaddr_in6 */
|
||||
#ifdef HAVE_WS2TCPIP_H
|
||||
#define HAVE_STRUCT_SOCKADDR_IN6 1
|
||||
#endif
|
||||
|
||||
/* Define this if you have sockaddr_in6 with scopeid */
|
||||
#ifdef HAVE_WS2TCPIP_H
|
||||
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __ARES_CONFIG_WIN32_H */
|
||||
|
@@ -1,11 +1,9 @@
|
||||
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT([c-ares],[1.5.1],[daniel@haxx.se])
|
||||
AC_PREREQ(2.57)
|
||||
AC_INIT(ares_init.c)
|
||||
AC_CONFIG_SRCDIR([ares_ipv6.h])
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_CONFIG_HEADER([config.h])
|
||||
AM_MAINTAINER_MODE
|
||||
AM_INIT_AUTOMAKE(c-ares, CVS)
|
||||
AM_INIT_AUTOMAKE
|
||||
|
||||
dnl
|
||||
dnl Detect the canonical host and target build environment
|
||||
@@ -17,12 +15,13 @@ AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
|
||||
|
||||
AC_AIX
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_INSTALL
|
||||
|
||||
case $host_os in
|
||||
solaris*)
|
||||
AC_DEFINE(ETC_INET, 1, [if a /etc/inet dir is being used])
|
||||
;;
|
||||
solaris*)
|
||||
AC_DEFINE(ETC_INET, 1, [if a /etc/inet dir is being used])
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl support building of Windows DLLs
|
||||
@@ -46,6 +45,8 @@ AC_HELP_STRING([--disable-debug],[Disable debug options]),
|
||||
dnl when doing the debug stuff, use static library only
|
||||
AC_DISABLE_SHARED
|
||||
|
||||
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])
|
||||
@@ -70,16 +71,21 @@ AC_HELP_STRING([--disable-debug],[Disable debug options]),
|
||||
esac ],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
AM_CONDITIONAL(DEBUGBUILD, 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],[])
|
||||
|
||||
@@ -100,7 +106,7 @@ AC_PROG_LIBTOOL
|
||||
|
||||
AC_MSG_CHECKING([if we need -no-undefined])
|
||||
case $host in
|
||||
*-*-cygwin | *-*-mingw* | *-*-pw32*)
|
||||
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
|
||||
need_no_undefined=yes
|
||||
;;
|
||||
*)
|
||||
@@ -117,6 +123,28 @@ dnl gethostbyname_r() version
|
||||
dnl **********************************************************************
|
||||
CURL_DETECT_ICC([CFLAGS="$CFLAGS -we 147"])
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
|
||||
dnl and ws2tcpip.h take precedence over any other further checks which
|
||||
dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
|
||||
dnl this specific header files. And do them before its results are used.
|
||||
dnl **********************************************************************
|
||||
|
||||
CURL_CHECK_HEADER_WINDOWS
|
||||
CURL_CHECK_NATIVE_WINDOWS
|
||||
case X-"$ac_cv_native_windows" in
|
||||
X-yes)
|
||||
CURL_CHECK_HEADER_WINSOCK
|
||||
CURL_CHECK_HEADER_WINSOCK2
|
||||
CURL_CHECK_HEADER_WS2TCPIP
|
||||
;;
|
||||
*)
|
||||
ac_cv_header_winsock_h="no"
|
||||
ac_cv_header_winsock2_h="no"
|
||||
ac_cv_header_ws2tcpip_h="no"
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl platform/compiler/architecture specific checks/flags
|
||||
dnl **********************************************************************
|
||||
@@ -184,49 +212,107 @@ then
|
||||
AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
|
||||
my_ac_save_LIBS=$LIBS
|
||||
LIBS="-lnsl -lsocket $LIBS"
|
||||
AC_TRY_LINK( ,
|
||||
[gethostbyname();],
|
||||
[ dnl found it!
|
||||
HAVE_GETHOSTBYNAME="1"
|
||||
AC_MSG_RESULT([yes])],
|
||||
[ dnl failed!
|
||||
AC_MSG_RESULT([no])
|
||||
dnl restore LIBS
|
||||
LIBS=$my_ac_save_LIBS]
|
||||
)
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
]],[[
|
||||
gethostbyname();
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
HAVE_GETHOSTBYNAME="1"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
LIBS=$my_ac_save_LIBS
|
||||
])
|
||||
fi
|
||||
|
||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||
then
|
||||
dnl This is for Msys/Mingw
|
||||
AC_MSG_CHECKING([for gethostbyname in ws2_32])
|
||||
my_ac_save_LIBS=$LIBS
|
||||
LIBS="-lws2_32 $LIBS"
|
||||
AC_TRY_LINK([#include <winsock2.h>],
|
||||
[gethostbyname("www.dummysite.com");],
|
||||
[ dnl worked!
|
||||
ws2="yes"
|
||||
AC_MSG_RESULT([yes])
|
||||
HAVE_GETHOSTBYNAME="1"],
|
||||
[ dnl failed, restore LIBS
|
||||
LIBS=$my_ac_save_LIBS
|
||||
AC_MSG_RESULT(no)]
|
||||
)
|
||||
dnl This is for winsock systems
|
||||
if test "$ac_cv_header_windows_h" = "yes"; then
|
||||
if test "$ac_cv_header_winsock_h" = "yes"; then
|
||||
case $host in
|
||||
*-*-mingw32ce*)
|
||||
winsock_LIB="-lwinsock"
|
||||
;;
|
||||
*)
|
||||
winsock_LIB="-lwsock32"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test "$ac_cv_header_winsock2_h" = "yes"; then
|
||||
winsock_LIB="-lws2_32"
|
||||
fi
|
||||
if test ! -z "$winsock_LIB"; then
|
||||
my_ac_save_LIBS=$LIBS
|
||||
LIBS="$winsock_LIB $LIBS"
|
||||
AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#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
|
||||
]],[[
|
||||
gethostbyname("www.dummysite.com");
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
HAVE_GETHOSTBYNAME="1"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
winsock_LIB=""
|
||||
LIBS=$my_ac_save_LIBS
|
||||
])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||
then
|
||||
dnl This is for Minix 3.1
|
||||
AC_MSG_CHECKING([for gethostbyname for Minix 3])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
/* Older Minix versions may need <net/gen/netdb.h> here instead */
|
||||
#include <netdb.h>
|
||||
]],[[
|
||||
gethostbyname("www.dummysite.com");
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
HAVE_GETHOSTBYNAME="1"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
fi
|
||||
|
||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||
then
|
||||
dnl This is for eCos with a stubbed DNS implementation
|
||||
AC_MSG_CHECKING([for gethostbyname for eCos])
|
||||
AC_TRY_LINK([
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#include <stdio.h>
|
||||
#include <netdb.h>],
|
||||
[gethostbyname("www.dummysite.com");],
|
||||
[ dnl worked!
|
||||
AC_MSG_RESULT([yes])
|
||||
HAVE_GETHOSTBYNAME="1"],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
#include <netdb.h>
|
||||
]],[[
|
||||
gethostbyname("www.dummysite.com");
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
HAVE_GETHOSTBYNAME="1"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
fi
|
||||
|
||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||
@@ -258,8 +344,11 @@ fi
|
||||
dnl socket lib?
|
||||
AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
|
||||
|
||||
dnl dl lib?
|
||||
AC_CHECK_FUNC(dlclose, , [ AC_CHECK_LIB(dl, dlopen) ])
|
||||
dnl **********************************************************************
|
||||
dnl In case that function clock_gettime with monotonic timer is available,
|
||||
dnl check for additional required libraries.
|
||||
dnl **********************************************************************
|
||||
CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
|
||||
|
||||
AC_MSG_CHECKING([whether to use libgcc])
|
||||
AC_ARG_ENABLE(libgcc,
|
||||
@@ -342,6 +431,9 @@ if test "x$RECENTAIX" = "xyes"; then
|
||||
dnl the optimizer assumes that pointers can only point to
|
||||
dnl an object of the same type.
|
||||
CFLAGS="$CFLAGS -qnoansialias"
|
||||
dnl Force AIX xlc to stop after the compilation phase, and not
|
||||
dnl generate object code, when the source compiles with errors.
|
||||
CFLAGS="$CFLAGS -qhalt=e"
|
||||
)
|
||||
fi
|
||||
|
||||
@@ -353,18 +445,6 @@ dnl **********************************************************************
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
|
||||
dnl and ws2tcpip.h take precedence over any other further checks which
|
||||
dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
|
||||
dnl this specific header files. And do them before its results are used.
|
||||
dnl **********************************************************************
|
||||
|
||||
CURL_CHECK_HEADER_WINDOWS
|
||||
CURL_CHECK_HEADER_WINSOCK
|
||||
CURL_CHECK_HEADER_WINSOCK2
|
||||
CURL_CHECK_HEADER_WS2TCPIP
|
||||
|
||||
CURL_CHECK_HEADER_MALLOC
|
||||
|
||||
dnl check for a few basic system headers we need
|
||||
@@ -380,7 +460,9 @@ AC_CHECK_HEADERS(
|
||||
netinet/tcp.h \
|
||||
net/if.h \
|
||||
errno.h \
|
||||
strings.h \
|
||||
stdbool.h \
|
||||
time.h \
|
||||
arpa/nameser.h \
|
||||
arpa/nameser_compat.h \
|
||||
arpa/inet.h,
|
||||
@@ -831,8 +913,15 @@ AC_HELP_STRING([--with-random=FILE],
|
||||
[read randomness from FILE (default=/dev/urandom)]),
|
||||
[ RANDOM_FILE="$withval" ],
|
||||
[
|
||||
dnl Check for random device
|
||||
AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
|
||||
dnl Check for random device. If we're cross compiling, we can't
|
||||
dnl check, and it's better to assume it doesn't exist than it is
|
||||
dnl to fail on AC_CHECK_FILE or later.
|
||||
if test "$cross_compiling" = "no"; then
|
||||
AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
|
||||
else
|
||||
AC_MSG_WARN([cannot check for /dev/urandom while cross compiling; assuming none])
|
||||
fi
|
||||
|
||||
]
|
||||
)
|
||||
if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
|
||||
@@ -841,4 +930,5 @@ if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
|
||||
[a suitable file/device to read random data from])
|
||||
fi
|
||||
|
||||
AC_OUTPUT(Makefile libcares.pc)
|
||||
AC_CONFIG_FILES([Makefile libcares.pc])
|
||||
AC_OUTPUT
|
||||
|
36
ares/get_ver.awk
Normal file
36
ares/get_ver.awk
Normal file
@@ -0,0 +1,36 @@
|
||||
# ***************************************************************************
|
||||
# * Project: c-ares
|
||||
# *
|
||||
# * $Id$
|
||||
# ***************************************************************************
|
||||
# awk script which fetches c-ares version number and string from input
|
||||
# file and writes them to STDOUT. Here you can get an awk version for Win32:
|
||||
# http://www.gknw.net/development/prgtools/awk-20070501.zip
|
||||
#
|
||||
BEGIN {
|
||||
if (match (ARGV[1], /ares_version.h/)) {
|
||||
while ((getline < ARGV[1]) > 0) {
|
||||
if (match ($0, /^#define ARES_COPYRIGHT "[^"]+"$/)) {
|
||||
libcares_copyright_str = substr($0, 25, length($0)-25);
|
||||
}
|
||||
else if (match ($0, /^#define ARES_VERSION_STR "[^"]+"$/)) {
|
||||
libcares_ver_str = substr($3, 2, length($3)-2);
|
||||
}
|
||||
else if (match ($0, /^#define ARES_VERSION_MAJOR [0-9]+$/)) {
|
||||
libcares_ver_major = substr($3, 1, length($3));
|
||||
}
|
||||
else if (match ($0, /^#define ARES_VERSION_MINOR [0-9]+$/)) {
|
||||
libcares_ver_minor = substr($3, 1, length($3));
|
||||
}
|
||||
else if (match ($0, /^#define ARES_VERSION_PATCH [0-9]+$/)) {
|
||||
libcares_ver_patch = substr($3, 1, length($3));
|
||||
}
|
||||
}
|
||||
libcares_ver = libcares_ver_major "," libcares_ver_minor "," libcares_ver_patch;
|
||||
print "LIBCARES_VERSION = " libcares_ver "";
|
||||
print "LIBCARES_VERSION_STR = " libcares_ver_str "";
|
||||
print "LIBCARES_COPYRIGHT_STR = " libcares_copyright_str "";
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -3,7 +3,8 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
/* Copyright (C) 2005 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
|
||||
|
@@ -3,7 +3,8 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
/* Copyright (C) 2005 by Dominick Meglio
|
||||
*
|
||||
* 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
|
||||
|
@@ -12,7 +12,7 @@ includedir=@includedir@
|
||||
|
||||
Name: c-ares
|
||||
URL: http://daniel.haxx.se/projects/c-ares/
|
||||
Description: asyncronous DNS lookup library
|
||||
Description: asynchronous DNS lookup library
|
||||
Version: @VERSION@
|
||||
Requires:
|
||||
Requires.private:
|
||||
|
@@ -38,11 +38,11 @@ if(!-f "configure") {
|
||||
`./buildconf`;
|
||||
}
|
||||
print "adding $version in the configure.ac file\n";
|
||||
`sed -e 's/AM_INIT_AUTOMAKE(c-ares, CVS)/AM_INIT_AUTOMAKE(c-ares, $version)/' < configure.ac > configure.ac-rel`;
|
||||
`sed -e 's/AC_INIT.*/AC_INIT([c-ares], [$version])/' < configure.ac > configure.ac.dist`;
|
||||
|
||||
# now make a new configure script with this
|
||||
print "makes a new configure script\n";
|
||||
`autoconf configure.ac-rel >configure`;
|
||||
`autoconf configure.ac.dist >configure`;
|
||||
|
||||
# now run this new configure to get a fine makefile
|
||||
print "running configure\n";
|
||||
@@ -53,6 +53,6 @@ print "running make dist\n";
|
||||
`make dist`;
|
||||
|
||||
print "removing temporary configure.ac file\n";
|
||||
`rm configure.ac-rel`;
|
||||
`rm configure.ac.dist`;
|
||||
|
||||
print "NOTE: now cvs tag this release!\n";
|
||||
|
@@ -7,9 +7,6 @@
|
||||
port build */
|
||||
|
||||
#ifndef NETWARE
|
||||
#ifndef __CYGWIN__
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#include <process.h> /* for the _getpid() proto */
|
||||
#endif /* !NETWARE */
|
||||
#include <sys/types.h>
|
||||
@@ -32,13 +29,6 @@ struct iovec
|
||||
int ares_writev (SOCKET s, const struct iovec *vector, size_t count);
|
||||
#define writev(s,vect,count) ares_writev(s,vect,count)
|
||||
|
||||
#ifndef HAVE_GETTIMEOFDAY
|
||||
struct timezone { int dummy; };
|
||||
#endif
|
||||
|
||||
int ares_gettimeofday(struct timeval *tv, struct timezone *tz);
|
||||
#define gettimeofday(tv,tz) ares_gettimeofday(tv,tz)
|
||||
|
||||
#endif /* !NETWARE */
|
||||
|
||||
#define NS_CMPRSFLGS 0xc0
|
||||
|
10
ares/setup.h
10
ares/setup.h
@@ -16,13 +16,11 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#if !defined(WIN32) && defined(__WIN32__)
|
||||
/* Borland fix */
|
||||
#define WIN32
|
||||
#endif
|
||||
/*
|
||||
* Define WIN32 when build target is Win32 API
|
||||
*/
|
||||
|
||||
#if !defined(WIN32) && defined(_WIN32)
|
||||
/* VS2005 on x64 fix */
|
||||
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
|
||||
#define WIN32
|
||||
#endif
|
||||
|
||||
|
@@ -100,11 +100,10 @@ struct timeval {
|
||||
* definition is present the other one also is available.
|
||||
*/
|
||||
|
||||
#if defined(WIN32) && !defined(HAVE_SOCKLEN_T)
|
||||
#if defined(WIN32) && !defined(HAVE_CONFIG_H)
|
||||
# if ( defined(_MSC_VER) && !defined(INET_ADDRSTRLEN) ) || \
|
||||
(!defined(_MSC_VER) && !defined(HAVE_WS2TCPIP_H) )
|
||||
# define socklen_t int
|
||||
# define HAVE_SOCKLEN_T
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
2
ares/vc/.cvsignore
Normal file
2
ares/vc/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
vc.ncb
|
||||
vc.opt
|
3
ares/vc/acountry/.cvsignore
Normal file
3
ares/vc/acountry/.cvsignore
Normal file
@@ -0,0 +1,3 @@
|
||||
acountry.dep
|
||||
acountry.mak
|
||||
acountry.plg
|
110
ares/vc/acountry/acountry.dsp
Normal file
110
ares/vc/acountry/acountry.dsp
Normal file
@@ -0,0 +1,110 @@
|
||||
# Microsoft Developer Studio Project File - Name="acountry" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=acountry - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "acountry.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "acountry.mak" CFG="acountry - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "acountry - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "acountry - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "acountry - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /machine:I386 /libpath:"..\areslib\Release"
|
||||
# ADD LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /machine:I386 /libpath:"..\areslib\Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "acountry - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\areslib\Debug"
|
||||
# ADD LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\areslib\Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "acountry - Win32 Release"
|
||||
# Name "acountry - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\acountry.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_getopt.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_getopt.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
3
ares/vc/adig/.cvsignore
Normal file
3
ares/vc/adig/.cvsignore
Normal file
@@ -0,0 +1,3 @@
|
||||
adig.dep
|
||||
adig.mak
|
||||
adig.plg
|
@@ -1,2 +0,0 @@
|
||||
# Microsoft Developer Studio Generated Dependency File, included by adig.mak
|
||||
|
@@ -41,16 +41,16 @@ RSC=rc.exe
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 wsock32.lib areslib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\areslib\Release"
|
||||
# ADD BASE LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /machine:I386 /libpath:"..\areslib\Release"
|
||||
# ADD LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /machine:I386 /libpath:"..\areslib\Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "adig - Win32 Debug"
|
||||
|
||||
@@ -65,16 +65,16 @@ LINK32=link.exe
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 wsock32.lib areslib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\areslib\Debug"
|
||||
# ADD BASE LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\areslib\Debug"
|
||||
# ADD LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\areslib\Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
3
ares/vc/ahost/.cvsignore
Normal file
3
ares/vc/ahost/.cvsignore
Normal file
@@ -0,0 +1,3 @@
|
||||
ahost.dep
|
||||
ahost.mak
|
||||
ahost.plg
|
@@ -1,2 +0,0 @@
|
||||
# Microsoft Developer Studio Generated Dependency File, included by ahost.mak
|
||||
|
@@ -39,17 +39,18 @@ RSC=rc.exe
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 wsock32.lib areslib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\areslib\Release"
|
||||
# ADD BASE LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /machine:I386 /libpath:"..\areslib\Release"
|
||||
# ADD LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /machine:I386 /libpath:"..\areslib\Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ahost - Win32 Debug"
|
||||
|
||||
@@ -62,17 +63,18 @@ LINK32=link.exe
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 wsock32.lib areslib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\areslib\Debug"
|
||||
# ADD BASE LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\areslib\Debug"
|
||||
# ADD LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\areslib\Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
3
ares/vc/areslib/.cvsignore
Normal file
3
ares/vc/areslib/.cvsignore
Normal file
@@ -0,0 +1,3 @@
|
||||
areslib.dep
|
||||
areslib.mak
|
||||
areslib.plg
|
@@ -1,2 +0,0 @@
|
||||
# Microsoft Developer Studio Generated Dependency File, included by areslib.mak
|
||||
|
@@ -40,8 +40,8 @@ RSC=rc.exe
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -63,8 +63,8 @@ LIB32=link.exe -lib
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -97,6 +97,10 @@ SOURCE=..\..\ares__read_line.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares__timeval.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_cancel.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -109,6 +113,10 @@ SOURCE=..\..\ares_expand_name.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_expand_string.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_fds.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
@@ -3,6 +3,21 @@ Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "acountry"=".\acountry\acountry.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name areslib
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "adig"=".\adig\adig.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
|
@@ -55,37 +55,6 @@ ares_strcasecmp(const char *a, const char *b)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Number of micro-seconds between the beginning of the Windows epoch
|
||||
* (Jan. 1, 1601) and the Unix epoch (Jan. 1, 1970).
|
||||
*/
|
||||
#if defined(_MSC_VER) || defined(__WATCOMC__)
|
||||
#define EPOCH_FILETIME 11644473600000000Ui64
|
||||
#else
|
||||
#define EPOCH_FILETIME 11644473600000000ULL
|
||||
#endif
|
||||
|
||||
int
|
||||
ares_gettimeofday(struct timeval *tv, struct timezone *tz)
|
||||
{
|
||||
FILETIME ft;
|
||||
LARGE_INTEGER li;
|
||||
__int64 t;
|
||||
|
||||
if (tv)
|
||||
{
|
||||
GetSystemTimeAsFileTime(&ft);
|
||||
li.LowPart = ft.dwLowDateTime;
|
||||
li.HighPart = ft.dwHighDateTime;
|
||||
t = li.QuadPart / 10; /* In micro-second intervals */
|
||||
t -= EPOCH_FILETIME; /* Offset to the Epoch time */
|
||||
tv->tv_sec = (long)(t / 1000000);
|
||||
tv->tv_usec = (long)(t % 1000000);
|
||||
}
|
||||
(void) tz;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ares_writev (ares_socket_t s, const struct iovec *vector, size_t count)
|
||||
{
|
||||
|
@@ -3,11 +3,8 @@ REM set up a CVS tree to build when there's no autotools
|
||||
REM $Revision$
|
||||
REM $Date$
|
||||
|
||||
REM create ca-bundle.h
|
||||
echo /* This file is generated automatically */ >lib\ca-bundle.h
|
||||
|
||||
REM create hugehelp.c
|
||||
copy src\hugehelp.c.cvs src\hugehelp.c
|
||||
|
||||
REM create Makefile
|
||||
copy Makefile.dist Makefile
|
||||
copy Makefile.dist Makefile
|
||||
|
480
configure.ac
480
configure.ac
@@ -5,7 +5,7 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2008, 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
|
||||
@@ -24,11 +24,11 @@ dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.57)
|
||||
|
||||
dnl We don't know the version number "staticly" so we use a dash here
|
||||
AC_INIT(curl, [-], [a suitable curl mailing list => http://curl.haxx.se/mail/])
|
||||
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/])
|
||||
|
||||
dnl configure script copyright
|
||||
AC_COPYRIGHT([Copyright (c) 1998 - 2006 Daniel Stenberg, <daniel@haxx.se>
|
||||
AC_COPYRIGHT([Copyright (c) 1998 - 2008 Daniel Stenberg, <daniel@haxx.se>
|
||||
This configure script may be copied, distributed and modified under the
|
||||
terms of the curl license; see COPYING for more details])
|
||||
|
||||
@@ -151,7 +151,7 @@ AC_PROG_LIBTOOL
|
||||
|
||||
AC_MSG_CHECKING([if we need -no-undefined])
|
||||
case $host in
|
||||
*-*-cygwin | *-*-mingw* | *-*-pw32*)
|
||||
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
|
||||
need_no_undefined=yes
|
||||
;;
|
||||
*)
|
||||
@@ -174,6 +174,7 @@ case $host in
|
||||
esac
|
||||
AC_MSG_RESULT($mimpure)
|
||||
AM_CONDITIONAL(MIMPURE, test x$mimpure = xyes)
|
||||
AM_CONDITIONAL(STATICLIB, false)
|
||||
|
||||
AC_MSG_CHECKING([if we need BUILDING_LIBCURL])
|
||||
case $host in
|
||||
@@ -185,6 +186,7 @@ case $host in
|
||||
then
|
||||
AC_DEFINE(CURL_STATICLIB, 1, [when not building a shared library])
|
||||
AC_MSG_RESULT(yes)
|
||||
AM_CONDITIONAL(STATICLIB, true)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
@@ -218,12 +220,23 @@ dnl this specific header files. And do them before its results are used.
|
||||
dnl **********************************************************************
|
||||
|
||||
CURL_CHECK_HEADER_WINDOWS
|
||||
CURL_CHECK_HEADER_WINSOCK
|
||||
CURL_CHECK_HEADER_WINSOCK2
|
||||
CURL_CHECK_HEADER_WS2TCPIP
|
||||
|
||||
CURL_CHECK_HEADER_WINLDAP
|
||||
CURL_CHECK_HEADER_WINBER
|
||||
CURL_CHECK_NATIVE_WINDOWS
|
||||
case X-"$ac_cv_native_windows" in
|
||||
X-yes)
|
||||
CURL_CHECK_HEADER_WINSOCK
|
||||
CURL_CHECK_HEADER_WINSOCK2
|
||||
CURL_CHECK_HEADER_WS2TCPIP
|
||||
CURL_CHECK_HEADER_WINLDAP
|
||||
CURL_CHECK_HEADER_WINBER
|
||||
;;
|
||||
*)
|
||||
ac_cv_header_winsock_h="no"
|
||||
ac_cv_header_winsock2_h="no"
|
||||
ac_cv_header_ws2tcpip_h="no"
|
||||
ac_cv_header_winldap_h="no"
|
||||
ac_cv_header_winber_h="no"
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl platform/compiler/architecture specific checks/flags
|
||||
@@ -321,10 +334,29 @@ AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
|
||||
AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
|
||||
AC_SUBST(CURL_DISABLE_LDAP, [1])
|
||||
;;
|
||||
*) AC_MSG_RESULT(yes)
|
||||
*)
|
||||
case $host in
|
||||
*-*-cygwin*)
|
||||
# Force no ldap. config/build process is broken for cygwin
|
||||
AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
|
||||
AC_SUBST(CURL_DISABLE_LDAP, [1])
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(yes)
|
||||
esac
|
||||
;;
|
||||
esac ],
|
||||
AC_MSG_RESULT(yes)
|
||||
esac ],[
|
||||
case $host in
|
||||
*-*-cygwin*)
|
||||
# Force no ldap. config/build process is broken for cygwin
|
||||
AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
|
||||
AC_SUBST(CURL_DISABLE_LDAP, [1])
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(yes)
|
||||
esac ]
|
||||
)
|
||||
AC_MSG_CHECKING([whether to support ldaps])
|
||||
AC_ARG_ENABLE(ldaps,
|
||||
@@ -457,64 +489,116 @@ then
|
||||
AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
|
||||
my_ac_save_LIBS=$LIBS
|
||||
LIBS="-lnsl -lsocket $LIBS"
|
||||
AC_TRY_LINK( ,
|
||||
[gethostbyname();],
|
||||
[ dnl found it!
|
||||
HAVE_GETHOSTBYNAME="1"
|
||||
AC_MSG_RESULT([yes])],
|
||||
[ dnl failed!
|
||||
AC_MSG_RESULT([no])
|
||||
dnl restore LIBS
|
||||
LIBS=$my_ac_save_LIBS]
|
||||
)
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
]],[[
|
||||
gethostbyname();
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
HAVE_GETHOSTBYNAME="1"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
LIBS=$my_ac_save_LIBS
|
||||
])
|
||||
fi
|
||||
|
||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||
then
|
||||
dnl This is for Msys/Mingw
|
||||
AC_MSG_CHECKING([for gethostbyname in ws2_32])
|
||||
my_ac_save_LIBS=$LIBS
|
||||
LIBS="-lws2_32 $LIBS"
|
||||
AC_TRY_LINK([#include <winsock2.h>],
|
||||
[gethostbyname("www.dummysite.com");],
|
||||
[ dnl worked!
|
||||
ws2="yes"
|
||||
AC_MSG_RESULT([yes])
|
||||
HAVE_GETHOSTBYNAME="1"],
|
||||
[ dnl failed, restore LIBS
|
||||
LIBS=$my_ac_save_LIBS
|
||||
AC_MSG_RESULT(no)]
|
||||
)
|
||||
dnl This is for winsock systems
|
||||
if test "$ac_cv_header_windows_h" = "yes"; then
|
||||
if test "$ac_cv_header_winsock_h" = "yes"; then
|
||||
case $host in
|
||||
*-*-mingw32ce*)
|
||||
winsock_LIB="-lwinsock"
|
||||
;;
|
||||
*)
|
||||
winsock_LIB="-lwsock32"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test "$ac_cv_header_winsock2_h" = "yes"; then
|
||||
winsock_LIB="-lws2_32"
|
||||
fi
|
||||
if test ! -z "$winsock_LIB"; then
|
||||
my_ac_save_LIBS=$LIBS
|
||||
LIBS="$winsock_LIB $LIBS"
|
||||
AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#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
|
||||
]],[[
|
||||
gethostbyname("www.dummysite.com");
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
HAVE_GETHOSTBYNAME="1"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
winsock_LIB=""
|
||||
LIBS=$my_ac_save_LIBS
|
||||
])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||
then
|
||||
dnl This is for Minix 3.1
|
||||
AC_MSG_CHECKING([for gethostbyname for Minix 3])
|
||||
AC_TRY_LINK([
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
/* Older Minix versions may need <net/gen/netdb.h> here instead */
|
||||
#include <netdb.h>],
|
||||
[gethostbyname("www.dummysite.com");],
|
||||
[ dnl worked!
|
||||
AC_MSG_RESULT([yes])
|
||||
HAVE_GETHOSTBYNAME="1"],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
#include <netdb.h>
|
||||
]],[[
|
||||
gethostbyname("www.dummysite.com");
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
HAVE_GETHOSTBYNAME="1"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
fi
|
||||
|
||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||
then
|
||||
dnl This is for eCos with a stubbed DNS implementation
|
||||
AC_MSG_CHECKING([for gethostbyname for eCos])
|
||||
AC_TRY_LINK([
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#include <stdio.h>
|
||||
#include <netdb.h>],
|
||||
[gethostbyname("www.dummysite.com");],
|
||||
[ dnl worked!
|
||||
AC_MSG_RESULT([yes])
|
||||
HAVE_GETHOSTBYNAME="1"],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
#include <netdb.h>
|
||||
]],[[
|
||||
gethostbyname("www.dummysite.com");
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
HAVE_GETHOSTBYNAME="1"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
fi
|
||||
|
||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||
then
|
||||
dnl gethostbyname in the network lib - for Haiku OS
|
||||
AC_CHECK_LIB(network, gethostbyname,
|
||||
[HAVE_GETHOSTBYNAME="1"
|
||||
LIBS="$LIBS -lnetwork"
|
||||
])
|
||||
fi
|
||||
|
||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||
@@ -546,6 +630,12 @@ fi
|
||||
dnl socket lib?
|
||||
AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl In case that function clock_gettime with monotonic timer is available,
|
||||
dnl check for additional required libraries.
|
||||
dnl **********************************************************************
|
||||
CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl The preceding library checks are all potentially useful for test
|
||||
dnl servers (for providing networking support). Save the list of required
|
||||
@@ -604,6 +694,8 @@ if test x$CURL_DISABLE_LDAP != x1 ; then
|
||||
AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
|
||||
AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
|
||||
AC_SUBST(CURL_DISABLE_LDAP, [1])])
|
||||
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
|
||||
AC_SUBST(CURL_DISABLE_LDAPS, [1])
|
||||
else
|
||||
dnl Try to find the right ldap libraries for this system
|
||||
CURL_CHECK_LIBS_LDAP
|
||||
@@ -612,6 +704,8 @@ if test x$CURL_DISABLE_LDAP != x1 ; then
|
||||
AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
|
||||
AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
|
||||
AC_SUBST(CURL_DISABLE_LDAP, [1])
|
||||
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
|
||||
AC_SUBST(CURL_DISABLE_LDAPS, [1])
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
@@ -627,6 +721,8 @@ if test x$CURL_DISABLE_LDAP != x1 ; then
|
||||
AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
|
||||
AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
|
||||
AC_SUBST(CURL_DISABLE_LDAP, [1])])
|
||||
AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
|
||||
AC_SUBST(CURL_DISABLE_LDAPS, [1])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -647,36 +743,6 @@ if test x$CURL_DISABLE_LDAP != x1 ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Check for the presence of the winmm library.
|
||||
dnl **********************************************************************
|
||||
|
||||
case $host in
|
||||
*-*-cygwin*)
|
||||
dnl Under Cygwin, winmm exists but is not needed as WIN32 is not #defined
|
||||
dnl and gettimeofday() will be used regardless of the outcome of this test.
|
||||
dnl Skip this test, otherwise -lwinmm will be needlessly added to LIBS
|
||||
dnl (and recorded as such in the .la file, potentially affecting downstream
|
||||
dnl clients of the library.)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_CHECKING([for timeGetTime in winmm])
|
||||
my_ac_save_LIBS=$LIBS
|
||||
LIBS="-lwinmm $LIBS"
|
||||
AC_TRY_LINK([#include <windef.h>
|
||||
#include <mmsystem.h>
|
||||
],
|
||||
[timeGetTime();],
|
||||
[ dnl worked!
|
||||
AC_MSG_RESULT([yes])
|
||||
],
|
||||
[ dnl failed, restore LIBS
|
||||
LIBS=$my_ac_save_LIBS
|
||||
AC_MSG_RESULT(no)]
|
||||
)
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Checks for IPv6
|
||||
dnl **********************************************************************
|
||||
@@ -901,6 +967,9 @@ dnl **********************************************************************
|
||||
dnl Check for GSS-API libraries
|
||||
dnl **********************************************************************
|
||||
|
||||
dnl check for gss stuff in the /usr as default
|
||||
|
||||
GSSAPI_ROOT="/usr"
|
||||
AC_ARG_WITH(gssapi-includes,
|
||||
AC_HELP_STRING([--with-gssapi-includes=DIR],
|
||||
[Specify location of GSSAPI header]),
|
||||
@@ -921,6 +990,10 @@ AC_ARG_WITH(gssapi,
|
||||
GSSAPI_ROOT="$withval"
|
||||
if test x"$GSSAPI_ROOT" != xno; then
|
||||
want_gss="yes"
|
||||
if test x"$GSSAPI_ROOT" = xyes; then
|
||||
dnl if yes, then use default root
|
||||
GSSAPI_ROOT="/usr"
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -932,11 +1005,15 @@ if test x"$want_gss" = xyes; then
|
||||
if test -z "$GSSAPI_INCS"; then
|
||||
if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
|
||||
GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
|
||||
GSSAPI_LIBS=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
|
||||
elif test "$GSSAPI_ROOT" != "yes"; then
|
||||
GSSAPI_INCS="-I$GSSAPI_ROOT/include"
|
||||
GSSAPI_LIBS="-lgssapi"
|
||||
fi
|
||||
fi
|
||||
|
||||
CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
|
||||
LIBS="$LIBS $GSSAPI_LIBS"
|
||||
|
||||
AC_CHECK_HEADER(gss.h,
|
||||
[
|
||||
@@ -945,18 +1022,17 @@ if test x"$want_gss" = xyes; then
|
||||
gnu_gss=yes
|
||||
],
|
||||
[
|
||||
dnl not found, check Heimdal
|
||||
AC_CHECK_HEADER(gssapi.h,
|
||||
[
|
||||
dnl found in the given dirs
|
||||
AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries])
|
||||
],
|
||||
[
|
||||
dnl not found, check in gssapi/ subdir
|
||||
AC_CHECK_HEADER(gssapi/gssapi.h,
|
||||
dnl not found, check Heimdal or MIT
|
||||
AC_CHECK_HEADERS(
|
||||
[gssapi/gssapi.h gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
|
||||
[],
|
||||
[not_mit=1])
|
||||
if test "x$not_mit" = "x1"; then
|
||||
dnl MIT not found, check for Heimdal
|
||||
AC_CHECK_HEADER(gssapi.h,
|
||||
[
|
||||
dnl found
|
||||
AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
|
||||
AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries])
|
||||
],
|
||||
[
|
||||
dnl no header found, disabling GSS
|
||||
@@ -964,8 +1040,30 @@ if test x"$want_gss" = xyes; then
|
||||
AC_MSG_WARN(disabling GSSAPI since no header files was found)
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
else
|
||||
dnl MIT found
|
||||
AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
|
||||
dnl check if we have a really old MIT kerberos (<= 1.2)
|
||||
AC_MSG_CHECKING([if gssapi headers declare GSS_C_NT_HOSTBASED_SERVICE])
|
||||
AC_TRY_COMPILE([
|
||||
#include <gssapi/gssapi.h>
|
||||
#include <gssapi/gssapi_generic.h>
|
||||
#include <gssapi/gssapi_krb5.h>
|
||||
],[
|
||||
gss_import_name(
|
||||
(OM_uint32 *)0,
|
||||
(gss_buffer_t)0,
|
||||
GSS_C_NT_HOSTBASED_SERVICE,
|
||||
(gss_name_t *)0);
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
AC_DEFINE(HAVE_OLD_GSSMIT, 1, [if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE])
|
||||
]
|
||||
)
|
||||
|
||||
fi
|
||||
]
|
||||
)
|
||||
else
|
||||
@@ -978,18 +1076,23 @@ if test x"$want_gss" = xyes; then
|
||||
|
||||
if test -n "$gnu_gss"; then
|
||||
curl_gss_msg="enabled (GNU GSS)"
|
||||
LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR -lgss"
|
||||
LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
|
||||
LIBS="$LIBS -lgss"
|
||||
elif test -z "$GSSAPI_LIB_DIR"; then
|
||||
if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
|
||||
gss_ldflags=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
|
||||
LDFLAGS="$LDFLAGS $gss_ldflags"
|
||||
dnl krb5-config doesn't have --libs-only-L or similar, put everything
|
||||
dnl into LIBS
|
||||
gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
|
||||
LIBS="$LIBS $gss_libs"
|
||||
elif test "$GSSAPI_ROOT" != "yes"; then
|
||||
LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff -lgssapi"
|
||||
LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
|
||||
LIBS="$LIBS -lgssapi"
|
||||
else
|
||||
LDFLAGS="$LDFLAGS -lgssapi"
|
||||
LIBS="$LIBS -lgssapi"
|
||||
fi
|
||||
else
|
||||
LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR -lgssapi"
|
||||
LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
|
||||
LIBS="$LIBS -lgssapi"
|
||||
fi
|
||||
else
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
@@ -1198,21 +1301,23 @@ if test X"$OPT_SSL" != Xno; then
|
||||
dnl and acting like OpenSSL.
|
||||
|
||||
AC_MSG_CHECKING([for yaSSL using OpenSSL compatibility mode])
|
||||
AC_TRY_COMPILE([
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#include <openssl/ssl.h>
|
||||
],[
|
||||
]],[[
|
||||
#if defined(YASSL_VERSION) && defined(OPENSSL_VERSION_NUMBER)
|
||||
int dummy = SSL_ERROR_NONE;
|
||||
#else
|
||||
Not the yaSSL OpenSSL compatibility header.
|
||||
#endif
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE_UNQUOTED(USE_YASSLEMUL, 1,
|
||||
[Define to 1 if using yaSSL in OpenSSL compatibility mode.])
|
||||
curl_ssl_msg="enabled (OpenSSL emulation by yaSSL)"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE_UNQUOTED(USE_YASSLEMUL, 1,
|
||||
[Define to 1 if using yaSSL in OpenSSL compatibility mode.])
|
||||
curl_ssl_msg="enabled (OpenSSL emulation by yaSSL)"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
fi
|
||||
|
||||
@@ -1292,6 +1397,7 @@ else
|
||||
if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
|
||||
then
|
||||
AC_MSG_WARN([configure found only the libz lib, not the header file!])
|
||||
HAVE_LIBZ=""
|
||||
elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
|
||||
then
|
||||
AC_MSG_WARN([configure found only the libz header file, not the lib!])
|
||||
@@ -1336,7 +1442,7 @@ if test X"$OPT_LIBSSH2" != Xno; then
|
||||
yes)
|
||||
dnl --with-libssh2 (without path) used
|
||||
PREFIX_LIBSSH2=/usr/local/lib
|
||||
LIB_LIBSSH2="$PREFIX_LIBSSH2/lib$libsuff"
|
||||
LIB_LIBSSH2="$PREFIX_LIBSSH2$libsuff"
|
||||
;;
|
||||
off)
|
||||
dnl no --with-libssh2 option given, just check default places
|
||||
@@ -1356,8 +1462,9 @@ if test X"$OPT_LIBSSH2" != Xno; then
|
||||
AC_CHECK_HEADERS(libssh2.h,
|
||||
curl_ssh_msg="enabled (libSSH2)"
|
||||
LIBSSH2_ENABLED=1
|
||||
AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use]))
|
||||
AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use])
|
||||
AC_SUBST(USE_LIBSSH2, [1])
|
||||
)
|
||||
|
||||
if test X"$OPT_LIBSSH2" != Xoff &&
|
||||
test "$LIBSSH2_ENABLED" != "1"; then
|
||||
@@ -1516,7 +1623,7 @@ if test "$OPENSSL_ENABLED" != "1" -a "$GNUTLS_ENABLED" != "1"; then
|
||||
|
||||
dnl Check for functionPK11_CreateGenericObject
|
||||
dnl this is needed for using the PEM PKCS#11 module
|
||||
AC_CHECK_LIB(nss3, PK11_CreateGenericObject-d,
|
||||
AC_CHECK_LIB(nss3, PK11_CreateGenericObject,
|
||||
[
|
||||
AC_DEFINE(HAVE_PK11_CREATEGENERICOBJECT, 1, [if you have the function PK11_CreateGenericObject])
|
||||
AC_SUBST(HAVE_PK11_CREATEGENERICOBJECT, [1])
|
||||
@@ -1566,36 +1673,17 @@ fi dnl OPENSSL != 1 -a GNUTLS_ENABLED != 1
|
||||
if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED" = "x"; then
|
||||
AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
|
||||
AC_MSG_WARN([Use --with-ssl, --with-gnutls or --with-nss to address this.])
|
||||
else
|
||||
# SSL is enabled, genericly
|
||||
AC_SUBST(SSL_ENABLED)
|
||||
SSL_ENABLED="1"
|
||||
fi
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Check for the CA bundle
|
||||
dnl **********************************************************************
|
||||
|
||||
if test X"$USE_NSS$USE_GNUTLS$OPENSSL_ENABLED" != "X"; then
|
||||
|
||||
AC_MSG_CHECKING([CA cert bundle install path])
|
||||
|
||||
AC_ARG_WITH(ca-bundle,
|
||||
AC_HELP_STRING([--with-ca-bundle=FILE], [File name to install the CA bundle as])
|
||||
AC_HELP_STRING([--without-ca-bundle], [Don't install the CA bundle]),
|
||||
[ ca="$withval" ],
|
||||
[
|
||||
if test "x$prefix" != xNONE; then
|
||||
ca="\${prefix}/share/curl/curl-ca-bundle.crt"
|
||||
else
|
||||
ca="$ac_default_prefix/share/curl/curl-ca-bundle.crt"
|
||||
fi
|
||||
] )
|
||||
|
||||
if test "x$ca" != "xno"; then
|
||||
CURL_CA_BUNDLE='"'$ca'"'
|
||||
AC_SUBST(CURL_CA_BUNDLE)
|
||||
fi
|
||||
AC_MSG_RESULT([$ca])
|
||||
fi dnl only done if some kind of SSL was enabled
|
||||
|
||||
AM_CONDITIONAL(CABUNDLE, test x$ca != xno)
|
||||
CURL_CHECK_CA_BUNDLE
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Check for the presence of IDN libraries and headers
|
||||
@@ -1733,6 +1821,9 @@ if test "x$RECENTAIX" = "xyes"; then
|
||||
dnl the optimizer assumes that pointers can only point to
|
||||
dnl an object of the same type.
|
||||
CFLAGS="$CFLAGS -qnoansialias"
|
||||
dnl Force AIX xlc to stop after the compilation phase, and not
|
||||
dnl generate object code, when the source compiles with errors.
|
||||
CFLAGS="$CFLAGS -qhalt=e"
|
||||
)
|
||||
|
||||
|
||||
@@ -1782,7 +1873,7 @@ if test x$cross_compiling != xyes; then
|
||||
)
|
||||
fi
|
||||
else
|
||||
dnl and for crosscompilings
|
||||
dnl and for crosscompiling
|
||||
AC_CHECK_FUNCS(gmtime_r)
|
||||
fi
|
||||
|
||||
@@ -1811,6 +1902,7 @@ AC_CHECK_HEADERS(
|
||||
arpa/inet.h \
|
||||
net/if.h \
|
||||
netinet/in.h \
|
||||
sys/un.h \
|
||||
netinet/tcp.h \
|
||||
netdb.h \
|
||||
sys/sockio.h \
|
||||
@@ -1827,6 +1919,7 @@ AC_CHECK_HEADERS(
|
||||
utime.h \
|
||||
sys/utime.h \
|
||||
sys/poll.h \
|
||||
poll.h \
|
||||
sys/resource.h \
|
||||
libgen.h \
|
||||
locale.h \
|
||||
@@ -1856,6 +1949,9 @@ dnl default includes
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_UN_H
|
||||
#include <sys/un.h>
|
||||
#endif
|
||||
]
|
||||
)
|
||||
|
||||
@@ -1874,6 +1970,7 @@ AC_CHECK_SIZEOF(curl_off_t, ,[
|
||||
AC_CHECK_SIZEOF(size_t)
|
||||
AC_CHECK_SIZEOF(long)
|
||||
AC_CHECK_SIZEOF(time_t)
|
||||
AC_CHECK_SIZEOF(off_t)
|
||||
|
||||
AC_CHECK_TYPE(long long,
|
||||
[AC_DEFINE(HAVE_LONGLONG, 1, [if your compiler supports long long])]
|
||||
@@ -1918,7 +2015,7 @@ TYPE_SIG_ATOMIC_T
|
||||
|
||||
AC_TYPE_SIGNAL
|
||||
|
||||
AC_FUNC_SELECT_ARGTYPES
|
||||
CURL_CHECK_FUNC_SELECT
|
||||
|
||||
CURL_CHECK_FUNC_RECV
|
||||
|
||||
@@ -1939,7 +2036,6 @@ case $host in
|
||||
esac
|
||||
AC_CHECK_FUNCS( strtoll \
|
||||
socket \
|
||||
select \
|
||||
strdup \
|
||||
strstr \
|
||||
strcasestr \
|
||||
@@ -1962,6 +2058,7 @@ AC_CHECK_FUNCS( strtoll \
|
||||
strlcat \
|
||||
getpwuid \
|
||||
geteuid \
|
||||
getppid \
|
||||
utime \
|
||||
sigsetjmp \
|
||||
basename \
|
||||
@@ -1992,48 +2089,23 @@ if test "x$skipcheck" != "xyes"; then
|
||||
fi
|
||||
)
|
||||
|
||||
dnl For some reason, the check above doesn't properly detect select() with
|
||||
dnl Msys/Mingw
|
||||
if test "$ac_cv_func_select" = "no"; then
|
||||
AC_MSG_CHECKING([for select in ws2_32])
|
||||
AC_TRY_LINK([
|
||||
#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
|
||||
],[
|
||||
select(0,(fd_set *)NULL,(fd_set *)NULL,(fd_set *)NULL,(struct timeval *)NULL);
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
HAVE_SELECT="1"
|
||||
AC_DEFINE_UNQUOTED(HAVE_SELECT, 1,
|
||||
[Define to 1 if you have the select function.])
|
||||
],[
|
||||
AC_MSG_ERROR([You can't compile without a select])
|
||||
])
|
||||
fi
|
||||
|
||||
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_TRY_LINK( [#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)
|
||||
)
|
||||
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, ,
|
||||
@@ -2088,6 +2160,8 @@ if test "$disable_poll" = "no"; then
|
||||
AC_RUN_IFELSE([
|
||||
#ifdef HAVE_SYS_POLL_H
|
||||
#include <sys/poll.h>
|
||||
#elif defined(HAVE_POLL_H)
|
||||
#include <poll.h>
|
||||
#endif
|
||||
|
||||
int main(void)
|
||||
@@ -2205,25 +2279,26 @@ AC_HELP_STRING([--disable-ares],[Disable c-ares for name lookups]),
|
||||
dnl out and don't use the "embedded" ares dir (in which case we don't
|
||||
dnl check it because it might not have been built yet)
|
||||
AC_MSG_CHECKING([that c-ares is good and recent enough])
|
||||
AC_LINK_IFELSE( [
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#include <ares.h>
|
||||
/* provide a set of dummy functions in case c-ares was built with debug */
|
||||
void curl_dofree() { }
|
||||
void curl_sclose() { }
|
||||
void curl_domalloc() { }
|
||||
|
||||
int main(void)
|
||||
{
|
||||
ares_channel channel;
|
||||
ares_cancel(channel); /* added in 1.2.0 */
|
||||
ares_process_fd(channel, 0, 0); /* added in 1.4.0 */
|
||||
return 0;
|
||||
}
|
||||
],
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([c-ares library defective or too old])
|
||||
)
|
||||
/* set of dummy functions in case c-ares was built with debug */
|
||||
void curl_dofree() { }
|
||||
void curl_sclose() { }
|
||||
void curl_domalloc() { }
|
||||
void curl_docalloc() { }
|
||||
void curl_socket() { }
|
||||
]],[[
|
||||
ares_channel channel;
|
||||
ares_cancel(channel); /* added in 1.2.0 */
|
||||
ares_process_fd(channel, 0, 0); /* added in 1.4.0 */
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([c-ares library defective or too old])
|
||||
])
|
||||
fi
|
||||
;;
|
||||
esac ],
|
||||
@@ -2249,8 +2324,6 @@ AC_HELP_STRING([--disable-verbose],[Disable verbose strings]),
|
||||
AC_MSG_RESULT(yes)
|
||||
)
|
||||
|
||||
CURL_CHECK_NATIVE_WINDOWS
|
||||
|
||||
dnl ************************************************************
|
||||
dnl enable SSPI support
|
||||
dnl
|
||||
@@ -2380,15 +2453,15 @@ AC_HELP_STRING([--disable-hidden-symbols],[Leave all symbols with default visibi
|
||||
)
|
||||
|
||||
dnl ************************************************************
|
||||
if test "x$ws2" = "xyes"; then
|
||||
if test ! -z "$winsock_LIB"; then
|
||||
|
||||
dnl If ws2_32 is wanted, make sure it is the _last_ lib in LIBS (makes
|
||||
dnl things work when built with c-ares). But we can't just move it last
|
||||
dnl since then other stuff (SSL) won't build. So we simply append it to the
|
||||
dnl end.
|
||||
|
||||
LIBS="$LIBS -lws2_32"
|
||||
TEST_SERVER_LIBS="$TEST_SERVER_LIBS -lws2_32"
|
||||
LIBS="$LIBS $winsock_LIB"
|
||||
TEST_SERVER_LIBS="$TEST_SERVER_LIBS $winsock_LIB"
|
||||
|
||||
fi
|
||||
|
||||
@@ -2458,7 +2531,8 @@ AC_MSG_NOTICE([Configured to build curl/libcurl:
|
||||
Built-in manual: ${curl_manual_msg}
|
||||
Verbose errors: ${curl_verbose_msg}
|
||||
SSPI support: ${curl_sspi_msg}
|
||||
ca cert path: ${ca}
|
||||
ca cert bundle: ${ca}
|
||||
ca cert path: ${capath}
|
||||
LDAP support: ${curl_ldap_msg}
|
||||
LDAPS support: ${curl_ldaps_msg}
|
||||
])
|
||||
|
@@ -6,7 +6,7 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 2001 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 2001 - 2008, 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
|
||||
@@ -83,7 +83,7 @@ while test $# -gt 0; do
|
||||
if test "@USE_SSLEAY@" = "1"; then
|
||||
echo "SSL"
|
||||
NTLM=1 # OpenSSL implies NTLM
|
||||
elif test -n "@USE_GNUTLS@"; then
|
||||
elif test -n "@SSL_ENABLED@"; then
|
||||
echo "SSL"
|
||||
fi
|
||||
if test "@KRB4_ENABLED@" = "1"; then
|
||||
@@ -113,13 +113,13 @@ while test $# -gt 0; do
|
||||
--protocols)
|
||||
if test "@CURL_DISABLE_HTTP@" != "1"; then
|
||||
echo "HTTP"
|
||||
if test "@USE_SSLEAY@" = "1"; then
|
||||
if test "@SSL_ENABLED@" = "1"; then
|
||||
echo "HTTPS"
|
||||
fi
|
||||
fi
|
||||
if test "@CURL_DISABLE_FTP@" != "1"; then
|
||||
echo "FTP"
|
||||
if test "@USE_SSLEAY@" = "1"; then
|
||||
if test "@SSL_ENABLED@" = "1"; then
|
||||
echo "FTPS"
|
||||
fi
|
||||
fi
|
||||
@@ -189,7 +189,7 @@ while test $# -gt 0; do
|
||||
;;
|
||||
|
||||
--libs)
|
||||
if test "X@libdir@" != "X/usr/lib"; then
|
||||
if test "X@libdir@" != "X/usr/lib" -a "X@libdir@" != "X/usr/lib64"; then
|
||||
CURLLIBDIR="-L@libdir@ "
|
||||
else
|
||||
CURLLIBDIR=""
|
||||
|
@@ -60,19 +60,27 @@ Euphoria
|
||||
http://rays-web.com/eulibcurl.htm
|
||||
|
||||
Ferite
|
||||
|
||||
Written by Paul Querna
|
||||
http://www.ferite.org/
|
||||
|
||||
Gambas
|
||||
|
||||
http://gambas.sourceforge.net
|
||||
|
||||
glib/GTK+
|
||||
|
||||
Written by Richard Atterer
|
||||
http://atterer.net/glibcurl/
|
||||
|
||||
Haskell
|
||||
|
||||
Written by Galois, Inc
|
||||
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/curl
|
||||
|
||||
Java
|
||||
|
||||
Maintained by Vic Hanson
|
||||
Maintained by [blank]
|
||||
http://curl.haxx.se/libcurl/java/
|
||||
|
||||
Lisp
|
||||
@@ -143,11 +151,20 @@ Rexx
|
||||
Written Mark Hessling
|
||||
http://rexxcurl.sourceforge.net/
|
||||
|
||||
RPG
|
||||
|
||||
Support for ILE/RPG on OS/400 is included in source distribution
|
||||
http://curl.haxx.se/libcurl/
|
||||
See packages/OS400/README.OS400 and packages/OS400/curl.inc.in
|
||||
|
||||
Ruby
|
||||
|
||||
Written by Ross Bamford
|
||||
curb - written by Ross Bamford
|
||||
http://curb.rubyforge.org/
|
||||
|
||||
ruby-curl-multi - written by Kristjan Petursson and Keith Rarick
|
||||
http://curl-multi.rubyforge.org/
|
||||
|
||||
Scheme
|
||||
|
||||
Bigloo binding by Kirill Lisovsky
|
||||
|
@@ -102,6 +102,8 @@
|
||||
using spaces only (no tabs) and having the opening brace ({) on the same line
|
||||
as the if() or while().
|
||||
|
||||
Also note that we use if() and while() with no space before the parenthesis.
|
||||
|
||||
2.3 Commenting
|
||||
|
||||
Comment your source code extensively using C comments (/* comment */), DO NOT
|
||||
|
44
docs/FAQ
44
docs/FAQ
@@ -1,4 +1,4 @@
|
||||
Updated: July 30, 2007 (http://curl.haxx.se/docs/faq.html)
|
||||
Updated: Feb 18, 2008 (http://curl.haxx.se/docs/faq.html)
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
@@ -18,6 +18,7 @@ FAQ
|
||||
1.8 I have a problem who do I mail?
|
||||
1.9 Where do I buy commercial support for curl?
|
||||
1.10 How many are using curl?
|
||||
1.11 Why don't you update ca-bundle.crt
|
||||
|
||||
2. Install Related Problems
|
||||
2.1 configure doesn't find OpenSSL even when it is installed
|
||||
@@ -83,6 +84,7 @@ FAQ
|
||||
5.10 How do I prevent libcurl from writing the response to stdout?
|
||||
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?
|
||||
|
||||
6. License Issues
|
||||
6.1 I have a GPL program, can I use the libcurl library?
|
||||
@@ -214,8 +216,7 @@ FAQ
|
||||
improvements and have them inserted in the main sources (of course on the
|
||||
condition that developers agree on that the fixes are good).
|
||||
|
||||
The full list of the more than 530 contributors is found in the docs/THANKS
|
||||
file.
|
||||
The full list of all contributors is found in the docs/THANKS file.
|
||||
|
||||
curl is developed by a community, with Daniel at the wheel.
|
||||
|
||||
@@ -296,7 +297,7 @@ FAQ
|
||||
as used by numerous applications that include libcurl binaries in their
|
||||
distribution packages (like Adobe Acrobat Reader and Google Earth).
|
||||
|
||||
More than 70 known named companies use curl in commercial environments and
|
||||
More than 80 known named companies use curl in commercial environments and
|
||||
products. More than 100 known named open source projects depend on
|
||||
(lib)curl.
|
||||
|
||||
@@ -317,6 +318,29 @@ FAQ
|
||||
http://counter.li.org/estimates.php
|
||||
http://news.netcraft.com/archives/2005/03/14/fedora_makes_rapid_progress.html
|
||||
|
||||
1.11 Why don't you update ca-bundle.crt
|
||||
|
||||
The ca-bundle.crt file that used to be bundled with curl was very outdated
|
||||
(it being last modified year 2000 should tell) and must be replaced with a
|
||||
much more modern and up-to-date version by anyone who wants to verify peers
|
||||
anyway. It is no longer provided, the last curl release that shipped it was
|
||||
curl 7.18.0.
|
||||
|
||||
In the cURL project we've decided not to attempt to keep this file updated
|
||||
(or even present anymore) since deciding what to add to a ca cert bundle is
|
||||
an undertaking we've not been ready to accept, and the one we can get from
|
||||
Mozilla is perfectly fine so there's no need to duplicate that work.
|
||||
|
||||
Today, with many services performed over HTTPS, every operating system
|
||||
should come with a default ca cert bundle that can be deemed somewhat
|
||||
trustworthy and that collection (if reasonably updated) should be deemed to
|
||||
be a lot better than a private curl version.
|
||||
|
||||
If you want the most recent collection of ca certs that Mozilla Firefox
|
||||
uses, we recommend that you extract the collection yourself from Mozilla
|
||||
Firefox (by running 'make ca-bundle), or by using our online service setup
|
||||
for this purpose: http://curl.haxx.se/docs/caextract.html
|
||||
|
||||
|
||||
2. Install Related Problems
|
||||
|
||||
@@ -1033,6 +1057,18 @@ FAQ
|
||||
that makes you see and use a different IP address locally than what the
|
||||
remote server will see you coming from.
|
||||
|
||||
5.13 How do I stop an ongoing transfer?
|
||||
|
||||
There are several ways, but none of them are instant. There is no function
|
||||
you can call from another thread or similar that will stop it immediately.
|
||||
Instead you need to make sure that one of the callbacks you use return an
|
||||
appropriate value that will stop the transfer.
|
||||
|
||||
Suitable callbacks that you can do this with include the progress callback,
|
||||
the read callback and the write callback.
|
||||
|
||||
If you're using the multi interface, you also stop a transfer by removing
|
||||
the particular easy handle from the multi stack.
|
||||
|
||||
6. License Issues
|
||||
|
||||
|
32
docs/INSTALL
32
docs/INSTALL
@@ -188,7 +188,7 @@ Win32
|
||||
environment variables, for example:
|
||||
|
||||
set ZLIB_PATH=c:\zlib-1.2.3
|
||||
set OPENSSL_PATH=c:\openssl-0.9.8e
|
||||
set OPENSSL_PATH=c:\openssl-0.9.8g
|
||||
set LIBSSH2_PATH=c:\libssh2-0.17
|
||||
|
||||
ATTENTION: if you want to build with libssh2 support you have to use latest
|
||||
@@ -257,7 +257,7 @@ Win32
|
||||
Before running nmake define the OPENSSL_PATH environment variable with
|
||||
the root/base directory of OpenSSL, for example:
|
||||
|
||||
set OPENSSL_PATH=c:\openssl-0.9.8e
|
||||
set OPENSSL_PATH=c:\openssl-0.9.8g
|
||||
|
||||
Then run 'nmake vc-ssl' or 'nmake vc-ssl-dll' in curl's root
|
||||
directory. 'nmake vc-ssl' will create a libcurl static and dynamic
|
||||
@@ -521,7 +521,7 @@ NetWare
|
||||
http://www.gknw.net/development/ossl/netware/
|
||||
for CLIB-based builds OpenSSL needs to be patched to build with BSD
|
||||
sockets (currently only a winsock-based CLIB build is supported):
|
||||
http://www.gknw.net/development/ossl/netware/patches/v_0.9.8e/openssl-0.9.8e.diff
|
||||
http://www.gknw.net/development/ossl/netware/patches/v_0.9.8g/openssl-0.9.8g.diff
|
||||
- optional SSH2 sources (version 0.17 or later);
|
||||
|
||||
Set a search path to your compiler, linker and tools; on Linux make
|
||||
@@ -655,6 +655,19 @@ Minix
|
||||
make
|
||||
|
||||
|
||||
Symbian OS
|
||||
==========
|
||||
The Symbian OS port uses the Symbian build system to compile. From the
|
||||
packages/Symbian/group/ directory, run:
|
||||
|
||||
bldmake bldfiles
|
||||
abld build
|
||||
|
||||
to compile and install curl and libcurl. If your Symbian SDK doesn't
|
||||
include support for P.I.P.S., you will need to contact your SDK vendor
|
||||
to obtain that first.
|
||||
|
||||
|
||||
CROSS COMPILE
|
||||
=============
|
||||
(This section was graciously brought to us by Jim Duey, with additions by
|
||||
@@ -709,8 +722,8 @@ REDUCING SIZE
|
||||
size of libcurl for embedded applications where binary size is an
|
||||
important factor. First, be sure to set the CFLAGS variable when
|
||||
configuring with any relevant compiler optimization flags to reduce the
|
||||
size of the binary. For gcc, this would mean at minimum the -Os option
|
||||
and probably the -march=X option as well, e.g.:
|
||||
size of the binary. For gcc, this would mean at minimum the -Os option,
|
||||
potentially the -march=X and -mdynamic-no-pic options as well, e.g.:
|
||||
|
||||
./configure CFLAGS='-Os' ...
|
||||
|
||||
@@ -777,7 +790,8 @@ PORTS
|
||||
- PowerPC Linux
|
||||
- PowerPC Mac OS 9
|
||||
- PowerPC Mac OS X
|
||||
- SuperH4 Linux 2.6.X
|
||||
- SH4 Linux 2.6.X
|
||||
- SH4 OS21
|
||||
- SINIX-Z v5
|
||||
- Sparc Linux
|
||||
- Sparc Solaris 2.4, 2.5, 2.5.1, 2.6, 7, 8, 9, 10
|
||||
@@ -785,6 +799,7 @@ PORTS
|
||||
- StrongARM (and other ARM) RISC OS 3.1, 4.02
|
||||
- StrongARM/ARM7/ARM9 Linux 2.4, 2.6
|
||||
- StrongARM NetBSD 1.4.1
|
||||
- Symbian OS (P.I.P.S.)
|
||||
- TPF
|
||||
- Ultrix 4.3a
|
||||
- UNICOS 9.0
|
||||
@@ -794,24 +809,27 @@ PORTS
|
||||
- i386 Esix 4.1
|
||||
- i386 FreeBSD
|
||||
- i386 HURD
|
||||
- i386 Haiku OS
|
||||
- i386 Linux 1.3, 2.0, 2.2, 2.3, 2.4, 2.6
|
||||
- i386 MINIX 3.1
|
||||
- i386 NetBSD
|
||||
- i386 Novell NetWare
|
||||
- i386 OS/2
|
||||
- i386 OpenBSD
|
||||
- i386 QNX 6
|
||||
- i386 SCO unix
|
||||
- i386 Solaris 2.7
|
||||
- i386 Windows 95, 98, ME, NT, 2000, XP, 2003
|
||||
- i386 QNX 6
|
||||
- i486 ncr-sysv4.3.03 (NCR MP-RAS)
|
||||
- ia64 Linux 2.3.99
|
||||
- m68k AmigaOS 3
|
||||
- m68k Linux
|
||||
- m68k uClinux
|
||||
- m68k OpenBSD
|
||||
- m88k dg-dgux5.4R3.00
|
||||
- s390 Linux
|
||||
- XScale/PXA250 Linux 2.4
|
||||
- Nios II uClinux
|
||||
|
||||
Useful URLs
|
||||
===========
|
||||
|
@@ -239,7 +239,7 @@ Linker Links
|
||||
checked.
|
||||
|
||||
3- Include in the white space immediately below the box referred in 2 -lcurl
|
||||
-lws2_32 -lwinmm.
|
||||
-lws2_32.
|
||||
|
||||
SSL Files
|
||||
---------
|
||||
|
@@ -97,7 +97,9 @@ Library
|
||||
|
||||
... analyzes the URL, it separates the different components and connects to
|
||||
the remote host. This may involve using a proxy and/or using SSL. The
|
||||
Curl_gethost() function in lib/hostip.c is used for looking up host names.
|
||||
Curl_resolv() function in lib/hostip.c is used for looking up host names
|
||||
(it does then use the proper underlying method, which may vary between
|
||||
platforms and builds).
|
||||
|
||||
When Curl_connect is done, we are connected to the remote site. Then it is
|
||||
time to tell the server to get a document/file. Curl_do() arranges this.
|
||||
@@ -122,17 +124,20 @@ Library
|
||||
Curl_Transfer() function (in lib/transfer.c) to setup the transfer and
|
||||
returns.
|
||||
|
||||
Starting in 7.9.1, if this DO function fails and the connection is being
|
||||
re-used, libcurl will then close this connection, setup a new connection
|
||||
and re-issue the DO request on that. This is because there is no way to be
|
||||
perfectly sure that we have discovered a dead connection before the DO
|
||||
function and thus we might wrongly be re-using a connection that was closed
|
||||
by the remote peer.
|
||||
If this DO function fails and the connection is being re-used, libcurl will
|
||||
then close this connection, setup a new connection and re-issue the DO
|
||||
request on that. This is because there is no way to be perfectly sure that
|
||||
we have discovered a dead connection before the DO function and thus we
|
||||
might wrongly be re-using a connection that was closed by the remote peer.
|
||||
|
||||
Some time during the DO function, the Curl_setup_transfer() function must
|
||||
be called with some basic info about the upcoming transfer: what socket(s)
|
||||
to read/write and the expected file tranfer sizes (if known).
|
||||
|
||||
o Transfer()
|
||||
|
||||
Curl_perform() then calls Transfer() in lib/transfer.c that performs
|
||||
the entire file transfer.
|
||||
Curl_perform() then calls Transfer() in lib/transfer.c that performs the
|
||||
entire file transfer.
|
||||
|
||||
During transfer, the progress functions in lib/progress.c are called at a
|
||||
frequent interval (or at the user's choice, a specified callback might get
|
||||
@@ -236,9 +241,8 @@ Library
|
||||
URL encoding and decoding, called escaping and unescaping in the source code,
|
||||
is found in lib/escape.c.
|
||||
|
||||
While transfering data in Transfer() a few functions might get
|
||||
used. curl_getdate() in lib/getdate.c is for HTTP date comparisons (and
|
||||
more).
|
||||
While transfering data in Transfer() a few functions might get used.
|
||||
curl_getdate() in lib/parsedate.c is for HTTP date comparisons (and more).
|
||||
|
||||
lib/getenv.c offers curl_getenv() which is for reading environment variables
|
||||
in a neat platform independent way. That's used in the client, but also in
|
||||
@@ -254,10 +258,6 @@ Library
|
||||
A function named curl_version() that returns the full curl version string is
|
||||
found in lib/version.c.
|
||||
|
||||
If authentication is requested but no password is given, a getpass_r() clone
|
||||
exists in lib/getpass.c. libcurl offers a custom callback that can be used
|
||||
instead of this, but it doesn't change much to us.
|
||||
|
||||
Persistent Connections
|
||||
======================
|
||||
|
||||
@@ -269,9 +269,11 @@ Persistent Connections
|
||||
all the options etc that the library-user may choose.
|
||||
o The 'SessionHandle' struct holds the "connection cache" (an array of
|
||||
pointers to 'connectdata' structs). There's one connectdata struct
|
||||
allocated for each connection that libcurl knows about.
|
||||
o This also enables the 'curl handle' to be reused on subsequent transfers,
|
||||
something that was illegal before libcurl 7.7.
|
||||
allocated for each connection that libcurl knows about. Note that when you
|
||||
use the multi interface, the multi handle will hold the connection cache
|
||||
and not the particular easy handle. This of course to allow all easy handles
|
||||
in a multi stack to be able to share and re-use connections.
|
||||
o This enables the 'curl handle' to be reused on subsequent transfers.
|
||||
o When we are about to perform a transfer with curl_easy_perform(), we first
|
||||
check for an already existing connection in the cache that we can use,
|
||||
otherwise we create a new one and add to the cache. If the cache is full
|
||||
@@ -281,11 +283,46 @@ Persistent Connections
|
||||
o When the transfer operation is complete, we try to leave the connection
|
||||
open. Particular options may tell us not to, and protocols may signal
|
||||
closure on connections and then we don't keep it open of course.
|
||||
o When curl_easy_cleanup() is called, we close all still opened connections.
|
||||
o When curl_easy_cleanup() is called, we close all still opened connections,
|
||||
unless of course the multi interface "owns" the connections.
|
||||
|
||||
You do realize that the curl handle must be re-used in order for the
|
||||
persistent connections to work.
|
||||
|
||||
multi interface/non-blocking
|
||||
============================
|
||||
|
||||
We make an effort to provide a non-blocking interface to the library, the
|
||||
multi interface. To make that interface work as good as possible, no
|
||||
low-level functions within libcurl must be written to work in a blocking
|
||||
manner.
|
||||
|
||||
One of the primary reasons we introduced c-ares support was to allow the name
|
||||
resolve phase to be perfectly non-blocking as well.
|
||||
|
||||
The ultimate goal is to provide the easy interface simply by wrapping the
|
||||
multi interface functions and thus treat everything internally as the multi
|
||||
interface is the single interface we have.
|
||||
|
||||
The FTP and the SFTP/SCP protocols are thus perfect examples of how we adapt
|
||||
and adjust the code to allow non-blocking operations even on multi-stage
|
||||
protocols. The DICT, TELNET and TFTP are crappy examples and they are subject
|
||||
for rewrite in the future to better fit the libcurl protocol family.
|
||||
|
||||
SSL libraries
|
||||
=============
|
||||
|
||||
Originally libcurl supported SSLeay for SSL/TLS transports, but that was then
|
||||
extended to its successor OpenSSL but has since also been extended to several
|
||||
other SSL/TLS libraries and we expect and hope to further extend the support
|
||||
in future libcurl versions.
|
||||
|
||||
To deal with this internally in the best way possible, we have a generic SSL
|
||||
function API as provided by the sslgen.[ch] system, and they are the only SSL
|
||||
functions we must use from within libcurl. sslgen is then crafted to use the
|
||||
appropriate lower-level function calls to whatever SSL library that is in
|
||||
use.
|
||||
|
||||
Library Symbols
|
||||
===============
|
||||
|
||||
@@ -309,6 +346,13 @@ Return Codes and Informationals
|
||||
them. They are best used when revealing information that isn't otherwise
|
||||
obvious.
|
||||
|
||||
API/ABI
|
||||
=======
|
||||
|
||||
We make an effort to not export or show internals or how internals work, as
|
||||
that makes it easier to keep a solid API/ABI over time. See docs/libcurl/ABI
|
||||
for our promise to users.
|
||||
|
||||
Client
|
||||
======
|
||||
|
||||
|
@@ -3,6 +3,31 @@ 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!
|
||||
|
||||
55. libcurl fails to build with MIT Kerberos for Windows (KfW) due to KfW's
|
||||
library header files exporting symbols/macros that should be kept private
|
||||
to the KfW library. See ticket #5601 at http://krbdev.mit.edu/rt/
|
||||
|
||||
54. User names embedded in URLs without a password are parsed incorrectly--the
|
||||
host name is treated as part of the user name and the port number becomes the
|
||||
password. This can be observed test 279.
|
||||
|
||||
53. SFTP busy-loop problem. When doing SFTP uploads, we can see that libcurl
|
||||
occasionally will busy-loop while waiting for certain network conditions.
|
||||
Reported by Pavel Shalagin, explained somewhat by Daniel Stenberg here:
|
||||
http://curl.haxx.se/mail/lib-2008-04/0439.html
|
||||
|
||||
52. Gautam Kachroo's issue that identifies a problem with the multi interface
|
||||
where a connection can be re-used without actually being properly
|
||||
SSL-negoatiated:
|
||||
http://curl.haxx.se/mail/lib-2008-01/0277.html
|
||||
|
||||
49. If using --retry and the transfer timeouts (possibly due to using -m or
|
||||
-y/-Y) the next attempt doesn't resume the transfer properly from what was
|
||||
downloaded in the previous attempt but will truncate and restart at the
|
||||
original position where it was at before the previous failed attempt. See
|
||||
http://curl.haxx.se/mail/lib-2008-01/0080.html and Mandriva bug report
|
||||
https://qa.mandriva.com/show_bug.cgi?id=22565
|
||||
|
||||
48. If a CONNECT response-headers are larger than BUFSIZE (16KB) when the
|
||||
connection is meant to be kept alive (like for NTLM proxy auth), the
|
||||
function will return prematurely and will confuse the rest of the HTTP
|
||||
@@ -43,23 +68,9 @@ may have been fixed since this was written!
|
||||
Also see #12. According to bug #1556528, even the SOCKS5 connect code does
|
||||
not do it right: http://curl.haxx.se/bug/view.cgi?id=1556528,
|
||||
|
||||
33. Doing multi-pass HTTP authentication on a non-default port does not work.
|
||||
This happens because the multi-pass code abuses the redirect following code
|
||||
for doing multiple requests, and when we following redirects to an absolute
|
||||
URL we must use the newly specified port and not the one specified in the
|
||||
original URL. A proper fix to this would need to separate the negotiation
|
||||
"redirect" from an actual redirect.
|
||||
|
||||
32. (At least on Windows) If libcurl is built with c-ares and there's no DNS
|
||||
server configured in the system, the ares_init() call fails and thus
|
||||
curl_easy_init() fails as well. This causes weird effects for people who use
|
||||
numerical IP addresses only.
|
||||
|
||||
31. "curl-config --libs" will include details set in LDFLAGS when configure is
|
||||
run that might be needed only for building libcurl. Similarly, it might
|
||||
include options that perhaps aren't suitable both for static and dynamic
|
||||
linking. Further, curl-config --cflags suffers from the same effects with
|
||||
CFLAGS/CPPFLAGS.
|
||||
run that might be needed only for building libcurl. Further, curl-config
|
||||
--cflags suffers from the same effects with CFLAGS/CPPFLAGS.
|
||||
|
||||
30. You need to use -g to the command line tool in order to use RFC2732-style
|
||||
IPv6 numerical addresses in URLs.
|
||||
|
@@ -1,21 +1,25 @@
|
||||
Peer SSL Certificate Verification
|
||||
=================================
|
||||
|
||||
libcurl performs peer SSL certificate verification by default. This is done by
|
||||
installing a default CA cert bundle on 'make install' (or similar), that CA
|
||||
bundle package is used by default on operations against SSL servers.
|
||||
libcurl performs peer SSL certificate verification by default. This is done
|
||||
by using CA cert bundle that the SSL library can use to make sure the peer's
|
||||
server certificate is valid.
|
||||
|
||||
If you communicate with HTTPS or FTPS servers using certificates that are
|
||||
signed by CAs present in the bundle, you can be sure that the remote server
|
||||
really is the one it claims to be.
|
||||
|
||||
If the remote server uses a self-signed certificate, if you don't install
|
||||
curl's CA cert bundle, if the server uses a certificate signed by a CA that
|
||||
isn't included in the bundle or if the remote host is an impostor
|
||||
Until 7.18.0, curl bundled a severely outdated ca bundle file that was
|
||||
installed by default. These days, the curl archives include no ca certs at
|
||||
all. You need to get them elsewhere. See below for example.
|
||||
|
||||
If the remote server uses a self-signed certificate, if you don't install a CA
|
||||
cert bundle, if the server uses a certificate signed by a CA that isn't
|
||||
included in the bundle you use or if the remote host is an impostor
|
||||
impersonating your favorite site, and you want to transfer files from this
|
||||
server, do one of the following:
|
||||
|
||||
1. Tell libcurl to *not* verify the peer. With libcurl you disable with with
|
||||
1. Tell libcurl to *not* verify the peer. With libcurl you disable this with
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||
|
||||
With the curl command line tool, you disable this with -k/--insecure.
|
||||
@@ -27,10 +31,8 @@ server, do one of the following:
|
||||
With the curl command line tool: --cacert [file]
|
||||
|
||||
3. Add the CA cert for your server to the existing default CA cert bundle.
|
||||
The default path of the CA bundle installed with the curl package is:
|
||||
/usr/local/share/curl/curl-ca-bundle.crt, which can be changed by running
|
||||
configure with the --with-ca-bundle option pointing out the path of your
|
||||
choice.
|
||||
The default path of the CA bundle used can be changed by running configure
|
||||
with the --with-ca-bundle option pointing out the path of your choice.
|
||||
|
||||
To do this, you need to get the CA cert for your server in PEM format and
|
||||
then append that to your CA cert bundle.
|
||||
@@ -48,8 +50,6 @@ server, do one of the following:
|
||||
o Append the 'outcert.pem' to the CA cert bundle or use it stand-alone
|
||||
as described below.
|
||||
|
||||
(Thanks to Frankie V for this description)
|
||||
|
||||
If you use the 'openssl' tool, this is one way to get extract the CA cert
|
||||
for a particular server:
|
||||
|
||||
@@ -64,8 +64,6 @@ server, do one of the following:
|
||||
cert_bundle or use it stand-alone as described. Just remember that the
|
||||
security is no better than the way you obtained the certificate.
|
||||
|
||||
(Thanks to Doug Kaufman for this description)
|
||||
|
||||
4. If you're using the curl command line tool, you can specify your own CA
|
||||
cert path by setting the environment variable CURL_CA_BUNDLE to the path
|
||||
of your choice.
|
||||
@@ -80,8 +78,9 @@ server, do one of the following:
|
||||
5. all directories along %PATH%
|
||||
|
||||
5. Get a better/different/newer CA cert bundle! One option is to extract the
|
||||
one a recent Mozilla browser uses, by following the instruction found
|
||||
here:
|
||||
one a recent Mozilla browser uses by running 'make ca-bundle' in the curl
|
||||
build tree root, or possibly download a version that was generated this
|
||||
way for you:
|
||||
|
||||
http://curl.haxx.se/docs/caextract.html
|
||||
|
||||
|
49
docs/THANKS
49
docs/THANKS
@@ -12,6 +12,8 @@ Albert Chin-A-Young
|
||||
Albert Choy
|
||||
Ale Vesely
|
||||
Aleksandar Milivojevic
|
||||
Alessandro Vesely
|
||||
Alex Fishman
|
||||
Alex Neblett
|
||||
Alex Suykov
|
||||
Alex aka WindEagle
|
||||
@@ -19,10 +21,12 @@ Alexander Kourakos
|
||||
Alexander Krasnostavsky
|
||||
Alexander Lazic
|
||||
Alexander Zhuravlev
|
||||
Alexey Pesternikov
|
||||
Alexey Simak
|
||||
Alexis Carvalho
|
||||
Allen Pulsifer
|
||||
Amol Pattekar
|
||||
Anatoli Tubman
|
||||
Anders Gustafsson
|
||||
Andi Jahja
|
||||
Andre Guibert de Bruet
|
||||
@@ -36,6 +40,7 @@ Andrew Biggs
|
||||
Andrew Bushnell
|
||||
Andrew Francis
|
||||
Andrew Fuller
|
||||
Andrew Moise
|
||||
Andrew Wansink
|
||||
Andr<EFBFBD>s Garc<72>a
|
||||
Andy Cedilnik
|
||||
@@ -65,6 +70,7 @@ Brent Beardsley
|
||||
Brian Akins
|
||||
Brian Dessent
|
||||
Brian R Duffy
|
||||
Brian Ulm
|
||||
Bruce Mitchener
|
||||
Bryan Henderson
|
||||
Bryan Kemp
|
||||
@@ -99,10 +105,12 @@ Dan Becker
|
||||
Dan C
|
||||
Dan Fandrich
|
||||
Dan Nelson
|
||||
Dan Petitt
|
||||
Dan Torop
|
||||
Dan Zitter
|
||||
Daniel Black
|
||||
Daniel Cater
|
||||
Daniel Egger
|
||||
Daniel Johnson
|
||||
Daniel Stenberg
|
||||
Daniel at touchtunes
|
||||
@@ -128,6 +136,7 @@ David Phillips
|
||||
David Shaw
|
||||
David Tarendash
|
||||
David Thiel
|
||||
David Wright
|
||||
David Yan
|
||||
Detlef Schmier
|
||||
Diego Casorran
|
||||
@@ -138,6 +147,8 @@ Dirk Eddelbuettel
|
||||
Dirk Manske
|
||||
Dmitriy Sergeyev
|
||||
Dmitry Bartsevich
|
||||
Dmitry Kurochkin
|
||||
Dmitry Popov
|
||||
Dmitry Rechkin
|
||||
Dolbneff A.V
|
||||
Domenico Andreoli
|
||||
@@ -154,11 +165,14 @@ Dylan Ellicott
|
||||
Dylan Salisbury
|
||||
Early Ehlinger
|
||||
Edin Kadribasic
|
||||
Eetu Ojanen
|
||||
Ellis Pritchard
|
||||
Emil Romanus
|
||||
Emiliano Ida
|
||||
Enrico Scholz
|
||||
Enrik Berkhan
|
||||
Eric Cooper
|
||||
Eric Landes
|
||||
Eric Lavigne
|
||||
Eric Melville
|
||||
Eric Rautman
|
||||
@@ -183,11 +197,14 @@ Frank Ticheler
|
||||
Fred New
|
||||
Fred Noz
|
||||
Frederic Lepied
|
||||
Gary Maxwell
|
||||
Gautam Kachroo
|
||||
Gautam Mani
|
||||
Gavrie Philipson
|
||||
Gaz Iqbal
|
||||
Georg Horn
|
||||
Georg Huettenegger
|
||||
Georg Lippitsch
|
||||
Georg Wicherski
|
||||
Gerd v. Egidy
|
||||
Gerhard Herre
|
||||
@@ -196,6 +213,7 @@ Giancarlo Formicuccia
|
||||
Giaslas Georgios
|
||||
Gilad
|
||||
Gilbert Ramirez Jr.
|
||||
Gilles Blanc
|
||||
Gisle Vanem
|
||||
Giuseppe Attardi
|
||||
Giuseppe D'Ambrosio
|
||||
@@ -226,9 +244,11 @@ Ian Gulliver
|
||||
Ian Turner
|
||||
Ian Wilkes
|
||||
Ignacio Vazquez-Abrams
|
||||
Igor Franchuk
|
||||
Igor Polyakov
|
||||
Ilguiz Latypov
|
||||
Ilja van Sprundel
|
||||
Immanuel Gregoire
|
||||
Ingmar Runge
|
||||
Ingo Ralf Blum
|
||||
Ingo Wilken
|
||||
@@ -256,15 +276,19 @@ Jean-Claude Chauve
|
||||
Jean-Louis Lemaire
|
||||
Jean-Marc Ranger
|
||||
Jean-Philippe Barrette-LaPierre
|
||||
Jeff Johnson
|
||||
Jeff Lawson
|
||||
Jeff Phillips
|
||||
Jeff Pohlmeyer
|
||||
Jeffrey Pohlmeyer
|
||||
Jeremy Friesner
|
||||
Jerome Muffat-Meridol
|
||||
Jes Badwal
|
||||
Jesper Jensen
|
||||
Jesse Noller
|
||||
Jim Drash
|
||||
Joe Halpin
|
||||
Joe Malicki
|
||||
Joel Chen
|
||||
Jofell Gallardo
|
||||
Johan Anderson
|
||||
@@ -274,6 +298,7 @@ John Janssen
|
||||
John Kelly
|
||||
John Lask
|
||||
John McGowan
|
||||
Johnny Luong
|
||||
Jon Grubbs
|
||||
Jon Travis
|
||||
Jon Turner
|
||||
@@ -285,6 +310,7 @@ Jose Kahan
|
||||
Josh Kapell
|
||||
Juan F. Codagnone
|
||||
Juan Ignacio Herv<72>s
|
||||
Judson Bishop
|
||||
Juergen Wilke
|
||||
Jukka Pihl
|
||||
Julian Noble
|
||||
@@ -298,6 +324,7 @@ Kai-Uwe Rommel
|
||||
Kang-Jin Lee
|
||||
Karl Moerder
|
||||
Karol Pietrzak
|
||||
Kaspar Brand
|
||||
Katie Wang
|
||||
Kees Cook
|
||||
Keith MacDonald
|
||||
@@ -307,7 +334,9 @@ Ken Rastatter
|
||||
Kent Boortz
|
||||
Kevin Fisk
|
||||
Kevin Lussier
|
||||
Kevin Reed
|
||||
Kevin Roth
|
||||
Kim Rinnewitz
|
||||
Kimmo Kinnunen
|
||||
Kjell Ericson
|
||||
Kjetil Jacobsen
|
||||
@@ -324,6 +353,7 @@ Lars Gustafsson
|
||||
Lars J. Aas
|
||||
Lars Nilsson
|
||||
Lars Torben Wilson
|
||||
Lau Hang Kin
|
||||
Legoff Vincent
|
||||
Lehel Bernadt
|
||||
Len Krause
|
||||
@@ -348,6 +378,7 @@ Marco G. Salvagno
|
||||
Marcus Webster
|
||||
Mario Schroeder
|
||||
Mark Butler
|
||||
Mark Davies
|
||||
Mark Eichin
|
||||
Mark Lentczner
|
||||
Markus Koetter
|
||||
@@ -360,6 +391,7 @@ Martin Skinner
|
||||
Marty Kuhrt
|
||||
Maruko
|
||||
Massimiliano Ziccardi
|
||||
Mateusz Loskot
|
||||
Mathias Axelsson
|
||||
Mats Lidell
|
||||
Matt Kraai
|
||||
@@ -368,9 +400,12 @@ Matt Witherspoon
|
||||
Matthew Blain
|
||||
Matthew Clarke
|
||||
Maurice Barnum
|
||||
Max Katsev
|
||||
Maxim Perenesenko
|
||||
Mekonikum
|
||||
Mettgut Jamalla
|
||||
Michael Benedict
|
||||
Michael Calmer
|
||||
Michael Curtis
|
||||
Michael Jahn
|
||||
Michael Jerris
|
||||
@@ -383,12 +418,14 @@ Mihai Ionescu
|
||||
Mikael Sennerholm
|
||||
Mike Bytnar
|
||||
Mike Dobbs
|
||||
Mike Hommey
|
||||
Mike Protts
|
||||
Miklos Nemeth
|
||||
Mitz Wark
|
||||
Mohamed Lrhazi
|
||||
Mohun Biswas
|
||||
Moonesamy
|
||||
Nathan Coulter
|
||||
Nathan O'Sullivan
|
||||
Nathanael Nerode
|
||||
Naveen Noel
|
||||
@@ -404,6 +441,8 @@ Nicolas Croiset
|
||||
Nicolas Fran<61>ois
|
||||
Niels van Tongeren
|
||||
Nikita Schmidt
|
||||
Nikitinskit Dmitriy
|
||||
Niklas Angebrand
|
||||
Nir Soffer
|
||||
Nis Jorgensen
|
||||
Nodak Sodak
|
||||
@@ -440,10 +479,12 @@ Peter Wullinger
|
||||
Peteris Krumins
|
||||
Phil Karn
|
||||
Philip Gladstone
|
||||
Philip Langdale
|
||||
Philippe Hameau
|
||||
Philippe Raoult
|
||||
Philippe Vaucher
|
||||
Pierre
|
||||
Pooyan McSporran
|
||||
Puneet Pawaia
|
||||
Quagmire
|
||||
Rafael Sagula
|
||||
@@ -453,6 +494,7 @@ Ralph Mitchell
|
||||
Ramana Mokkapati
|
||||
Randy McMurchy
|
||||
Ravi Pratap
|
||||
Ray Pekowski
|
||||
Reinout van Schouwen
|
||||
Renaud Chaillat
|
||||
Renaud Duhaut
|
||||
@@ -479,6 +521,7 @@ Robert Foreman
|
||||
Robert Iakobashvili
|
||||
Robert Olson
|
||||
Robert Weaver
|
||||
Robin Johnson
|
||||
Robin Kay
|
||||
Robson Braga Araujo
|
||||
Rodney Simmons
|
||||
@@ -494,6 +537,7 @@ Ryan Nelson
|
||||
S. Moonesamy
|
||||
Salvador D<>vila
|
||||
Salvatore Sorrentino
|
||||
Sam Listopad
|
||||
Sampo Kellomaki
|
||||
Samuel D<>az Garc<72>a
|
||||
Samuel Listopad
|
||||
@@ -514,12 +558,14 @@ Simon Josefsson
|
||||
Simon Liu
|
||||
Song Ma
|
||||
Sonia Subramanian
|
||||
Spacen Jasset
|
||||
Spiridonoff A.V
|
||||
Stadler Stephan
|
||||
Stefan Esser
|
||||
Stefan Krause
|
||||
Stefan Ulrich
|
||||
Stephan Bergmann
|
||||
Stephen Collyer
|
||||
Stephen Kick
|
||||
Stephen More
|
||||
Sterling Hughes
|
||||
@@ -571,10 +617,12 @@ Ulf H
|
||||
Ulrich Zadow
|
||||
Venkat Akella
|
||||
Victor Snezhko
|
||||
Vikram Saxena
|
||||
Vilmos Nebehaj
|
||||
Vincent Bronner
|
||||
Vincent Penquerc'h
|
||||
Vincent Sanders
|
||||
Vladimir Lazarenko
|
||||
Vojtech Janota
|
||||
Vojtech Minarik
|
||||
Walter J. Mack
|
||||
@@ -588,6 +636,7 @@ Xavier Bouchoux
|
||||
Yang Tse
|
||||
Yarram Sunil
|
||||
Yves Lejeune
|
||||
Zmey Petroff
|
||||
Zvi Har'El
|
||||
nk
|
||||
swalkaus at yahoo.com
|
||||
|
742
docs/TODO
742
docs/TODO
@@ -4,346 +4,598 @@
|
||||
| (__| |_| | _ <| |___
|
||||
\___|\___/|_| \_\_____|
|
||||
|
||||
TODO
|
||||
Things that could be nice to do in the future
|
||||
|
||||
Things to do in project cURL. Please tell us what you think, contribute and
|
||||
send us patches that improve things! Also check the http://curl.haxx.se/dev
|
||||
web section for various technical development notes.
|
||||
send us patches that improve things!
|
||||
|
||||
All bugs documented in the KNOWN_BUGS document are subject for fixing!
|
||||
|
||||
LIBCURL
|
||||
1. libcurl
|
||||
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
|
||||
|
||||
* Introduce another callback interface for upload/download that makes one
|
||||
less copy of data and thus a faster operation.
|
||||
[http://curl.haxx.se/dev/no_copy_callbacks.txt]
|
||||
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
|
||||
|
||||
* More data sharing. curl_share_* functions already exist and work, and they
|
||||
can be extended to share more. For example, enable sharing of the ares
|
||||
channel and the connection cache.
|
||||
3. Documentation
|
||||
3.1 More and better
|
||||
|
||||
* Introduce a new error code indicating authentication problems (for proxy
|
||||
CONNECT error 407 for example). This cannot be an error code, we must not
|
||||
return informational stuff as errors, consider a new info returned by
|
||||
curl_easy_getinfo() http://curl.haxx.se/bug/view.cgi?id=845941
|
||||
4. FTP
|
||||
4.1 PRET
|
||||
4.2 Alter passive/active on failure and retry
|
||||
4.3 Earlier bad letter detection
|
||||
4.4 REST for large files
|
||||
4.5 FTP proxy support
|
||||
4.6 PORT port range
|
||||
4.7 ASCII support
|
||||
|
||||
* Use 'struct lifreq' and SIOCGLIFADDR instead of 'struct ifreq' and
|
||||
SIOCGIFADDR on newer Solaris versions as they claim the latter is obsolete.
|
||||
To support ipv6 interface addresses properly.
|
||||
5. HTTP
|
||||
5.1 Other HTTP versions with CONNECT
|
||||
5.2 Better persistency for HTTP 1.0
|
||||
5.3 support FF3 sqlite cookie files
|
||||
|
||||
* 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. Suggested by Alan.
|
||||
6. TELNET
|
||||
6.1 ditch stdin
|
||||
6.2 ditch telnet-specific select
|
||||
6.3 feature negotiation debug data
|
||||
6.4 send data in chunks
|
||||
|
||||
* Add option that changes the interval in which the progress callback is
|
||||
called at most.
|
||||
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
|
||||
|
||||
* 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).
|
||||
8. GnuTLS
|
||||
8.1 Make NTLM work without OpenSSL functions
|
||||
8.2 SSL engine stuff
|
||||
8.3 SRP
|
||||
8.4 non-blocking
|
||||
8.5 check connection
|
||||
|
||||
* Make the curl/*.h 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).
|
||||
9. Other protocols
|
||||
9.1 ditch ldap-specific select
|
||||
|
||||
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
|
||||
10. New protocols
|
||||
10.1 RTSP
|
||||
10.2 RSYNC
|
||||
10.3 RTMP
|
||||
|
||||
LIBCURL - multi interface
|
||||
11. Client
|
||||
11.1 Content-Disposition
|
||||
11.2 sync
|
||||
11.3 glob posts
|
||||
11.4 prevent file overwriting
|
||||
11.5 ftp wildcard download
|
||||
11.6 simultaneous parallel transfers
|
||||
11.7 provide formpost headers
|
||||
11.8 url-specific options
|
||||
11.9 metalink support
|
||||
11.10 warning when setting an option
|
||||
|
||||
* Make sure we don't ever loop because of non-blocking sockets return
|
||||
EWOULDBLOCK or similar. The GnuTLS connection etc.
|
||||
12. Build
|
||||
12.1 roffit
|
||||
|
||||
* 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.
|
||||
13. Test suite
|
||||
13.1 SSL tunnel
|
||||
13.2 nicer lacking perl message
|
||||
13.3 more protocols supported
|
||||
13.4 more platforms supported
|
||||
|
||||
* 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
|
||||
transfer is done, then detach the easy handle, destroy the multi handle and
|
||||
return the easy handle's return code. This will thus make everything
|
||||
internally use and assume the multi interface. The select()-loop should use
|
||||
curl_multi_socket().
|
||||
14. Next SONAME bump
|
||||
14.1 http-style HEAD output for ftp
|
||||
14.2 combine error codes
|
||||
14.3 extend CURLOPT_SOCKOPTFUNCTION prototype
|
||||
|
||||
* curl_multi_handle_control() - this can control the easy handle (while)
|
||||
added to a multi handle in various ways:
|
||||
o RESTART, unconditionally restart this easy handle's transfer from the
|
||||
start, re-init the state
|
||||
o RESTART_COMPLETED, restart this easy handle's transfer but only if the
|
||||
existing transfer has already completed and it is in a "finished state".
|
||||
o STOP, just stop this transfer and consider it completed
|
||||
o PAUSE?
|
||||
o RESUME?
|
||||
15. Next major release
|
||||
15.1 cleanup return codes
|
||||
15.2 remove obsolete defines
|
||||
15.3 size_t
|
||||
15.4 remove several functions
|
||||
15.5 remove CURLOPT_FAILONERROR
|
||||
15.6 remove CURLOPT_DNS_USE_GLOBAL_CACHE
|
||||
|
||||
DOCUMENTATION
|
||||
==============================================================================
|
||||
|
||||
* More and better
|
||||
1. libcurl
|
||||
|
||||
FTP
|
||||
1.1 Zero-copy interface
|
||||
|
||||
* PRET is a command that primarily "drftpd" supports, which could be useful
|
||||
when using libcurl against such a server. It is a non-standard and a rather
|
||||
oddly designed command, but...
|
||||
http://curl.haxx.se/bug/feature.cgi?id=1729967
|
||||
Introduce another callback interface for upload/download that makes one less
|
||||
copy of data and thus a faster operation.
|
||||
[http://curl.haxx.se/dev/no_copy_callbacks.txt]
|
||||
|
||||
* When trying to connect passively to a server which only supports active
|
||||
connections, libcurl returns CURLE_FTP_WEIRD_PASV_REPLY and closes the
|
||||
connection. There could be a way to fallback to an active connection (and
|
||||
vice versa). http://curl.haxx.se/bug/feature.cgi?id=1754793
|
||||
1.2 More data sharing
|
||||
|
||||
* Make the detection of (bad) %0d and %0a codes in FTP url parts earlier in
|
||||
the process to avoid doing a resolve and connect in vain.
|
||||
curl_share_* functions already exist and work, and they can be extended to
|
||||
share more. For example, enable sharing of the ares channel and the
|
||||
connection cache.
|
||||
|
||||
* REST fix for servers not behaving well on >2GB requests. This should fail
|
||||
if the server doesn't set the pointer to the requested index. The tricky
|
||||
(impossible?) part is to figure out if the server did the right thing or
|
||||
not.
|
||||
1.3 struct lifreq
|
||||
|
||||
* Support the most common FTP proxies, Philip Newton provided a list
|
||||
allegedly from ncftp:
|
||||
http://curl.haxx.se/mail/archive-2003-04/0126.html
|
||||
Use 'struct lifreq' and SIOCGLIFADDR instead of 'struct ifreq' and
|
||||
SIOCGIFADDR on newer Solaris versions as they claim the latter is obsolete.
|
||||
To support ipv6 interface addresses for network interfaces properly.
|
||||
|
||||
* Make CURLOPT_FTPPORT support an additional port number on the IP/if/name,
|
||||
like "blabla:[port]" or possibly even "blabla:[portfirst]-[portsecond]".
|
||||
http://curl.haxx.se/bug/feature.cgi?id=1505166
|
||||
1.4 Get IP address
|
||||
|
||||
* FTP ASCII transfers do not follow RFC959. They don't convert the data
|
||||
accordingly.
|
||||
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.
|
||||
|
||||
* Since USERPWD always override the user and password specified in URLs, we
|
||||
might need another way to specify user+password for anonymous ftp logins.
|
||||
1.5 c-ares ipv6
|
||||
|
||||
* The FTP code should get a way of returning errors that is known to still
|
||||
have the control connection alive and sound. Currently, a returned error
|
||||
from within ftp-functions does not tell if the control connection is still
|
||||
OK to use or not. This causes libcurl to fail to re-use connections
|
||||
slightly too often.
|
||||
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).
|
||||
|
||||
HTTP
|
||||
1.6 configure-based info in public headers
|
||||
|
||||
* 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.
|
||||
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).
|
||||
|
||||
* "Better" support for persistent connections over HTTP 1.0
|
||||
http://curl.haxx.se/bug/feature.cgi?id=1089001
|
||||
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
|
||||
|
||||
TELNET
|
||||
The remaining problems to solve involve the platforms that can't run
|
||||
configure.
|
||||
|
||||
* Reading input (to send to the remote server) on stdin is a crappy solution
|
||||
for library purposes. We need to invent a good way for the application to
|
||||
be able to provide the data to send.
|
||||
2. libcurl - multi interface
|
||||
|
||||
* Move the telnet support's network select() loop go away and merge the code
|
||||
into the main transfer loop. Until this is done, the multi interface won't
|
||||
work for telnet.
|
||||
2.1 More non-blocking
|
||||
|
||||
SSL
|
||||
Make sure we don't ever loop because of non-blocking sockets return
|
||||
EWOULDBLOCK or similar. The GnuTLS connection etc.
|
||||
|
||||
* Provide an option that allows for disabling specific SSL versions, such as
|
||||
SSLv2 http://curl.haxx.se/bug/feature.cgi?id=1767276
|
||||
2.2 Pause transfers
|
||||
|
||||
* 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.
|
||||
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.
|
||||
|
||||
* Anton Fedorov's "dumpcert" patch:
|
||||
http://curl.haxx.se/mail/lib-2004-03/0088.html
|
||||
2.3 Remove easy interface internally
|
||||
|
||||
* Evaluate/apply Gertjan van Wingerde's SSL patches:
|
||||
http://curl.haxx.se/mail/lib-2004-03/0087.html
|
||||
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
|
||||
transfer is done, then detach the easy handle, destroy the multi handle and
|
||||
return the easy handle's return code. This will thus make everything
|
||||
internally use and assume the multi interface. The select()-loop should use
|
||||
curl_multi_socket().
|
||||
|
||||
* "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 once per handle)". The major improvement we can rather easily do is to
|
||||
make sure we don't create and kill a new SSL "context" for every request,
|
||||
but instead make one for every connection and re-use that SSL context in
|
||||
the same 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.
|
||||
2.4 Avoid having to remove/readd handles
|
||||
|
||||
* Add an interface to libcurl that enables "session IDs" to get
|
||||
exported/imported. Cris Bailiff said: "OpenSSL has functions which can
|
||||
serialise the current SSL state to a buffer of your choice, and
|
||||
recover/reset 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".
|
||||
curl_multi_handle_control() - this can control the easy handle (while) added
|
||||
to a multi handle in various ways:
|
||||
|
||||
* 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! (brought by Chris
|
||||
Clark)
|
||||
o RESTART, unconditionally restart this easy handle's transfer from the
|
||||
start, re-init the state
|
||||
|
||||
* Make curl's SSL layer capable of using other free SSL libraries. Such as
|
||||
MatrixSSL (http://www.matrixssl.org/).
|
||||
o RESTART_COMPLETED, restart this easy handle's transfer but only if the
|
||||
existing transfer has already completed and it is in a "finished state".
|
||||
|
||||
* 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.
|
||||
o STOP, just stop this transfer and consider it completed
|
||||
|
||||
* make the configure --with-ssl option first check for OpenSSL, then GnuTLS,
|
||||
then NSS...
|
||||
o PAUSE?
|
||||
|
||||
GnuTLS
|
||||
o RESUME?
|
||||
|
||||
* Get NTLM working using the functions provided by libgcrypt, since GnuTLS
|
||||
already depends on that to function. Not strictly SSL/TLS related, but
|
||||
hey... Another option is to get available DES and MD4 source code from the
|
||||
cryptopp library. They are fine license-wise, but are C++.
|
||||
3. Documentation
|
||||
|
||||
* SSL engine stuff?
|
||||
3.1 More and better
|
||||
|
||||
* Work out a common method with Peter Sylvester's OpenSSL-patch for SRP
|
||||
on the TLS to provide name and password
|
||||
Exactly
|
||||
|
||||
* Fix the connection phase to be non-blocking when multi interface is used
|
||||
4. FTP
|
||||
|
||||
* Add a way to check if the connection seems to be alive, to correspond to
|
||||
the SSL_peak() way we use with OpenSSL.
|
||||
4.1 PRET
|
||||
|
||||
LDAP
|
||||
PRET is a command that primarily "drftpd" supports, which could be useful
|
||||
when using libcurl against such a server. It is a non-standard and a rather
|
||||
oddly designed command, but...
|
||||
http://curl.haxx.se/bug/feature.cgi?id=1729967
|
||||
|
||||
4.2 Alter passive/active on failure and retry
|
||||
|
||||
When trying to connect passively to a server which only supports active
|
||||
connections, libcurl returns CURLE_FTP_WEIRD_PASV_REPLY and closes the
|
||||
connection. There could be a way to fallback to an active connection (and
|
||||
vice versa). http://curl.haxx.se/bug/feature.cgi?id=1754793
|
||||
|
||||
4.3 Earlier bad letter detection
|
||||
|
||||
Make the detection of (bad) %0d and %0a codes in FTP url parts earlier in the
|
||||
process to avoid doing a resolve and connect in vain.
|
||||
|
||||
4.4 REST for large files
|
||||
|
||||
REST fix for servers not behaving well on >2GB requests. This should fail if
|
||||
the server doesn't set the pointer to the requested index. The tricky
|
||||
(impossible?) part is to figure out if the server did the right thing or not.
|
||||
|
||||
4.5 FTP proxy support
|
||||
|
||||
Support the most common FTP proxies, Philip Newton provided a list allegedly
|
||||
from ncftp. This is not a subject without debate, and is probably not really
|
||||
suitable for libcurl. http://curl.haxx.se/mail/archive-2003-04/0126.html
|
||||
|
||||
4.6 PORT port range
|
||||
|
||||
Make CURLOPT_FTPPORT support an additional port number on the IP/if/name,
|
||||
like "blabla:[port]" or possibly even "blabla:[portfirst]-[portsecond]".
|
||||
http://curl.haxx.se/bug/feature.cgi?id=1505166
|
||||
|
||||
4.7 ASCII support
|
||||
|
||||
FTP ASCII transfers do not follow RFC959. They don't convert the data
|
||||
accordingly.
|
||||
|
||||
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
|
||||
|
||||
"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
|
||||
|
||||
Firefox 3 is changing from its former format to a a sqlite database instead.
|
||||
We should consider how (lib)curl can/should support this.
|
||||
http://curl.haxx.se/bug/feature.cgi?id=1871388
|
||||
|
||||
6. TELNET
|
||||
|
||||
6.1 ditch stdin
|
||||
|
||||
Reading input (to send to the remote server) on stdin is a crappy solution for
|
||||
library purposes. We need to invent a good way for the application to be able
|
||||
to provide the data to send.
|
||||
|
||||
6.2 ditch telnet-specific select
|
||||
|
||||
Move the telnet support's network select() loop go away and merge the code
|
||||
into the main transfer loop. Until this is done, the multi interface won't
|
||||
work for telnet.
|
||||
|
||||
6.3 feature negotiation debug data
|
||||
|
||||
Add telnet feature negotiation data to the debug callback as header data.
|
||||
|
||||
6.4 send data in chunks
|
||||
|
||||
Currently, telnet sends data one byte at a time. This is fine for interactive
|
||||
use, but inefficient for any other. Sent data should be sent in larger
|
||||
chunks.
|
||||
|
||||
7. SSL
|
||||
|
||||
7.1 Disable specific versions
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
Evaluate/apply Gertjan van Wingerde's SSL patches:
|
||||
http://curl.haxx.se/mail/lib-2004-03/0087.html
|
||||
|
||||
7.5 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
|
||||
once per handle)". The major improvement we can rather easily do is to make
|
||||
sure we don't create and kill a new SSL "context" for every request, but
|
||||
instead make one for every connection and re-use that SSL context in the same
|
||||
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
|
||||
|
||||
Add an interface to libcurl that enables "session IDs" to get
|
||||
exported/imported. Cris Bailiff said: "OpenSSL has functions which can
|
||||
serialise the current SSL state to a buffer of your choice, and recover/reset
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
make the configure --with-ssl option first check for OpenSSL, then GnuTLS,
|
||||
then NSS...
|
||||
|
||||
8. GnuTLS
|
||||
|
||||
8.1 Make NTLM work without OpenSSL functions
|
||||
|
||||
Get NTLM working using the functions provided by libgcrypt, since GnuTLS
|
||||
already depends on that to function. Not strictly SSL/TLS related, but
|
||||
hey... Another option is to get available DES and MD4 source code from the
|
||||
cryptopp library. They are fine license-wise, but are C++.
|
||||
|
||||
8.2 SSL engine stuff
|
||||
|
||||
Is this even possible?
|
||||
|
||||
8.3 SRP
|
||||
|
||||
Work out a common method with Peter Sylvester's OpenSSL-patch for SRP on the
|
||||
TLS to provide name and password. GnuTLS already supports it...
|
||||
|
||||
8.4 non-blocking
|
||||
|
||||
Fix the connection phase to be non-blocking when multi interface is used
|
||||
|
||||
8.5 check connection
|
||||
|
||||
Add a way to check if the connection seems to be alive, to correspond to the
|
||||
SSL_peak() way we use with OpenSSL.
|
||||
|
||||
9. Other protocols
|
||||
|
||||
9.1 ditch ldap-specific select
|
||||
|
||||
* Look over the implementation. The looping will have to "go away" from the
|
||||
lib/ldap.c source file and get moved to the main network code so that the
|
||||
multi interface and friends will work for LDAP as well.
|
||||
|
||||
NEW PROTOCOLS
|
||||
9.2 stop TFTP blocking
|
||||
|
||||
* RTSP - RFC2326 (protocol - very HTTP-like, also contains URL description)
|
||||
Stop TFTP from being blocking and doing its own read loop in tftp_do.
|
||||
|
||||
* RSYNC (no RFCs for protocol nor URI/URL format). An implementation should
|
||||
most probably use an existing rsync library, such as librsync.
|
||||
10. New protocols
|
||||
|
||||
CLIENT
|
||||
10.1 RTSP
|
||||
|
||||
* Add option that is similar to -O but that takes the output file name from
|
||||
the Content-Disposition: header, and/or uses the local file name used in
|
||||
redirections for the cases the server bounces the request further to a
|
||||
different file (name): http://curl.haxx.se/bug/feature.cgi?id=1364676
|
||||
RFC2326 (protocol - very HTTP-like, also contains URL description)
|
||||
|
||||
* "curl --sync http://example.com/feed[1-100].rss" or
|
||||
"curl --sync http://example.net/{index,calendar,history}.html"
|
||||
10.2 RSYNC
|
||||
|
||||
Downloads a range or set of URLs using the remote name, but only if the
|
||||
remote file is newer than the local file. A Last-Modified HTTP date header
|
||||
should also be used to set the mod date on the downloaded file.
|
||||
(idea from "Brianiac")
|
||||
There's no RFC for protocol nor URI/URL format. An implementation should
|
||||
most probably use an existing rsync library, such as librsync.
|
||||
|
||||
* Globbing support for -d and -F, as in 'curl -d "name=foo[0-9]" URL'.
|
||||
Requested by Dane Jensen and others. This is easily scripted though.
|
||||
10.3 RTMP
|
||||
|
||||
* Add an option that prevents cURL from overwriting existing local files. When
|
||||
used, and there already is an existing file with the target file name
|
||||
(either -O or -o), a number should be appended (and increased if already
|
||||
existing). So that index.html becomes first index.html.1 and then
|
||||
index.html.2 etc. Jeff Pohlmeyer suggested.
|
||||
There exists a patch that claims to introduce this protocol:
|
||||
http://osdir.com/ml/gnu.gnash.devel2/2006-11/msg00278.html, further details
|
||||
in the feature-request: http://curl.haxx.se/bug/feature.cgi?id=1843469
|
||||
|
||||
* "curl ftp://site.com/*.txt"
|
||||
11. Client
|
||||
|
||||
* The client could be told to use maximum N simultaneous parallel transfers
|
||||
and then just make sure that happens. It should of course not make more
|
||||
than one connection to the same remote host. This would require the client
|
||||
to use the multi interface. http://curl.haxx.se/bug/feature.cgi?id=1558595
|
||||
11.1 Content-Disposition
|
||||
|
||||
* Extending the capabilities of the multipart formposting. How about leaving
|
||||
the ';type=foo' syntax as it is and adding an extra tag (headers) which
|
||||
works like this: curl -F "coolfiles=@fil1.txt;headers=@fil1.hdr" where
|
||||
fil1.hdr contains extra headers like
|
||||
Add option that is similar to -O but that takes the output file name from the
|
||||
Content-Disposition: header, and/or uses the local file name used in
|
||||
redirections for the cases the server bounces the request further to a
|
||||
different file (name): http://curl.haxx.se/bug/feature.cgi?id=1364676
|
||||
|
||||
Content-Type: text/plain; charset=KOI8-R"
|
||||
Content-Transfer-Encoding: base64
|
||||
X-User-Comment: Please don't use browser specific HTML code
|
||||
11.2 sync
|
||||
|
||||
which should overwrite the program reasonable defaults (plain/text,
|
||||
8bit...) (Idea brough to us by kromJx)
|
||||
"curl --sync http://example.com/feed[1-100].rss" or
|
||||
"curl --sync http://example.net/{index,calendar,history}.html"
|
||||
|
||||
* ability to specify the classic computing suffixes on the range
|
||||
specifications. For example, to download the first 500 Kilobytes of a file,
|
||||
be able to specify the following for the -r option: "-r 0-500K" or for the
|
||||
first 2 Megabytes of a file: "-r 0-2M". (Mark Smith suggested)
|
||||
Downloads a range or set of URLs using the remote name, but only if the
|
||||
remote file is newer than the local file. A Last-Modified HTTP date header
|
||||
should also be used to set the mod date on the downloaded file.
|
||||
|
||||
* --data-encode that URL encodes the data before posting
|
||||
http://curl.haxx.se/mail/archive-2003-11/0091.html (Kevin Roth suggested)
|
||||
11.3 glob posts
|
||||
|
||||
* Provide a way to make options bound to a specific URL among several on the
|
||||
command line. Possibly by letting ':' separate options between URLs,
|
||||
similar to this:
|
||||
Globbing support for -d and -F, as in 'curl -d "name=foo[0-9]" URL'.
|
||||
This is easily scripted though.
|
||||
|
||||
curl --data foo --url url.com : \
|
||||
--url url2.com : \
|
||||
--url url3.com --data foo3
|
||||
11.4 prevent file overwriting
|
||||
|
||||
(More details: http://curl.haxx.se/mail/archive-2004-07/0133.html)
|
||||
Add an option that prevents cURL from overwriting existing local files. When
|
||||
used, and there already is an existing file with the target file name
|
||||
(either -O or -o), a number should be appended (and increased if already
|
||||
existing). So that index.html becomes first index.html.1 and then
|
||||
index.html.2 etc.
|
||||
|
||||
The example would do a POST-GET-POST combination on a single command line.
|
||||
11.5 ftp wildcard download
|
||||
|
||||
BUILD
|
||||
"curl ftp://site.com/*.txt"
|
||||
|
||||
* Consider extending 'roffit' to produce decent ASCII output, and use that
|
||||
instead of (g)nroff when building src/hugehelp.c
|
||||
11.6 simultaneous parallel transfers
|
||||
|
||||
TEST SUITE
|
||||
The client could be told to use maximum N simultaneous parallel transfers and
|
||||
then just make sure that happens. It should of course not make more than one
|
||||
connection to the same remote host. This would require the client to use the
|
||||
multi interface. http://curl.haxx.se/bug/feature.cgi?id=1558595
|
||||
|
||||
* Make our own version of stunnel for simple port forwarding to enable HTTPS
|
||||
and FTP-SSL tests without the stunnel dependency, and it could allow us to
|
||||
provide test tools built with either OpenSSL or GnuTLS
|
||||
11.7 provide formpost headers
|
||||
|
||||
* If perl wasn't found by the configure script, don't attempt to run the
|
||||
tests but explain something nice why it doesn't.
|
||||
Extending the capabilities of the multipart formposting. How about leaving
|
||||
the ';type=foo' syntax as it is and adding an extra tag (headers) which
|
||||
works like this: curl -F "coolfiles=@fil1.txt;headers=@fil1.hdr" where
|
||||
fil1.hdr contains extra headers like
|
||||
|
||||
* Extend the test suite to include more protocols. The telnet could just do
|
||||
ftp or http operations (for which we have test servers).
|
||||
Content-Type: text/plain; charset=KOI8-R"
|
||||
Content-Transfer-Encoding: base64
|
||||
X-User-Comment: Please don't use browser specific HTML code
|
||||
|
||||
* Make the test suite work on more platforms. OpenBSD and Mac OS. Remove
|
||||
fork()s and it should become even more portable.
|
||||
which should overwrite the program reasonable defaults (plain/text,
|
||||
8bit...)
|
||||
|
||||
NEXT soname bump
|
||||
11.8 url-specific options
|
||||
|
||||
* #undef CURL_FTP_HTTPSTYLE_HEAD in lib/ftp.c to remove the HTTP-style headers
|
||||
from being output in NOBODY requests over ftp
|
||||
Provide a way to make options bound to a specific URL among several on the
|
||||
command line. Possibly by letting ':' separate options between URLs,
|
||||
similar to this:
|
||||
|
||||
* Combine some of the error codes to remove duplicates. The original
|
||||
numbering should not be changed, and the old identifiers would be
|
||||
macroed to the new ones in an CURL_NO_OLDIES section to help with
|
||||
backward compatibility.
|
||||
curl --data foo --url url.com : \
|
||||
--url url2.com : \
|
||||
--url url3.com --data foo3
|
||||
|
||||
Candidates for removal and their replacements:
|
||||
(More details: http://curl.haxx.se/mail/archive-2004-07/0133.html)
|
||||
|
||||
CURLE_FILE_COULDNT_READ_FILE => CURLE_REMOTE_FILE_NOT_FOUND
|
||||
CURLE_FTP_COULDNT_RETR_FILE => CURLE_REMOTE_FILE_NOT_FOUND
|
||||
CURLE_FTP_COULDNT_USE_REST => CURLE_RANGE_ERROR
|
||||
CURLE_FUNCTION_NOT_FOUND => CURLE_FAILED_INIT
|
||||
CURLE_LDAP_INVALID_URL => CURLE_URL_MALFORMAT
|
||||
CURLE_TFTP_NOSUCHUSER => CURLE_TFTP_ILLEGAL
|
||||
CURLE_TFTP_NOTFOUND => CURLE_REMOTE_FILE_NOT_FOUND
|
||||
CURLE_TFTP_PERM => CURLE_REMOTE_ACCESS_DENIED
|
||||
The example would do a POST-GET-POST combination on a single command line.
|
||||
|
||||
NEXT MAJOR RELEASE
|
||||
11.9 metalink support
|
||||
|
||||
* curl_easy_cleanup() returns void, but curl_multi_cleanup() returns a
|
||||
CURLMcode. These should be changed to be the same.
|
||||
Add metalink support to curl (http://www.metalinker.org/). This is most useful
|
||||
with simultaneous parallel transfers (11.6) but not necessary.
|
||||
|
||||
* remove obsolete defines from curl/curl.h
|
||||
11.10 warning when setting an option
|
||||
|
||||
* make several functions use size_t instead of int in their APIs
|
||||
Display a warning when libcurl returns an error when setting an option.
|
||||
This can be useful to tell when support for a particular feature hasn't been
|
||||
compiled into the library.
|
||||
|
||||
* remove the following functions from the public API:
|
||||
curl_getenv
|
||||
curl_mprintf (and variations)
|
||||
curl_strequal
|
||||
curl_strnequal
|
||||
12. Build
|
||||
|
||||
They will instead become curlx_ - alternatives. That makes the curl app
|
||||
still capable of building with them from source.
|
||||
12.1 roffit
|
||||
|
||||
* Remove support for CURLOPT_FAILONERROR, it has gotten too kludgy and weird
|
||||
internally. Let the app judge success or not for itself.
|
||||
Consider extending 'roffit' to produce decent ASCII output, and use that
|
||||
instead of (g)nroff when building src/hugehelp.c
|
||||
|
||||
13. Test suite
|
||||
|
||||
13.1 SSL tunnel
|
||||
|
||||
Make our own version of stunnel for simple port forwarding to enable HTTPS
|
||||
and FTP-SSL tests without the stunnel dependency, and it could allow us to
|
||||
provide test tools built with either OpenSSL or GnuTLS
|
||||
|
||||
13.2 nicer lacking perl message
|
||||
|
||||
If perl wasn't found by the configure script, don't attempt to run the tests
|
||||
but explain something nice why it doesn't.
|
||||
|
||||
13.3 more protocols supported
|
||||
|
||||
Extend the test suite to include more protocols. The telnet could just do ftp
|
||||
or http operations (for which we have test servers).
|
||||
|
||||
13.4 more platforms supported
|
||||
|
||||
Make the test suite work on more platforms. OpenBSD and Mac OS. Remove
|
||||
fork()s and it should become even more portable.
|
||||
|
||||
14. Next SONAME bump
|
||||
|
||||
14.1 http-style HEAD output for ftp
|
||||
|
||||
#undef CURL_FTP_HTTPSTYLE_HEAD in lib/ftp.c to remove the HTTP-style headers
|
||||
from being output in NOBODY requests over ftp
|
||||
|
||||
14.2 combine error codes
|
||||
|
||||
Combine some of the error codes to remove duplicates. The original
|
||||
numbering should not be changed, and the old identifiers would be
|
||||
macroed to the new ones in an CURL_NO_OLDIES section to help with
|
||||
backward compatibility.
|
||||
|
||||
Candidates for removal and their replacements:
|
||||
|
||||
CURLE_FILE_COULDNT_READ_FILE => CURLE_REMOTE_FILE_NOT_FOUND
|
||||
CURLE_FTP_COULDNT_RETR_FILE => CURLE_REMOTE_FILE_NOT_FOUND
|
||||
CURLE_FTP_COULDNT_USE_REST => CURLE_RANGE_ERROR
|
||||
CURLE_FUNCTION_NOT_FOUND => CURLE_FAILED_INIT
|
||||
CURLE_LDAP_INVALID_URL => CURLE_URL_MALFORMAT
|
||||
CURLE_TFTP_NOSUCHUSER => CURLE_TFTP_ILLEGAL
|
||||
CURLE_TFTP_NOTFOUND => CURLE_REMOTE_FILE_NOT_FOUND
|
||||
CURLE_TFTP_PERM => CURLE_REMOTE_ACCESS_DENIED
|
||||
|
||||
14.3 extend CURLOPT_SOCKOPTFUNCTION prototype
|
||||
|
||||
The current prototype only provides 'purpose' that tells what the
|
||||
connection/socket is for, but not any protocol or similar. It makes it hard
|
||||
for applications to differentiate on TCP vs UDP and even HTTP vs FTP and
|
||||
similar.
|
||||
|
||||
15. Next major release
|
||||
|
||||
15.1 cleanup return codes
|
||||
|
||||
curl_easy_cleanup() returns void, but curl_multi_cleanup() returns a
|
||||
CURLMcode. These should be changed to be the same.
|
||||
|
||||
15.2 remove obsolete defines
|
||||
|
||||
remove obsolete defines from curl/curl.h
|
||||
|
||||
15.3 size_t
|
||||
|
||||
make several functions use size_t instead of int in their APIs
|
||||
|
||||
15.4 remove several functions
|
||||
|
||||
remove the following functions from the public API:
|
||||
|
||||
curl_getenv
|
||||
|
||||
curl_mprintf (and variations)
|
||||
|
||||
curl_strequal
|
||||
|
||||
curl_strnequal
|
||||
|
||||
They will instead become curlx_ - alternatives. That makes the curl app
|
||||
still capable of building with them from source.
|
||||
|
||||
15.5 remove CURLOPT_FAILONERROR
|
||||
|
||||
Remove support for CURLOPT_FAILONERROR, it has gotten too kludgy and weird
|
||||
internally. Let the app judge success or not for itself.
|
||||
|
||||
15.6 remove CURLOPT_DNS_USE_GLOBAL_CACHE
|
||||
|
||||
Remove support for a global DNS cache. Anything global is silly, and we
|
||||
already offer the share interface for the same functionality but done
|
||||
"right".
|
||||
|
@@ -1,5 +1,5 @@
|
||||
Online: http://curl.haxx.se/docs/httpscripting.html
|
||||
Date: December 9, 2004
|
||||
Date: May 28, 2008
|
||||
|
||||
The Art Of Scripting HTTP Requests Using Curl
|
||||
=============================================
|
||||
@@ -137,6 +137,10 @@ Date: December 9, 2004
|
||||
you need to replace that space with %20 etc. Failing to comply with this
|
||||
will most likely cause your data to be received wrongly and messed up.
|
||||
|
||||
Recent curl versions can in fact url-encode POST data for you, like this:
|
||||
|
||||
curl --data-urlencode "name=I am Daniel" www.example.com
|
||||
|
||||
4.3 File Upload POST
|
||||
|
||||
Back in late 1995 they defined an additional way to post data over HTTP. It
|
||||
@@ -202,14 +206,14 @@ Date: December 9, 2004
|
||||
|
||||
curl -T uploadfile www.uploadhttp.com/receive.cgi
|
||||
|
||||
6. Authentication
|
||||
6. HTTP Authentication
|
||||
|
||||
Authentication is the ability to tell the server your username and password
|
||||
so that it can verify that you're allowed to do the request you're doing. The
|
||||
Basic authentication used in HTTP (which is the type curl uses by default) is
|
||||
*plain* *text* based, which means it sends username and password only
|
||||
slightly obfuscated, but still fully readable by anyone that sniffs on the
|
||||
network between you and the remote server.
|
||||
HTTP Authentication is the ability to tell the server your username and
|
||||
password so that it can verify that you're allowed to do the request you're
|
||||
doing. The Basic authentication used in HTTP (which is the type curl uses by
|
||||
default) is *plain* *text* based, which means it sends username and password
|
||||
only slightly obfuscated, but still fully readable by anyone that sniffs on
|
||||
the network between you and the remote server.
|
||||
|
||||
To tell curl to use a user and password for authentication:
|
||||
|
||||
@@ -237,6 +241,10 @@ Date: December 9, 2004
|
||||
able to watch your passwords if you pass them as plain command line
|
||||
options. There are ways to circumvent this.
|
||||
|
||||
It is worth noting that while this is how HTTP Authentication works, very
|
||||
many web sites will not use this concept when they provide logins etc. See
|
||||
the Web Login chapter further below for more details on that.
|
||||
|
||||
7. Referer
|
||||
|
||||
A HTTP request may include a 'referer' field (yes it is misspelled), which
|
||||
@@ -407,7 +415,37 @@ Date: December 9, 2004
|
||||
|
||||
curl -H "Destination: http://moo.com/nowhere" http://url.com
|
||||
|
||||
13. Debug
|
||||
13. Web Login
|
||||
|
||||
While not strictly just HTTP related, it still cause a lot of people problems
|
||||
so here's the executive run-down of how the vast majority of all login forms
|
||||
work and how to login to them using curl.
|
||||
|
||||
It can also be noted that to do this properly in an automated fashion, you
|
||||
will most certainly need to script things and do multiple curl invokes etc.
|
||||
|
||||
First, servers mostly use cookies to track the logged-in status of the
|
||||
client, so you will need to capture the cookies you receive in the
|
||||
responses. Then, many sites also set a special cookie on the login page (to
|
||||
make sure you got there through their login page) so you should make a habit
|
||||
of first getting the login-form page to capture the cookies set there.
|
||||
|
||||
Some web-based login systems features various amounts of javascript, and
|
||||
sometimes they use such code to set or modify cookie contents. Possibly they
|
||||
do that to prevent programmed logins, like this manual describes how to...
|
||||
Anyway, if reading the code isn't enough to let you repeat the behavior
|
||||
manually, capturing the HTTP requests done by your browers and analyzing the
|
||||
sent cookies is usually a working method to work out how to shortcut the
|
||||
javascript need.
|
||||
|
||||
In the actual <form> tag for the login, lots of sites fill-in random/session
|
||||
or otherwise secretly generated hidden tags and you may need to first capture
|
||||
the HTML code for the login form and extract all the hidden fields to be able
|
||||
to do a proper login POST. Remember that the contents need to be URL encoded
|
||||
when sent in a normal POST.
|
||||
|
||||
|
||||
14. Debug
|
||||
|
||||
Many times when you run curl on a site, you'll notice that the site doesn't
|
||||
seem to respond the same way to your curl requests as it does to your
|
||||
@@ -437,7 +475,7 @@ Date: December 9, 2004
|
||||
such as ethereal or tcpdump and check what headers that were sent and
|
||||
received by the browser. (HTTPS makes this technique inefficient.)
|
||||
|
||||
14. References
|
||||
15. References
|
||||
|
||||
RFC 2616 is a must to read if you want in-depth understanding of the HTTP
|
||||
protocol.
|
||||
|
176
docs/curl.1
176
docs/curl.1
@@ -5,7 +5,7 @@
|
||||
.\" * | (__| |_| | _ <| |___
|
||||
.\" * \___|\___/|_| \_\_____|
|
||||
.\" *
|
||||
.\" * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
.\" * Copyright (C) 1998 - 2008, 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
|
||||
@@ -21,7 +21,7 @@
|
||||
.\" * $Id$
|
||||
.\" **************************************************************************
|
||||
.\"
|
||||
.TH curl 1 "21 Sep 2007" "Curl 7.17.1" "Curl Manual"
|
||||
.TH curl 1 "5 Jan 2008" "Curl 7.18.0" "Curl Manual"
|
||||
.SH NAME
|
||||
curl \- transfer a URL
|
||||
.SH SYNOPSIS
|
||||
@@ -82,7 +82,7 @@ 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 transfered data, transfer speeds and estimated time left etc.
|
||||
of transferred data, transfer speeds and estimated time left etc.
|
||||
|
||||
However, since curl displays 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
|
||||
@@ -115,10 +115,10 @@ 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
|
||||
doing a request and checking the response-headers, thus 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, \fI--ntlm\fP, and
|
||||
\fI--negotiate\fP.
|
||||
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,
|
||||
\fI--ntlm\fP, and \fI--negotiate\fP.
|
||||
|
||||
Note that using --anyauth is not recommended if you do uploads from stdin,
|
||||
since it may require data to be sent twice and then the client must be able to
|
||||
@@ -224,43 +224,63 @@ To create remote directories when using FTP or SFTP, try
|
||||
If this option is used several times, the following occurrences make no
|
||||
difference.
|
||||
.IP "-d/--data <data>"
|
||||
(HTTP) Sends the specified data in a POST request to the HTTP server, in a way
|
||||
that can emulate as if a user has filled in a HTML form and pressed the submit
|
||||
button. Note that the data is sent exactly as specified with no extra
|
||||
processing (with all newlines cut off). The data is expected to be
|
||||
\&"url-encoded". This will cause curl to pass the data to the server using the
|
||||
content-type application/x-www-form-urlencoded. Compare to \fI-F/--form\fP. If
|
||||
this option 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 chunk that looks like
|
||||
\&'name=daniel&skill=lousy'.
|
||||
(HTTP) Sends the specified data in a POST request to the HTTP server, in the
|
||||
same way that a browser does when a user has filled in an HTML form and
|
||||
presses the submit button. This will cause curl to pass the data to the server
|
||||
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
|
||||
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
|
||||
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
|
||||
specified. Posting data from a file named 'foobar' would thus be done with
|
||||
\fI--data\fP @foobar".
|
||||
|
||||
To post data purely binary, you should instead use the \fI--data-binary\fP
|
||||
option.
|
||||
|
||||
\fI-d/--data\fP is the same as \fI--data-ascii\fP.
|
||||
|
||||
If this option is used several times, the ones following the first will
|
||||
append data.
|
||||
.IP "--data-ascii <data>"
|
||||
(HTTP) This is an alias for the \fI-d/--data\fP option.
|
||||
|
||||
If this option is used several times, the ones following the first will
|
||||
append data.
|
||||
\fI--data @foobar\fP.
|
||||
.IP "--data-binary <data>"
|
||||
(HTTP) This posts data in a similar manner as \fI--data-ascii\fP does,
|
||||
although when using this option the entire context of the posted data is kept
|
||||
as-is. If you want to post a binary file without the strip-newlines feature of
|
||||
the \fI--data-ascii\fP option, this is for you.
|
||||
(HTTP) This posts data exactly as specified with no extra processing
|
||||
whatsoever.
|
||||
|
||||
If this option is used several times, the ones following the first will
|
||||
append data.
|
||||
If you start the data with the letter @, the rest should be a filename. Data
|
||||
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.
|
||||
.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)
|
||||
|
||||
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
|
||||
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.
|
||||
.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.
|
||||
.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.
|
||||
.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
|
||||
sign appended, resulting in \fIname=urlencoded-file-content\fP. Note that the
|
||||
name is expected to be URL encoded already.
|
||||
.RE
|
||||
.IP "--digest"
|
||||
(HTTP) Enables HTTP Digest authentication. This is a authentication that
|
||||
prevents the password from being sent over the wire in clear text. Use this in
|
||||
@@ -341,9 +361,10 @@ DER and ENG are recognized types. If not specified, PEM is assumed.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--cacert <CA certificate>"
|
||||
(SSL) Tells curl to use the specified certificate file to verify the
|
||||
peer. The file may contain multiple CA certificates. The certificate(s) must
|
||||
be in PEM format.
|
||||
(SSL) Tells curl to use the specified certificate file to verify the peer. The
|
||||
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
|
||||
set, and uses the given path as a path to a CA cert bundle. This option
|
||||
@@ -388,9 +409,10 @@ has been provided, this data is sent off using the ACCT command. (Added in
|
||||
|
||||
If this option is used twice, the second will override the previous use.
|
||||
.IP "--ftp-create-dirs"
|
||||
(FTP) When an FTP or SFTP URL/operation uses a path that doesn't currently exist on
|
||||
the server, the standard behavior of curl is to fail. Using this option, curl
|
||||
will instead attempt to create missing directories.
|
||||
(FTP/SFTP) When an FTP or SFTP URL/operation uses a path that doesn't
|
||||
currently exist on the server, the standard behavior of curl is to
|
||||
fail. Using this option, curl will instead attempt to create missing
|
||||
directories.
|
||||
|
||||
If this option is used twice, the second will again disable directory creation.
|
||||
.IP "--ftp-method [method]"
|
||||
@@ -546,7 +568,7 @@ See also the \fI-A/--user-agent\fP and \fI-e/--referer\fP options.
|
||||
This option can be used multiple times to add/replace/remove multiple headers.
|
||||
.IP "--hostpubmd5"
|
||||
Pass a string containing 32 hexadecimal digits. The string should be the 128
|
||||
bit MD5 cheksum of the remote host's public key, curl will refuse the
|
||||
bit MD5 checksum of the remote host's public key, curl will refuse the
|
||||
connection with the host unless the md5sums match. This option is only for SCP
|
||||
and SFTP transfers. (Added in 7.17.1)
|
||||
.IP "--ignore-content-length"
|
||||
@@ -592,6 +614,14 @@ See this online resource for further details:
|
||||
\fBhttp://curl.haxx.se/docs/sslcerts.html\fP
|
||||
|
||||
If this option is used twice, the second time will again disable it.
|
||||
.IP "--keepalive-time <seconds>"
|
||||
This option sets the time a connection needs to remain idle before sending
|
||||
keepalive probes and the time between individual keepalive probes. It is
|
||||
currently effective on operating systems offering the TCP_KEEPIDLE and
|
||||
TCP_KEEPINTVL socket options (meaning Linux, recent AIX, HP-UX and more). This
|
||||
option has no effect if \fI--no-keepalive\fP is used. (Added in 7.18.0)
|
||||
|
||||
If this option is used multiple times, the last occurrence sets the amount.
|
||||
.IP "--key <key>"
|
||||
(SSL/SSH) Private key file name. Allows you to provide your private key in this
|
||||
separate file.
|
||||
@@ -617,8 +647,12 @@ If this option is used several times, the last one will be used.
|
||||
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. If the parameter is
|
||||
to contain white spaces, the parameter must be enclosed within quotes. If the
|
||||
parameters must be specified on the same config file line, separated by
|
||||
white space, 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
|
||||
quotes, the following escape sequences are available: \\\\, \\", \\t, \\n,
|
||||
\\r and \\v. A backlash 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.
|
||||
@@ -673,7 +707,8 @@ NOTE: this does not properly support -F and the sending of multipart
|
||||
formposts, so in those cases the output program will be missing necessary
|
||||
calls to \fIcurl_formadd(3)\fP, and possibly more.
|
||||
|
||||
If this option is used several times, the last given file name will be used.
|
||||
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
|
||||
@@ -799,6 +834,11 @@ will output the data in chunks, not necessarily exactly when the data arrives.
|
||||
Using this option will disable that buffering.
|
||||
|
||||
If this option is used twice, the second will again switch on buffering.
|
||||
.IP "--no-keepalive"
|
||||
Disables the use of keepalive messages on the TCP connection, as by default
|
||||
curl enables them.
|
||||
|
||||
If this option is used twice, the second will again enable 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
|
||||
@@ -861,7 +901,7 @@ a redirection. This option is meaningful only when using \fI-L/--location\fP
|
||||
(Added in 7.17.1)
|
||||
.IP "--proxy-anyauth"
|
||||
Tells curl to pick a suitable authentication method when communicating with
|
||||
the given proxy. This will cause an extra request/response round-trip. (Added
|
||||
the given proxy. This might cause an extra request/response round-trip. (Added
|
||||
in 7.13.2)
|
||||
|
||||
If this option is used twice, the second will again disable the proxy use-any
|
||||
@@ -948,9 +988,9 @@ This option can be used multiple times.
|
||||
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)
|
||||
Retrieve a byte range (i.e a partial document) from a HTTP/1.1 or FTP
|
||||
server. Ranges can be specified in a number of ways.
|
||||
(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.
|
||||
.RS
|
||||
.TP 10
|
||||
.B 0-499
|
||||
@@ -1049,9 +1089,28 @@ This option overrides any previous use of \fI-x/--proxy\fP, as they are
|
||||
mutually exclusive.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--socks4a <host[:port]>"
|
||||
Use the specified SOCKS4a proxy. If the port number is not specified, it is
|
||||
assumed at port 1080. (Added in 7.18.0)
|
||||
|
||||
This option overrides any previous use of \fI-x/--proxy\fP, as they are
|
||||
mutually exclusive.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--socks5-hostname <host[:port]>"
|
||||
Use the specified SOCKS5 proxy (and let the proxy resolve the host name). If
|
||||
the port number is not specified, it is assumed at port 1080. (Added in
|
||||
7.18.0)
|
||||
|
||||
This option overrides any previous use of \fI-x/--proxy\fP, as they are
|
||||
mutually exclusive.
|
||||
|
||||
If this option is used several times, the last one will be used. (This option
|
||||
was previously wrongly documented and used as --socks without the number
|
||||
appended.)
|
||||
.IP "--socks5 <host[:port]>"
|
||||
Use the specified SOCKS5 proxy. If the port number is not specified, it is
|
||||
assumed at port 1080. (Added in 7.11.1)
|
||||
Use the specified SOCKS5 proxy - but resolve the host name locally. If the
|
||||
port number is not specified, it is assumed at port 1080.
|
||||
|
||||
This option overrides any previous use of \fI-x/--proxy\fP, as they are
|
||||
mutually exclusive.
|
||||
@@ -1128,6 +1187,9 @@ If this option is used several times, each occurrence will toggle it on/off.
|
||||
Specify user 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
|
||||
a password.
|
||||
|
||||
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
|
||||
simply specifying a single colon with this option: "-u :".
|
||||
@@ -1226,7 +1288,9 @@ The URL that was fetched last. This is mostly meaningful if you've told curl
|
||||
to follow location: headers.
|
||||
.TP
|
||||
.B http_code
|
||||
The numerical code that was found in the last retrieved HTTP(S) page.
|
||||
The numerical response code that was found in the last retrieved HTTP(S) or
|
||||
FTP(s) transfer. In 7.18.2 the alias \fBresponse_code\fP was added to show the
|
||||
same info.
|
||||
.TP
|
||||
.B http_connect
|
||||
The numerical code that was found in the last response (from a proxy) to a
|
||||
@@ -1287,6 +1351,10 @@ Number of new connects made in the recent transfer. (Added in 7.12.3)
|
||||
.B num_redirects
|
||||
Number of redirects that were followed in the request. (Added in 7.12.3)
|
||||
.TP
|
||||
.B redirect_url
|
||||
When a HTTP request was made without -L to follow redirects, this variable
|
||||
will show the actual URL a redirect \fIwould\fP take you to. (Added in 7.18.2)
|
||||
.TP
|
||||
.B ftp_entry_path
|
||||
The initial path libcurl ended up in when logging on to the remote FTP
|
||||
server. (Added in 7.15.4)
|
||||
|
@@ -18,6 +18,9 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <curl/multi.h>
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
static const char *urls[] = {
|
||||
"http://www.microsoft.com",
|
||||
@@ -74,7 +77,7 @@ static const char *urls[] = {
|
||||
#define MAX 10 /* number of simultaneous transfers */
|
||||
#define CNT sizeof(urls)/sizeof(char*) /* total number of transfers to do */
|
||||
|
||||
static int cb(char *d, size_t n, size_t l, void *p)
|
||||
static size_t cb(char *d, size_t n, size_t l, void *p)
|
||||
{
|
||||
/* take care of the data here, ignored in this example */
|
||||
(void)d;
|
||||
@@ -87,10 +90,10 @@ static void init(CURLM *cm, int i)
|
||||
CURL *eh = curl_easy_init();
|
||||
|
||||
curl_easy_setopt(eh, CURLOPT_WRITEFUNCTION, cb);
|
||||
curl_easy_setopt(eh, CURLOPT_HEADER, 0);
|
||||
curl_easy_setopt(eh, CURLOPT_HEADER, 0L);
|
||||
curl_easy_setopt(eh, CURLOPT_URL, urls[i]);
|
||||
curl_easy_setopt(eh, CURLOPT_PRIVATE, urls[i]);
|
||||
curl_easy_setopt(eh, CURLOPT_VERBOSE, 0);
|
||||
curl_easy_setopt(eh, CURLOPT_VERBOSE, 0L);
|
||||
|
||||
curl_multi_add_handle(cm, eh);
|
||||
}
|
||||
@@ -138,7 +141,11 @@ int main(void)
|
||||
L = 100;
|
||||
|
||||
if (M == -1) {
|
||||
#ifdef WIN32
|
||||
Sleep(L);
|
||||
#else
|
||||
sleep(L / 1000);
|
||||
#endif
|
||||
} else {
|
||||
T.tv_sec = L/1000;
|
||||
T.tv_usec = (L%1000)*1000;
|
||||
|
@@ -4,28 +4,24 @@
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign nostdinc
|
||||
|
||||
EXTRA_DIST = README Makefile.example makefile.dj $(COMPLICATED_EXAMPLES)
|
||||
EXTRA_DIST = README Makefile.example Makefile.inc Makefile.m32 \
|
||||
makefile.dj $(COMPLICATED_EXAMPLES)
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/include
|
||||
|
||||
LIBDIR = $(top_builddir)/lib
|
||||
CPPFLAGS = -DCURL_NO_OLDIES
|
||||
|
||||
if STATICLIB
|
||||
# we need this define when building with a static lib on Windows
|
||||
STATICCPPFLAGS = -DCURL_STATICLIB
|
||||
endif
|
||||
|
||||
CPPFLAGS = -DCURL_NO_OLDIES $(STATICCPPFLAGS)
|
||||
|
||||
# Dependencies
|
||||
LDADD = $(LIBDIR)/libcurl.la
|
||||
|
||||
# These are all libcurl example programs to be test compiled
|
||||
noinst_PROGRAMS = 10-at-a-time anyauthput cookie_interface \
|
||||
debug fileupload fopen ftpget ftpgetresp ftpupload \
|
||||
getinfo getinmemory http-post httpput \
|
||||
https multi-app multi-debugcallback multi-double \
|
||||
multi-post multi-single persistant post-callback \
|
||||
postit2 sepheaders simple simplepost simplessl
|
||||
# Makefile.inc provides the check_PROGRAMS and COMPLICATED_EXAMPLES defines
|
||||
include Makefile.inc
|
||||
|
||||
# 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
|
||||
|
||||
|
17
docs/examples/Makefile.inc
Normal file
17
docs/examples/Makefile.inc
Normal file
@@ -0,0 +1,17 @@
|
||||
# These are all libcurl example programs to be test compiled
|
||||
check_PROGRAMS = 10-at-a-time anyauthput cookie_interface \
|
||||
debug fileupload fopen ftpget ftpgetresp ftpupload \
|
||||
getinfo getinmemory http-post httpput \
|
||||
https multi-app multi-debugcallback multi-double \
|
||||
multi-post multi-single persistant post-callback \
|
||||
postit2 sepheaders simple simplepost simplessl \
|
||||
sendrecv
|
||||
|
||||
# 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
|
||||
|
||||
|
134
docs/examples/Makefile.m32
Normal file
134
docs/examples/Makefile.m32
Normal file
@@ -0,0 +1,134 @@
|
||||
#########################################################################
|
||||
# $Id$
|
||||
#
|
||||
## Makefile for building curl examples with MingW32
|
||||
## and optionally OpenSSL (0.9.8), libssh2 (0.18), zlib (1.2.3)
|
||||
##
|
||||
## Usage:
|
||||
## mingw32-make -f Makefile.m32 [SSL=1] [SSH2=1] [ZLIB=1] [SSPI=1] [IPV6=1] [DYN=1]
|
||||
##
|
||||
## Hint: you can also set environment vars to control the build, f.e.:
|
||||
## set ZLIB_PATH=c:/zlib-1.2.3
|
||||
## set ZLIB=1
|
||||
##
|
||||
#########################################################################
|
||||
|
||||
# Edit the path below to point to the base of your Zlib sources.
|
||||
ifndef ZLIB_PATH
|
||||
ZLIB_PATH = ../../zlib-1.2.3
|
||||
endif
|
||||
# Edit the path below to point to the base of your OpenSSL package.
|
||||
ifndef OPENSSL_PATH
|
||||
OPENSSL_PATH = ../../openssl-0.9.8g
|
||||
endif
|
||||
# Edit the path below to point to the base of your LibSSH2 package.
|
||||
ifndef LIBSSH2_PATH
|
||||
LIBSSH2_PATH = ../../libssh2-0.18
|
||||
endif
|
||||
# Edit the path below to point to the base of your Novell LDAP NDK.
|
||||
ifndef LDAP_SDK
|
||||
LDAP_SDK = c:/novell/ndk/cldapsdk/win32
|
||||
endif
|
||||
|
||||
PROOT = ../..
|
||||
ARES_LIB = $(PROOT)/ares
|
||||
|
||||
SSL = 1
|
||||
ZLIB = 1
|
||||
|
||||
CC = gcc
|
||||
CFLAGS = -g -O2 -Wall
|
||||
# comment LDFLAGS below to keep debug info
|
||||
LDFLAGS = -s
|
||||
RC = windres
|
||||
RCFLAGS = --include-dir=$(PROOT)/include -O COFF -i
|
||||
RM = del /q /f > NUL 2>&1
|
||||
CP = copy
|
||||
|
||||
########################################################
|
||||
## Nothing more to do below this line!
|
||||
|
||||
INCLUDES = -I. -I$(PROOT) -I$(PROOT)/include -I$(PROOT)/lib
|
||||
LINK = $(CC) $(LDFLAGS) -o $@
|
||||
|
||||
ifdef DYN
|
||||
curl_DEPENDENCIES = $(PROOT)/lib/libcurldll.a $(PROOT)/lib/libcurl.dll
|
||||
curl_LDADD = -L$(PROOT)/lib -lcurldll
|
||||
else
|
||||
curl_DEPENDENCIES = $(PROOT)/lib/libcurl.a
|
||||
curl_LDADD = -L$(PROOT)/lib -lcurl
|
||||
CFLAGS += -DCURL_STATICLIB
|
||||
endif
|
||||
ifdef ARES
|
||||
ifndef DYN
|
||||
curl_DEPENDENCIES += $(ARES_LIB)/libcares.a
|
||||
endif
|
||||
CFLAGS += -DUSE_ARES
|
||||
curl_LDADD += -L$(ARES_LIB) -lcares
|
||||
endif
|
||||
ifdef SSH2
|
||||
CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
|
||||
curl_LDADD += -L$(LIBSSH2_PATH)/win32 -lssh2
|
||||
endif
|
||||
ifdef SSL
|
||||
INCLUDES += -I"$(OPENSSL_PATH)/outinc"
|
||||
CFLAGS += -DUSE_SSLEAY -DHAVE_OPENSSL_ENGINE_H
|
||||
ifdef DYN
|
||||
curl_LDADD += -L$(OPENSSL_PATH)/out -leay32 -lssl32
|
||||
else
|
||||
curl_LDADD += -L$(OPENSSL_PATH)/out -lssl -lcrypto -lgdi32
|
||||
endif
|
||||
endif
|
||||
ifdef ZLIB
|
||||
INCLUDES += -I"$(ZLIB_PATH)"
|
||||
CFLAGS += -DHAVE_LIBZ -DHAVE_ZLIB_H
|
||||
curl_LDADD += -L$(ZLIB_PATH) -lz
|
||||
endif
|
||||
ifdef SSPI
|
||||
CFLAGS += -DUSE_WINDOWS_SSPI
|
||||
endif
|
||||
ifdef IPV6
|
||||
CFLAGS += -DENABLE_IPV6
|
||||
endif
|
||||
ifdef LDAPS
|
||||
CFLAGS += -DHAVE_LDAP_SSL
|
||||
endif
|
||||
ifdef USE_LDAP_NOVELL
|
||||
CFLAGS += -DCURL_HAS_NOVELL_LDAPSDK
|
||||
curl_LDADD += -L"$(LDAP_SDK)/lib/mscvc" -lldapsdk -lldapssl -lldapx
|
||||
endif
|
||||
ifdef USE_LDAP_OPENLDAP
|
||||
CFLAGS += -DCURL_HAS_OPENLDAP_LDAPSDK
|
||||
curl_LDADD += -L"$(LDAP_SDK)/lib" -lldap -llber
|
||||
endif
|
||||
ifndef USE_LDAP_NOVELL
|
||||
ifndef USE_LDAP_OPENLDAP
|
||||
curl_LDADD += -lwldap32
|
||||
endif
|
||||
endif
|
||||
curl_LDADD += -lws2_32
|
||||
COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
|
||||
|
||||
# Makefile.inc provides the check_PROGRAMS and COMPLICATED_EXAMPLES defines
|
||||
include Makefile.inc
|
||||
|
||||
example_PROGRAMS := $(patsubst %,%.exe,$(strip $(check_PROGRAMS)))
|
||||
|
||||
.SUFFIXES: .rc .res .o .exe
|
||||
|
||||
|
||||
all: $(example_PROGRAMS)
|
||||
|
||||
.o.exe: $(curl_DEPENDENCIES)
|
||||
$(LINK) $< $(curl_LDADD)
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.rc.res:
|
||||
$(RC) $(RCFLAGS) $< -o $@
|
||||
|
||||
clean:
|
||||
$(RM) $(example_PROGRAMS)
|
||||
|
||||
|
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
@@ -37,7 +38,7 @@
|
||||
/* ioctl callback function */
|
||||
static curlioerr my_ioctl(CURL *handle, curliocmd cmd, void *userp)
|
||||
{
|
||||
int fd = (int)userp;
|
||||
intptr_t fd = (intptr_t)userp;
|
||||
|
||||
(void)handle; /* not used in here */
|
||||
|
||||
@@ -61,7 +62,7 @@ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
|
||||
{
|
||||
size_t retcode;
|
||||
|
||||
int fd = (int)stream;
|
||||
intptr_t fd = (intptr_t)stream;
|
||||
|
||||
retcode = read(fd, ptr, size * nmemb);
|
||||
|
||||
@@ -74,7 +75,7 @@ int main(int argc, char **argv)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
int hd ;
|
||||
intptr_t hd ;
|
||||
struct stat file_info;
|
||||
|
||||
char *file;
|
||||
@@ -100,16 +101,16 @@ int main(int argc, char **argv)
|
||||
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
|
||||
|
||||
/* which file to upload */
|
||||
curl_easy_setopt(curl, CURLOPT_READDATA, hd);
|
||||
curl_easy_setopt(curl, CURLOPT_READDATA, (void*)hd);
|
||||
|
||||
/* set the ioctl function */
|
||||
curl_easy_setopt(curl, CURLOPT_IOCTLFUNCTION, my_ioctl);
|
||||
|
||||
/* pass the file descriptor to the ioctl callback as well */
|
||||
curl_easy_setopt(curl, CURLOPT_IOCTLDATA, hd);
|
||||
curl_easy_setopt(curl, CURLOPT_IOCTLDATA, (void*)hd);
|
||||
|
||||
/* enable "uploading" (which means PUT when doing HTTP) */
|
||||
curl_easy_setopt(curl, CURLOPT_UPLOAD, TRUE) ;
|
||||
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L) ;
|
||||
|
||||
/* specify target URL, and note that this URL should also include a file
|
||||
name, not only a directory (as you can do with GTP uploads) */
|
||||
@@ -117,12 +118,13 @@ int main(int argc, char **argv)
|
||||
|
||||
/* and give the size of the upload, this supports large file sizes
|
||||
on systems that have general support for it */
|
||||
curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, file_info.st_size);
|
||||
curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE,
|
||||
(curl_off_t)file_info.st_size);
|
||||
|
||||
/* tell libcurl we can use "any" auth, which lets the lib pick one, but it
|
||||
also costs one extra round-trip and possibly sending of all the PUT
|
||||
data twice!!! */
|
||||
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
|
||||
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_ANY);
|
||||
|
||||
/* set user name and password for the authentication */
|
||||
curl_easy_setopt(curl, CURLOPT_USERPWD, "user:password");
|
||||
|
@@ -102,16 +102,16 @@ int main(void)
|
||||
|
||||
rv=curl_global_init(CURL_GLOBAL_ALL);
|
||||
ch=curl_easy_init();
|
||||
rv=curl_easy_setopt(ch,CURLOPT_VERBOSE, 0);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_HEADER, 0);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_NOPROGRESS, 1);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_NOSIGNAL, 1);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_VERBOSE, 0L);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_HEADER, 0L);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_NOPROGRESS, 1L);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_NOSIGNAL, 1L);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_WRITEFUNCTION, *writefunction);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_WRITEDATA, stdout);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_HEADERFUNCTION, *writefunction);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_WRITEHEADER, stderr);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_SSLCERTTYPE,"PEM");
|
||||
rv=curl_easy_setopt(ch,CURLOPT_SSL_VERIFYPEER,1);
|
||||
rv=curl_easy_setopt(ch,CURLOPT_SSL_VERIFYPEER,1L);
|
||||
rv=curl_easy_setopt(ch, CURLOPT_URL, "https://www.cacert.org/");
|
||||
|
||||
/* first try: retrieve page without cacerts' certificate -> will fail
|
||||
|
@@ -54,7 +54,7 @@ main(void)
|
||||
char nline[256];
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "http://www.google.com/"); /* google.com sets "PREF" cookie */
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); /* just to start the cookie engine */
|
||||
res = curl_easy_perform(curl);
|
||||
if (res != CURLE_OK) {
|
||||
|
@@ -29,7 +29,7 @@ size_t my_read_func(void *ptr, size_t size, size_t nmemb, FILE *stream)
|
||||
return fread(ptr, size, nmemb, stream);
|
||||
}
|
||||
|
||||
int my_progress_func(GtkWidget *Bar,
|
||||
int my_progress_func(GtkWidget *bar,
|
||||
double t, /* dltotal */
|
||||
double d, /* dlnow */
|
||||
double ultotal,
|
||||
@@ -37,7 +37,7 @@ int my_progress_func(GtkWidget *Bar,
|
||||
{
|
||||
/* printf("%d / %d (%g %%)\n", d, t, d*100.0/t);*/
|
||||
gdk_threads_enter();
|
||||
gtk_progress_set_value(GTK_PROGRESS(Bar), d*100.0/t);
|
||||
gtk_progress_set_value(GTK_PROGRESS(bar), d*100.0/t);
|
||||
gdk_threads_leave();
|
||||
return 0;
|
||||
}
|
||||
@@ -58,7 +58,7 @@ void *my_thread(void *ptr)
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_write_func);
|
||||
curl_easy_setopt(curl, CURLOPT_READFUNCTION, my_read_func);
|
||||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, FALSE);
|
||||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
|
||||
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, my_progress_func);
|
||||
curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, Bar);
|
||||
|
||||
@@ -77,6 +77,9 @@ int main(int argc, char **argv)
|
||||
GtkWidget *Window, *Frame, *Frame2;
|
||||
GtkAdjustment *adj;
|
||||
|
||||
/* Must initialize libcurl before any threads are started */
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
|
||||
/* Init thread */
|
||||
g_thread_init(NULL);
|
||||
|
||||
|
@@ -438,7 +438,7 @@ int main(int argc, char **argv) {
|
||||
/* Now specify the POST binary data */
|
||||
|
||||
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDS, binaryptr);
|
||||
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDSIZE,tabLength);
|
||||
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDSIZE,(long)tabLength);
|
||||
|
||||
/* pass our list of custom made headers */
|
||||
|
||||
@@ -477,7 +477,7 @@ int main(int argc, char **argv) {
|
||||
/* Now specify the POST binary data */
|
||||
|
||||
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDS, binaryptr);
|
||||
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDSIZE,tabLength);
|
||||
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDSIZE,(long)tabLength);
|
||||
|
||||
|
||||
/* Perform the request, res will get the return code */
|
||||
|
@@ -65,7 +65,7 @@ void dump(const char *text,
|
||||
|
||||
static
|
||||
int my_trace(CURL *handle, curl_infotype type,
|
||||
unsigned char *data, size_t size,
|
||||
char *data, size_t size,
|
||||
void *userp)
|
||||
{
|
||||
struct data *config = (struct data *)userp;
|
||||
@@ -98,7 +98,7 @@ int my_trace(CURL *handle, curl_infotype type,
|
||||
break;
|
||||
}
|
||||
|
||||
dump(text, stderr, data, size, config->trace_ascii);
|
||||
dump(text, stderr, (unsigned char *)data, size, config->trace_ascii);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ int main(void)
|
||||
curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &config);
|
||||
|
||||
/* the DEBUGFUNCTION has no effect until we enable VERBOSE */
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
|
||||
res = curl_easy_perform(curl);
|
||||
|
@@ -36,7 +36,7 @@ int main(void)
|
||||
"file:///home/dast/src/curl/debug/new");
|
||||
|
||||
/* tell it to "upload" to the URL */
|
||||
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
|
||||
|
||||
/* set where to read from (on Windows you need to use READFUNCTION too) */
|
||||
curl_easy_setopt(curl, CURLOPT_READDATA, fd);
|
||||
@@ -46,7 +46,7 @@ int main(void)
|
||||
(curl_off_t)file_info.st_size);
|
||||
|
||||
/* enable verbose for easier tracing */
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
|
@@ -236,7 +236,7 @@ url_fopen(const char *url,const char *operation)
|
||||
|
||||
curl_easy_setopt(file->handle.curl, CURLOPT_URL, url);
|
||||
curl_easy_setopt(file->handle.curl, CURLOPT_WRITEDATA, file);
|
||||
curl_easy_setopt(file->handle.curl, CURLOPT_VERBOSE, 0);
|
||||
curl_easy_setopt(file->handle.curl, CURLOPT_VERBOSE, 0L);
|
||||
curl_easy_setopt(file->handle.curl, CURLOPT_WRITEFUNCTION, write_callback);
|
||||
|
||||
if(!multi_handle)
|
||||
@@ -488,7 +488,7 @@ main(int argc, char *argv[])
|
||||
handle = url_fopen(url, "r");
|
||||
if(!handle)
|
||||
{
|
||||
printf("couldn't url_fopen()\n");
|
||||
printf("couldn't url_fopen() %s\n", url);
|
||||
fclose(outf);
|
||||
return 2;
|
||||
}
|
||||
@@ -514,7 +514,7 @@ main(int argc, char *argv[])
|
||||
|
||||
handle = url_fopen("testfile", "r");
|
||||
if(!handle) {
|
||||
printf("couldn't url_fopen()\n");
|
||||
printf("couldn't url_fopen() testfile\n");
|
||||
fclose(outf);
|
||||
return 2;
|
||||
}
|
||||
@@ -539,7 +539,7 @@ main(int argc, char *argv[])
|
||||
|
||||
handle = url_fopen("testfile", "r");
|
||||
if(!handle) {
|
||||
printf("couldn't url_fopen()\n");
|
||||
printf("couldn't url_fopen() testfile\n");
|
||||
fclose(outf);
|
||||
return 2;
|
||||
}
|
||||
|
@@ -26,7 +26,7 @@ struct FtpFile {
|
||||
FILE *stream;
|
||||
};
|
||||
|
||||
static int my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream)
|
||||
static size_t my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream)
|
||||
{
|
||||
struct FtpFile *out=(struct FtpFile *)stream;
|
||||
if(out && !out->stream) {
|
||||
@@ -65,7 +65,7 @@ int main(void)
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ftpfile);
|
||||
|
||||
/* Switch on full protocol/debug output */
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
|
@@ -9,12 +9,18 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#ifdef WIN32
|
||||
#include <io.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This example shows an FTP upload, with a rename of the file just after
|
||||
@@ -28,12 +34,26 @@
|
||||
#define REMOTE_URL "ftp://localhost/" UPLOAD_FILE_AS
|
||||
#define RENAME_FILE_TO "renamed-and-fine.txt"
|
||||
|
||||
/* NOTE: if you want this example to work on Windows with libcurl as a
|
||||
DLL, you MUST also provide a read callback with CURLOPT_READFUNCTION.
|
||||
Failing to do so will give you a crash since a DLL may not use the
|
||||
variable's memory when passed in to it from an app like this. */
|
||||
static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
|
||||
{
|
||||
/* in real-world cases, this would probably get this data differently
|
||||
as this fread() stuff is exactly what the library already would do
|
||||
by default internally */
|
||||
size_t retcode = fread(ptr, size, nmemb, stream);
|
||||
|
||||
fprintf(stderr, "*** We read %d bytes from file\n", retcode);
|
||||
return retcode;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
FILE * hd_src ;
|
||||
int hd ;
|
||||
FILE *hd_src;
|
||||
struct stat file_info;
|
||||
|
||||
struct curl_slist *headerlist=NULL;
|
||||
@@ -41,13 +61,13 @@ int main(int argc, char **argv)
|
||||
static const char buf_2 [] = "RNTO " RENAME_FILE_TO;
|
||||
|
||||
/* get the file size of the local file */
|
||||
hd = open(LOCAL_FILE, O_RDONLY) ;
|
||||
fstat(hd, &file_info);
|
||||
close(hd) ;
|
||||
if(stat(LOCAL_FILE, &file_info)) {
|
||||
printf("Couldnt open '%s': %s\n", LOCAL_FILE, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
printf("Local file size: %ld bytes.\n", file_info.st_size);
|
||||
|
||||
/* get a FILE * of the same file, could also be made with
|
||||
fdopen() from the previous descriptor, but hey this is just
|
||||
an example! */
|
||||
/* get a FILE * of the same file */
|
||||
hd_src = fopen(LOCAL_FILE, "rb");
|
||||
|
||||
/* In windows, this will init the winsock stuff */
|
||||
@@ -60,8 +80,11 @@ int main(int argc, char **argv)
|
||||
headerlist = curl_slist_append(headerlist, buf_1);
|
||||
headerlist = curl_slist_append(headerlist, buf_2);
|
||||
|
||||
/* we want to use our own read function */
|
||||
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
|
||||
|
||||
/* enable uploading */
|
||||
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1) ;
|
||||
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
|
||||
|
||||
/* specify target */
|
||||
curl_easy_setopt(curl,CURLOPT_URL, REMOTE_URL);
|
||||
@@ -72,12 +95,6 @@ int main(int argc, char **argv)
|
||||
/* now specify which file to upload */
|
||||
curl_easy_setopt(curl, CURLOPT_READDATA, hd_src);
|
||||
|
||||
/* NOTE: if you want this example to work on Windows with libcurl as a
|
||||
DLL, you MUST also provide a read callback with
|
||||
CURLOPT_READFUNCTION. Failing to do so will give you a crash since a
|
||||
DLL may not use the variable's memory when passed in to it from an app
|
||||
like this. */
|
||||
|
||||
/* Set the size of the file to upload (optional). If you give a *_LARGE
|
||||
option you MUST make sure that the type of the passed-in argument is a
|
||||
curl_off_t. If you use CURLOPT_INFILESIZE (without _LARGE) you must
|
||||
|
@@ -77,7 +77,7 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
|
||||
return 0;
|
||||
}
|
||||
|
||||
curl_easy_setopt(curlhandle, CURLOPT_UPLOAD, 1);
|
||||
curl_easy_setopt(curlhandle, CURLOPT_UPLOAD, 1L);
|
||||
|
||||
curl_easy_setopt(curlhandle, CURLOPT_URL, remotepath);
|
||||
|
||||
@@ -93,9 +93,9 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
|
||||
curl_easy_setopt(curlhandle, CURLOPT_READDATA, f);
|
||||
|
||||
curl_easy_setopt(curlhandle, CURLOPT_FTPPORT, "-"); /* disable passive mode */
|
||||
curl_easy_setopt(curlhandle, CURLOPT_FTP_CREATE_MISSING_DIRS, 1);
|
||||
curl_easy_setopt(curlhandle, CURLOPT_FTP_CREATE_MISSING_DIRS, 1L);
|
||||
|
||||
curl_easy_setopt(curlhandle, CURLOPT_VERBOSE, 1);
|
||||
curl_easy_setopt(curlhandle, CURLOPT_VERBOSE, 1L);
|
||||
|
||||
for (c = 0; (r != CURLE_OK) && (c < tries); c++) {
|
||||
/* are we resuming? */
|
||||
@@ -110,22 +110,22 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
|
||||
* because HEADER will dump the headers to stdout
|
||||
* without it.
|
||||
*/
|
||||
curl_easy_setopt(curlhandle, CURLOPT_NOBODY, 1);
|
||||
curl_easy_setopt(curlhandle, CURLOPT_HEADER, 1);
|
||||
curl_easy_setopt(curlhandle, CURLOPT_NOBODY, 1L);
|
||||
curl_easy_setopt(curlhandle, CURLOPT_HEADER, 1L);
|
||||
|
||||
r = curl_easy_perform(curlhandle);
|
||||
if (r != CURLE_OK)
|
||||
continue;
|
||||
|
||||
curl_easy_setopt(curlhandle, CURLOPT_NOBODY, 0);
|
||||
curl_easy_setopt(curlhandle, CURLOPT_HEADER, 0);
|
||||
curl_easy_setopt(curlhandle, CURLOPT_NOBODY, 0L);
|
||||
curl_easy_setopt(curlhandle, CURLOPT_HEADER, 0L);
|
||||
|
||||
fseek(f, uploaded_len, SEEK_SET);
|
||||
|
||||
curl_easy_setopt(curlhandle, CURLOPT_APPEND, 1);
|
||||
curl_easy_setopt(curlhandle, CURLOPT_APPEND, 1L);
|
||||
}
|
||||
else { /* no */
|
||||
curl_easy_setopt(curlhandle, CURLOPT_APPEND, 0);
|
||||
curl_easy_setopt(curlhandle, CURLOPT_APPEND, 0L);
|
||||
}
|
||||
|
||||
r = curl_easy_perform(curlhandle);
|
||||
|
@@ -98,5 +98,8 @@ int main(int argc, char **argv)
|
||||
if(chunk.memory)
|
||||
free(chunk.memory);
|
||||
|
||||
/* we're done with libcurl, so clean it up */
|
||||
curl_global_cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -325,16 +325,16 @@ static void new_conn(char *url, GlobalInfo *g )
|
||||
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, SHOW_VERBOSE);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, (long)SHOW_VERBOSE);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, SHOW_PROGRESS?0:1);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, SHOW_PROGRESS?0L:1L);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_PROGRESSFUNCTION, prog_cb);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_PROGRESSDATA, conn);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_CONNECTTIMEOUT, 30);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_LIMIT, 1);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_TIME, 30);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_CONNECTTIMEOUT, 30L);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_LIMIT, 1L);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_TIME, 30L);
|
||||
|
||||
MSG_OUT("Adding easy %p to multi %p (%s)\n", conn->easy, g->multi, url);
|
||||
rc =curl_multi_add_handle(g->multi, conn->easy);
|
||||
|
@@ -95,6 +95,7 @@ typedef struct _SockInfo {
|
||||
static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
|
||||
{
|
||||
struct timeval timeout;
|
||||
(void)multi; /* unused */
|
||||
|
||||
timeout.tv_sec = timeout_ms/1000;
|
||||
timeout.tv_usec = (timeout_ms%1000)*1000;
|
||||
@@ -103,12 +104,11 @@ static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Die if we get a bad CURLMcode somewhere */
|
||||
void mcode_or_die(char *where, CURLMcode code) {
|
||||
static void mcode_or_die(const char *where, CURLMcode code)
|
||||
{
|
||||
if ( CURLM_OK != code ) {
|
||||
char *s;
|
||||
const char *s;
|
||||
switch (code) {
|
||||
case CURLM_CALL_MULTI_PERFORM: s="CURLM_CALL_MULTI_PERFORM"; break;
|
||||
case CURLM_OK: s="CURLM_OK"; break;
|
||||
@@ -116,10 +116,14 @@ void mcode_or_die(char *where, CURLMcode code) {
|
||||
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_BAD_SOCKET: s="CURLM_BAD_SOCKET"; 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);
|
||||
@@ -176,6 +180,7 @@ static void event_cb(int fd, short kind, void *userp)
|
||||
{
|
||||
GlobalInfo *g = (GlobalInfo*) userp;
|
||||
CURLMcode rc;
|
||||
(void)kind; /* unused */
|
||||
|
||||
do {
|
||||
rc = curl_multi_socket(g->multi, fd, &g->still_running);
|
||||
@@ -195,10 +200,10 @@ static void event_cb(int fd, short kind, void *userp)
|
||||
/* Called by libevent when our timeout expires */
|
||||
static void timer_cb(int fd, short kind, void *userp)
|
||||
{
|
||||
(void)fd;
|
||||
(void)kind;
|
||||
GlobalInfo *g = (GlobalInfo *)userp;
|
||||
CURLMcode rc;
|
||||
(void)fd;
|
||||
(void)kind;
|
||||
|
||||
do {
|
||||
rc = curl_multi_socket(g->multi, CURL_SOCKET_TIMEOUT, &g->still_running);
|
||||
@@ -212,9 +217,11 @@ static void timer_cb(int fd, short kind, void *userp)
|
||||
/* Clean up the SockInfo structure */
|
||||
static void remsock(SockInfo *f)
|
||||
{
|
||||
if (!f) { return; }
|
||||
if (f->evset) { event_del(&f->ev); }
|
||||
free(f);
|
||||
if (f) {
|
||||
if (f->evset)
|
||||
event_del(&f->ev);
|
||||
free(f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -228,8 +235,9 @@ static void setsock(SockInfo*f, curl_socket_t s, CURL*e, int act, GlobalInfo*g)
|
||||
f->sockfd = s;
|
||||
f->action = act;
|
||||
f->easy = e;
|
||||
if (f->evset) { event_del(&f->ev); }
|
||||
event_set( &f->ev, f->sockfd, kind, event_cb, g);
|
||||
if (f->evset)
|
||||
event_del(&f->ev);
|
||||
event_set(&f->ev, f->sockfd, kind, event_cb, g);
|
||||
f->evset=1;
|
||||
event_add(&f->ev, NULL);
|
||||
}
|
||||
@@ -245,8 +253,6 @@ static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *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)
|
||||
{
|
||||
@@ -259,16 +265,16 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
|
||||
if (what == CURL_POLL_REMOVE) {
|
||||
fprintf(MSG_OUT, "\n");
|
||||
remsock(fdp);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (!fdp) {
|
||||
fprintf(MSG_OUT, "Adding data: %s%s\n",
|
||||
what&CURL_POLL_IN?"READ":"",
|
||||
what&CURL_POLL_OUT?"WRITE":"" );
|
||||
fprintf(MSG_OUT, "Adding data: %s\n", whatstr[what]);
|
||||
addsock(s, e, what, g);
|
||||
}
|
||||
else {
|
||||
fprintf(MSG_OUT,
|
||||
"Changing action from %d to %d\n", fdp->action, what);
|
||||
"Changing action from %s to %s\n",
|
||||
whatstr[fdp->action], whatstr[what]);
|
||||
setsock(fdp, s, e, what, g);
|
||||
}
|
||||
}
|
||||
@@ -289,16 +295,21 @@ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data)
|
||||
|
||||
|
||||
/* CURLOPT_PROGRESSFUNCTION */
|
||||
int prog_cb (void *p, double dltotal, double dlnow, double ult, double uln)
|
||||
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 */
|
||||
void new_conn(char *url, GlobalInfo *g ) {
|
||||
static void new_conn(char *url, GlobalInfo *g )
|
||||
{
|
||||
ConnInfo *conn;
|
||||
CURLMcode rc;
|
||||
|
||||
@@ -316,10 +327,10 @@ void new_conn(char *url, GlobalInfo *g ) {
|
||||
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, 0);
|
||||
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, 0);
|
||||
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);
|
||||
fprintf(MSG_OUT,
|
||||
@@ -333,14 +344,15 @@ void new_conn(char *url, GlobalInfo *g ) {
|
||||
check_run_count(g);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* This gets called whenever data is received from the fifo */
|
||||
void fifo_cb(int fd, short event, void *arg) {
|
||||
static void fifo_cb(int fd, short event, void *arg)
|
||||
{
|
||||
char s[1024];
|
||||
long int rv=0;
|
||||
int n=0;
|
||||
GlobalInfo *g = (GlobalInfo *)arg;
|
||||
(void)fd; /* unused */
|
||||
(void)event; /* unused */
|
||||
|
||||
do {
|
||||
s[0]='\0';
|
||||
@@ -352,13 +364,12 @@ void fifo_cb(int fd, short event, void *arg) {
|
||||
} while ( rv != EOF);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Create a named pipe and tell libevent to monitor it */
|
||||
int init_fifo (GlobalInfo *g) {
|
||||
static int init_fifo (GlobalInfo *g)
|
||||
{
|
||||
struct stat st;
|
||||
static const char *fifo = "hiper.fifo";
|
||||
int socket;
|
||||
int sockfd;
|
||||
|
||||
fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo);
|
||||
if (lstat (fifo, &st) == 0) {
|
||||
@@ -373,25 +384,25 @@ int init_fifo (GlobalInfo *g) {
|
||||
perror("mkfifo");
|
||||
exit (1);
|
||||
}
|
||||
socket = open(fifo, O_RDWR | O_NONBLOCK, 0);
|
||||
if (socket == -1) {
|
||||
perror("open");
|
||||
exit (1);
|
||||
sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0);
|
||||
if (sockfd == -1) {
|
||||
perror("open");
|
||||
exit (1);
|
||||
}
|
||||
g->input = fdopen(socket, "r");
|
||||
g->input = fdopen(sockfd, "r");
|
||||
|
||||
fprintf(MSG_OUT, "Now, pipe some URL's into > %s\n", fifo);
|
||||
event_set(&g->fifo_event, socket, EV_READ | EV_PERSIST, fifo_cb, g);
|
||||
event_set(&g->fifo_event, sockfd, EV_READ | EV_PERSIST, fifo_cb, g);
|
||||
event_add(&g->fifo_event, NULL);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GlobalInfo g;
|
||||
CURLMcode rc;
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
memset(&g, 0, sizeof(GlobalInfo));
|
||||
event_init();
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user