Compare commits
437 Commits
curl-7_19_
...
curl-7_19_
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3cda1a23ce | ||
![]() |
215677c10b | ||
![]() |
3688cd3fea | ||
![]() |
5ca2a8318d | ||
![]() |
e27ec862c3 | ||
![]() |
d0b8b5a199 | ||
![]() |
efe2ce3647 | ||
![]() |
71f00188fb | ||
![]() |
a1c9cb8860 | ||
![]() |
74e9718370 | ||
![]() |
2d71c9cdfd | ||
![]() |
484d549ece | ||
![]() |
d098ab436d | ||
![]() |
85ffd33f08 | ||
![]() |
c1b8e93083 | ||
![]() |
383d4656aa | ||
![]() |
3e3d10824f | ||
![]() |
128418b214 | ||
![]() |
050a39a7a5 | ||
![]() |
5f085789b9 | ||
![]() |
6a8832d83b | ||
![]() |
fcb498b0d5 | ||
![]() |
0433252e50 | ||
![]() |
5ce6f37e26 | ||
![]() |
02fc7bb5f6 | ||
![]() |
9e1294e866 | ||
![]() |
c2c800d863 | ||
![]() |
625c107c25 | ||
![]() |
33319f5d2d | ||
![]() |
ad3c1c37bb | ||
![]() |
005bf19acf | ||
![]() |
91c77808c4 | ||
![]() |
0ce97f77e0 | ||
![]() |
197ad60d21 | ||
![]() |
dc31387c6f | ||
![]() |
bd64da3785 | ||
![]() |
4fef0d4f14 | ||
![]() |
89d6f580dc | ||
![]() |
23eb74e085 | ||
![]() |
9c86097286 | ||
![]() |
f0bb9c7d8d | ||
![]() |
d4514f9c10 | ||
![]() |
c324033ba4 | ||
![]() |
74a16db975 | ||
![]() |
a10044e110 | ||
![]() |
6cdd067faf | ||
![]() |
0989cd358a | ||
![]() |
6e0739931d | ||
![]() |
b17ca44f0b | ||
![]() |
fd6e025d61 | ||
![]() |
9230708e47 | ||
![]() |
92f3b3895e | ||
![]() |
fa8a78ff01 | ||
![]() |
310d842b70 | ||
![]() |
1498de83d6 | ||
![]() |
e29f62f0a7 | ||
![]() |
39e5fa6ae8 | ||
![]() |
dc289aa4fa | ||
![]() |
6db8f53445 | ||
![]() |
417bac4055 | ||
![]() |
e9c94cdd49 | ||
![]() |
d104216bbe | ||
![]() |
d086fdaf9f | ||
![]() |
8693afdfea | ||
![]() |
a876161ef9 | ||
![]() |
10035c898b | ||
![]() |
71edaf4d01 | ||
![]() |
2b77d50776 | ||
![]() |
6ea91af2f8 | ||
![]() |
b767440399 | ||
![]() |
4174ec7116 | ||
![]() |
068ba17e21 | ||
![]() |
4d10c96aa6 | ||
![]() |
b701ea36a7 | ||
![]() |
198fa5e3c7 | ||
![]() |
507cd13793 | ||
![]() |
6c14c96e71 | ||
![]() |
976963cd21 | ||
![]() |
9391d980c3 | ||
![]() |
bab5183820 | ||
![]() |
0abaf22467 | ||
![]() |
463a8134a1 | ||
![]() |
d22b2d181f | ||
![]() |
5a9bbf639a | ||
![]() |
81e48ada47 | ||
![]() |
598bc44f67 | ||
![]() |
b93f4f623c | ||
![]() |
1054dc5ed1 | ||
![]() |
7fc4e8af0a | ||
![]() |
4198bb88b6 | ||
![]() |
db325d1f43 | ||
![]() |
7ff38c14a9 | ||
![]() |
3f2de3d101 | ||
![]() |
6bd91936ff | ||
![]() |
035a2e5479 | ||
![]() |
6983ba3225 | ||
![]() |
77e028d620 | ||
![]() |
0bb91218c5 | ||
![]() |
231a51fe7a | ||
![]() |
8d0cbaf8df | ||
![]() |
b843c27322 | ||
![]() |
2688cf343b | ||
![]() |
b416b87518 | ||
![]() |
3f1b9f095a | ||
![]() |
8a6eeb82c5 | ||
![]() |
5779283a52 | ||
![]() |
80d0dcc9a3 | ||
![]() |
d51ad518c4 | ||
![]() |
29ba1730ca | ||
![]() |
183210619d | ||
![]() |
feff911fb7 | ||
![]() |
8eee5f3253 | ||
![]() |
3e55fef5e1 | ||
![]() |
63397e380f | ||
![]() |
07c3aaeea1 | ||
![]() |
8254bbae56 | ||
![]() |
e7886aa9b4 | ||
![]() |
fb08868e54 | ||
![]() |
c141d99059 | ||
![]() |
f66e1c49b0 | ||
![]() |
4acbe8f20c | ||
![]() |
2ea70a5c73 | ||
![]() |
eb612bfdfc | ||
![]() |
5e826c78a7 | ||
![]() |
a0d906739d | ||
![]() |
98b13037e7 | ||
![]() |
29f09f71b4 | ||
![]() |
a00b6e258d | ||
![]() |
7ded272b94 | ||
![]() |
1d12b1fa1e | ||
![]() |
54582bdce9 | ||
![]() |
a9a4300a36 | ||
![]() |
f720e0ac0f | ||
![]() |
a8245df745 | ||
![]() |
86c5d02a5e | ||
![]() |
5af597c2fb | ||
![]() |
dd9e0164d5 | ||
![]() |
9d16b4081e | ||
![]() |
545cafce9b | ||
![]() |
fb66d51796 | ||
![]() |
5175664174 | ||
![]() |
a579d67064 | ||
![]() |
be760bed7e | ||
![]() |
357383159e | ||
![]() |
0ea1c28135 | ||
![]() |
36e56f36ad | ||
![]() |
0a9984c27e | ||
![]() |
0ecdcc253b | ||
![]() |
1667890172 | ||
![]() |
9b3f863cf5 | ||
![]() |
2f2ed4e40e | ||
![]() |
3d582304b6 | ||
![]() |
996d45df0a | ||
![]() |
6047635406 | ||
![]() |
e16bccbb91 | ||
![]() |
9786e7faeb | ||
![]() |
fde4b823f1 | ||
![]() |
b7e71a249e | ||
![]() |
bf8d642607 | ||
![]() |
1fab40bb69 | ||
![]() |
ad61b58036 | ||
![]() |
b7722e7037 | ||
![]() |
6c2167b65f | ||
![]() |
18be9882f7 | ||
![]() |
a102c2c22b | ||
![]() |
ae75462254 | ||
![]() |
3ad956e73f | ||
![]() |
d6114165d3 | ||
![]() |
c3a959cc37 | ||
![]() |
ca70beec47 | ||
![]() |
758939215d | ||
![]() |
ab861e56f1 | ||
![]() |
8eb64ad600 | ||
![]() |
d74d3fe851 | ||
![]() |
fefc6a7e6b | ||
![]() |
a119114ad7 | ||
![]() |
430b1a22db | ||
![]() |
a754ea1326 | ||
![]() |
2ecf22e37e | ||
![]() |
9dcd0756ba | ||
![]() |
c455254fd1 | ||
![]() |
bb1f6e6818 | ||
![]() |
0722e91eb9 | ||
![]() |
c859a6f365 | ||
![]() |
ef49850789 | ||
![]() |
4f6f334f41 | ||
![]() |
8cd76d3921 | ||
![]() |
885805b5df | ||
![]() |
d61f260372 | ||
![]() |
d0a48627b2 | ||
![]() |
4b8f13e902 | ||
![]() |
5b9a57f536 | ||
![]() |
ba9963b8fa | ||
![]() |
6887106ff7 | ||
![]() |
98416a4fab | ||
![]() |
fad3288d20 | ||
![]() |
5ecff1e4c3 | ||
![]() |
bfeae0b5f5 | ||
![]() |
1c5336cd57 | ||
![]() |
43c2cf4edb | ||
![]() |
f6d80d66a2 | ||
![]() |
b2ca0babeb | ||
![]() |
ed4ae322f5 | ||
![]() |
4f924ab07e | ||
![]() |
ebadeff0ca | ||
![]() |
830018aa38 | ||
![]() |
8dfddd279b | ||
![]() |
544f2f74df | ||
![]() |
450348d6bd | ||
![]() |
5928ea9c7a | ||
![]() |
4754880099 | ||
![]() |
1fea66e527 | ||
![]() |
806a3163ba | ||
![]() |
08cf6780ba | ||
![]() |
6814907a2c | ||
![]() |
11a8a25528 | ||
![]() |
1b246eecfe | ||
![]() |
95456b8e78 | ||
![]() |
79fc481a2b | ||
![]() |
b9ce871463 | ||
![]() |
0bd78e1cd8 | ||
![]() |
d27f2d8168 | ||
![]() |
407f3f142a | ||
![]() |
61cfbecc74 | ||
![]() |
feeabd08ab | ||
![]() |
31a3432a8e | ||
![]() |
27db045095 | ||
![]() |
db8c75f08d | ||
![]() |
beaada77e6 | ||
![]() |
aefab9293a | ||
![]() |
a6d9310888 | ||
![]() |
bfc09ac211 | ||
![]() |
d930280af5 | ||
![]() |
445e4a9792 | ||
![]() |
aec761916e | ||
![]() |
7d750d2b92 | ||
![]() |
bdf1724412 | ||
![]() |
9cea2dfb8f | ||
![]() |
00dec36c72 | ||
![]() |
26a651f7ae | ||
![]() |
b64f0dace3 | ||
![]() |
a7b95cacb6 | ||
![]() |
ac0e0351a0 | ||
![]() |
2245ac2f88 | ||
![]() |
1bfaf76dd0 | ||
![]() |
88513d2d1a | ||
![]() |
91bc396178 | ||
![]() |
d3fdbe48ae | ||
![]() |
2c086105b1 | ||
![]() |
aed98c5125 | ||
![]() |
2d77f7cd48 | ||
![]() |
d5affe1ada | ||
![]() |
d61688923d | ||
![]() |
4aee6822ca | ||
![]() |
038542ea3e | ||
![]() |
beb14ca6d6 | ||
![]() |
4114129ac0 | ||
![]() |
6d24719167 | ||
![]() |
2393c94363 | ||
![]() |
372203f1fa | ||
![]() |
691468174b | ||
![]() |
6f8d439717 | ||
![]() |
f3ab5d5500 | ||
![]() |
8f467b4288 | ||
![]() |
4adcf7e9ed | ||
![]() |
9f8c40ed78 | ||
![]() |
cda9d7e579 | ||
![]() |
c27d2d4b93 | ||
![]() |
003afef541 | ||
![]() |
09bbca2f61 | ||
![]() |
0a305eb79f | ||
![]() |
aff5408633 | ||
![]() |
31626d4c6f | ||
![]() |
426ec2d399 | ||
![]() |
a632f6d5b1 | ||
![]() |
83c199bb00 | ||
![]() |
2ec6d08613 | ||
![]() |
42271ad463 | ||
![]() |
57ee847ce7 | ||
![]() |
985bd18904 | ||
![]() |
2d1f798d14 | ||
![]() |
9e9f70a693 | ||
![]() |
1b9d311b5c | ||
![]() |
4d437416da | ||
![]() |
267b942383 | ||
![]() |
142cb601f8 | ||
![]() |
21b523fcd3 | ||
![]() |
006cab3e9e | ||
![]() |
4e909ee8b1 | ||
![]() |
95df5d042c | ||
![]() |
22059858fe | ||
![]() |
82107a02f5 | ||
![]() |
515893595d | ||
![]() |
3800be3898 | ||
![]() |
c9ad952604 | ||
![]() |
2a09ffc648 | ||
![]() |
821d8fee3b | ||
![]() |
42224594b6 | ||
![]() |
d369a2b775 | ||
![]() |
a5f4cfc612 | ||
![]() |
23e5402bec | ||
![]() |
391e8afd1f | ||
![]() |
eff2c3a621 | ||
![]() |
de48e4e4df | ||
![]() |
c4a694862c | ||
![]() |
1e076a4ae0 | ||
![]() |
188311863a | ||
![]() |
0eb083e979 | ||
![]() |
abe61b9926 | ||
![]() |
54e49d10d2 | ||
![]() |
ef75829878 | ||
![]() |
a19341b57a | ||
![]() |
c9549391d1 | ||
![]() |
2b767161da | ||
![]() |
7c9631081d | ||
![]() |
b6f29bef06 | ||
![]() |
6abbbaad1b | ||
![]() |
fe5f448015 | ||
![]() |
7beb473a3d | ||
![]() |
19bc92289d | ||
![]() |
4e4f6c1ec8 | ||
![]() |
459e67b2a7 | ||
![]() |
51ba24991c | ||
![]() |
dfa0fd5b33 | ||
![]() |
f7ef60c13f | ||
![]() |
8b2bfa4212 | ||
![]() |
a6c915aab9 | ||
![]() |
a8323cc3f5 | ||
![]() |
aa29735868 | ||
![]() |
a059e9241e | ||
![]() |
acd637160f | ||
![]() |
ddb2783f9a | ||
![]() |
8fa895d65e | ||
![]() |
33b658a341 | ||
![]() |
df725aade2 | ||
![]() |
d84440d53b | ||
![]() |
0c1ae21c11 | ||
![]() |
f30959c6bd | ||
![]() |
d7e406e020 | ||
![]() |
638e3c070c | ||
![]() |
07aeac37fd | ||
![]() |
6ec76e7f9a | ||
![]() |
cb9951dcad | ||
![]() |
0776701396 | ||
![]() |
39de6c784c | ||
![]() |
e5c4482088 | ||
![]() |
975c171d5a | ||
![]() |
7d7f63059a | ||
![]() |
8c6c0a7bcc | ||
![]() |
aa41743ebd | ||
![]() |
ee5f13cb6b | ||
![]() |
974145f61c | ||
![]() |
849318138e | ||
![]() |
6a04c0878b | ||
![]() |
db80e18308 | ||
![]() |
3081207a4c | ||
![]() |
8085c7a450 | ||
![]() |
842de91168 | ||
![]() |
4c621bc697 | ||
![]() |
938458b330 | ||
![]() |
651dad0cc1 | ||
![]() |
f591ab3ba0 | ||
![]() |
09aa4cf2ca | ||
![]() |
61c0bdb09c | ||
![]() |
89367d47a8 | ||
![]() |
7fdfd938e0 | ||
![]() |
e526b5ffeb | ||
![]() |
adb974960d | ||
![]() |
2acc92828f | ||
![]() |
a1d1f43e6a | ||
![]() |
aac739ccd2 | ||
![]() |
c3d1b07c45 | ||
![]() |
77bafd823b | ||
![]() |
624b5f228b | ||
![]() |
6d233becf0 | ||
![]() |
2bcd13aaee | ||
![]() |
20723cb792 | ||
![]() |
b93ad10fa5 | ||
![]() |
28e2007767 | ||
![]() |
802f1e4406 | ||
![]() |
a37cc6cb08 | ||
![]() |
6cea51585f | ||
![]() |
fce9c3a9f1 | ||
![]() |
969903ebf2 | ||
![]() |
7b3f86152a | ||
![]() |
ea1362a936 | ||
![]() |
f62a5b83a9 | ||
![]() |
a834b98232 | ||
![]() |
152cf6325d | ||
![]() |
c98ab69cc7 | ||
![]() |
f7cce15156 | ||
![]() |
3072c5b8a1 | ||
![]() |
ac1ab03cb0 | ||
![]() |
2ef72f7abb | ||
![]() |
eae27d1788 | ||
![]() |
a3787eff19 | ||
![]() |
836d945ece | ||
![]() |
2816902f0e | ||
![]() |
f72a26d340 | ||
![]() |
387521bb6d | ||
![]() |
a4da82a43b | ||
![]() |
bc90fefb5b | ||
![]() |
c3d871aef4 | ||
![]() |
59e378f48f | ||
![]() |
a622fd90b4 | ||
![]() |
861b647e7b | ||
![]() |
70e57dad88 | ||
![]() |
91ff938035 | ||
![]() |
3acd1146f9 | ||
![]() |
45d3bfff28 | ||
![]() |
18110b519c | ||
![]() |
4c9768565e | ||
![]() |
873e734c39 | ||
![]() |
747e0c657d | ||
![]() |
780f13db30 | ||
![]() |
62519bfe05 | ||
![]() |
29f7f468ce | ||
![]() |
9c36a5fd06 | ||
![]() |
4558c8f37a | ||
![]() |
bb67388bbe | ||
![]() |
3dcd2b82c4 | ||
![]() |
c0f3e32447 | ||
![]() |
8733e087d7 | ||
![]() |
9f9e577640 | ||
![]() |
9813cea1d0 | ||
![]() |
304537c24f | ||
![]() |
cc0054a4d5 | ||
![]() |
29ec219b82 | ||
![]() |
0994d7811f | ||
![]() |
934708d950 | ||
![]() |
bbc002a505 | ||
![]() |
c8d4e8b5d0 | ||
![]() |
18a21d5802 | ||
![]() |
fcb63f3039 | ||
![]() |
91d7a6f8a9 | ||
![]() |
238db14002 | ||
![]() |
d0995204da |
372
CHANGES
372
CHANGES
@@ -6,6 +6,378 @@
|
||||
|
||||
Changelog
|
||||
|
||||
Version 7.19.1 (5 November 2008)
|
||||
|
||||
Daniel Stenberg (4 Nov 2008)
|
||||
- CURLINFO_FILETIME now works for file:// transfers as well
|
||||
|
||||
Daniel Stenberg (3 Nov 2008)
|
||||
- Bug #2218480 (http://curl.haxx.se/bug/view.cgi?id=2218480) pointed out a
|
||||
problem with my CURLINFO_PRIMARY_IP fix from October 7th that caused a NULL
|
||||
pointer read. I also took the opportunity to clean up this logic (storing of
|
||||
the connection's IP address) somewhat as we had it stored in two different
|
||||
places and ways previously and they are now unified.
|
||||
|
||||
Yang Tse (3 Nov 2008)
|
||||
- Fix undersized IPv6 address internal buffer. IPv6 address strings longer
|
||||
than 35 characters would be truncated.
|
||||
|
||||
Daniel Stenberg (2 Nov 2008)
|
||||
- Daniel Johnson reported and fixed:
|
||||
|
||||
When c-ares isn't enabled, libcurl by default calls getaddrinfo with family
|
||||
set to PF_UNSPEC which causes getaddrinfo to return all available addresses,
|
||||
both IPv4 and IPv6. Libcurl then tries each one until it can connect. If the
|
||||
net connection doesn't support IPv6, libcurl can still fall back to IPv4.
|
||||
|
||||
However, since c-ares doesn't support PF_UNSPEC, when it's used it defaults
|
||||
to using family=PF_INET6 and therefore only returns IPv6 addresses when AAAA
|
||||
records are available, even if IPv4 addresses are also available. The effect
|
||||
is that since my ISP doesn't do IPv6, libcurl can't connect at all to a site
|
||||
that has AAAA records. It will work if I explicitly use CURL_IPRESOLVE_V4 or
|
||||
--ipv4 with the curl tool. I discovered this when curl would fail to connect
|
||||
to seemingly random sites. It turns out they weren't random, they were sites
|
||||
with AAAA records.
|
||||
|
||||
So now libcurl defaults to PF_INET... until c-ares has been tought to offer
|
||||
both.
|
||||
|
||||
Yang Tse (31 Oct 2008)
|
||||
- Tests 558 and 559 are stabilized. These two tests were initially introduced
|
||||
to aid in the location of a seg-fault which was only triggered on non-debug
|
||||
builds done with the icc 9.1 Intel compiler. Test 558 does not trigger the
|
||||
problem, but test 559 does trigger it. As of today, it isn't yet absolutely
|
||||
clear if it is a compiler optimizer issue or a memory corruption one.
|
||||
|
||||
Yang Tse (30 Oct 2008)
|
||||
- Use our Curl_addrinfo structure definition to handle address info data even
|
||||
when a system addrinfo struct is available. Provide and use a wrapper around
|
||||
systems getaddrinfo function, Curl_getaddrinfo_ex which returns a pointer to
|
||||
a list of dynamically allocated Curl_addrinfo structs.
|
||||
|
||||
Configure will check freeaddrinfo and getaddrinfo functions and define
|
||||
preprocessor symbols HAVE_FREEADDRINFO and HAVE_GETADDRINFO when appropriate.
|
||||
|
||||
Daniel Fandrich (29 Oct 2008)
|
||||
- Fixed a bug that caused a few bytes of garbage to be sent after a
|
||||
curl_easy_pause() during a chunky upload. Reported by Steve Roskowski.
|
||||
|
||||
Daniel Fandrich (28 Oct 2008)
|
||||
- Changed the "resolve" test precheck program to verify that an IPv6 socket
|
||||
can be created before resolving the IPv6 name. In the context of running
|
||||
a test, it doesn't make sense to run an IPv6 test when a host is resolvable
|
||||
but IPv6 isn't usable. This should fix failures of test 1085 on hosts with
|
||||
library and DNS support for IPv6 but where actual use of IPv6 has been
|
||||
administratively disabled.
|
||||
|
||||
Daniel Fandrich (24 Oct 2008)
|
||||
- Added experimental support for zlib and OpenSSL on Symbian OS.
|
||||
|
||||
Daniel Fandrich (21 Oct 2008)
|
||||
- Fixed some problems with SFTP range support to fix test cases 634 through
|
||||
637.
|
||||
|
||||
Daniel Fandrich (17 Oct 2008)
|
||||
- Fixed a compile error reported by Albert Chin on AIX and IRIX when using
|
||||
GTLS.
|
||||
|
||||
Daniel Stenberg (16 Oct 2008)
|
||||
- Igor Novoseltsev added CURLOPT_PROXYUSER and CURLOPT_PROXYPASSWORD that then
|
||||
make CURLOPT_PROXYUSERPWD sort of deprecated. The primary motive for adding
|
||||
these new options is that they have no problems with the colon separator
|
||||
that the CURLOPT_PROXYUSERPWD option does.
|
||||
|
||||
Daniel Stenberg (15 Oct 2008)
|
||||
- Pascal Terjan filed bug #2154627
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2154627) which pointed out that libcurl
|
||||
uses strcasecmp() in multiple places where it causes failures when the
|
||||
Turkish locale is used. This is because 'i' and 'I' isn't the same letter so
|
||||
strcasecmp() on those letters are different in Turkish than in English (or
|
||||
just about all other languages). I thus introduced a totally new internal
|
||||
function in libcurl (called Curl_raw_equal) for doing case insentive
|
||||
comparisons for english-(ascii?) style strings that thus will make "file"
|
||||
and "FILE" match even if the Turkish locale is selected.
|
||||
|
||||
Daniel Fandrich (15 Oct 2008)
|
||||
- A <precheck> command is considered to have failed if it returns a non-zero
|
||||
return code. This way, if the precheck command can't be run at all for
|
||||
whatever reason, it's treated as a precheck failure which causes the
|
||||
test to be skipped.
|
||||
|
||||
Daniel Stenberg (15 Oct 2008)
|
||||
- John Wilkinson filed bug #2155496
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2155496) pointing out an error case
|
||||
without a proper human-readable error message. When a read callback returns
|
||||
a too large value (like when trying to return a negative number) it would
|
||||
trigger and the generic error message then makes the proplem slightly
|
||||
different to track down. I've added an error message for this now.
|
||||
|
||||
Daniel Fandrich (9 Oct 2008)
|
||||
- Fixed the --interface option to work with IPv6 connections on glibc
|
||||
systems supporting getifaddrs(). Also fixed a problem where an IPv6
|
||||
address could be chosen instead of an IPv4 one for --interface when it
|
||||
involved a name lookup.
|
||||
|
||||
Daniel Fandrich (8 Oct 2008)
|
||||
- Added tests 1082 through 1085 to test symbolic --interface parameters
|
||||
|
||||
- Added tests 633 through 637 to test the new file range support for SFTP.
|
||||
All but the first test cause an infinite loop or other failure and so
|
||||
are added to DISABLED.
|
||||
|
||||
Daniel Stenberg (8 Oct 2008)
|
||||
- John Wilkinson filed bug #2152270
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2152270) which identified and fixed a
|
||||
CURLINFO_REDIRECT_URL memory leak and an additional wrong-doing:
|
||||
|
||||
Any subsequent transfer with a redirect leaks memory, eventually crashing
|
||||
the process potentially.
|
||||
|
||||
Any subsequent transfer WITHOUT a redirect causes the most recent redirect
|
||||
that DID occur on some previous transfer to still be reported.
|
||||
|
||||
- Igor Novoseltsev filed bug #2111613
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2111613) that eventually identified a
|
||||
flaw in how the multi_socket interface in some cases missed to call the
|
||||
timeout callback when easy interfaces are removed and added within the same
|
||||
millisecond.
|
||||
|
||||
- Igor Novoseltsev brought a patch that introduced two new options to
|
||||
curl_easy_setopt: CURLOPT_USERNAME and CURLOPT_PASSWORD that sort of
|
||||
deprecates the good old CURLOPT_USERPWD since they allow applications to set
|
||||
the user name and password independently and perhaps more importantly allow
|
||||
both to contain colon(s) which CURLOPT_USERPWD doesn't fully support.
|
||||
|
||||
Daniel Fandrich (7 Oct 2008)
|
||||
- Changed the handling of read/write errors in Curl_perform() to allow a
|
||||
a fresh connection to be made in such cases and the request retransmitted.
|
||||
This should fix test case 160. Added test case 1079 in an attempt to
|
||||
test a similar connection dropping scenario, but as a race condition, it's
|
||||
hard to test reliably.
|
||||
|
||||
- Created test cases 1080 and 1081 to reproduce a problem of
|
||||
CURLINFO_REDIRECT_URL leaking memory and returning incorrect results when
|
||||
two URLs are requested. Reported by vmpdemo in bug #2152270
|
||||
|
||||
Daniel Stenberg (7 Oct 2008)
|
||||
- Fixed CURLINFO_PRIMARY_IP: When libcurl created a connection to host A then
|
||||
the app re-used the handle to do a connection to host B and then again
|
||||
re-used the handle to host A, it would not update the info with host A's IP
|
||||
address (due to the connection being re-used) but it would instead report
|
||||
the info from host B.
|
||||
|
||||
Yang Tse (7 Oct 2008)
|
||||
- Added --enable-optimize configure option to enable and disable compiler
|
||||
optimizations to allow decoupled setting from --enable-debug.
|
||||
|
||||
Yang Tse (2 Oct 2008)
|
||||
- Added --enable-warnings configure option to enable and disable strict
|
||||
compiler warnings to allow decoupled setting from --enable-debug.
|
||||
|
||||
runtests.pl will now run with picky compiler warnings enabled unless
|
||||
explicitly disabled.
|
||||
|
||||
Daniel Fandrich (1 Oct 2008)
|
||||
- "make clean" now cleans out the docs and tests directories, too.
|
||||
|
||||
Daniel Stenberg (30 Sep 2008)
|
||||
- The libcurl FTP code now returns CURLE_REMOTE_FILE_NOT_FOUND error when SIZE
|
||||
gets a 550 response back for the cases where a download (or NOBODY) is
|
||||
wanted. It still allows a 550 as response if the SIZE is used as part of an
|
||||
upload process (like if resuming an upload is requested and the file isn't
|
||||
there before the upload). I also modified the FTP test server and a few test
|
||||
cases accordingly to match this modified behavior.
|
||||
|
||||
Daniel Stenberg (29 Sep 2008)
|
||||
- Daniel Egger provided a patch that allows you to disable proxy support in
|
||||
libcurl to somewhat reduce the size of the binary. Run configure
|
||||
--disable-proxy.
|
||||
|
||||
Daniel Fandrich (29 Sep 2008)
|
||||
- Moved all signal-based name resolution timeout handling into a single new
|
||||
Curl_resolv_timeout function to reduce coupling.
|
||||
|
||||
Daniel Stenberg (29 Sep 2008)
|
||||
- Ian Lynagh provided a patch that now makes CURLOPT_RANGE work fine for SFTP
|
||||
downloads!
|
||||
|
||||
- Maxim Ivanov filed bug report #2107803
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2107803) "no CURLINFO_REDIRECT_URL in
|
||||
multi mode" together with a patch that fixed the problem.
|
||||
|
||||
Daniel Stenberg (25 Sep 2008)
|
||||
- Emanuele Bovisio submitted bug report #2126435. We fixed the HTTP Digest
|
||||
auth code to not behave badly when getting a blank realm with
|
||||
realm="". http://curl.haxx.se/bug/view.cgi?id=2126435
|
||||
|
||||
Daniel Fandrich (23 Sep 2008)
|
||||
- Make sure not to dereference the wrong UrlState proto union member when
|
||||
switching from one protocol to another in a single request (e.g.
|
||||
redirecting from HTTP to FTP as in test 1055) by resetting
|
||||
state.expect100header before every request.
|
||||
|
||||
Daniel Stenberg (23 Sep 2008)
|
||||
- Introducing Jamie Lokier's function for date to epoch conversion used in the
|
||||
date parser function. This makes our function less dependent on system-
|
||||
provided functions and instead we do all the magic ourselves. We also no
|
||||
longer depend on the TZ environment variable. Switching to our own converter
|
||||
has some side-effect and they are noted here for future reference (taken
|
||||
from a mail by mr Lokier):
|
||||
|
||||
time_t is not measured in seconds in the ANSI C standard - or even counted
|
||||
uniformly - weird platforms can use other numeric representations of dates
|
||||
in time_t - hence the difftime() function.
|
||||
|
||||
On POSIX time_t is measured in UTC seconds, which means not including leap
|
||||
seconds. But it's mentioned in a few places that some old POSIX-ish
|
||||
environments include leap seconds in their time_t counts...
|
||||
|
||||
I'm pretty sure [the new implementation is] correct on anything truly POSIX.
|
||||
And it's obviously a lot less dependent on platform quirks and corner cases
|
||||
in many ways than the mktime() version.
|
||||
|
||||
- Rob Crittenden brought a patch to "add some locking for thread-safety to NSS
|
||||
implementation".
|
||||
|
||||
Daniel Stenberg (22 Sep 2008)
|
||||
- Made the SOCKS code use the new Curl_read_plain() function to fix the bug
|
||||
Markus Moeller reported: http://curl.haxx.se/mail/archive-2008-09/0016.html
|
||||
|
||||
- recv() errors other than those equal to EAGAIN now cause proper
|
||||
CURLE_RECV_ERROR to get returned. This made test case 160 fail so I've now
|
||||
disabled it until we can figure out another way to exercise that logic.
|
||||
|
||||
- Michael Goffioul filed bug report #2107377 "Problem with multi + GnuTLS +
|
||||
proxy" (http://curl.haxx.se/bug/view.cgi?id=2107377) that showed how a multi
|
||||
interface using program didn't work when built with GnuTLS and a CONNECT
|
||||
request was done over a proxy (basically test 502 over a proxy to a HTTPS
|
||||
site). It turned out the ssl connect function would get called twice which
|
||||
caused the second call to fail.
|
||||
|
||||
Daniel Fandrich (22 Sep 2008)
|
||||
- Fixed test 539 to handle an out of memory condition that shows up now
|
||||
that memdebug.h is included in the test programs.
|
||||
|
||||
Yang Tse (20 Sep 2008)
|
||||
- Fix regression in configure script which affected OpenSSL builds on MSYS.
|
||||
|
||||
Yang Tse (19 Sep 2008)
|
||||
- configure script now checks availability of the alarm() function.
|
||||
|
||||
Daniel Fandrich (18 Sep 2008)
|
||||
- Don't bother to install a SIGALRM handler unless alarm() is available.
|
||||
Also, leave the existing SIGALRM handler alone if the timeout is too small
|
||||
to handle.
|
||||
|
||||
Daniel Fandrich (17 Sep 2008)
|
||||
- Removed reference to curl-ca-bundle.crt in the host verification failure
|
||||
error message.
|
||||
|
||||
Yang Tse (17 Sep 2008)
|
||||
- Improve configure detection of gethostname(), localtime_r(), strstr(),
|
||||
getservbyport_r(), gethostbyaddr_r() and gethostbyname_r().
|
||||
|
||||
Yang Tse (14 Sep 2008)
|
||||
- Improve configure detection of strcasecmp(), strcasestr(), strcmpi(),
|
||||
stricmp(), strlcat(), strncasecmp(), strncmpi() and strnicmp().
|
||||
|
||||
Yang Tse (13 Sep 2008)
|
||||
- Disable tracking of fdopen() calls in the low-level memory leak tracking
|
||||
code when fdopen() is not available, to avoid compiler error.
|
||||
|
||||
Yang Tse (12 Sep 2008)
|
||||
- Further adjust detection of strerror_r() in the configure process, and
|
||||
ensure that errno is not modified inside Curl_strerror().
|
||||
|
||||
Yang Tse (10 Sep 2008)
|
||||
- Improve detection of gmtime_r(), strtoll(), sigaction(), strtok_r(),
|
||||
strdup() and ftruncate() in the configure process.
|
||||
|
||||
Daniel Fandrich (9 Sep 2008)
|
||||
- Mike Revi discovered some swapped speed switches documented in the curl man
|
||||
page.
|
||||
|
||||
- Checked in some documentation and code improvements and fixes that I
|
||||
discovered in the FreeBSD ports system.
|
||||
|
||||
Daniel Stenberg (8 Sep 2008)
|
||||
- Dmitry Kurochkin patched a problem: I have found bug in pipelining through
|
||||
proxy. I have a transparent proxy. When running with http_proxy environment
|
||||
variable not set my test completes fine (it goes through transparent
|
||||
proxy). When I set http_proxy variable my test hangs after the first
|
||||
downloaded is complete. Looks like the second handle never gets out from
|
||||
WAITDO state.
|
||||
|
||||
The fix: It makes checkPendPipeline move 1 handler from pend pipe to send
|
||||
pipe if pipelining is not supported by server but there are no handles in
|
||||
send and recv pipes.
|
||||
|
||||
- Stefan Krause pointed out that libcurl would wrongly send away cookies to
|
||||
sites in cases where the cookie clearly has a very old expiry date. The
|
||||
condition was simply that libcurl's date parser would fail to convert the
|
||||
date and it would then count as a (timed-based) match. Starting now, a
|
||||
missed date due to an unsupported date format or date range will now cause
|
||||
the cookie to not match.
|
||||
|
||||
Daniel Fandrich (5 Sep 2008)
|
||||
- Improved the logic that decides whether to use HTTP 1.1 features or not in a
|
||||
request. Setting a specific version with CURLOPT_HTTP_VERSION overrides
|
||||
all other checks, but otherwise, a 1.0 request will be made if the server
|
||||
is known to support only 1.0 because it previously responded so and the
|
||||
connection was kept alive, or a response to a previous request on this handle
|
||||
came back as 1.0. The latter could take place in cases like redirection or
|
||||
authentication where several requests have to be made before the operation
|
||||
is complete. If any one of the servers in a redirection chain supports only
|
||||
1.0, then remaining requests will be sent in 1.0 mode.
|
||||
|
||||
- Detect cases where an upload must be sent chunked and the server supports
|
||||
only HTTP 1.0 and return CURLE_UPLOAD_FAILED.
|
||||
|
||||
Daniel Stenberg (5 Sep 2008)
|
||||
- Martin Drasar provided the CURLOPT_POSTREDIR patch. It renames
|
||||
CURLOPT_POST301 (but adds a define for backwards compatibility for you who
|
||||
don't define CURL_NO_OLDIES). This option allows you to now also change the
|
||||
libcurl behavior for a HTTP response 302 after a POST to not use GET in the
|
||||
subsequent request (when CURLOPT_FOLLOWLOCATION is enabled). I edited the
|
||||
patch somewhat before commit. The curl tool got a matching --post302
|
||||
option. Test case 1076 was added to verify this.
|
||||
|
||||
- Introducing CURLOPT_CERTINFO and the corresponding CURLINFO_CERTINFO. By
|
||||
enabling this feature with CURLOPT_CERTINFO for a request using SSL (HTTPS
|
||||
or FTPS), libcurl will gather lots of server certificate info and that info
|
||||
can then get extracted by a client after the request has completed with
|
||||
curl_easy_getinfo()'s CURLINFO_CERTINFO option. Linus Nielsen Feltzing
|
||||
helped me test and smoothen out this feature.
|
||||
|
||||
Unfortunately, this feature currently only works with libcurl built to use
|
||||
OpenSSL.
|
||||
|
||||
This feature was sponsored by networking4all.com - thanks!
|
||||
|
||||
- Dmitriy Sergeyev pointed out that curl_easy_pause() didn't unpause properly
|
||||
during certain conditions. I also changed this code to use realloc() based
|
||||
on Daniel Fandrich's suggestion.
|
||||
|
||||
Guenter Knauf (4 Sep 2008)
|
||||
- MingW32 non-configure builds are now largefile feature enabled by default.
|
||||
NetWare LIBC builds are also now largefile feature enabled by default.
|
||||
|
||||
Yang Tse (4 Sep 2008)
|
||||
- Several fixes related with print formatting string directives.
|
||||
|
||||
Daniel Fandrich (3 Sep 2008)
|
||||
- Search for the FreeBSD CA cert file /usr/local/share/certs/ca-root.crt
|
||||
|
||||
Daniel Fandrich (2 Sep 2008)
|
||||
- Fixed an out of memory problem that caused torture test failures in tests
|
||||
706 and 707.
|
||||
|
||||
Daniel Stenberg (2 Sep 2008)
|
||||
- Keith Mok added supported_protocols and supported_features to the pkg-config
|
||||
file for libcurl, and while doing that fix he unified with curl-config.in
|
||||
how the supported protocols and features are extracted and used, so both those
|
||||
tools should now always be synced.
|
||||
|
||||
Version 7.19.0 (1 September 2008)
|
||||
|
||||
Daniel Fandrich (29 Aug 2008)
|
||||
|
@@ -77,6 +77,10 @@ endif
|
||||
examples:
|
||||
@(cd docs/examples; $(MAKE) check)
|
||||
|
||||
clean-local:
|
||||
@(cd tests; $(MAKE) clean)
|
||||
@(cd docs; $(MAKE) clean)
|
||||
|
||||
#
|
||||
# Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros
|
||||
# must contain the following line:
|
||||
@@ -105,7 +109,7 @@ rpm:
|
||||
mv $$RPM_TOPDIR/SRPMS/$(RPMDIST)-*.src.rpm .
|
||||
|
||||
#
|
||||
# Build a Solaris pkkgadd format file
|
||||
# Build a Solaris pkgadd format file
|
||||
# run 'make pkgadd' once you've done './configure' and 'make' to make a Solaris pkgadd format
|
||||
# file (which ends up back in this directory).
|
||||
# The pkgadd file is in 'pkgtrans' format, so to install on Solaris, do
|
||||
|
109
RELEASE-NOTES
109
RELEASE-NOTES
@@ -1,69 +1,49 @@
|
||||
Curl and libcurl 7.19.0
|
||||
Curl and libcurl 7.19.1
|
||||
|
||||
Public curl releases: 106
|
||||
Command line options: 127
|
||||
curl_easy_setopt() options: 153
|
||||
Public curl releases: 107
|
||||
Command line options: 128
|
||||
curl_easy_setopt() options: 158
|
||||
Public functions in libcurl: 58
|
||||
Known libcurl bindings: 36
|
||||
Contributors: 654
|
||||
Known libcurl bindings: 37
|
||||
Contributors: 672
|
||||
|
||||
This release includes the following changes:
|
||||
|
||||
o curl_off_t gets its size/typedef somewhat differently than before. This _may_
|
||||
cause an ABI change for you. See lib/README.curl_off_t for a full explanation.
|
||||
|
||||
o Added CURLINFO_PRIMARY_IP
|
||||
o Added CURLOPT_CRLFILE and CURLE_SSL_CRL_BADFILE
|
||||
o Added CURLOPT_ISSUERCERT and CURLE_SSL_ISSUER_ERROR
|
||||
o curl's option parser for boolean options reworked
|
||||
o Added --remote-name-all
|
||||
o Now builds for the INTEGRITY operating system
|
||||
o Added CURLINFO_APPCONNECT_TIME
|
||||
o Added test selection by key word in runtests.pl
|
||||
o the curl tool's -w option support the %{ssl_verify_result} variable
|
||||
o Added CURLOPT_ADDRESS_SCOPE and scope parsing of the URL according to RFC4007
|
||||
o Support --append on SFTP uploads (not with OpenSSH, though)
|
||||
o Added curlbuild.h and curlrules.h to the external library interface
|
||||
o pkg-config can now show supported_protocols and supported_features
|
||||
o Added CURLOPT_CERTINFO and CURLINFO_CERTINFO
|
||||
o Added CURLOPT_POSTREDIR
|
||||
o Better detect HTTP 1.0 servers and don't do HTTP 1.1 requests on them
|
||||
o configure --disable-proxy disables proxy support
|
||||
o Added CURLOPT_USERNAME and CURLOPT_PASSWORD
|
||||
o --interface now works with IPv6 connections on glibc systems
|
||||
o Added CURLOPT_PROXYUSERNAME and CURLOPT_PROXYPASSWORD
|
||||
|
||||
This release includes the following bugfixes:
|
||||
|
||||
o Fixed curl-config --ca
|
||||
o Fixed the multi interface connection re-use with NSS-built libcurl
|
||||
o connection re-use when using the multi interface with pipelining enabled
|
||||
o curl_multi_socket() socket callback fix for close/re-create sockets case
|
||||
o SCP or SFTP over socks proxy crashed
|
||||
o RC4-MD5 cipher now works with NSS-built libcurl
|
||||
o range requests with --head are now done correctly
|
||||
o fallback to gettimeofday when monotonic clock is unavailable at run-time
|
||||
o range numbers could be made to wrongly get output as signed
|
||||
o unexpected 1xx responses hung transfers
|
||||
o FTP transfers segfault when using different CURLOPT_FTP_FILEMETHOD
|
||||
o c-ares powered libcurls can resolve/use IPv6 addresses
|
||||
o poll not working on Windows Vista due to POLLPRI being incorrectly used
|
||||
o user-agent in CONNECT with non-HTTP protocols
|
||||
o CURL_READFUNC_PAUSE problems fixed
|
||||
o --use-ascii now works on Symbian OS, MS-DOS and OS/2
|
||||
o CURLINFO_SSL_VERIFYRESULT is fixed
|
||||
o FTP URLs and IPv6 URLs mangled when sent to proxy with CURLOPT_PORT set
|
||||
o a user name in a proxy URL without a password was parsed incorrectly
|
||||
o library will now be built with _REENTRANT symbol defined only if needed
|
||||
o no longer link with gdi32 on Windows cross-compiled targets
|
||||
o HTTP PUT with -C - sent bad Content-Range: header
|
||||
o HTTP PUT or POST with redirect could lead to hang
|
||||
o re-use of connections with failed SSL connects in the multi interface
|
||||
o NTLM over proxy state was wrongly cleared when host connection was closed
|
||||
o Windows SSPI DLL loading is now done in curl_global_init()
|
||||
o runtests.pl has an improved find-stunnel-and-invoke
|
||||
o FTP sessions could go out of sync on a long header boundary condition
|
||||
o potential buffer overflows in the MS-DOS command-line port fixed
|
||||
o --stderr is now honoured with the -v option
|
||||
o memory leak in libcurl on Windows built with OpenSSL
|
||||
o improved curl_m*printf() integral data type size and signedness handling
|
||||
o error when --dump-header - used with more than one URL
|
||||
o proxy closing connect during CONNECT with auth with the multi interface
|
||||
o CURLOPT_UPLOAD sets HTTP method back to GET or HEAD when passed in a 0
|
||||
o shared cookies could get locked twice
|
||||
o deal with closed connection while doing POST/PUT
|
||||
o MingW32 non-configure builds are now largefile feature enabled by default
|
||||
o NetWare LIBC builds are now largefile feature enabled by default
|
||||
o curl_easy_pause() could behave wrongly on unpause
|
||||
o cookies with invalid expire dates are now considered expired
|
||||
o HTTP pipelining over proxy
|
||||
o fix regression in configure script which affected OpenSSL builds on MSYS
|
||||
o GnuTLS-based multi interface doing HTTPS over proxy failed
|
||||
o recv() failures cause CURLE_RECV_ERROR
|
||||
o SFTP over SOCKS crash fixed
|
||||
o thread-safety issues addressed for NSS-powered libcurls
|
||||
o removed the use of mktime() and gmtime(_r)() in date parsing and conversions
|
||||
o HTTP Digest with a blank realm did wrong
|
||||
o CURLINFO_REDIRECT_URL didn't work with the multi interface
|
||||
o CURLOPT_RANGE now works for SFTP downloads
|
||||
o FTP SIZE response 550 now causes CURLE_REMOTE_FILE_NOT_FOUND
|
||||
o CURLINFO_PRIMARY_IP fixed for persistent connection re-use cases
|
||||
o remove_handle/add_handle multi interface timer callback flaw
|
||||
o CURLINFO_REDIRECT_URL memory leak and wrong-doing
|
||||
o case insensitive string matching works in Turkish too
|
||||
o Solaris builds get _REENTRANT defined properly and work again
|
||||
o Garbage sent on chunky upload after curl_easy_pause()
|
||||
o ipv4 name resolves when libcurl is built with ipv6-enabled c-ares
|
||||
o undersized IPv6 address internal buffer truncated long IPv6 addresses
|
||||
o CURLINFO_FILETIME works for file:// transfers as well
|
||||
|
||||
This release includes the following known bugs:
|
||||
|
||||
@@ -76,13 +56,12 @@ Other curl-related news:
|
||||
This release would not have looked like this without help, code, reports and
|
||||
advice from friends like these:
|
||||
|
||||
Lenny Rachitsky, Axel Tillequin, Arnaud Ebalard, Yang Tse, Dan Fandrich,
|
||||
Rob Crittenden, Dengminwen, Christopher Palow, Hans-Jurgen May,
|
||||
Phil Pellouchoud, Eduard Bloch, John Lightsey, Stephen Collyer, Tor Arntsen,
|
||||
Rolland Dudemaine, Phil Blundell, Scott Barrett, Andreas Schuldei,
|
||||
Peter Lamberg, David Bau, Pramod Sharma, Yehoshua Hershberg,
|
||||
Constantine Sapuntzakis, Lars Nilsson, Andy Tsouladze, Jamie Lokier,
|
||||
Vincent Le Normand
|
||||
Keith Mok, Yang Tse, Daniel Fandrich, Guenter Knauf, Dmitriy Sergeyev,
|
||||
Linus Nielsen Feltzing, Martin Drasar, Stefan Krause, Dmitry Kurochkin,
|
||||
Mike Revi, Andres Garcia, Michael Goffioul, Markus Moeller, Rob Crittenden,
|
||||
Jamie Lokier, Emanuele Bovisio, Maxim Ivanov, Ian Lynagh, Daniel Egger,
|
||||
Igor Novoseltsev, John Wilkinson, Pascal Terjan, Steve Roskowski,
|
||||
Daniel Johnson
|
||||
|
||||
|
||||
Thanks! (and sorry if I forgot to mention someone)
|
||||
|
26
TODO-RELEASE
26
TODO-RELEASE
@@ -1,26 +1,18 @@
|
||||
To be addressed before 7.19.0 (planned release: August 2008)
|
||||
To be addressed before 7.19.1 (planned release: November 2008)
|
||||
=============================
|
||||
|
||||
To be addressed in 7.19.2 (planned release: January 2009)
|
||||
=========================
|
||||
|
||||
To be addressed before 7.19.1 (planned release: October 2008)
|
||||
=============================
|
||||
188 - "Curl keep special character in filename when saving" bug #2192220
|
||||
|
||||
157 - the CERTINFO patch as posted to:
|
||||
http://curl.haxx.se/mail/lib-2008-08/0105.html
|
||||
189 - "NTLM authentication and POST wrong behavior" bug #2203193
|
||||
|
||||
158 - Martin Drasar's CURLOPT_POSTREDIR work:
|
||||
http://curl.haxx.se/mail/lib-2008-08/0170.html
|
||||
190 - "Using NTLM proxy will lose form-data. Makes NTLM unusable." bug #2210686
|
||||
|
||||
162 - Craig Perras' note "http upload: how to stop on error"
|
||||
http://curl.haxx.se/mail/archive-2008-08/0138.html
|
||||
191 - "proposed patch for curl/libssh2 bugfix"
|
||||
http://curl.haxx.se/mail/archive-2008-10/0000.html
|
||||
|
||||
163 - Detecting illegal attempts at chunked transfers on HTTP 1.0
|
||||
(tests 1069, 1072, 1073)
|
||||
http://curl.haxx.se/mail/archive-2008-08/0435.html
|
||||
|
||||
164 - Automatic downgrading to HTTP 1.0 (tests 1071 through 1074)
|
||||
192 -
|
||||
|
||||
165 - "Problem with CURLOPT_RESUME_FROM and CURLOPT_APPEND" by Daniele Pinau,
|
||||
recipe: http://curl.haxx.se/mail/lib-2008-08/0439.html
|
||||
|
||||
166 -
|
||||
|
770
acinclude.m4
770
acinclude.m4
@@ -1235,6 +1235,9 @@ AC_DEFUN([CURL_CHECK_NI_WITHSCOPEID], [
|
||||
[ac_cv_working_ni_withscopeid], [
|
||||
AC_RUN_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDIO_H
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
@@ -2317,6 +2320,9 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
|
||||
AC_MSG_CHECKING([if monotonic clock_gettime works])
|
||||
AC_RUN_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
@@ -2559,768 +2565,6 @@ AC_DEFUN([CURL_CHECK_FUNC_SELECT], [
|
||||
])
|
||||
|
||||
|
||||
dnl ************************************************************
|
||||
dnl check for working getaddrinfo() that works with AI_NUMERICHOST
|
||||
dnl
|
||||
AC_DEFUN([CURL_CHECK_WORKING_GETADDRINFO],[
|
||||
AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,[
|
||||
AC_TRY_RUN( [
|
||||
#include <netdb.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
struct addrinfo hints, *ai;
|
||||
int error;
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_flags = AI_NUMERICHOST;
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
error = getaddrinfo("127.0.0.1", "8080", &hints, &ai);
|
||||
if (error) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
],[
|
||||
ac_cv_working_getaddrinfo="yes"
|
||||
],[
|
||||
ac_cv_working_getaddrinfo="no"
|
||||
],[
|
||||
ac_cv_working_getaddrinfo="yes"
|
||||
])])
|
||||
if test "$ac_cv_working_getaddrinfo" = "yes"; then
|
||||
AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if getaddrinfo exists and works])
|
||||
AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
|
||||
|
||||
IPV6_ENABLED=1
|
||||
AC_SUBST(IPV6_ENABLED)
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([CURL_CHECK_LOCALTIME_R],
|
||||
[
|
||||
dnl check for localtime_r
|
||||
AC_CHECK_FUNCS(localtime_r,[
|
||||
AC_MSG_CHECKING(whether localtime_r is declared)
|
||||
AC_EGREP_CPP(localtime_r,[
|
||||
#undef _REENTRANT
|
||||
#include <time.h>],[
|
||||
AC_MSG_RESULT(yes)],[
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING(whether localtime_r with -D_REENTRANT is declared)
|
||||
AC_EGREP_CPP(localtime_r,[
|
||||
#undef _REENTRANT
|
||||
#define _REENTRANT
|
||||
#include <time.h>],[
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))])])
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl This function checks for strerror_r(). If it isn't found at first, it
|
||||
dnl retries with _THREAD_SAFE defined, as that is what AIX seems to require
|
||||
dnl in order to find this function.
|
||||
dnl
|
||||
dnl If the function is found, it will then proceed to check how the function
|
||||
dnl actually works: glibc-style or POSIX-style.
|
||||
dnl
|
||||
dnl glibc:
|
||||
dnl char *strerror_r(int errnum, char *buf, size_t n);
|
||||
dnl
|
||||
dnl What this one does is to return the error string (no surprises there),
|
||||
dnl but it doesn't usually copy anything into buf! The 'buf' and 'n'
|
||||
dnl parameters are only meant as an optional working area, in case strerror_r
|
||||
dnl needs it. A quick test on a few systems shows that it's generally not
|
||||
dnl touched at all.
|
||||
dnl
|
||||
dnl POSIX:
|
||||
dnl int strerror_r(int errnum, char *buf, size_t n);
|
||||
dnl
|
||||
AC_DEFUN([CURL_CHECK_STRERROR_R],
|
||||
[
|
||||
AC_CHECK_FUNCS(strerror_r)
|
||||
|
||||
if test "x$ac_cv_func_strerror_r" = "xyes"; then
|
||||
|
||||
AC_MSG_CHECKING(whether strerror_r is declared)
|
||||
AC_EGREP_CPP(strerror_r,[
|
||||
#undef _REENTRANT
|
||||
#include <string.h>],[
|
||||
AC_MSG_RESULT(yes)],[
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING(whether strerror_r with -D_REENTRANT is declared)
|
||||
AC_EGREP_CPP(strerror_r,[
|
||||
#undef _REENTRANT
|
||||
#define _REENTRANT
|
||||
#include <string.h>],[
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(HAVE_NO_STRERROR_R_DECL, 1, [we have no strerror_r() proto])
|
||||
) dnl with _THREAD_SAFE
|
||||
]) dnl plain cpp for it
|
||||
|
||||
dnl determine if this strerror_r() is glibc or POSIX
|
||||
AC_MSG_CHECKING([for a glibc strerror_r API])
|
||||
AC_TRY_RUN([
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
int
|
||||
main () {
|
||||
char buffer[1024]; /* big enough to play with */
|
||||
char *string =
|
||||
strerror_r(EACCES, buffer, sizeof(buffer));
|
||||
/* this should've returned a string */
|
||||
if(!string || !string[0])
|
||||
return 99;
|
||||
return 0;
|
||||
}
|
||||
],
|
||||
GLIBC_STRERROR_R="1"
|
||||
AC_DEFINE(HAVE_GLIBC_STRERROR_R, 1, [we have a glibc-style strerror_r()])
|
||||
AC_MSG_RESULT([yes]),
|
||||
AC_MSG_RESULT([no]),
|
||||
|
||||
dnl Use an inferior method of strerror_r detection while cross-compiling
|
||||
AC_EGREP_CPP(yes, [
|
||||
#include <features.h>
|
||||
#ifdef __GLIBC__
|
||||
yes
|
||||
#endif
|
||||
],
|
||||
dnl looks like glibc, so assume a glibc-style strerror_r()
|
||||
GLIBC_STRERROR_R="1"
|
||||
AC_DEFINE(HAVE_GLIBC_STRERROR_R, 1, [we have a glibc-style strerror_r()])
|
||||
AC_MSG_RESULT([yes]),
|
||||
AC_MSG_NOTICE([cannot determine strerror_r() style: edit lib/config.h manually!])
|
||||
) dnl while cross-compiling
|
||||
)
|
||||
|
||||
if test -z "$GLIBC_STRERROR_R"; then
|
||||
|
||||
AC_MSG_CHECKING([for a POSIX strerror_r API])
|
||||
AC_TRY_RUN([
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
int
|
||||
main () {
|
||||
char buffer[1024]; /* big enough to play with */
|
||||
int error =
|
||||
strerror_r(EACCES, buffer, sizeof(buffer));
|
||||
/* This should've returned zero, and written an error string in the
|
||||
buffer.*/
|
||||
if(!buffer[0] || error)
|
||||
return 99;
|
||||
return 0;
|
||||
}
|
||||
],
|
||||
AC_DEFINE(HAVE_POSIX_STRERROR_R, 1, [we have a POSIX-style strerror_r()])
|
||||
AC_MSG_RESULT([yes]),
|
||||
AC_MSG_RESULT([no]) ,
|
||||
dnl cross-compiling!
|
||||
AC_MSG_NOTICE([cannot determine strerror_r() style: edit lib/config.h manually!])
|
||||
)
|
||||
|
||||
fi dnl if not using glibc API
|
||||
|
||||
fi dnl we have a strerror_r
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN([CURL_CHECK_INET_NTOA_R],
|
||||
[
|
||||
dnl determine if function definition for inet_ntoa_r exists.
|
||||
AC_CHECK_FUNCS(inet_ntoa_r,[
|
||||
AC_MSG_CHECKING(whether inet_ntoa_r is declared)
|
||||
AC_EGREP_CPP(inet_ntoa_r,[
|
||||
#undef _REENTRANT
|
||||
#include <arpa/inet.h>],[
|
||||
AC_DEFINE(HAVE_INET_NTOA_R_DECL, 1, [inet_ntoa_r() is declared])
|
||||
AC_MSG_RESULT(yes)],[
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING(whether inet_ntoa_r with -D_REENTRANT is declared)
|
||||
AC_EGREP_CPP(inet_ntoa_r,[
|
||||
#undef _REENTRANT
|
||||
#define _REENTRANT
|
||||
#include <arpa/inet.h>],[
|
||||
AC_DEFINE(HAVE_INET_NTOA_R_DECL, 1, [inet_ntoa_r() is declared])
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))])])
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_GETHOSTBYADDR_R
|
||||
dnl -------------------------------------------------
|
||||
dnl check number of arguments for gethostbyaddr_r, it
|
||||
dnl might take either 5, 7, or 8 arguments.
|
||||
|
||||
AC_DEFUN([CURL_CHECK_GETHOSTBYADDR_R], [
|
||||
#
|
||||
AC_MSG_CHECKING([for gethostbyaddr_r])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_FUNC_LINK_TRY([gethostbyaddr_r])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
tmp_cv_gethostbyaddr_r="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
tmp_cv_gethostbyaddr_r="no"
|
||||
])
|
||||
#
|
||||
if test "$tmp_cv_gethostbyaddr_r" != "yes"; then
|
||||
AC_MSG_CHECKING([deeper for gethostbyaddr_r])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
]],[[
|
||||
gethostbyaddr_r();
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
tmp_cv_gethostbyaddr_r="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([but still no])
|
||||
tmp_cv_gethostbyaddr_r="no"
|
||||
])
|
||||
fi
|
||||
#
|
||||
if test "$tmp_cv_gethostbyaddr_r" = "yes"; then
|
||||
|
||||
ac_cv_gethostbyaddr_r_args="unknown"
|
||||
|
||||
AC_MSG_CHECKING([if gethostbyaddr_r takes 5 arguments])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#undef _REENTRANT
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
]],[[
|
||||
char * address;
|
||||
int length;
|
||||
int type;
|
||||
struct hostent h;
|
||||
struct hostent_data hdata;
|
||||
int rc;
|
||||
rc = gethostbyaddr_r(address, length, type, &h, &hdata);
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_GETHOSTBYADDR_R_5, 1, [gethostbyaddr_r() takes 5 args])
|
||||
ac_cv_gethostbyaddr_r_args="5"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
|
||||
if test "$ac_cv_gethostbyaddr_r_args" = "unknown"; then
|
||||
AC_MSG_CHECKING([if gethostbyaddr_r with -D_REENTRANT takes 5 arguments])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#undef _REENTRANT
|
||||
#define _REENTRANT
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
]],[[
|
||||
char * address;
|
||||
int length;
|
||||
int type;
|
||||
struct hostent h;
|
||||
struct hostent_data hdata;
|
||||
int rc;
|
||||
rc = gethostbyaddr_r(address, length, type, &h, &hdata);
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_GETHOSTBYADDR_R_5, 1, [gethostbyaddr_r() takes 5 args])
|
||||
ac_cv_gethostbyaddr_r_args="5"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
fi
|
||||
|
||||
if test "$ac_cv_gethostbyaddr_r_args" = "unknown"; then
|
||||
AC_MSG_CHECKING([if gethostbyaddr_r takes 7 arguments])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#undef _REENTRANT
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
]],[[
|
||||
char * address;
|
||||
int length;
|
||||
int type;
|
||||
struct hostent h;
|
||||
char buffer[8192];
|
||||
int h_errnop;
|
||||
struct hostent * hp;
|
||||
hp = gethostbyaddr_r(address, length, type, &h,
|
||||
buffer, 8192, &h_errnop);
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_GETHOSTBYADDR_R_7, 1, [gethostbyaddr_r() takes 7 args])
|
||||
ac_cv_gethostbyaddr_r_args="7"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
fi
|
||||
|
||||
if test "$ac_cv_gethostbyaddr_r_args" = "unknown"; then
|
||||
AC_MSG_CHECKING([if gethostbyaddr_r with -D_REENTRANT takes 7 arguments])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#undef _REENTRANT
|
||||
#define _REENTRANT
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
]],[[
|
||||
char * address;
|
||||
int length;
|
||||
int type;
|
||||
struct hostent h;
|
||||
char buffer[8192];
|
||||
int h_errnop;
|
||||
struct hostent * hp;
|
||||
hp = gethostbyaddr_r(address, length, type, &h,
|
||||
buffer, 8192, &h_errnop);
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_GETHOSTBYADDR_R_7, 1, [gethostbyaddr_r() takes 7 args])
|
||||
ac_cv_gethostbyaddr_r_args="7"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
fi
|
||||
|
||||
if test "$ac_cv_gethostbyaddr_r_args" = "unknown"; then
|
||||
AC_MSG_CHECKING([if gethostbyaddr_r takes 8 arguments])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#undef _REENTRANT
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
]],[[
|
||||
char * address;
|
||||
int length;
|
||||
int type;
|
||||
struct hostent h;
|
||||
char buffer[8192];
|
||||
int h_errnop;
|
||||
struct hostent * hp;
|
||||
int rc;
|
||||
rc = gethostbyaddr_r(address, length, type, &h,
|
||||
buffer, 8192, &hp, &h_errnop);
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_GETHOSTBYADDR_R_8, 1, [gethostbyaddr_r() takes 8 args])
|
||||
ac_cv_gethostbyaddr_r_args="8"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
fi
|
||||
|
||||
if test "$ac_cv_gethostbyaddr_r_args" = "unknown"; then
|
||||
AC_MSG_CHECKING([if gethostbyaddr_r with -D_REENTRANT takes 8 arguments])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#undef _REENTRANT
|
||||
#define _REENTRANT
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
]],[[
|
||||
char * address;
|
||||
int length;
|
||||
int type;
|
||||
struct hostent h;
|
||||
char buffer[8192];
|
||||
int h_errnop;
|
||||
struct hostent * hp;
|
||||
int rc;
|
||||
rc = gethostbyaddr_r(address, length, type, &h,
|
||||
buffer, 8192, &hp, &h_errnop);
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_GETHOSTBYADDR_R_8, 1, [gethostbyaddr_r() takes 8 args])
|
||||
ac_cv_gethostbyaddr_r_args="8"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
fi
|
||||
|
||||
if test "$ac_cv_gethostbyaddr_r_args" = "unknown"; then
|
||||
AC_MSG_WARN([Cannot find out how to use gethostbyaddr_r])
|
||||
AC_MSG_WARN([HAVE_GETHOSTBYADDR_R will not be defined])
|
||||
ac_cv_func_gethostbyaddr_r="no"
|
||||
else
|
||||
AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYADDR_R, 1,
|
||||
[Define to 1 if you have the gethostbyaddr_r function.])
|
||||
ac_cv_func_gethostbyaddr_r="yes"
|
||||
fi
|
||||
|
||||
else
|
||||
ac_cv_func_gethostbyaddr_r="no"
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_GETHOSTBYNAME_R
|
||||
dnl -------------------------------------------------
|
||||
dnl check number of arguments for gethostbyname_r, it
|
||||
dnl might take either 3, 5, or 6 arguments.
|
||||
|
||||
AC_DEFUN([CURL_CHECK_GETHOSTBYNAME_R], [
|
||||
#
|
||||
AC_MSG_CHECKING([for gethostbyname_r])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_FUNC_LINK_TRY([gethostbyname_r])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
tmp_cv_gethostbyname_r="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
tmp_cv_gethostbyname_r="no"
|
||||
])
|
||||
#
|
||||
if test "$tmp_cv_gethostbyname_r" != "yes"; then
|
||||
AC_MSG_CHECKING([deeper for gethostbyname_r])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
]],[[
|
||||
gethostbyname_r();
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
tmp_cv_gethostbyname_r="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([but still no])
|
||||
tmp_cv_gethostbyname_r="no"
|
||||
])
|
||||
fi
|
||||
#
|
||||
if test "$tmp_cv_gethostbyname_r" = "yes"; then
|
||||
|
||||
ac_cv_gethostbyname_r_args="unknown"
|
||||
|
||||
AC_MSG_CHECKING([if gethostbyname_r takes 3 arguments])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#undef _REENTRANT
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
#undef NULL
|
||||
#define NULL (void *)0
|
||||
int
|
||||
gethostbyname_r(const char *, struct hostent *,
|
||||
struct hostent_data *);
|
||||
]],[[
|
||||
struct hostent_data data;
|
||||
gethostbyname_r(NULL, NULL, NULL);
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1, [gethostbyname_r() takes 3 args])
|
||||
ac_cv_gethostbyname_r_args="3"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
|
||||
if test "$ac_cv_gethostbyname_r_args" = "unknown"; then
|
||||
AC_MSG_CHECKING([if gethostbyname_r with -D_REENTRANT takes 3 arguments])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#undef _REENTRANT
|
||||
#define _REENTRANT
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
#undef NULL
|
||||
#define NULL (void *)0
|
||||
int
|
||||
gethostbyname_r(const char *, struct hostent *,
|
||||
struct hostent_data *);
|
||||
]],[[
|
||||
struct hostent_data data;
|
||||
gethostbyname_r(NULL, NULL, NULL);
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1, [gethostbyname_r() takes 3 args])
|
||||
ac_cv_gethostbyname_r_args="3"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
fi
|
||||
|
||||
if test "$ac_cv_gethostbyname_r_args" = "unknown"; then
|
||||
AC_MSG_CHECKING([if gethostbyname_r takes 5 arguments])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#undef _REENTRANT
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
#undef NULL
|
||||
#define NULL (void *)0
|
||||
struct hostent *
|
||||
gethostbyname_r(const char *, struct hostent *,
|
||||
char *, int, int *);
|
||||
]],[[
|
||||
gethostbyname_r(NULL, NULL, NULL, 0, NULL);
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_GETHOSTBYNAME_R_5, 1, [gethostbyname_r() takes 5 args])
|
||||
ac_cv_gethostbyname_r_args="5"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
fi
|
||||
|
||||
if test "$ac_cv_gethostbyname_r_args" = "unknown"; then
|
||||
AC_MSG_CHECKING([if gethostbyname_r with -D_REENTRANT takes 5 arguments])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#undef _REENTRANT
|
||||
#define _REENTRANT
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
#undef NULL
|
||||
#define NULL (void *)0
|
||||
struct hostent *
|
||||
gethostbyname_r(const char *, struct hostent *,
|
||||
char *, int, int *);
|
||||
]],[[
|
||||
gethostbyname_r(NULL, NULL, NULL, 0, NULL);
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_GETHOSTBYNAME_R_5, 1, [gethostbyname_r() takes 5 args])
|
||||
ac_cv_gethostbyname_r_args="5"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
fi
|
||||
|
||||
if test "$ac_cv_gethostbyname_r_args" = "unknown"; then
|
||||
AC_MSG_CHECKING([if gethostbyname_r takes 6 arguments])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#undef _REENTRANT
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
#undef NULL
|
||||
#define NULL (void *)0
|
||||
int
|
||||
gethostbyname_r(const char *, struct hostent *,
|
||||
char *, size_t, struct hostent **, int *);
|
||||
]],[[
|
||||
gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL);
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_GETHOSTBYNAME_R_6, 1, [gethostbyname_r() takes 6 args])
|
||||
ac_cv_gethostbyname_r_args="6"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
fi
|
||||
|
||||
if test "$ac_cv_gethostbyname_r_args" = "unknown"; then
|
||||
AC_MSG_CHECKING([if gethostbyname_r with -D_REENTRANT takes 6 arguments])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#undef _REENTRANT
|
||||
#define _REENTRANT
|
||||
#include <sys/types.h>
|
||||
#include <netdb.h>
|
||||
#undef NULL
|
||||
#define NULL (void *)0
|
||||
int
|
||||
gethostbyname_r(const char *, struct hostent *,
|
||||
char *, size_t, struct hostent **, int *);
|
||||
]],[[
|
||||
gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL);
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_GETHOSTBYNAME_R_6, 1, [gethostbyname_r() takes 6 args])
|
||||
ac_cv_gethostbyname_r_args="6"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
fi
|
||||
|
||||
if test "$ac_cv_gethostbyname_r_args" = "unknown"; then
|
||||
AC_MSG_WARN([Cannot find out how to use gethostbyname_r])
|
||||
AC_MSG_WARN([HAVE_GETHOSTBYNAME_R will not be defined])
|
||||
ac_cv_func_gethostbyname_r="no"
|
||||
else
|
||||
AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYNAME_R, 1,
|
||||
[Define to 1 if you have the gethostbyname_r function.])
|
||||
ac_cv_func_gethostbyname_r="yes"
|
||||
fi
|
||||
|
||||
else
|
||||
ac_cv_func_gethostbyname_r="no"
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl CURL_DETECT_ICC ([ACTION-IF-YES])
|
||||
dnl
|
||||
dnl check if this is the Intel ICC compiler, and if so run the ACTION-IF-YES
|
||||
dnl sets the $ICC variable to "yes" or "no"
|
||||
dnl **********************************************************************
|
||||
AC_DEFUN([CURL_DETECT_ICC],
|
||||
[
|
||||
ICC="no"
|
||||
AC_MSG_CHECKING([for icc in use])
|
||||
if test "$GCC" = "yes"; then
|
||||
dnl check if this is icc acting as gcc in disguise
|
||||
AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER],
|
||||
dnl action if the text is found, this it has not been replaced by the
|
||||
dnl cpp
|
||||
ICC="no",
|
||||
dnl the text was not found, it was replaced by the cpp
|
||||
ICC="yes"
|
||||
AC_MSG_RESULT([yes])
|
||||
[$1]
|
||||
)
|
||||
fi
|
||||
if test "$ICC" = "no"; then
|
||||
# this is not ICC
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
])
|
||||
|
||||
dnl We create a function for detecting which compiler we use and then set as
|
||||
dnl pendantic compiler options as possible for that particular compiler. The
|
||||
dnl options are only used for debug-builds.
|
||||
|
||||
AC_DEFUN([CURL_CC_DEBUG_OPTS],
|
||||
[
|
||||
if test "z$ICC" = "z"; then
|
||||
CURL_DETECT_ICC
|
||||
fi
|
||||
|
||||
if test "$GCC" = "yes"; then
|
||||
|
||||
dnl figure out gcc version!
|
||||
AC_MSG_CHECKING([gcc version])
|
||||
gccver=`$CC -dumpversion`
|
||||
num1=`echo $gccver | cut -d . -f1`
|
||||
num2=`echo $gccver | cut -d . -f2`
|
||||
gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
|
||||
AC_MSG_RESULT($gccver)
|
||||
|
||||
if test "$ICC" = "yes"; then
|
||||
dnl this is icc, not gcc.
|
||||
|
||||
dnl ICC warnings we ignore:
|
||||
dnl * 269 warns on our "%Od" printf formatters for curl_off_t output:
|
||||
dnl "invalid format string conversion"
|
||||
dnl * 279 warns on static conditions in while expressions
|
||||
dnl * 981 warns on "operands are evaluated in unspecified order"
|
||||
dnl * 1418 "external definition with no prior declaration"
|
||||
dnl * 1419 warns on "external declaration in primary source file"
|
||||
dnl which we know and do on purpose.
|
||||
|
||||
WARN="-wd279,269,981,1418,1419"
|
||||
|
||||
if test "$gccnum" -gt "600"; then
|
||||
dnl icc 6.0 and older doesn't have the -Wall flag
|
||||
WARN="-Wall $WARN"
|
||||
fi
|
||||
else dnl $ICC = yes
|
||||
dnl this is a set of options we believe *ALL* gcc versions support:
|
||||
WARN="-W -Wall -Wwrite-strings -pedantic -Wpointer-arith -Wnested-externs -Winline -Wmissing-prototypes"
|
||||
|
||||
dnl -Wcast-align is a bit too annoying on all gcc versions ;-)
|
||||
|
||||
if test "$gccnum" -ge "207"; then
|
||||
dnl gcc 2.7 or later
|
||||
WARN="$WARN -Wmissing-declarations"
|
||||
fi
|
||||
|
||||
if test "$gccnum" -gt "295"; then
|
||||
dnl only if the compiler is newer than 2.95 since we got lots of
|
||||
dnl "`_POSIX_C_SOURCE' is not defined" in system headers with
|
||||
dnl gcc 2.95.4 on FreeBSD 4.9!
|
||||
WARN="$WARN -Wundef -Wno-long-long -Wsign-compare -Wshadow -Wno-multichar"
|
||||
fi
|
||||
|
||||
if test "$gccnum" -ge "296"; then
|
||||
dnl gcc 2.96 or later
|
||||
WARN="$WARN -Wfloat-equal"
|
||||
fi
|
||||
|
||||
if test "$gccnum" -gt "296"; then
|
||||
dnl this option does not exist in 2.96
|
||||
WARN="$WARN -Wno-format-nonliteral"
|
||||
fi
|
||||
|
||||
dnl -Wunreachable-code seems totally unreliable on my gcc 3.3.2 on
|
||||
dnl on i686-Linux as it gives us heaps with false positives.
|
||||
dnl Also, on gcc 4.0.X it is totally unbearable and complains all
|
||||
dnl over making it unusable for generic purposes. Let's not use it.
|
||||
|
||||
if test "$gccnum" -ge "303"; then
|
||||
dnl gcc 3.3 and later
|
||||
WARN="$WARN -Wendif-labels -Wstrict-prototypes"
|
||||
fi
|
||||
|
||||
if test "$gccnum" -ge "304"; then
|
||||
# try these on gcc 3.4
|
||||
WARN="$WARN -Wdeclaration-after-statement"
|
||||
fi
|
||||
|
||||
for flag in $CPPFLAGS; do
|
||||
case "$flag" in
|
||||
-I*)
|
||||
dnl Include path, provide a -isystem option for the same dir
|
||||
dnl to prevent warnings in those dirs. The -isystem was not very
|
||||
dnl reliable on earlier gcc versions.
|
||||
add=`echo $flag | sed 's/^-I/-isystem /g'`
|
||||
WARN="$WARN $add"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
fi dnl $ICC = no
|
||||
|
||||
CFLAGS="$CFLAGS $WARN"
|
||||
|
||||
AC_MSG_NOTICE([Added this set of compiler options: $WARN])
|
||||
|
||||
else dnl $GCC = yes
|
||||
|
||||
AC_MSG_NOTICE([Added no extra compiler options])
|
||||
|
||||
fi dnl $GCC = yes
|
||||
|
||||
dnl strip off optimizer flags
|
||||
NEWFLAGS=""
|
||||
for flag in $CFLAGS; do
|
||||
case "$flag" in
|
||||
-O*)
|
||||
dnl echo "cut off $flag"
|
||||
;;
|
||||
*)
|
||||
NEWFLAGS="$NEWFLAGS $flag"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
CFLAGS=$NEWFLAGS
|
||||
|
||||
]) # AC-DEFUN
|
||||
|
||||
|
||||
|
||||
# This is only a temporary fix. This macro is here to replace the broken one
|
||||
# delivered by the automake project (including the 1.9.6 release). As soon as
|
||||
# they ship a working version we SHOULD remove this work-around.
|
||||
@@ -3444,6 +2688,7 @@ dnl regarding the paths this will scan:
|
||||
dnl /etc/ssl/certs/ca-certificates.crt Debian systems
|
||||
dnl /etc/pki/tls/certs/ca-bundle.crt Redhat and Mandriva
|
||||
dnl /usr/share/ssl/certs/ca-bundle.crt old(er) Redhat
|
||||
dnl /usr/local/share/certs/ca-root.crt FreeBSD
|
||||
dnl /etc/ssl/certs/ (ca path) SUSE
|
||||
|
||||
AC_DEFUN([CURL_CHECK_CA_BUNDLE], [
|
||||
@@ -3505,6 +2750,7 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
|
||||
for a in /etc/ssl/certs/ca-certificates.crt \
|
||||
/etc/pki/tls/certs/ca-bundle.crt \
|
||||
/usr/share/ssl/certs/ca-bundle.crt \
|
||||
/usr/local/share/certs/ca-root.crt \
|
||||
"$cac"; do
|
||||
if test -f "$a"; then
|
||||
ca="$a"
|
||||
|
43
ares/CHANGES
43
ares/CHANGES
@@ -1,5 +1,48 @@
|
||||
Changelog for the c-ares project
|
||||
|
||||
* Nov 1 2008 (Daniel Stenberg)
|
||||
- Carlo Contavalli added support for the glibc "rotate" option, as documented
|
||||
in man resolv.conf:
|
||||
|
||||
causes round robin selection of nameservers from among those listed. This
|
||||
has the effect of spreading the query load among all listed servers, rather
|
||||
than having all clients try the first listed server first every time.
|
||||
|
||||
You can enable it with ARES_OPT_ROTATE
|
||||
|
||||
* Oct 21 2008 (Yang Tse)
|
||||
Charles Hardin added handling of EINPROGRESS for UDP connects.
|
||||
|
||||
* Oct 18 2008 (Daniel Stenberg)
|
||||
Charles Hardin made adig support a regular numerical dotted IP address for the
|
||||
-s option as well.
|
||||
|
||||
* Oct 7 2008 (Yang Tse)
|
||||
- Added --enable-optimize configure option to enable and disable compiler
|
||||
optimizations to allow decoupled setting from --enable-debug.
|
||||
|
||||
* Oct 2 2008 (Yang Tse)
|
||||
- Added --enable-warnings configure option to enable and disable strict
|
||||
compiler warnings to allow decoupled setting from --enable-debug.
|
||||
|
||||
* Sep 17 2008 (Yang Tse)
|
||||
- Code reorganization to allow internal/private use of "nameser.h" to any
|
||||
system that lacks arpa/nameser.h or arpa/nameser_compat.h header files.
|
||||
|
||||
* Sep 16 2008 (Yang Tse)
|
||||
- Code reorganization to allow internal/private use of ares_writev to any
|
||||
system that lacks the writev function.
|
||||
|
||||
* Sep 15 2008 (Yang Tse)
|
||||
- Code reorganization to allow internal/private use of ares_strcasecmp to any
|
||||
system that lacks the strcasecmp function.
|
||||
|
||||
- Improve configure detection of some string functions.
|
||||
|
||||
* Sep 11 2008 (Yang Tse)
|
||||
- Code reorganization to allow internal/private use of ares_strdup to any
|
||||
system that lacks the strdup function.
|
||||
|
||||
Version 1.5.3 (Aug 29, 2008)
|
||||
|
||||
* Aug 25 2008 (Yang Tse)
|
||||
|
@@ -45,7 +45,8 @@ noinst_PROGRAMS =$(PROGS)
|
||||
# regular sources and headers
|
||||
EXTRA_DIST = AUTHORS CHANGES README.cares Makefile.inc Makefile.dj \
|
||||
Makefile.m32 Makefile.netware Makefile.vc6 $(man_MANS) $(MSVCFILES) \
|
||||
config-win32.h RELEASE-NOTES libcares.pc.in buildconf get_ver.awk maketgz
|
||||
config-win32.h RELEASE-NOTES libcares.pc.in buildconf get_ver.awk maketgz \
|
||||
TODO
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libcares.pc
|
||||
|
@@ -28,7 +28,8 @@ CFLAGS += -DWATT32 -DHAVE_AF_INET6 -DHAVE_PF_INET6 -DHAVE_IOCTLSOCKET \
|
||||
-DRECVFROM_TYPE_ARG3='int' -DRECVFROM_TYPE_ARG4='int' \
|
||||
-DRECVFROM_TYPE_ARG6='int' -DRECVFROM_TYPE_RETV='int' \
|
||||
-DRECVFROM_TYPE_ARG5='struct sockaddr' -DHAVE_RECVFROM \
|
||||
-DRECVFROM_TYPE_ARG2_IS_VOID
|
||||
-DRECVFROM_TYPE_ARG2_IS_VOID -DHAVE_STRDUP -DHAVE_NETDB_H \
|
||||
-DHAVE_ARPA_INET_H -DHAVE_STRCASECMP -DHAVE_STRNCASECMP
|
||||
|
||||
LDFLAGS = -s
|
||||
|
||||
|
@@ -3,14 +3,14 @@ ares_query.c ares__close_sockets.c ares_free_string.c ares_search.c \
|
||||
ares__get_hostent.c ares_gethostbyaddr.c ares_send.c ares__read_line.c \
|
||||
ares_gethostbyname.c ares_strerror.c ares_cancel.c ares_init.c \
|
||||
ares_timeout.c ares_destroy.c ares_mkquery.c ares_version.c \
|
||||
ares_expand_name.c ares_parse_a_reply.c windows_port.c \
|
||||
ares_expand_name.c ares_parse_a_reply.c windows_port.c ares_strdup.c \
|
||||
ares_expand_string.c ares_parse_ptr_reply.c ares_parse_aaaa_reply.c \
|
||||
ares_getnameinfo.c inet_net_pton.c bitncmp.c inet_ntop.c \
|
||||
ares_parse_ns_reply.c ares_llist.c ares__timeval.c
|
||||
ares_getnameinfo.c inet_net_pton.c bitncmp.c inet_ntop.c ares_writev.c \
|
||||
ares_parse_ns_reply.c ares_llist.c ares__timeval.c ares_strcasecmp.c
|
||||
|
||||
HHEADERS = ares.h ares_private.h setup.h ares_dns.h ares_version.h \
|
||||
nameser.h inet_net_pton.h inet_ntop.h ares_ipv6.h bitncmp.h \
|
||||
setup_once.h ares_llist.h
|
||||
nameser.h inet_net_pton.h inet_ntop.h ares_ipv6.h bitncmp.h setup_once.h \
|
||||
ares_llist.h ares_strdup.h ares_strcasecmp.h ares_writev.h
|
||||
|
||||
MANPAGES= ares_destroy.3 ares_expand_name.3 ares_expand_string.3 ares_fds.3 \
|
||||
ares_free_hostent.3 ares_free_string.3 ares_gethostbyaddr.3 \
|
||||
|
@@ -160,7 +160,7 @@ lib: prebuild $(LTARGET)
|
||||
|
||||
nlm: prebuild $(TARGETS)
|
||||
|
||||
prebuild: $(OBJDIR) $(OBJDIR)/version.inc config.h arpa/nameser.h
|
||||
prebuild: $(OBJDIR) $(OBJDIR)/version.inc config.h
|
||||
|
||||
install: $(INSTDIR) all
|
||||
@$(CP) *.nlm $(INSTDIR)
|
||||
@@ -282,6 +282,8 @@ config.h: Makefile.netware
|
||||
@echo $(DL)#define PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/"$(DL) >> $@
|
||||
ifeq ($(LIBARCH),CLIB)
|
||||
@echo $(DL)#define OS "i586-pc-clib-NetWare"$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRICMP 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRNICMP 1$(DL) >> $@
|
||||
@echo $(DL)#define NETDB_USE_INTERNET 1$(DL) >> $@
|
||||
@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
|
||||
@echo $(DL)#define RECV_TYPE_ARG2 char *$(DL) >> $@
|
||||
@@ -302,15 +304,12 @@ ifeq ($(LIBARCH),CLIB)
|
||||
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
|
||||
@echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@
|
||||
@echo $(DL)#define socklen_t int$(DL) >> $@
|
||||
@echo $(DL)#define strncasecmp strnicmp$(DL) >> $@
|
||||
@echo $(DL)#define strcasecmp stricmp$(DL) >> $@
|
||||
else
|
||||
@echo $(DL)#define OS "i586-pc-libc-NetWare"$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_DLOPEN 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_FTRUNCATE 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_INET_PTON 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@
|
||||
@@ -348,7 +347,6 @@ else
|
||||
@echo $(DL)#define SIZEOF_STRUCT_IN6_ADDR 16$(DL) >> $@
|
||||
endif
|
||||
@echo $(DL)#define HAVE_ARPA_INET_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_ARPA_NAMESER_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_ERR_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@
|
||||
@@ -358,7 +356,6 @@ endif
|
||||
@echo $(DL)#define HAVE_GETPROTOBYNAME 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_GMTIME_R 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_INET_ADDR 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_INET_NTOA 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_LL 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_LOCALTIME_R 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
|
||||
@@ -387,6 +384,7 @@ endif
|
||||
@echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_UTIME 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_UTIME_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_WRITEV 1$(DL) >> $@
|
||||
@echo $(DL)#define RETSIGTYPE void$(DL) >> $@
|
||||
@echo $(DL)#define SIZEOF_STRUCT_IN_ADDR 4$(DL) >> $@
|
||||
@echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
|
||||
@@ -408,9 +406,3 @@ ifdef OLD_NOVELLSDK
|
||||
@echo $(DL)#define socklen_t int$(DL) >> $@
|
||||
endif
|
||||
|
||||
arpa/nameser.h: nameser.h
|
||||
@echo Fix missing header $@
|
||||
@-mkdir arpa
|
||||
@$(CP) $< arpa
|
||||
|
||||
|
||||
|
@@ -57,6 +57,7 @@ OBJECTS = $(OBJ_DIR)\ares_fds.obj \
|
||||
$(OBJ_DIR)\ares__read_line.obj \
|
||||
$(OBJ_DIR)\ares_gethostbyname.obj \
|
||||
$(OBJ_DIR)\ares_getnameinfo.obj \
|
||||
$(OBJ_DIR)\ares_strcasecmp.obj \
|
||||
$(OBJ_DIR)\ares_strerror.obj \
|
||||
$(OBJ_DIR)\ares_cancel.obj \
|
||||
$(OBJ_DIR)\ares_init.obj \
|
||||
@@ -73,6 +74,7 @@ OBJECTS = $(OBJ_DIR)\ares_fds.obj \
|
||||
$(OBJ_DIR)\windows_port.obj \
|
||||
$(OBJ_DIR)\ares_expand_string.obj \
|
||||
$(OBJ_DIR)\ares_parse_ptr_reply.obj \
|
||||
$(OBJ_DIR)\ares_writev.obj \
|
||||
$(OBJ_DIR)\bitncmp.obj \
|
||||
$(OBJ_DIR)\inet_net_pton.obj \
|
||||
$(OBJ_DIR)\inet_ntop.obj
|
||||
@@ -184,6 +186,8 @@ $(OBJ_DIR)\ares__read_line.obj: ares__read_line.c setup.h setup_once.h ares.h \
|
||||
$(OBJ_DIR)\ares_gethostbyname.obj: ares_gethostbyname.c setup.h setup_once.h \
|
||||
nameser.h ares.h ares_private.h ares_ipv6.h inet_net_pton.h bitncmp.h
|
||||
|
||||
$(OBJ_DIR)\ares_strcasecmp.obj: ares_strcasecmp.c setup.h setup_once.h ares.h
|
||||
|
||||
$(OBJ_DIR)\ares_strerror.obj: ares_strerror.c setup.h setup_once.h ares.h
|
||||
|
||||
$(OBJ_DIR)\ares_cancel.obj: ares_cancel.c setup.h setup_once.h ares.h \
|
||||
@@ -243,3 +247,6 @@ $(OBJ_DIR)\ares_getopt.obj: ares_getopt.c ares_getopt.h
|
||||
|
||||
$(OBJ_DIR)\ares_llist.obj: ares_llist.c setup.h setup_once.h ares.h \
|
||||
ares_private.h ares_llist.h
|
||||
|
||||
$(OBJ_DIR)\ares_writev.obj: ares_writev.c setup.h setup_once.h ares.h \
|
||||
ares_writev.h
|
||||
|
@@ -1,6 +1,7 @@
|
||||
This is what's new and changed in the c-ares 1.5.4 release:
|
||||
|
||||
o
|
||||
o improved configure detection of several functions
|
||||
o improved source code portability
|
||||
|
||||
Thanks go to these friendly people for their efforts and contributions:
|
||||
|
||||
|
8
ares/TODO
Normal file
8
ares/TODO
Normal file
@@ -0,0 +1,8 @@
|
||||
TODO
|
||||
====
|
||||
|
||||
ares_gethostbyname
|
||||
|
||||
- When built to support IPv6, it needs to also support PF_UNSPEC or similar,
|
||||
so that an application can ask for any protocol and then c-ares would return
|
||||
all known resolves and not just explicitly IPv4 _or_ IPv6 resolves.
|
@@ -702,6 +702,9 @@ AC_DEFUN([CURL_CHECK_NI_WITHSCOPEID], [
|
||||
[ac_cv_working_ni_withscopeid], [
|
||||
AC_RUN_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDIO_H
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
@@ -1785,6 +1788,9 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
|
||||
AC_MSG_CHECKING([if monotonic clock_gettime works])
|
||||
AC_RUN_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
@@ -1827,160 +1833,6 @@ AC_DEFUN([CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC], [
|
||||
])
|
||||
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl CURL_DETECT_ICC ([ACTION-IF-YES])
|
||||
dnl
|
||||
dnl check if this is the Intel ICC compiler, and if so run the ACTION-IF-YES
|
||||
dnl sets the $ICC variable to "yes" or "no"
|
||||
dnl **********************************************************************
|
||||
AC_DEFUN([CURL_DETECT_ICC],
|
||||
[
|
||||
ICC="no"
|
||||
AC_MSG_CHECKING([for icc in use])
|
||||
if test "$GCC" = "yes"; then
|
||||
dnl check if this is icc acting as gcc in disguise
|
||||
AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER],
|
||||
dnl action if the text is found, this it has not been replaced by the
|
||||
dnl cpp
|
||||
ICC="no",
|
||||
dnl the text was not found, it was replaced by the cpp
|
||||
ICC="yes"
|
||||
AC_MSG_RESULT([yes])
|
||||
[$1]
|
||||
)
|
||||
fi
|
||||
if test "$ICC" = "no"; then
|
||||
# this is not ICC
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
])
|
||||
|
||||
dnl We create a function for detecting which compiler we use and then set as
|
||||
dnl pendantic compiler options as possible for that particular compiler. The
|
||||
dnl options are only used for debug-builds.
|
||||
|
||||
dnl This is a copy of the original found in curl's configure script. Don't
|
||||
dnl modify this one, edit the one in curl and copy it back here when that one
|
||||
dnl is changed.
|
||||
|
||||
AC_DEFUN([CURL_CC_DEBUG_OPTS],
|
||||
[
|
||||
if test "z$ICC" = "z"; then
|
||||
CURL_DETECT_ICC
|
||||
fi
|
||||
|
||||
if test "$GCC" = "yes"; then
|
||||
|
||||
dnl figure out gcc version!
|
||||
AC_MSG_CHECKING([gcc version])
|
||||
gccver=`$CC -dumpversion`
|
||||
num1=`echo $gccver | cut -d . -f1`
|
||||
num2=`echo $gccver | cut -d . -f2`
|
||||
gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
|
||||
AC_MSG_RESULT($gccver)
|
||||
|
||||
if test "$ICC" = "yes"; then
|
||||
dnl this is icc, not gcc.
|
||||
|
||||
dnl ICC warnings we ignore:
|
||||
dnl * 269 warns on our "%Od" printf formatters for curl_off_t output:
|
||||
dnl "invalid format string conversion"
|
||||
dnl * 279 warns on static conditions in while expressions
|
||||
dnl * 981 warns on "operands are evaluated in unspecified order"
|
||||
dnl * 1418 "external definition with no prior declaration"
|
||||
dnl * 1419 warns on "external declaration in primary source file"
|
||||
dnl which we know and do on purpose.
|
||||
|
||||
WARN="-wd279,269,981,1418,1419"
|
||||
|
||||
if test "$gccnum" -gt "600"; then
|
||||
dnl icc 6.0 and older doesn't have the -Wall flag
|
||||
WARN="-Wall $WARN"
|
||||
fi
|
||||
else dnl $ICC = yes
|
||||
dnl this is a set of options we believe *ALL* gcc versions support:
|
||||
WARN="-W -Wall -Wwrite-strings -pedantic -Wpointer-arith -Wnested-externs -Winline -Wmissing-prototypes"
|
||||
|
||||
dnl -Wcast-align is a bit too annoying on all gcc versions ;-)
|
||||
|
||||
if test "$gccnum" -ge "207"; then
|
||||
dnl gcc 2.7 or later
|
||||
WARN="$WARN -Wmissing-declarations"
|
||||
fi
|
||||
|
||||
if test "$gccnum" -gt "295"; then
|
||||
dnl only if the compiler is newer than 2.95 since we got lots of
|
||||
dnl "`_POSIX_C_SOURCE' is not defined" in system headers with
|
||||
dnl gcc 2.95.4 on FreeBSD 4.9!
|
||||
WARN="$WARN -Wundef -Wno-long-long -Wsign-compare -Wshadow -Wno-multichar"
|
||||
fi
|
||||
|
||||
if test "$gccnum" -ge "296"; then
|
||||
dnl gcc 2.96 or later
|
||||
WARN="$WARN -Wfloat-equal"
|
||||
fi
|
||||
|
||||
if test "$gccnum" -gt "296"; then
|
||||
dnl this option does not exist in 2.96
|
||||
WARN="$WARN -Wno-format-nonliteral"
|
||||
fi
|
||||
|
||||
dnl -Wunreachable-code seems totally unreliable on my gcc 3.3.2 on
|
||||
dnl on i686-Linux as it gives us heaps with false positives.
|
||||
dnl Also, on gcc 4.0.X it is totally unbearable and complains all
|
||||
dnl over making it unusable for generic purposes. Let's not use it.
|
||||
|
||||
if test "$gccnum" -ge "303"; then
|
||||
dnl gcc 3.3 and later
|
||||
WARN="$WARN -Wendif-labels -Wstrict-prototypes"
|
||||
fi
|
||||
|
||||
if test "$gccnum" -ge "304"; then
|
||||
# try these on gcc 3.4
|
||||
WARN="$WARN -Wdeclaration-after-statement"
|
||||
fi
|
||||
|
||||
for flag in $CPPFLAGS; do
|
||||
case "$flag" in
|
||||
-I*)
|
||||
dnl Include path, provide a -isystem option for the same dir
|
||||
dnl to prevent warnings in those dirs. The -isystem was not very
|
||||
dnl reliable on earlier gcc versions.
|
||||
add=`echo $flag | sed 's/^-I/-isystem /g'`
|
||||
WARN="$WARN $add"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
fi dnl $ICC = no
|
||||
|
||||
CFLAGS="$CFLAGS $WARN"
|
||||
|
||||
AC_MSG_NOTICE([Added this set of compiler options: $WARN])
|
||||
|
||||
else dnl $GCC = yes
|
||||
|
||||
AC_MSG_NOTICE([Added no extra compiler options])
|
||||
|
||||
fi dnl $GCC = yes
|
||||
|
||||
dnl strip off optimizer flags
|
||||
NEWFLAGS=""
|
||||
for flag in $CFLAGS; do
|
||||
case "$flag" in
|
||||
-O*)
|
||||
dnl echo "cut off $flag"
|
||||
;;
|
||||
*)
|
||||
NEWFLAGS="$NEWFLAGS $flag"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
CFLAGS=$NEWFLAGS
|
||||
|
||||
])
|
||||
|
||||
|
||||
dnl This macro determines if the specified struct exists in the specified file
|
||||
dnl Syntax:
|
||||
dnl CARES_CHECK_STRUCT(headers, struct name, if found, [if not found])
|
||||
@@ -2026,132 +1878,3 @@ AC_DEFUN([CARES_CHECK_CONSTANT], [
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CHECK_GETSERVBYPORT_R
|
||||
dnl -------------------------------------------------
|
||||
dnl Test if the getservbyport_r function is available,
|
||||
dnl and find out how many parameters it takes.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_GETSERVBYPORT_R], [
|
||||
AC_CHECK_HEADERS(sys/types.h netdb.h)
|
||||
#
|
||||
AC_MSG_CHECKING([for getservbyport_r])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_FUNC_LINK_TRY([getservbyport_r])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
cares_cv_getservbyport_r="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
cares_cv_getservbyport_r="no"
|
||||
])
|
||||
#
|
||||
if test "$cares_cv_getservbyport_r" != "yes"; then
|
||||
AC_MSG_CHECKING([deeper for getservbyport_r])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
]],[[
|
||||
getservbyport_r();
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
cares_cv_getservbyport_r="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([but still no])
|
||||
cares_cv_getservbyport_r="no"
|
||||
])
|
||||
fi
|
||||
#
|
||||
if test "$cares_cv_getservbyport_r" = "yes"; then
|
||||
AC_MSG_CHECKING([how many arguments getservbyport_r takes])
|
||||
cares_cv_getservbyport_r_nargs="unknown"
|
||||
#
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
extern int
|
||||
getservbyport_r(int, const char*, struct servent*,
|
||||
char*, size_t, struct servent**);
|
||||
]],[[
|
||||
int p1, res;
|
||||
size_t p5;
|
||||
char *p2, p4[4096];
|
||||
struct servent *p3, *p6;
|
||||
res = getservbyport_r(p1, p2, p3, p4, p5, &p6);
|
||||
]])
|
||||
],[
|
||||
cares_cv_getservbyport_r_nargs="6"
|
||||
])
|
||||
#
|
||||
if test "$cares_cv_getservbyport_r_nargs" = "unknown"; then
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
extern struct servent*
|
||||
getservbyport_r(int, const char*, struct servent*,
|
||||
char*, int);
|
||||
]],[[
|
||||
int p1, p5;
|
||||
char *p2, p4[4096];
|
||||
struct servent *p3, res;
|
||||
res = getservbyport_r(p1, p2, p3, p4, p5);
|
||||
]])
|
||||
],[
|
||||
cares_cv_getservbyport_r_nargs="5"
|
||||
])
|
||||
fi
|
||||
#
|
||||
if test "$cares_cv_getservbyport_r_nargs" = "unknown"; then
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
extern int
|
||||
getservbyport_r(int, const char*, struct servent*,
|
||||
struct servent_data*);
|
||||
]],[[
|
||||
int p1, res;
|
||||
char *p2;
|
||||
struct servent *p3;
|
||||
struct servent_data *p4;
|
||||
res = getservbyport_r(p1, p2, p3, p4);
|
||||
]])
|
||||
],[
|
||||
cares_cv_getservbyport_r_nargs="4"
|
||||
])
|
||||
fi
|
||||
#
|
||||
AC_MSG_RESULT([$cares_cv_getservbyport_r_nargs])
|
||||
#
|
||||
if test "$cares_cv_getservbyport_r_nargs" = "unknown"; then
|
||||
AC_MSG_WARN([HAVE_GETSERVBYPORT_R will not be defined])
|
||||
else
|
||||
AC_DEFINE(HAVE_GETSERVBYPORT_R, 1,
|
||||
[Specifies whether getservbyport_r is present])
|
||||
AC_DEFINE_UNQUOTED(GETSERVBYPORT_R_ARGS, $cares_cv_getservbyport_r_nargs,
|
||||
[Specifies the number of arguments to getservbyport_r])
|
||||
if test "$cares_cv_getservbyport_r_nargs" = "4" ; then
|
||||
AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, sizeof(struct servent_data),
|
||||
[Specifies the size of the buffer to pass to getservbyport_r])
|
||||
else
|
||||
AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, 4096,
|
||||
[Specifies the size of the buffer to pass to getservbyport_r])
|
||||
fi
|
||||
fi
|
||||
#
|
||||
fi
|
||||
])
|
||||
|
@@ -60,6 +60,21 @@
|
||||
#include "inet_net_pton.h"
|
||||
#include "inet_ntop.h"
|
||||
|
||||
#ifndef HAVE_STRDUP
|
||||
# include "ares_strdup.h"
|
||||
# define strdup(ptr) ares_strdup(ptr)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRCASECMP
|
||||
# include "ares_strcasecmp.h"
|
||||
# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
# include "ares_strcasecmp.h"
|
||||
# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
|
||||
#endif
|
||||
|
||||
#ifndef INADDR_NONE
|
||||
#define INADDR_NONE 0xffffffff
|
||||
#endif
|
||||
@@ -240,7 +255,7 @@ struct search_list {
|
||||
const char *long_name; /* normal country name */
|
||||
};
|
||||
|
||||
const struct search_list *list_lookup(int number, const struct search_list *list, int num)
|
||||
static const struct search_list *list_lookup(int number, const struct search_list *list, int num)
|
||||
{
|
||||
while (num > 0 && list->long_name)
|
||||
{
|
||||
@@ -508,7 +523,8 @@ static int is_addr(char *str, char **end)
|
||||
{
|
||||
int a0, a1, a2, a3, num, rc = 0, length = 0;
|
||||
|
||||
if ((num = sscanf(str,"%3d.%3d.%3d.%3d%n",&a0,&a1,&a2,&a3,&length)) == 4 &&
|
||||
num = sscanf(str,"%3d.%3d.%3d.%3d%n",&a0,&a1,&a2,&a3,&length);
|
||||
if( (num == 4) &&
|
||||
BYTE_OK(a0) && BYTE_OK(a1) && BYTE_OK(a2) && BYTE_OK(a3) &&
|
||||
length >= (3+4))
|
||||
{
|
||||
@@ -536,6 +552,7 @@ static void find_country_from_cname(const char *cname, struct in_addr addr)
|
||||
z0 = tolower(cname[0]);
|
||||
z1 = tolower(cname[1]);
|
||||
ccopy = strdup(cname);
|
||||
dot_4 = NULL;
|
||||
|
||||
ver_1 = (z0 == 'z' && z1 == 'z' && !strcasecmp(cname+4,nerd_ver1));
|
||||
ver_2 = (is_addr(ccopy,&dot_4) && !strcasecmp(dot_4,nerd_ver2));
|
||||
@@ -567,8 +584,8 @@ static void find_country_from_cname(const char *cname, struct in_addr addr)
|
||||
|
||||
if (ver_1)
|
||||
{
|
||||
ccode_A2[0] = tolower(cname[2]);
|
||||
ccode_A2[1] = tolower(cname[3]);
|
||||
ccode_A2[0] = (char)tolower(cname[2]);
|
||||
ccode_A2[1] = (char)tolower(cname[3]);
|
||||
ccode_A2[2] = '\0';
|
||||
}
|
||||
else
|
||||
|
149
ares/adig.c
149
ares/adig.c
@@ -17,26 +17,35 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <arpa/nameser.h>
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <netdb.h>
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -48,8 +57,24 @@
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "inet_ntop.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_getopt.h"
|
||||
|
||||
#ifndef HAVE_STRDUP
|
||||
# include "ares_strdup.h"
|
||||
# define strdup(ptr) ares_strdup(ptr)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRCASECMP
|
||||
# include "ares_strcasecmp.h"
|
||||
# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
# include "ares_strcasecmp.h"
|
||||
# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
|
||||
#endif
|
||||
|
||||
#ifdef WATT32
|
||||
#undef WIN32 /* Redefined in MingW headers */
|
||||
#endif
|
||||
@@ -127,6 +152,7 @@ static const char *opcodes[] = {
|
||||
"UPDATEA", "UPDATED", "UPDATEDA", "UPDATEM", "UPDATEMA",
|
||||
"ZONEINIT", "ZONEREF"
|
||||
};
|
||||
struct in_addr inaddr;
|
||||
|
||||
static const char *rcodes[] = {
|
||||
"NOERROR", "FORMERR", "SERVFAIL", "NXDOMAIN", "NOTIMP", "REFUSED",
|
||||
@@ -188,11 +214,15 @@ int main(int argc, char **argv)
|
||||
|
||||
case 's':
|
||||
/* Add a server, and specify servers in the option mask. */
|
||||
hostent = gethostbyname(optarg);
|
||||
if (!hostent || hostent->h_addrtype != AF_INET)
|
||||
if (ares_inet_pton(AF_INET, optarg, &inaddr) <= 0)
|
||||
{
|
||||
fprintf(stderr, "adig: server %s not found.\n", optarg);
|
||||
return 1;
|
||||
hostent = gethostbyname(optarg);
|
||||
if (!hostent || hostent->h_addrtype != AF_INET)
|
||||
{
|
||||
fprintf(stderr, "adig: server %s not found.\n", optarg);
|
||||
return 1;
|
||||
}
|
||||
memcpy(&inaddr, hostent->h_addr, sizeof(struct in_addr));
|
||||
}
|
||||
options.servers = realloc(options.servers, (options.nservers + 1)
|
||||
* sizeof(struct in_addr));
|
||||
@@ -201,7 +231,7 @@ int main(int argc, char **argv)
|
||||
fprintf(stderr, "Out of memory!\n");
|
||||
return 1;
|
||||
}
|
||||
memcpy(&options.servers[options.nservers], hostent->h_addr,
|
||||
memcpy(&options.servers[options.nservers], &inaddr,
|
||||
sizeof(struct in_addr));
|
||||
options.nservers++;
|
||||
optmask |= ARES_OPT_SERVERS;
|
||||
@@ -436,13 +466,16 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
const unsigned char *abuf, int alen)
|
||||
{
|
||||
const unsigned char *p;
|
||||
char *name;
|
||||
int type, dnsclass, ttl, dlen, status;
|
||||
long len;
|
||||
char addr[46];
|
||||
union {
|
||||
unsigned char * as_uchar;
|
||||
char * as_char;
|
||||
} name;
|
||||
|
||||
/* Parse the RR name. */
|
||||
status = ares_expand_name(aptr, abuf, alen, &name, &len);
|
||||
status = ares_expand_name(aptr, abuf, alen, &name.as_char, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
aptr += len;
|
||||
@@ -452,7 +485,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
*/
|
||||
if (aptr + RRFIXEDSZ > abuf + alen)
|
||||
{
|
||||
ares_free_string(name);
|
||||
ares_free_string(name.as_char);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -465,16 +498,16 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
aptr += RRFIXEDSZ;
|
||||
if (aptr + dlen > abuf + alen)
|
||||
{
|
||||
ares_free_string(name);
|
||||
ares_free_string(name.as_char);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Display the RR name, class, and type. */
|
||||
printf("\t%-15s.\t%d", name, ttl);
|
||||
printf("\t%-15s.\t%d", name.as_char, ttl);
|
||||
if (dnsclass != C_IN)
|
||||
printf("\t%s", class_name(dnsclass));
|
||||
printf("\t%s", type_name(type));
|
||||
ares_free_string(name);
|
||||
ares_free_string(name.as_char);
|
||||
|
||||
/* Display the RR data. Don't touch aptr. */
|
||||
switch (type)
|
||||
@@ -488,11 +521,11 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
case T_NS:
|
||||
case T_PTR:
|
||||
/* For these types, the RR data is just a domain name. */
|
||||
status = ares_expand_name(aptr, abuf, alen, &name, &len);
|
||||
status = ares_expand_name(aptr, abuf, alen, &name.as_char, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t%s.", name);
|
||||
ares_free_string(name);
|
||||
printf("\t%s.", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
break;
|
||||
|
||||
case T_HINFO:
|
||||
@@ -512,17 +545,17 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
case T_MINFO:
|
||||
/* The RR data is two domain names. */
|
||||
p = aptr;
|
||||
status = ares_expand_name(p, abuf, alen, &name, &len);
|
||||
status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t%s.", name);
|
||||
ares_free_string(name);
|
||||
printf("\t%s.", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
p += len;
|
||||
status = ares_expand_name(p, abuf, alen, &name, &len);
|
||||
status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t%s.", name);
|
||||
ares_free_string(name);
|
||||
printf("\t%s.", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
break;
|
||||
|
||||
case T_MX:
|
||||
@@ -532,11 +565,11 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
if (dlen < 2)
|
||||
return NULL;
|
||||
printf("\t%d", DNS__16BIT(aptr));
|
||||
status = ares_expand_name(aptr + 2, abuf, alen, &name, &len);
|
||||
status = ares_expand_name(aptr + 2, abuf, alen, &name.as_char, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t%s.", name);
|
||||
ares_free_string(name);
|
||||
printf("\t%s.", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
break;
|
||||
|
||||
case T_SOA:
|
||||
@@ -544,17 +577,17 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
* numbers giving the serial number and some timeouts.
|
||||
*/
|
||||
p = aptr;
|
||||
status = ares_expand_name(p, abuf, alen, &name, &len);
|
||||
status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t%s.\n", name);
|
||||
ares_free_string(name);
|
||||
printf("\t%s.\n", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
p += len;
|
||||
status = ares_expand_name(p, abuf, alen, &name, &len);
|
||||
status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t\t\t\t\t\t%s.\n", name);
|
||||
ares_free_string(name);
|
||||
printf("\t\t\t\t\t\t%s.\n", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
p += len;
|
||||
if (p + 20 > aptr + dlen)
|
||||
return NULL;
|
||||
@@ -605,11 +638,11 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
printf(" %d", DNS__16BIT(aptr + 2));
|
||||
printf(" %d", DNS__16BIT(aptr + 4));
|
||||
|
||||
status = ares_expand_name(aptr + 6, abuf, alen, &name, &len);
|
||||
status = ares_expand_name(aptr + 6, abuf, alen, &name.as_char, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t%s.", name);
|
||||
ares_free_string(name);
|
||||
printf("\t%s.", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
break;
|
||||
|
||||
case T_NAPTR:
|
||||
@@ -618,32 +651,32 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
printf(" %d\n", DNS__16BIT(aptr + 2)); /* preference */
|
||||
|
||||
p = aptr + 4;
|
||||
status = ares_expand_string(p, abuf, alen, (unsigned char **)&name, &len);
|
||||
status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t\t\t\t\t\t%s\n", name);
|
||||
ares_free_string(name);
|
||||
printf("\t\t\t\t\t\t%s\n", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
p += len;
|
||||
|
||||
status = ares_expand_string(p, abuf, alen, (unsigned char **)&name, &len);
|
||||
status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t\t\t\t\t\t%s\n", name);
|
||||
ares_free_string(name);
|
||||
printf("\t\t\t\t\t\t%s\n", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
p += len;
|
||||
|
||||
status = ares_expand_string(p, abuf, alen, (unsigned char **)&name, &len);
|
||||
status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t\t\t\t\t\t%s\n", name);
|
||||
ares_free_string(name);
|
||||
printf("\t\t\t\t\t\t%s\n", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
p += len;
|
||||
|
||||
status = ares_expand_string(p, abuf, alen, (unsigned char **)&name, &len);
|
||||
status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t\t\t\t\t\t%s", name);
|
||||
ares_free_string(name);
|
||||
printf("\t\t\t\t\t\t%s", name.as_char);
|
||||
ares_free_string(name.as_char);
|
||||
break;
|
||||
|
||||
|
||||
|
15
ares/ahost.c
15
ares/ahost.c
@@ -43,6 +43,21 @@
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_getopt.h"
|
||||
|
||||
#ifndef HAVE_STRDUP
|
||||
# include "ares_strdup.h"
|
||||
# define strdup(ptr) ares_strdup(ptr)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRCASECMP
|
||||
# include "ares_strcasecmp.h"
|
||||
# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
# include "ares_strcasecmp.h"
|
||||
# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
|
||||
#endif
|
||||
|
||||
static void callback(void *arg, int status, int timeouts, struct hostent *host);
|
||||
static void usage(void);
|
||||
|
||||
|
@@ -114,6 +114,7 @@ extern "C" {
|
||||
#define ARES_OPT_SOCK_SNDBUF (1 << 11)
|
||||
#define ARES_OPT_SOCK_RCVBUF (1 << 12)
|
||||
#define ARES_OPT_TIMEOUTMS (1 << 13)
|
||||
#define ARES_OPT_ROTATE (1 << 14)
|
||||
|
||||
/* Nameinfo flag values */
|
||||
#define ARES_NI_NOFQDN (1 << 0)
|
||||
@@ -184,6 +185,7 @@ struct ares_options {
|
||||
int timeout; /* in seconds or milliseconds, depending on options */
|
||||
int tries;
|
||||
int ndots;
|
||||
int rotate;
|
||||
unsigned short udp_port;
|
||||
unsigned short tcp_port;
|
||||
int socket_send_buffer_size;
|
||||
|
@@ -18,11 +18,19 @@
|
||||
#include "setup.h"
|
||||
|
||||
#if !defined(WIN32) || defined(WATT32)
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -30,8 +38,8 @@
|
||||
#include <ctype.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
int ares__get_hostent(FILE *fp, int family, struct hostent **host)
|
||||
{
|
||||
|
@@ -17,14 +17,16 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/nameser.h>
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
@@ -17,11 +17,13 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/nameser.h>
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
@@ -16,16 +16,25 @@
|
||||
*/
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/nameser.h>
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -33,8 +42,8 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
#ifdef WATT32
|
||||
#undef WIN32
|
||||
|
@@ -17,19 +17,25 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
#include <arpa/nameser.h>
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -41,9 +47,9 @@
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "bitncmp.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
#ifdef WATT32
|
||||
#undef WIN32
|
||||
|
@@ -16,17 +16,32 @@
|
||||
*/
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <arpa/nameser.h>
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#ifdef HAVE_GETSERVBYPORT_R
|
||||
# if !defined(GETSERVBYPORT_R_ARGS) || \
|
||||
(GETSERVBYPORT_R_ARGS < 4) || (GETSERVBYPORT_R_ARGS > 6)
|
||||
# error "you MUST specifiy a valid number of arguments for getservbyport_r"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NET_IF_H
|
||||
@@ -42,9 +57,9 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
#include "ares_ipv6.h"
|
||||
#include "inet_ntop.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
#ifdef WATT32
|
||||
#undef WIN32
|
||||
|
@@ -19,11 +19,10 @@
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#include <iphlpapi.h>
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#else
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
@@ -36,20 +35,30 @@
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/nameser.h>
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_PROCESS_H
|
||||
#include <process.h> /* Some have getpid() here */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -58,8 +67,8 @@
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
#include "inet_net_pton.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
#ifdef WATT32
|
||||
#undef WIN32 /* Redefined in MingW/MSVC headers */
|
||||
@@ -135,6 +144,7 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
||||
channel->timeout = -1;
|
||||
channel->tries = -1;
|
||||
channel->ndots = -1;
|
||||
channel->rotate = -1;
|
||||
channel->udp_port = -1;
|
||||
channel->tcp_port = -1;
|
||||
channel->socket_send_buffer_size = -1;
|
||||
@@ -150,6 +160,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_server = 0;
|
||||
channel->last_timeout_processed = (time_t)now.tv_sec;
|
||||
|
||||
/* Initialize our lists of queries */
|
||||
@@ -343,6 +354,8 @@ static int init_by_options(ares_channel channel,
|
||||
channel->tries = options->tries;
|
||||
if ((optmask & ARES_OPT_NDOTS) && channel->ndots == -1)
|
||||
channel->ndots = options->ndots;
|
||||
if ((optmask & ARES_OPT_ROTATE) && channel->rotate == -1)
|
||||
channel->rotate = options->rotate;
|
||||
if ((optmask & ARES_OPT_UDP_PORT) && channel->udp_port == -1)
|
||||
channel->udp_port = options->udp_port;
|
||||
if ((optmask & ARES_OPT_TCP_PORT) && channel->tcp_port == -1)
|
||||
@@ -675,7 +688,7 @@ DhcpNameServer
|
||||
{
|
||||
if (bytes)
|
||||
{
|
||||
line = (char *)malloc(bytes+1);
|
||||
line = malloc(bytes+1);
|
||||
if (RegQueryValueEx(mykey, NAMESERVER, NULL, &data_type,
|
||||
(unsigned char *)line, &bytes) ==
|
||||
ERROR_SUCCESS)
|
||||
@@ -923,6 +936,8 @@ static int init_by_defaults(ares_channel channel)
|
||||
channel->tries = DEFAULT_TRIES;
|
||||
if (channel->ndots == -1)
|
||||
channel->ndots = 1;
|
||||
if (channel->rotate == -1)
|
||||
channel->rotate = 0;
|
||||
if (channel->udp_port == -1)
|
||||
channel->udp_port = htons(NAMESERVER_PORT);
|
||||
if (channel->tcp_port == -1)
|
||||
@@ -952,7 +967,7 @@ static int init_by_defaults(ares_channel channel)
|
||||
size_t len = 64;
|
||||
int res;
|
||||
|
||||
hostname = (char *)malloc(len);
|
||||
hostname = malloc(len);
|
||||
if(!hostname) {
|
||||
rc = ARES_ENOMEM;
|
||||
goto error;
|
||||
@@ -1293,6 +1308,9 @@ static int set_options(ares_channel channel, const char *str)
|
||||
val = try_option(p, q, "retry:");
|
||||
if (val && channel->tries == -1)
|
||||
channel->tries = atoi(val);
|
||||
val = try_option(p, q, "rotate");
|
||||
if (val && channel->rotate == -1)
|
||||
channel->rotate = 1;
|
||||
p = q;
|
||||
while (ISSPACE(*p))
|
||||
p++;
|
||||
@@ -1365,7 +1383,7 @@ static char *try_config(char *s, const char *opt)
|
||||
static const char *try_option(const char *p, const char *q, const char *opt)
|
||||
{
|
||||
size_t len = strlen(opt);
|
||||
return ((size_t)(q - p) > len && !strncmp(p, opt, len)) ? &p[len] : NULL;
|
||||
return ((size_t)(q - p) >= len && !strncmp(p, opt, len)) ? &p[len] : NULL;
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
|
@@ -17,14 +17,16 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/nameser.h>
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
@@ -17,20 +17,29 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/nameser.h>
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
@@ -17,22 +17,29 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
#include <arpa/nameser.h>
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
@@ -20,17 +20,25 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/nameser.h>
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
@@ -17,19 +17,26 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/nameser.h>
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -77,7 +84,7 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
||||
|
||||
/* Examine each answer resource record (RR) in turn. */
|
||||
hostname = NULL;
|
||||
aliases = (char **) malloc(8 * sizeof(char *));
|
||||
aliases = malloc(8 * sizeof(char *));
|
||||
if (!aliases)
|
||||
{
|
||||
free(ptrname);
|
||||
@@ -119,7 +126,7 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
||||
strncpy(aliases[aliascnt], rr_data, strlen(rr_data)+1);
|
||||
aliascnt++;
|
||||
if ((aliascnt%8)==0)
|
||||
aliases = (char **) realloc(aliases, (aliascnt/16+1) * sizeof(char *));
|
||||
aliases = realloc(aliases, (aliascnt/16+1) * sizeof(char *));
|
||||
}
|
||||
|
||||
if (rr_class == C_IN && rr_type == T_CNAME)
|
||||
|
@@ -43,6 +43,7 @@
|
||||
#undef closesocket
|
||||
#define closesocket(s) close_s(s)
|
||||
#define writev(s,v,c) writev_s(s,v,c)
|
||||
#define HAVE_WRITEV 1
|
||||
#endif
|
||||
|
||||
#ifdef NETWARE
|
||||
@@ -94,6 +95,26 @@
|
||||
#include "ares_ipv6.h"
|
||||
#include "ares_llist.h"
|
||||
|
||||
#ifndef HAVE_STRDUP
|
||||
# include "ares_strdup.h"
|
||||
# define strdup(ptr) ares_strdup(ptr)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRCASECMP
|
||||
# include "ares_strcasecmp.h"
|
||||
# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
# include "ares_strcasecmp.h"
|
||||
# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_WRITEV
|
||||
# include "ares_writev.h"
|
||||
# define writev(s,ptr,cnt) ares_writev(s,ptr,cnt)
|
||||
#endif
|
||||
|
||||
struct query;
|
||||
|
||||
struct send_request {
|
||||
@@ -174,8 +195,8 @@ struct query {
|
||||
void *arg;
|
||||
|
||||
/* Query status */
|
||||
int try;
|
||||
int server;
|
||||
int try; /* Number of times we tried this query already. */
|
||||
int server; /* Server this query has last been sent to. */
|
||||
struct query_server_info *server_info; /* per-server state */
|
||||
int using_tcp;
|
||||
int error_status;
|
||||
@@ -221,6 +242,7 @@ struct ares_channeldata {
|
||||
int timeout; /* in milliseconds */
|
||||
int tries;
|
||||
int ndots;
|
||||
int rotate; /* if true, all servers specified are used */
|
||||
int udp_port;
|
||||
int tcp_port;
|
||||
int socket_send_buffer_size;
|
||||
@@ -247,6 +269,9 @@ struct ares_channeldata {
|
||||
just to draw the line somewhere. */
|
||||
time_t last_timeout_processed;
|
||||
|
||||
/* Last server we sent a query to. */
|
||||
int last_server;
|
||||
|
||||
/* Circular, doubly-linked list of queries, bucketed various ways.... */
|
||||
/* All active queries in a single list: */
|
||||
struct list_node all_queries;
|
||||
|
@@ -18,47 +18,45 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
|
||||
#else
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_UIO_H
|
||||
#include <sys/uio.h>
|
||||
# include <sys/uio.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h> /* <netinet/tcp.h> may need it */
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_TCP_H
|
||||
#include <netinet/tcp.h> /* for TCP_NODELAY */
|
||||
# include <netinet/tcp.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
#include <arpa/nameser.h>
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
# include <sys/time.h>
|
||||
#endif
|
||||
#endif /* WIN32 && !WATT32 */
|
||||
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
# include <strings.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
#include <sys/ioctl.h>
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
#ifdef NETWARE
|
||||
#include <sys/filio.h>
|
||||
# include <sys/filio.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
@@ -672,30 +670,33 @@ static void skip_server(ares_channel channel, struct query *query,
|
||||
static void next_server(ares_channel channel, struct query *query,
|
||||
struct timeval *now)
|
||||
{
|
||||
/* Advance to the next server or try. */
|
||||
query->server++;
|
||||
for (; query->try < channel->tries; query->try++)
|
||||
/* We need to try each server channel->tries times. We have channel->nservers
|
||||
* servers to try. In total, we need to do channel->nservers * channel->tries
|
||||
* attempts. Use query->try to remember how many times we already attempted
|
||||
* this query. Use modular arithmetic to find the next server to try. */
|
||||
while (++(query->try) < (channel->nservers * channel->tries))
|
||||
{
|
||||
for (; query->server < channel->nservers; query->server++)
|
||||
struct server_state *server;
|
||||
|
||||
/* Move on to the next server. */
|
||||
query->server = (query->server + 1) % channel->nservers;
|
||||
server = &channel->servers[query->server];
|
||||
|
||||
/* We don't want to use this server if (1) we decided this
|
||||
* connection is broken, and thus about to be closed, (2)
|
||||
* we've decided to skip this server because of earlier
|
||||
* errors we encountered, or (3) we already sent this query
|
||||
* over this exact connection.
|
||||
*/
|
||||
if (!server->is_broken &&
|
||||
!query->server_info[query->server].skip_server &&
|
||||
!(query->using_tcp &&
|
||||
(query->server_info[query->server].tcp_connection_generation ==
|
||||
server->tcp_connection_generation)))
|
||||
{
|
||||
struct server_state *server = &channel->servers[query->server];
|
||||
/* We don't want to use this server if (1) we decided this
|
||||
* connection is broken, and thus about to be closed, (2)
|
||||
* we've decided to skip this server because of earlier
|
||||
* errors we encountered, or (3) we already sent this query
|
||||
* over this exact connection.
|
||||
*/
|
||||
if (!server->is_broken &&
|
||||
!query->server_info[query->server].skip_server &&
|
||||
!(query->using_tcp &&
|
||||
(query->server_info[query->server].tcp_connection_generation ==
|
||||
server->tcp_connection_generation)))
|
||||
{
|
||||
ares__send_query(channel, query, now);
|
||||
return;
|
||||
}
|
||||
ares__send_query(channel, query, now);
|
||||
return;
|
||||
}
|
||||
query->server = 0;
|
||||
|
||||
/* You might think that with TCP we only need one try. However,
|
||||
* even when using TCP, servers can time-out our connection just
|
||||
@@ -704,6 +705,8 @@ static void next_server(ares_channel channel, struct query *query,
|
||||
* tickle a bug that drops our request.
|
||||
*/
|
||||
}
|
||||
|
||||
/* If we are here, all attempts to perform query failed. */
|
||||
end_query(channel, query, query->error_status, NULL, 0);
|
||||
}
|
||||
|
||||
@@ -777,8 +780,7 @@ void ares__send_query(ares_channel channel, struct query *query,
|
||||
}
|
||||
query->timeout = *now;
|
||||
ares__timeadd(&query->timeout,
|
||||
(query->try == 0) ? channel->timeout
|
||||
: channel->timeout << query->try / channel->nservers);
|
||||
channel->timeout << (query->try / channel->nservers));
|
||||
/* Keep track of queries bucketed by timeout, so we can process
|
||||
* timeout events quickly.
|
||||
*/
|
||||
@@ -908,7 +910,7 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
|
||||
/* Configure it. */
|
||||
if (configure_socket(s, channel) < 0)
|
||||
{
|
||||
close(s);
|
||||
closesocket(s);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -922,7 +924,7 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
|
||||
if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY,
|
||||
(void *)&opt, sizeof(opt)) == -1)
|
||||
{
|
||||
close(s);
|
||||
closesocket(s);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -931,14 +933,16 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
|
||||
sockin.sin_family = AF_INET;
|
||||
sockin.sin_addr = server->addr;
|
||||
sockin.sin_port = (unsigned short)(channel->tcp_port & 0xffff);
|
||||
if (connect(s, (struct sockaddr *) &sockin, sizeof(sockin)) == -1) {
|
||||
int err = SOCKERRNO;
|
||||
if (connect(s, (struct sockaddr *) &sockin, sizeof(sockin)) == -1)
|
||||
{
|
||||
int err = SOCKERRNO;
|
||||
|
||||
if (err != EINPROGRESS && err != EWOULDBLOCK) {
|
||||
closesocket(s);
|
||||
return -1;
|
||||
if (err != EINPROGRESS && err != EWOULDBLOCK)
|
||||
{
|
||||
closesocket(s);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SOCK_STATE_CALLBACK(channel, s, 1, 0);
|
||||
server->tcp_buffer_pos = 0;
|
||||
@@ -960,7 +964,7 @@ static int open_udp_socket(ares_channel channel, struct server_state *server)
|
||||
/* Set the socket non-blocking. */
|
||||
if (configure_socket(s, channel) < 0)
|
||||
{
|
||||
close(s);
|
||||
closesocket(s);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -971,8 +975,13 @@ static int open_udp_socket(ares_channel channel, struct server_state *server)
|
||||
sockin.sin_port = (unsigned short)(channel->udp_port & 0xffff);
|
||||
if (connect(s, (struct sockaddr *) &sockin, sizeof(sockin)) == -1)
|
||||
{
|
||||
closesocket(s);
|
||||
return -1;
|
||||
int err = SOCKERRNO;
|
||||
|
||||
if (err != EINPROGRESS && err != EWOULDBLOCK)
|
||||
{
|
||||
closesocket(s);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
SOCK_STATE_CALLBACK(channel, s, 1, 0);
|
||||
|
@@ -17,14 +17,16 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/nameser.h>
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
@@ -16,14 +16,15 @@
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
|
@@ -17,14 +17,16 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/nameser.h>
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
#include <arpa/nameser_compat.h>
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -93,7 +95,13 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
|
||||
|
||||
/* Initialize query status. */
|
||||
query->try = 0;
|
||||
query->server = 0;
|
||||
|
||||
/* Choose the server to send the query to. If rotation is enabled, keep track
|
||||
* of the next server we want to use. */
|
||||
query->server = channel->last_server;
|
||||
if (channel->rotate == 1)
|
||||
channel->last_server = (channel->last_server + 1) % channel->nservers;
|
||||
|
||||
for (i = 0; i < channel->nservers; i++)
|
||||
{
|
||||
query->server_info[i].skip_server = 0;
|
||||
|
67
ares/ares_strcasecmp.c
Normal file
67
ares/ares_strcasecmp.c
Normal file
@@ -0,0 +1,67 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_strcasecmp.h"
|
||||
|
||||
#ifndef HAVE_STRCASECMP
|
||||
int ares_strcasecmp(const char *a, const char *b)
|
||||
{
|
||||
#if defined(HAVE_STRCMPI)
|
||||
return strcmpi(a, b);
|
||||
#elif defined(HAVE_STRICMP)
|
||||
return stricmp(a, b);
|
||||
#else
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < (size_t)-1; i++) {
|
||||
int c1 = ISUPPER(a[i]) ? tolower(a[i]) : a[i];
|
||||
int c2 = ISUPPER(b[i]) ? tolower(b[i]) : b[i];
|
||||
if (c1 != c2)
|
||||
return c1-c2;
|
||||
if (!c1)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
int ares_strncasecmp(const char *a, const char *b, size_t n)
|
||||
{
|
||||
#if defined(HAVE_STRNCMPI)
|
||||
return strncmpi(a, b, n);
|
||||
#elif defined(HAVE_STRNICMP)
|
||||
return strnicmp(a, b, n);
|
||||
#else
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
int c1 = ISUPPER(a[i]) ? tolower(a[i]) : a[i];
|
||||
int c2 = ISUPPER(b[i]) ? tolower(b[i]) : b[i];
|
||||
if (c1 != c2)
|
||||
return c1-c2;
|
||||
if (!c1)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
31
ares/ares_strcasecmp.h
Normal file
31
ares/ares_strcasecmp.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef HEADER_CARES_STRCASECMP_H
|
||||
#define HEADER_CARES_STRCASECMP_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#ifndef HAVE_STRCASECMP
|
||||
extern int ares_strcasecmp(const char *a, const char *b);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
extern int ares_strncasecmp(const char *a, const char *b, size_t n);
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CARES_STRCASECMP_H */
|
43
ares/ares_strdup.c
Normal file
43
ares/ares_strdup.c
Normal file
@@ -0,0 +1,43 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares_strdup.h"
|
||||
|
||||
#ifndef HAVE_STRDUP
|
||||
char *ares_strdup(const char *s1)
|
||||
{
|
||||
size_t sz;
|
||||
char * s2;
|
||||
|
||||
if(s1) {
|
||||
sz = strlen(s1);
|
||||
if(sz < (size_t)-1) {
|
||||
sz++;
|
||||
if(sz < ((size_t)-1) / sizeof(char)) {
|
||||
s2 = malloc(sz * sizeof(char));
|
||||
if(s2) {
|
||||
memcpy(s2, s1, sz * sizeof(char));
|
||||
return s2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return (char *)NULL;
|
||||
}
|
||||
#endif
|
27
ares/ares_strdup.h
Normal file
27
ares/ares_strdup.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef HEADER_CARES_STRDUP_H
|
||||
#define HEADER_CARES_STRDUP_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#ifndef HAVE_STRDUP
|
||||
extern char *ares_strdup(const char *s1);
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CARES_STRDUP_H */
|
77
ares/ares_writev.c
Normal file
77
ares/ares_writev.c
Normal file
@@ -0,0 +1,77 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#include <limits.h>
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
#ifndef HAVE_WRITEV
|
||||
ssize_t ares_writev(ares_socket_t s, const struct iovec *iov, int iovcnt)
|
||||
{
|
||||
char *buffer, *bp;
|
||||
int i;
|
||||
size_t bytes = 0;
|
||||
ssize_t result;
|
||||
|
||||
/* Validate iovcnt */
|
||||
if (iovcnt <= 0)
|
||||
{
|
||||
SET_ERRNO(EINVAL);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Validate and find the sum of the iov_len values in the iov array */
|
||||
for (i = 0; i < iovcnt; i++)
|
||||
{
|
||||
if (iov[i].iov_len > INT_MAX - bytes)
|
||||
{
|
||||
SET_ERRNO(EINVAL);
|
||||
return (-1);
|
||||
}
|
||||
bytes += iov[i].iov_len;
|
||||
}
|
||||
|
||||
if (bytes == 0)
|
||||
return (0);
|
||||
|
||||
/* Allocate a temporary buffer to hold the data */
|
||||
buffer = malloc(bytes);
|
||||
if (!buffer)
|
||||
{
|
||||
SET_ERRNO(ENOMEM);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Copy the data into buffer */
|
||||
for (bp = buffer, i = 0; i < iovcnt; ++i)
|
||||
{
|
||||
memcpy (bp, iov[i].iov_base, iov[i].iov_len);
|
||||
bp += iov[i].iov_len;
|
||||
}
|
||||
|
||||
/* Send buffer contents */
|
||||
result = swrite(s, buffer, bytes);
|
||||
|
||||
free(buffer);
|
||||
|
||||
return (result);
|
||||
}
|
||||
#endif
|
||||
|
37
ares/ares_writev.h
Normal file
37
ares/ares_writev.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef HEADER_CARES_WRITEV_H
|
||||
#define HEADER_CARES_WRITEV_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
* fee is hereby granted, provided that the above copyright
|
||||
* notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of M.I.T. not be used in
|
||||
* advertising or publicity pertaining to distribution of the
|
||||
* software without specific, written prior permission.
|
||||
* M.I.T. makes no representations about the suitability of
|
||||
* this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#include "setup.h"
|
||||
#include "ares.h"
|
||||
|
||||
#ifndef HAVE_WRITEV
|
||||
|
||||
/* Structure for scatter/gather I/O. */
|
||||
struct iovec
|
||||
{
|
||||
void *iov_base; /* Pointer to data. */
|
||||
size_t iov_len; /* Length of data. */
|
||||
};
|
||||
|
||||
extern ssize_t ares_writev(ares_socket_t s, const struct iovec *iov, int iovcnt);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* HEADER_CARES_WRITEV_H */
|
@@ -79,6 +79,21 @@
|
||||
/* Define if you have the ioctlsocket function. */
|
||||
#define HAVE_IOCTLSOCKET 1
|
||||
|
||||
/* Define if you have the strcasecmp function. */
|
||||
/* #define HAVE_STRCASECMP 1 */
|
||||
|
||||
/* Define if you have the strdup function. */
|
||||
#define HAVE_STRDUP 1
|
||||
|
||||
/* Define if you have the stricmp function. */
|
||||
#define HAVE_STRICMP 1
|
||||
|
||||
/* Define if you have the strncasecmp function. */
|
||||
/* #define HAVE_STRNCASECMP 1 */
|
||||
|
||||
/* Define if you have the strnicmp function. */
|
||||
#define HAVE_STRNICMP 1
|
||||
|
||||
/* Define if you have the recv function. */
|
||||
#define HAVE_RECV 1
|
||||
|
||||
@@ -207,6 +222,20 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is quite */
|
||||
/* convoluted, compiler dependant and in some cases even build target dependat. */
|
||||
#if defined(HAVE_WS2TCPIP_H)
|
||||
# if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
|
||||
# define HAVE_FREEADDRINFO 1
|
||||
# define HAVE_GETADDRINFO 1
|
||||
# define HAVE_GETNAMEINFO 1
|
||||
# elif defined(_MSC_VER) && (_MSC_VER >= 1200)
|
||||
# define HAVE_FREEADDRINFO 1
|
||||
# define HAVE_GETADDRINFO 1
|
||||
# define HAVE_GETNAMEINFO 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* IPV6 COMPATIBILITY */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
@@ -8,6 +8,10 @@ AC_CONFIG_SRCDIR([ares_ipv6.h])
|
||||
AM_CONFIG_HEADER([config.h])
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
CARES_CHECK_OPTION_DEBUG
|
||||
CARES_CHECK_OPTION_OPTIMIZE
|
||||
CARES_CHECK_OPTION_WARNINGS
|
||||
|
||||
dnl SED is mandatory for configure process and libtool.
|
||||
dnl Set it now, allowing it to be changed later.
|
||||
AC_PATH_PROG([SED], [sed], [not_found],
|
||||
@@ -64,7 +68,7 @@ AC_CANONICAL_HOST
|
||||
dnl Get system canonical name
|
||||
AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
|
||||
|
||||
AC_PROG_CC
|
||||
CARES_CHECK_PROG_CC
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_INSTALL
|
||||
|
||||
@@ -86,43 +90,10 @@ esac
|
||||
dnl support building of Windows DLLs
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
|
||||
dnl ************************************************************
|
||||
dnl Option to switch on debug options. This makes an assumption that
|
||||
dnl this is built as an 'ares' subdir in the curl source tree. Subject for
|
||||
dnl improval in the future!
|
||||
dnl
|
||||
AC_MSG_CHECKING([whether to enable debug options])
|
||||
AC_ARG_ENABLE(debug,
|
||||
AC_HELP_STRING([--enable-debug],[Enable pedantic debug options])
|
||||
AC_HELP_STRING([--disable-debug],[Disable debug options]),
|
||||
[ case "$enableval" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
*) AC_MSG_RESULT(yes)
|
||||
CARES_PROCESS_DEBUG_BUILD_OPTS
|
||||
|
||||
dnl when doing the debug stuff, use static library only
|
||||
AC_DISABLE_SHARED
|
||||
|
||||
debugbuild="yes"
|
||||
|
||||
dnl the entire --enable-debug is a hack that lives and runs on top of
|
||||
dnl libcurl stuff so this BUILDING_LIBCURL is not THAT much uglier
|
||||
AC_DEFINE(BUILDING_LIBCURL, 1, [when building as static part of libcurl])
|
||||
|
||||
CPPFLAGS="$CPPFLAGS -DCURLDEBUG -I$srcdir/../include"
|
||||
CFLAGS="$CFLAGS -g"
|
||||
|
||||
dnl set compiler "debug" options to become more picky, and remove
|
||||
dnl optimize options from CFLAGS
|
||||
CURL_CC_DEBUG_OPTS
|
||||
|
||||
;;
|
||||
esac ],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
AM_CONDITIONAL(DEBUGBUILD, test x$debugbuild = xyes)
|
||||
AM_CONDITIONAL(CURLDEBUG, test x$debugbuild = xyes)
|
||||
AM_CONDITIONAL(DEBUGBUILD, test x$want_debug = xyes)
|
||||
AM_CONDITIONAL(CURLDEBUG, test x$want_debug = xyes)
|
||||
|
||||
dnl skip libtool C++ and Fortran compiler checks
|
||||
m4_ifdef([AC_PROG_CXX], [m4_undefine([AC_PROG_CXX])])
|
||||
@@ -140,10 +111,10 @@ m4_defun([AC_LIBTOOL_CXXCPP],[true])
|
||||
m4_ifdef([AC_LIBTOOL_F77], [m4_undefine([AC_LIBTOOL_F77])])
|
||||
m4_defun([AC_LIBTOOL_F77],[])
|
||||
|
||||
dnl force libtool to build static libraries with PIC on AMD64-linux
|
||||
AC_MSG_CHECKING([if arch-OS host is AMD64-linux (to build static libraries with PIC)])
|
||||
dnl force libtool to build static libraries with PIC on AMD64-Linux & FreeBSD
|
||||
AC_MSG_CHECKING([if arch-OS host is AMD64-Linux/FreeBSD (to build static libraries with PIC)])
|
||||
case $host in
|
||||
x86_64*linux*)
|
||||
x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
|
||||
AC_MSG_RESULT([yes])
|
||||
with_pic=yes
|
||||
;;
|
||||
@@ -167,41 +138,29 @@ esac
|
||||
AC_MSG_RESULT($need_no_undefined)
|
||||
AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl check if this is the Intel ICC compiler, and if so make it stricter
|
||||
dnl (convert warning 147 into an error) so that it properly can detect the
|
||||
dnl gethostbyname_r() version
|
||||
dnl **********************************************************************
|
||||
CURL_DETECT_ICC([CFLAGS="$CFLAGS -we 147"])
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl platform/compiler/architecture specific checks/flags
|
||||
dnl **********************************************************************
|
||||
|
||||
CARES_CHECK_COMPILER
|
||||
CARES_SET_COMPILER_BASIC_OPTS
|
||||
CARES_SET_COMPILER_DEBUG_OPTS
|
||||
CARES_SET_COMPILER_OPTIMIZE_OPTS
|
||||
CARES_SET_COMPILER_WARNING_OPTS
|
||||
|
||||
case $host in
|
||||
#
|
||||
x86_64*linux*)
|
||||
x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
|
||||
#
|
||||
dnl find out if icc is being used
|
||||
if test "z$ICC" = "z"; then
|
||||
CURL_DETECT_ICC
|
||||
fi
|
||||
#
|
||||
if test "$ICC" = "yes"; then
|
||||
dnl figure out icc version
|
||||
AC_MSG_CHECKING([icc version])
|
||||
iccver=`$CC -dumpversion`
|
||||
iccnhi=`echo $iccver | cut -d . -f1`
|
||||
iccnlo=`echo $iccver | cut -d . -f2`
|
||||
iccnum=`(expr $iccnhi "*" 100 + $iccnlo) 2>/dev/null`
|
||||
AC_MSG_RESULT($iccver)
|
||||
if test "$compiler_id" = "INTEL_UNIX_C"; then
|
||||
#
|
||||
if test "$iccnum" -ge "900" && test "$iccnum" -lt "1000"; then
|
||||
if test "$compiler_num" -ge "900" &&
|
||||
test "$compiler_num" -lt "1000"; then
|
||||
dnl icc 9.X specific
|
||||
CFLAGS="$CFLAGS -i-dynamic"
|
||||
fi
|
||||
#
|
||||
if test "$iccnum" -ge "1000"; then
|
||||
if test "$compiler_num" -ge "1000"; then
|
||||
dnl icc 10.X or later
|
||||
CFLAGS="$CFLAGS -shared-intel"
|
||||
fi
|
||||
@@ -211,44 +170,6 @@ case $host in
|
||||
#
|
||||
esac
|
||||
|
||||
AC_MSG_CHECKING([whether we are using the IBM C compiler])
|
||||
CURL_CHECK_DEF([__IBMC__], [], [silent])
|
||||
if test "$curl_cv_have_def___IBMC__" = "yes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
dnl Ensure that compiler optimizations are always thread-safe.
|
||||
CFLAGS="$CFLAGS -qthreaded"
|
||||
dnl Disable type based strict aliasing optimizations, using worst
|
||||
dnl case aliasing assumptions when compiling. Type based aliasing
|
||||
dnl would restrict the lvalues that could be safely used to access
|
||||
dnl a data object.
|
||||
CFLAGS="$CFLAGS -qnoansialias"
|
||||
dnl Force compiler to stop after the compilation phase, without
|
||||
dnl generating an object code file when compilation has errors.
|
||||
CFLAGS="$CFLAGS -qhalt=e"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([whether we are using the DEC/Compaq C compiler])
|
||||
CURL_CHECK_DEF([__DECC], [], [silent])
|
||||
CURL_CHECK_DEF([__DECC_VER], [], [silent])
|
||||
if test "$curl_cv_have_def___DECC" = "yes" &&
|
||||
test "$curl_cv_have_def___DECC_VER" = "yes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
dnl Select strict ANSI C compiler mode
|
||||
CFLAGS="$CFLAGS -std1"
|
||||
dnl Turn off optimizer ANSI C aliasing rules
|
||||
CFLAGS="$CFLAGS -noansi_alias"
|
||||
dnl Select a higher warning level than default level2
|
||||
CFLAGS="$CFLAGS -msg_enable level3"
|
||||
dnl Generate warnings for missing function prototypes
|
||||
CFLAGS="$CFLAGS -warnprotos"
|
||||
dnl Change some warnings into fatal errors
|
||||
CFLAGS="$CFLAGS -msg_fatal toofewargs,toomanyargs"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
CURL_CHECK_COMPILER_HALT_ON_ERROR
|
||||
CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
|
||||
|
||||
@@ -436,6 +357,7 @@ if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
|
||||
,
|
||||
-lnsl)
|
||||
fi
|
||||
ac_cv_func_strcasecmp="no"
|
||||
|
||||
dnl socket lib?
|
||||
AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
|
||||
@@ -531,6 +453,7 @@ AC_CHECK_HEADERS(
|
||||
sys/socket.h \
|
||||
sys/ioctl.h \
|
||||
sys/param.h \
|
||||
sys/uio.h \
|
||||
netdb.h \
|
||||
netinet/in.h \
|
||||
netinet/tcp.h \
|
||||
@@ -630,6 +553,22 @@ CURL_CHECK_FUNC_RECVFROM
|
||||
CURL_CHECK_FUNC_SEND
|
||||
CURL_CHECK_MSG_NOSIGNAL
|
||||
|
||||
CARES_CHECK_FUNC_FREEADDRINFO
|
||||
CARES_CHECK_FUNC_GETADDRINFO
|
||||
CARES_CHECK_FUNC_GETHOSTNAME
|
||||
CARES_CHECK_FUNC_GETSERVBYPORT_R
|
||||
CARES_CHECK_FUNC_INET_NTOP
|
||||
CARES_CHECK_FUNC_INET_PTON
|
||||
CARES_CHECK_FUNC_STRCASECMP
|
||||
CARES_CHECK_FUNC_STRCMPI
|
||||
CARES_CHECK_FUNC_STRDUP
|
||||
CARES_CHECK_FUNC_STRICMP
|
||||
CARES_CHECK_FUNC_STRNCASECMP
|
||||
CARES_CHECK_FUNC_STRNCMPI
|
||||
CARES_CHECK_FUNC_STRNICMP
|
||||
CARES_CHECK_FUNC_WRITEV
|
||||
|
||||
|
||||
dnl check for AF_INET6
|
||||
CARES_CHECK_CONSTANT(
|
||||
[
|
||||
@@ -819,35 +758,6 @@ AC_CHECK_FUNCS([bitncmp \
|
||||
])
|
||||
|
||||
|
||||
dnl check for inet_pton
|
||||
AC_CHECK_FUNCS(inet_pton)
|
||||
dnl Some systems have it, but not IPv6
|
||||
if test "$ac_cv_func_inet_pton" = "yes" ; then
|
||||
AC_MSG_CHECKING(if inet_pton supports IPv6)
|
||||
AC_TRY_RUN(
|
||||
[
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
int main()
|
||||
{
|
||||
struct in6_addr addr6;
|
||||
if (inet_pton(AF_INET6, "::1", &addr6) < 1)
|
||||
exit(1);
|
||||
else
|
||||
exit(0);
|
||||
}
|
||||
], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE_UNQUOTED(HAVE_INET_PTON_IPV6,1,[Define to 1 if inet_pton supports IPv6.])
|
||||
], AC_MSG_RESULT(no),AC_MSG_RESULT(no))
|
||||
fi
|
||||
dnl Check for inet_net_pton
|
||||
AC_CHECK_FUNCS(inet_net_pton)
|
||||
dnl Again, some systems have it, but not IPv6
|
||||
@@ -879,39 +789,6 @@ int main()
|
||||
fi
|
||||
|
||||
|
||||
dnl Check for inet_ntop
|
||||
AC_CHECK_FUNCS(inet_ntop)
|
||||
dnl Again, some systems have it, but not IPv6
|
||||
if test "$ac_cv_func_inet_ntop" = "yes" ; then
|
||||
AC_MSG_CHECKING(if inet_ntop supports IPv6)
|
||||
AC_TRY_RUN(
|
||||
[
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
int main()
|
||||
{
|
||||
struct in6_addr addr6;
|
||||
char buf[128];
|
||||
if (inet_ntop(AF_INET6, &addr6, buf, 128) == 0 && errno == EAFNOSUPPORT)
|
||||
exit(1);
|
||||
else
|
||||
exit(0);
|
||||
}
|
||||
], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE_UNQUOTED(HAVE_INET_NTOP_IPV6,1,
|
||||
[Define to 1 if inet_ntop supports IPv6.])
|
||||
], AC_MSG_RESULT(no),AC_MSG_RESULT(no))
|
||||
fi
|
||||
|
||||
AC_CHECK_SIZEOF(struct in6_addr, ,
|
||||
[
|
||||
#undef inline
|
||||
@@ -974,10 +851,6 @@ dnl and get the types of five of its arguments.
|
||||
CURL_CHECK_FUNC_GETNAMEINFO
|
||||
|
||||
|
||||
dnl God bless non-standardized functions! We need to see which getservbyport_r
|
||||
dnl variant is available
|
||||
CARES_CHECK_GETSERVBYPORT_R
|
||||
|
||||
CURL_CHECK_NONBLOCKING_SOCKET
|
||||
|
||||
AC_C_BIGENDIAN(
|
||||
@@ -1013,5 +886,15 @@ fi
|
||||
CARES_PRIVATE_LIBS="$LIBS"
|
||||
AC_SUBST(CARES_PRIVATE_LIBS)
|
||||
|
||||
dnl squeeze whitespace out of some variables
|
||||
|
||||
squeeze CFLAGS
|
||||
squeeze CPPFLAGS
|
||||
squeeze DEFS
|
||||
squeeze LDFLAGS
|
||||
squeeze LIBS
|
||||
|
||||
squeeze CARES_PRIVATE_LIBS
|
||||
|
||||
AC_CONFIG_FILES([Makefile libcares.pc])
|
||||
AC_OUTPUT
|
||||
|
@@ -19,23 +19,22 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
#include <arpa/nameser.h>
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
@@ -47,8 +46,7 @@
|
||||
#include "ares_ipv6.h"
|
||||
#include "inet_net_pton.h"
|
||||
|
||||
#if !defined(HAVE_INET_NET_PTON) || !defined(HAVE_INET_NET_PTON_IPV6) || \
|
||||
!defined(HAVE_INET_PTON) || !defined(HAVE_INET_PTON_IPV6)
|
||||
#if !defined(HAVE_INET_NET_PTON) || !defined(HAVE_INET_NET_PTON_IPV6)
|
||||
|
||||
/*
|
||||
* static int
|
||||
@@ -425,7 +423,7 @@ ares_inet_net_pton(int af, const char *src, void *dst, size_t size)
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_INET_PTON) || !defined(HAVE_INET_PTON_IPV6)
|
||||
#ifndef HAVE_INET_PTON
|
||||
int ares_inet_pton(int af, const char *src, void *dst)
|
||||
{
|
||||
int size, result;
|
||||
|
@@ -18,7 +18,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#if defined(HAVE_INET_PTON) && defined(HAVE_INET_PTON_IPV6)
|
||||
#ifdef HAVE_INET_PTON
|
||||
#define ares_inet_pton(x,y,z) inet_pton(x,y,z)
|
||||
#else
|
||||
int ares_inet_pton(int af, const char *src, void *dst);
|
||||
|
@@ -18,21 +18,22 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#if defined(WIN32) && !defined(WATT32)
|
||||
#include "nameser.h"
|
||||
#else
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
#include <arpa/nameser.h>
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#else
|
||||
# include "nameser.h"
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
# include <arpa/nameser_compat.h>
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
@@ -45,7 +46,7 @@
|
||||
#include "inet_ntop.h"
|
||||
|
||||
|
||||
#if !defined(HAVE_INET_NTOP) || !defined(HAVE_INET_NTOP_IPV6)
|
||||
#ifndef HAVE_INET_NTOP
|
||||
|
||||
#ifdef SPRINTF_CHAR
|
||||
# define SPRINTF(x) strlen(sprintf/**/x)
|
||||
|
@@ -18,7 +18,7 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#if defined(HAVE_INET_NTOP) && defined(HAVE_INET_NTOP_IPV6)
|
||||
#ifdef HAVE_INET_NTOP
|
||||
#define ares_inet_ntop(w,x,y,z) inet_ntop(w,x,y,z)
|
||||
#else
|
||||
const char *ares_inet_ntop(int af, const void *src, char *dst, size_t size);
|
||||
|
1219
ares/m4/cares-compilers.m4
Normal file
1219
ares/m4/cares-compilers.m4
Normal file
File diff suppressed because it is too large
Load Diff
142
ares/m4/cares-confopts.m4
Normal file
142
ares/m4/cares-confopts.m4
Normal file
@@ -0,0 +1,142 @@
|
||||
#***************************************************************************
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (C) 2008 by Daniel Stenberg et al
|
||||
#
|
||||
# Permission to use, copy, modify, and distribute this software and its
|
||||
# documentation for any purpose and without fee is hereby granted, provided
|
||||
# that the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
#
|
||||
#***************************************************************************
|
||||
|
||||
# File version for 'aclocal' use. Keep it a single number.
|
||||
# serial 2
|
||||
|
||||
|
||||
dnl CARES_CHECK_OPTION_DEBUG
|
||||
dnl -------------------------------------------------
|
||||
dnl Verify if configure has been invoked with option
|
||||
dnl --enable-debug or --disable-debug, and set shell
|
||||
dnl variable want_debug value as appropriate.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_OPTION_DEBUG], [
|
||||
AC_BEFORE([$0],[CARES_CHECK_OPTION_WARNINGS])dnl
|
||||
AC_BEFORE([$0],[CARES_CHECK_PROG_CC])dnl
|
||||
AC_MSG_CHECKING([whether to enable debug build options])
|
||||
OPT_DEBUG_BUILD="default"
|
||||
AC_ARG_ENABLE(debug,
|
||||
AC_HELP_STRING([--enable-debug],[Enable debug build options])
|
||||
AC_HELP_STRING([--disable-debug],[Disable debug build options]),
|
||||
OPT_DEBUG_BUILD=$enableval)
|
||||
case "$OPT_DEBUG_BUILD" in
|
||||
no)
|
||||
dnl --disable-debug option used
|
||||
want_debug="no"
|
||||
;;
|
||||
default)
|
||||
dnl configure option not specified
|
||||
want_debug="no"
|
||||
;;
|
||||
*)
|
||||
dnl --enable-debug option used
|
||||
want_debug="yes"
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT([$want_debug])
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CHECK_OPTION_OPTIMIZE
|
||||
dnl -------------------------------------------------
|
||||
dnl Verify if configure has been invoked with option
|
||||
dnl --enable-optimize or --disable-optimize, and set
|
||||
dnl shell variable want_optimize value as appropriate.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_OPTION_OPTIMIZE], [
|
||||
AC_REQUIRE([CARES_CHECK_OPTION_DEBUG])dnl
|
||||
AC_BEFORE([$0],[CARES_CHECK_PROG_CC])dnl
|
||||
AC_MSG_CHECKING([whether to enable compiler optimizer])
|
||||
OPT_COMPILER_OPTIMIZE="default"
|
||||
AC_ARG_ENABLE(optimize,
|
||||
AC_HELP_STRING([--enable-optimize(=OPT)],[Enable compiler optimizations (default=-O2)])
|
||||
AC_HELP_STRING([--disable-optimize],[Disable compiler optimizations]),
|
||||
OPT_COMPILER_OPTIMIZE=$enableval)
|
||||
case "$OPT_COMPILER_OPTIMIZE" in
|
||||
no)
|
||||
dnl --disable-optimize option used. We will handle this as
|
||||
dnl a request to disable compiler optimizations if possible.
|
||||
dnl If the compiler is known CFLAGS and CPPFLAGS will be
|
||||
dnl overridden, otherwise this can not be honored.
|
||||
want_optimize="no"
|
||||
AC_MSG_RESULT([no])
|
||||
;;
|
||||
default)
|
||||
dnl configure's optimize option not specified. Initially we will
|
||||
dnl handle this as a a request contrary to configure's setting
|
||||
dnl for --enable-debug. IOW, initially, for debug-enabled builds
|
||||
dnl this will be handled as a request to disable optimizations if
|
||||
dnl possible, and for debug-disabled builds this will be handled
|
||||
dnl initially as a request to enable optimizations if possible.
|
||||
dnl Finally, if the compiler is known and CFLAGS and CPPFLAGS do
|
||||
dnl not have any optimizer flag the request will be honored, in
|
||||
dnl any other case the request can not be honored.
|
||||
dnl IOW, existing optimizer flags defined in CFLAGS or CPPFLAGS
|
||||
dnl will always take precedence over any initial assumption.
|
||||
if test "$want_debug" = "yes"; then
|
||||
want_optimize="assume_no"
|
||||
AC_MSG_RESULT([not specified (assuming no)])
|
||||
else
|
||||
want_optimize="assume_yes"
|
||||
AC_MSG_RESULT([not specified (assuming yes)])
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
dnl --enable-optimize option used. We will handle this as
|
||||
dnl a request to enable compiler optimizations if possible.
|
||||
dnl If the compiler is known CFLAGS and CPPFLAGS will be
|
||||
dnl overridden, otherwise this can not be honored.
|
||||
want_optimize="yes"
|
||||
AC_MSG_RESULT([yes])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CHECK_OPTION_WARNINGS
|
||||
dnl -------------------------------------------------
|
||||
dnl Verify if configure has been invoked with option
|
||||
dnl --enable-warnings or --disable-warnings, and set
|
||||
dnl shell variable want_warnings as appropriate.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_OPTION_WARNINGS], [
|
||||
AC_REQUIRE([CARES_CHECK_OPTION_DEBUG])dnl
|
||||
AC_BEFORE([$0],[CARES_CHECK_PROG_CC])dnl
|
||||
AC_MSG_CHECKING([whether to enable strict compiler warnings])
|
||||
OPT_COMPILER_WARNINGS="default"
|
||||
AC_ARG_ENABLE(warnings,
|
||||
AC_HELP_STRING([--enable-warnings],[Enable strict compiler warnings])
|
||||
AC_HELP_STRING([--disable-warnings],[Disable strict compiler warnings]),
|
||||
OPT_COMPILER_WARNINGS=$enableval)
|
||||
case "$OPT_COMPILER_WARNINGS" in
|
||||
no)
|
||||
dnl --disable-warnings option used
|
||||
want_warnings="no"
|
||||
;;
|
||||
default)
|
||||
dnl configure option not specified, so
|
||||
dnl use same setting as --enable-debug
|
||||
want_warnings="$want_debug"
|
||||
;;
|
||||
*)
|
||||
dnl --enable-warnings option used
|
||||
want_warnings="yes"
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT([$want_warnings])
|
||||
])
|
1698
ares/m4/cares-functions.m4
Normal file
1698
ares/m4/cares-functions.m4
Normal file
File diff suppressed because it is too large
Load Diff
@@ -16,7 +16,7 @@
|
||||
#***************************************************************************
|
||||
|
||||
# File version for 'aclocal' use. Keep it a single number.
|
||||
# serial 2
|
||||
# serial 3
|
||||
|
||||
dnl Note 1
|
||||
dnl ------
|
||||
@@ -333,9 +333,6 @@ dnl makes several _r functions compiler visible.
|
||||
dnl Internal macro for CARES_CONFIGURE_REENTRANT.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_NEED_REENTRANT_FUNCTIONS_R], [
|
||||
#
|
||||
tmp_need_reentrant="no"
|
||||
#
|
||||
if test "$tmp_need_reentrant" = "no"; then
|
||||
CARES_CHECK_NEED_REENTRANT_GMTIME_R
|
||||
fi
|
||||
@@ -366,6 +363,24 @@ AC_DEFUN([CARES_CHECK_NEED_REENTRANT_FUNCTIONS_R], [
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CHECK_NEED_REENTRANT_SYSTEM
|
||||
dnl -------------------------------------------------
|
||||
dnl Checks if the preprocessor _REENTRANT definition
|
||||
dnl must be unconditionally done for this platform.
|
||||
dnl Internal macro for CARES_CONFIGURE_REENTRANT.
|
||||
|
||||
AC_DEFUN([CARES_CHECK_NEED_REENTRANT_SYSTEM], [
|
||||
case $host in
|
||||
*-*-solaris*)
|
||||
tmp_need_reentrant="yes"
|
||||
;;
|
||||
*)
|
||||
tmp_need_reentrant="no"
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
|
||||
dnl CARES_CONFIGURE_FROM_NOW_ON_WITH_REENTRANT
|
||||
dnl -------------------------------------------------
|
||||
dnl This macro ensures that configuration tests done
|
||||
@@ -421,7 +436,10 @@ AC_DEFUN([CARES_CONFIGURE_REENTRANT], [
|
||||
#
|
||||
if test "$tmp_reentrant_initially_defined" = "no"; then
|
||||
AC_MSG_CHECKING([if _REENTRANT is actually needed])
|
||||
CARES_CHECK_NEED_REENTRANT_FUNCTIONS_R
|
||||
CARES_CHECK_NEED_REENTRANT_SYSTEM
|
||||
if test "$tmp_need_reentrant" = "no"; then
|
||||
CARES_CHECK_NEED_REENTRANT_FUNCTIONS_R
|
||||
fi
|
||||
if test "$tmp_need_reentrant" = "yes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
|
100
ares/nameser.h
100
ares/nameser.h
@@ -3,39 +3,22 @@
|
||||
#ifndef ARES_NAMESER_H
|
||||
#define ARES_NAMESER_H
|
||||
|
||||
/* Windows-only header file provided by liren@vivisimo.com to make his Windows
|
||||
port build */
|
||||
/* header file provided by liren@vivisimo.com */
|
||||
|
||||
#ifndef NETWARE
|
||||
#include <process.h> /* for the _getpid() proto */
|
||||
#endif /* !NETWARE */
|
||||
#include <sys/types.h>
|
||||
#ifndef HAVE_ARPA_NAMESER_H
|
||||
|
||||
#ifndef NETWARE
|
||||
|
||||
/* Structure for scatter/gather I/O. */
|
||||
struct iovec
|
||||
{
|
||||
void *iov_base; /* Pointer to data. */
|
||||
size_t iov_len; /* Length of data. */
|
||||
};
|
||||
|
||||
#ifndef __WATCOMC__
|
||||
#define getpid() _getpid()
|
||||
#endif
|
||||
|
||||
int ares_writev (SOCKET s, const struct iovec *vector, size_t count);
|
||||
#define writev(s,vect,count) ares_writev(s,vect,count)
|
||||
|
||||
#endif /* !NETWARE */
|
||||
|
||||
#define NS_CMPRSFLGS 0xc0
|
||||
#define NS_IN6ADDRSZ 16
|
||||
#define NS_INT16SZ 2
|
||||
#define NS_INADDRSZ 4
|
||||
|
||||
/* Flag bits indicating name compression. */
|
||||
#define INDIR_MASK NS_CMPRSFLGS
|
||||
#define NS_PACKETSZ 512 /* maximum packet size */
|
||||
#define NS_MAXDNAME 256 /* maximum domain name */
|
||||
#define NS_MAXCDNAME 255 /* maximum compressed domain name */
|
||||
#define NS_MAXLABEL 63
|
||||
#define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */
|
||||
#define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */
|
||||
#define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */
|
||||
#define NS_INT16SZ 2
|
||||
#define NS_INADDRSZ 4
|
||||
#define NS_IN6ADDRSZ 16
|
||||
#define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */
|
||||
#define NS_DEFAULTPORT 53 /* For both TCP and UDP. */
|
||||
|
||||
typedef enum __ns_class {
|
||||
ns_c_invalid = 0, /* Cookie. */
|
||||
@@ -49,8 +32,6 @@ typedef enum __ns_class {
|
||||
ns_c_max = 65536
|
||||
} ns_class;
|
||||
|
||||
#define C_IN ns_c_in
|
||||
|
||||
typedef enum __ns_type {
|
||||
ns_t_invalid = 0, /* Cookie. */
|
||||
ns_t_a = 1, /* Host address. */
|
||||
@@ -94,6 +75,8 @@ typedef enum __ns_type {
|
||||
ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */
|
||||
ns_t_sink = 40, /* Kitchen sink (experimentatl) */
|
||||
ns_t_opt = 41, /* EDNS0 option (meta-RR) */
|
||||
ns_t_apl = 42, /* Address prefix list (RFC3123) */
|
||||
ns_t_tkey = 249, /* Transaction key */
|
||||
ns_t_tsig = 250, /* Transaction signature. */
|
||||
ns_t_ixfr = 251, /* Incremental zone transfer. */
|
||||
ns_t_axfr = 252, /* Transfer zone of authority. */
|
||||
@@ -104,19 +87,6 @@ typedef enum __ns_type {
|
||||
ns_t_max = 65536
|
||||
} ns_type;
|
||||
|
||||
#define T_PTR ns_t_ptr
|
||||
#define T_A ns_t_a
|
||||
|
||||
|
||||
#define NS_DEFAULTPORT 53 /* For both TCP and UDP. */
|
||||
#define NAMESERVER_PORT NS_DEFAULTPORT
|
||||
|
||||
#define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */
|
||||
#define HFIXEDSZ NS_HFIXEDSZ
|
||||
|
||||
#define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */
|
||||
#define QFIXEDSZ NS_QFIXEDSZ
|
||||
|
||||
typedef enum __ns_opcode {
|
||||
ns_o_query = 0, /* Standard query. */
|
||||
ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */
|
||||
@@ -127,25 +97,6 @@ typedef enum __ns_opcode {
|
||||
ns_o_max = 6
|
||||
} ns_opcode;
|
||||
|
||||
#define QUERY ns_o_query
|
||||
|
||||
#define NS_MAXLABEL 63
|
||||
#define MAXLABEL NS_MAXLABEL
|
||||
|
||||
#define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */
|
||||
#define RRFIXEDSZ NS_RRFIXEDSZ
|
||||
|
||||
#define T_CNAME ns_t_cname
|
||||
|
||||
#define NS_MAXDNAME 256 /* maximum domain name */
|
||||
#define MAXDNAME NS_MAXDNAME
|
||||
|
||||
#define NS_MAXCDNAME 255 /* maximum compressed domain name */
|
||||
#define MAXCDNAME NS_MAXCDNAME
|
||||
|
||||
#define NS_PACKETSZ 512 /* maximum packet size */
|
||||
#define PACKETSZ NS_PACKETSZ
|
||||
|
||||
typedef enum __ns_rcode {
|
||||
ns_r_noerror = 0, /* No error occurred. */
|
||||
ns_r_formerr = 1, /* Format error. */
|
||||
@@ -166,6 +117,22 @@ typedef enum __ns_rcode {
|
||||
ns_r_badtime = 18
|
||||
} ns_rcode;
|
||||
|
||||
#endif /* HAVE_ARPA_NAMESER_H */
|
||||
|
||||
#ifndef HAVE_ARPA_NAMESER_COMPAT_H
|
||||
|
||||
#define PACKETSZ NS_PACKETSZ
|
||||
#define MAXDNAME NS_MAXDNAME
|
||||
#define MAXCDNAME NS_MAXCDNAME
|
||||
#define MAXLABEL NS_MAXLABEL
|
||||
#define HFIXEDSZ NS_HFIXEDSZ
|
||||
#define QFIXEDSZ NS_QFIXEDSZ
|
||||
#define RRFIXEDSZ NS_RRFIXEDSZ
|
||||
#define INDIR_MASK NS_CMPRSFLGS
|
||||
#define NAMESERVER_PORT NS_DEFAULTPORT
|
||||
|
||||
#define QUERY ns_o_query
|
||||
|
||||
#define SERVFAIL ns_r_servfail
|
||||
#define NOTIMP ns_r_notimpl
|
||||
#define REFUSED ns_r_refused
|
||||
@@ -174,6 +141,7 @@ typedef enum __ns_rcode {
|
||||
#define FORMERR ns_r_formerr
|
||||
#define NXDOMAIN ns_r_nxdomain
|
||||
|
||||
#define C_IN ns_c_in
|
||||
#define C_CHAOS ns_c_chaos
|
||||
#define C_HS ns_c_hs
|
||||
#define C_NONE ns_c_none
|
||||
@@ -221,4 +189,6 @@ typedef enum __ns_rcode {
|
||||
#define T_MAILA ns_t_maila
|
||||
#define T_ANY ns_t_any
|
||||
|
||||
#endif /* HAVE_ARPA_NAMESER_COMPAT_H */
|
||||
|
||||
#endif /* ARES_NAMESER_H */
|
||||
|
18
ares/setup.h
18
ares/setup.h
@@ -139,24 +139,6 @@
|
||||
#define HAVE_SYS_UIO_H
|
||||
#endif
|
||||
|
||||
#if (defined(WIN32) || defined(WATT32)) && \
|
||||
!(defined(__MINGW32__) || defined(NETWARE) || defined(__DJGPP__))
|
||||
/* protos for the functions we provide in windows_port.c */
|
||||
int ares_strncasecmp(const char *s1, const char *s2, int n);
|
||||
int ares_strcasecmp(const char *s1, const char *s2);
|
||||
|
||||
/* use this define magic to prevent us from adding symbol names to the library
|
||||
that is a high-risk to collide with another libraries' attempts to do the
|
||||
same */
|
||||
#define strncasecmp(a,b,c) ares_strncasecmp(a,b,c)
|
||||
#define strcasecmp(a,b) ares_strcasecmp(a,b)
|
||||
#ifdef _MSC_VER
|
||||
# if _MSC_VER >= 1400
|
||||
# define strdup(a) _strdup(a)
|
||||
# endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* IPv6 compatibility */
|
||||
#if !defined(HAVE_AF_INET6)
|
||||
#if defined(HAVE_PF_INET6)
|
||||
|
@@ -181,6 +181,10 @@ SOURCE=..\..\ares_send.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_strcasecmp.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_strerror.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -193,6 +197,10 @@ SOURCE=..\..\ares_version.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_writev.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\bitncmp.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -233,10 +241,18 @@ SOURCE=..\..\ares_private.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_strcasecmp.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_version.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\ares_writev.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\bitncmp.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
@@ -5,20 +5,6 @@
|
||||
/* only do the following on windows
|
||||
*/
|
||||
#if (defined(WIN32) || defined(WATT32)) && !defined(MSDOS)
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#ifdef WATT32
|
||||
#include <sys/socket.h>
|
||||
#else
|
||||
#include "nameser.h"
|
||||
#endif
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
#ifdef __WATCOMC__
|
||||
/*
|
||||
@@ -34,57 +20,4 @@ WINAPI DllMain (HINSTANCE hnd, DWORD reason, LPVOID reserved)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef __MINGW32__
|
||||
int
|
||||
ares_strncasecmp(const char *a, const char *b, int n)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
int c1 = ISUPPER(a[i]) ? tolower(a[i]) : a[i];
|
||||
int c2 = ISUPPER(b[i]) ? tolower(b[i]) : b[i];
|
||||
if (c1 != c2) return c1-c2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ares_strcasecmp(const char *a, const char *b)
|
||||
{
|
||||
return strncasecmp(a, b, strlen(a)+1);
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
ares_writev (ares_socket_t s, const struct iovec *vector, size_t count)
|
||||
{
|
||||
char *buffer, *bp;
|
||||
size_t i, bytes = 0;
|
||||
|
||||
/* Find the total number of bytes to write
|
||||
*/
|
||||
for (i = 0; i < count; i++)
|
||||
bytes += vector[i].iov_len;
|
||||
|
||||
if (bytes == 0) /* not an error */
|
||||
return (0);
|
||||
|
||||
/* Allocate a temporary buffer to hold the data
|
||||
*/
|
||||
buffer = bp = (char*) alloca (bytes);
|
||||
if (!buffer)
|
||||
{
|
||||
SET_ERRNO(ENOMEM);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Copy the data into buffer.
|
||||
*/
|
||||
for (i = 0; i < count; ++i)
|
||||
{
|
||||
memcpy (bp, vector[i].iov_base, vector[i].iov_len);
|
||||
bp += vector[i].iov_len;
|
||||
}
|
||||
return (int)swrite(s, buffer, bytes);
|
||||
}
|
||||
#endif /* WIN32 builds only */
|
||||
|
374
configure.ac
374
configure.ac
@@ -36,6 +36,10 @@ AC_CONFIG_SRCDIR([lib/urldata.h])
|
||||
AM_CONFIG_HEADER(lib/config.h src/config.h include/curl/curlbuild.h)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
CURL_CHECK_OPTION_DEBUG
|
||||
CURL_CHECK_OPTION_OPTIMIZE
|
||||
CURL_CHECK_OPTION_WARNINGS
|
||||
|
||||
dnl SED is mandatory for configure process and libtool.
|
||||
dnl Set it now, allowing it to be changed later.
|
||||
AC_PATH_PROG([SED], [sed], [not_found],
|
||||
@@ -130,7 +134,7 @@ dnl Get system canonical name
|
||||
AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
CURL_CHECK_PROG_CC
|
||||
|
||||
dnl Our curl_off_t internal and external configure settings
|
||||
CURL_CONFIGURE_CURL_OFF_T
|
||||
@@ -147,6 +151,8 @@ AC_SYS_LARGEFILE
|
||||
dnl support building of Windows DLLs
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
|
||||
CURL_PROCESS_DEBUG_BUILD_OPTS
|
||||
|
||||
dnl skip libtool C++ and Fortran compiler checks
|
||||
m4_ifdef([AC_PROG_CXX], [m4_undefine([AC_PROG_CXX])])
|
||||
m4_defun([AC_PROG_CXX],[])
|
||||
@@ -163,10 +169,10 @@ m4_defun([AC_LIBTOOL_CXXCPP],[true])
|
||||
m4_ifdef([AC_LIBTOOL_F77], [m4_undefine([AC_LIBTOOL_F77])])
|
||||
m4_defun([AC_LIBTOOL_F77],[])
|
||||
|
||||
dnl force libtool to build static libraries with PIC on AMD64-linux
|
||||
AC_MSG_CHECKING([if arch-OS host is AMD64-linux (to build static libraries with PIC)])
|
||||
dnl force libtool to build static libraries with PIC on AMD64-Linux & FreeBSD
|
||||
AC_MSG_CHECKING([if arch-OS host is AMD64-Linux/FreeBSD (to build static libraries with PIC)])
|
||||
case $host in
|
||||
x86_64*linux*)
|
||||
x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
|
||||
AC_MSG_RESULT([yes])
|
||||
with_pic=yes
|
||||
;;
|
||||
@@ -245,30 +251,25 @@ dnl **********************************************************************
|
||||
dnl platform/compiler/architecture specific checks/flags
|
||||
dnl **********************************************************************
|
||||
|
||||
CURL_CHECK_COMPILER
|
||||
CURL_SET_COMPILER_BASIC_OPTS
|
||||
CURL_SET_COMPILER_DEBUG_OPTS
|
||||
CURL_SET_COMPILER_OPTIMIZE_OPTS
|
||||
CURL_SET_COMPILER_WARNING_OPTS
|
||||
|
||||
case $host in
|
||||
#
|
||||
x86_64*linux*)
|
||||
x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
|
||||
#
|
||||
dnl find out if icc is being used
|
||||
if test "z$ICC" = "z"; then
|
||||
CURL_DETECT_ICC
|
||||
fi
|
||||
#
|
||||
if test "$ICC" = "yes"; then
|
||||
dnl figure out icc version
|
||||
AC_MSG_CHECKING([icc version])
|
||||
iccver=`$CC -dumpversion`
|
||||
iccnhi=`echo $iccver | cut -d . -f1`
|
||||
iccnlo=`echo $iccver | cut -d . -f2`
|
||||
iccnum=`(expr $iccnhi "*" 100 + $iccnlo) 2>/dev/null`
|
||||
AC_MSG_RESULT($iccver)
|
||||
if test "$compiler_id" = "INTEL_UNIX_C"; then
|
||||
#
|
||||
if test "$iccnum" -ge "900" && test "$iccnum" -lt "1000"; then
|
||||
if test "$compiler_num" -ge "900" &&
|
||||
test "$compiler_num" -lt "1000"; then
|
||||
dnl icc 9.X specific
|
||||
CFLAGS="$CFLAGS -i-dynamic"
|
||||
fi
|
||||
#
|
||||
if test "$iccnum" -ge "1000"; then
|
||||
if test "$compiler_num" -ge "1000"; then
|
||||
dnl icc 10.X or later
|
||||
CFLAGS="$CFLAGS -shared-intel"
|
||||
fi
|
||||
@@ -278,44 +279,6 @@ case $host in
|
||||
#
|
||||
esac
|
||||
|
||||
AC_MSG_CHECKING([whether we are using the IBM C compiler])
|
||||
CURL_CHECK_DEF([__IBMC__], [], [silent])
|
||||
if test "$curl_cv_have_def___IBMC__" = "yes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
dnl Ensure that compiler optimizations are always thread-safe.
|
||||
CFLAGS="$CFLAGS -qthreaded"
|
||||
dnl Disable type based strict aliasing optimizations, using worst
|
||||
dnl case aliasing assumptions when compiling. Type based aliasing
|
||||
dnl would restrict the lvalues that could be safely used to access
|
||||
dnl a data object.
|
||||
CFLAGS="$CFLAGS -qnoansialias"
|
||||
dnl Force compiler to stop after the compilation phase, without
|
||||
dnl generating an object code file when compilation has errors.
|
||||
CFLAGS="$CFLAGS -qhalt=e"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([whether we are using the DEC/Compaq C compiler])
|
||||
CURL_CHECK_DEF([__DECC], [], [silent])
|
||||
CURL_CHECK_DEF([__DECC_VER], [], [silent])
|
||||
if test "$curl_cv_have_def___DECC" = "yes" &&
|
||||
test "$curl_cv_have_def___DECC_VER" = "yes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
dnl Select strict ANSI C compiler mode
|
||||
CFLAGS="$CFLAGS -std1"
|
||||
dnl Turn off optimizer ANSI C aliasing rules
|
||||
CFLAGS="$CFLAGS -noansi_alias"
|
||||
dnl Select a higher warning level than default level2
|
||||
CFLAGS="$CFLAGS -msg_enable level3"
|
||||
dnl Generate warnings for missing function prototypes
|
||||
CFLAGS="$CFLAGS -warnprotos"
|
||||
dnl Change some warnings into fatal errors
|
||||
CFLAGS="$CFLAGS -msg_fatal toofewargs,toomanyargs"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
CURL_CHECK_COMPILER_HALT_ON_ERROR
|
||||
CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
|
||||
|
||||
@@ -459,6 +422,22 @@ AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
|
||||
AC_SUBST(CURL_DISABLE_LDAPS, [1])
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([whether to support proxies])
|
||||
AC_ARG_ENABLE(proxy,
|
||||
AC_HELP_STRING([--enable-proxy],[Enable proxy support])
|
||||
AC_HELP_STRING([--disable-proxy],[Disable proxy support]),
|
||||
[ case "$enableval" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
|
||||
AC_SUBST(CURL_DISABLE_PROXY, [1])
|
||||
;;
|
||||
*) AC_MSG_RESULT(yes)
|
||||
;;
|
||||
esac ],
|
||||
AC_MSG_RESULT(yes)
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([whether to support dict])
|
||||
AC_ARG_ENABLE(dict,
|
||||
AC_HELP_STRING([--enable-dict],[Enable DICT support])
|
||||
@@ -527,13 +506,6 @@ AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
|
||||
dnl The actual use of the USE_MANUAL variable is done much later in this
|
||||
dnl script to allow other actions to disable it as well.
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl check if this is the Intel ICC compiler, and if so make it stricter
|
||||
dnl (convert warning 147 into an error) so that it properly can detect the
|
||||
dnl gethostbyname_r() version
|
||||
dnl **********************************************************************
|
||||
CURL_DETECT_ICC([CFLAGS="$CFLAGS -we 147"])
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Checks for libraries.
|
||||
dnl **********************************************************************
|
||||
@@ -701,6 +673,7 @@ if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
|
||||
,
|
||||
-lnsl)
|
||||
fi
|
||||
ac_cv_func_strcasecmp="no"
|
||||
|
||||
dnl socket lib?
|
||||
AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
|
||||
@@ -1252,6 +1225,24 @@ if test X"$OPT_SSL" != Xno; then
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl This is for Msys/Mingw
|
||||
case $host in
|
||||
*-*-msys* | *-*-mingw*)
|
||||
AC_MSG_CHECKING([for gdi32])
|
||||
my_ac_save_LIBS=$LIBS
|
||||
LIBS="-lgdi32 $LIBS"
|
||||
AC_TRY_LINK([#include <windef.h>
|
||||
#include <wingdi.h>],
|
||||
[GdiFlush();],
|
||||
[ dnl worked!
|
||||
AC_MSG_RESULT([yes])],
|
||||
[ dnl failed, restore LIBS
|
||||
LIBS=$my_ac_save_LIBS
|
||||
AC_MSG_RESULT(no)]
|
||||
)
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_CHECK_LIB(crypto, CRYPTO_lock,[
|
||||
HAVECRYPTO="yes"
|
||||
LIBS="-lcrypto $LIBS"
|
||||
@@ -1827,22 +1818,22 @@ then
|
||||
AC_DEFINE(DISABLED_THREADSAFE, 1,
|
||||
[Set to explicitly specify we don't want to use thread-safe functions])
|
||||
else
|
||||
if test "$ipv6" != "yes"; then
|
||||
dnl if test "$ipv6" != "yes"; then
|
||||
dnl dig around for gethostbyname_r()
|
||||
CURL_CHECK_GETHOSTBYNAME_R()
|
||||
dnl the old gethostbyname_r check was done here
|
||||
|
||||
dnl dig around for gethostbyaddr_r()
|
||||
dnl CURL_CHECK_GETHOSTBYADDR_R()
|
||||
fi
|
||||
dnl the old gethostbyaddr_r check was here BUT COMMENTED OUT
|
||||
dnl fi
|
||||
|
||||
dnl poke around for inet_ntoa_r()
|
||||
CURL_CHECK_INET_NTOA_R()
|
||||
dnl the old inet_ntoa_r check was done here
|
||||
|
||||
dnl is there a localtime_r()
|
||||
CURL_CHECK_LOCALTIME_R()
|
||||
dnl the old localtime_r check was done here
|
||||
|
||||
dnl is there a strerror_r()
|
||||
CURL_CHECK_STRERROR_R()
|
||||
dnl the old strerror_r check was done here
|
||||
|
||||
checkfor_gmtime_r="yes"
|
||||
fi
|
||||
@@ -1860,55 +1851,14 @@ if test "x$RECENTAIX" = "xyes"; then
|
||||
AC_DEFINE(_THREAD_SAFE, 1, [define this if you need it to compile thread-safe code])
|
||||
|
||||
dnl is there a localtime_r()
|
||||
CURL_CHECK_LOCALTIME_R()
|
||||
dnl the old localtime_r check was done here
|
||||
|
||||
dnl is there a strerror_r()
|
||||
CURL_CHECK_STRERROR_R()
|
||||
dnl the old strerror_r check was done here
|
||||
|
||||
checkfor_gmtime_r="yes"
|
||||
fi
|
||||
|
||||
if test x$cross_compiling != xyes; then
|
||||
|
||||
if test x$checkfor_gmtime_r = xyes; then
|
||||
|
||||
dnl if gmtime_r was found, verify that it actually works, as (at least) HPUX
|
||||
dnl 10.20 is known to have a buggy one. If it doesn't work, disable use of
|
||||
dnl it.
|
||||
|
||||
AC_MSG_CHECKING([if gmtime_r exists and works])
|
||||
AC_RUN_IFELSE([[
|
||||
#include <time.h>
|
||||
int main(void)
|
||||
{
|
||||
time_t local = 1170352587;
|
||||
struct tm *gmt;
|
||||
struct tm keeper;
|
||||
putenv("TZ=CST6CDT");
|
||||
tzset();
|
||||
gmt = gmtime_r(&local, &keeper);
|
||||
if(gmt) {
|
||||
return 0;
|
||||
}
|
||||
return 1; /* failure */
|
||||
}
|
||||
]],
|
||||
dnl success, do nothing
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_GMTIME_R, 1, [if you have (a working) gmtime_r])
|
||||
,
|
||||
dnl failure, now disable the function
|
||||
AC_MSG_RESULT(no)
|
||||
,
|
||||
dnl not invoked when crosscompiling)
|
||||
echo "hej"
|
||||
)
|
||||
fi
|
||||
else
|
||||
dnl and for crosscompiling
|
||||
AC_CHECK_FUNCS(gmtime_r)
|
||||
fi
|
||||
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Back to "normal" configuring
|
||||
@@ -1927,6 +1877,7 @@ AC_CHECK_HEADERS(
|
||||
sys/select.h \
|
||||
sys/socket.h \
|
||||
sys/ioctl.h \
|
||||
sys/uio.h \
|
||||
assert.h \
|
||||
unistd.h \
|
||||
stdlib.h \
|
||||
@@ -2062,6 +2013,39 @@ CURL_CHECK_FUNC_RECVFROM
|
||||
CURL_CHECK_FUNC_SEND
|
||||
CURL_CHECK_MSG_NOSIGNAL
|
||||
|
||||
CURL_CHECK_FUNC_ALARM
|
||||
CURL_CHECK_FUNC_FDOPEN
|
||||
CURL_CHECK_FUNC_FREEADDRINFO
|
||||
CURL_CHECK_FUNC_FTRUNCATE
|
||||
CURL_CHECK_FUNC_GETADDRINFO
|
||||
CURL_CHECK_FUNC_GETHOSTBYADDR_R
|
||||
CURL_CHECK_FUNC_GETHOSTBYNAME_R
|
||||
CURL_CHECK_FUNC_GETHOSTNAME
|
||||
CURL_CHECK_FUNC_GETSERVBYPORT_R
|
||||
CURL_CHECK_FUNC_GMTIME_R
|
||||
CURL_CHECK_FUNC_INET_NTOA_R
|
||||
CURL_CHECK_FUNC_INET_NTOP
|
||||
CURL_CHECK_FUNC_INET_PTON
|
||||
CURL_CHECK_FUNC_LOCALTIME_R
|
||||
CURL_CHECK_FUNC_SIGACTION
|
||||
CURL_CHECK_FUNC_SIGINTERRUPT
|
||||
CURL_CHECK_FUNC_SIGNAL
|
||||
CURL_CHECK_FUNC_SIGSETJMP
|
||||
CURL_CHECK_FUNC_STRCASECMP
|
||||
CURL_CHECK_FUNC_STRCASESTR
|
||||
CURL_CHECK_FUNC_STRCMPI
|
||||
CURL_CHECK_FUNC_STRDUP
|
||||
CURL_CHECK_FUNC_STRERROR_R
|
||||
CURL_CHECK_FUNC_STRICMP
|
||||
CURL_CHECK_FUNC_STRLCAT
|
||||
CURL_CHECK_FUNC_STRNCASECMP
|
||||
CURL_CHECK_FUNC_STRNCMPI
|
||||
CURL_CHECK_FUNC_STRNICMP
|
||||
CURL_CHECK_FUNC_STRSTR
|
||||
CURL_CHECK_FUNC_STRTOK_R
|
||||
CURL_CHECK_FUNC_STRTOLL
|
||||
CURL_CHECK_FUNC_WRITEV
|
||||
|
||||
dnl Checks for library functions.
|
||||
dnl AC_PROG_GCC_TRADITIONAL
|
||||
|
||||
@@ -2077,9 +2061,9 @@ esac
|
||||
AC_CHECK_FUNCS([basename \
|
||||
closesocket \
|
||||
fork \
|
||||
ftruncate \
|
||||
geteuid \
|
||||
gethostbyaddr \
|
||||
getifaddrs \
|
||||
getpass_r \
|
||||
getppid \
|
||||
getprotobyname \
|
||||
@@ -2087,28 +2071,13 @@ AC_CHECK_FUNCS([basename \
|
||||
getrlimit \
|
||||
gettimeofday \
|
||||
inet_addr \
|
||||
inet_ntoa \
|
||||
inet_pton \
|
||||
perror \
|
||||
pipe \
|
||||
poll \
|
||||
setlocale \
|
||||
setmode \
|
||||
setrlimit \
|
||||
sigaction \
|
||||
siginterrupt \
|
||||
signal \
|
||||
sigsetjmp \
|
||||
socket \
|
||||
strcasecmp \
|
||||
strcasestr \
|
||||
strcmpi \
|
||||
strdup \
|
||||
stricmp \
|
||||
strlcat \
|
||||
strstr \
|
||||
strtok_r \
|
||||
strtoll \
|
||||
uname \
|
||||
utime
|
||||
],[
|
||||
@@ -2134,25 +2103,6 @@ AC_CHECK_FUNCS([basename \
|
||||
])
|
||||
|
||||
|
||||
dnl sigsetjmp() might be a macro and no function so if it isn't found already
|
||||
dnl we make an extra check here!
|
||||
if test "$ac_cv_func_sigsetjmp" != "yes"; then
|
||||
AC_MSG_CHECKING([for sigsetjmp defined as macro])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#include <setjmp.h>
|
||||
]],[[
|
||||
sigjmp_buf jmpenv;
|
||||
sigsetjmp(jmpenv, 1);
|
||||
]])
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_SIGSETJMP, 1, [If you have sigsetjmp])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
fi
|
||||
|
||||
AC_CHECK_DECL(basename, ,
|
||||
AC_DEFINE(NEED_BASENAME_PROTO, 1, [If you lack a fine basename() prototype]),
|
||||
#ifdef HAVE_STRING_H
|
||||
@@ -2166,22 +2116,17 @@ AC_CHECK_DECL(basename, ,
|
||||
#endif
|
||||
)
|
||||
|
||||
AC_CHECK_DECL(inet_pton, ,
|
||||
AC_DEFINE(HAVE_NO_INET_PTON_PROTO, 1,
|
||||
[Defined if no inet_pton() prototype available]),
|
||||
[
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
]
|
||||
)
|
||||
|
||||
dnl Check if the getnameinfo function is available
|
||||
dnl and get the types of five of its arguments.
|
||||
CURL_CHECK_FUNC_GETNAMEINFO
|
||||
|
||||
if test "$ipv6" = "yes"; then
|
||||
CURL_CHECK_WORKING_GETADDRINFO
|
||||
if test "$ac_cv_func_getaddrinfo" = "yes"; then
|
||||
AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
|
||||
IPV6_ENABLED=1
|
||||
AC_SUBST(IPV6_ENABLED)
|
||||
fi
|
||||
CURL_CHECK_NI_WITHSCOPEID
|
||||
fi
|
||||
|
||||
@@ -2395,31 +2340,6 @@ AC_HELP_STRING([--disable-sspi],[Disable SSPI]),
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
|
||||
dnl ************************************************************
|
||||
dnl lame option to switch on debug options
|
||||
dnl
|
||||
AC_MSG_CHECKING([whether to enable debug options])
|
||||
AC_ARG_ENABLE(debug,
|
||||
AC_HELP_STRING([--enable-debug],[Enable pedantic debug options])
|
||||
AC_HELP_STRING([--disable-debug],[Disable debug options]),
|
||||
[ case "$enableval" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
*) AC_MSG_RESULT(yes)
|
||||
|
||||
CPPFLAGS="$CPPFLAGS -DCURLDEBUG"
|
||||
CFLAGS="$CFLAGS -g"
|
||||
|
||||
dnl set compiler "debug" options to become more picky, and remove
|
||||
dnl optimize options from CFLAGS
|
||||
CURL_CC_DEBUG_OPTS
|
||||
;;
|
||||
esac
|
||||
],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
|
||||
dnl ************************************************************
|
||||
dnl disable cryptographic authentication
|
||||
dnl
|
||||
@@ -2546,6 +2466,90 @@ LIBS=$ALL_LIBS dnl LIBS is a magic variable that's used for every link
|
||||
|
||||
AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
|
||||
|
||||
dnl
|
||||
dnl For keeping supported features and protocols also in pkg-config file
|
||||
dnl since it is more cross-compile frient than curl-config
|
||||
dnl
|
||||
|
||||
if test "x$USE_SSLEAY" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
|
||||
elif test -n "$SSL_ENABLED"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
|
||||
fi
|
||||
if test "@KRB4_ENABLED@" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES KRB4"
|
||||
fi
|
||||
if test "x$IPV6_ENABLED" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
|
||||
fi
|
||||
if test "x$HAVE_LIBZ" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
|
||||
fi
|
||||
if test "x$HAVE_ARES" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
|
||||
fi
|
||||
if test "x$IDN_ENABLED" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
|
||||
fi
|
||||
if test "x$USE_WINDOWS_SSPI" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
|
||||
fi
|
||||
if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1"; then
|
||||
SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
|
||||
fi
|
||||
|
||||
AC_SUBST(SUPPORT_FEATURES)
|
||||
|
||||
dnl For supported protocols in pkg-config file
|
||||
if test "x$CURL_DISABLE_HTTP" != "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
|
||||
if test "x$SSL_ENABLED" = "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
|
||||
fi
|
||||
fi
|
||||
if test "x$CURL_DISABLE_FTP" != "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
|
||||
if test "x$SSL_ENABLED" = "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
|
||||
fi
|
||||
fi
|
||||
if test "x$CURL_DISABLE_FILE" != "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
|
||||
fi
|
||||
if test "x$CURL_DISABLE_TELNET" != "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
|
||||
fi
|
||||
if test "x$CURL_DISABLE_LDAP" != "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
|
||||
fi
|
||||
if test "x$CURL_DISABLE_LDAPS" != "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
|
||||
fi
|
||||
if test "x$CURL_DISABLE_DICT" != "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
|
||||
fi
|
||||
if test "x$CURL_DISABLE_TFTP" != "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
|
||||
fi
|
||||
if test "x$USE_LIBSSH2" = "x1"; then
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
|
||||
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
|
||||
fi
|
||||
|
||||
AC_SUBST(SUPPORT_PROTOCOLS)
|
||||
|
||||
dnl squeeze whitespace out of some variables
|
||||
|
||||
squeeze CFLAGS
|
||||
squeeze CPPFLAGS
|
||||
squeeze DEFS
|
||||
squeeze LDFLAGS
|
||||
squeeze LIBS
|
||||
|
||||
squeeze CURL_LIBS
|
||||
squeeze LIBCURL_LIBS
|
||||
squeeze TEST_SERVER_LIBS
|
||||
|
||||
AC_CONFIG_FILES([Makefile \
|
||||
docs/Makefile \
|
||||
docs/examples/Makefile \
|
||||
|
@@ -80,71 +80,15 @@ while test $# -gt 0; do
|
||||
;;
|
||||
|
||||
--feature|--features)
|
||||
if test "@USE_SSLEAY@" = "1"; then
|
||||
echo "SSL"
|
||||
NTLM=1 # OpenSSL implies NTLM
|
||||
elif test -n "@SSL_ENABLED@"; then
|
||||
echo "SSL"
|
||||
fi
|
||||
if test "@KRB4_ENABLED@" = "1"; then
|
||||
echo "KRB4"
|
||||
fi
|
||||
if test "@IPV6_ENABLED@" = "1"; then
|
||||
echo "IPv6"
|
||||
fi
|
||||
if test "@HAVE_LIBZ@" = "1"; then
|
||||
echo "libz"
|
||||
fi
|
||||
if test "@HAVE_ARES@" = "1"; then
|
||||
echo "AsynchDNS"
|
||||
fi
|
||||
if test "@IDN_ENABLED@" = "1"; then
|
||||
echo "IDN"
|
||||
fi
|
||||
if test "@USE_WINDOWS_SSPI@" = "1"; then
|
||||
echo "SSPI"
|
||||
NTLM=1
|
||||
fi
|
||||
if test "$NTLM" = "1"; then
|
||||
echo "NTLM"
|
||||
fi
|
||||
for feature in @SUPPORT_FEATURES@ ""; do
|
||||
test -n "$feature" && echo "$feature"
|
||||
done
|
||||
;;
|
||||
|
||||
--protocols)
|
||||
if test "@CURL_DISABLE_HTTP@" != "1"; then
|
||||
echo "HTTP"
|
||||
if test "@SSL_ENABLED@" = "1"; then
|
||||
echo "HTTPS"
|
||||
fi
|
||||
fi
|
||||
if test "@CURL_DISABLE_FTP@" != "1"; then
|
||||
echo "FTP"
|
||||
if test "@SSL_ENABLED@" = "1"; then
|
||||
echo "FTPS"
|
||||
fi
|
||||
fi
|
||||
if test "@CURL_DISABLE_FILE@" != "1"; then
|
||||
echo "FILE"
|
||||
fi
|
||||
if test "@CURL_DISABLE_TELNET@" != "1"; then
|
||||
echo "TELNET"
|
||||
fi
|
||||
if test "@CURL_DISABLE_LDAP@" != "1"; then
|
||||
echo "LDAP"
|
||||
fi
|
||||
if test "@CURL_DISABLE_LDAPS@" != "1"; then
|
||||
echo "LDAPS"
|
||||
fi
|
||||
if test "@CURL_DISABLE_DICT@" != "1"; then
|
||||
echo "DICT"
|
||||
fi
|
||||
if test "@CURL_DISABLE_TFTP@" != "1"; then
|
||||
echo "TFTP"
|
||||
fi
|
||||
if test "@USE_LIBSSH2@" = "1"; then
|
||||
echo "SCP"
|
||||
echo "SFTP"
|
||||
fi
|
||||
for protocol in @SUPPORT_PROTOCOLS@; do
|
||||
echo "$protocol"
|
||||
done
|
||||
;;
|
||||
--version)
|
||||
echo libcurl @VERSION@
|
||||
|
@@ -181,6 +181,7 @@ Smalltalk
|
||||
http://www.squeaksource.com/CurlPlugin/
|
||||
|
||||
SP-Forth
|
||||
|
||||
SP-Forth binding by ygrek
|
||||
http://www.forth.org.ru/~ac/lib/lin/curl/
|
||||
|
||||
@@ -199,6 +200,11 @@ Visual Basic
|
||||
libcurl-vb by Jeffrey Phillips
|
||||
http://sourceforge.net/projects/libcurl-vb/
|
||||
|
||||
Visual Foxpro
|
||||
|
||||
by Carlos Alloatti
|
||||
http://www.ctl32.com.ar/libcurl.asp
|
||||
|
||||
Q
|
||||
The libcurl module is part of the default install
|
||||
http://q-lang.sourceforge.net/
|
||||
|
36
docs/FAQ
36
docs/FAQ
@@ -1,4 +1,4 @@
|
||||
Updated: Feb 18, 2008 (http://curl.haxx.se/docs/faq.html)
|
||||
Updated: Sep 24, 2008 (http://curl.haxx.se/docs/faq.html)
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
@@ -70,6 +70,7 @@ FAQ
|
||||
4.13 Why is curl -R on Windows one hour off?
|
||||
4.14 Redirects work in browser but not with curl!
|
||||
4.15 FTPS doesn't work
|
||||
4.16 My HTTP POST or PUT requests are slow!
|
||||
|
||||
5. libcurl Issues
|
||||
5.1 Is libcurl thread-safe?
|
||||
@@ -85,6 +86,7 @@ FAQ
|
||||
5.11 How do I make libcurl not receive the whole HTTP response?
|
||||
5.12 Can I make libcurl fake or hide my real IP address?
|
||||
5.13 How do I stop an ongoing transfer?
|
||||
5.14 Using C++ non-static functions for callbacks?
|
||||
|
||||
6. License Issues
|
||||
6.1 I have a GPL program, can I use the libcurl library?
|
||||
@@ -867,6 +869,20 @@ FAQ
|
||||
mandated by RFC4217. This kind of connection then of course uses the
|
||||
standard FTP port 21 by default.
|
||||
|
||||
4.16 My HTTP POST or PUT requests are slow!
|
||||
|
||||
libcurl makes all POST and PUT requests (except for POST requests with a
|
||||
very tiny request body) use the "Expect: 100-continue" header. This header
|
||||
allows the server to deny the operation early so that libcurl can bail out
|
||||
already before having to send any data. This is useful in authentication
|
||||
cases and others.
|
||||
|
||||
However, many servers don't implement the Expect: stuff properly and if the
|
||||
server doesn't respond (positively) within 1 second libcurl will continue
|
||||
and send off the data anyway.
|
||||
|
||||
You can disable libcurl's use of the Expect: header the same way you disable
|
||||
any header, using -H / CURLOPT_HTTPHEADER, or by forcing it to use HTTP 1.0.
|
||||
|
||||
5. libcurl Issues
|
||||
|
||||
@@ -1070,6 +1086,24 @@ FAQ
|
||||
If you're using the multi interface, you also stop a transfer by removing
|
||||
the particular easy handle from the multi stack.
|
||||
|
||||
5.14 Using C++ non-static functions for callbacks?
|
||||
|
||||
libcurl is a C library, it doesn't know anything about C++ member functions.
|
||||
|
||||
You can overcome this "limitation" with a relative ease using a static
|
||||
member function that is passed a pointer to the class:
|
||||
|
||||
// f is the pointer to your object.
|
||||
static YourClass::staticFunction(void *buffer, size_t sz, size_t n, void *f)
|
||||
{
|
||||
// Call non-static member function.
|
||||
static_cast<YourClass*>(f)->nonStaticFunction();
|
||||
}
|
||||
|
||||
// This is how you pass pointer to the static function:
|
||||
curl_easy_setopt(hcurl, CURLOPT_WRITEFUNCTION, YourClass:staticFunction);
|
||||
curl_easy_setopt(hcurl, CURLOPT_WRITEDATA, this);
|
||||
|
||||
6. License Issues
|
||||
|
||||
Curl and libcurl are released under a MIT/X derivate license. The license is
|
||||
|
25
docs/INSTALL
25
docs/INSTALL
@@ -770,10 +770,12 @@ REDUCING SIZE
|
||||
will not use, here are some other flags that can reduce the size of the
|
||||
library:
|
||||
|
||||
--disable-ares (disables support for the ARES DNS library)
|
||||
--disable-ares (disables support for the C-ARES DNS library)
|
||||
--disable-cookies (disables support for HTTP cookies)
|
||||
--disable-crypto-auth (disables HTTP cryptographic authentication)
|
||||
--disable-ipv6 (disables support for IPv6)
|
||||
--disable-manual (disables support for the built-in documentation)
|
||||
--disable-proxy (disables support for HTTP and SOCKS proxies)
|
||||
--disable-verbose (eliminates debugging strings and error code strings)
|
||||
--enable-hidden-symbols (eliminates unneeded symbols in the shared library)
|
||||
--without-libidn (disables support for the libidn DNS library)
|
||||
@@ -789,12 +791,24 @@ REDUCING SIZE
|
||||
sections of the shared library using the -R option to objcopy (e.g. the
|
||||
.comment section).
|
||||
|
||||
Using these techniques it is possible to create an HTTP-only shared libcurl
|
||||
library for i386 Linux platforms that is only 96 KiB in size (as of libcurl
|
||||
version 7.17.1, using gcc 4.2.2).
|
||||
Using these techniques it is possible to create a basic HTTP-only shared
|
||||
libcurl library for i386 Linux platforms that is only 94 KiB in size, and
|
||||
an FTP-only library that is 87 KiB in size (as of libcurl version 7.19.1,
|
||||
using gcc 4.2.2).
|
||||
|
||||
You may find that statically linking libcurl to your application will
|
||||
result in a lower total size.
|
||||
result in a lower total size than dynamically linking.
|
||||
|
||||
Note that the curl test harness can detect the use of some, but not all, of
|
||||
the --disable statements suggested above. Use will cause tests relying on
|
||||
those features to fail. The test harness can be manually forced to skip
|
||||
the relevant tests by specifying certain key words on the runtests.pl
|
||||
command line. Following is a list of appropriate key words:
|
||||
|
||||
--disable-cookies !cookies
|
||||
--disable-crypto-auth !HTTP\ Digest\ auth !HTTP\ proxy\ Digest\ auth
|
||||
--disable-manual !--manual
|
||||
--disable-proxy !HTTP\ proxy !proxytunnel !SOCKS4 !SOCKS5
|
||||
|
||||
|
||||
PORTS
|
||||
@@ -811,6 +825,7 @@ PORTS
|
||||
- Alpha OpenBSD 3.0
|
||||
- Alpha OpenVMS V7.1-1H2
|
||||
- Alpha Tru64 v5.0 5.1
|
||||
- AVR32 Linux
|
||||
- HP-PA HP-UX 9.X 10.X 11.X
|
||||
- HP-PA Linux
|
||||
- HP3000 MPE/iX
|
||||
|
@@ -160,11 +160,6 @@ may have been fixed since this was written!
|
||||
doesn't do a HEAD first to get the initial size. This needs to be done
|
||||
manually for HTTP PUT resume to work, and then '-C [index]'.
|
||||
|
||||
7. CURLOPT_USERPWD and CURLOPT_PROXYUSERPWD have no way of providing user names
|
||||
that contain a colon. This can't be fixed easily in a backwards compatible
|
||||
way without adding new options (and then, they should most probably allow
|
||||
setting user name and password separately).
|
||||
|
||||
6. libcurl ignores empty path parts in FTP URLs, whereas RFC1738 states that
|
||||
such parts should be sent to the server as 'CWD ' (without an argument).
|
||||
The only exception to this rule, is that we knowingly break this if the
|
||||
|
18
docs/THANKS
18
docs/THANKS
@@ -35,6 +35,7 @@ Andreas Faerber
|
||||
Andreas Ntaflos
|
||||
Andreas Olsson
|
||||
Andreas Rieke
|
||||
Andreas Schuldei
|
||||
Andres Garcia
|
||||
Andrew Benham
|
||||
Andrew Biggs
|
||||
@@ -46,15 +47,18 @@ Andrew Wansink
|
||||
Andr<EFBFBD>s Garc<72>a
|
||||
Andy Cedilnik
|
||||
Andy Serpa
|
||||
Andy Tsouladze
|
||||
Angus Mackay
|
||||
Antoine Calando
|
||||
Anton Kalmykov
|
||||
Arkadiusz Miskiewicz
|
||||
Armel Asselin
|
||||
Arnaud Ebalard
|
||||
Arve Knudsen
|
||||
Ates Goral
|
||||
Augustus Saunders
|
||||
Avery Fay
|
||||
Axel Tillequin
|
||||
Bart Whiteley
|
||||
Ben Greear
|
||||
Ben Madsen
|
||||
@@ -100,6 +104,7 @@ Cody Jones
|
||||
Colin Hogben
|
||||
Colin Watson
|
||||
Colm Buckley
|
||||
Constantine Sapuntzakis
|
||||
Cory Nelson
|
||||
Craig Davison
|
||||
Craig Markwardt
|
||||
@@ -126,6 +131,7 @@ Dave Halbakken
|
||||
Dave Hamilton
|
||||
Dave May
|
||||
Dave Vasilevsky
|
||||
David Bau
|
||||
David Byron
|
||||
David Cohen
|
||||
David Eriksson
|
||||
@@ -145,6 +151,7 @@ David Tarendash
|
||||
David Thiel
|
||||
David Wright
|
||||
David Yan
|
||||
Dengminwen
|
||||
Detlef Schmier
|
||||
Diego Casorran
|
||||
Dima Barsky
|
||||
@@ -172,6 +179,7 @@ Dylan Ellicott
|
||||
Dylan Salisbury
|
||||
Early Ehlinger
|
||||
Edin Kadribasic
|
||||
Eduard Bloch
|
||||
Eetu Ojanen
|
||||
Ellis Pritchard
|
||||
Emil Romanus
|
||||
@@ -241,6 +249,7 @@ Hamish Mackenzie
|
||||
Hang Kin Lau
|
||||
Hanno Kranzhoff
|
||||
Hans Steegers
|
||||
Hans-Jurgen May
|
||||
Hardeep Singh
|
||||
Harshal Pradhan
|
||||
Heikki Korpela
|
||||
@@ -306,6 +315,7 @@ John Crow
|
||||
John Janssen
|
||||
John Kelly
|
||||
John Lask
|
||||
John Lightsey
|
||||
John McGowan
|
||||
Johnny Luong
|
||||
Jon Grubbs
|
||||
@@ -366,6 +376,7 @@ Lau Hang Kin
|
||||
Legoff Vincent
|
||||
Lehel Bernadt
|
||||
Len Krause
|
||||
Lenny Rachitsky
|
||||
Liam Healy
|
||||
Linas Vepstas
|
||||
Ling Thio
|
||||
@@ -480,6 +491,7 @@ Pete Su
|
||||
Peter Bray
|
||||
Peter Forret
|
||||
Peter Heuchert
|
||||
Peter Lamberg
|
||||
Peter O'Gorman
|
||||
Peter Pentchev
|
||||
Peter Silva
|
||||
@@ -489,7 +501,9 @@ Peter Todd
|
||||
Peter Verhas
|
||||
Peter Wullinger
|
||||
Peteris Krumins
|
||||
Phil Blundell
|
||||
Phil Karn
|
||||
Phil Pellouchoud
|
||||
Philip Gladstone
|
||||
Philip Langdale
|
||||
Philippe Hameau
|
||||
@@ -497,6 +511,7 @@ Philippe Raoult
|
||||
Philippe Vaucher
|
||||
Pierre
|
||||
Pooyan McSporran
|
||||
Pramod Sharma
|
||||
Puneet Pawaia
|
||||
Quagmire
|
||||
Rafa Muyo
|
||||
@@ -541,6 +556,7 @@ Rodney Simmons
|
||||
Roland Blom
|
||||
Roland Krikava
|
||||
Roland Zimmermann
|
||||
Rolland Dudemaine
|
||||
Roman Koifman
|
||||
Ron Zapp
|
||||
Rosimildo da Silva
|
||||
@@ -636,6 +652,7 @@ Victor Snezhko
|
||||
Vikram Saxena
|
||||
Vilmos Nebehaj
|
||||
Vincent Bronner
|
||||
Vincent Le Normand
|
||||
Vincent Penquerc'h
|
||||
Vincent Sanders
|
||||
Vladimir Lazarenko
|
||||
@@ -651,6 +668,7 @@ Wojciech Zwiefka
|
||||
Xavier Bouchoux
|
||||
Yang Tse
|
||||
Yarram Sunil
|
||||
Yehoshua Hershberg
|
||||
Yuriy Sosov
|
||||
Yves Lejeune
|
||||
Zmey Petroff
|
||||
|
21
docs/TODO
21
docs/TODO
@@ -18,6 +18,7 @@
|
||||
1.4 Get IP address
|
||||
1.5 c-ares ipv6
|
||||
1.6 configure-based info in public headers
|
||||
1.7 signal-based resolver timeouts
|
||||
|
||||
2. libcurl - multi interface
|
||||
2.1 More non-blocking
|
||||
@@ -50,7 +51,7 @@
|
||||
|
||||
7. SSL
|
||||
7.1 Disable specific versions
|
||||
7.2 Provide mytex locking API
|
||||
7.2 Provide mutex locking API
|
||||
7.3 dumpcert
|
||||
7.4 Evaluate SSL patches
|
||||
7.5 Cache OpenSSL contexts
|
||||
@@ -152,7 +153,7 @@
|
||||
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).
|
||||
a collision with other apps that use libcurl and that runs configure).
|
||||
|
||||
Work on this has been started but hasn't been finished, and the initial patch
|
||||
and some details are found here:
|
||||
@@ -161,11 +162,23 @@
|
||||
The remaining problems to solve involve the platforms that can't run
|
||||
configure.
|
||||
|
||||
1.7 signal-based resolver timeouts
|
||||
|
||||
libcurl built without an asynchronous resolver library uses alarm() to time
|
||||
out DNS lookups. When a timeout occurs, this causes libcurl to jump from the
|
||||
signal handler back into the library with a sigsetjmp, which effectively
|
||||
causes libcurl to continue running within the signal handler. This is
|
||||
non-portable and could cause problems on some platforms. A discussion on the
|
||||
problem is available at http://curl.haxx.se/mail/lib-2008-09/0197.html
|
||||
|
||||
Also, alarm() provides timeout resolution only to the nearest second. alarm
|
||||
ought to be replaced by setitimer on systems that support it.
|
||||
|
||||
2. libcurl - multi interface
|
||||
|
||||
2.1 More non-blocking
|
||||
|
||||
Make sure we don't ever loop because of non-blocking sockets return
|
||||
Make sure we don't ever loop because of non-blocking sockets returning
|
||||
EWOULDBLOCK or similar. The GnuTLS connection etc.
|
||||
|
||||
2.2 Pause transfers
|
||||
@@ -304,7 +317,7 @@ to provide the data to send.
|
||||
Provide an option that allows for disabling specific SSL versions, such as
|
||||
SSLv2 http://curl.haxx.se/bug/feature.cgi?id=1767276
|
||||
|
||||
7.2 Provide mytex locking API
|
||||
7.2 Provide mutex locking API
|
||||
|
||||
Provide a libcurl API for setting mutex callbacks in the underlying SSL
|
||||
library, so that the same application code can use mutex-locking
|
||||
|
248
docs/curl.1
248
docs/curl.1
@@ -34,7 +34,7 @@ protocols (HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT, TELNET, LDAP or
|
||||
FILE). The command is designed to work without user interaction.
|
||||
|
||||
curl offers a busload of useful tricks like proxy support, user
|
||||
authentication, ftp upload, HTTP post, SSL connections, cookies, file transfer
|
||||
authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer
|
||||
resume and more. As you will see below, the number of features will make your
|
||||
head spin!
|
||||
|
||||
@@ -42,7 +42,7 @@ curl is powered by libcurl for all transfer-related features. See
|
||||
.BR libcurl (3)
|
||||
for details.
|
||||
.SH URL
|
||||
The URL syntax is protocol dependent. You'll find a detailed description in
|
||||
The URL syntax is protocol-dependent. You'll find a detailed description in
|
||||
RFC 3986.
|
||||
|
||||
You can specify multiple URLs or parts of URLs by writing part sets within
|
||||
@@ -64,7 +64,7 @@ several ones next to each other:
|
||||
You can specify any amount of URLs on the command line. They will be fetched
|
||||
in a sequential manner in the specified order.
|
||||
|
||||
Since curl 7.15.1 you can also specify step counter for the ranges, so that
|
||||
Since curl 7.15.1 you can also specify a step counter for the ranges, so that
|
||||
you can get every Nth number or letter:
|
||||
|
||||
http://www.numericals.com/file[1-100:10].txt
|
||||
@@ -81,10 +81,10 @@ handshakes. This improves speed. Of course this is only done on files
|
||||
specified on a single command line and cannot be used between separate curl
|
||||
invokes.
|
||||
.SH "PROGRESS METER"
|
||||
curl normally displays a progress meter during operations, indicating amount
|
||||
of transferred data, transfer speeds and estimated time left etc.
|
||||
curl normally displays a progress meter during operations, indicating the amount
|
||||
of transferred data, transfer speeds and estimated time left, etc.
|
||||
|
||||
However, since curl displays data to the terminal by default, if you invoke
|
||||
However, since curl displays this data to the terminal by default, if you invoke
|
||||
curl to do an operation and it is about to write data to the terminal, it
|
||||
\fIdisables\fP the progress meter as otherwise it would mess up the output
|
||||
mixing progress meter and response data.
|
||||
@@ -93,7 +93,7 @@ If you want a progress meter for HTTP POST or PUT requests, you need to
|
||||
redirect the response output to a file, using shell redirect (>), -o [file] or
|
||||
similar.
|
||||
|
||||
It is not the same case for FTP upload as that operation is not spitting out
|
||||
It is not the same case for FTP upload as that operation does not spit out
|
||||
any response data to the terminal.
|
||||
|
||||
If you prefer a progress "bar" instead of the regular meter, \fI-#\fP is your
|
||||
@@ -119,7 +119,7 @@ If this option is set more than once, the last one will be the one that's
|
||||
used.
|
||||
.IP "--anyauth"
|
||||
(HTTP) Tells curl to figure out authentication method by itself, and use the
|
||||
most secure one the remote site claims it supports. This is done by first
|
||||
most secure one the remote site claims to support. This is done by first
|
||||
doing a request and checking the response-headers, thus possibly inducing an
|
||||
extra network round-trip. This is used instead of setting a specific
|
||||
authentication method, which you can do with \fI--basic\fP, \fI--digest\fP,
|
||||
@@ -158,10 +158,10 @@ sent to stdout to be in text mode for win32 systems.
|
||||
(HTTP) Tells curl to use HTTP Basic authentication. This is the default and
|
||||
this option is usually pointless, unless you use it to override a previously
|
||||
set option that sets a different authentication method (such as \fI--ntlm\fP,
|
||||
\fI--digest\fP and \fI--negotiate\fP).
|
||||
\fI--digest\fP, or \fI--negotiate\fP).
|
||||
.IP "--ciphers <list of ciphers>"
|
||||
(SSL) Specifies which ciphers to use in the connection. The list of ciphers
|
||||
must be using valid ciphers. Read up on SSL cipher list details on this URL:
|
||||
must specify valid ciphers. Read up on SSL cipher list details on this URL:
|
||||
\fIhttp://www.openssl.org/docs/apps/ciphers.html\fP
|
||||
|
||||
NSS ciphers are done differently than OpenSSL and GnuTLS. The full list of
|
||||
@@ -199,7 +199,7 @@ used.
|
||||
Continue/Resume a previous file transfer at the given offset. The given offset
|
||||
is the exact number of bytes that will be skipped counted from the beginning
|
||||
of the source file before it is transferred to the destination. If used with
|
||||
uploads, the ftp server command SIZE will not be used by curl.
|
||||
uploads, the FTP server command SIZE will not be used by curl.
|
||||
|
||||
Use "-C -" to tell curl to automatically find out where/how to resume the
|
||||
transfer. It then uses the given output/input files to figure that out.
|
||||
@@ -223,7 +223,7 @@ using the content-type application/x-www-form-urlencoded. Compare to
|
||||
\fI-F/--form\fP.
|
||||
|
||||
\fI-d/--data\fP is the same as \fI--data-ascii\fP. To post data purely binary,
|
||||
you should instead use the \fI--data-binary\fP option. To URL encode the value
|
||||
you should instead use the \fI--data-binary\fP option. To URL-encode the value
|
||||
of a form field you may use \fI--data-urlencode\fP.
|
||||
|
||||
If any of these options is used more than once on the same command line, the
|
||||
@@ -233,7 +233,7 @@ chunk that looks like \&'name=daniel&skill=lousy'.
|
||||
|
||||
If you start the data with the letter @, the rest should be a file name to
|
||||
read the data from, or - if you want curl to read the data from stdin. The
|
||||
contents of the file must already be url-encoded. Multiple files can also be
|
||||
contents of the file must already be URL-encoded. Multiple files can also be
|
||||
specified. Posting data from a file named 'foobar' would thus be done with
|
||||
\fI--data @foobar\fP.
|
||||
.IP "--data-binary <data>"
|
||||
@@ -245,33 +245,33 @@ is posted in a similar manner as \fI--data-ascii\fP does, except that newlines
|
||||
are preserved and conversions are never done.
|
||||
|
||||
If this option is used several times, the ones following the first will append
|
||||
data. As described in \fI-d/--data\fP.
|
||||
data as described in \fI-d/--data\fP.
|
||||
.IP "--data-urlencode <data>"
|
||||
(HTTP) This posts data, similar to the other --data options with the exception
|
||||
that this performs URL encoding. (Added in 7.18.0)
|
||||
that this performs URL-encoding. (Added in 7.18.0)
|
||||
|
||||
To be CGI compliant, the <data> part should begin with a \fIname\fP followed
|
||||
To be CGI-compliant, the <data> part should begin with a \fIname\fP followed
|
||||
by a separator and a content specification. The <data> part can be passed to
|
||||
curl using one of the following syntaxes:
|
||||
.RS
|
||||
.IP "content"
|
||||
This will make curl URL encode the content and pass that on. Just be careful
|
||||
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 =
|
||||
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.
|
||||
This will make curl URL-encode the content part and pass that on. Note that
|
||||
the name part is expected to be URL-encoded already.
|
||||
.IP "@filename"
|
||||
This will make curl load data from the given file (including any newlines),
|
||||
URL encode that data and pass it on in the POST.
|
||||
URL-encode that data and pass it on in the POST.
|
||||
.IP "name@filename"
|
||||
This will make curl load data from the given file (including any newlines),
|
||||
URL encode that data and pass it on in the POST. The name part gets an equal
|
||||
URL-encode that data and pass it on in the POST. The name part gets an equal
|
||||
sign appended, resulting in \fIname=urlencoded-file-content\fP. Note that the
|
||||
name is expected to be URL encoded already.
|
||||
name is expected to be URL-encoded already.
|
||||
.RE
|
||||
.IP "--digest"
|
||||
(HTTP) Enables HTTP Digest authentication. This is a authentication that
|
||||
@@ -304,10 +304,10 @@ Write the protocol headers to the specified file.
|
||||
|
||||
This option is handy to use when you want to store the headers that a HTTP
|
||||
site sends to you. Cookies from the headers could then be read in a second
|
||||
curl invoke by using the \fI-b/--cookie\fP option! The \fI-c/--cookie-jar\fP
|
||||
curl invocation by using the \fI-b/--cookie\fP option! The \fI-c/--cookie-jar\fP
|
||||
option is however a better way to store cookies.
|
||||
|
||||
When used on FTP, the ftp server response lines are considered being "headers"
|
||||
When used in FTP, the FTP server response lines are considered being "headers"
|
||||
and thus are saved there.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
@@ -358,7 +358,7 @@ file may contain multiple CA certificates. The certificate(s) must be in PEM
|
||||
format. Normally curl is built to use a default file for this, so this option
|
||||
is typically used to alter that default file.
|
||||
|
||||
curl recognizes the environment variable named 'CURL_CA_BUNDLE' if that is
|
||||
curl recognizes the environment variable named 'CURL_CA_BUNDLE' if it is
|
||||
set, and uses the given path as a path to a CA cert bundle. This option
|
||||
overrides that variable.
|
||||
|
||||
@@ -384,7 +384,7 @@ certificates.
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-f/--fail"
|
||||
(HTTP) Fail silently (no output at all) on server errors. This is mostly done
|
||||
like this to better enable scripts etc to better deal with failed attempts. In
|
||||
to better enable scripts etc to better deal with failed attempts. In
|
||||
normal cases when a HTTP server fails to deliver a document, it returns an
|
||||
HTML document stating so (which often also describes why and more). This flag
|
||||
will prevent curl from outputting that and return error 22.
|
||||
@@ -419,6 +419,7 @@ curl does one CWD with the full target directory and then operates on the file
|
||||
\&"normally" (like in the multicwd case). This is somewhat more standards
|
||||
compliant than 'nocwd' but without the full penalty of 'multicwd'.
|
||||
.RE
|
||||
(Added in 7.15.1)
|
||||
.IP "--ftp-pasv"
|
||||
(FTP) Use PASV when transferring. PASV is the internal default behavior, but
|
||||
using this option can be used to override a previous --ftp-port option. (Added
|
||||
@@ -445,7 +446,7 @@ connection if the server doesn't support SSL/TLS. See also
|
||||
\fI--ftp-ssl-control\fP and \fI--ftp-ssl-reqd\fP for different levels of
|
||||
encryption required. (Added in 7.11.0)
|
||||
.IP "--ftp-ssl-control"
|
||||
(FTP) Require SSL/TLS for the ftp login, clear for transfer. Allows secure
|
||||
(FTP) Require SSL/TLS for the FTP login, clear for transfer. Allows secure
|
||||
authentication, but non-encrypted data transfers for efficiency. Fails the
|
||||
transfer if the server doesn't support SSL/TLS. (Added in 7.16.0)
|
||||
.IP "--ftp-ssl-reqd"
|
||||
@@ -467,7 +468,7 @@ shutdown from the server. The active mode initiates the shutdown and
|
||||
waits for a reply from the server.
|
||||
(Added in 7.16.2)
|
||||
.IP "-F/--form <name=content>"
|
||||
(HTTP) This lets curl emulate a filled in form in which a user has pressed the
|
||||
(HTTP) This lets curl emulate a filled-in form in which a user has pressed the
|
||||
submit button. This causes curl to POST data using the Content-Type
|
||||
multipart/form-data according to RFC1867. This enables uploading of binary
|
||||
files etc. To force the 'content' part to be a file, prefix the file name
|
||||
@@ -517,7 +518,7 @@ contents but they should be encoded according to the URI standard.
|
||||
When used, this option will make all data specified with \fI-d/--data\fP or
|
||||
\fI--data-binary\fP to be used in a HTTP GET request instead of the POST
|
||||
request that otherwise would be used. The data will be appended to the URL
|
||||
with a '?' separator.
|
||||
with a '?' separator.
|
||||
|
||||
If used in combination with -I, the POST data will instead be appended to the
|
||||
URL with a HEAD request.
|
||||
@@ -537,9 +538,9 @@ set headers without knowing perfectly well what you're doing. Remove an
|
||||
internal header by giving a replacement without content on the right side of
|
||||
the colon, as in: -H \&"Host:".
|
||||
|
||||
curl will make sure that each header you add/replace get sent with the proper
|
||||
end of line marker, you should thus \fBnot\fP add that as a part of the header
|
||||
content: do not add newlines or carriage returns they will only mess things up
|
||||
curl will make sure that each header you add/replace is sent with the proper
|
||||
end-of-line marker, you should thus \fBnot\fP add that as a part of the header
|
||||
content: do not add newlines or carriage returns, they will only mess things up
|
||||
for you.
|
||||
|
||||
See also the \fI-A/--user-agent\fP and \fI-e/--referer\fP options.
|
||||
@@ -580,7 +581,7 @@ cookies when they're closed down.
|
||||
(SSL) This option explicitly allows curl to perform "insecure" SSL connections
|
||||
and transfers. All SSL connections are attempted to be made secure by using
|
||||
the CA certificate bundle installed by default. This makes all connections
|
||||
considered "insecure" to fail unless \fI-k/--insecure\fP is used.
|
||||
considered "insecure" fail unless \fI-k/--insecure\fP is used.
|
||||
|
||||
See this online resource for further details:
|
||||
\fBhttp://curl.haxx.se/docs/sslcerts.html\fP
|
||||
@@ -599,16 +600,16 @@ separate file.
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--key-type <type>"
|
||||
(SSL) Private key file type. Specify which type your \fI--key\fP provided
|
||||
private key is. DER, PEM and ENG are supported. If not specified, PEM is
|
||||
private key is. DER, PEM, and ENG are supported. If not specified, PEM is
|
||||
assumed.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--krb <level>"
|
||||
(FTP) Enable Kerberos authentication and use. The level must be entered and
|
||||
should be one of 'clear', 'safe', 'confidential' or 'private'. Should you use
|
||||
should be one of 'clear', 'safe', 'confidential', or 'private'. Should you use
|
||||
a level that is not one of these, 'private' will instead be used.
|
||||
|
||||
This option requires that the library was built with kerberos4 or GSSAPI
|
||||
This option requires a library built with kerberos4 or GSSAPI
|
||||
(GSS-Negotiate) support. This is not very common. Use \fI-V/--version\fP to
|
||||
see if your curl supports it.
|
||||
|
||||
@@ -618,11 +619,11 @@ Specify which config file to read curl arguments from. The config file is a
|
||||
text file in which command line arguments can be written which then will be
|
||||
used as if they were written on the actual command line. Options and their
|
||||
parameters must be specified on the same config file line, separated by
|
||||
white space, colon, the equals sign or any combination thereof (however,
|
||||
whitespace, colon, the equals sign or any combination thereof (however,
|
||||
the preferred separator is the equals sign). If the parameter is to contain
|
||||
white spaces, the parameter must be enclosed within quotes. Within double
|
||||
whitespace, the parameter must be enclosed within quotes. Within double
|
||||
quotes, the following escape sequences are available: \\\\, \\", \\t, \\n,
|
||||
\\r and \\v. A backlash preceding any other letter is ignored. If the
|
||||
\\r and \\v. A backslash preceding any other letter is ignored. If the
|
||||
first column of a config line is a '#' character, the rest of the line will be
|
||||
treated as a comment. Only write one option per physical line in the config
|
||||
file.
|
||||
@@ -645,12 +646,12 @@ the following places in this order:
|
||||
|
||||
1) curl tries to find the "home dir": It first checks for the CURL_HOME and
|
||||
then the HOME environment variables. Failing that, it uses getpwuid() on
|
||||
unix-like systems (which returns the home dir given the current user in your
|
||||
UNIX-like systems (which returns the home dir given the current user in your
|
||||
system). On Windows, it then checks for the APPDATA variable, or as a last
|
||||
resort the '%USERPROFILE%\Application Data'.
|
||||
resort the '%USERPROFILE%\\Application Data'.
|
||||
|
||||
2) On windows, if there is no _curlrc file in the home dir, it checks for one
|
||||
in the same dir the executable curl is placed. On unix-like systems, it will
|
||||
in the same dir the curl executable is placed. On UNIX-like systems, it will
|
||||
simply try to load .curlrc from the determined home dir.
|
||||
|
||||
.nf
|
||||
@@ -671,7 +672,7 @@ This option can be used multiple times to load multiple config files.
|
||||
.IP "--libcurl <file>"
|
||||
Append this option to any ordinary curl command line, and you will get a
|
||||
libcurl-using source code written to the file that does the equivalent
|
||||
operation of what your command line operation does!
|
||||
of what your command-line operation does!
|
||||
|
||||
NOTE: this does not properly support -F and the sending of multipart
|
||||
formposts, so in those cases the output program will be missing necessary
|
||||
@@ -681,18 +682,18 @@ If this option is used several times, the last given file name will be
|
||||
used. (Added in 7.16.1)
|
||||
.IP "--limit-rate <speed>"
|
||||
Specify the maximum transfer rate you want curl to use. This feature is useful
|
||||
if you have a limited pipe and you'd like your transfer not use your entire
|
||||
if you have a limited pipe and you'd like your transfer not to use your entire
|
||||
bandwidth.
|
||||
|
||||
The given speed is measured in bytes/second, unless a suffix is appended.
|
||||
Appending 'k' or 'K' will count the number as kilobytes, 'm' or M' makes it
|
||||
megabytes while 'g' or 'G' makes it gigabytes. Examples: 200K, 3m and 1G.
|
||||
megabytes, while 'g' or 'G' makes it gigabytes. Examples: 200K, 3m and 1G.
|
||||
|
||||
The given rate is the average speed, counted during the entire transfer. It
|
||||
The given rate is the average speed counted during the entire transfer. It
|
||||
means that curl might use higher transfer speeds in short bursts, but over
|
||||
time it uses no more than the given rate.
|
||||
|
||||
If you are also using the \fI-Y/--speed-limit\fP option, that option will take
|
||||
If you also use the \fI-Y/--speed-limit\fP option, that option will take
|
||||
precedence and might cripple the rate-limiting slightly, to help keeping the
|
||||
speed-limit logic working.
|
||||
|
||||
@@ -710,12 +711,12 @@ subdirectories and symbolic links.
|
||||
|
||||
.IP "--local-port <num>[-num]"
|
||||
Set a preferred number or range of local port numbers to use for the
|
||||
connection(s). Note that port numbers by nature is a scarce resource that
|
||||
connection(s). Note that port numbers by nature are a scarce resource that
|
||||
will be busy at times so setting this range to something too narrow might
|
||||
cause unnecessary connection setup failures. (Added in 7.15.2)
|
||||
.IP "-L/--location"
|
||||
(HTTP/HTTPS) If the server reports that the requested page has moved to a
|
||||
different location (indicated with a Location: header and a 3XX response code)
|
||||
different location (indicated with a Location: header and a 3XX response code),
|
||||
this option will make curl redo the request on the new place. If used together
|
||||
with \fI-i/--include\fP or \fI-I/--head\fP, headers from all requested pages
|
||||
will be shown. When authentication is used, curl only sends its credentials to
|
||||
@@ -740,7 +741,7 @@ Specify the maximum size (in bytes) of a file to download. If the file
|
||||
requested is larger than this value, the transfer will not start and curl will
|
||||
return with exit code 63.
|
||||
|
||||
NOTE: The file size is not always known prior to download, and for such files
|
||||
\fBNOTE:\fP The file size is not always known prior to download, and for such files
|
||||
this option has no effect even if the file transfer ends up being larger than
|
||||
this given limit. This concerns both FTP and HTTP transfers.
|
||||
.IP "-m/--max-time <seconds>"
|
||||
@@ -753,24 +754,24 @@ If this option is used several times, the last one will be used.
|
||||
Manual. Display the huge help text.
|
||||
.IP "-n/--netrc"
|
||||
Makes curl scan the \fI.netrc\fP (\fI_netrc\fP on Windows) file in the user's
|
||||
home directory for login name and password. This is typically used for ftp on
|
||||
unix. If used with http, curl will enable user authentication. See
|
||||
home directory for login name and password. This is typically used for FTP on
|
||||
UNIX. If used with HTTP, curl will enable user authentication. See
|
||||
.BR netrc(4)
|
||||
or
|
||||
.BR ftp(1)
|
||||
for details on the file format. Curl will not complain if that file
|
||||
hasn't the right permissions (it should not be world nor group
|
||||
readable). The environment variable "HOME" is used to find the home
|
||||
doesn't have the right permissions (it should not be either world- or
|
||||
group-readable). The environment variable "HOME" is used to find the home
|
||||
directory.
|
||||
|
||||
A quick and very simple example of how to setup a \fI.netrc\fP to allow curl
|
||||
to ftp to the machine host.domain.com with user name \&'myself' and password
|
||||
to FTP to the machine host.domain.com with user name \&'myself' and password
|
||||
\&'secret' should look similar to:
|
||||
|
||||
.B "machine host.domain.com login myself password secret"
|
||||
.IP "--netrc-optional"
|
||||
Very similar to \fI--netrc\fP, but this option makes the .netrc usage
|
||||
\fBoptional\fP and not mandatory as the \fI--netrc\fP does.
|
||||
\fBoptional\fP and not mandatory as the \fI--netrc\fP option does.
|
||||
.IP "--negotiate"
|
||||
(HTTP) Enables GSS-Negotiate authentication. The GSS-Negotiate method was
|
||||
designed by Microsoft and is used in their web applications. It is primarily
|
||||
@@ -781,7 +782,7 @@ draft-brezak-spnego-http-04.txt.
|
||||
If you want to enable Negotiate for your proxy authentication, then use
|
||||
\fI--proxy-negotiate\fP.
|
||||
|
||||
This option requires that the library was built with GSSAPI support. This is
|
||||
This option requires a library built with GSSAPI support. This is
|
||||
not very common. Use \fI-V/--version\fP to see if your version supports
|
||||
GSS-Negotiate.
|
||||
|
||||
@@ -807,7 +808,7 @@ Note that this is the negated option name documented. You can thus use
|
||||
\fI--keepalive\fP to enforce keepalive.
|
||||
.IP "--no-sessionid"
|
||||
(SSL) Disable curl's use of SSL session-ID caching. By default all transfers
|
||||
are done using the cache. Note that while nothing ever should get hurt by
|
||||
are done using the cache. Note that while nothing should ever get hurt by
|
||||
attempting to reuse SSL session-IDs, there seem to be broken SSL
|
||||
implementations in the wild that may require you to disable this in order for
|
||||
you to succeed. (Added in 7.16.0)
|
||||
@@ -817,15 +818,15 @@ Note that this is the negated option name documented. You can thus use
|
||||
.IP "--ntlm"
|
||||
(HTTP) Enables NTLM authentication. The NTLM authentication method was
|
||||
designed by Microsoft and is used by IIS web servers. It is a proprietary
|
||||
protocol, reversed engineered by clever people and implemented in curl based
|
||||
protocol, reverse-engineered by clever people and implemented in curl based
|
||||
on their efforts. This kind of behavior should not be endorsed, you should
|
||||
encourage everyone who uses NTLM to switch to a public and documented
|
||||
authentication method instead. Such as Digest.
|
||||
authentication method instead, such as Digest.
|
||||
|
||||
If you want to enable NTLM for your proxy authentication, then use
|
||||
\fI--proxy-ntlm\fP.
|
||||
|
||||
This option requires that the library was built with SSL support. Use
|
||||
This option requires a library built with SSL support. Use
|
||||
\fI-V/--version\fP to see if your curl supports NTLM.
|
||||
|
||||
If this option is used several times, the following occurrences make no
|
||||
@@ -842,7 +843,7 @@ or use several variables like:
|
||||
|
||||
curl http://{site,host}.host[1-5].com -o "#1_#2"
|
||||
|
||||
You may use this option as many times as you have number of URLs.
|
||||
You may use this option as many times as the number of URLs you have.
|
||||
|
||||
See also the \fI--create-dirs\fP option to create the local directories
|
||||
dynamically.
|
||||
@@ -853,23 +854,30 @@ part of the remote file is used, the path is cut off.)
|
||||
The remote file name to use for saving is extracted from the given URL,
|
||||
nothing else.
|
||||
|
||||
You may use this option as many times as you have number of URLs.
|
||||
You may use this option as many times as the number of URLs you have.
|
||||
.IP "--remote-name-all"
|
||||
This option changes the default action for all given URLs to be dealt with as
|
||||
if \fI-O/--remote-name\fP were used for each one. So if you want to disable
|
||||
that for a specific URL after \fI--remote-name-all\fP has been used, you must
|
||||
use "-o -" or \fI--no-remote-name\fP. (Added in 7.19.0)
|
||||
.IP "--pass <phrase>"
|
||||
(SSL/SSH) Pass phrase for the private key
|
||||
(SSL/SSH) Passphrase for the private key
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--post301"
|
||||
Tells curl to respect RFC 2616/10.3.2 and not convert POST requests into GET
|
||||
requests when following a 301 redirection. The non-RFC behaviour is ubiquitous
|
||||
in web browsers, so curl does the conversion by default to maintain
|
||||
consistency. However, a server may requires a POST to remain a POST after such
|
||||
consistency. However, a server may require a POST to remain a POST after such
|
||||
a redirection. This option is meaningful only when using \fI-L/--location\fP
|
||||
(Added in 7.17.1)
|
||||
.IP "--post302"
|
||||
Tells curl to respect RFC 2616/10.3.2 and not convert POST requests into GET
|
||||
requests when following a 302 redirection. The non-RFC behaviour is ubiquitous
|
||||
in web browsers, so curl does the conversion by default to maintain
|
||||
consistency. However, a server may requires a POST to remain a POST after such
|
||||
a redirection. This option is meaningful only when using \fI-L/--location\fP
|
||||
(Added in 7.19.1)
|
||||
.IP "--proxy-anyauth"
|
||||
Tells curl to pick a suitable authentication method when communicating with
|
||||
the given proxy. This might cause an extra request/response round-trip. (Added
|
||||
@@ -900,18 +908,18 @@ separate file.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-P/--ftp-port <address>"
|
||||
(FTP) Reverses the initiator/listener roles when connecting with ftp. This
|
||||
switch makes Curl use the PORT command instead of PASV. In practise, PORT
|
||||
(FTP) Reverses the initiator/listener roles when connecting with FTP. This
|
||||
switch makes Curl use the PORT command instead of PASV. In practice, PORT
|
||||
tells the server to connect to the client's specified address and port, while
|
||||
PASV asks the server for an ip address and port to connect to. <address>
|
||||
PASV asks the server for an IP address and port to connect to. <address>
|
||||
should be one of:
|
||||
.RS
|
||||
.IP interface
|
||||
i.e "eth0" to specify which interface's IP address you want to use (Unix only)
|
||||
i.e "eth0" to specify which interface's IP address you want to use (Unix only)
|
||||
.IP "IP address"
|
||||
i.e "192.168.10.1" to specify exact IP number
|
||||
i.e "192.168.10.1" to specify the exact IP address
|
||||
.IP "host name"
|
||||
i.e "my.host.domain" to specify machine
|
||||
i.e "my.host.domain" to specify the machine
|
||||
.IP "-"
|
||||
make curl pick the same IP address that is already used for the control
|
||||
connection
|
||||
@@ -926,11 +934,11 @@ file will not be read and used. See the \fI-K/--config\fP for details on the
|
||||
default config file search path.
|
||||
.IP "-Q/--quote <command>"
|
||||
(FTP/SFTP) Send an arbitrary command to the remote FTP or SFTP server. Quote
|
||||
commands are sent BEFORE the transfer is taking place (just after the
|
||||
commands are sent BEFORE the transfer takes place (just after the
|
||||
initial PWD command in an FTP transfer, to be exact). To make commands
|
||||
take place after a successful transfer, prefix them with a dash '-'.
|
||||
To make commands get sent after libcurl has changed working directory,
|
||||
just before the transfer command(s), prefix the command with '+' (this
|
||||
To make commands be sent after libcurl has changed the working directory,
|
||||
just before the transfer command(s), prefix the command with a '+' (this
|
||||
is only supported for FTP). You may specify any number of commands. If
|
||||
the server returns failure for one of the commands, the entire operation
|
||||
will be aborted. You must send syntactically correct FTP commands as
|
||||
@@ -975,9 +983,9 @@ See ln.
|
||||
random data. The data is used to seed the random engine for SSL connections.
|
||||
See also the \fI--egd-file\fP option.
|
||||
.IP "-r/--range <range>"
|
||||
(HTTP/FTP/FILE) Retrieve a byte range (i.e a partial document) from a
|
||||
HTTP/1.1, FTP server or a local FILE. Ranges can be specified in a number of
|
||||
ways.
|
||||
(HTTP/FTP/SFTP/FILE) Retrieve a byte range (i.e a partial document) from a
|
||||
HTTP/1.1, FTP or SFTP server or a local FILE. Ranges can be specified
|
||||
in a number of ways.
|
||||
.RS
|
||||
.TP 10
|
||||
.B 0-499
|
||||
@@ -999,22 +1007,23 @@ specifies the first and last byte only(*)(H)
|
||||
specifies 300 bytes from offset 500(H)
|
||||
.TP
|
||||
.B 100-199,500-599
|
||||
specifies two separate 100 bytes ranges(*)(H)
|
||||
specifies two separate 100-byte ranges(*)(H)
|
||||
.RE
|
||||
|
||||
(*) = NOTE that this will cause the server to reply with a multipart
|
||||
response!
|
||||
|
||||
Only digit characters (0-9) are valid in 'start' and 'stop' of range syntax
|
||||
\&'start-stop'. If a non-digit character is given in the range, the server's
|
||||
response will be indeterminable, depending on different server's configuration.
|
||||
Only digit characters (0-9) are valid in the 'start' and 'stop' fields of
|
||||
the \&'start-stop' range syntax. If a non-digit character is given in the range, the server's
|
||||
response will be unspecified, depending on the server's configuration.
|
||||
|
||||
You should also be aware that many HTTP/1.1 servers do not have this feature
|
||||
enabled, so that when you attempt to get a range, you'll instead get the whole
|
||||
document.
|
||||
|
||||
FTP range downloads only support the simple syntax 'start-stop' (optionally
|
||||
with one of the numbers omitted). It depends on the non-RFC command SIZE.
|
||||
FTP and SFTP range downloads only support the simple 'start-stop' syntax
|
||||
(optionally with one of the numbers omitted). FTP use depends on the extended
|
||||
FTP command SIZE.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "--raw"
|
||||
@@ -1039,13 +1048,13 @@ retries. (Added in 7.12.3)
|
||||
|
||||
If this option is used multiple times, the last occurrence decide the amount.
|
||||
.IP "--retry-delay <seconds>"
|
||||
Make curl sleep this amount of time between each retry when a transfer has
|
||||
Make curl sleep this amount of time before each retry when a transfer has
|
||||
failed with a transient error (it changes the default backoff time algorithm
|
||||
between retries). This option is only interesting if \fI--retry\fP is also
|
||||
used. Setting this delay to zero will make curl use the default backoff time.
|
||||
(Added in 7.12.3)
|
||||
|
||||
If this option is used multiple times, the last occurrence decide the amount.
|
||||
If this option is used multiple times, the last occurrence determines the amount.
|
||||
.IP "--retry-max-time <seconds>"
|
||||
The retry timer is reset before the first transfer attempt. Retries will be
|
||||
done as usual (see \fI--retry\fP) as long as the timer hasn't reached this
|
||||
@@ -1054,12 +1063,13 @@ will be made and while performing, it may take longer than this given time
|
||||
period. To limit a single request\'s maximum time, use \fI-m/--max-time\fP.
|
||||
Set this option to zero to not timeout retries. (Added in 7.12.3)
|
||||
|
||||
If this option is used multiple times, the last occurrence decide the amount.
|
||||
If this option is used multiple times, the last occurrence determines the
|
||||
amount.
|
||||
.IP "-s/--silent"
|
||||
Silent mode. Don't show progress meter or error messages. Makes
|
||||
Curl mute.
|
||||
.IP "-S/--show-error"
|
||||
When used with -s it makes curl show error message if it fails.
|
||||
When used with -s it makes curl show an error message if it fails.
|
||||
.IP "--socks4 <host[:port]>"
|
||||
Use the specified SOCKS4 proxy. If the port number is not specified, it is
|
||||
assumed at port 1080. (Added in 7.15.2)
|
||||
@@ -1120,7 +1130,7 @@ part in the specified URL, Curl will append the local file name. NOTE that you
|
||||
must use a trailing / on the last directory to really prove to Curl that there
|
||||
is no file name or curl will think that your last directory name is the remote
|
||||
file name to use. That will most likely cause the upload operation to fail. If
|
||||
this is used on a http(s) server, the PUT command will be used.
|
||||
this is used on a HTTP(S) server, the PUT command will be used.
|
||||
|
||||
Use the file name "-" (a single dash) to use stdin instead of a given file.
|
||||
|
||||
@@ -1159,7 +1169,7 @@ If this option is used several times, the last one will be used.
|
||||
Prepends a time stamp to each trace or verbose line that curl displays.
|
||||
(Added in 7.14.0)
|
||||
.IP "-u/--user <user:password>"
|
||||
Specify user and password to use for server authentication. Overrides
|
||||
Specify the user name and password to use for server authentication. Overrides
|
||||
\fI-n/--netrc\fP and \fI--netrc-optional\fP.
|
||||
|
||||
If you just give the user name (without entering a colon) curl will prompt for
|
||||
@@ -1171,7 +1181,7 @@ simply specifying a single colon with this option: "-u :".
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-U/--proxy-user <user:password>"
|
||||
Specify user and password to use for proxy authentication.
|
||||
Specify the user name and password to use for proxy authentication.
|
||||
|
||||
If you use an SSPI-enabled curl binary and do NTLM authentication, you can
|
||||
force curl to pick up the user name and password from your environment by
|
||||
@@ -1185,9 +1195,9 @@ URL(s) in a config file.
|
||||
This option may be used any number of times. To control where this URL is
|
||||
written, use the \fI-o/--output\fP or the \fI-O/--remote-name\fP options.
|
||||
.IP "-v/--verbose"
|
||||
Makes the fetching more verbose/talkative. Mostly usable for debugging. Lines
|
||||
Makes the fetching more verbose/talkative. Mostly useful for debugging. A line
|
||||
starting with '>' means "header data" sent by curl, '<' means "header data"
|
||||
received by curl that is hidden in normal cases and lines starting with '*'
|
||||
received by curl that is hidden in normal cases, and a line starting with '*'
|
||||
means additional info provided by curl.
|
||||
|
||||
Note that if you only want HTTP headers in the output, \fI-i/--include\fP
|
||||
@@ -1212,7 +1222,7 @@ reports to offer. Available features include:
|
||||
.IP "IPv6"
|
||||
You can use IPv6 with this.
|
||||
.IP "krb4"
|
||||
Krb4 for ftp is supported.
|
||||
Krb4 for FTP is supported.
|
||||
.IP "SSL"
|
||||
HTTPS and FTPS are supported.
|
||||
.IP "libz"
|
||||
@@ -1220,7 +1230,7 @@ Automatic decompression of compressed files over HTTP is supported.
|
||||
.IP "NTLM"
|
||||
NTLM authentication is supported.
|
||||
.IP "GSS-Negotiate"
|
||||
Negotiate authentication and krb5 for ftp is supported.
|
||||
Negotiate authentication and krb5 for FTP is supported.
|
||||
.IP "Debug"
|
||||
This curl uses a libcurl built with Debug. This enables more error-tracking
|
||||
and memory debugging etc. For curl-developers only!
|
||||
@@ -1245,7 +1255,7 @@ format from stdin you write "@-".
|
||||
|
||||
The variables present in the output format will be substituted by the value or
|
||||
text that curl thinks fit, as described below. All variables are specified
|
||||
like %{variable_name} and to output a normal % you just write them like
|
||||
as %{variable_name} and to output a normal % you just it them as
|
||||
%%. You can output a newline by using \\n, a carriage return with \\r and a tab
|
||||
space with \\t.
|
||||
|
||||
@@ -1253,11 +1263,11 @@ space with \\t.
|
||||
The %-letter is a special letter in the win32-environment, where all
|
||||
occurrences of % must be doubled when using this option.
|
||||
|
||||
Available variables are at this point:
|
||||
The variables available at this point are:
|
||||
.RS
|
||||
.TP 15
|
||||
.B url_effective
|
||||
The URL that was fetched last. This is mostly meaningful if you've told curl
|
||||
The URL that was fetched last. This is most meaningful if you've told curl
|
||||
to follow location: headers.
|
||||
.TP
|
||||
.B http_code
|
||||
@@ -1286,20 +1296,20 @@ The time, in seconds, it took from the start until the SSL/SSH/etc
|
||||
connect/handshake to the remote host was completed. (Added in 7.19.0)
|
||||
.TP
|
||||
.B time_pretransfer
|
||||
The time, in seconds, it took from the start until the file transfer is just
|
||||
The time, in seconds, it took from the start until the file transfer was just
|
||||
about to begin. This includes all pre-transfer commands and negotiations that
|
||||
are specific to the particular protocol(s) involved.
|
||||
.TP
|
||||
.B time_redirect
|
||||
The time, in seconds, it took for all redirection steps include name lookup,
|
||||
connect, pretransfer and transfer before final transaction was
|
||||
connect, pretransfer and transfer before the final transaction was
|
||||
started. time_redirect shows the complete execution time for multiple
|
||||
redirections. (Added in 7.12.3)
|
||||
.TP
|
||||
.B time_starttransfer
|
||||
The time, in seconds, it took from the start until the first byte is just about
|
||||
The time, in seconds, it took from the start until the first byte was just about
|
||||
to be transferred. This includes time_pretransfer and also the time the
|
||||
server needs to calculate the result.
|
||||
server needed to calculate the result.
|
||||
.TP
|
||||
.B size_download
|
||||
The total amount of bytes that were downloaded.
|
||||
@@ -1343,10 +1353,10 @@ means the verification was successful. (Added in 7.19.0)
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-x/--proxy <proxyhost[:port]>"
|
||||
Use specified HTTP proxy. If the port number is not specified, it is assumed
|
||||
Use the specified HTTP proxy. If the port number is not specified, it is assumed
|
||||
at port 1080.
|
||||
|
||||
This option overrides existing environment variables that sets proxy to
|
||||
This option overrides existing environment variables that set the proxy to
|
||||
use. If there's an environment variable setting a proxy, you can set proxy to
|
||||
\&"" to override it.
|
||||
|
||||
@@ -1356,8 +1366,8 @@ operations might not be available. This is not the case if you can tunnel
|
||||
through the proxy, as done with the \fI-p/--proxytunnel\fP option.
|
||||
|
||||
Starting with 7.14.1, the proxy host can be specified the exact same way as
|
||||
the proxy environment variables, include protocol prefix (http://) and
|
||||
embedded user + password.
|
||||
the proxy environment variables, including the protocol prefix (http://) and
|
||||
the embedded user + password.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-X/--request <command>"
|
||||
@@ -1368,21 +1378,21 @@ details and explanations.
|
||||
|
||||
(FTP)
|
||||
Specifies a custom FTP command to use instead of LIST when doing file lists
|
||||
with ftp.
|
||||
with FTP.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-y/--speed-time <time>"
|
||||
If a download is slower than speed-limit bytes per second during a speed-time
|
||||
period, the download gets aborted. If speed-time is used, the default
|
||||
speed-limit will be 1 unless set with -y.
|
||||
speed-limit will be 1 unless set with -Y.
|
||||
|
||||
This option controls transfers and thus will not affect slow connects etc. If
|
||||
this is a concern for you, try the \fI--connect-timeout\fP option.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
.IP "-Y/--speed-limit <speed>"
|
||||
If a download is slower than this given speed, in bytes per second, for
|
||||
speed-time seconds it gets aborted. speed-time is set with -Y and is 30 if
|
||||
If a download is slower than this given speed (in bytes per second) for
|
||||
speed-time seconds it gets aborted. speed-time is set with -y and is 30 if
|
||||
not set.
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
@@ -1410,7 +1420,7 @@ If this option is used several times, the last one will be used.
|
||||
internally preferred: HTTP 1.1.
|
||||
.IP "-1/--tlsv1"
|
||||
(SSL)
|
||||
Forces curl to use TSL version 1 when negotiating with a remote TLS server.
|
||||
Forces curl to use TLS version 1 when negotiating with a remote TLS server.
|
||||
.IP "-2/--sslv2"
|
||||
(SSL)
|
||||
Forces curl to use SSL version 2 when negotiating with a remote SSL server.
|
||||
@@ -1419,11 +1429,11 @@ Forces curl to use SSL version 2 when negotiating with a remote SSL server.
|
||||
Forces curl to use SSL version 3 when negotiating with a remote SSL server.
|
||||
.IP "-4/--ipv4"
|
||||
If libcurl is capable of resolving an address to multiple IP versions (which
|
||||
it is if it is ipv6-capable), this option tells libcurl to resolve names to
|
||||
it is if it is IPv6-capable), this option tells libcurl to resolve names to
|
||||
IPv4 addresses only.
|
||||
.IP "-6/--ipv6"
|
||||
If libcurl is capable of resolving an address to multiple IP versions (which
|
||||
it is if it is ipv6-capable), this option tells libcurl to resolve names to
|
||||
it is if it is IPv6-capable), this option tells libcurl to resolve names to
|
||||
IPv6 addresses only.
|
||||
.IP "-#/--progress-bar"
|
||||
Make curl display progress information as a progress bar instead of the
|
||||
@@ -1435,13 +1445,13 @@ Default config file, see \fI-K/--config\fP for details.
|
||||
|
||||
.SH ENVIRONMENT
|
||||
.IP "http_proxy [protocol://]<host>[:port]"
|
||||
Sets proxy server to use for HTTP.
|
||||
Sets the proxy server to use for HTTP.
|
||||
.IP "HTTPS_PROXY [protocol://]<host>[:port]"
|
||||
Sets proxy server to use for HTTPS.
|
||||
Sets the proxy server to use for HTTPS.
|
||||
.IP "FTP_PROXY [protocol://]<host>[:port]"
|
||||
Sets proxy server to use for FTP.
|
||||
Sets the proxy server to use for FTP.
|
||||
.IP "ALL_PROXY [protocol://]<host>[:port]"
|
||||
Sets proxy server to use if no protocol-specific proxy is set.
|
||||
Sets the proxy server to use if no protocol-specific proxy is set.
|
||||
.IP "NO_PROXY <comma-separated list of hosts>"
|
||||
list of host names that shouldn't go through any proxy. If set to a asterisk
|
||||
\&'*' only, it matches all hosts.
|
||||
@@ -1565,7 +1575,7 @@ Sending the data requires a rewind that failed
|
||||
.IP 66
|
||||
Failed to initialise SSL Engine
|
||||
.IP 67
|
||||
User, password or similar was not accepted and curl failed to login
|
||||
The user name, password, or similar was not accepted and curl failed to log in
|
||||
.IP 68
|
||||
File not found on TFTP server
|
||||
.IP 69
|
||||
@@ -1597,7 +1607,7 @@ Could not load CRL file, missing or wrong format (added in 7.19.0)
|
||||
.IP 83
|
||||
Issuer check failed (added in 7.19.0)
|
||||
.IP XX
|
||||
There will appear more error codes here in future releases. The existing ones
|
||||
More error codes will appear here in future releases. The existing ones
|
||||
are meant to never change.
|
||||
.SH AUTHORS / CONTRIBUTORS
|
||||
Daniel Stenberg is the main author, but the whole list of contributors is
|
||||
|
@@ -113,7 +113,7 @@ int main(void)
|
||||
|
||||
/* we can optionally limit the total amount of connections this multi handle
|
||||
uses */
|
||||
curl_multi_setopt(cm, CURLMOPT_MAXCONNECTS, MAX);
|
||||
curl_multi_setopt(cm, CURLMOPT_MAXCONNECTS, (long)MAX);
|
||||
|
||||
for (C = 0; C < MAX; ++C) {
|
||||
init(cm, C);
|
||||
|
@@ -5,7 +5,7 @@ check_PROGRAMS = 10-at-a-time anyauthput cookie_interface \
|
||||
https multi-app multi-debugcallback multi-double \
|
||||
multi-post multi-single persistant post-callback \
|
||||
postit2 sepheaders simple simplepost simplessl \
|
||||
sendrecv httpcustomheader
|
||||
sendrecv httpcustomheader certinfo
|
||||
|
||||
# These examples require external dependencies that may not be commonly
|
||||
# available on POSIX systems, so don't bother attempting to compile them here.
|
||||
@@ -14,4 +14,3 @@ COMPLICATED_EXAMPLES = \
|
||||
ghiper.c hiperfifo.c htmltidy.c multithread.c \
|
||||
opensslthreadlock.c sampleconv.c synctime.c threaded-ssl.c
|
||||
|
||||
|
||||
|
62
docs/examples/certinfo.c
Normal file
62
docs/examples/certinfo.c
Normal file
@@ -0,0 +1,62 @@
|
||||
/*****************************************************************************
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include <curl/types.h>
|
||||
#include <curl/easy.h>
|
||||
|
||||
static size_t wrfu(void *ptr, size_t size, size_t nmemb, void *stream)
|
||||
{
|
||||
return size * nmemb;
|
||||
}
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
|
||||
curl_global_init(CURL_GLOBAL_DEFAULT);
|
||||
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://www.networking4all.com/");
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, wrfu);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L);
|
||||
curl_easy_setopt(curl, CURLOPT_CERTINFO, 1L);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(!res) {
|
||||
struct curl_certinfo *ci = NULL;
|
||||
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CERTINFO, &ci);
|
||||
|
||||
if(!res && ci) {
|
||||
int i;
|
||||
printf("%d certs!\n", ci->num_of_certs);
|
||||
|
||||
for(i=0; i<ci->num_of_certs; i++) {
|
||||
struct curl_slist *slist;
|
||||
|
||||
for(slist = ci->certinfo[i]; slist; slist = slist->next)
|
||||
printf("%s\n", slist->data);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
|
||||
curl_global_cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
@@ -281,7 +281,7 @@ int main(int argc, char **argv) {
|
||||
struct curl_slist * headers=NULL;
|
||||
int badarg=0;
|
||||
|
||||
binaryptr=(char*)malloc(tabLength);
|
||||
binaryptr = malloc(tabLength);
|
||||
|
||||
p.verbose = 0;
|
||||
p.errorbio = BIO_new_fp (stderr, BIO_NOCLOSE);
|
||||
@@ -404,7 +404,7 @@ int main(int argc, char **argv) {
|
||||
/* determine URL to go */
|
||||
|
||||
if (hostporturl) {
|
||||
serverurl=(char*) malloc(9+strlen(hostporturl));
|
||||
serverurl = malloc(9+strlen(hostporturl));
|
||||
sprintf(serverurl,"https://%s",hostporturl);
|
||||
}
|
||||
else if (p.accesstype != 0) { /* see whether we can find an AIA or SIA for a given access type */
|
||||
@@ -442,7 +442,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
/* pass our list of custom made headers */
|
||||
|
||||
contenttype=(char*) malloc(15+strlen(mimetype));
|
||||
contenttype = malloc(15+strlen(mimetype));
|
||||
sprintf(contenttype,"Content-type: %s",mimetype);
|
||||
headers = curl_slist_append(headers,contenttype);
|
||||
curl_easy_setopt(p.curl, CURLOPT_HTTPHEADER, headers);
|
||||
@@ -469,7 +469,7 @@ int main(int argc, char **argv) {
|
||||
i+=lu;
|
||||
if (i== tabLength) {
|
||||
tabLength+=100;
|
||||
binaryptr=(char*)realloc(binaryptr,tabLength); /* should be more careful */
|
||||
binaryptr=realloc(binaryptr,tabLength); /* should be more careful */
|
||||
}
|
||||
}
|
||||
tabLength = i;
|
||||
|
@@ -27,7 +27,11 @@ int main(void)
|
||||
return 1; /* can't continue */
|
||||
}
|
||||
|
||||
stat("debugit", &file_info); /* to get the file size */
|
||||
/* to get the file size */
|
||||
if(fstat(fileno(fd), &file_info) != 0) {
|
||||
|
||||
return 1; /* can't continue */
|
||||
}
|
||||
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
|
@@ -221,7 +221,7 @@ url_fopen(const char *url,const char *operation)
|
||||
URL_FILE *file;
|
||||
(void)operation;
|
||||
|
||||
file = (URL_FILE *)malloc(sizeof(URL_FILE));
|
||||
file = malloc(sizeof(URL_FILE));
|
||||
if(!file)
|
||||
return NULL;
|
||||
|
||||
|
@@ -26,6 +26,8 @@ struct MemoryStruct {
|
||||
size_t size;
|
||||
};
|
||||
|
||||
static void *myrealloc(void *ptr, size_t size);
|
||||
|
||||
static void *myrealloc(void *ptr, size_t size)
|
||||
{
|
||||
/* There might be a realloc() out there that doesn't like reallocing
|
||||
@@ -42,7 +44,7 @@ WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
|
||||
size_t realsize = size * nmemb;
|
||||
struct MemoryStruct *mem = (struct MemoryStruct *)data;
|
||||
|
||||
mem->memory = (char *)myrealloc(mem->memory, mem->size + realsize + 1);
|
||||
mem->memory = myrealloc(mem->memory, mem->size + realsize + 1);
|
||||
if (mem->memory) {
|
||||
memcpy(&(mem->memory[mem->size]), ptr, realsize);
|
||||
mem->size += realsize;
|
||||
|
@@ -56,7 +56,7 @@ int thread_setup(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
mutex_buf = (MUTEX_TYPE *)malloc(CRYPTO_num_locks( ) * sizeof(MUTEX_TYPE));
|
||||
mutex_buf = malloc(CRYPTO_num_locks( ) * sizeof(MUTEX_TYPE));
|
||||
if (!mutex_buf)
|
||||
return 0;
|
||||
for (i = 0; i < CRYPTO_num_locks( ); i++)
|
||||
|
@@ -21,7 +21,7 @@
|
||||
.\" * $Id$
|
||||
.\" **************************************************************************
|
||||
.\"
|
||||
.TH curl_easy_getinfo 3 "21 Mar 2006" "libcurl 7.15.4" "libcurl Manual"
|
||||
.TH curl_easy_getinfo 3 "16 Oct 2008" "libcurl 7.19.1" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_easy_getinfo - extract information from a curl handle
|
||||
.SH SYNOPSIS
|
||||
@@ -190,6 +190,16 @@ Pass a pointer to a 'char *' to receive a pointer to a string holding the path
|
||||
of the entry path. That is the initial path libcurl ended up in when logging
|
||||
on to the remote FTP server. This stores a NULL as pointer if something is
|
||||
wrong. (Added in 7.15.4)
|
||||
.IP CURLINFO_CERTINFO
|
||||
Pass a pointer to a 'struct curl_certinfo *' and you'll get it set to point to
|
||||
struct that holds a number of linked lists with info about the certificate
|
||||
chain, assuming you had CURLOPT_CERTINFO enabled when the previous request was
|
||||
done. The struct reports how many certs it found and then you can extract info
|
||||
for each of those certs by following the linked lists. The info chain is
|
||||
provided in a series of data in the format "name:content" where the content is
|
||||
for the specific named data. See also the certinfo.c example. NOTE: this
|
||||
option is only available in libcurl built with OpenSSL support. (Added in
|
||||
7.19.1)
|
||||
.SH TIMES
|
||||
.NF
|
||||
An overview of the six time values available from curl_easy_getinfo()
|
||||
|
@@ -12,7 +12,7 @@ curl_easy_pause - pause and unpause a connection
|
||||
Using this function, you can explicitly mark a running connection to get
|
||||
paused, and you can unpause a connection that was previously paused.
|
||||
|
||||
A connection can made to pause by using this function or by letting the read
|
||||
A connection can be paused by using this function or by letting the read
|
||||
or the write callbacks return the proper magic return code
|
||||
(\fICURL_READFUNC_PAUSE\fP and \fICURL_WRITEFUNC_PAUSE\fP). A write callback
|
||||
that returns pause signals to the library that it couldn't take care of any
|
||||
@@ -56,7 +56,7 @@ it in an allocated buffer until the reading is again unpaused using this
|
||||
function.
|
||||
|
||||
If the downloaded data is compressed and is asked to get uncompressed
|
||||
automatially on download, libcurl will continue to uncompress the entire
|
||||
automatically on download, libcurl will continue to uncompress the entire
|
||||
downloaded chunk and it will cache the data uncompressed. This has the side-
|
||||
effect that if you download something that is compressed a lot, it can result
|
||||
in a very large data amount needing to be allocated to save the data during
|
||||
|
@@ -21,7 +21,7 @@
|
||||
.\" * $Id$
|
||||
.\" **************************************************************************
|
||||
.\"
|
||||
.TH curl_easy_setopt 3 "30 Jul 2008" "libcurl 7.19.0" "libcurl Manual"
|
||||
.TH curl_easy_setopt 3 "28 Oct 2008" "libcurl 7.19.1" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_easy_setopt \- set options for a curl easy handle
|
||||
.SH SYNOPSIS
|
||||
@@ -81,8 +81,10 @@ process. This option is mainly here to allow multi-threaded unix applications
|
||||
to still set/use all timeout options etc, without risking getting signals.
|
||||
(Added in 7.10)
|
||||
|
||||
If this option is set and libcurl has been built with the standard name
|
||||
resolver, timeouts will not occur while the name resolve takes place.
|
||||
Consider building libcurl with ares support to enable asynchronous DNS
|
||||
lookups. It enables nice timeouts for name resolves without signals.
|
||||
lookups, which enables nice timeouts for name resolves without signals.
|
||||
.PP
|
||||
.SH CALLBACK OPTIONS
|
||||
.IP CURLOPT_WRITEFUNCTION
|
||||
@@ -477,12 +479,6 @@ Set the parameter to 1 to make the library tunnel all operations through a
|
||||
given HTTP proxy. There is a big difference between using a proxy and to
|
||||
tunnel through it. If you don't know what this means, you probably don't want
|
||||
this tunneling option.
|
||||
.IP CURLOPT_SOCKS5_RESOLVE_LOCAL
|
||||
Set the parameter to 1 to make the library to resolve the host name locally
|
||||
instead of passing it to the proxy to resolve, when using a SOCKS5 proxy.
|
||||
|
||||
Note that libcurl before 7.18.0 always resolved the host name locally even
|
||||
when SOCKS5 was used. (Added in 7.18.0)
|
||||
.IP CURLOPT_INTERFACE
|
||||
Pass a char * as parameter. This set the interface name to use as outgoing
|
||||
network interface. The name can be an interface name, an IP address or a host
|
||||
@@ -607,14 +603,54 @@ to prevent accidental information leakage.
|
||||
Pass a char * as parameter, which should be [user name]:[password] to use for
|
||||
the connection to the HTTP proxy. Use \fICURLOPT_PROXYAUTH\fP to decide
|
||||
authentication method.
|
||||
.IP CURLOPT_USERNAME
|
||||
Pass a char * as parameter, which should be pointing to the zero terminated
|
||||
user name to use for the transfer.
|
||||
|
||||
The CURLOPT_USERNAME option should be used in same way as the
|
||||
\fICURLOPT_USERPWD\fP is used. In comparison to \fICURLOPT_USERPWD\fP the
|
||||
CURLOPT_USERNAME allows the username to contain colon, like in following
|
||||
example: "sip:user@example.com". Note the CURLOPT_USERNAME option is an
|
||||
alternative way to set the user name. There is no meaning to use it together
|
||||
with the \fICURLOPT_USERPWD\fP option.
|
||||
|
||||
In order to specify the password to be used in conjunction with the user name
|
||||
use the \fICURLOPT_PASSWORD\fP option. (Added in 7.19.1)
|
||||
.IP CURLOPT_PASSWORD
|
||||
Pass a char * as parameter, which should be pointing to the zero terminated
|
||||
password to use for the transfer.
|
||||
|
||||
The CURLOPT_PASSWORD option should be used in conjunction with
|
||||
as the \fICURLOPT_USERNAME\fP option. (Added in 7.19.1)
|
||||
.IP CURLOPT_PROXYUSERNAME
|
||||
Pass a char * as parameter, which should be pointing to the zero terminated
|
||||
user name to use for the transfer while connecting to Proxy.
|
||||
|
||||
The CURLOPT_PROXYUSERNAME option should be used in same way as the
|
||||
\fICURLOPT_PROXYUSERPWD\fP is used. In comparison to \fICURLOPT_PROXYUSERPWD\fP
|
||||
the CURLOPT_PROXYUSERNAME allows the username to contain colon,
|
||||
like in following example: "sip:user@example.com".
|
||||
Note the CURLOPT_PROXYUSERNAME option is an alternative way to set the user name
|
||||
while connecting to Proxy. There is no meaning to use it together
|
||||
with the \fICURLOPT_PROXYUSERPWD\fP option.
|
||||
|
||||
In order to specify the password to be used in conjunction with the user name
|
||||
use the \fICURLOPT_PROXYPASSWORD\fP option. (Added in 7.19.1)
|
||||
.IP CURLOPT_PROXYPASSWORD
|
||||
Pass a char * as parameter, which should be pointing to the zero terminated
|
||||
password to use for the transfer while connecting to Proxy.
|
||||
|
||||
The CURLOPT_PROXYPASSWORD option should be used in conjunction with
|
||||
as the \fICURLOPT_PROXYUSERNAME\fP option. (Added in 7.19.1)
|
||||
.IP CURLOPT_HTTPAUTH
|
||||
Pass a long as parameter, which is set to a bitmask, to tell libcurl what
|
||||
authentication method(s) you want it to use. The available bits are listed
|
||||
below. If more than one bit is set, libcurl will first query the site to see
|
||||
what authentication methods it supports and then pick the best one you allow
|
||||
it to use. For some methods, this will induce an extra network round-trip. Set
|
||||
the actual name and password with the \fICURLOPT_USERPWD\fP option. (Added in
|
||||
7.10.6)
|
||||
the actual name and password with the \fICURLOPT_USERPWD\fP option or
|
||||
with the \fICURLOPT_USERNAME\fP and the \fICURLOPT_USERPASSWORD\fP options.
|
||||
(Added in 7.10.6)
|
||||
.RS
|
||||
.IP CURLAUTH_BASIC
|
||||
HTTP Basic authentication. This is the default choice, and the only method
|
||||
@@ -695,13 +731,14 @@ redirections have been followed, the next redirect will cause an error
|
||||
\fICURLOPT_FOLLOWLOCATION\fP is used at the same time. Added in 7.15.1:
|
||||
Setting the limit to 0 will make libcurl refuse any redirect. Set it to -1 for
|
||||
an infinite number of redirects (which is the default)
|
||||
.IP CURLOPT_POST301
|
||||
.IP CURLOPT_POSTREDIR
|
||||
A parameter set to 1 tells the library to respect RFC 2616/10.3.2 and not
|
||||
convert POST requests into GET requests when following a 301 redirection. The
|
||||
non-RFC behaviour is ubiquitous in web browsers, so the library does the
|
||||
conversion by default to maintain consistency. However, a server may requires
|
||||
a POST to remain a POST after such a redirection. This option is meaningful
|
||||
only when setting \fICURLOPT_FOLLOWLOCATION\fP. (Added in 7.17.1)
|
||||
(This option was known as CURLOPT_POST301 up to 7.19.0)
|
||||
.IP CURLOPT_PUT
|
||||
A parameter set to 1 tells the library to use HTTP PUT to transfer data. The
|
||||
data should be set with \fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE\fP.
|
||||
@@ -1071,7 +1108,7 @@ Require SSL for all communication or fail with \fICURLE_USE_SSL_FAILED\fP.
|
||||
.IP CURLOPT_FTPSSLAUTH
|
||||
Pass a long using one of the values from below, to alter how libcurl issues
|
||||
\&"AUTH TLS" or "AUTH SSL" when FTP over SSL is activated (see
|
||||
\fICURLOPT_FTP_SSL\fP). (Added in 7.12.2)
|
||||
\fICURLOPT_USE_SSL\fP). (Added in 7.12.2)
|
||||
.RS
|
||||
.IP CURLFTPAUTH_DEFAULT
|
||||
Allow libcurl to decide
|
||||
@@ -1265,8 +1302,10 @@ In unix-like systems, this might cause signals to be used unless
|
||||
\fICURLOPT_NOSIGNAL\fP is set.
|
||||
.IP CURLOPT_TIMEOUT_MS
|
||||
Like \fICURLOPT_TIMEOUT\fP but takes number of milliseconds instead. If
|
||||
libcurl is built to use the standard system name resolver, that part will
|
||||
still use full-second resolution for timeouts. (Added in 7.16.2)
|
||||
libcurl is built to use the standard system name resolver, that portion
|
||||
of the transfer will still use full-second resolution for timeouts with
|
||||
a minimum timeout allowed of one second.
|
||||
(Added in 7.16.2)
|
||||
.IP CURLOPT_LOW_SPEED_LIMIT
|
||||
Pass a long as parameter. It contains the transfer speed in bytes per second
|
||||
that the transfer should be below during \fICURLOPT_LOW_SPEED_TIME\fP seconds
|
||||
@@ -1329,9 +1368,11 @@ timeouts). See also the \fICURLOPT_TIMEOUT\fP option.
|
||||
In unix-like systems, this might cause signals to be used unless
|
||||
\fICURLOPT_NOSIGNAL\fP is set.
|
||||
.IP CURLOPT_CONNECTTIMEOUT_MS
|
||||
Like \fICURLOPT_CONNECTTIMEOUT\fP but takes number of milliseconds instead. If
|
||||
libcurl is built to use the standard system name resolver, that part will
|
||||
still use full-second resolution for timeouts. (Added in 7.16.2)
|
||||
Like \fICURLOPT_CONNECTTIMEOUT\fP but takes the number of milliseconds
|
||||
instead. If libcurl is built to use the standard system name resolver,
|
||||
that portion of the connect will still use full-second resolution for
|
||||
timeouts with a minimum timeout allowed of one second.
|
||||
(Added in 7.16.2)
|
||||
.IP CURLOPT_IPRESOLVE
|
||||
Allows an application to select what kind of IP addresses to use when
|
||||
resolving host names. This is only interesting when using host names that
|
||||
@@ -1496,6 +1537,13 @@ A specific error code (CURLE_SSL_CRL_BADFILE) is defined with the option. It
|
||||
is returned when the SSL exchange fails because the CRL file cannot be loaded.
|
||||
Note that a failure in certificate verification due to a revocation information
|
||||
found in the CRL does not trigger this specific error. (Added in 7.19.0)
|
||||
.IP CURLOPT_CERTINFO
|
||||
Pass a long set to 1 to enable libcurl's certificate chain info gatherer. With
|
||||
this enabled, libcurl (if built with OpenSSL) will extract lots of information
|
||||
and data about the certificate's in the certificate chain used in the SSL
|
||||
connection. This data is then possible to extract after a transfer using
|
||||
\fIcurl_easy_getinfo(3)\fP and its option \fICURLINFO_CERTINFO\fP. (Added in
|
||||
7.19.1)
|
||||
.IP CURLOPT_RANDOM_FILE
|
||||
Pass a char * to a zero terminated file name. The file will be used to read
|
||||
from to seed the random engine for SSL. The more random the specified file is,
|
||||
|
@@ -49,7 +49,7 @@ one of the \&"performing" functions of the multi interface
|
||||
\fIcurl_multi_perform(3)\fP) - to allow libcurl to keep timeouts and retries
|
||||
etc to work. A timeout value of -1 means that there is no timeout at all, and
|
||||
0 means that the timeout is already reached. Libcurl attempts to limit calling
|
||||
this only when the fixed future timeout time actually change. See also
|
||||
this only when the fixed future timeout time actually changes. See also
|
||||
\fICURLMOPT_TIMERDATA\fP. This callback can be used instead of, or in addition
|
||||
to, \fIcurl_multi_timeout(3)\fP. (Added in 7.16.0)
|
||||
.IP CURLMOPT_TIMERDATA
|
||||
|
@@ -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
|
||||
@@ -339,7 +339,7 @@ between the application and the callback.
|
||||
|
||||
curl_easy_setopt(easyhandle, CURLOPT_READFUNCTION, read_function);
|
||||
|
||||
curl_easy_setopt(easyhandle, CURLOPT_INFILE, &filedata);
|
||||
curl_easy_setopt(easyhandle, CURLOPT_READDATA, &filedata);
|
||||
|
||||
Tell libcurl that we want to upload:
|
||||
|
||||
@@ -1117,12 +1117,18 @@ interface that transfers one file at a time and doesn't return until its
|
||||
done.
|
||||
|
||||
The multi interface on the other hand, allows your program to transfer
|
||||
multiple files in both directions at the same time, without forcing you to
|
||||
use multiple threads.
|
||||
multiple files in both directions at the same time, without forcing you
|
||||
to use multiple threads. The name might make it seem that the multi
|
||||
interface is for multi-threaded programs, but the truth is almost the
|
||||
reverse. The multi interface can allow a single-threaded application
|
||||
to perform the same kinds of multiple, simultaneous transfers that
|
||||
multi-threaded programs can perform. It allows many of the benefits
|
||||
of multi-threaded transfers without the complexity of managing and
|
||||
synchronizing many threads.
|
||||
|
||||
To use this interface, you are better off if you first understand the basics
|
||||
of how to use the easy interface. The multi interface is simply a way to make
|
||||
multiple transfers at the same time, by adding up multiple easy handles in to
|
||||
multiple transfers at the same time by adding up multiple easy handles in to
|
||||
a "multi stack".
|
||||
|
||||
You create the easy handles you want and you set all the options just like you
|
||||
|
@@ -1103,8 +1103,9 @@ typedef enum {
|
||||
CINIT(NEW_FILE_PERMS, LONG, 159),
|
||||
CINIT(NEW_DIRECTORY_PERMS, LONG, 160),
|
||||
|
||||
/* Obey RFC 2616/10.3.2 and keep POSTs as POSTs after a 301 */
|
||||
CINIT(POST301, LONG, 161),
|
||||
/* Set the behaviour of POST when redirecting. Values must be set to one
|
||||
of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */
|
||||
CINIT(POSTREDIR, LONG, 161),
|
||||
|
||||
/* used by scp/sftp to verify the host's public key */
|
||||
CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162),
|
||||
@@ -1135,6 +1136,19 @@ typedef enum {
|
||||
/* (IPv6) Address scope */
|
||||
CINIT(ADDRESS_SCOPE, LONG, 171),
|
||||
|
||||
/* Collect certificate chain info and allow it to get retrievable with
|
||||
CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only
|
||||
working with OpenSSL-powered builds. */
|
||||
CINIT(CERTINFO, LONG, 172),
|
||||
|
||||
/* "name" and "pwd" to use when fetching. */
|
||||
CINIT(USERNAME, OBJECTPOINT, 173),
|
||||
CINIT(PASSWORD, OBJECTPOINT, 174),
|
||||
|
||||
/* "name" and "pwd" to use with Proxy when fetching. */
|
||||
CINIT(PROXYUSERNAME, OBJECTPOINT, 175),
|
||||
CINIT(PROXYPASSWORD, OBJECTPOINT, 176),
|
||||
|
||||
CURLOPT_LASTENTRY /* the last unused */
|
||||
} CURLoption;
|
||||
|
||||
@@ -1142,6 +1156,11 @@ typedef enum {
|
||||
the obsolete stuff removed! */
|
||||
|
||||
/* Backwards compatibility with older names */
|
||||
/* These are scheduled to disappear by 2011 */
|
||||
|
||||
/* This was added in version 7.19.1 */
|
||||
#define CURLOPT_POST301 CURLOPT_POSTREDIR
|
||||
|
||||
/* These are scheduled to disappear by 2009 */
|
||||
|
||||
/* The following were added in 7.17.0 */
|
||||
@@ -1206,6 +1225,14 @@ enum {
|
||||
CURL_SSLVERSION_LAST /* never use, keep last */
|
||||
};
|
||||
|
||||
/* symbols to use with CURLOPT_POSTREDIR.
|
||||
CURL_REDIR_POST_301 and CURL_REDIR_POST_302 can be bitwise ORed so that
|
||||
CURL_REDIR_POST_301 | CURL_REDIR_POST_302 == CURL_REDIR_POST_ALL */
|
||||
|
||||
#define CURL_REDIR_GET_ALL 0
|
||||
#define CURL_REDIR_POST_301 1
|
||||
#define CURL_REDIR_POST_302 2
|
||||
#define CURL_REDIR_POST_ALL (CURL_REDIR_POST_301|CURL_REDIR_POST_302)
|
||||
|
||||
typedef enum {
|
||||
CURL_TIMECOND_NONE,
|
||||
@@ -1491,6 +1518,15 @@ CURL_EXTERN void curl_slist_free_all(struct curl_slist *);
|
||||
*/
|
||||
CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);
|
||||
|
||||
/* info about the certificate chain, only for OpenSSL builds. Asked
|
||||
for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */
|
||||
struct curl_certinfo {
|
||||
int num_of_certs; /* number of certificates with information */
|
||||
struct curl_slist **certinfo; /* for each index in this array, there's a
|
||||
linked list with textual information in the
|
||||
format "name: value" */
|
||||
};
|
||||
|
||||
#define CURLINFO_STRING 0x100000
|
||||
#define CURLINFO_LONG 0x200000
|
||||
#define CURLINFO_DOUBLE 0x300000
|
||||
@@ -1533,9 +1569,10 @@ typedef enum {
|
||||
CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31,
|
||||
CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32,
|
||||
CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33,
|
||||
CURLINFO_CERTINFO = CURLINFO_SLIST + 34,
|
||||
/* Fill in new entries below here! */
|
||||
|
||||
CURLINFO_LASTONE = 33
|
||||
CURLINFO_LASTONE = 34
|
||||
} CURLINFO;
|
||||
|
||||
/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
|
||||
@@ -1746,7 +1783,8 @@ CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
|
||||
#include "multi.h"
|
||||
|
||||
/* the typechecker doesn't work in C++ (yet) */
|
||||
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \
|
||||
#if defined(__GNUC__) && defined(__GNUC_MINOR__) && \
|
||||
((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \
|
||||
!defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK)
|
||||
#include "typecheck-gcc.h"
|
||||
#else
|
||||
|
@@ -31,13 +31,13 @@
|
||||
|
||||
/* This is the version number of the libcurl package from which this header
|
||||
file origins: */
|
||||
#define LIBCURL_VERSION "7.19.0-CVS"
|
||||
#define LIBCURL_VERSION "7.19.1-CVS"
|
||||
|
||||
/* The numeric version number is also available "in parts" by using these
|
||||
defines: */
|
||||
#define LIBCURL_VERSION_MAJOR 7
|
||||
#define LIBCURL_VERSION_MINOR 19
|
||||
#define LIBCURL_VERSION_PATCH 0
|
||||
#define LIBCURL_VERSION_PATCH 1
|
||||
|
||||
/* This is the numeric version of the libcurl version number, meant for easier
|
||||
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
|
||||
@@ -54,7 +54,7 @@
|
||||
and it is always a greater number in a more recent release. It makes
|
||||
comparisons with greater than and less than work.
|
||||
*/
|
||||
#define LIBCURL_VERSION_NUM 0x071300
|
||||
#define LIBCURL_VERSION_NUM 0x071301
|
||||
|
||||
/*
|
||||
* This is the date and time when the full source package was created. The
|
||||
|
@@ -196,7 +196,11 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
|
||||
(option) == CURLOPT_INTERFACE || \
|
||||
(option) == CURLOPT_NETRC_FILE || \
|
||||
(option) == CURLOPT_USERPWD || \
|
||||
(option) == CURLOPT_USERNAME || \
|
||||
(option) == CURLOPT_PASSWORD || \
|
||||
(option) == CURLOPT_PROXYUSERPWD || \
|
||||
(option) == CURLOPT_PROXYUSERNAME || \
|
||||
(option) == CURLOPT_PROXYPASSWORD || \
|
||||
(option) == CURLOPT_ENCODING || \
|
||||
(option) == CURLOPT_REFERER || \
|
||||
(option) == CURLOPT_USERAGENT || \
|
||||
|
@@ -34,34 +34,35 @@ C_ARG = $(OBJ_BASE)\wcc386.arg
|
||||
LINK_ARG = $(OBJ_BASE)\dyn\wlink.arg
|
||||
LIB_ARG = $(OBJ_BASE)\stat\wlib.arg
|
||||
|
||||
OBJS = $(OBJ_DIR)\base64.obj $(OBJ_DIR)\connect.obj &
|
||||
$(OBJ_DIR)\content_encoding.obj $(OBJ_DIR)\cookie.obj &
|
||||
$(OBJ_DIR)\dict.obj $(OBJ_DIR)\easy.obj &
|
||||
$(OBJ_DIR)\escape.obj $(OBJ_DIR)\file.obj &
|
||||
$(OBJ_DIR)\formdata.obj $(OBJ_DIR)\ftp.obj &
|
||||
$(OBJ_DIR)\getenv.obj $(OBJ_DIR)\getinfo.obj &
|
||||
$(OBJ_DIR)\gtls.obj $(OBJ_DIR)\hash.obj &
|
||||
$(OBJ_DIR)\hostares.obj $(OBJ_DIR)\hostasyn.obj &
|
||||
$(OBJ_DIR)\hostip.obj $(OBJ_DIR)\hostip4.obj &
|
||||
$(OBJ_DIR)\hostip6.obj $(OBJ_DIR)\hostsyn.obj &
|
||||
$(OBJ_DIR)\hostthre.obj $(OBJ_DIR)\http.obj &
|
||||
$(OBJ_DIR)\http_chunks.obj $(OBJ_DIR)\http_digest.obj &
|
||||
$(OBJ_DIR)\http_negotiate.obj $(OBJ_DIR)\http_ntlm.obj &
|
||||
$(OBJ_DIR)\if2ip.obj $(OBJ_DIR)\inet_ntop.obj &
|
||||
$(OBJ_DIR)\inet_pton.obj $(OBJ_DIR)\krb4.obj &
|
||||
$(OBJ_DIR)\ldap.obj $(OBJ_DIR)\llist.obj &
|
||||
$(OBJ_DIR)\md5.obj $(OBJ_DIR)\memdebug.obj &
|
||||
$(OBJ_DIR)\mprintf.obj $(OBJ_DIR)\multi.obj &
|
||||
$(OBJ_DIR)\netrc.obj $(OBJ_DIR)\parsedate.obj &
|
||||
$(OBJ_DIR)\progress.obj $(OBJ_DIR)\security.obj &
|
||||
$(OBJ_DIR)\select.obj $(OBJ_DIR)\sendf.obj &
|
||||
$(OBJ_DIR)\share.obj $(OBJ_DIR)\socks.obj &
|
||||
$(OBJ_DIR)\speedcheck.obj $(OBJ_DIR)\splay.obj &
|
||||
$(OBJ_DIR)\sslgen.obj $(OBJ_DIR)\ssluse.obj &
|
||||
$(OBJ_DIR)\strequal.obj $(OBJ_DIR)\strerror.obj &
|
||||
$(OBJ_DIR)\strtok.obj $(OBJ_DIR)\strtoofft.obj &
|
||||
$(OBJ_DIR)\telnet.obj $(OBJ_DIR)\tftp.obj &
|
||||
$(OBJ_DIR)\timeval.obj $(OBJ_DIR)\transfer.obj &
|
||||
OBJS = $(OBJ_DIR)\base64.obj $(OBJ_DIR)\connect.obj &
|
||||
$(OBJ_DIR)\content_encoding.obj $(OBJ_DIR)\cookie.obj &
|
||||
$(OBJ_DIR)\curl_addrinfo.obj $(OBJ_DIR)\dict.obj &
|
||||
$(OBJ_DIR)\easy.obj $(OBJ_DIR)\escape.obj &
|
||||
$(OBJ_DIR)\file.obj $(OBJ_DIR)\formdata.obj &
|
||||
$(OBJ_DIR)\ftp.obj $(OBJ_DIR)\getenv.obj &
|
||||
$(OBJ_DIR)\getinfo.obj $(OBJ_DIR)\gtls.obj &
|
||||
$(OBJ_DIR)\hash.obj $(OBJ_DIR)\hostares.obj &
|
||||
$(OBJ_DIR)\hostasyn.obj $(OBJ_DIR)\hostip.obj &
|
||||
$(OBJ_DIR)\hostip4.obj $(OBJ_DIR)\hostip6.obj &
|
||||
$(OBJ_DIR)\hostsyn.obj $(OBJ_DIR)\hostthre.obj &
|
||||
$(OBJ_DIR)\http.obj $(OBJ_DIR)\http_chunks.obj &
|
||||
$(OBJ_DIR)\http_digest.obj $(OBJ_DIR)\http_negotiate.obj &
|
||||
$(OBJ_DIR)\http_ntlm.obj $(OBJ_DIR)\if2ip.obj &
|
||||
$(OBJ_DIR)\inet_ntop.obj $(OBJ_DIR)\inet_pton.obj &
|
||||
$(OBJ_DIR)\krb4.obj $(OBJ_DIR)\ldap.obj &
|
||||
$(OBJ_DIR)\llist.obj $(OBJ_DIR)\md5.obj &
|
||||
$(OBJ_DIR)\memdebug.obj $(OBJ_DIR)\mprintf.obj &
|
||||
$(OBJ_DIR)\multi.obj $(OBJ_DIR)\netrc.obj &
|
||||
$(OBJ_DIR)\parsedate.obj $(OBJ_DIR)\progress.obj &
|
||||
$(OBJ_DIR)\security.obj $(OBJ_DIR)\rawstr.obj &
|
||||
$(OBJ_DIR)\select.obj $(OBJ_DIR)\sendf.obj &
|
||||
$(OBJ_DIR)\share.obj $(OBJ_DIR)\socks.obj &
|
||||
$(OBJ_DIR)\speedcheck.obj $(OBJ_DIR)\splay.obj &
|
||||
$(OBJ_DIR)\sslgen.obj $(OBJ_DIR)\ssluse.obj &
|
||||
$(OBJ_DIR)\strequal.obj $(OBJ_DIR)\strerror.obj &
|
||||
$(OBJ_DIR)\strtok.obj $(OBJ_DIR)\strtoofft.obj &
|
||||
$(OBJ_DIR)\telnet.obj $(OBJ_DIR)\tftp.obj &
|
||||
$(OBJ_DIR)\timeval.obj $(OBJ_DIR)\transfer.obj &
|
||||
$(OBJ_DIR)\url.obj $(OBJ_DIR)\version.obj
|
||||
|
||||
#
|
||||
@@ -503,3 +504,15 @@ $(OBJ_DIR)\nss.obj: nss.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
strequal.h select.h sslgen.h ..\include\curl\mprintf.h
|
||||
$(OBJ_DIR)\qssl.obj: qssl.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h
|
||||
$(OBJ_DIR)\rawstr.obj: rawstr.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
strerror.h urldata.h cookie.h formdata.h timeval.h http_chunks.h &
|
||||
hostip.h hash.h llist.h splay.h ..\include\curl\mprintf.h
|
||||
$(OBJ_DIR)\curl_addrinfo.o: curl_addrinfo.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h curl_addrinfo.h &
|
||||
..\include\curl\mprintf.h memory.h memdebug.h
|
@@ -68,38 +68,23 @@ if SONAME_BUMP
|
||||
#
|
||||
# This conditional soname bump SHOULD be removed at next "proper" bump.
|
||||
#
|
||||
VERSIONINFO=-version-info 6:0:1
|
||||
VERSIONINFO=-version-info 6:1:1
|
||||
else
|
||||
VERSIONINFO=-version-info 5:0:1
|
||||
VERSIONINFO=-version-info 5:1:1
|
||||
endif
|
||||
|
||||
# This flag accepts an argument of the form current[:revision[:age]]. So,
|
||||
# passing -version-info 3:12:1 sets current to 3, revision to 12, and age to
|
||||
# 1.
|
||||
#
|
||||
# If either revision or age are omitted, they default to 0. Also note that age
|
||||
# must be less than or equal to the current interface number.
|
||||
# Here's the simplified rule guide on how to change -version-info:
|
||||
# (current version is C:R:A)
|
||||
#
|
||||
# Here are a set of rules to help you update your library version information:
|
||||
#
|
||||
# 1.Start with version information of 0:0:0 for each libtool library.
|
||||
#
|
||||
# 2.Update the version information only immediately before a public release of
|
||||
# your software. More frequent updates are unnecessary, and only guarantee
|
||||
# that the current interface number gets larger faster.
|
||||
#
|
||||
# 3.If the library source code has changed at all since the last update, then
|
||||
# increment revision (c:r+1:a)
|
||||
#
|
||||
# 4.If any interfaces have been added, removed, or changed since the last
|
||||
# update, increment current, and set revision to 0. (c+1:r=0:a)
|
||||
#
|
||||
# 5.If any interfaces have been added since the last public release, then
|
||||
# increment age. (c:r:a+1)
|
||||
#
|
||||
# 6.If any interfaces have been removed since the last public release, then
|
||||
# set age to 0. (c:r:a=0)
|
||||
# 1. if there are only source changes, use C:R+1:A
|
||||
# 2. if interfaces were added use C+1:0:A+1
|
||||
# 3. if interfaces were removed, then use C+1:0:0
|
||||
#
|
||||
# For the full guide on libcurl ABI rules, see docs/libcurl/ABI
|
||||
|
||||
if NO_UNDEFINED
|
||||
# The -no-undefined flag is CRUCIAL for this to build fine on Cygwin.
|
||||
|
@@ -9,15 +9,15 @@ CSOURCES = file.c timeval.c base64.c hostip.c progress.c formdata.c \
|
||||
http_negotiate.c http_ntlm.c inet_pton.c strtoofft.c strerror.c \
|
||||
hostares.c hostasyn.c hostip4.c hostip6.c hostsyn.c hostthre.c \
|
||||
inet_ntop.c parsedate.c select.c gtls.c sslgen.c tftp.c splay.c \
|
||||
strdup.c socks.c ssh.c nss.c qssl.c
|
||||
strdup.c socks.c ssh.c nss.c qssl.c rawstr.c curl_addrinfo.c
|
||||
|
||||
HHEADERS = arpa_telnet.h netrc.h file.h timeval.h qssl.h hostip.h \
|
||||
progress.h formdata.h cookie.h http.h sendf.h ftp.h url.h dict.h \
|
||||
if2ip.h speedcheck.h urldata.h curl_ldap.h ssluse.h escape.h telnet.h \
|
||||
getinfo.h strequal.h krb4.h memdebug.h inet_ntoa_r.h http_chunks.h \
|
||||
getinfo.h strequal.h krb4.h memdebug.h http_chunks.h \
|
||||
strtok.h connect.h llist.h hash.h content_encoding.h share.h \
|
||||
curl_md5.h http_digest.h http_negotiate.h http_ntlm.h inet_pton.h \
|
||||
strtoofft.h strerror.h inet_ntop.h curlx.h memory.h setup.h \
|
||||
transfer.h select.h easyif.h multiif.h parsedate.h sslgen.h gtls.h \
|
||||
tftp.h sockaddr.h splay.h strdup.h setup_once.h socks.h ssh.h nssg.h \
|
||||
curl_base64.h
|
||||
curl_base64.h rawstr.h curl_addrinfo.h
|
||||
|
@@ -379,6 +379,7 @@ ifeq ($(LIBARCH),CLIB)
|
||||
@echo $(DL)#define OS "i586-pc-clib-NetWare"$(DL) >> $@
|
||||
@echo $(DL)#define NETDB_USE_INTERNET 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRICMP 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRNICMP 1$(DL) >> $@
|
||||
@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
|
||||
@echo $(DL)#define RECV_TYPE_ARG2 char *$(DL) >> $@
|
||||
@echo $(DL)#define RECV_TYPE_ARG3 int$(DL) >> $@
|
||||
@@ -403,7 +404,6 @@ else
|
||||
@echo $(DL)#define OS "i586-pc-libc-NetWare"$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_FTRUNCATE 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_INET_PTON 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@
|
||||
@@ -439,8 +439,12 @@ 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 SIZEOF_OFF_T 8$(DL) >> $@
|
||||
@echo $(DL)#define _LARGEFILE 1$(DL) >> $@
|
||||
ifdef ENABLE_IPV6
|
||||
@echo $(DL)#define ENABLE_IPV6 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_FREEADDRINFO 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_GETADDRINFO 1$(DL) >> $@
|
||||
endif
|
||||
endif
|
||||
@echo $(DL)#define USE_MANUAL 1$(DL) >> $@
|
||||
@@ -454,7 +458,6 @@ endif
|
||||
@echo $(DL)#define HAVE_GETPROTOBYNAME 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_GMTIME_R 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_INET_ADDR 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_INET_NTOA 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_LL 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_LOCALE_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_LOCALTIME_R 1$(DL) >> $@
|
||||
@@ -485,6 +488,7 @@ endif
|
||||
@echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_UTIME 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_UTIME_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_WRITEV 1$(DL) >> $@
|
||||
@echo $(DL)#define RETSIGTYPE void$(DL) >> $@
|
||||
@echo $(DL)#define SIZEOF_STRUCT_IN_ADDR 4$(DL) >> $@
|
||||
@echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
|
||||
|
@@ -12,7 +12,8 @@ objs = o.base64 o.connect o.cookie o.dict \
|
||||
o.memdebug o.mprintf o.netrc o.parsedate o.progress \
|
||||
o.security o.select o.sendf o.speedcheck o.ssluse \
|
||||
o.strequal o.strtok o.telnet o.timeval \
|
||||
o.transfer o.url o.version o.strtoofft o.sslgen o.gtls
|
||||
o.transfer o.url o.version o.strtoofft o.sslgen o.gtls \
|
||||
o.rawstr
|
||||
|
||||
# Compile options:
|
||||
linkopts = -o libcurl
|
||||
@@ -128,6 +129,9 @@ o.sslgen: c.sslgen
|
||||
o.ssluse: c.ssluse
|
||||
gcc $(compileropts) -c -o ssluse.o c.ssluse
|
||||
|
||||
o.rawstr: c.rawstr
|
||||
gcc $(compileropts) -c -o rawstr.o c.rawstr
|
||||
|
||||
o.strequal: c.strequal
|
||||
gcc $(compileropts) -c -o strequal.o c.strequal
|
||||
|
||||
|
@@ -481,6 +481,7 @@ X_OBJS= \
|
||||
$(DIROBJ)\tftp.obj \
|
||||
$(DIROBJ)\splay.obj \
|
||||
$(DIROBJ)\socks.obj \
|
||||
$(DIROBJ)\rawstr.obj \
|
||||
$(RESOURCE)
|
||||
|
||||
all : $(TARGET)
|
||||
|
@@ -40,9 +40,6 @@
|
||||
#ifndef select
|
||||
# define select(args...) WaitSelect( args, NULL)
|
||||
#endif
|
||||
#ifndef inet_ntoa
|
||||
# define inet_ntoa(x) Inet_NtoA( x ## .s_addr)
|
||||
#endif
|
||||
#ifndef ioctl
|
||||
# define ioctl(a,b,c,d) IoctlSocket( (LONG)a, (ULONG)b, (char*)c)
|
||||
#endif
|
||||
|
12
lib/base64.c
12
lib/base64.c
@@ -117,7 +117,7 @@ size_t Curl_base64_decode(const char *src, unsigned char **outptr)
|
||||
/* Decode all but the last quantum (which may not decode to a
|
||||
multiple of 3 bytes) */
|
||||
for(i = 0; i < numQuantums - 1; i++) {
|
||||
decodeQuantum((unsigned char *)newstr, src);
|
||||
decodeQuantum(newstr, src);
|
||||
newstr += 3; src += 4;
|
||||
}
|
||||
|
||||
@@ -153,14 +153,14 @@ size_t Curl_base64_encode(struct SessionHandle *data,
|
||||
char *convbuf = NULL;
|
||||
#endif
|
||||
|
||||
char *indata = (char *)inp;
|
||||
const char *indata = inp;
|
||||
|
||||
*outptr = NULL; /* set to NULL in case of failure before we reach the end */
|
||||
|
||||
if(0 == insize)
|
||||
insize = strlen(indata);
|
||||
|
||||
base64data = output = (char*)malloc(insize*4/3+4);
|
||||
base64data = output = malloc(insize*4/3+4);
|
||||
if(NULL == output)
|
||||
return 0;
|
||||
|
||||
@@ -171,7 +171,7 @@ size_t Curl_base64_encode(struct SessionHandle *data,
|
||||
* so we copy it to a buffer, translate it, and use that instead.
|
||||
*/
|
||||
if(data) {
|
||||
convbuf = (char*)malloc(insize);
|
||||
convbuf = malloc(insize);
|
||||
if(!convbuf) {
|
||||
free(output);
|
||||
return 0;
|
||||
@@ -271,7 +271,7 @@ int main(int argc, argv_item_t argv[], char **envp)
|
||||
data = (unsigned char *)suck(&dataLen);
|
||||
base64Len = Curl_base64_encode(handle, data, dataLen, &base64);
|
||||
|
||||
fprintf(stderr, "%d\n", base64Len);
|
||||
fprintf(stderr, "%zu\n", base64Len);
|
||||
fprintf(stdout, "%s\n", base64);
|
||||
|
||||
free(base64); free(data);
|
||||
@@ -356,7 +356,7 @@ void *suck(int *lenptr)
|
||||
|
||||
do {
|
||||
cursize *= 2;
|
||||
buf = (unsigned char *)realloc(buf, cursize);
|
||||
buf = realloc(buf, cursize);
|
||||
memset(buf + len, 0, cursize - len);
|
||||
lastread = fread(buf + len, 1, cursize - len, stdin);
|
||||
len += lastread;
|
||||
|
@@ -28,7 +28,6 @@
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
#define HAVE_GETHOSTBYADDR 1
|
||||
#define HAVE_INET_ADDR 1
|
||||
#define HAVE_INET_NTOA 1
|
||||
#define HAVE_INTTYPES_H 1
|
||||
#define HAVE_IOCTLSOCKET_CASE 1
|
||||
#define HAVE_LIBCRYPTO 1
|
||||
|
@@ -1,3 +1,12 @@
|
||||
#ifndef __LIB_CONFIG_MAC_H
|
||||
#define __LIB_CONFIG_MAC_H
|
||||
|
||||
/* ================================================================ */
|
||||
/* lib/config-mac.h - Hand crafted config file for Mac OS 9 */
|
||||
/* ================================================================ */
|
||||
/* On Mac OS X you must run configure to generate config.h file */
|
||||
/* ================================================================ */
|
||||
|
||||
#define OS "mac"
|
||||
|
||||
#define HAVE_NETINET_IN_H 1
|
||||
@@ -19,9 +28,9 @@
|
||||
|
||||
#define TIME_WITH_SYS_TIME 1
|
||||
|
||||
#define HAVE_ALARM 1
|
||||
#define HAVE_STRDUP 1
|
||||
#define HAVE_UTIME 1
|
||||
#define HAVE_INET_NTOA 1
|
||||
#define HAVE_SETVBUF 1
|
||||
#define HAVE_STRFTIME 1
|
||||
#define HAVE_INET_ADDR 1
|
||||
@@ -83,3 +92,5 @@
|
||||
|
||||
#define HAVE_EXTRA_STRICMP_H 1
|
||||
#define HAVE_EXTRA_STRDUP_H 1
|
||||
|
||||
#endif /* __LIB_CONFIG_MAC_H */
|
||||
|
@@ -33,12 +33,6 @@
|
||||
/* Define if you have the gethostbyname_r() function with 6 arguments */
|
||||
#undef HAVE_GETHOSTBYNAME_R_6
|
||||
|
||||
/* Define if you have the inet_ntoa_r function declared. */
|
||||
#define HAVE_INET_NTOA_R_DECL
|
||||
|
||||
/* Define if the inet_ntoa_r function returns an int. */
|
||||
#define HAVE_INT_INET_NTOA_R
|
||||
|
||||
/* Define if you need the _REENTRANT define for some functions */
|
||||
#undef NEED_REENTRANT
|
||||
|
||||
@@ -63,6 +57,9 @@
|
||||
/* Set to explicitly specify we don't want to use thread-safe functions */
|
||||
#undef DISABLED_THREADSAFE
|
||||
|
||||
/* Define to 1 if you have the alarm function. */
|
||||
#define HAVE_ALARM 1
|
||||
|
||||
/* Define if you have the <alloca.h> header file. */
|
||||
#undef HAVE_ALLOCA_H
|
||||
|
||||
@@ -124,12 +121,6 @@
|
||||
/* Define if you have the `inet_addr' function. */
|
||||
#define HAVE_INET_ADDR
|
||||
|
||||
/* Define if you have the `inet_ntoa' function. */
|
||||
#define HAVE_INET_NTOA
|
||||
|
||||
/* Define if you have the `inet_ntoa_r' function. */
|
||||
#define HAVE_INET_NTOA_R
|
||||
|
||||
/* Define if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H
|
||||
|
||||
|
@@ -29,9 +29,6 @@
|
||||
/* Define if you have the gethostbyname_r() function with 6 arguments */
|
||||
#undef HAVE_GETHOSTBYNAME_R_6
|
||||
|
||||
/* Define if you have the inet_ntoa_r function declared. */
|
||||
#undef HAVE_INET_NTOA_R_DECL
|
||||
|
||||
/* Define if you need the _REENTRANT define for some functions */
|
||||
#undef NEED_REENTRANT
|
||||
|
||||
@@ -59,6 +56,9 @@
|
||||
/* Define if you want to enable IPv6 support */
|
||||
#undef ENABLE_IPV6
|
||||
|
||||
/* Define to 1 if you have the alarm function. */
|
||||
#define HAVE_ALARM 1
|
||||
|
||||
/* Define if you have the <alloca.h> header file. */
|
||||
#define HAVE_ALLOCA_H
|
||||
|
||||
@@ -119,12 +119,6 @@
|
||||
/* Define if you have the `inet_addr' function. */
|
||||
#undef HAVE_INET_ADDR
|
||||
|
||||
/* Define if you have the `inet_ntoa' function. */
|
||||
#undef HAVE_INET_NTOA
|
||||
|
||||
/* Define if you have the `inet_ntoa_r' function. */
|
||||
#undef HAVE_INET_NTOA_R
|
||||
|
||||
/* Define if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H
|
||||
|
||||
|
@@ -222,17 +222,11 @@
|
||||
/* Define to 1 if you have the `inet_addr' function. */
|
||||
/*#define HAVE_INET_ADDR 1*/
|
||||
|
||||
/* Define to 1 if you have the `inet_ntoa' function. */
|
||||
/*#define HAVE_INET_NTOA 1*/
|
||||
/* Define to 1 if you have a IPv6 capable working inet_ntop function. */
|
||||
/*#define HAVE_INET_NTOP 1*/
|
||||
|
||||
/* Define to 1 if you have the `inet_ntoa_r' function. */
|
||||
/* #undef HAVE_INET_NTOA_R */
|
||||
|
||||
/* inet_ntoa_r() is declared */
|
||||
/* #undef HAVE_INET_NTOA_R_DECL */
|
||||
|
||||
/* Define to 1 if you have the `inet_pton' function. */
|
||||
#define HAVE_INET_PTON 1
|
||||
/* Define to 1 if you have a IPv6 capable working inet_pton function. */
|
||||
/*#define HAVE_INET_PTON 1*/
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
@@ -297,9 +291,6 @@
|
||||
/* Define to 1 if you have the `ssl' library (-lssl). */
|
||||
/*#define HAVE_LIBSSL 1*/
|
||||
|
||||
/* if zlib is available */
|
||||
/*#define HAVE_LIBZ 1*/
|
||||
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
@@ -339,9 +330,6 @@
|
||||
/* Define to 1 if NI_WITHSCOPEID exists and works. */
|
||||
/*#define HAVE_NI_WITHSCOPEID 1*/
|
||||
|
||||
/* Defined if no inet_pton() prototype available */
|
||||
/* #undef HAVE_NO_INET_PTON_PROTO */
|
||||
|
||||
/* we have no strerror_r() proto */
|
||||
/* #undef HAVE_NO_STRERROR_R_DECL */
|
||||
|
||||
@@ -628,9 +616,6 @@
|
||||
/* Define to 1 if you have the <x509.h> header file. */
|
||||
/* #undef HAVE_X509_H */
|
||||
|
||||
/* if you have the zlib.h header file */
|
||||
/*#define HAVE_ZLIB_H 1*/
|
||||
|
||||
/* Define to 1 if you are building a native Windows target. */
|
||||
/* #undef NATIVE_WINDOWS */
|
||||
|
||||
@@ -803,7 +788,18 @@
|
||||
/* #define CURLDEBUG */
|
||||
#endif
|
||||
|
||||
/* sys/cdefs.h fails to define this for WINSCW */
|
||||
/* sys/cdefs.h fails to define this for WINSCW prior to Symbian OS ver. 9.4 */
|
||||
#ifndef __LONG_LONG_SUPPORTED
|
||||
#define __LONG_LONG_SUPPORTED
|
||||
#endif
|
||||
|
||||
/* Enable appropriate header only when zlib support is enabled */
|
||||
#ifdef HAVE_LIBZ
|
||||
#define HAVE_ZLIB_H 1
|
||||
#endif
|
||||
|
||||
/* Enable appropriate definitions only when OpenSSL support is enabled */
|
||||
#ifdef USE_SSL
|
||||
#define USE_OPENSSL 1
|
||||
#define USE_SSLEAY 1
|
||||
#endif
|
||||
|
@@ -74,6 +74,9 @@
|
||||
/* Define to the type of arg 7 for getnameinfo. */
|
||||
/* #undef GETNAMEINFO_TYPE_ARG7 */
|
||||
|
||||
/* Define to 1 if you have the alarm function. */
|
||||
#define HAVE_ALARM 1
|
||||
|
||||
/* Define to 1 if you have the <arpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
|
||||
@@ -205,16 +208,10 @@
|
||||
/* Define to 1 if you have the `inet_addr' function. */
|
||||
#define HAVE_INET_ADDR 1
|
||||
|
||||
/* Define to 1 if you have the `inet_ntoa' function. */
|
||||
#define HAVE_INET_NTOA 1
|
||||
/* Define to 1 if you have a IPv6 capable working inet_ntop function. */
|
||||
/* #undef HAVE_INET_NTOP */
|
||||
|
||||
/* Define to 1 if you have the `inet_ntoa_r' function. */
|
||||
/* #undef HAVE_INET_NTOA_R */
|
||||
|
||||
/* inet_ntoa_r() is declared */
|
||||
/* #undef HAVE_INET_NTOA_R_DECL */
|
||||
|
||||
/* Define to 1 if you have the `inet_pton' function. */
|
||||
/* Define to 1 if you have a IPv6 capable working inet_pton function. */
|
||||
/* #undef HAVE_INET_PTON */
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
@@ -296,9 +293,6 @@
|
||||
/* Define if NI_WITHSCOPEID exists and works */
|
||||
/* #undef HAVE_NI_WITHSCOPEID */
|
||||
|
||||
/* Defined if no inet_pton() prototype available */
|
||||
/* #undef HAVE_NO_INET_PTON_PROTO */
|
||||
|
||||
/* we have no strerror_r() proto */
|
||||
/* #undef HAVE_NO_STRERROR_R_DECL */
|
||||
|
||||
|
@@ -157,9 +157,6 @@
|
||||
/* Define if you have the inet_addr function. */
|
||||
#define HAVE_INET_ADDR 1
|
||||
|
||||
/* Define if you have the inet_ntoa function. */
|
||||
#define HAVE_INET_NTOA 1
|
||||
|
||||
/* Define if you have the ioctlsocket function. */
|
||||
#define HAVE_IOCTLSOCKET 1
|
||||
|
||||
@@ -188,15 +185,21 @@
|
||||
/* Define if you have the strcasecmp function. */
|
||||
/* #define HAVE_STRCASECMP 1 */
|
||||
|
||||
/* Define if you have the stricmp function. */
|
||||
#define HAVE_STRICMP 1
|
||||
|
||||
/* Define if you have the strdup function. */
|
||||
#define HAVE_STRDUP 1
|
||||
|
||||
/* Define if you have the strftime function. */
|
||||
#define HAVE_STRFTIME 1
|
||||
|
||||
/* Define if you have the stricmp function. */
|
||||
#define HAVE_STRICMP 1
|
||||
|
||||
/* Define if you have the strncasecmp function. */
|
||||
/* #define HAVE_STRNCASECMP 1 */
|
||||
|
||||
/* Define if you have the strnicmp function. */
|
||||
#define HAVE_STRNICMP 1
|
||||
|
||||
/* Define if you have the strstr function. */
|
||||
#define HAVE_STRSTR 1
|
||||
|
||||
@@ -216,9 +219,6 @@
|
||||
#define HAVE_UTIME 1
|
||||
#endif
|
||||
|
||||
/* Define if you have the getnameinfo function. */
|
||||
#define HAVE_GETNAMEINFO 1
|
||||
|
||||
/* Define to the type qualifier of arg 1 for getnameinfo. */
|
||||
#define GETNAMEINFO_QUAL_ARG1 const
|
||||
|
||||
@@ -390,6 +390,20 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is quite */
|
||||
/* convoluted, compiler dependant and in some cases even build target dependat. */
|
||||
#if defined(HAVE_WS2TCPIP_H)
|
||||
# if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)
|
||||
# define HAVE_FREEADDRINFO 1
|
||||
# define HAVE_GETADDRINFO 1
|
||||
# define HAVE_GETNAMEINFO 1
|
||||
# elif defined(_MSC_VER) && (_MSC_VER >= 1200)
|
||||
# define HAVE_FREEADDRINFO 1
|
||||
# define HAVE_GETADDRINFO 1
|
||||
# define HAVE_GETNAMEINFO 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* LARGE FILE SUPPORT */
|
||||
/* ---------------------------------------------------------------- */
|
||||
@@ -402,6 +416,10 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__MINGW32__) && !defined(USE_WIN32_LARGE_FILES)
|
||||
# define USE_WIN32_LARGE_FILES
|
||||
#endif
|
||||
|
||||
#if !defined(USE_WIN32_LARGE_FILES) && !defined(USE_WIN32_SMALL_FILES)
|
||||
# define USE_WIN32_SMALL_FILES
|
||||
#endif
|
||||
|
@@ -145,9 +145,6 @@
|
||||
/* Define if you have the inet_addr function. */
|
||||
#define HAVE_INET_ADDR 1
|
||||
|
||||
/* Define if you have the inet_ntoa function. */
|
||||
#define HAVE_INET_NTOA 1
|
||||
|
||||
/* Define if you have the ioctlsocket function. */
|
||||
#define HAVE_IOCTLSOCKET 1
|
||||
|
||||
@@ -172,15 +169,21 @@
|
||||
/* Define if you have the strcasecmp function. */
|
||||
/* #define HAVE_STRCASECMP 1 */
|
||||
|
||||
/* Define if you have the stricmp function. */
|
||||
/* #define HAVE_STRICMP 1 */
|
||||
|
||||
/* Define if you have the strdup function. */
|
||||
/* #define HAVE_STRDUP 1 */
|
||||
|
||||
/* Define if you have the strftime function. */
|
||||
/* #define HAVE_STRFTIME 1 */
|
||||
|
||||
/* Define if you have the stricmp function. */
|
||||
/* #define HAVE_STRICMP 1 */
|
||||
|
||||
/* Define if you have the strncasecmp function. */
|
||||
/* #define HAVE_STRNCASECMP 1 */
|
||||
|
||||
/* Define if you have the strnicmp function. */
|
||||
/* #define HAVE_STRNICMP 1 */
|
||||
|
||||
/* Define if you have the strstr function. */
|
||||
#define HAVE_STRSTR 1
|
||||
|
||||
|
@@ -20,12 +20,12 @@
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
#define HAVE_FCNTL_H 1
|
||||
#define HAVE_FIONBIO 1
|
||||
#define HAVE_GETADDRINFO 1
|
||||
#define HAVE_GETNAMEINFO 1
|
||||
#define HAVE_GETPROTOBYNAME 1
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
#define HAVE_IO_H 1
|
||||
#define HAVE_IOCTLSOCKET 1
|
||||
#define HAVE_INET_PTON 1
|
||||
#define HAVE_INET_NTOP 1
|
||||
#define HAVE_LOCALE_H 1
|
||||
#define HAVE_LONGLONG 1
|
||||
#define HAVE_MEMORY_H 1
|
||||
@@ -64,7 +64,7 @@
|
||||
#define STDC_HEADERS 1
|
||||
#define TIME_WITH_SYS_TIME 1
|
||||
|
||||
/* Qualifiers for send(), recv() and recvfrom(). */
|
||||
/* Qualifiers for send(), recv(), recvfrom() and getnameinfo(). */
|
||||
|
||||
#define SEND_TYPE_ARG1 int
|
||||
#define SEND_QUAL_ARG2 const
|
||||
@@ -88,6 +88,12 @@
|
||||
#define RECVFROM_TYPE_RETV int
|
||||
#define RECVFROM_TYPE_ARG2_IS_VOID 1
|
||||
|
||||
#define GETNAMEINFO_QUAL_ARG1 const
|
||||
#define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
|
||||
#define GETNAMEINFO_TYPE_ARG2 int
|
||||
#define GETNAMEINFO_TYPE_ARG46 int
|
||||
#define GETNAMEINFO_TYPE_ARG7 int
|
||||
|
||||
#define BSD
|
||||
|
||||
/* #define MALLOCDEBUG */
|
||||
|
261
lib/connect.c
261
lib/connect.c
@@ -102,6 +102,18 @@
|
||||
#undef SO_NOSIGPIPE
|
||||
#endif
|
||||
|
||||
struct Curl_sockaddr_ex {
|
||||
int family;
|
||||
int socktype;
|
||||
int protocol;
|
||||
unsigned int addrlen;
|
||||
union {
|
||||
struct sockaddr addr;
|
||||
struct Curl_sockaddr_storage buff;
|
||||
} _sa_ex_u;
|
||||
};
|
||||
#define sa_addr _sa_ex_u.addr
|
||||
|
||||
static bool verifyconnect(curl_socket_t sockfd, int *error);
|
||||
|
||||
static curl_socket_t
|
||||
@@ -284,39 +296,34 @@ int waitconnect(curl_socket_t sockfd, /* socket */
|
||||
}
|
||||
|
||||
static CURLcode bindlocal(struct connectdata *conn,
|
||||
curl_socket_t sockfd)
|
||||
curl_socket_t sockfd, int af)
|
||||
{
|
||||
#ifdef ENABLE_IPV6
|
||||
char ipv6_addr[16];
|
||||
#endif
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct sockaddr_in me;
|
||||
#ifdef ENABLE_IPV6
|
||||
struct sockaddr_in6 me6;
|
||||
#endif
|
||||
struct sockaddr *sock = NULL; /* bind to this address */
|
||||
socklen_t socksize; /* size of the data sock points to */
|
||||
socklen_t socksize = 0; /* size of the data sock points to */
|
||||
struct Curl_dns_entry *h=NULL;
|
||||
unsigned short port = data->set.localport; /* use this port number, 0 for
|
||||
"random" */
|
||||
/* how many port numbers to try to bind to, increasing one at a time */
|
||||
int portnum = data->set.localportrange;
|
||||
const char *dev = data->set.str[STRING_DEVICE];
|
||||
int error;
|
||||
|
||||
/*************************************************************
|
||||
* Select device to bind socket to
|
||||
*************************************************************/
|
||||
if(dev && (strlen(dev)<255) ) {
|
||||
struct Curl_dns_entry *h=NULL;
|
||||
char myhost[256] = "";
|
||||
in_addr_t in;
|
||||
int rc;
|
||||
bool was_iface = FALSE;
|
||||
int in6 = -1;
|
||||
|
||||
/* First check if the given name is an IP address */
|
||||
in=inet_addr((char *) dev);
|
||||
|
||||
if((in == CURL_INADDR_NONE) &&
|
||||
Curl_if2ip(dev, myhost, sizeof(myhost))) {
|
||||
if(Curl_if2ip(af, dev, myhost, sizeof(myhost))) {
|
||||
/*
|
||||
* We now have the numerical IPv4-style x.y.z.w in the 'myhost' buffer
|
||||
* We now have the numerical IP address in the 'myhost' buffer
|
||||
*/
|
||||
rc = Curl_resolv(conn, myhost, 0, &h);
|
||||
if(rc == CURLRESOLV_PENDING)
|
||||
@@ -324,7 +331,6 @@ static CURLcode bindlocal(struct connectdata *conn,
|
||||
|
||||
if(h) {
|
||||
was_iface = TRUE;
|
||||
Curl_resolv_unlock(data, h);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,22 +339,32 @@ static CURLcode bindlocal(struct connectdata *conn,
|
||||
* This was not an interface, resolve the name as a host name
|
||||
* or IP number
|
||||
*/
|
||||
|
||||
/*
|
||||
* Temporarily force name resolution to use only the address type
|
||||
* of the connection. The resolve functions should really be changed
|
||||
* to take a type parameter instead.
|
||||
*/
|
||||
long ipver = data->set.ip_version;
|
||||
if (af == AF_INET)
|
||||
data->set.ip_version = CURL_IPRESOLVE_V4;
|
||||
#ifdef ENABLE_IPV6
|
||||
else if (af == AF_INET6)
|
||||
data->set.ip_version = CURL_IPRESOLVE_V6;
|
||||
#endif
|
||||
|
||||
rc = Curl_resolv(conn, dev, 0, &h);
|
||||
if(rc == CURLRESOLV_PENDING)
|
||||
(void)Curl_wait_for_resolv(conn, &h);
|
||||
data->set.ip_version = ipver;
|
||||
|
||||
if(h) {
|
||||
if(in == CURL_INADDR_NONE)
|
||||
/* convert the resolved address, sizeof myhost >= INET_ADDRSTRLEN */
|
||||
Curl_printable_address(h->addr, myhost, sizeof myhost);
|
||||
else
|
||||
/* we know data->set.device is shorter than the myhost array */
|
||||
strcpy(myhost, dev);
|
||||
Curl_resolv_unlock(data, h);
|
||||
/* convert the resolved address, sizeof myhost >= INET_ADDRSTRLEN */
|
||||
Curl_printable_address(h->addr, myhost, sizeof myhost);
|
||||
}
|
||||
}
|
||||
|
||||
if(! *myhost) {
|
||||
if(!*myhost || !h) {
|
||||
/* need to fix this
|
||||
h=Curl_gethost(data,
|
||||
getmyhost(*myhost,sizeof(myhost)),
|
||||
@@ -356,11 +372,16 @@ static CURLcode bindlocal(struct connectdata *conn,
|
||||
sizeof(hostent_buf));
|
||||
*/
|
||||
failf(data, "Couldn't bind to '%s'", dev);
|
||||
if(h)
|
||||
Curl_resolv_unlock(data, h);
|
||||
return CURLE_INTERFACE_FAILED;
|
||||
}
|
||||
|
||||
infof(data, "Bind local address to %s\n", myhost);
|
||||
|
||||
sock = h->addr->ai_addr;
|
||||
socksize = h->addr->ai_addrlen;
|
||||
|
||||
#ifdef SO_BINDTODEVICE
|
||||
/* I am not sure any other OSs than Linux that provide this feature, and
|
||||
* at the least I cannot test. --Ben
|
||||
@@ -376,44 +397,39 @@ static CURLcode bindlocal(struct connectdata *conn,
|
||||
*/
|
||||
if(setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE,
|
||||
dev, strlen(dev)+1) != 0) {
|
||||
/* printf("Failed to BINDTODEVICE, socket: %d device: %s error: %s\n",
|
||||
sockfd, dev, Curl_strerror(SOCKERRNO)); */
|
||||
infof(data, "SO_BINDTODEVICE %s failed\n", dev);
|
||||
error = SOCKERRNO;
|
||||
infof(data, "SO_BINDTODEVICE %s failed with errno %d: %s; will do regular bind\n",
|
||||
dev, error, Curl_strerror(conn, error));
|
||||
/* This is typically "errno 1, error: Operation not permitted" if
|
||||
you're not running as root or another suitable privileged user */
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
in=inet_addr(myhost);
|
||||
|
||||
#ifdef ENABLE_IPV6
|
||||
in6 = Curl_inet_pton (AF_INET6, myhost, (void *)&ipv6_addr);
|
||||
#endif
|
||||
if(CURL_INADDR_NONE == in && -1 == in6) {
|
||||
failf(data,"couldn't find my own IP address (%s)", myhost);
|
||||
return CURLE_INTERFACE_FAILED;
|
||||
} /* end of inet_addr */
|
||||
|
||||
if( h ) {
|
||||
Curl_addrinfo *addr = h->addr;
|
||||
sock = addr->ai_addr;
|
||||
socksize = addr->ai_addrlen;
|
||||
}
|
||||
else
|
||||
return CURLE_INTERFACE_FAILED;
|
||||
|
||||
}
|
||||
else if(port) {
|
||||
/* if a local port number is requested but no local IP, extract the
|
||||
address from the socket */
|
||||
memset(&me, 0, sizeof(struct sockaddr));
|
||||
me.sin_family = AF_INET;
|
||||
me.sin_addr.s_addr = INADDR_ANY;
|
||||
if(af == AF_INET) {
|
||||
memset(&me, 0, sizeof(me));
|
||||
me.sin_family = AF_INET;
|
||||
me.sin_addr.s_addr = INADDR_ANY;
|
||||
|
||||
sock = (struct sockaddr *)&me;
|
||||
socksize = sizeof(struct sockaddr);
|
||||
sock = (struct sockaddr *)&me;
|
||||
socksize = sizeof(me);
|
||||
|
||||
}
|
||||
#ifdef ENABLE_IPV6
|
||||
else { /* AF_INET6 */
|
||||
memset(&me6, 0, sizeof(me6));
|
||||
me6.sin6_family = AF_INET6;
|
||||
/* in6addr_any isn't always available and since me6 has just been
|
||||
cleared, it's not strictly necessary to use it here */
|
||||
/*me6.sin6_addr = in6addr_any;*/
|
||||
|
||||
sock = (struct sockaddr *)&me6;
|
||||
socksize = sizeof(me6);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
/* no local kind of binding was requested */
|
||||
@@ -423,20 +439,23 @@ static CURLcode bindlocal(struct connectdata *conn,
|
||||
|
||||
/* Set port number to bind to, 0 makes the system pick one */
|
||||
if(sock->sa_family == AF_INET)
|
||||
((struct sockaddr_in *)sock)->sin_port = htons(port);
|
||||
me.sin_port = htons(port);
|
||||
#ifdef ENABLE_IPV6
|
||||
else
|
||||
((struct sockaddr_in6 *)sock)->sin6_port = htons(port);
|
||||
me6.sin6_port = htons(port);
|
||||
#endif
|
||||
|
||||
if( bind(sockfd, sock, socksize) >= 0) {
|
||||
/* we succeeded to bind */
|
||||
struct Curl_sockaddr_storage add;
|
||||
socklen_t size;
|
||||
|
||||
size = sizeof(add);
|
||||
socklen_t size = sizeof(add);
|
||||
memset(&add, 0, sizeof(struct Curl_sockaddr_storage));
|
||||
if(getsockname(sockfd, (struct sockaddr *) &add, &size) < 0) {
|
||||
failf(data, "getsockname() failed");
|
||||
data->state.os_errno = error = SOCKERRNO;
|
||||
failf(data, "getsockname() failed with errno %d: %s",
|
||||
error, Curl_strerror(conn, error));
|
||||
if(h)
|
||||
Curl_resolv_unlock(data, h);
|
||||
return CURLE_INTERFACE_FAILED;
|
||||
}
|
||||
/* We re-use/clobber the port variable here below */
|
||||
@@ -448,6 +467,8 @@ static CURLcode bindlocal(struct connectdata *conn,
|
||||
#endif
|
||||
infof(data, "Local port: %d\n", port);
|
||||
conn->bits.bound = TRUE;
|
||||
if(h)
|
||||
Curl_resolv_unlock(data, h);
|
||||
return CURLE_OK;
|
||||
}
|
||||
if(--portnum > 0) {
|
||||
@@ -458,11 +479,13 @@ static CURLcode bindlocal(struct connectdata *conn,
|
||||
break;
|
||||
} while(1);
|
||||
|
||||
data->state.os_errno = SOCKERRNO;
|
||||
failf(data, "bind failure: %s",
|
||||
Curl_strerror(conn, data->state.os_errno));
|
||||
return CURLE_INTERFACE_FAILED;
|
||||
data->state.os_errno = error = SOCKERRNO;
|
||||
failf(data, "bind failed with errno %d: %s",
|
||||
error, Curl_strerror(conn, error));
|
||||
if(h)
|
||||
Curl_resolv_unlock(data, h);
|
||||
|
||||
return CURLE_INTERFACE_FAILED;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -532,25 +555,6 @@ static bool verifyconnect(curl_socket_t sockfd, int *error)
|
||||
return rc;
|
||||
}
|
||||
|
||||
CURLcode Curl_store_ip_addr(struct connectdata *conn)
|
||||
{
|
||||
char addrbuf[256];
|
||||
Curl_printable_address(conn->ip_addr, addrbuf, sizeof(addrbuf));
|
||||
|
||||
/* save the string */
|
||||
Curl_safefree(conn->ip_addr_str);
|
||||
conn->ip_addr_str = strdup(addrbuf);
|
||||
if(!conn->ip_addr_str)
|
||||
return CURLE_OUT_OF_MEMORY; /* FAIL */
|
||||
|
||||
#ifdef PF_INET6
|
||||
if(conn->ip_addr->ai_family == PF_INET6)
|
||||
conn->bits.ipv6 = TRUE;
|
||||
#endif
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/* Used within the multi interface. Try next IP address, return TRUE if no
|
||||
more address exists or error */
|
||||
static bool trynextip(struct connectdata *conn,
|
||||
@@ -577,8 +581,7 @@ static bool trynextip(struct connectdata *conn,
|
||||
/* store the new socket descriptor */
|
||||
conn->sock[sockindex] = sockfd;
|
||||
conn->ip_addr = ai;
|
||||
|
||||
return Curl_store_ip_addr(conn) != CURLE_OK;
|
||||
break;
|
||||
}
|
||||
ai = ai->ai_next;
|
||||
}
|
||||
@@ -735,6 +738,7 @@ singleipconnect(struct connectdata *conn,
|
||||
long timeout_ms,
|
||||
bool *connected)
|
||||
{
|
||||
struct Curl_sockaddr_ex addr;
|
||||
char addr_buf[128];
|
||||
int rc;
|
||||
int error;
|
||||
@@ -742,66 +746,85 @@ singleipconnect(struct connectdata *conn,
|
||||
struct SessionHandle *data = conn->data;
|
||||
curl_socket_t sockfd;
|
||||
CURLcode res;
|
||||
/*
|
||||
* Curl_sockaddr_storage, which is basically sockaddr_storage has a space
|
||||
* for a largest possible struct sockaddr only. We should add some space for
|
||||
* the other fields we are using. Hence the addr_storage size math.
|
||||
*/
|
||||
char addr_storage[sizeof(struct curl_sockaddr)-
|
||||
sizeof(struct sockaddr)+
|
||||
sizeof(struct Curl_sockaddr_storage)];
|
||||
struct curl_sockaddr *addr=(struct curl_sockaddr*)&addr_storage;
|
||||
const void *iptoprint;
|
||||
struct sockaddr_in * const sa4 = (void *)&addr.sa_addr;
|
||||
#ifdef ENABLE_IPV6
|
||||
struct sockaddr_in6 * const sa6 = (void *)&addr.sa_addr;
|
||||
#endif
|
||||
|
||||
addr->family=ai->ai_family;
|
||||
addr->socktype=conn->socktype;
|
||||
addr->protocol=ai->ai_protocol;
|
||||
addr->addrlen =
|
||||
(ai->ai_addrlen < (socklen_t)sizeof(struct Curl_sockaddr_storage)) ?
|
||||
(unsigned int)ai->ai_addrlen : sizeof(struct Curl_sockaddr_storage);
|
||||
memcpy(&addr->addr, ai->ai_addr, addr->addrlen);
|
||||
/*
|
||||
* The Curl_sockaddr_ex structure is basically libcurl's external API
|
||||
* curl_sockaddr structure with enough space available to directly hold
|
||||
* any protocol-specific address structures. The variable declared here
|
||||
* will be used to pass / receive data to/from the fopensocket callback
|
||||
* if this has been set, before that, it is initialized from parameters.
|
||||
*/
|
||||
|
||||
/* If set, use opensocket callback to get the socket */
|
||||
if(data->set.fopensocket)
|
||||
sockfd = data->set.fopensocket(data->set.opensocket_client,
|
||||
CURLSOCKTYPE_IPCXN, addr);
|
||||
else
|
||||
sockfd = socket(addr->family, addr->socktype, addr->protocol);
|
||||
if(sockfd == CURL_SOCKET_BAD)
|
||||
return CURL_SOCKET_BAD;
|
||||
addr.family = ai->ai_family;
|
||||
addr.socktype = conn->socktype;
|
||||
addr.protocol = ai->ai_protocol;
|
||||
addr.addrlen = ai->ai_addrlen;
|
||||
|
||||
if(addr.addrlen > sizeof(struct Curl_sockaddr_storage))
|
||||
addr.addrlen = sizeof(struct Curl_sockaddr_storage);
|
||||
memcpy(&addr.sa_addr, ai->ai_addr, addr.addrlen);
|
||||
|
||||
*connected = FALSE; /* default is not connected */
|
||||
|
||||
#ifdef CURLRES_IPV6
|
||||
if (conn->scope && (addr->family == AF_INET6)) {
|
||||
struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)&addr->addr;
|
||||
in6->sin6_scope_id = conn->scope;
|
||||
}
|
||||
if(data->set.fopensocket)
|
||||
/*
|
||||
* If the opensocket callback is set, all the destination address information
|
||||
* is passed to the callback. Depending on this information the callback may
|
||||
* opt to abort the connection, this is indicated returning CURL_SOCKET_BAD;
|
||||
* otherwise it will return a not-connected socket. When the callback returns
|
||||
* a valid socket the destination address information might have been changed
|
||||
* and this 'new' address will actually be used here to connect.
|
||||
*/
|
||||
sockfd = data->set.fopensocket(data->set.opensocket_client,
|
||||
CURLSOCKTYPE_IPCXN,
|
||||
(struct curl_sockaddr *)&addr);
|
||||
else
|
||||
/* opensocket callback not set, so simply create the socket now */
|
||||
sockfd = socket(addr.family, addr.socktype, addr.protocol);
|
||||
|
||||
if(sockfd == CURL_SOCKET_BAD)
|
||||
/* no socket, no connection */
|
||||
return CURL_SOCKET_BAD;
|
||||
|
||||
#ifdef ENABLE_IPV6
|
||||
if (conn->scope && (addr.family == AF_INET6))
|
||||
sa6->sin6_scope_id = conn->scope;
|
||||
#endif
|
||||
|
||||
/* FIXME: do we have Curl_printable_address-like with struct sockaddr* as
|
||||
argument? */
|
||||
#if defined(HAVE_SYS_UN_H) && defined(AF_UNIX)
|
||||
if(addr->family==AF_UNIX) {
|
||||
if(addr.family == AF_UNIX) {
|
||||
infof(data, " Trying %s... ",
|
||||
((const struct sockaddr_un*)(&addr->addr))->sun_path);
|
||||
((const struct sockaddr_un*)(&addr.sa_addr))->sun_path);
|
||||
snprintf(data->info.ip, MAX_IPADR_LEN, "%s",
|
||||
((const struct sockaddr_un*)(&addr->addr))->sun_path);
|
||||
((const struct sockaddr_un*)(&addr.sa_addr))->sun_path);
|
||||
strcpy(conn->ip_addr_str, data->info.ip);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#ifdef ENABLE_IPV6
|
||||
if(addr->family==AF_INET6)
|
||||
iptoprint= &((const struct sockaddr_in6*)(&addr->addr))->sin6_addr;
|
||||
if(addr.family == AF_INET6) {
|
||||
iptoprint = &sa6->sin6_addr;
|
||||
conn->bits.ipv6 = TRUE;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
iptoprint = &((const struct sockaddr_in*)(&addr->addr))->sin_addr;
|
||||
{
|
||||
iptoprint = &sa4->sin_addr;
|
||||
}
|
||||
|
||||
if(Curl_inet_ntop(addr->family, iptoprint, addr_buf,
|
||||
if(Curl_inet_ntop(addr.family, iptoprint, addr_buf,
|
||||
sizeof(addr_buf)) != NULL) {
|
||||
infof(data, " Trying %s... ", addr_buf);
|
||||
snprintf(data->info.ip, MAX_IPADR_LEN, "%s", addr_buf);
|
||||
strcpy(conn->ip_addr_str, data->info.ip);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -822,7 +845,7 @@ singleipconnect(struct connectdata *conn,
|
||||
}
|
||||
|
||||
/* possibly bind the local end to an IP, interface or port */
|
||||
res = bindlocal(conn, sockfd);
|
||||
res = bindlocal(conn, sockfd, addr.family);
|
||||
if(res) {
|
||||
sclose(sockfd); /* close socket and bail out */
|
||||
return CURL_SOCKET_BAD;
|
||||
@@ -833,7 +856,7 @@ singleipconnect(struct connectdata *conn,
|
||||
|
||||
/* Connect TCP sockets, bind UDP */
|
||||
if(conn->socktype == SOCK_STREAM)
|
||||
rc = connect(sockfd, &addr->addr, addr->addrlen);
|
||||
rc = connect(sockfd, &addr.sa_addr, addr.addrlen);
|
||||
else
|
||||
rc = 0;
|
||||
|
||||
|
@@ -37,8 +37,6 @@ CURLcode Curl_connecthost(struct connectdata *conn,
|
||||
Curl_addrinfo **addr, /* the one we used */
|
||||
bool *connected); /* truly connected? */
|
||||
|
||||
CURLcode Curl_store_ip_addr(struct connectdata *conn);
|
||||
|
||||
/* generic function that returns how much time there's left to run, according
|
||||
to the timeouts set */
|
||||
long Curl_timeleft(struct connectdata *conn,
|
||||
|
@@ -89,7 +89,7 @@ inflate_stream(struct connectdata *conn,
|
||||
|
||||
/* Dynamically allocate a buffer for decompression because it's uncommonly
|
||||
large to hold on the stack */
|
||||
decomp = (char*)malloc(DSIZ);
|
||||
decomp = malloc(DSIZ);
|
||||
if(decomp == NULL) {
|
||||
return exit_zlib(z, &k->zlib_init, CURLE_OUT_OF_MEMORY);
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user