Compare commits
346 Commits
curl-7_15_
...
curl-7_15_
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7010e5ea84 | ||
![]() |
2cba6b246d | ||
![]() |
52cc2a7a0c | ||
![]() |
c012e2b408 | ||
![]() |
646a6b604f | ||
![]() |
cca00a6378 | ||
![]() |
10b7fc7e51 | ||
![]() |
43e4544d51 | ||
![]() |
21aa8f0b45 | ||
![]() |
b708fa51ad | ||
![]() |
8709f6c4b3 | ||
![]() |
2ac560e58b | ||
![]() |
8f8ba9486d | ||
![]() |
f55924b3e0 | ||
![]() |
7240acdebc | ||
![]() |
b9b06b00bf | ||
![]() |
51f258d103 | ||
![]() |
4c75f1c7b7 | ||
![]() |
ed7bff1fec | ||
![]() |
01a79be2c9 | ||
![]() |
d211fcd34f | ||
![]() |
159834171e | ||
![]() |
8a38c72c48 | ||
![]() |
fbcdc192d5 | ||
![]() |
ee642859ef | ||
![]() |
9f579f12fc | ||
![]() |
825a526789 | ||
![]() |
ae8a01ead6 | ||
![]() |
9dde0b54a3 | ||
![]() |
f1343b2f55 | ||
![]() |
962b7985e6 | ||
![]() |
5a1c64d316 | ||
![]() |
01b2cf82ec | ||
![]() |
c033c4c71c | ||
![]() |
aa791ee5cf | ||
![]() |
305671e2ab | ||
![]() |
d654736834 | ||
![]() |
2c81bfead5 | ||
![]() |
77b3bc239d | ||
![]() |
c10d15aa0f | ||
![]() |
a88deadd6f | ||
![]() |
e6ea8f1199 | ||
![]() |
4d4151f6c1 | ||
![]() |
518becfe2e | ||
![]() |
6f6b93da02 | ||
![]() |
45b1843dc9 | ||
![]() |
cb86a302d8 | ||
![]() |
d15ed439ae | ||
![]() |
b765e1f3b7 | ||
![]() |
2527b53019 | ||
![]() |
78a47826b2 | ||
![]() |
ecfaa4f869 | ||
![]() |
f36adcdb73 | ||
![]() |
13616f8f96 | ||
![]() |
ab486d1e27 | ||
![]() |
9111909c1d | ||
![]() |
4a1a1a75fb | ||
![]() |
e4d6ade4b3 | ||
![]() |
c82e880f5b | ||
![]() |
f2aa3b21e0 | ||
![]() |
385db0e97d | ||
![]() |
4e58da5222 | ||
![]() |
1c6ebb0782 | ||
![]() |
7e8b84c3e7 | ||
![]() |
132067b081 | ||
![]() |
8c36fc8f31 | ||
![]() |
93858efe73 | ||
![]() |
ba7f27a3f6 | ||
![]() |
2f70fb7015 | ||
![]() |
655ec6bf8e | ||
![]() |
c4ad533300 | ||
![]() |
5cdbd0cf4a | ||
![]() |
a55c70d4ae | ||
![]() |
02938a010d | ||
![]() |
e40641bf7c | ||
![]() |
27c0b43897 | ||
![]() |
d46de5ab8b | ||
![]() |
73ebb0edde | ||
![]() |
684245d6ce | ||
![]() |
d157c29269 | ||
![]() |
4d2e81661b | ||
![]() |
483a586d55 | ||
![]() |
4ac54f8c2c | ||
![]() |
840aacf7dd | ||
![]() |
ab4256d53a | ||
![]() |
46c5e562bf | ||
![]() |
42f5a90d09 | ||
![]() |
ef82da93fb | ||
![]() |
06d05b18b2 | ||
![]() |
431c4bd6e3 | ||
![]() |
f72c4e82fd | ||
![]() |
9c83a20a27 | ||
![]() |
773bec5ae5 | ||
![]() |
f3c508f6e8 | ||
![]() |
2aa4710745 | ||
![]() |
3b0a920fad | ||
![]() |
daef1cf34d | ||
![]() |
bd8d4637a3 | ||
![]() |
d2cefc140a | ||
![]() |
ccfce89423 | ||
![]() |
700cd5805c | ||
![]() |
498aad8587 | ||
![]() |
73f407b7ae | ||
![]() |
4be7dcba48 | ||
![]() |
f0694c582e | ||
![]() |
f90f0c98d9 | ||
![]() |
95aecc5dbb | ||
![]() |
f975fd03a1 | ||
![]() |
8272874704 | ||
![]() |
86f4cead16 | ||
![]() |
88a1a10e6f | ||
![]() |
624e657210 | ||
![]() |
2278e8f1ba | ||
![]() |
58176d1484 | ||
![]() |
10489879f7 | ||
![]() |
fe22872d14 | ||
![]() |
4d95d23d99 | ||
![]() |
c6fc5a1a26 | ||
![]() |
012d75442a | ||
![]() |
dcc7900e7c | ||
![]() |
34f5e8ad0e | ||
![]() |
c2fee9894a | ||
![]() |
abd983e851 | ||
![]() |
28611704d9 | ||
![]() |
305dddeab0 | ||
![]() |
ee8112b42f | ||
![]() |
ca319f63ad | ||
![]() |
a09a8164db | ||
![]() |
e5cf6a20a7 | ||
![]() |
af5e6e7e6d | ||
![]() |
70f2b5e877 | ||
![]() |
8ef454dcbe | ||
![]() |
551a041283 | ||
![]() |
03288943af | ||
![]() |
725f734bae | ||
![]() |
0f32460656 | ||
![]() |
25180cc850 | ||
![]() |
2a0e41cab9 | ||
![]() |
05edd48ad0 | ||
![]() |
266ab95557 | ||
![]() |
0a4bba565c | ||
![]() |
2ddb9d57aa | ||
![]() |
4f012ad703 | ||
![]() |
a1cd180082 | ||
![]() |
bc2f0c7dcb | ||
![]() |
c6ae0ebcbf | ||
![]() |
c6ec576cbb | ||
![]() |
55329b56cb | ||
![]() |
7e43d06b60 | ||
![]() |
89f54f3739 | ||
![]() |
01fa02d0b5 | ||
![]() |
8bed45340a | ||
![]() |
55138753c6 | ||
![]() |
43369b8096 | ||
![]() |
bec1977137 | ||
![]() |
4c08eb4b11 | ||
![]() |
0163730437 | ||
![]() |
39745ac38e | ||
![]() |
cacf8bbb58 | ||
![]() |
a1c6d5861a | ||
![]() |
589c4596d8 | ||
![]() |
7a6d7fca42 | ||
![]() |
5305c9f1e8 | ||
![]() |
b1022ea4c1 | ||
![]() |
380a74a4ed | ||
![]() |
ff709848a6 | ||
![]() |
279dd6d878 | ||
![]() |
2e0ad842d0 | ||
![]() |
a3949c7786 | ||
![]() |
2320606262 | ||
![]() |
b01286d280 | ||
![]() |
64f72c22b9 | ||
![]() |
856114d05c | ||
![]() |
98b8c4b0c9 | ||
![]() |
01f5f0be5a | ||
![]() |
eb6d404753 | ||
![]() |
c508ab1aef | ||
![]() |
0793dc922c | ||
![]() |
00a41ab296 | ||
![]() |
37f4877e56 | ||
![]() |
a6fc45c02f | ||
![]() |
25411e01db | ||
![]() |
a8ac6f1dc1 | ||
![]() |
dfe1884c25 | ||
![]() |
3e5dcc8bcd | ||
![]() |
ff81900784 | ||
![]() |
4cb30a3057 | ||
![]() |
72f80b88f7 | ||
![]() |
3008d8133c | ||
![]() |
4524618bf2 | ||
![]() |
55d22ba10c | ||
![]() |
76cf020750 | ||
![]() |
f13ac35edf | ||
![]() |
59582a9d9d | ||
![]() |
6246bbc656 | ||
![]() |
1b028b419b | ||
![]() |
4c6c768422 | ||
![]() |
1d3969b215 | ||
![]() |
94116d9ebc | ||
![]() |
cc5174a89a | ||
![]() |
31552100c5 | ||
![]() |
8df5dcb193 | ||
![]() |
7929600798 | ||
![]() |
a05ea124b9 | ||
![]() |
6a03ab3ad4 | ||
![]() |
6a151c1312 | ||
![]() |
990e56fb13 | ||
![]() |
2bd3033f68 | ||
![]() |
fe105a07e3 | ||
![]() |
a5782defd3 | ||
![]() |
bcccd2fe74 | ||
![]() |
404e23734b | ||
![]() |
973d63f4f2 | ||
![]() |
405d98ee63 | ||
![]() |
f81724969d | ||
![]() |
edb5444fa3 | ||
![]() |
e877cb7bd7 | ||
![]() |
482b3ba702 | ||
![]() |
752acedc0b | ||
![]() |
fb88723afc | ||
![]() |
3718737091 | ||
![]() |
3d3f056f7e | ||
![]() |
c60621c367 | ||
![]() |
606562aa7e | ||
![]() |
f689d06ca9 | ||
![]() |
7cfd7f3fb1 | ||
![]() |
4a8dfb3461 | ||
![]() |
3752b3aead | ||
![]() |
b81d41df22 | ||
![]() |
dadf3f06ee | ||
![]() |
8ed0d5675f | ||
![]() |
d5e9041344 | ||
![]() |
d99c20f628 | ||
![]() |
973ed24dc8 | ||
![]() |
5d5f5e3be8 | ||
![]() |
d9e14408f0 | ||
![]() |
c9c5ce2365 | ||
![]() |
975534370f | ||
![]() |
28605f6bd3 | ||
![]() |
3c6d3b69c2 | ||
![]() |
00312e95fe | ||
![]() |
4223130bb0 | ||
![]() |
c811e1ce70 | ||
![]() |
77475f2ad0 | ||
![]() |
3680a2f6f5 | ||
![]() |
1946058e7b | ||
![]() |
73daf8ce33 | ||
![]() |
094ceeba14 | ||
![]() |
3b7359a27a | ||
![]() |
df9108e19b | ||
![]() |
6307e783d8 | ||
![]() |
b9cd73c76d | ||
![]() |
b62c230ca2 | ||
![]() |
800193da9b | ||
![]() |
577ba5783c | ||
![]() |
9bece2b313 | ||
![]() |
e85e30546c | ||
![]() |
758f6eed51 | ||
![]() |
80ee5d3bd8 | ||
![]() |
dd06c60ada | ||
![]() |
6ca627ae74 | ||
![]() |
80a0b81c2a | ||
![]() |
06a7b0561b | ||
![]() |
12db20be4e | ||
![]() |
3cbb1b2b64 | ||
![]() |
d75e587613 | ||
![]() |
414c57d138 | ||
![]() |
c14a84e6f2 | ||
![]() |
def0db30e7 | ||
![]() |
6ef7a81a3b | ||
![]() |
95152aec68 | ||
![]() |
8ed6762363 | ||
![]() |
87c5ed8bec | ||
![]() |
ecc6c1f501 | ||
![]() |
3d8338b0d4 | ||
![]() |
c91e25518f | ||
![]() |
a8dddeab61 | ||
![]() |
8f0a5ab660 | ||
![]() |
db03d4bdd0 | ||
![]() |
0ec96e4279 | ||
![]() |
6e520c4cdc | ||
![]() |
1e8683d72d | ||
![]() |
2df622fd14 | ||
![]() |
fede784fa2 | ||
![]() |
f191b143e9 | ||
![]() |
59212553b5 | ||
![]() |
e532b196cc | ||
![]() |
0f5232280c | ||
![]() |
38898ba4af | ||
![]() |
48f56d9600 | ||
![]() |
17bf5ac2fc | ||
![]() |
343b882d80 | ||
![]() |
db06d21339 | ||
![]() |
19240f08bb | ||
![]() |
d774730f83 | ||
![]() |
c2edf42567 | ||
![]() |
08f0e55b4f | ||
![]() |
deeb74b7e4 | ||
![]() |
0542002d7a | ||
![]() |
c1e307f585 | ||
![]() |
7b4ba43dcf | ||
![]() |
b0e4debaab | ||
![]() |
676597e961 | ||
![]() |
686d90745b | ||
![]() |
5dc02d53c3 | ||
![]() |
0598547b58 | ||
![]() |
67c7745f5d | ||
![]() |
a2c289646d | ||
![]() |
e6efecd054 | ||
![]() |
778b6a86c0 | ||
![]() |
e5babd086d | ||
![]() |
c212ebbdda | ||
![]() |
83b8de3d43 | ||
![]() |
e174d374f2 | ||
![]() |
4edb93508d | ||
![]() |
38c994b83b | ||
![]() |
1b8643d4c9 | ||
![]() |
d3c796f5b0 | ||
![]() |
83d8a6a450 | ||
![]() |
a21a77d230 | ||
![]() |
260b88c197 | ||
![]() |
655331a91b | ||
![]() |
09e569f83d | ||
![]() |
e4a4b562c4 | ||
![]() |
35b4a755f9 | ||
![]() |
5a4b43848a | ||
![]() |
d98869a088 | ||
![]() |
4d33cf739d | ||
![]() |
34e7daf989 | ||
![]() |
b0adcd6a46 | ||
![]() |
be285cde3f | ||
![]() |
0ff1faf7f2 | ||
![]() |
bcc62cc9e3 | ||
![]() |
97b466d409 | ||
![]() |
f17d9bba14 | ||
![]() |
d74725ce67 | ||
![]() |
3dad55d7a8 | ||
![]() |
598ffeea89 | ||
![]() |
83367f67de | ||
![]() |
15f2647d71 | ||
![]() |
6421d69bff | ||
![]() |
18081e30e1 | ||
![]() |
97181b5c0d | ||
![]() |
a63f9887b9 | ||
![]() |
1282aad4a5 | ||
![]() |
b8fad99f09 |
1183
CHANGES.2005
Normal file
1183
CHANGES.2005
Normal file
File diff suppressed because it is too large
Load Diff
6
CVS-INFO
6
CVS-INFO
@@ -53,12 +53,6 @@ installed:
|
||||
give you an older version of the file that isn't up-to-date. That file was
|
||||
checked in once and won't be updated very regularly.
|
||||
|
||||
o yacc/bison
|
||||
|
||||
If you don't have yacc or bison, you must rename the lib/getdate.c.cvs file
|
||||
to lib/getdate.c to be able to build libcurl. yacc/bison is normally used
|
||||
to generate the lib/getdate.c file from the lib/getdate.y source file.
|
||||
|
||||
MAC OS X
|
||||
|
||||
With Mac OS X 10.2 and the associated Developer Tools, the installed versions
|
||||
|
31
README
31
README
@@ -7,7 +7,7 @@
|
||||
README
|
||||
|
||||
Curl is a command line tool for transferring data specified with URL
|
||||
syntax. Find out how to use Curl by reading the curl.1 man page or the
|
||||
syntax. Find out how to use curl by reading the curl.1 man page or the
|
||||
MANUAL document. Find out how to install Curl by reading the INSTALL
|
||||
document.
|
||||
|
||||
@@ -33,34 +33,7 @@ WEB SITE
|
||||
Visit the curl web site or mirrors for the latest news and downloads:
|
||||
|
||||
Sweden http://curl.haxx.se/
|
||||
Australia http://curl.planetmirror.com/
|
||||
Austria http://curl.gds.tuwien.ac.at/
|
||||
Denmark http://curl.cofman.dk/
|
||||
France http://curl.fastmirror.net/
|
||||
Germany http://curl.freemirror.de/
|
||||
Germany http://curl.mirror-server.net/
|
||||
Germany http://curl.mirror.at.stealer.net/
|
||||
Germany http://curl.mirroring.de/
|
||||
Germany http://curl.miscellaneousmirror.org/
|
||||
Germany http://curl.mons-new-media.de/
|
||||
Germany http://curl.storemypix.com/
|
||||
Germany http://curl.triplemind.com/
|
||||
Hong Kong http://curl.hkmirror.org/
|
||||
Japan http://curl.s-lines.net/
|
||||
Netherlands http://curl.nedmirror.nl/
|
||||
Russia http://curl.tsuren.net/
|
||||
Taiwan http://curl.cs.pu.edu.tw/
|
||||
Thailand http://curl.siamu.ac.th/
|
||||
US (AZ) http://curl.islandofpoker.com/
|
||||
US (CA) http://curl.meulie.net/
|
||||
US (CA) http://curl.mirror.redwire.net/
|
||||
US (CA) http://curl.mirrormonster.com/
|
||||
US (CA) http://curl.signal42.com/
|
||||
US (FL) http://curl.hoxt.com/
|
||||
US (TX) http://curl.109k.com/
|
||||
US (TX) http://curl.hostingzero.com/
|
||||
US (TX) http://curl.mirrors.cyberservers.net/
|
||||
US (TX) http://curl.seekmeup.com/
|
||||
Mirrors http://curlm.haxx.se/
|
||||
|
||||
CVS
|
||||
|
||||
|
@@ -1,40 +1,57 @@
|
||||
Curl and libcurl 7.15.3
|
||||
Curl and libcurl 7.15.5
|
||||
|
||||
Public curl release number: 93
|
||||
Releases counted from the very beginning: 120
|
||||
Available command line options: 112
|
||||
Available curl_easy_setopt() options: 129
|
||||
Number of public functions in libcurl: 46
|
||||
Amount of public web site mirrors: 31
|
||||
Public curl release number: 95
|
||||
Releases counted from the very beginning: 122
|
||||
Available command line options: 114
|
||||
Available curl_easy_setopt() options: 133
|
||||
Number of public functions in libcurl: 54
|
||||
Amount of public web site mirrors: 33
|
||||
Number of known libcurl bindings: 32
|
||||
Number of contributors: 487
|
||||
Number of contributors: 506
|
||||
|
||||
This release includes the following changes:
|
||||
|
||||
o added docs for --ftp-method and CURLOPT_FTP_FILEMETHOD
|
||||
o added --ftp-ssl-reqd
|
||||
o modified the prototype for the socket callback set with
|
||||
CURLMOPT_SOCKETFUNCTION
|
||||
o added curl_multi_assign()
|
||||
o added CURLOPT_FTP_ALTERNATIVE_TO_USER and --ftp-alternative-to-user
|
||||
o added a vcproj file for building libcurl
|
||||
o added curl_formget()
|
||||
o added CURLOPT_MAX_SEND_SPEED_LARGE and CURLOPT_MAX_RECV_SPEED_LARGE
|
||||
o added configure --enable-hidden-symbols
|
||||
o Made -K on a file that couldn't be read cause a warning to be displayed
|
||||
|
||||
This release includes the following bugfixes:
|
||||
|
||||
o TFTP Packet Buffer Overflow Vulnerability:
|
||||
http://curl.haxx.se/docs/adv_20060320.html
|
||||
o properly detecting problems with sending the FTP command USER
|
||||
o wrong error message shown when certificate verification failed
|
||||
o multi-part formpost with multi interface crash
|
||||
o the CURLFTPSSL_CONTROL setting for CURLOPT_FTP_SSL is acknowledged
|
||||
o "SSL: couldn't set callback" is now treated as a less serious problem
|
||||
o Interix build fix
|
||||
o fixed curl "hang" when out of file handles at start
|
||||
o prevent FTP uploads to URLs with trailing slash
|
||||
o chunked encoding when custom header "Transfer-Encoding: chunked" is set
|
||||
o Curl_strerror() crash on unknown errors
|
||||
o changing Content-Type when doing formposts
|
||||
o added CURL_EXTERN to a few recent multi functions that lacked them
|
||||
o splay-tree related problems for internal expire time handling
|
||||
o FTP ASCII CRLF counter reset
|
||||
o cookie parser now compares paths case sensitive
|
||||
o an easy handle with shared DNS cache added to a multi handle caused a crash
|
||||
o couldn't override the Proxy-Connection: header for non-CONNECT requests
|
||||
o curl_multi_fdset() could wrongly return -1 as max_fd value
|
||||
|
||||
Other curl-related news since the previous public release:
|
||||
Other curl-related news:
|
||||
|
||||
o pycurl-7.15.2 has been released: http://pycurl.sf.net
|
||||
o http://curl.download.nextag.com/ is a new US curl web mirror!
|
||||
o yassl 1.3.7 can now be used with libcurl as an optional TLS library for
|
||||
HTTPS/FTPS support: http://www.yassl.com/
|
||||
o cURLpp 0.6.0 was released: http://rrette.com/curlpp.html
|
||||
o pycurl-7.15.4 was released: http://pycurl.sf.net
|
||||
|
||||
New curl mirrors:
|
||||
|
||||
o
|
||||
|
||||
This release would not have looked like this without help, code, reports and
|
||||
advice from friends like these:
|
||||
|
||||
Gisle Vanem, Dan Fandrich, Thomas Klausner, Todd Vierling, Peter Heuchert,
|
||||
Markus Koetter, David McCreedy, Tor Arntsen
|
||||
Dan Fandrich, Peter Silva, Arve Knudsen, Michael Wallner, Toshiyuki Maezawa,
|
||||
Ingmar Runge, Ates Goral, David McCreedy, Jari Sundell, Georg Horn,
|
||||
Gisle Vanem, Yang Tse, Michael Jerris, Dan Nelson, Yves Lejeune,
|
||||
Maciej Karpiuk, Mark Lentczner
|
||||
|
||||
Thanks! (and sorry if I forgot to mention someone)
|
||||
|
@@ -1,4 +1,5 @@
|
||||
To get fixed in 7.15.2 (planned release: Febrary 2006)
|
||||
To get fixed in 7.15.5 (planned release: August 2006)
|
||||
======================
|
||||
|
||||
65 -
|
||||
66 -
|
||||
|
||||
|
780
acinclude.m4
780
acinclude.m4
@@ -5,7 +5,7 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
#
|
||||
# This software is licensed as described in the file COPYING, which
|
||||
# you should have received as part of this distribution. The terms
|
||||
@@ -21,6 +21,7 @@
|
||||
# $Id$
|
||||
###########################################################################
|
||||
|
||||
|
||||
dnl CURL_CHECK_HEADER_WINDOWS
|
||||
dnl -------------------------------------------------
|
||||
dnl Check for compilable and valid windows.h header
|
||||
@@ -35,7 +36,11 @@ AC_DEFUN([CURL_CHECK_HEADER_WINDOWS], [
|
||||
#endif
|
||||
#include <windows.h>
|
||||
],[
|
||||
#ifdef __CYGWIN__
|
||||
HAVE_WINDOWS_H shall not be defined.
|
||||
#else
|
||||
int dummy=2*WINVER;
|
||||
#endif
|
||||
])
|
||||
],[
|
||||
ac_cv_header_windows_h="yes"
|
||||
@@ -43,12 +48,14 @@ AC_DEFUN([CURL_CHECK_HEADER_WINDOWS], [
|
||||
ac_cv_header_windows_h="no"
|
||||
])
|
||||
])
|
||||
if test "x$ac_cv_header_windows_h" = "xyes"; then
|
||||
case "$ac_cv_header_windows_h" in
|
||||
yes)
|
||||
AC_DEFINE_UNQUOTED(HAVE_WINDOWS_H, 1,
|
||||
[Define to 1 if you have the windows.h header file.])
|
||||
AC_DEFINE_UNQUOTED(WIN32_LEAN_AND_MEAN, 1,
|
||||
[Define to avoid automatic inclusion of winsock.h])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
|
||||
@@ -68,7 +75,11 @@ AC_DEFUN([CURL_CHECK_HEADER_WINSOCK], [
|
||||
#include <windows.h>
|
||||
#include <winsock.h>
|
||||
],[
|
||||
#ifdef __CYGWIN__
|
||||
HAVE_WINSOCK_H shall not be defined.
|
||||
#else
|
||||
int dummy=WSACleanup();
|
||||
#endif
|
||||
])
|
||||
],[
|
||||
ac_cv_header_winsock_h="yes"
|
||||
@@ -76,10 +87,12 @@ AC_DEFUN([CURL_CHECK_HEADER_WINSOCK], [
|
||||
ac_cv_header_winsock_h="no"
|
||||
])
|
||||
])
|
||||
if test "x$ac_cv_header_winsock_h" = "xyes"; then
|
||||
case "$ac_cv_header_winsock_h" in
|
||||
yes)
|
||||
AC_DEFINE_UNQUOTED(HAVE_WINSOCK_H, 1,
|
||||
[Define to 1 if you have the winsock.h header file.])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
|
||||
@@ -99,7 +112,11 @@ AC_DEFUN([CURL_CHECK_HEADER_WINSOCK2], [
|
||||
#include <windows.h>
|
||||
#include <winsock2.h>
|
||||
],[
|
||||
#ifdef __CYGWIN__
|
||||
HAVE_WINSOCK2_H shall not be defined.
|
||||
#else
|
||||
int dummy=2*IPPROTO_ESP;
|
||||
#endif
|
||||
])
|
||||
],[
|
||||
ac_cv_header_winsock2_h="yes"
|
||||
@@ -107,10 +124,12 @@ AC_DEFUN([CURL_CHECK_HEADER_WINSOCK2], [
|
||||
ac_cv_header_winsock2_h="no"
|
||||
])
|
||||
])
|
||||
if test "x$ac_cv_header_winsock2_h" = "xyes"; then
|
||||
case "$ac_cv_header_winsock2_h" in
|
||||
yes)
|
||||
AC_DEFINE_UNQUOTED(HAVE_WINSOCK2_H, 1,
|
||||
[Define to 1 if you have the winsock2.h header file.])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
|
||||
@@ -131,7 +150,11 @@ AC_DEFUN([CURL_CHECK_HEADER_WS2TCPIP], [
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
],[
|
||||
#ifdef __CYGWIN__
|
||||
HAVE_WS2TCPIP_H shall not be defined.
|
||||
#else
|
||||
int dummy=2*IP_PKTINFO;
|
||||
#endif
|
||||
])
|
||||
],[
|
||||
ac_cv_header_ws2tcpip_h="yes"
|
||||
@@ -139,9 +162,62 @@ AC_DEFUN([CURL_CHECK_HEADER_WS2TCPIP], [
|
||||
ac_cv_header_ws2tcpip_h="no"
|
||||
])
|
||||
])
|
||||
if test "x$ac_cv_header_ws2tcpip_h" = "xyes"; then
|
||||
case "$ac_cv_header_ws2tcpip_h" in
|
||||
yes)
|
||||
AC_DEFINE_UNQUOTED(HAVE_WS2TCPIP_H, 1,
|
||||
[Define to 1 if you have the ws2tcpip.h header file.])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_HEADER_MALLOC
|
||||
dnl -------------------------------------------------
|
||||
dnl Check for compilable and valid malloc.h header,
|
||||
dnl and check if it is needed even with stdlib.h
|
||||
|
||||
AC_DEFUN([CURL_CHECK_HEADER_MALLOC], [
|
||||
AC_CACHE_CHECK([for malloc.h], [ac_cv_header_malloc_h], [
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([
|
||||
#include <malloc.h>
|
||||
],[
|
||||
void *p = malloc(10);
|
||||
void *q = calloc(10,10);
|
||||
free(p);
|
||||
free(q);
|
||||
])
|
||||
],[
|
||||
ac_cv_header_malloc_h="yes"
|
||||
],[
|
||||
ac_cv_header_malloc_h="no"
|
||||
])
|
||||
])
|
||||
if test "$ac_cv_header_malloc_h" = "yes"; then
|
||||
AC_DEFINE_UNQUOTED(HAVE_MALLOC_H, 1,
|
||||
[Define to 1 if you have the malloc.h header file.])
|
||||
#
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([
|
||||
#include <stdlib.h>
|
||||
],[
|
||||
void *p = malloc(10);
|
||||
void *q = calloc(10,10);
|
||||
free(p);
|
||||
free(q);
|
||||
])
|
||||
],[
|
||||
curl_cv_need_header_malloc_h="no"
|
||||
],[
|
||||
curl_cv_need_header_malloc_h="yes"
|
||||
])
|
||||
#
|
||||
case "$curl_cv_need_header_malloc_h" in
|
||||
yes)
|
||||
AC_DEFINE_UNQUOTED(NEED_MALLOC_H, 1,
|
||||
[Define to 1 if you need the malloc.h header file even with stdlib.h])
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -194,12 +270,15 @@ AC_DEFUN([CURL_CHECK_TYPE_SOCKLEN_T], [
|
||||
done
|
||||
done
|
||||
])
|
||||
if test "$curl_cv_socklen_t_equiv" = "unknown"; then
|
||||
case "$curl_cv_socklen_t_equiv" in
|
||||
unknown)
|
||||
AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
|
||||
else
|
||||
;;
|
||||
*)
|
||||
AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv,
|
||||
[type to use in place of socklen_t if not defined])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
],[
|
||||
#undef inline
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
@@ -232,9 +311,9 @@ dnl and check the types of five of its arguments.
|
||||
dnl If the function succeeds HAVE_GETNAMEINFO will be
|
||||
dnl defined, defining the types of the arguments in
|
||||
dnl GETNAMEINFO_TYPE_ARG1, GETNAMEINFO_TYPE_ARG2,
|
||||
dnl GETNAMEINFO_TYPE_ARG46 and GETNAMEINFO_TYPE_ARG7.
|
||||
dnl This function is experimental and its results shall
|
||||
dnl not be trusted while this notice is in place ------
|
||||
dnl GETNAMEINFO_TYPE_ARG46 and GETNAMEINFO_TYPE_ARG7,
|
||||
dnl and also defining the type qualifier of first
|
||||
dnl argument in GETNAMEINFO_QUAL_ARG1.
|
||||
|
||||
AC_DEFUN([CURL_CHECK_FUNC_GETNAMEINFO], [
|
||||
AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl
|
||||
@@ -370,14 +449,50 @@ AC_DEFUN([CURL_CHECK_FUNC_GETNAMEINFO], [
|
||||
set dummy `echo "$curl_cv_func_getnameinfo_args" | sed 's/\*/\*/g'`
|
||||
IFS=$gni_prev_IFS
|
||||
shift
|
||||
AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG1, $[1],
|
||||
[Define to the type of arg 1 for getnameinfo.])
|
||||
#
|
||||
gni_qual_type_arg1=$[1]
|
||||
#
|
||||
AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG2, $[2],
|
||||
[Define to the type of arg 2 for getnameinfo.])
|
||||
AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG46, $[3],
|
||||
[Define to the type of args 4 and 6 for getnameinfo.])
|
||||
AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG7, $[4],
|
||||
[Define to the type of arg 7 for getnameinfo.])
|
||||
#
|
||||
prev_sh_opts=$-
|
||||
#
|
||||
case $prev_sh_opts in
|
||||
*f*)
|
||||
;;
|
||||
*)
|
||||
set -f
|
||||
;;
|
||||
esac
|
||||
#
|
||||
case "$gni_qual_type_arg1" in
|
||||
const*)
|
||||
gni_qual_arg1=const
|
||||
gni_type_arg1=`echo $gni_qual_type_arg1 | sed 's/^const //'`
|
||||
;;
|
||||
*)
|
||||
gni_qual_arg1=
|
||||
gni_type_arg1=$gni_qual_type_arg1
|
||||
;;
|
||||
esac
|
||||
#
|
||||
AC_DEFINE_UNQUOTED(GETNAMEINFO_QUAL_ARG1, $gni_qual_arg1,
|
||||
[Define to the type qualifier of arg 1 for getnameinfo.])
|
||||
AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG1, $gni_type_arg1,
|
||||
[Define to the type of arg 1 for getnameinfo.])
|
||||
#
|
||||
case $prev_sh_opts in
|
||||
*f*)
|
||||
;;
|
||||
*)
|
||||
set +f
|
||||
;;
|
||||
esac
|
||||
#
|
||||
AC_DEFINE_UNQUOTED(HAVE_GETNAMEINFO, 1,
|
||||
[Define to 1 if you have the getnameinfo function.])
|
||||
ac_cv_func_getnameinfo="yes"
|
||||
@@ -386,6 +501,481 @@ AC_DEFUN([CURL_CHECK_FUNC_GETNAMEINFO], [
|
||||
]) # AC_DEFUN
|
||||
|
||||
|
||||
dnl TYPE_SOCKADDR_STORAGE
|
||||
dnl -------------------------------------------------
|
||||
dnl Check for struct sockaddr_storage. Most IPv6-enabled
|
||||
dnl hosts have it, but AIX 4.3 is one known exception.
|
||||
|
||||
AC_DEFUN([TYPE_SOCKADDR_STORAGE],
|
||||
[
|
||||
AC_CHECK_TYPE([struct sockaddr_storage],
|
||||
AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1,
|
||||
[if struct sockaddr_storage is defined]), ,
|
||||
[
|
||||
#undef inline
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
#else
|
||||
#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
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#endif
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_NI_WITHSCOPEID
|
||||
dnl -------------------------------------------------
|
||||
dnl Check for working NI_WITHSCOPEID in getnameinfo()
|
||||
|
||||
AC_DEFUN([CURL_CHECK_NI_WITHSCOPEID], [
|
||||
AC_REQUIRE([CURL_CHECK_FUNC_GETNAMEINFO])dnl
|
||||
AC_REQUIRE([TYPE_SOCKADDR_STORAGE])dnl
|
||||
AC_CHECK_HEADERS(stdio.h sys/types.h sys/socket.h \
|
||||
netdb.h netinet/in.h arpa/inet.h)
|
||||
#
|
||||
AC_CACHE_CHECK([for working NI_WITHSCOPEID],
|
||||
[ac_cv_working_ni_withscopeid], [
|
||||
AC_RUN_IFELSE([
|
||||
AC_LANG_PROGRAM([
|
||||
#ifdef HAVE_STDIO_H
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
],[
|
||||
#if defined(NI_WITHSCOPEID) && defined(HAVE_GETNAMEINFO)
|
||||
#ifdef HAVE_STRUCT_SOCKADDR_STORAGE
|
||||
struct sockaddr_storage sa;
|
||||
#else
|
||||
unsigned char sa[256];
|
||||
#endif
|
||||
char hostbuf[NI_MAXHOST];
|
||||
int rc;
|
||||
GETNAMEINFO_TYPE_ARG2 salen = (GETNAMEINFO_TYPE_ARG2)sizeof(sa);
|
||||
GETNAMEINFO_TYPE_ARG46 hostlen = (GETNAMEINFO_TYPE_ARG46)sizeof(hostbuf);
|
||||
GETNAMEINFO_TYPE_ARG7 flags = NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID;
|
||||
int fd = socket(AF_INET6, SOCK_STREAM, 0);
|
||||
if(fd < 0) {
|
||||
perror("socket()");
|
||||
return 1; /* Error creating socket */
|
||||
}
|
||||
rc = getsockname(fd, (GETNAMEINFO_TYPE_ARG1)&sa, &salen);
|
||||
if(rc) {
|
||||
perror("getsockname()");
|
||||
return 2; /* Error retrieving socket name */
|
||||
}
|
||||
rc = getnameinfo((GETNAMEINFO_TYPE_ARG1)&sa, salen, hostbuf, hostlen, NULL, 0, flags);
|
||||
if(rc) {
|
||||
printf("rc = %s\n", gai_strerror(rc));
|
||||
return 3; /* Error translating socket address */
|
||||
}
|
||||
return 0; /* Ok, NI_WITHSCOPEID works */
|
||||
#else
|
||||
return 4; /* Error, NI_WITHSCOPEID not defined or no getnameinfo() */
|
||||
#endif
|
||||
]) # AC_LANG_PROGRAM
|
||||
],[
|
||||
# Exit code == 0. Program worked.
|
||||
ac_cv_working_ni_withscopeid="yes"
|
||||
],[
|
||||
# Exit code != 0. Program failed.
|
||||
ac_cv_working_ni_withscopeid="no"
|
||||
],[
|
||||
# Program is not run when cross-compiling. So we assume
|
||||
# NI_WITHSCOPEID will work if we are able to compile it.
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
],[
|
||||
unsigned int dummy= NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID;
|
||||
])
|
||||
],[
|
||||
ac_cv_working_ni_withscopeid="yes"
|
||||
],[
|
||||
ac_cv_working_ni_withscopeid="no"
|
||||
]) # AC_COMPILE_IFELSE
|
||||
]) # AC_RUN_IFELSE
|
||||
]) # AC_CACHE_CHECK
|
||||
case "$ac_cv_working_ni_withscopeid" in
|
||||
yes)
|
||||
AC_DEFINE(HAVE_NI_WITHSCOPEID, 1,
|
||||
[Define to 1 if NI_WITHSCOPEID exists and works.])
|
||||
;;
|
||||
esac
|
||||
]) # AC_DEFUN
|
||||
|
||||
|
||||
dnl CURL_CHECK_FUNC_RECV
|
||||
dnl -------------------------------------------------
|
||||
dnl Test if the socket recv() function is available,
|
||||
dnl and check its return type and the types of its
|
||||
dnl arguments. If the function succeeds HAVE_RECV
|
||||
dnl will be defined, defining the types of the arguments
|
||||
dnl in RECV_TYPE_ARG1, RECV_TYPE_ARG2, RECV_TYPE_ARG3
|
||||
dnl and RECV_TYPE_ARG4, defining the type of the function
|
||||
dnl return value in RECV_TYPE_RETV.
|
||||
|
||||
AC_DEFUN([CURL_CHECK_FUNC_RECV], [
|
||||
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl
|
||||
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
|
||||
AC_CHECK_HEADERS(sys/types.h sys/socket.h)
|
||||
#
|
||||
AC_MSG_CHECKING([for recv])
|
||||
AC_TRY_LINK([
|
||||
#undef inline
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#ifdef HAVE_WINSOCK_H
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#endif
|
||||
],[
|
||||
recv(0, 0, 0, 0);
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
curl_cv_recv="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
curl_cv_recv="no"
|
||||
])
|
||||
#
|
||||
if test "$curl_cv_recv" = "yes"; then
|
||||
AC_CACHE_CHECK([types of arguments and return type for recv],
|
||||
[curl_cv_func_recv_args], [
|
||||
curl_cv_func_recv_args="unknown"
|
||||
for recv_retv in 'int' 'ssize_t'; do
|
||||
for recv_arg1 in 'int' 'ssize_t' 'SOCKET'; do
|
||||
for recv_arg2 in 'char *' 'void *'; do
|
||||
for recv_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do
|
||||
for recv_arg4 in 'int' 'unsigned int'; do
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([
|
||||
#undef inline
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#ifdef HAVE_WINSOCK_H
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
#endif
|
||||
#define RECVCALLCONV PASCAL
|
||||
#else
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#define RECVCALLCONV
|
||||
#endif
|
||||
extern $recv_retv RECVCALLCONV recv($recv_arg1, $recv_arg2, $recv_arg3, $recv_arg4);
|
||||
],[
|
||||
$recv_arg1 s=0;
|
||||
$recv_arg2 buf=0;
|
||||
$recv_arg3 len=0;
|
||||
$recv_arg4 flags=0;
|
||||
$recv_retv res = recv(s, buf, len, flags);
|
||||
])
|
||||
],[
|
||||
curl_cv_func_recv_args="$recv_arg1,$recv_arg2,$recv_arg3,$recv_arg4,$recv_retv"
|
||||
break 5
|
||||
])
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
]) # AC_CACHE_CHECK
|
||||
if test "$curl_cv_func_recv_args" = "unknown"; then
|
||||
AC_MSG_ERROR([Cannot find proper types to use for recv args])
|
||||
else
|
||||
recv_prev_IFS=$IFS; IFS=','
|
||||
set dummy `echo "$curl_cv_func_recv_args" | sed 's/\*/\*/g'`
|
||||
IFS=$recv_prev_IFS
|
||||
shift
|
||||
#
|
||||
AC_DEFINE_UNQUOTED(RECV_TYPE_ARG1, $[1],
|
||||
[Define to the type of arg 1 for recv.])
|
||||
AC_DEFINE_UNQUOTED(RECV_TYPE_ARG2, $[2],
|
||||
[Define to the type of arg 2 for recv.])
|
||||
AC_DEFINE_UNQUOTED(RECV_TYPE_ARG3, $[3],
|
||||
[Define to the type of arg 3 for recv.])
|
||||
AC_DEFINE_UNQUOTED(RECV_TYPE_ARG4, $[4],
|
||||
[Define to the type of arg 4 for recv.])
|
||||
AC_DEFINE_UNQUOTED(RECV_TYPE_RETV, $[5],
|
||||
[Define to the function return type for recv.])
|
||||
#
|
||||
AC_DEFINE_UNQUOTED(HAVE_RECV, 1,
|
||||
[Define to 1 if you have the recv function.])
|
||||
ac_cv_func_recv="yes"
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR([Unable to link function recv])
|
||||
fi
|
||||
]) # AC_DEFUN
|
||||
|
||||
|
||||
dnl CURL_CHECK_FUNC_SEND
|
||||
dnl -------------------------------------------------
|
||||
dnl Test if the socket send() function is available,
|
||||
dnl and check its return type and the types of its
|
||||
dnl arguments. If the function succeeds HAVE_SEND
|
||||
dnl will be defined, defining the types of the arguments
|
||||
dnl in SEND_TYPE_ARG1, SEND_TYPE_ARG2, SEND_TYPE_ARG3
|
||||
dnl and SEND_TYPE_ARG4, defining the type of the function
|
||||
dnl return value in SEND_TYPE_RETV, and also defining the
|
||||
dnl type qualifier of second argument in SEND_QUAL_ARG2.
|
||||
|
||||
AC_DEFUN([CURL_CHECK_FUNC_SEND], [
|
||||
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl
|
||||
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
|
||||
AC_CHECK_HEADERS(sys/types.h sys/socket.h)
|
||||
#
|
||||
AC_MSG_CHECKING([for send])
|
||||
AC_TRY_LINK([
|
||||
#undef inline
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#ifdef HAVE_WINSOCK_H
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#endif
|
||||
],[
|
||||
send(0, 0, 0, 0);
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
curl_cv_send="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
curl_cv_send="no"
|
||||
])
|
||||
#
|
||||
if test "$curl_cv_send" = "yes"; then
|
||||
AC_CACHE_CHECK([types of arguments and return type for send],
|
||||
[curl_cv_func_send_args], [
|
||||
curl_cv_func_send_args="unknown"
|
||||
for send_retv in 'int' 'ssize_t'; do
|
||||
for send_arg1 in 'int' 'ssize_t' 'SOCKET'; do
|
||||
for send_arg2 in 'char *' 'void *' 'const char *' 'const void *'; do
|
||||
for send_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do
|
||||
for send_arg4 in 'int' 'unsigned int'; do
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([
|
||||
#undef inline
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#ifdef HAVE_WINSOCK_H
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
#endif
|
||||
#define SENDCALLCONV PASCAL
|
||||
#else
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#define SENDCALLCONV
|
||||
#endif
|
||||
extern $send_retv SENDCALLCONV send($send_arg1, $send_arg2, $send_arg3, $send_arg4);
|
||||
],[
|
||||
$send_arg1 s=0;
|
||||
$send_arg3 len=0;
|
||||
$send_arg4 flags=0;
|
||||
$send_retv res = send(s, 0, len, flags);
|
||||
])
|
||||
],[
|
||||
curl_cv_func_send_args="$send_arg1,$send_arg2,$send_arg3,$send_arg4,$send_retv"
|
||||
break 5
|
||||
])
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
]) # AC_CACHE_CHECK
|
||||
if test "$curl_cv_func_send_args" = "unknown"; then
|
||||
AC_MSG_ERROR([Cannot find proper types to use for send args])
|
||||
else
|
||||
send_prev_IFS=$IFS; IFS=','
|
||||
set dummy `echo "$curl_cv_func_send_args" | sed 's/\*/\*/g'`
|
||||
IFS=$send_prev_IFS
|
||||
shift
|
||||
#
|
||||
send_qual_type_arg2=$[2]
|
||||
#
|
||||
AC_DEFINE_UNQUOTED(SEND_TYPE_ARG1, $[1],
|
||||
[Define to the type of arg 1 for send.])
|
||||
AC_DEFINE_UNQUOTED(SEND_TYPE_ARG3, $[3],
|
||||
[Define to the type of arg 3 for send.])
|
||||
AC_DEFINE_UNQUOTED(SEND_TYPE_ARG4, $[4],
|
||||
[Define to the type of arg 4 for send.])
|
||||
AC_DEFINE_UNQUOTED(SEND_TYPE_RETV, $[5],
|
||||
[Define to the function return type for send.])
|
||||
#
|
||||
prev_sh_opts=$-
|
||||
#
|
||||
case $prev_sh_opts in
|
||||
*f*)
|
||||
;;
|
||||
*)
|
||||
set -f
|
||||
;;
|
||||
esac
|
||||
#
|
||||
case "$send_qual_type_arg2" in
|
||||
const*)
|
||||
send_qual_arg2=const
|
||||
send_type_arg2=`echo $send_qual_type_arg2 | sed 's/^const //'`
|
||||
;;
|
||||
*)
|
||||
send_qual_arg2=
|
||||
send_type_arg2=$send_qual_type_arg2
|
||||
;;
|
||||
esac
|
||||
#
|
||||
AC_DEFINE_UNQUOTED(SEND_QUAL_ARG2, $send_qual_arg2,
|
||||
[Define to the type qualifier of arg 2 for send.])
|
||||
AC_DEFINE_UNQUOTED(SEND_TYPE_ARG2, $send_type_arg2,
|
||||
[Define to the type of arg 2 for send.])
|
||||
#
|
||||
case $prev_sh_opts in
|
||||
*f*)
|
||||
;;
|
||||
*)
|
||||
set +f
|
||||
;;
|
||||
esac
|
||||
#
|
||||
AC_DEFINE_UNQUOTED(HAVE_SEND, 1,
|
||||
[Define to 1 if you have the send function.])
|
||||
ac_cv_func_send="yes"
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR([Unable to link function send])
|
||||
fi
|
||||
]) # AC_DEFUN
|
||||
|
||||
|
||||
dnl CURL_CHECK_MSG_NOSIGNAL
|
||||
dnl -------------------------------------------------
|
||||
dnl Check for MSG_NOSIGNAL
|
||||
|
||||
AC_DEFUN([CURL_CHECK_MSG_NOSIGNAL], [
|
||||
AC_CHECK_HEADERS(sys/types.h sys/socket.h)
|
||||
AC_CACHE_CHECK([for MSG_NOSIGNAL], [ac_cv_msg_nosignal], [
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([
|
||||
#undef inline
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#ifdef HAVE_WINSOCK_H
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#endif
|
||||
],[
|
||||
int flag=MSG_NOSIGNAL;
|
||||
])
|
||||
],[
|
||||
ac_cv_msg_nosignal="yes"
|
||||
],[
|
||||
ac_cv_msg_nosignal="no"
|
||||
])
|
||||
])
|
||||
case "$ac_cv_msg_nosignal" in
|
||||
yes)
|
||||
AC_DEFINE_UNQUOTED(HAVE_MSG_NOSIGNAL, 1,
|
||||
[Define to 1 if you have the MSG_NOSIGNAL flag.])
|
||||
;;
|
||||
esac
|
||||
]) # AC_DEFUN
|
||||
|
||||
|
||||
dnl CURL_CHECK_NONBLOCKING_SOCKET
|
||||
dnl -------------------------------------------------
|
||||
dnl Check for how to set a socket to non-blocking state. There seems to exist
|
||||
@@ -528,43 +1118,6 @@ dnl end of non-blocking try-compile test
|
||||
])
|
||||
|
||||
|
||||
dnl TYPE_SOCKADDR_STORAGE
|
||||
dnl -------------------------------------------------
|
||||
dnl Check for struct sockaddr_storage. Most IPv6-enabled hosts have it, but
|
||||
dnl AIX 4.3 is one known exception.
|
||||
AC_DEFUN([TYPE_SOCKADDR_STORAGE],
|
||||
[
|
||||
AC_CHECK_TYPE([struct sockaddr_storage],
|
||||
AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1,
|
||||
[if struct sockaddr_storage is defined]), ,
|
||||
[
|
||||
#undef inline
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
#else
|
||||
#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
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#endif
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
dnl TYPE_IN_ADDR_T
|
||||
dnl -------------------------------------------------
|
||||
dnl Check for in_addr_t: it is used to receive the return code of inet_addr()
|
||||
@@ -717,84 +1270,6 @@ if test "$ac_cv_working_getaddrinfo" = "yes"; then
|
||||
fi
|
||||
])
|
||||
|
||||
dnl ************************************************************
|
||||
dnl check for working NI_WITHSCOPEID in getnameinfo()
|
||||
dnl
|
||||
AC_DEFUN([CURL_CHECK_NI_WITHSCOPEID],[
|
||||
AC_CACHE_CHECK(for working NI_WITHSCOPEID, ac_cv_working_ni_withscopeid,[
|
||||
|
||||
AC_RUN_IFELSE([[
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
int main()
|
||||
{
|
||||
#ifdef NI_WITHSCOPEID
|
||||
struct sockaddr_storage ss;
|
||||
int sslen = sizeof(ss);
|
||||
int rc;
|
||||
char hbuf[NI_MAXHOST];
|
||||
int fd = socket(AF_INET6, SOCK_STREAM, 0);
|
||||
if(fd < 0) {
|
||||
perror("socket()");
|
||||
return 1; /* couldn't create socket of either kind */
|
||||
}
|
||||
|
||||
rc = getsockname(fd, (struct sockaddr *)&ss, &sslen);
|
||||
if(rc) {
|
||||
perror("getsockname()");
|
||||
return 2;
|
||||
}
|
||||
|
||||
rc = getnameinfo((struct sockaddr *)&ss, sslen, hbuf, sizeof(hbuf),
|
||||
NULL, 0,
|
||||
NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID);
|
||||
|
||||
if(rc) {
|
||||
printf("rc = %s\n", gai_strerror(rc));
|
||||
return 3;
|
||||
}
|
||||
|
||||
return 0; /* everything works fine, use NI_WITHSCOPEID! */
|
||||
#else
|
||||
return 4; /* we don't seem to have the definition, don't use it */
|
||||
#endif
|
||||
}
|
||||
]],
|
||||
dnl program worked:
|
||||
[ ac_cv_working_ni_withscopeid="yes" ],
|
||||
dnl program failed:
|
||||
[ ac_cv_working_ni_withscopeid="no" ],
|
||||
dnl we cross-compile, check the headers using the preprocessor
|
||||
[
|
||||
|
||||
AC_EGREP_CPP(WORKS,
|
||||
[
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
|
||||
#ifdef NI_WITHSCOPEID
|
||||
WORKS
|
||||
#endif
|
||||
],
|
||||
ac_cv_working_ni_withscopeid="yes",
|
||||
ac_cv_working_ni_withscopeid="no" )
|
||||
|
||||
]
|
||||
) dnl end of AC_RUN_IFELSE
|
||||
|
||||
]) dnl end of AC_CACHE_CHECK
|
||||
|
||||
if test "$ac_cv_working_ni_withscopeid" = "yes"; then
|
||||
AC_DEFINE(HAVE_NI_WITHSCOPEID, 1,
|
||||
[Define if NI_WITHSCOPEID exists and works])
|
||||
fi
|
||||
|
||||
]) dnl end of AC_DEFUN
|
||||
|
||||
|
||||
AC_DEFUN([CURL_CHECK_LOCALTIME_R],
|
||||
[
|
||||
@@ -1105,12 +1580,44 @@ 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!
|
||||
@@ -1121,17 +1628,6 @@ AC_DEFUN([CURL_CC_DEBUG_OPTS],
|
||||
gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
|
||||
AC_MSG_RESULT($gccver)
|
||||
|
||||
AC_MSG_CHECKING([if this is icc 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"
|
||||
AC_MSG_RESULT([no]),
|
||||
dnl the text was not found, it was replaced by the cpp
|
||||
ICC="yes"
|
||||
AC_MSG_RESULT([yes])
|
||||
)
|
||||
|
||||
if test "$ICC" = "yes"; then
|
||||
dnl this is icc, not gcc.
|
||||
|
||||
|
@@ -12,3 +12,5 @@ Gisle Vanem
|
||||
Gunter Knauf
|
||||
Henrik Stoerner
|
||||
Yang Tse
|
||||
Nick Mathewson
|
||||
Alexander Lazic
|
||||
|
47
ares/CHANGES
47
ares/CHANGES
@@ -1,5 +1,46 @@
|
||||
Changelog for the c-ares project
|
||||
|
||||
* August 3 2006
|
||||
|
||||
- Ravi Pratap fixed ares_getsock() to actually return the proper bitmap and
|
||||
not always zero!
|
||||
|
||||
Version 1.3.1 (June 24, 2006)
|
||||
|
||||
* July 23, 2006
|
||||
|
||||
- Gisle Vanem added getopt() to the ahost program. Currently accepts
|
||||
only [-t {a|aaaa}] to specify address family in ares_gethostbyname().
|
||||
|
||||
* June 19, 2006
|
||||
|
||||
- (wahern) Removed "big endian" DNS section and RR data integer parser
|
||||
macros from ares_dns.h, which break c-ares on my Sparc64. Bit-wise
|
||||
operations in C operate on logical values. And in any event the octets are
|
||||
already in big-endian (aka network) byte order so they're being reversed
|
||||
(thus the source of the breakage).
|
||||
|
||||
* June 18, 2006
|
||||
|
||||
- William Ahern handles EAGAIN/EWOULDBLOCK errors in most of the I/O calls
|
||||
from area_process.c.
|
||||
|
||||
TODO: Handle one last EAGAIN for a UDP socket send(2) in
|
||||
ares__send_query().
|
||||
|
||||
* May 10, 2006
|
||||
|
||||
- Bram Matthys brought my attention to a libtool peculiarity where detecting
|
||||
things such as C++ compiler actually is a bad thing and since we don't need
|
||||
that detection I added a work-around, much inspired by a previous patch by
|
||||
Paolo Bonzini. This also shortens the configure script quite a lot.
|
||||
|
||||
* May 3, 2006
|
||||
|
||||
- Nick Mathewson added the ARES_OPT_SOCK_STATE_CB option that when set makes
|
||||
c-ares call a callback on socket state changes. A better way than the
|
||||
ares_getsock() to get full control over the socket state.
|
||||
|
||||
* January 9, 2006
|
||||
|
||||
- Alexander Lazic improved the getservbyport_r() configure check.
|
||||
@@ -28,15 +69,15 @@
|
||||
|
||||
- Added constants that will be used by ares_getaddrinfo
|
||||
|
||||
- Made ares_getnameinfo use the reentrant getservbyport (getservbyport_r) if it is
|
||||
available to ensure it works properly in a threaded environment.
|
||||
- Made ares_getnameinfo use the reentrant getservbyport (getservbyport_r) if it
|
||||
is available to ensure it works properly in a threaded environment.
|
||||
|
||||
* September 10
|
||||
|
||||
- configure fix for detecting a member in the sockaddr_in6 struct which failed
|
||||
on ipv6-enabled HP-UX 11.00
|
||||
|
||||
Version 1.3.0 (August 29, 2004)
|
||||
Version 1.3.0 (August 29, 2005)
|
||||
|
||||
* August 21
|
||||
|
||||
|
@@ -11,7 +11,7 @@ MSVCFILES = vc/adig/adig.dep vc/adig/adig.dsp vc/vc.dsw vc/ahost/ahost.dep \
|
||||
# adig and ahost are just sample programs and thus not mentioned with the
|
||||
# regular sources and headers
|
||||
EXTRA_DIST = CHANGES README.cares Makefile.inc adig.c ahost.c $(man_MANS) \
|
||||
$(MSVCFILES) AUTHORS
|
||||
$(MSVCFILES) AUTHORS config-win32.h
|
||||
|
||||
|
||||
VER=-version-info 1:0:0
|
||||
@@ -43,7 +43,13 @@ VER=-version-info 1:0:0
|
||||
# set age to 0. (c:r:a=0)
|
||||
#
|
||||
|
||||
libcares_la_LDFLAGS = $(VER)
|
||||
if NO_UNDEFINED
|
||||
# The -no-undefined flag is crucial for this to build fine on some platforms
|
||||
UNDEF = -no-undefined
|
||||
endif
|
||||
|
||||
|
||||
libcares_la_LDFLAGS = $(UNDEF) $(VER)
|
||||
|
||||
# Makefile.inc provides the CSOURCES and HHEADERS defines
|
||||
include Makefile.inc
|
||||
|
@@ -8,7 +8,8 @@ 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
|
||||
|
||||
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
|
||||
nameser.h inet_net_pton.h inet_ntop.h ares_ipv6.h bitncmp.h \
|
||||
setup_once.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 \
|
||||
|
@@ -20,7 +20,7 @@ endif
|
||||
TARGETS = adig.nlm ahost.nlm
|
||||
LTARGET = libcares.lib
|
||||
VERSION = $(LIBCARES_VERSION)
|
||||
COPYR = Copyright (C) 1996 - 2005, Daniel Stenberg, <daniel@haxx.se>
|
||||
COPYR = Copyright (C) 1996 - 2006, Daniel Stenberg, <daniel@haxx.se>
|
||||
DESCR = cURL $(subst .def,,$(notdir $@)) $(LIBCARES_VERSION_STR) - http://curl.haxx.se
|
||||
MTSAFE = YES
|
||||
STACK = 64000
|
||||
@@ -88,7 +88,7 @@ LD = nlmconv
|
||||
LDFLAGS = -T
|
||||
AR = ar
|
||||
ARFLAGS = -cq
|
||||
CFLAGS += -fno-builtin -fpack-struct -fpcc-struct-return -fno-strict-aliasing
|
||||
CFLAGS += -fno-builtin -fpcc-struct-return -fno-strict-aliasing
|
||||
CFLAGS += -Wall -Wno-format -Wno-uninitialized # -pedantic
|
||||
ifeq ($(LIBARCH),LIBC)
|
||||
PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
|
||||
@@ -256,8 +256,8 @@ config.h: Makefile.netware
|
||||
@echo $(DL)** All your changes will be lost!!$(DL) >> $@
|
||||
@echo $(DL)*/$(DL) >> $@
|
||||
@echo $(DL)#define OS "i586-pc-NetWare"$(DL) >> $@
|
||||
@echo $(DL)#define VERSION "$(LIBCURL_VERSION_STR)"$(DL) >> $@
|
||||
@echo $(DL)#define PACKAGE_BUGREPORT "curl-bug@haxx.se"$(DL) >> $@
|
||||
@echo $(DL)#define VERSION "$(LIBCARES_VERSION_STR)"$(DL) >> $@
|
||||
@echo $(DL)#define PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/"$(DL) >> $@
|
||||
@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) >> $@
|
||||
@@ -276,7 +276,9 @@ config.h: Makefile.netware
|
||||
@echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_RECV 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SELECT 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SEND 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SIGNAL 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SOCKET 1$(DL) >> $@
|
||||
@@ -297,7 +299,18 @@ config.h: Makefile.netware
|
||||
@echo $(DL)#define HAVE_TIME_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_UNAME 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_UNISTD_H 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) >> $@
|
||||
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
|
||||
@echo $(DL)#define RECV_TYPE_RETV int$(DL) >> $@
|
||||
@echo $(DL)#define RETSIGTYPE void$(DL) >> $@
|
||||
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
|
||||
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
|
||||
@echo $(DL)#define SEND_TYPE_ARG2 char *$(DL) >> $@
|
||||
@echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@
|
||||
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
|
||||
@echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@
|
||||
@echo $(DL)#define SIZEOF_CURL_OFF_T 4$(DL) >> $@
|
||||
@echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
|
||||
@echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@
|
||||
|
@@ -140,51 +140,58 @@ vclean realclean: clean
|
||||
#
|
||||
# Copyright "gcc -MM .."
|
||||
#
|
||||
$(OBJ_DIR)\ares_fds.obj: ares_fds.c setup.h ares.h ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares_process.obj: ares_process.c setup.h nameser.h ares.h ares_dns.h \
|
||||
ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares_free_hostent.obj: ares_free_hostent.c setup.h ares.h ares_private.h \
|
||||
$(OBJ_DIR)\ares_fds.obj: ares_fds.c setup.h setup_once.h ares.h ares_private.h \
|
||||
ares_ipv6.h
|
||||
$(OBJ_DIR)\ares_query.obj: ares_query.c setup.h nameser.h ares.h ares_dns.h \
|
||||
$(OBJ_DIR)\ares_process.obj: ares_process.c setup.h setup_once.h nameser.h \
|
||||
ares.h ares_dns.h ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares_free_hostent.obj: ares_free_hostent.c setup.h setup_once.h \
|
||||
ares.h ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares_query.obj: ares_query.c setup.h setup_once.h nameser.h \
|
||||
ares.h ares_dns.h ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares__close_sockets.obj: ares__close_sockets.c setup.h setup_once.h \
|
||||
ares.h ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares_free_string.obj: ares_free_string.c setup.h setup_once.h ares.h
|
||||
$(OBJ_DIR)\ares_search.obj: ares_search.c setup.h setup_once.h nameser.h \
|
||||
ares.h ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares__get_hostent.obj: ares__get_hostent.c setup.h setup_once.h \
|
||||
ares.h ares_private.h ares_ipv6.h inet_net_pton.h
|
||||
$(OBJ_DIR)\ares_gethostbyaddr.obj: ares_gethostbyaddr.c setup.h setup_once.h \
|
||||
nameser.h ares.h ares_private.h ares_ipv6.h inet_net_pton.h
|
||||
$(OBJ_DIR)\ares_send.obj: ares_send.c setup.h setup_once.h nameser.h ares.h \
|
||||
ares_dns.h ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares__read_line.obj: ares__read_line.c setup.h setup_once.h ares.h \
|
||||
ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares__close_sockets.obj: ares__close_sockets.c setup.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_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 \
|
||||
ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares_free_string.obj: ares_free_string.c setup.h ares.h
|
||||
$(OBJ_DIR)\ares_search.obj: ares_search.c setup.h nameser.h ares.h ares_private.h \
|
||||
ares_ipv6.h
|
||||
$(OBJ_DIR)\ares__get_hostent.obj: ares__get_hostent.c setup.h ares.h ares_private.h \
|
||||
ares_ipv6.h inet_net_pton.h
|
||||
$(OBJ_DIR)\ares_gethostbyaddr.obj: ares_gethostbyaddr.c setup.h nameser.h ares.h \
|
||||
$(OBJ_DIR)\ares_init.obj: ares_init.c setup.h setup_once.h nameser.h ares.h \
|
||||
ares_private.h ares_ipv6.h inet_net_pton.h
|
||||
$(OBJ_DIR)\ares_send.obj: ares_send.c setup.h nameser.h ares.h ares_dns.h \
|
||||
$(OBJ_DIR)\ares_timeout.obj: ares_timeout.c setup.h setup_once.h ares.h \
|
||||
ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares__read_line.obj: ares__read_line.c setup.h ares.h ares_private.h \
|
||||
$(OBJ_DIR)\ares_destroy.obj: ares_destroy.c setup.h setup_once.h ares.h \
|
||||
ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares_mkquery.obj: ares_mkquery.c setup.h setup_once.h nameser.h \
|
||||
ares.h ares_dns.h
|
||||
$(OBJ_DIR)\ares_version.obj: ares_version.c setup.h setup_once.h ares_version.h
|
||||
$(OBJ_DIR)\ares_expand_name.obj: ares_expand_name.c setup.h setup_once.h \
|
||||
nameser.h ares.h ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares_parse_a_reply.obj: ares_parse_a_reply.c setup.h setup_once.h \
|
||||
nameser.h ares.h ares_dns.h ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\windows_port.obj: windows_port.c setup.h setup_once.h nameser.h \
|
||||
ares.h ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares_expand_string.obj: ares_expand_string.c setup.h setup_once.h \
|
||||
nameser.h ares.h ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares_parse_ptr_reply.obj: ares_parse_ptr_reply.c setup.h \
|
||||
setup_once.h nameser.h ares.h ares_dns.h ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares_parse_aaaa_reply.obj: ares_parse_aaaa_reply.c setup.h \
|
||||
setup_once.h nameser.h ares.h ares_dns.h inet_net_pton.h ares_private.h \
|
||||
ares_ipv6.h
|
||||
$(OBJ_DIR)\ares_gethostbyname.obj: ares_gethostbyname.c setup.h nameser.h ares.h \
|
||||
ares_private.h ares_ipv6.h inet_net_pton.h bitncmp.h
|
||||
$(OBJ_DIR)\ares_strerror.obj: ares_strerror.c setup.h ares.h
|
||||
$(OBJ_DIR)\ares_cancel.obj: ares_cancel.c setup.h ares.h ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares_init.obj: ares_init.c setup.h nameser.h ares.h ares_private.h \
|
||||
$(OBJ_DIR)\ares_getnameinfo.obj: ares_getnameinfo.c setup.h setup_once.h \
|
||||
nameser.h ares.h ares_private.h ares_ipv6.h inet_ntop.h
|
||||
$(OBJ_DIR)\inet_net_pton.obj: inet_net_pton.c setup.h setup_once.h nameser.h \
|
||||
ares_ipv6.h inet_net_pton.h
|
||||
$(OBJ_DIR)\ares_timeout.obj: ares_timeout.c setup.h ares.h ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares_destroy.obj: ares_destroy.c setup.h ares.h ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares_mkquery.obj: ares_mkquery.c setup.h nameser.h ares.h ares_dns.h
|
||||
$(OBJ_DIR)\ares_version.obj: ares_version.c setup.h ares_version.h
|
||||
$(OBJ_DIR)\ares_expand_name.obj: ares_expand_name.c setup.h nameser.h ares.h \
|
||||
ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares_parse_a_reply.obj: ares_parse_a_reply.c setup.h nameser.h ares.h \
|
||||
ares_dns.h ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\windows_port.obj: windows_port.c setup.h nameser.h ares.h ares_private.h \
|
||||
ares_ipv6.h
|
||||
$(OBJ_DIR)\ares_expand_string.obj: ares_expand_string.c setup.h nameser.h ares.h \
|
||||
ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares_parse_ptr_reply.obj: ares_parse_ptr_reply.c setup.h nameser.h ares.h \
|
||||
ares_dns.h ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares_parse_aaaa_reply.obj: ares_parse_aaaa_reply.c setup.h nameser.h ares.h \
|
||||
ares_dns.h inet_net_pton.h ares_private.h ares_ipv6.h
|
||||
$(OBJ_DIR)\ares_getnameinfo.obj: ares_getnameinfo.c setup.h nameser.h ares.h \
|
||||
ares_private.h ares_ipv6.h inet_ntop.h
|
||||
$(OBJ_DIR)\inet_net_pton.obj: inet_net_pton.c setup.h nameser.h ares_ipv6.h \
|
||||
inet_net_pton.h
|
||||
$(OBJ_DIR)\bitncmp.obj: bitncmp.c bitncmp.h
|
||||
$(OBJ_DIR)\inet_ntop.obj: inet_ntop.c setup.h nameser.h ares_ipv6.h inet_ntop.h
|
||||
$(OBJ_DIR)\inet_ntop.obj: inet_ntop.c setup.h setup_once.h nameser.h \
|
||||
ares_ipv6.h inet_ntop.h
|
||||
|
@@ -14,7 +14,11 @@ AC_DEFUN([CURL_CHECK_HEADER_WINDOWS], [
|
||||
#endif
|
||||
#include <windows.h>
|
||||
],[
|
||||
#ifdef __CYGWIN__
|
||||
HAVE_WINDOWS_H shall not be defined.
|
||||
#else
|
||||
int dummy=2*WINVER;
|
||||
#endif
|
||||
])
|
||||
],[
|
||||
ac_cv_header_windows_h="yes"
|
||||
@@ -22,12 +26,14 @@ AC_DEFUN([CURL_CHECK_HEADER_WINDOWS], [
|
||||
ac_cv_header_windows_h="no"
|
||||
])
|
||||
])
|
||||
if test "x$ac_cv_header_windows_h" = "xyes"; then
|
||||
case "$ac_cv_header_windows_h" in
|
||||
yes)
|
||||
AC_DEFINE_UNQUOTED(HAVE_WINDOWS_H, 1,
|
||||
[Define to 1 if you have the windows.h header file.])
|
||||
AC_DEFINE_UNQUOTED(WIN32_LEAN_AND_MEAN, 1,
|
||||
[Define to avoid automatic inclusion of winsock.h])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
|
||||
@@ -47,7 +53,11 @@ AC_DEFUN([CURL_CHECK_HEADER_WINSOCK], [
|
||||
#include <windows.h>
|
||||
#include <winsock.h>
|
||||
],[
|
||||
#ifdef __CYGWIN__
|
||||
HAVE_WINSOCK_H shall not be defined.
|
||||
#else
|
||||
int dummy=WSACleanup();
|
||||
#endif
|
||||
])
|
||||
],[
|
||||
ac_cv_header_winsock_h="yes"
|
||||
@@ -55,10 +65,12 @@ AC_DEFUN([CURL_CHECK_HEADER_WINSOCK], [
|
||||
ac_cv_header_winsock_h="no"
|
||||
])
|
||||
])
|
||||
if test "x$ac_cv_header_winsock_h" = "xyes"; then
|
||||
case "$ac_cv_header_winsock_h" in
|
||||
yes)
|
||||
AC_DEFINE_UNQUOTED(HAVE_WINSOCK_H, 1,
|
||||
[Define to 1 if you have the winsock.h header file.])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
|
||||
@@ -78,7 +90,11 @@ AC_DEFUN([CURL_CHECK_HEADER_WINSOCK2], [
|
||||
#include <windows.h>
|
||||
#include <winsock2.h>
|
||||
],[
|
||||
#ifdef __CYGWIN__
|
||||
HAVE_WINSOCK2_H shall not be defined.
|
||||
#else
|
||||
int dummy=2*IPPROTO_ESP;
|
||||
#endif
|
||||
])
|
||||
],[
|
||||
ac_cv_header_winsock2_h="yes"
|
||||
@@ -86,10 +102,12 @@ AC_DEFUN([CURL_CHECK_HEADER_WINSOCK2], [
|
||||
ac_cv_header_winsock2_h="no"
|
||||
])
|
||||
])
|
||||
if test "x$ac_cv_header_winsock2_h" = "xyes"; then
|
||||
case "$ac_cv_header_winsock2_h" in
|
||||
yes)
|
||||
AC_DEFINE_UNQUOTED(HAVE_WINSOCK2_H, 1,
|
||||
[Define to 1 if you have the winsock2.h header file.])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
|
||||
@@ -110,7 +128,11 @@ AC_DEFUN([CURL_CHECK_HEADER_WS2TCPIP], [
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
],[
|
||||
#ifdef __CYGWIN__
|
||||
HAVE_WS2TCPIP_H shall not be defined.
|
||||
#else
|
||||
int dummy=2*IP_PKTINFO;
|
||||
#endif
|
||||
])
|
||||
],[
|
||||
ac_cv_header_ws2tcpip_h="yes"
|
||||
@@ -118,9 +140,62 @@ AC_DEFUN([CURL_CHECK_HEADER_WS2TCPIP], [
|
||||
ac_cv_header_ws2tcpip_h="no"
|
||||
])
|
||||
])
|
||||
if test "x$ac_cv_header_ws2tcpip_h" = "xyes"; then
|
||||
case "$ac_cv_header_ws2tcpip_h" in
|
||||
yes)
|
||||
AC_DEFINE_UNQUOTED(HAVE_WS2TCPIP_H, 1,
|
||||
[Define to 1 if you have the ws2tcpip.h header file.])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_HEADER_MALLOC
|
||||
dnl -------------------------------------------------
|
||||
dnl Check for compilable and valid malloc.h header,
|
||||
dnl and check if it is needed even with stdlib.h
|
||||
|
||||
AC_DEFUN([CURL_CHECK_HEADER_MALLOC], [
|
||||
AC_CACHE_CHECK([for malloc.h], [ac_cv_header_malloc_h], [
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([
|
||||
#include <malloc.h>
|
||||
],[
|
||||
void *p = malloc(10);
|
||||
void *q = calloc(10,10);
|
||||
free(p);
|
||||
free(q);
|
||||
])
|
||||
],[
|
||||
ac_cv_header_malloc_h="yes"
|
||||
],[
|
||||
ac_cv_header_malloc_h="no"
|
||||
])
|
||||
])
|
||||
if test "$ac_cv_header_malloc_h" = "yes"; then
|
||||
AC_DEFINE_UNQUOTED(HAVE_MALLOC_H, 1,
|
||||
[Define to 1 if you have the malloc.h header file.])
|
||||
#
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([
|
||||
#include <stdlib.h>
|
||||
],[
|
||||
void *p = malloc(10);
|
||||
void *q = calloc(10,10);
|
||||
free(p);
|
||||
free(q);
|
||||
])
|
||||
],[
|
||||
curl_cv_need_header_malloc_h="no"
|
||||
],[
|
||||
curl_cv_need_header_malloc_h="yes"
|
||||
])
|
||||
#
|
||||
case "$curl_cv_need_header_malloc_h" in
|
||||
yes)
|
||||
AC_DEFINE_UNQUOTED(NEED_MALLOC_H, 1,
|
||||
[Define to 1 if you need the malloc.h header file even with stdlib.h])
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -173,12 +248,15 @@ AC_DEFUN([CURL_CHECK_TYPE_SOCKLEN_T], [
|
||||
done
|
||||
done
|
||||
])
|
||||
if test "$curl_cv_socklen_t_equiv" = "unknown"; then
|
||||
case "$curl_cv_socklen_t_equiv" in
|
||||
unknown)
|
||||
AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
|
||||
else
|
||||
;;
|
||||
*)
|
||||
AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv,
|
||||
[type to use in place of socklen_t if not defined])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
],[
|
||||
#undef inline
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
@@ -211,9 +289,9 @@ dnl and check the types of five of its arguments.
|
||||
dnl If the function succeeds HAVE_GETNAMEINFO will be
|
||||
dnl defined, defining the types of the arguments in
|
||||
dnl GETNAMEINFO_TYPE_ARG1, GETNAMEINFO_TYPE_ARG2,
|
||||
dnl GETNAMEINFO_TYPE_ARG46 and GETNAMEINFO_TYPE_ARG7.
|
||||
dnl This function is experimental and its results shall
|
||||
dnl not be trusted while this notice is in place ------
|
||||
dnl GETNAMEINFO_TYPE_ARG46 and GETNAMEINFO_TYPE_ARG7,
|
||||
dnl and also defining the type qualifier of first
|
||||
dnl argument in GETNAMEINFO_QUAL_ARG1.
|
||||
|
||||
AC_DEFUN([CURL_CHECK_FUNC_GETNAMEINFO], [
|
||||
AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl
|
||||
@@ -349,14 +427,50 @@ AC_DEFUN([CURL_CHECK_FUNC_GETNAMEINFO], [
|
||||
set dummy `echo "$curl_cv_func_getnameinfo_args" | sed 's/\*/\*/g'`
|
||||
IFS=$gni_prev_IFS
|
||||
shift
|
||||
AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG1, $[1],
|
||||
[Define to the type of arg 1 for getnameinfo.])
|
||||
#
|
||||
gni_qual_type_arg1=$[1]
|
||||
#
|
||||
AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG2, $[2],
|
||||
[Define to the type of arg 2 for getnameinfo.])
|
||||
AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG46, $[3],
|
||||
[Define to the type of args 4 and 6 for getnameinfo.])
|
||||
AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG7, $[4],
|
||||
[Define to the type of arg 7 for getnameinfo.])
|
||||
#
|
||||
prev_sh_opts=$-
|
||||
#
|
||||
case $prev_sh_opts in
|
||||
*f*)
|
||||
;;
|
||||
*)
|
||||
set -f
|
||||
;;
|
||||
esac
|
||||
#
|
||||
case "$gni_qual_type_arg1" in
|
||||
const*)
|
||||
gni_qual_arg1=const
|
||||
gni_type_arg1=`echo $gni_qual_type_arg1 | sed 's/^const //'`
|
||||
;;
|
||||
*)
|
||||
gni_qual_arg1=
|
||||
gni_type_arg1=$gni_qual_type_arg1
|
||||
;;
|
||||
esac
|
||||
#
|
||||
AC_DEFINE_UNQUOTED(GETNAMEINFO_QUAL_ARG1, $gni_qual_arg1,
|
||||
[Define to the type qualifier of arg 1 for getnameinfo.])
|
||||
AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG1, $gni_type_arg1,
|
||||
[Define to the type of arg 1 for getnameinfo.])
|
||||
#
|
||||
case $prev_sh_opts in
|
||||
*f*)
|
||||
;;
|
||||
*)
|
||||
set +f
|
||||
;;
|
||||
esac
|
||||
#
|
||||
AC_DEFINE_UNQUOTED(HAVE_GETNAMEINFO, 1,
|
||||
[Define to 1 if you have the getnameinfo function.])
|
||||
ac_cv_func_getnameinfo="yes"
|
||||
@@ -365,6 +479,481 @@ AC_DEFUN([CURL_CHECK_FUNC_GETNAMEINFO], [
|
||||
]) # AC_DEFUN
|
||||
|
||||
|
||||
dnl TYPE_SOCKADDR_STORAGE
|
||||
dnl -------------------------------------------------
|
||||
dnl Check for struct sockaddr_storage. Most IPv6-enabled
|
||||
dnl hosts have it, but AIX 4.3 is one known exception.
|
||||
|
||||
AC_DEFUN([TYPE_SOCKADDR_STORAGE],
|
||||
[
|
||||
AC_CHECK_TYPE([struct sockaddr_storage],
|
||||
AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1,
|
||||
[if struct sockaddr_storage is defined]), ,
|
||||
[
|
||||
#undef inline
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
#else
|
||||
#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
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#endif
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_NI_WITHSCOPEID
|
||||
dnl -------------------------------------------------
|
||||
dnl Check for working NI_WITHSCOPEID in getnameinfo()
|
||||
|
||||
AC_DEFUN([CURL_CHECK_NI_WITHSCOPEID], [
|
||||
AC_REQUIRE([CURL_CHECK_FUNC_GETNAMEINFO])dnl
|
||||
AC_REQUIRE([TYPE_SOCKADDR_STORAGE])dnl
|
||||
AC_CHECK_HEADERS(stdio.h sys/types.h sys/socket.h \
|
||||
netdb.h netinet/in.h arpa/inet.h)
|
||||
#
|
||||
AC_CACHE_CHECK([for working NI_WITHSCOPEID],
|
||||
[ac_cv_working_ni_withscopeid], [
|
||||
AC_RUN_IFELSE([
|
||||
AC_LANG_PROGRAM([
|
||||
#ifdef HAVE_STDIO_H
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
],[
|
||||
#if defined(NI_WITHSCOPEID) && defined(HAVE_GETNAMEINFO)
|
||||
#ifdef HAVE_STRUCT_SOCKADDR_STORAGE
|
||||
struct sockaddr_storage sa;
|
||||
#else
|
||||
unsigned char sa[256];
|
||||
#endif
|
||||
char hostbuf[NI_MAXHOST];
|
||||
int rc;
|
||||
GETNAMEINFO_TYPE_ARG2 salen = (GETNAMEINFO_TYPE_ARG2)sizeof(sa);
|
||||
GETNAMEINFO_TYPE_ARG46 hostlen = (GETNAMEINFO_TYPE_ARG46)sizeof(hostbuf);
|
||||
GETNAMEINFO_TYPE_ARG7 flags = NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID;
|
||||
int fd = socket(AF_INET6, SOCK_STREAM, 0);
|
||||
if(fd < 0) {
|
||||
perror("socket()");
|
||||
return 1; /* Error creating socket */
|
||||
}
|
||||
rc = getsockname(fd, (GETNAMEINFO_TYPE_ARG1)&sa, &salen);
|
||||
if(rc) {
|
||||
perror("getsockname()");
|
||||
return 2; /* Error retrieving socket name */
|
||||
}
|
||||
rc = getnameinfo((GETNAMEINFO_TYPE_ARG1)&sa, salen, hostbuf, hostlen, NULL, 0, flags);
|
||||
if(rc) {
|
||||
printf("rc = %s\n", gai_strerror(rc));
|
||||
return 3; /* Error translating socket address */
|
||||
}
|
||||
return 0; /* Ok, NI_WITHSCOPEID works */
|
||||
#else
|
||||
return 4; /* Error, NI_WITHSCOPEID not defined or no getnameinfo() */
|
||||
#endif
|
||||
]) # AC_LANG_PROGRAM
|
||||
],[
|
||||
# Exit code == 0. Program worked.
|
||||
ac_cv_working_ni_withscopeid="yes"
|
||||
],[
|
||||
# Exit code != 0. Program failed.
|
||||
ac_cv_working_ni_withscopeid="no"
|
||||
],[
|
||||
# Program is not run when cross-compiling. So we assume
|
||||
# NI_WITHSCOPEID will work if we are able to compile it.
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
],[
|
||||
unsigned int dummy= NI_NUMERICHOST | NI_NUMERICSERV | NI_WITHSCOPEID;
|
||||
])
|
||||
],[
|
||||
ac_cv_working_ni_withscopeid="yes"
|
||||
],[
|
||||
ac_cv_working_ni_withscopeid="no"
|
||||
]) # AC_COMPILE_IFELSE
|
||||
]) # AC_RUN_IFELSE
|
||||
]) # AC_CACHE_CHECK
|
||||
case "$ac_cv_working_ni_withscopeid" in
|
||||
yes)
|
||||
AC_DEFINE(HAVE_NI_WITHSCOPEID, 1,
|
||||
[Define to 1 if NI_WITHSCOPEID exists and works.])
|
||||
;;
|
||||
esac
|
||||
]) # AC_DEFUN
|
||||
|
||||
|
||||
dnl CURL_CHECK_FUNC_RECV
|
||||
dnl -------------------------------------------------
|
||||
dnl Test if the socket recv() function is available,
|
||||
dnl and check its return type and the types of its
|
||||
dnl arguments. If the function succeeds HAVE_RECV
|
||||
dnl will be defined, defining the types of the arguments
|
||||
dnl in RECV_TYPE_ARG1, RECV_TYPE_ARG2, RECV_TYPE_ARG3
|
||||
dnl and RECV_TYPE_ARG4, defining the type of the function
|
||||
dnl return value in RECV_TYPE_RETV.
|
||||
|
||||
AC_DEFUN([CURL_CHECK_FUNC_RECV], [
|
||||
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl
|
||||
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
|
||||
AC_CHECK_HEADERS(sys/types.h sys/socket.h)
|
||||
#
|
||||
AC_MSG_CHECKING([for recv])
|
||||
AC_TRY_LINK([
|
||||
#undef inline
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#ifdef HAVE_WINSOCK_H
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#endif
|
||||
],[
|
||||
recv(0, 0, 0, 0);
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
curl_cv_recv="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
curl_cv_recv="no"
|
||||
])
|
||||
#
|
||||
if test "$curl_cv_recv" = "yes"; then
|
||||
AC_CACHE_CHECK([types of arguments and return type for recv],
|
||||
[curl_cv_func_recv_args], [
|
||||
curl_cv_func_recv_args="unknown"
|
||||
for recv_retv in 'int' 'ssize_t'; do
|
||||
for recv_arg1 in 'int' 'ssize_t' 'SOCKET'; do
|
||||
for recv_arg2 in 'char *' 'void *'; do
|
||||
for recv_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do
|
||||
for recv_arg4 in 'int' 'unsigned int'; do
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([
|
||||
#undef inline
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#ifdef HAVE_WINSOCK_H
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
#endif
|
||||
#define RECVCALLCONV PASCAL
|
||||
#else
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#define RECVCALLCONV
|
||||
#endif
|
||||
extern $recv_retv RECVCALLCONV recv($recv_arg1, $recv_arg2, $recv_arg3, $recv_arg4);
|
||||
],[
|
||||
$recv_arg1 s=0;
|
||||
$recv_arg2 buf=0;
|
||||
$recv_arg3 len=0;
|
||||
$recv_arg4 flags=0;
|
||||
$recv_retv res = recv(s, buf, len, flags);
|
||||
])
|
||||
],[
|
||||
curl_cv_func_recv_args="$recv_arg1,$recv_arg2,$recv_arg3,$recv_arg4,$recv_retv"
|
||||
break 5
|
||||
])
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
]) # AC_CACHE_CHECK
|
||||
if test "$curl_cv_func_recv_args" = "unknown"; then
|
||||
AC_MSG_ERROR([Cannot find proper types to use for recv args])
|
||||
else
|
||||
recv_prev_IFS=$IFS; IFS=','
|
||||
set dummy `echo "$curl_cv_func_recv_args" | sed 's/\*/\*/g'`
|
||||
IFS=$recv_prev_IFS
|
||||
shift
|
||||
#
|
||||
AC_DEFINE_UNQUOTED(RECV_TYPE_ARG1, $[1],
|
||||
[Define to the type of arg 1 for recv.])
|
||||
AC_DEFINE_UNQUOTED(RECV_TYPE_ARG2, $[2],
|
||||
[Define to the type of arg 2 for recv.])
|
||||
AC_DEFINE_UNQUOTED(RECV_TYPE_ARG3, $[3],
|
||||
[Define to the type of arg 3 for recv.])
|
||||
AC_DEFINE_UNQUOTED(RECV_TYPE_ARG4, $[4],
|
||||
[Define to the type of arg 4 for recv.])
|
||||
AC_DEFINE_UNQUOTED(RECV_TYPE_RETV, $[5],
|
||||
[Define to the function return type for recv.])
|
||||
#
|
||||
AC_DEFINE_UNQUOTED(HAVE_RECV, 1,
|
||||
[Define to 1 if you have the recv function.])
|
||||
ac_cv_func_recv="yes"
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR([Unable to link function recv])
|
||||
fi
|
||||
]) # AC_DEFUN
|
||||
|
||||
|
||||
dnl CURL_CHECK_FUNC_SEND
|
||||
dnl -------------------------------------------------
|
||||
dnl Test if the socket send() function is available,
|
||||
dnl and check its return type and the types of its
|
||||
dnl arguments. If the function succeeds HAVE_SEND
|
||||
dnl will be defined, defining the types of the arguments
|
||||
dnl in SEND_TYPE_ARG1, SEND_TYPE_ARG2, SEND_TYPE_ARG3
|
||||
dnl and SEND_TYPE_ARG4, defining the type of the function
|
||||
dnl return value in SEND_TYPE_RETV, and also defining the
|
||||
dnl type qualifier of second argument in SEND_QUAL_ARG2.
|
||||
|
||||
AC_DEFUN([CURL_CHECK_FUNC_SEND], [
|
||||
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl
|
||||
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
|
||||
AC_CHECK_HEADERS(sys/types.h sys/socket.h)
|
||||
#
|
||||
AC_MSG_CHECKING([for send])
|
||||
AC_TRY_LINK([
|
||||
#undef inline
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#ifdef HAVE_WINSOCK_H
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#endif
|
||||
],[
|
||||
send(0, 0, 0, 0);
|
||||
],[
|
||||
AC_MSG_RESULT([yes])
|
||||
curl_cv_send="yes"
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
curl_cv_send="no"
|
||||
])
|
||||
#
|
||||
if test "$curl_cv_send" = "yes"; then
|
||||
AC_CACHE_CHECK([types of arguments and return type for send],
|
||||
[curl_cv_func_send_args], [
|
||||
curl_cv_func_send_args="unknown"
|
||||
for send_retv in 'int' 'ssize_t'; do
|
||||
for send_arg1 in 'int' 'ssize_t' 'SOCKET'; do
|
||||
for send_arg2 in 'char *' 'void *' 'const char *' 'const void *'; do
|
||||
for send_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do
|
||||
for send_arg4 in 'int' 'unsigned int'; do
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([
|
||||
#undef inline
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#ifdef HAVE_WINSOCK_H
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
#endif
|
||||
#define SENDCALLCONV PASCAL
|
||||
#else
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#define SENDCALLCONV
|
||||
#endif
|
||||
extern $send_retv SENDCALLCONV send($send_arg1, $send_arg2, $send_arg3, $send_arg4);
|
||||
],[
|
||||
$send_arg1 s=0;
|
||||
$send_arg3 len=0;
|
||||
$send_arg4 flags=0;
|
||||
$send_retv res = send(s, 0, len, flags);
|
||||
])
|
||||
],[
|
||||
curl_cv_func_send_args="$send_arg1,$send_arg2,$send_arg3,$send_arg4,$send_retv"
|
||||
break 5
|
||||
])
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
]) # AC_CACHE_CHECK
|
||||
if test "$curl_cv_func_send_args" = "unknown"; then
|
||||
AC_MSG_ERROR([Cannot find proper types to use for send args])
|
||||
else
|
||||
send_prev_IFS=$IFS; IFS=','
|
||||
set dummy `echo "$curl_cv_func_send_args" | sed 's/\*/\*/g'`
|
||||
IFS=$send_prev_IFS
|
||||
shift
|
||||
#
|
||||
send_qual_type_arg2=$[2]
|
||||
#
|
||||
AC_DEFINE_UNQUOTED(SEND_TYPE_ARG1, $[1],
|
||||
[Define to the type of arg 1 for send.])
|
||||
AC_DEFINE_UNQUOTED(SEND_TYPE_ARG3, $[3],
|
||||
[Define to the type of arg 3 for send.])
|
||||
AC_DEFINE_UNQUOTED(SEND_TYPE_ARG4, $[4],
|
||||
[Define to the type of arg 4 for send.])
|
||||
AC_DEFINE_UNQUOTED(SEND_TYPE_RETV, $[5],
|
||||
[Define to the function return type for send.])
|
||||
#
|
||||
prev_sh_opts=$-
|
||||
#
|
||||
case $prev_sh_opts in
|
||||
*f*)
|
||||
;;
|
||||
*)
|
||||
set -f
|
||||
;;
|
||||
esac
|
||||
#
|
||||
case "$send_qual_type_arg2" in
|
||||
const*)
|
||||
send_qual_arg2=const
|
||||
send_type_arg2=`echo $send_qual_type_arg2 | sed 's/^const //'`
|
||||
;;
|
||||
*)
|
||||
send_qual_arg2=
|
||||
send_type_arg2=$send_qual_type_arg2
|
||||
;;
|
||||
esac
|
||||
#
|
||||
AC_DEFINE_UNQUOTED(SEND_QUAL_ARG2, $send_qual_arg2,
|
||||
[Define to the type qualifier of arg 2 for send.])
|
||||
AC_DEFINE_UNQUOTED(SEND_TYPE_ARG2, $send_type_arg2,
|
||||
[Define to the type of arg 2 for send.])
|
||||
#
|
||||
case $prev_sh_opts in
|
||||
*f*)
|
||||
;;
|
||||
*)
|
||||
set +f
|
||||
;;
|
||||
esac
|
||||
#
|
||||
AC_DEFINE_UNQUOTED(HAVE_SEND, 1,
|
||||
[Define to 1 if you have the send function.])
|
||||
ac_cv_func_send="yes"
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR([Unable to link function send])
|
||||
fi
|
||||
]) # AC_DEFUN
|
||||
|
||||
|
||||
dnl CURL_CHECK_MSG_NOSIGNAL
|
||||
dnl -------------------------------------------------
|
||||
dnl Check for MSG_NOSIGNAL
|
||||
|
||||
AC_DEFUN([CURL_CHECK_MSG_NOSIGNAL], [
|
||||
AC_CHECK_HEADERS(sys/types.h sys/socket.h)
|
||||
AC_CACHE_CHECK([for MSG_NOSIGNAL], [ac_cv_msg_nosignal], [
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([
|
||||
#undef inline
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#ifdef HAVE_WINSOCK2_H
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#ifdef HAVE_WINSOCK_H
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
#endif
|
||||
],[
|
||||
int flag=MSG_NOSIGNAL;
|
||||
])
|
||||
],[
|
||||
ac_cv_msg_nosignal="yes"
|
||||
],[
|
||||
ac_cv_msg_nosignal="no"
|
||||
])
|
||||
])
|
||||
case "$ac_cv_msg_nosignal" in
|
||||
yes)
|
||||
AC_DEFINE_UNQUOTED(HAVE_MSG_NOSIGNAL, 1,
|
||||
[Define to 1 if you have the MSG_NOSIGNAL flag.])
|
||||
;;
|
||||
esac
|
||||
]) # AC_DEFUN
|
||||
|
||||
|
||||
dnl CURL_CHECK_NONBLOCKING_SOCKET
|
||||
dnl -------------------------------------------------
|
||||
dnl Check for how to set a socket to non-blocking state. There seems to exist
|
||||
@@ -826,3 +1415,39 @@ else
|
||||
fi
|
||||
])
|
||||
|
||||
# Prevent libtool for checking how to run C++ compiler and check for other
|
||||
# tools we don't want to use. We do this by m4-defining the _LT_AC_TAGCONFIG
|
||||
# variable to the code to run, as by default it uses a much more complicated
|
||||
# approach. The code below that is actually added seems to be used for cases
|
||||
# where configure has trouble figuring out what C compiler to use but where
|
||||
# the installed libtool has an idea.
|
||||
#
|
||||
# This function is a re-implemented version of the Paolo Bonzini fix posted to
|
||||
# the c-ares mailing list by Bram Matthys on May 6 2006. My version removes
|
||||
# redundant code but also adds the LTCFLAGS check that wasn't in that patch.
|
||||
#
|
||||
# Some code in this function was extracted from the generated configure script.
|
||||
#
|
||||
# CARES_CLEAR_LIBTOOL_TAGS
|
||||
AC_DEFUN([CARES_CLEAR_LIBTOOL_TAGS],
|
||||
[m4_define([_LT_AC_TAGCONFIG], [
|
||||
if test -f "$ltmain"; then
|
||||
if test ! -f "${ofile}"; then
|
||||
AC_MSG_WARN([output file `$ofile' does not exist])
|
||||
fi
|
||||
|
||||
if test -z "$LTCC"; then
|
||||
eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
|
||||
if test -z "$LTCC"; then
|
||||
AC_MSG_WARN([output file `$ofile' does not look like a libtool
|
||||
script])
|
||||
else
|
||||
AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
|
||||
fi
|
||||
fi
|
||||
if test -z "$LTCFLAGS"; then
|
||||
eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
|
||||
fi
|
||||
fi
|
||||
])]
|
||||
)
|
||||
|
24
ares/adig.c
24
ares/adig.c
@@ -396,7 +396,7 @@ static const unsigned char *display_question(const unsigned char *aptr,
|
||||
*/
|
||||
if (aptr + QFIXEDSZ > abuf + alen)
|
||||
{
|
||||
free(name);
|
||||
ares_free_string(name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -412,7 +412,7 @@ static const unsigned char *display_question(const unsigned char *aptr,
|
||||
if (dnsclass != C_IN)
|
||||
printf("\t%s", class_name(dnsclass));
|
||||
printf("\t%s\n", type_name(type));
|
||||
free(name);
|
||||
ares_free_string(name);
|
||||
return aptr;
|
||||
}
|
||||
|
||||
@@ -436,7 +436,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
*/
|
||||
if (aptr + RRFIXEDSZ > abuf + alen)
|
||||
{
|
||||
free(name);
|
||||
ares_free_string(name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -449,7 +449,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
aptr += RRFIXEDSZ;
|
||||
if (aptr + dlen > abuf + alen)
|
||||
{
|
||||
free(name);
|
||||
ares_free_string(name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -458,7 +458,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
if (dnsclass != C_IN)
|
||||
printf("\t%s", class_name(dnsclass));
|
||||
printf("\t%s", type_name(type));
|
||||
free(name);
|
||||
ares_free_string(name);
|
||||
|
||||
/* Display the RR data. Don't touch aptr. */
|
||||
switch (type)
|
||||
@@ -476,7 +476,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t%s.", name);
|
||||
free(name);
|
||||
ares_free_string(name);
|
||||
break;
|
||||
|
||||
case T_HINFO:
|
||||
@@ -500,13 +500,13 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t%s.", name);
|
||||
free(name);
|
||||
ares_free_string(name);
|
||||
p += len;
|
||||
status = ares_expand_name(p, abuf, alen, &name, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t%s.", name);
|
||||
free(name);
|
||||
ares_free_string(name);
|
||||
break;
|
||||
|
||||
case T_MX:
|
||||
@@ -520,7 +520,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t%s.", name);
|
||||
free(name);
|
||||
ares_free_string(name);
|
||||
break;
|
||||
|
||||
case T_SOA:
|
||||
@@ -532,13 +532,13 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t%s.\n", name);
|
||||
free(name);
|
||||
ares_free_string(name);
|
||||
p += len;
|
||||
status = ares_expand_name(p, abuf, alen, &name, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t\t\t\t\t\t%s.\n", name);
|
||||
free(name);
|
||||
ares_free_string(name);
|
||||
p += len;
|
||||
if (p + 20 > aptr + dlen)
|
||||
return NULL;
|
||||
@@ -592,7 +592,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
||||
if (status != ARES_SUCCESS)
|
||||
return NULL;
|
||||
printf("\t%s.", name);
|
||||
free(name);
|
||||
ares_free_string(name);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
38
ares/ahost.c
38
ares/ahost.c
@@ -1,4 +1,6 @@
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -30,6 +32,10 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "inet_ntop.h"
|
||||
@@ -52,7 +58,7 @@ static void usage(void);
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
ares_channel channel;
|
||||
int status, nfds;
|
||||
int status, nfds, c, addr_family = AF_INET;
|
||||
fd_set read_fds, write_fds;
|
||||
struct timeval *tvp, tv;
|
||||
struct in_addr addr4;
|
||||
@@ -64,7 +70,28 @@ int main(int argc, char **argv)
|
||||
WSAStartup(wVersionRequested, &wsaData);
|
||||
#endif
|
||||
|
||||
if (argc <= 1)
|
||||
while ((c = getopt(argc,argv,"t:h")) != -1)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case 't':
|
||||
if (!strcasecmp(optarg,"a"))
|
||||
addr_family = AF_INET;
|
||||
else if (!strcasecmp(optarg,"aaaa"))
|
||||
addr_family = AF_INET6;
|
||||
else
|
||||
usage();
|
||||
break;
|
||||
case 'h':
|
||||
default:
|
||||
usage();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
if (argc < 1)
|
||||
usage();
|
||||
|
||||
status = ares_init(&channel);
|
||||
@@ -75,7 +102,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* Initiate the queries, one per command-line argument. */
|
||||
for (argv++; *argv; argv++)
|
||||
for ( ; *argv; argv++)
|
||||
{
|
||||
if (ares_inet_pton(AF_INET, *argv, &addr4) == 1)
|
||||
{
|
||||
@@ -89,8 +116,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* assume user wants A-records */
|
||||
ares_gethostbyname(channel, *argv, AF_INET, callback, *argv);
|
||||
ares_gethostbyname(channel, *argv, addr_family, callback, *argv);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,6 +169,6 @@ static void callback(void *arg, int status, struct hostent *host)
|
||||
|
||||
static void usage(void)
|
||||
{
|
||||
fprintf(stderr, "usage: ahost {host|addr} ...\n");
|
||||
fprintf(stderr, "usage: ahost [-t {a|aaaa}] {host|addr} ...\n");
|
||||
exit(1);
|
||||
}
|
||||
|
17
ares/ares.h
17
ares/ares.h
@@ -31,7 +31,7 @@
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
#include <tcp.h>
|
||||
#elif defined(WIN32)
|
||||
#elif defined(WIN32) && !defined(__CYGWIN__)
|
||||
#include <winsock2.h>
|
||||
#include <windows.h>
|
||||
#else
|
||||
@@ -93,6 +93,7 @@ extern "C" {
|
||||
#define ARES_OPT_SERVERS (1 << 6)
|
||||
#define ARES_OPT_DOMAINS (1 << 7)
|
||||
#define ARES_OPT_LOOKUPS (1 << 8)
|
||||
#define ARES_OPT_SOCK_STATE_CB (1 << 9)
|
||||
|
||||
/* Nameinfo flag values */
|
||||
#define ARES_NI_NOFQDN (1 << 0)
|
||||
@@ -135,6 +136,18 @@ extern "C" {
|
||||
#define ARES_GETSOCK_WRITABLE(bits,num) (bits & (1 << ((num) + \
|
||||
ARES_GETSOCK_MAXNUM)))
|
||||
|
||||
#ifdef WIN32
|
||||
typedef void (*ares_sock_state_cb)(void *data,
|
||||
SOCKET socket,
|
||||
int readable,
|
||||
int writable);
|
||||
#else
|
||||
typedef void (*ares_sock_state_cb)(void *data,
|
||||
int socket,
|
||||
int readable,
|
||||
int writable);
|
||||
#endif
|
||||
|
||||
struct ares_options {
|
||||
int flags;
|
||||
int timeout;
|
||||
@@ -147,6 +160,8 @@ struct ares_options {
|
||||
char **domains;
|
||||
int ndomains;
|
||||
char *lookups;
|
||||
ares_sock_state_cb sock_state_cb;
|
||||
void *sock_state_cb_data;
|
||||
};
|
||||
|
||||
struct hostent;
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
@@ -23,7 +25,7 @@
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
void ares__close_sockets(struct server_state *server)
|
||||
void ares__close_sockets(ares_channel channel, struct server_state *server)
|
||||
{
|
||||
struct send_request *sendreq;
|
||||
|
||||
@@ -46,11 +48,13 @@ void ares__close_sockets(struct server_state *server)
|
||||
/* Close the TCP and UDP sockets. */
|
||||
if (server->tcp_socket != ARES_SOCKET_BAD)
|
||||
{
|
||||
SOCK_STATE_CALLBACK(channel, server->tcp_socket, 0, 0);
|
||||
closesocket(server->tcp_socket);
|
||||
server->tcp_socket = ARES_SOCKET_BAD;
|
||||
}
|
||||
if (server->udp_socket != ARES_SOCKET_BAD)
|
||||
{
|
||||
SOCK_STATE_CALLBACK(channel, server->udp_socket, 0, 0);
|
||||
closesocket(server->udp_socket);
|
||||
server->udp_socket = ARES_SOCKET_BAD;
|
||||
}
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 2004 by Daniel Stenberg et al
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software and its
|
||||
@@ -38,6 +40,6 @@ void ares_cancel(ares_channel channel)
|
||||
if (!(channel->flags & ARES_FLAG_STAYOPEN))
|
||||
{
|
||||
for (i = 0; i < channel->nservers; i++)
|
||||
ares__close_sockets(&channel->servers[i]);
|
||||
ares__close_sockets(channel, &channel->servers[i]);
|
||||
}
|
||||
}
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
@@ -24,7 +26,7 @@ void ares_destroy(ares_channel channel)
|
||||
struct query *query;
|
||||
|
||||
for (i = 0; i < channel->nservers; i++)
|
||||
ares__close_sockets(&channel->servers[i]);
|
||||
ares__close_sockets(channel, &channel->servers[i]);
|
||||
free(channel->servers);
|
||||
for (i = 0; i < channel->ndomains; i++)
|
||||
free(channel->domains[i]);
|
||||
|
@@ -18,18 +18,6 @@
|
||||
#ifndef ARES__DNS_H
|
||||
#define ARES__DNS_H
|
||||
|
||||
#ifdef ARES_BIG_ENDIAN
|
||||
/* big-endian aware versions */
|
||||
#define DNS__16BIT(p) (((p)[1] << 8) | (p)[0])
|
||||
#define DNS__32BIT(p) (((p)[3] << 24) | ((p)[2] << 16) | \
|
||||
((p)[1] << 8) | (p)[0])
|
||||
#define DNS__SET16BIT(p, v) (((p)[1] = ((v) >> 8) & 0xff), \
|
||||
((p)[0] = (v) & 0xff))
|
||||
#define DNS__SET32BIT(p, v) (((p)[3] = ((v) >> 24) & 0xff), \
|
||||
((p)[2] = ((v) >> 16) & 0xff), \
|
||||
((p)[1] = ((v) >> 8) & 0xff), \
|
||||
((p)[0] = (v) & 0xff))
|
||||
#else
|
||||
#define DNS__16BIT(p) (((p)[0] << 8) | (p)[1])
|
||||
#define DNS__32BIT(p) (((p)[0] << 24) | ((p)[1] << 16) | \
|
||||
((p)[2] << 8) | (p)[3])
|
||||
@@ -39,7 +27,6 @@
|
||||
((p)[1] = ((v) >> 16) & 0xff), \
|
||||
((p)[2] = ((v) >> 8) & 0xff), \
|
||||
((p)[3] = (v) & 0xff))
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/* we cannot use this approach on systems where we can't access 16/32 bit
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 2000 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
@@ -16,6 +18,7 @@
|
||||
#include "setup.h"
|
||||
#include <stdlib.h>
|
||||
#include "ares.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
void ares_free_string(void *str)
|
||||
{
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
@@ -170,7 +172,7 @@ static void host_callback(void *arg, int status, unsigned char *abuf, int alen)
|
||||
}
|
||||
else if (status == ARES_ENODATA && hquery->family == AF_INET6)
|
||||
{
|
||||
/* There was no AAAA now lookup an A */
|
||||
/* There was no AAAA. Now lookup an A */
|
||||
hquery->family = AF_INET;
|
||||
ares_search(hquery->channel, hquery->name, C_IN, T_A, host_callback,
|
||||
hquery);
|
||||
|
@@ -28,7 +28,6 @@ int ares_getsock(ares_channel channel,
|
||||
int numsocks) /* size of the 'socks' array */
|
||||
{
|
||||
struct server_state *server;
|
||||
ares_socket_t nfds;
|
||||
int i;
|
||||
int sockindex=0;
|
||||
int bitmap = 0;
|
||||
@@ -40,7 +39,6 @@ int ares_getsock(ares_channel channel,
|
||||
if (!channel->queries)
|
||||
return 0;
|
||||
|
||||
nfds = 0;
|
||||
for (i = 0; i < channel->nservers; i++)
|
||||
{
|
||||
server = &channel->servers[i];
|
||||
@@ -67,5 +65,5 @@ int ares_getsock(ares_channel channel,
|
||||
|
||||
}
|
||||
}
|
||||
return (int)nfds;
|
||||
return bitmap;
|
||||
}
|
||||
|
@@ -98,6 +98,24 @@ The lookups to perform for host queries.
|
||||
.I lookups
|
||||
should be set to a string of the characters "b" or "f", where "b"
|
||||
indicates a DNS lookup and "f" indicates a lookup in the hosts file.
|
||||
.TP 18
|
||||
.B ARES_OPT_SOCK_STATE_CB
|
||||
.B void (*\fIsock_state_cb\fP)(void *data, int s, int read, int write);
|
||||
.br
|
||||
.B void *\fIsock_state_cb_data\fP;
|
||||
.br
|
||||
A callback function to be invoked when a socket changes state.
|
||||
.I s
|
||||
will be passed the socket whose state has changed;
|
||||
.I read
|
||||
will be set to true if the socket should listen for read events, and
|
||||
.I write
|
||||
will be set to true if the socket should listen for write events.
|
||||
The value of
|
||||
.I sock_state_cb_data
|
||||
will be passed as the
|
||||
.I data
|
||||
argument.
|
||||
.PP
|
||||
The
|
||||
.I flags
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
@@ -93,6 +95,16 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
||||
struct server_state *server;
|
||||
struct timeval tv;
|
||||
|
||||
#ifdef CURLDEBUG
|
||||
const char *env = getenv("CARES_MEMDEBUG");
|
||||
|
||||
if (env)
|
||||
curl_memdebug(env);
|
||||
env = getenv("CARES_MEMLIMIT");
|
||||
if (env)
|
||||
curl_memlimit(atoi(env));
|
||||
#endif
|
||||
|
||||
channel = malloc(sizeof(struct ares_channeldata));
|
||||
if (!channel)
|
||||
return ARES_ENOMEM;
|
||||
@@ -113,6 +125,7 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
||||
channel->queries = NULL;
|
||||
channel->domains = NULL;
|
||||
channel->sortlist = NULL;
|
||||
channel->sock_state_cb = NULL;
|
||||
|
||||
/* Initialize configuration by each of the four sources, from highest
|
||||
* precedence to lowest.
|
||||
@@ -192,6 +205,11 @@ static int init_by_options(ares_channel channel, struct ares_options *options,
|
||||
channel->udp_port = options->udp_port;
|
||||
if ((optmask & ARES_OPT_TCP_PORT) && channel->tcp_port == -1)
|
||||
channel->tcp_port = options->tcp_port;
|
||||
if ((optmask & ARES_OPT_SOCK_STATE_CB) && channel->sock_state_cb == NULL)
|
||||
{
|
||||
channel->sock_state_cb = options->sock_state_cb;
|
||||
channel->sock_state_cb_data = options->sock_state_cb_data;
|
||||
}
|
||||
|
||||
/* Copy the servers, if given. */
|
||||
if ((optmask & ARES_OPT_SERVERS) && channel->nservers == -1)
|
||||
|
@@ -46,8 +46,8 @@ struct addrinfo
|
||||
int ai_family;
|
||||
int ai_socktype;
|
||||
int ai_protocol;
|
||||
size_t ai_addrlen;
|
||||
char *ai_cannonname;
|
||||
socklen_t ai_addrlen; /* Follow rfc3493 struct addrinfo */
|
||||
char *ai_canonname;
|
||||
struct sockaddr *ai_addr;
|
||||
struct addrinfo *ai_next;
|
||||
};
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
@@ -30,6 +32,7 @@
|
||||
#include <string.h>
|
||||
#include "ares.h"
|
||||
#include "ares_dns.h"
|
||||
#include "ares_private.h"
|
||||
|
||||
/* Header format, from RFC 1035:
|
||||
* 1 1 1 1 1 1
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 2005 Dominick Meglio
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
|
@@ -1,3 +1,6 @@
|
||||
#ifndef __ARES_PRIVATE_H
|
||||
#define __ARES_PRIVATE_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
@@ -176,13 +179,22 @@ struct ares_channeldata {
|
||||
|
||||
/* Active queries */
|
||||
struct query *queries;
|
||||
|
||||
ares_sock_state_cb sock_state_cb;
|
||||
void *sock_state_cb_data;
|
||||
};
|
||||
|
||||
void ares__send_query(ares_channel channel, struct query *query, time_t now);
|
||||
void ares__close_sockets(struct server_state *server);
|
||||
void ares__close_sockets(ares_channel channel, struct server_state *server);
|
||||
int ares__get_hostent(FILE *fp, int family, struct hostent **host);
|
||||
int ares__read_line(FILE *fp, char **buf, int *bufsize);
|
||||
|
||||
#define SOCK_STATE_CALLBACK(c, s, r, w) \
|
||||
do { \
|
||||
if ((c)->sock_state_cb) \
|
||||
(c)->sock_state_cb((c)->sock_state_cb_data, (s), (r), (w)); \
|
||||
} while (0)
|
||||
|
||||
#ifdef CURLDEBUG
|
||||
/* This is low-level hard-hacking memory leak tracking and similar. Using the
|
||||
libcurl lowlevel code from within library is ugly and only works when
|
||||
@@ -190,3 +202,6 @@ int ares__read_line(FILE *fp, char **buf, int *bufsize);
|
||||
this anyway for convenience. */
|
||||
#include "../lib/memdebug.h"
|
||||
#endif
|
||||
|
||||
#endif /* __ARES_PRIVATE_H */
|
||||
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
@@ -63,6 +65,7 @@
|
||||
#define GET_ERRNO() errno
|
||||
#endif
|
||||
|
||||
static int try_again(int errnum);
|
||||
static void write_tcp_data(ares_channel channel, fd_set *write_fds,
|
||||
time_t now);
|
||||
static void read_tcp_data(ares_channel channel, fd_set *read_fds, time_t now);
|
||||
@@ -94,6 +97,31 @@ void ares_process(ares_channel channel, fd_set *read_fds, fd_set *write_fds)
|
||||
process_timeouts(channel, now);
|
||||
}
|
||||
|
||||
/* Return 1 if the specified errno describes a readiness error, or 0
|
||||
* otherwise. This is mostly for HP-UX, which could return EAGAIN or
|
||||
* EWOULDBLOCK. See this man page
|
||||
*
|
||||
* http://devrsrc1.external.hp.com/STKS/cgi-bin/man2html?manpage=/usr/share/man/man2.Z/send.2
|
||||
*/
|
||||
static int try_again(int errnum)
|
||||
{
|
||||
#if !defined EWOULDBLOCK && !defined EAGAIN
|
||||
#error "Neither EWOULDBLOCK nor EAGAIN defined"
|
||||
#endif
|
||||
switch (errnum)
|
||||
{
|
||||
#ifdef EWOULDBLOCK
|
||||
case EWOULDBLOCK:
|
||||
return 1;
|
||||
#endif
|
||||
#if defined EAGAIN && EAGAIN != EWOULDBLOCK
|
||||
case EAGAIN:
|
||||
return 1;
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* If any TCP sockets select true for writing, write out queued data
|
||||
* we have for them.
|
||||
*/
|
||||
@@ -132,10 +160,11 @@ static void write_tcp_data(ares_channel channel, fd_set *write_fds, time_t now)
|
||||
vec[n].iov_len = sendreq->len;
|
||||
n++;
|
||||
}
|
||||
wcount = writev(server->tcp_socket, vec, n);
|
||||
wcount = (ssize_t)writev(server->tcp_socket, vec, n);
|
||||
free(vec);
|
||||
if (wcount < 0)
|
||||
{
|
||||
if (!try_again(GET_ERRNO()))
|
||||
handle_error(channel, i, now);
|
||||
continue;
|
||||
}
|
||||
@@ -149,7 +178,10 @@ static void write_tcp_data(ares_channel channel, fd_set *write_fds, time_t now)
|
||||
wcount -= sendreq->len;
|
||||
server->qhead = sendreq->next;
|
||||
if (server->qhead == NULL)
|
||||
{
|
||||
SOCK_STATE_CALLBACK(channel, server->tcp_socket, 1, 0);
|
||||
server->qtail = NULL;
|
||||
}
|
||||
free(sendreq);
|
||||
}
|
||||
else
|
||||
@@ -165,11 +197,10 @@ static void write_tcp_data(ares_channel channel, fd_set *write_fds, time_t now)
|
||||
/* Can't allocate iovecs; just send the first request. */
|
||||
sendreq = server->qhead;
|
||||
|
||||
scount = send(server->tcp_socket, (void *)sendreq->data,
|
||||
sendreq->len, 0);
|
||||
|
||||
scount = swrite(server->tcp_socket, sendreq->data, sendreq->len);
|
||||
if (scount < 0)
|
||||
{
|
||||
if (!try_again(GET_ERRNO()))
|
||||
handle_error(channel, i, now);
|
||||
continue;
|
||||
}
|
||||
@@ -179,7 +210,10 @@ static void write_tcp_data(ares_channel channel, fd_set *write_fds, time_t now)
|
||||
{
|
||||
server->qhead = sendreq->next;
|
||||
if (server->qhead == NULL)
|
||||
{
|
||||
SOCK_STATE_CALLBACK(channel, server->tcp_socket, 1, 0);
|
||||
server->qtail = NULL;
|
||||
}
|
||||
free(sendreq);
|
||||
}
|
||||
else
|
||||
@@ -198,7 +232,8 @@ static void write_tcp_data(ares_channel channel, fd_set *write_fds, time_t now)
|
||||
static void read_tcp_data(ares_channel channel, fd_set *read_fds, time_t now)
|
||||
{
|
||||
struct server_state *server;
|
||||
int i, count;
|
||||
int i;
|
||||
ssize_t count;
|
||||
|
||||
for (i = 0; i < channel->nservers; i++)
|
||||
{
|
||||
@@ -213,16 +248,17 @@ static void read_tcp_data(ares_channel channel, fd_set *read_fds, time_t now)
|
||||
/* We haven't yet read a length word, so read that (or
|
||||
* what's left to read of it).
|
||||
*/
|
||||
count = recv(server->tcp_socket,
|
||||
(void *)(server->tcp_lenbuf + server->tcp_lenbuf_pos),
|
||||
2 - server->tcp_lenbuf_pos, 0);
|
||||
count = sread(server->tcp_socket,
|
||||
server->tcp_lenbuf + server->tcp_lenbuf_pos,
|
||||
2 - server->tcp_lenbuf_pos);
|
||||
if (count <= 0)
|
||||
{
|
||||
if (!(count == -1 && try_again(GET_ERRNO())))
|
||||
handle_error(channel, i, now);
|
||||
continue;
|
||||
}
|
||||
|
||||
server->tcp_lenbuf_pos += count;
|
||||
server->tcp_lenbuf_pos += (int)count;
|
||||
if (server->tcp_lenbuf_pos == 2)
|
||||
{
|
||||
/* We finished reading the length word. Decode the
|
||||
@@ -239,16 +275,17 @@ static void read_tcp_data(ares_channel channel, fd_set *read_fds, time_t now)
|
||||
else
|
||||
{
|
||||
/* Read data into the allocated buffer. */
|
||||
count = recv(server->tcp_socket,
|
||||
(void *)(server->tcp_buffer + server->tcp_buffer_pos),
|
||||
server->tcp_length - server->tcp_buffer_pos, 0);
|
||||
count = sread(server->tcp_socket,
|
||||
server->tcp_buffer + server->tcp_buffer_pos,
|
||||
server->tcp_length - server->tcp_buffer_pos);
|
||||
if (count <= 0)
|
||||
{
|
||||
if (!(count == -1 && try_again(GET_ERRNO())))
|
||||
handle_error(channel, i, now);
|
||||
continue;
|
||||
}
|
||||
|
||||
server->tcp_buffer_pos += count;
|
||||
server->tcp_buffer_pos += (int)count;
|
||||
if (server->tcp_buffer_pos == server->tcp_length)
|
||||
{
|
||||
/* We finished reading this answer; process it and
|
||||
@@ -270,7 +307,8 @@ static void read_udp_packets(ares_channel channel, fd_set *read_fds,
|
||||
time_t now)
|
||||
{
|
||||
struct server_state *server;
|
||||
int i, count;
|
||||
int i;
|
||||
ssize_t count;
|
||||
unsigned char buf[PACKETSZ + 1];
|
||||
|
||||
for (i = 0; i < channel->nservers; i++)
|
||||
@@ -282,11 +320,13 @@ static void read_udp_packets(ares_channel channel, fd_set *read_fds,
|
||||
!FD_ISSET(server->udp_socket, read_fds))
|
||||
continue;
|
||||
|
||||
count = recv(server->udp_socket, (void *)buf, sizeof(buf), 0);
|
||||
if (count <= 0)
|
||||
count = sread(server->udp_socket, buf, sizeof(buf));
|
||||
if (count == -1 && try_again(GET_ERRNO()))
|
||||
continue;
|
||||
else if (count <= 0)
|
||||
handle_error(channel, i, now);
|
||||
|
||||
process_answer(channel, buf, count, i, 0, now);
|
||||
process_answer(channel, buf, (int)count, i, 0, now);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -380,7 +420,7 @@ static void handle_error(ares_channel channel, int whichserver, time_t now)
|
||||
struct query *query, *next;
|
||||
|
||||
/* Reset communications with this server. */
|
||||
ares__close_sockets(&channel->servers[whichserver]);
|
||||
ares__close_sockets(channel, &channel->servers[whichserver]);
|
||||
|
||||
/* Tell all queries talking to this server to move on and not try
|
||||
* this server again.
|
||||
@@ -452,7 +492,10 @@ void ares__send_query(ares_channel channel, struct query *query, time_t now)
|
||||
if (server->qtail)
|
||||
server->qtail->next = sendreq;
|
||||
else
|
||||
{
|
||||
SOCK_STATE_CALLBACK(channel, server->tcp_socket, 1, 1);
|
||||
server->qhead = sendreq;
|
||||
}
|
||||
server->qtail = sendreq;
|
||||
query->timeout = 0;
|
||||
}
|
||||
@@ -467,9 +510,9 @@ void ares__send_query(ares_channel channel, struct query *query, time_t now)
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (send(server->udp_socket, (void *)query->qbuf,
|
||||
query->qlen, 0) == -1)
|
||||
if (swrite(server->udp_socket, query->qbuf, query->qlen) == -1)
|
||||
{
|
||||
/* FIXME: Handle EAGAIN here since it likely can happen. */
|
||||
query->skip_server[query->server] = 1;
|
||||
next_server(channel, query, now);
|
||||
return;
|
||||
@@ -575,6 +618,7 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
|
||||
}
|
||||
}
|
||||
|
||||
SOCK_STATE_CALLBACK(channel, s, 1, 0);
|
||||
server->tcp_buffer_pos = 0;
|
||||
server->tcp_socket = s;
|
||||
return 0;
|
||||
@@ -604,6 +648,8 @@ static int open_udp_socket(ares_channel channel, struct server_state *server)
|
||||
return -1;
|
||||
}
|
||||
|
||||
SOCK_STATE_CALLBACK(channel, s, 1, 0);
|
||||
|
||||
server->udp_socket = s;
|
||||
return 0;
|
||||
}
|
||||
@@ -714,7 +760,7 @@ static struct query *end_query (ares_channel channel, struct query *query, int s
|
||||
if (!channel->queries && !(channel->flags & ARES_FLAG_STAYOPEN))
|
||||
{
|
||||
for (i = 0; i < channel->nservers; i++)
|
||||
ares__close_sockets(&channel->servers[i]);
|
||||
ares__close_sockets(channel, &channel->servers[i]);
|
||||
}
|
||||
return (next);
|
||||
}
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (c) 1996,1999 by Internet Software Consortium.
|
||||
|
@@ -1,3 +1,6 @@
|
||||
#ifndef __ARES_BITNCMP_H
|
||||
#define __ARES_BITNCMP_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
@@ -14,13 +17,10 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#ifndef BITNCMP_H
|
||||
#define BITNCMP_H
|
||||
|
||||
#ifndef HAVE_BITNCMP
|
||||
int ares_bitncmp(const void *l, const void *r, int n);
|
||||
#else
|
||||
#define ares_bitncmp(x,y,z) bitncmp(x,y,z)
|
||||
#endif
|
||||
|
||||
#endif /* BITNCMP_H */
|
||||
#endif /* __ARES_BITNCMP_H */
|
||||
|
@@ -54,6 +54,63 @@
|
||||
/* Define if you have the ioctlsocket function. */
|
||||
#define HAVE_IOCTLSOCKET 1
|
||||
|
||||
/* 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
|
||||
|
||||
/* Define to the type of arg 1 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
|
||||
|
||||
/* Define to the type of arg 2 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG2 socklen_t
|
||||
|
||||
/* Define to the type of args 4 and 6 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG46 DWORD
|
||||
|
||||
/* Define to the type of arg 7 for getnameinfo. */
|
||||
#define GETNAMEINFO_TYPE_ARG7 int
|
||||
|
||||
/* Define if you have the recv function. */
|
||||
#define HAVE_RECV 1
|
||||
|
||||
/* Define to the type of arg 1 for recv. */
|
||||
#define RECV_TYPE_ARG1 SOCKET
|
||||
|
||||
/* Define to the type of arg 2 for recv. */
|
||||
#define RECV_TYPE_ARG2 char *
|
||||
|
||||
/* Define to the type of arg 3 for recv. */
|
||||
#define RECV_TYPE_ARG3 int
|
||||
|
||||
/* Define to the type of arg 4 for recv. */
|
||||
#define RECV_TYPE_ARG4 int
|
||||
|
||||
/* Define to the function return type for recv. */
|
||||
#define RECV_TYPE_RETV int
|
||||
|
||||
/* Define if you have the send function. */
|
||||
#define HAVE_SEND 1
|
||||
|
||||
/* Define to the type of arg 1 for send. */
|
||||
#define SEND_TYPE_ARG1 SOCKET
|
||||
|
||||
/* Define to the type qualifier of arg 2 for send. */
|
||||
#define SEND_QUAL_ARG2 const
|
||||
|
||||
/* Define to the type of arg 2 for send. */
|
||||
#define SEND_TYPE_ARG2 char *
|
||||
|
||||
/* Define to the type of arg 3 for send. */
|
||||
#define SEND_TYPE_ARG3 int
|
||||
|
||||
/* Define to the type of arg 4 for send. */
|
||||
#define SEND_TYPE_ARG4 int
|
||||
|
||||
/* Define to the function return type for send. */
|
||||
#define SEND_TYPE_RETV int
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* STRUCT RELATED */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
@@ -16,10 +16,6 @@ solaris*)
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SEARCH_LIBS(gethostbyname, nsl)
|
||||
AC_SEARCH_LIBS(socket, socket)
|
||||
|
||||
dnl check for cygwin stuff
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
|
||||
dnl ************************************************************
|
||||
@@ -47,6 +43,15 @@ AC_HELP_STRING([--disable-debug],[Disable debug options]),
|
||||
CPPFLAGS="$CPPFLAGS -DCURLDEBUG -I$srcdir/../include"
|
||||
CFLAGS="$CFLAGS -g"
|
||||
|
||||
dnl check for how to do large files, needed to get the curl_off_t check
|
||||
dnl done right
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
AC_CHECK_SIZEOF(curl_off_t, ,[
|
||||
#include <stdio.h>
|
||||
#include "$srcdir/../include/curl/curl.h"
|
||||
])
|
||||
|
||||
dnl set compiler "debug" options to become more picky, and remove
|
||||
dnl optimize options from CFLAGS
|
||||
CURL_CC_DEBUG_OPTS
|
||||
@@ -57,8 +62,146 @@ AC_HELP_STRING([--disable-debug],[Disable debug options]),
|
||||
)
|
||||
|
||||
dnl libtool setup
|
||||
CARES_CLEAR_LIBTOOL_TAGS
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
AC_MSG_CHECKING([if we need -no-undefined])
|
||||
case $host in
|
||||
*-*-cygwin | *-*-mingw* | *-*-pw32*)
|
||||
need_no_undefined=yes
|
||||
;;
|
||||
*)
|
||||
need_no_undefined=no
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT($need_no_undefined)
|
||||
AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Checks for libraries.
|
||||
dnl **********************************************************************
|
||||
|
||||
dnl gethostbyname without lib or in the nsl lib?
|
||||
AC_CHECK_FUNC(gethostbyname,
|
||||
[HAVE_GETHOSTBYNAME="1"
|
||||
],
|
||||
[ AC_CHECK_LIB(nsl, gethostbyname,
|
||||
[HAVE_GETHOSTBYNAME="1"
|
||||
LIBS="$LIBS -lnsl"
|
||||
])
|
||||
])
|
||||
|
||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||
then
|
||||
dnl gethostbyname in the socket lib?
|
||||
AC_CHECK_LIB(socket, gethostbyname,
|
||||
[HAVE_GETHOSTBYNAME="1"
|
||||
LIBS="$LIBS -lsocket"
|
||||
])
|
||||
fi
|
||||
|
||||
dnl At least one system has been identified to require BOTH nsl and socket
|
||||
dnl libs at the same time to link properly.
|
||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||
then
|
||||
AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
|
||||
my_ac_save_LIBS=$LIBS
|
||||
LIBS="-lnsl -lsocket $LIBS"
|
||||
AC_TRY_LINK( ,
|
||||
[gethostbyname();],
|
||||
[ dnl found it!
|
||||
HAVE_GETHOSTBYNAME="1"
|
||||
AC_MSG_RESULT([yes])],
|
||||
[ dnl failed!
|
||||
AC_MSG_RESULT([no])
|
||||
dnl restore LIBS
|
||||
LIBS=$my_ac_save_LIBS]
|
||||
)
|
||||
fi
|
||||
|
||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||
then
|
||||
dnl This is for Msys/Mingw
|
||||
AC_MSG_CHECKING([for gethostbyname in ws2_32])
|
||||
my_ac_save_LIBS=$LIBS
|
||||
LIBS="-lws2_32 $LIBS"
|
||||
AC_TRY_LINK([#include <winsock2.h>],
|
||||
[gethostbyname("www.dummysite.com");],
|
||||
[ dnl worked!
|
||||
ws2="yes"
|
||||
AC_MSG_RESULT([yes])
|
||||
HAVE_GETHOSTBYNAME="1"],
|
||||
[ dnl failed, restore LIBS
|
||||
LIBS=$my_ac_save_LIBS
|
||||
AC_MSG_RESULT(no)]
|
||||
)
|
||||
fi
|
||||
|
||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||
then
|
||||
dnl This is for eCos with a stubbed DNS implementation
|
||||
AC_MSG_CHECKING([for gethostbyname for eCos])
|
||||
AC_TRY_LINK([
|
||||
#include <stdio.h>
|
||||
#include <netdb.h>],
|
||||
[gethostbyname("www.dummysite.com");],
|
||||
[ dnl worked!
|
||||
AC_MSG_RESULT([yes])
|
||||
HAVE_GETHOSTBYNAME="1"],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
fi
|
||||
|
||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||
then
|
||||
dnl gethostbyname in the net lib - for BeOS
|
||||
AC_CHECK_LIB(net, gethostbyname,
|
||||
[HAVE_GETHOSTBYNAME="1"
|
||||
LIBS="$LIBS -lnet"
|
||||
])
|
||||
fi
|
||||
|
||||
|
||||
if test "$HAVE_GETHOSTBYNAME" = "1"; then
|
||||
AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [If you have gethostbyname])
|
||||
else
|
||||
AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
|
||||
fi
|
||||
|
||||
dnl resolve lib?
|
||||
AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ])
|
||||
|
||||
if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
|
||||
AC_CHECK_LIB(resolve, strcasecmp,
|
||||
[LIBS="-lresolve $LIBS"],
|
||||
,
|
||||
-lnsl)
|
||||
fi
|
||||
|
||||
dnl socket lib?
|
||||
AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
|
||||
|
||||
dnl dl lib?
|
||||
AC_CHECK_FUNC(dlclose, , [ AC_CHECK_LIB(dl, dlopen) ])
|
||||
|
||||
AC_MSG_CHECKING([whether to use libgcc])
|
||||
AC_ARG_ENABLE(libgcc,
|
||||
AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
|
||||
[ case "$enableval" in
|
||||
yes)
|
||||
LIBS="$LIBS -lgcc"
|
||||
AC_MSG_RESULT(yes)
|
||||
;;
|
||||
*) AC_MSG_RESULT(no)
|
||||
;;
|
||||
esac ],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Back to "normal" configuring
|
||||
dnl **********************************************************************
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
|
||||
@@ -74,6 +217,8 @@ CURL_CHECK_HEADER_WINSOCK
|
||||
CURL_CHECK_HEADER_WINSOCK2
|
||||
CURL_CHECK_HEADER_WS2TCPIP
|
||||
|
||||
CURL_CHECK_HEADER_MALLOC
|
||||
|
||||
dnl check for a few basic system headers we need
|
||||
AC_CHECK_HEADERS(
|
||||
sys/types.h \
|
||||
@@ -121,10 +266,6 @@ AC_C_CONST
|
||||
AC_TYPE_SIZE_T
|
||||
AC_HEADER_TIME
|
||||
|
||||
AC_CHECK_SIZEOF(curl_off_t, ,[
|
||||
#include <stdio.h>
|
||||
#include "$srcdir/include/curl/curl.h"
|
||||
])
|
||||
AC_CHECK_SIZEOF(size_t)
|
||||
AC_CHECK_SIZEOF(long)
|
||||
AC_CHECK_SIZEOF(time_t)
|
||||
@@ -155,6 +296,11 @@ TYPE_IN_ADDR_T
|
||||
|
||||
TYPE_SOCKADDR_STORAGE
|
||||
|
||||
CURL_CHECK_FUNC_RECV
|
||||
|
||||
CURL_CHECK_FUNC_SEND
|
||||
|
||||
CURL_CHECK_MSG_NOSIGNAL
|
||||
|
||||
dnl check for AF_INET6
|
||||
CARES_CHECK_CONSTANT(
|
||||
@@ -428,7 +574,8 @@ int main()
|
||||
}
|
||||
], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE_UNQUOTED(HAVE_INET_NTOP_IPV6,1,[Define to 1 if inet_ntop supports IPv6.])
|
||||
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
|
||||
|
||||
@@ -494,13 +641,15 @@ 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 variant is available
|
||||
dnl God bless non-standardized functions! We need to see which getservbyport_r
|
||||
dnl variant is available
|
||||
CARES_CHECK_GETSERVBYPORT_R
|
||||
|
||||
CURL_CHECK_NONBLOCKING_SOCKET
|
||||
|
||||
AC_C_BIGENDIAN(
|
||||
[AC_DEFINE(ARES_BIG_ENDIAN, 1, [define this if ares is built for a big endian system])],
|
||||
[AC_DEFINE(ARES_BIG_ENDIAN, 1,
|
||||
[define this if ares is built for a big endian system])],
|
||||
,
|
||||
[AC_MSG_WARN([couldn't figure out endianess, assuming little endian!])]
|
||||
)
|
||||
|
@@ -1,3 +1,5 @@
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (c) 1996,1999 by Internet Software Consortium.
|
||||
|
@@ -1,3 +1,6 @@
|
||||
#ifndef __ARES_INET_NET_PTON_H
|
||||
#define __ARES_INET_NET_PTON_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
@@ -14,9 +17,6 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#ifndef INET_NET_PTON_H
|
||||
#define INET_NET_PTON_H
|
||||
|
||||
#if defined(HAVE_INET_PTON) && defined(HAVE_INET_PTON_IPV6)
|
||||
#define ares_inet_pton(x,y,z) inet_pton(x,y,z)
|
||||
#else
|
||||
@@ -28,4 +28,4 @@ int ares_inet_pton(int af, const char *src, void *dst);
|
||||
int ares_inet_net_pton(int af, const char *src, void *dst, size_t size);
|
||||
#endif
|
||||
|
||||
#endif /* INET_NET_PTON_H */
|
||||
#endif /* __ARES_INET_NET_PTON_H */
|
||||
|
@@ -129,9 +129,13 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
|
||||
* Keep this in mind if you think this function should have been coded
|
||||
* to use pointer overlays. All the world's not a VAX.
|
||||
*/
|
||||
char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
|
||||
struct { int base, len; } best = { 0,0 }, cur = { 0,0 };
|
||||
unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ];
|
||||
char tmp[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
|
||||
char *tp;
|
||||
struct {
|
||||
long base;
|
||||
long len;
|
||||
} best, cur;
|
||||
unsigned long words[NS_IN6ADDRSZ / NS_INT16SZ];
|
||||
int i;
|
||||
|
||||
/*
|
||||
@@ -139,11 +143,15 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
|
||||
* Copy the input (bytewise) array into a wordwise array.
|
||||
* Find the longest run of 0x00's in src[] for :: shorthanding.
|
||||
*/
|
||||
memset(words, '\0', sizeof words);
|
||||
memset(words, '\0', sizeof(words));
|
||||
for (i = 0; i < NS_IN6ADDRSZ; i++)
|
||||
words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
|
||||
|
||||
best.base = -1;
|
||||
cur.base = -1;
|
||||
best.len = 0;
|
||||
cur.len = 0;
|
||||
|
||||
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++)
|
||||
{
|
||||
if (words[i] == 0)
|
||||
@@ -192,12 +200,12 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
|
||||
if (i == 6 && best.base == 0 &&
|
||||
(best.len == 6 || (best.len == 5 && words[5] == 0xffff)))
|
||||
{
|
||||
if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
|
||||
if (!inet_ntop4(src+12, tp, sizeof(tmp) - (tp - tmp)))
|
||||
return (NULL);
|
||||
tp += strlen(tp);
|
||||
break;
|
||||
}
|
||||
tp += SPRINTF((tp, "%x", words[i]));
|
||||
tp += SPRINTF((tp, "%lx", words[i]));
|
||||
}
|
||||
|
||||
/* Was it a trailing run of 0x00's? */
|
||||
|
@@ -1,3 +1,6 @@
|
||||
#ifndef __ARES_INET_NTOP_H
|
||||
#define __ARES_INET_NTOP_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/*
|
||||
@@ -14,13 +17,10 @@
|
||||
* without express or implied warranty.
|
||||
*/
|
||||
|
||||
#ifndef INET_NTOP_H
|
||||
#define INET_NTOP_H
|
||||
|
||||
#ifdef HAVE_INET_NTOP
|
||||
#if defined(HAVE_INET_NTOP) && defined(HAVE_INET_NTOP_IPV6)
|
||||
#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);
|
||||
#endif
|
||||
|
||||
#endif /* INET_NET_NTOP_H */
|
||||
#endif /* __ARES_INET_NTOP_H */
|
||||
|
@@ -7,7 +7,9 @@
|
||||
port build */
|
||||
|
||||
#ifndef NETWARE
|
||||
#ifndef __CYGWIN__
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#include <process.h> /* for the _getpid() proto */
|
||||
#endif /* !NETWARE */
|
||||
#include <sys/types.h>
|
||||
|
16
ares/setup.h
16
ares/setup.h
@@ -1,6 +1,8 @@
|
||||
#ifndef __ARES_SETUP_H
|
||||
#define __ARES_SETUP_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 2004 - 2005 by Daniel Stenberg et al
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software and its
|
||||
@@ -43,7 +45,11 @@
|
||||
* Include header files for windows builds before redefining anything.
|
||||
* Use this preproessor block only to include or exclude windows.h,
|
||||
* winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
|
||||
* to any other further and independant block.
|
||||
* to any other further and independant block. Under Cygwin things work
|
||||
* just as under linux (e.g. <sys/socket.h>) and the winsock headers should
|
||||
* never be included when __CYGWIN__ is defined. configure script takes
|
||||
* care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H,
|
||||
* neither HAVE_WS2TCPIP_H when __CYGWIN__ is defined.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
@@ -145,4 +151,12 @@ int ares_strcasecmp(const char *s1, const char *s2);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Include macros and defines that should only be processed once.
|
||||
*/
|
||||
|
||||
#ifndef __SETUP_ONCE_H
|
||||
#include "setup_once.h"
|
||||
#endif
|
||||
|
||||
#endif /* __ARES_SETUP_H */
|
||||
|
109
ares/setup_once.h
Normal file
109
ares/setup_once.h
Normal file
@@ -0,0 +1,109 @@
|
||||
#ifndef __SETUP_ONCE_H
|
||||
#define __SETUP_ONCE_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 2004 - 2006 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.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* If we have the MSG_NOSIGNAL define, make sure we use
|
||||
* it as the fourth argument of send() and recv()
|
||||
*/
|
||||
|
||||
#ifdef HAVE_MSG_NOSIGNAL
|
||||
#define SEND_4TH_ARG MSG_NOSIGNAL
|
||||
#else
|
||||
#define SEND_4TH_ARG 0
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* The definitions for the return type and arguments types
|
||||
* of functions recv() and send() belong and come from the
|
||||
* configuration file. Do not define them in any other place.
|
||||
*
|
||||
* HAVE_RECV is defined if you have a function named recv()
|
||||
* which is used to read incoming data from sockets. If your
|
||||
* function has another name then don't define HAVE_RECV.
|
||||
*
|
||||
* If HAVE_RECV is defined then RECV_TYPE_ARG1, RECV_TYPE_ARG2,
|
||||
* RECV_TYPE_ARG3, RECV_TYPE_ARG4 and RECV_TYPE_RETV must also
|
||||
* be defined.
|
||||
*
|
||||
* HAVE_SEND is defined if you have a function named send()
|
||||
* which is used to write outgoing data on a connected socket.
|
||||
* If yours has another name then don't define HAVE_SEND.
|
||||
*
|
||||
* If HAVE_SEND is defined then SEND_TYPE_ARG1, SEND_QUAL_ARG2,
|
||||
* SEND_TYPE_ARG2, SEND_TYPE_ARG3, SEND_TYPE_ARG4 and
|
||||
* SEND_TYPE_RETV must also be defined.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_RECV
|
||||
#if !defined(RECV_TYPE_ARG1) || \
|
||||
!defined(RECV_TYPE_ARG2) || \
|
||||
!defined(RECV_TYPE_ARG3) || \
|
||||
!defined(RECV_TYPE_ARG4) || \
|
||||
!defined(RECV_TYPE_RETV)
|
||||
/* */
|
||||
Error Missing_definition_of_return_and_arguments_types_of_recv
|
||||
/* */
|
||||
#else
|
||||
#define sread(x,y,z) (ssize_t)recv((RECV_TYPE_ARG1)(x), \
|
||||
(RECV_TYPE_ARG2)(y), \
|
||||
(RECV_TYPE_ARG3)(z), \
|
||||
(RECV_TYPE_ARG4)(SEND_4TH_ARG))
|
||||
#endif
|
||||
#else /* HAVE_RECV */
|
||||
#ifdef DJGPP
|
||||
#define sread(x,y,z) (ssize_t)read_s((int)(x), (char *)(y), (int)(z))
|
||||
#endif
|
||||
#ifndef sread
|
||||
/* */
|
||||
Error Missing_definition_of_macro_sread
|
||||
/* */
|
||||
#endif
|
||||
#endif /* HAVE_RECV */
|
||||
|
||||
#ifdef HAVE_SEND
|
||||
#if !defined(SEND_TYPE_ARG1) || \
|
||||
!defined(SEND_QUAL_ARG2) || \
|
||||
!defined(SEND_TYPE_ARG2) || \
|
||||
!defined(SEND_TYPE_ARG3) || \
|
||||
!defined(SEND_TYPE_ARG4) || \
|
||||
!defined(SEND_TYPE_RETV)
|
||||
/* */
|
||||
Error Missing_definition_of_return_and_arguments_types_of_send
|
||||
/* */
|
||||
#else
|
||||
#define swrite(x,y,z) (ssize_t)send((SEND_TYPE_ARG1)(x), \
|
||||
(SEND_TYPE_ARG2)(y), \
|
||||
(SEND_TYPE_ARG3)(z), \
|
||||
(SEND_TYPE_ARG4)(SEND_4TH_ARG))
|
||||
#endif
|
||||
#else /* HAVE_SEND */
|
||||
#ifdef DJGPP
|
||||
#define swrite(x,y,z) (ssize_t)write_s((int)(x), (char *)(y), (int)(z))
|
||||
#endif
|
||||
#ifndef swrite
|
||||
/* */
|
||||
Error Missing_definition_of_macro_swrite
|
||||
/* */
|
||||
#endif
|
||||
#endif /* HAVE_SEND */
|
||||
|
||||
|
||||
#endif /* __SETUP_ONCE_H */
|
||||
|
@@ -1,5 +1,7 @@
|
||||
#include "setup.h"
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* only do the following on windows
|
||||
*/
|
||||
#if (defined(WIN32) || defined(WATT32)) && !defined(MSDOS)
|
||||
@@ -100,6 +102,6 @@ ares_writev (ares_socket_t s, const struct iovec *vector, size_t count)
|
||||
memcpy (bp, vector[i].iov_base, vector[i].iov_len);
|
||||
bp += vector[i].iov_len;
|
||||
}
|
||||
return send (s, (const void*)buffer, bytes, 0);
|
||||
return (int)swrite(s, buffer, bytes);
|
||||
}
|
||||
#endif /* WIN32 builds only */
|
||||
|
124
configure.ac
124
configure.ac
@@ -306,6 +306,13 @@ 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 **********************************************************************
|
||||
@@ -366,6 +373,21 @@ then
|
||||
)
|
||||
fi
|
||||
|
||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||
then
|
||||
dnl This is for eCos with a stubbed DNS implementation
|
||||
AC_MSG_CHECKING([for gethostbyname for eCos])
|
||||
AC_TRY_LINK([
|
||||
#include <stdio.h>
|
||||
#include <netdb.h>],
|
||||
[gethostbyname("www.dummysite.com");],
|
||||
[ dnl worked!
|
||||
AC_MSG_RESULT([yes])
|
||||
HAVE_GETHOSTBYNAME="1"],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
fi
|
||||
|
||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||
then
|
||||
dnl gethostbyname in the net lib - for BeOS
|
||||
@@ -465,6 +487,15 @@ dnl **********************************************************************
|
||||
dnl Check for the presence of the winmm library.
|
||||
dnl **********************************************************************
|
||||
|
||||
case $host in
|
||||
*-*-cygwin*)
|
||||
dnl Under Cygwin, winmm exists but is not needed as WIN32 is not #defined
|
||||
dnl and gettimeofday() will be used regardless of the outcome of this test.
|
||||
dnl Skip this test, otherwise -lwinmm will be needlessly added to LIBS
|
||||
dnl (and recorded as such in the .la file, potentially affecting downstream
|
||||
dnl clients of the library.)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_CHECKING([for timeGetTime in winmm])
|
||||
my_ac_save_LIBS=$LIBS
|
||||
LIBS="-lwinmm $LIBS"
|
||||
@@ -479,6 +510,8 @@ AC_TRY_LINK([#include <windef.h>
|
||||
LIBS=$my_ac_save_LIBS
|
||||
AC_MSG_RESULT(no)]
|
||||
)
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Checks for IPv6
|
||||
@@ -519,10 +552,6 @@ main()
|
||||
|
||||
if test "$ipv6" = "yes"; then
|
||||
curl_ipv6_msg="enabled"
|
||||
|
||||
CURL_CHECK_WORKING_GETADDRINFO
|
||||
|
||||
CURL_CHECK_NI_WITHSCOPEID
|
||||
fi
|
||||
|
||||
dnl **********************************************************************
|
||||
@@ -881,6 +910,12 @@ if test X"$OPT_SSL" != Xno; then
|
||||
fi
|
||||
|
||||
dnl This is for Msys/Mingw
|
||||
case $host in
|
||||
*-*-cygwin*)
|
||||
dnl Under Cygwin this is extraneous and causes an unnecessary -lgdi32
|
||||
dnl to be added to LIBS and recorded in the .la file.
|
||||
;;
|
||||
*)
|
||||
AC_MSG_CHECKING([for gdi32])
|
||||
my_ac_save_LIBS=$LIBS
|
||||
LIBS="-lgdi32 $LIBS"
|
||||
@@ -893,6 +928,8 @@ if test X"$OPT_SSL" != Xno; then
|
||||
LIBS=$my_ac_save_LIBS
|
||||
AC_MSG_RESULT(no)]
|
||||
)
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_CHECK_LIB(crypto, CRYPTO_lock,[
|
||||
HAVECRYPTO="yes"
|
||||
@@ -940,9 +977,18 @@ if test X"$OPT_SSL" != Xno; then
|
||||
AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]))
|
||||
|
||||
if test $ac_cv_header_openssl_x509_h = no; then
|
||||
AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h,
|
||||
dnl we don't use the "action" part of the AC_CHECK_HEADERS macro
|
||||
dnl since 'err.h' might in fact find a krb4 header with the same
|
||||
dnl name
|
||||
AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h)
|
||||
|
||||
if test $ac_cv_header_x509_h = yes &&
|
||||
test $ac_cv_header_crypto_h = yes &&
|
||||
test $ac_cv_header_ssl_h = yes; then
|
||||
dnl three matches
|
||||
curl_ssl_msg="enabled (OpenSSL)"
|
||||
OPENSSL_ENABLED=1)
|
||||
OPENSSL_ENABLED=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1396,7 +1442,8 @@ if test x$cross_compiling != xyes; then
|
||||
AC_MSG_RESULT(no)
|
||||
,
|
||||
dnl not invoked when crosscompiling)
|
||||
])
|
||||
echo "hej"
|
||||
)
|
||||
fi
|
||||
else
|
||||
dnl and for crosscompilings
|
||||
@@ -1411,6 +1458,7 @@ dnl **********************************************************************
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
|
||||
CURL_CHECK_HEADER_MALLOC
|
||||
|
||||
dnl Now check for the very most basic headers. Then we can use these
|
||||
dnl ones as default-headers when checking for the rest!
|
||||
@@ -1422,7 +1470,6 @@ AC_CHECK_HEADERS(
|
||||
sys/ioctl.h \
|
||||
assert.h \
|
||||
unistd.h \
|
||||
malloc.h \
|
||||
stdlib.h \
|
||||
limits.h \
|
||||
arpa/inet.h \
|
||||
@@ -1517,6 +1564,12 @@ TYPE_SOCKADDR_STORAGE
|
||||
|
||||
AC_FUNC_SELECT_ARGTYPES
|
||||
|
||||
CURL_CHECK_FUNC_RECV
|
||||
|
||||
CURL_CHECK_FUNC_SEND
|
||||
|
||||
CURL_CHECK_MSG_NOSIGNAL
|
||||
|
||||
dnl Checks for library functions.
|
||||
dnl AC_PROG_GCC_TRADITIONAL
|
||||
AC_TYPE_SIGNAL
|
||||
@@ -1562,7 +1615,8 @@ AC_CHECK_FUNCS( strtoll \
|
||||
poll \
|
||||
getprotobyname \
|
||||
getrlimit \
|
||||
setrlimit,
|
||||
setrlimit \
|
||||
fork,
|
||||
dnl if found
|
||||
[],
|
||||
dnl if not found, $ac_func is the name we check for
|
||||
@@ -1652,6 +1706,11 @@ 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
|
||||
CURL_CHECK_NI_WITHSCOPEID
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if we are Mac OS X (to disable poll)])
|
||||
disable_poll=no
|
||||
case $host in
|
||||
@@ -1917,6 +1976,52 @@ AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
|
||||
AC_MSG_RESULT(yes)
|
||||
)
|
||||
|
||||
dnl ************************************************************
|
||||
dnl Enable hiding of internal symbols in library to reduce its size and
|
||||
dnl speed dynamic linking of applications. This currently is only supported
|
||||
dnl on gcc >= 4.0 and SunPro C.
|
||||
dnl
|
||||
AC_MSG_CHECKING([whether to enable hidden symbols in the library])
|
||||
AC_ARG_ENABLE(hidden-symbols,
|
||||
AC_HELP_STRING([--enable-hidden-symbols],[Hide internal symbols in library])
|
||||
AC_HELP_STRING([--disable-hidden-symbols],[Leave all symbols with default visibility in library]),
|
||||
[ case "$enableval" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_CHECKING([whether $CC supports it])
|
||||
if test "$GCC" = yes ; then
|
||||
if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(CURL_HIDDEN_SYMBOLS, 1, [to enable hidden symbols])
|
||||
AC_SUBST(CURL_HIDDEN_SYMBOLS)
|
||||
AC_DEFINE(CURL_EXTERN_SYMBOL, [__attribute__ ((visibility ("default")))], [to make a symbol visible])
|
||||
AC_SUBST(CURL_EXTERN_SYMBOL)
|
||||
CFLAGS="$CFLAGS -fvisibility=hidden"
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
else
|
||||
dnl Test for SunPro cc
|
||||
if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(CURL_HIDDEN_SYMBOLS, 1, [to enable hidden symbols])
|
||||
AC_SUBST(CURL_HIDDEN_SYMBOLS)
|
||||
AC_DEFINE(CURL_EXTERN_SYMBOL, [__global], [to make a symbol visible])
|
||||
AC_SUBST(CURL_EXTERN_SYMBOL)
|
||||
CFLAGS="$CFLAGS -xldscope=hidden"
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac ],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
|
||||
dnl ************************************************************
|
||||
if test "x$ws2" = "xyes"; then
|
||||
|
||||
dnl If ws2_32 is wanted, make sure it is the _last_ lib in LIBS (makes
|
||||
@@ -1956,6 +2061,7 @@ AC_CONFIG_FILES([Makefile \
|
||||
packages/vms/Makefile \
|
||||
packages/AIX/Makefile \
|
||||
packages/AIX/RPM/Makefile \
|
||||
packages/AIX/RPM/curl.spec \
|
||||
curl-config \
|
||||
libcurl.pc
|
||||
])
|
||||
|
@@ -1,10 +1,30 @@
|
||||
#! /bin/sh
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 2001 - 2006, 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
|
||||
# are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
#
|
||||
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
# copies of the Software, and permit persons to whom the Software is
|
||||
# furnished to do so, under the terms of the COPYING file.
|
||||
#
|
||||
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
# KIND, either express or implied.
|
||||
#
|
||||
# $Id$
|
||||
###########################################################################
|
||||
#
|
||||
# The idea to this kind of setup info script was stolen from numerous
|
||||
# other packages, such as neon, libxml and gnome.
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
includedir=@includedir@
|
||||
@@ -19,6 +39,7 @@ Available values for OPTION include:
|
||||
--ca ca bundle install path
|
||||
--cc compiler
|
||||
--cflags pre-processor and compiler flags
|
||||
--checkfor [version] check for (lib)curl of the specified version
|
||||
--features newline separated list of enabled features
|
||||
--protocols newline separated list of enabled protocols
|
||||
--help display this help and exit
|
||||
@@ -122,6 +143,26 @@ while test $# -gt 0; do
|
||||
exit 0
|
||||
;;
|
||||
|
||||
--checkfor)
|
||||
checkfor=$2
|
||||
cmajor=`echo $checkfor | cut -d. -f1`
|
||||
cminor=`echo $checkfor | cut -d. -f2`
|
||||
# when extracting the patch part we strip off everything after a
|
||||
# dash as that's used for things like version 1.2.3-CVS
|
||||
cpatch=`echo $checkfor | cut -d. -f3 | cut -d- -f1`
|
||||
checknum=`echo "$cmajor*256*256 + $cminor*256 + ${cpatch:-0}" | bc`
|
||||
numuppercase=`echo @VERSIONNUM@ | tr 'a-f' 'A-F'`
|
||||
nownum=`echo "obase=10; ibase=16; $numuppercase" | bc`
|
||||
|
||||
if test "$nownum" -ge "$checknum"; then
|
||||
# silent success
|
||||
exit 0
|
||||
else
|
||||
echo "requested version $checkfor is newer than existing @VERSION@"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
--vernum)
|
||||
echo @VERSIONNUM@
|
||||
exit 0
|
||||
|
@@ -46,8 +46,8 @@ Cocoa
|
||||
|
||||
D
|
||||
|
||||
Written by Charles Sanders and James Wavro
|
||||
http://www.atari-soldiers.com/libcurl.html
|
||||
Written by Kenneth Bogert
|
||||
http://curl.haxx.se/libcurl/d/
|
||||
|
||||
Dylan
|
||||
|
||||
@@ -155,6 +155,11 @@ S-Lang
|
||||
S-Lang binding written by John E Davis
|
||||
http://www.jedsoft.org/slang/modules/curl.html
|
||||
|
||||
SPL
|
||||
|
||||
SPL binding written by Clifford Wolf
|
||||
http://www.clifford.at/spl/
|
||||
|
||||
Tcl
|
||||
|
||||
Tclcurl is written by Andr<64>s Garc<72>a
|
||||
@@ -173,3 +178,8 @@ wxWidgets
|
||||
|
||||
Written by Casey O'Donnell
|
||||
http://homepage.mac.com/codonnell/wxcurldav/
|
||||
|
||||
XBLite
|
||||
|
||||
Written by David Szafranski
|
||||
http://perso.wanadoo.fr/xblite/libraries.html
|
||||
|
@@ -1,12 +1,12 @@
|
||||
Date: October 27, 2005
|
||||
Date: May 15, 2006
|
||||
Author: Daniel Stenberg <daniel@haxx.se>
|
||||
URL: http://curl.haxx.se/legal/distro-dilemma.html
|
||||
|
||||
Condition
|
||||
|
||||
This document is written to describe the situation as it is right
|
||||
now. libcurl 7.15.0 is currently the latest version available. Things may (or
|
||||
perhaps will) of course change in the future.
|
||||
now. libcurl 7.15.3 is currently the latest version available. Things may of
|
||||
course change in the future.
|
||||
|
||||
This document reflects my view and understanding of these things. Please tell
|
||||
me where and how you think I'm wrong, and I'll try to correct my mistakes.
|
||||
@@ -16,11 +16,10 @@ Background
|
||||
The Free Software Foundation has deemed the Original BSD license[1] to be
|
||||
"incompatible"[2] with GPL[3]. I'd rather say it is the other way around, but
|
||||
the point is the same: if you distribute a binary version of a GPL program,
|
||||
it MUST NOT be linked with any Original BSD-licensed parts or
|
||||
libraries. Doing so will violate the GPL license. For a long time, very many
|
||||
GPL licensed programs have avoided this license mess by adding an
|
||||
exception[8] to their license. And many others have just closed their eyes
|
||||
for this problem.
|
||||
it MUST NOT be linked with any Original BSD-licensed parts or libraries.
|
||||
Doing so will violate the GPL license. For a long time, very many GPL
|
||||
licensed programs have avoided this license mess by adding an exception[8] to
|
||||
their license. And many others have just closed their eyes for this problem.
|
||||
|
||||
libcurl is MIT-style[4] licensed - how on earth did this dilemma fall onto
|
||||
our plates?
|
||||
@@ -49,25 +48,13 @@ Part of the Operating System
|
||||
Debian does however not take this stance and has officially(?) claimed that
|
||||
OpenSSL is not a required part of the Debian operating system
|
||||
|
||||
Debian-legal
|
||||
|
||||
In August 2004 I figured I should start pulling people's attention to this to
|
||||
see if anyone has any bright ideas or if they would dismiss my worries based
|
||||
on some elegant writing I had missed somewhere:
|
||||
|
||||
My post to debian-legal on August 12 2004:
|
||||
|
||||
http://lists.debian.org/debian-legal/2004/08/msg00279.html
|
||||
|
||||
Several people agreed then that this is a known and rather big problem, but
|
||||
the following discussion didn't result in much.
|
||||
|
||||
GnuTLS
|
||||
|
||||
With the release of libcurl 7.14.0 (May 2005), it can now get built to use
|
||||
GnuTLS instead of OpenSSL. GnuTLS is a LGPL[7] licensed library that offers a
|
||||
matching set of features as OpenSSL does. Now, you can build and distribute
|
||||
an SSL capable libcurl without including any Original BSD licensed code.
|
||||
With the release of libcurl 7.14.0 (May 2005), libcurl can now get built to
|
||||
use GnuTLS instead of OpenSSL. GnuTLS is an LGPL[7] licensed library that
|
||||
offers a matching set of features as OpenSSL does. Now, you can build and
|
||||
distribute an TLS/SSL capable libcurl without including any Original BSD
|
||||
licensed code.
|
||||
|
||||
I believe Debian is the first distro to provide libcurl/GnutTLS packages.
|
||||
|
||||
@@ -80,23 +67,20 @@ GnuTLS vs OpenSSL
|
||||
and it has not been tested nor used very extensively, while the OpenSSL
|
||||
equivalent code has been used and thus matured for more than seven (7) years.
|
||||
|
||||
In August 2005, the debian-devel mailing list discovered the license issue as
|
||||
a GPL licensed application wanted SSL capabilities from libcurl and thus was
|
||||
forced to use the GnuTLS powered libcurl. For a reason that is unknown to me,
|
||||
the application authors didn't want to or was unable to add an exception to
|
||||
their GPL license. Alas, the license problem hit the fan again.
|
||||
|
||||
GnuTLS
|
||||
- LGPL licensened
|
||||
- supports SRP
|
||||
- lacks SSLv2 support
|
||||
- lacks MD2 support (used by at least some CA certs)
|
||||
- lacks the crypto functions libcurl uses for NTLM
|
||||
|
||||
OpenSSL
|
||||
- Original BSD licensened
|
||||
- lacks SRP
|
||||
- supports SSLv2
|
||||
- older and more widely used
|
||||
- provides crypto functions libcurl uses for NTLM
|
||||
- libcurl can do non-blocking connects with it in 7.15.4 and later
|
||||
|
||||
The Better License, Original BSD or LGPL?
|
||||
|
||||
@@ -124,20 +108,21 @@ More SSL Libraries
|
||||
Application Angle of this Problem
|
||||
|
||||
libcurl is built to use one SSL/TLS library. It uses a single fixed name (by
|
||||
default), and applications are built/linked to use that single lib. Replacing
|
||||
one libcurl instance with another one that uses the other SSL/TLS library
|
||||
might break one or more applications (due to ABI differences and/or different
|
||||
feature set). You want your application to use the libcurl it was built for.
|
||||
default) on the built/created lib file, and applications are built/linked to
|
||||
use that single lib. Replacing one libcurl instance with another one that
|
||||
uses the other SSL/TLS library might break one or more applications (due to
|
||||
ABI differences and/or different feature set). You want your application to
|
||||
use the libcurl it was built for.
|
||||
|
||||
Project cURL Angle of this Problem
|
||||
|
||||
We distribute libcurl and everyone may build libcurl with either library. At
|
||||
We distribute libcurl and everyone may build libcurl with either library at
|
||||
their choice. This problem is not directly a problem of ours. It merely
|
||||
affects users - GPL application authors only - of our lib as it comes
|
||||
included and delivered on some distros.
|
||||
|
||||
libcurl has different ABI when built with different SSL/TLS libraries due to
|
||||
two reasons:
|
||||
these reasons:
|
||||
|
||||
1. No one has worked on fixing this. The mutex/lock callbacks should be set
|
||||
with a generic libcurl function that should use the proper underlying
|
||||
@@ -146,25 +131,25 @@ Project cURL Angle of this Problem
|
||||
2. The CURLOPT_SSL_CTX_FUNCTION option is not possible to "emulate" on GnuTLS
|
||||
but simply requires OpenSSL.
|
||||
|
||||
3. There might be some other subtle differences just because nobody has yet
|
||||
tried to make a fixed ABI like this.
|
||||
|
||||
Distro Angle of this Problem
|
||||
|
||||
A distro can provide separate libcurls built with different SSL/TLS libraries
|
||||
to work around this, but at least Debian seems to be very hostile against
|
||||
such an approach, probably since it makes things like devel packages for the
|
||||
different libs collide since they would provide the same include files and
|
||||
man pages etc.
|
||||
To my knowledge there is only one distro that ships libcurl built with either
|
||||
one of the SSL libs supported.
|
||||
|
||||
Debian Linux is now (since mid September 2005) providing two different
|
||||
libcurl packages, one for libcurl built with OpenSSL and one built with
|
||||
GnuTLS. They use different .so names and can this both be installed in a
|
||||
single system simultaneously. This has been said to be a transitional system
|
||||
not desired to keep in the long run.
|
||||
|
||||
Fixing the Only Problem
|
||||
|
||||
The only problem is thus for distributions that want to offer libcurl
|
||||
versions built with more than one SSL/TLS library.
|
||||
|
||||
Debian is now (since mid September 2005) providing two different devel
|
||||
packages, one for libcurl built with OpenSSL and one built with GnuTLS. They
|
||||
use different .so names and can this both be installed in a single system
|
||||
simultaneously. This has previously been said as a transitional system not
|
||||
desired to keep in the long run.
|
||||
|
||||
Since multiple libcurl binaries using different names are ruled out, we need
|
||||
to come up with a way to have one single libcurl that someone uses different
|
||||
underlying libraries. The best(?) approach currently suggested involves this:
|
||||
@@ -194,9 +179,9 @@ Fixing the Only Problem
|
||||
|
||||
When Will This Happen
|
||||
|
||||
Note again that this is not a problem in curl, it doesn't solve any actual
|
||||
technical problems in our project. Don't hold your breath for this to happen
|
||||
very soon (if at all) unless you step forward and contribute.
|
||||
This is not a problem in curl, it doesn't solve any actual technical problems
|
||||
in our project. Don't hold your breath for this to happen very soon (if at
|
||||
all) unless you step forward and contribute.
|
||||
|
||||
The suggestion that is outlined above is still only a suggestion. Feel free
|
||||
to bring a better idea!
|
||||
@@ -206,7 +191,7 @@ When Will This Happen
|
||||
code like today (without the use of lib2), should you decide to ignore the
|
||||
problems outlined in this document.
|
||||
|
||||
Update: Work on this has been initiated by Richard Atterer:
|
||||
Work on this was suggested by Richard Atterer:
|
||||
|
||||
http://curl.haxx.se/mail/lib-2005-09/0066.html
|
||||
|
||||
|
@@ -91,8 +91,8 @@ FTP
|
||||
- no dir depth limit
|
||||
|
||||
FTPS (*1)
|
||||
- explicit ftps:// support that use SSL on both connections
|
||||
- implicit "AUTH TSL" and "AUTH SSL" usage to "upgrade" plain ftp://
|
||||
- implicit ftps:// support that use SSL on both connections
|
||||
- explicit "AUTH TSL" and "AUTH SSL" usage to "upgrade" plain ftp://
|
||||
connection to use SSL for both or one of the connections
|
||||
|
||||
TFTP
|
||||
|
38
docs/INSTALL
38
docs/INSTALL
@@ -129,6 +129,18 @@ UNIX
|
||||
If you're a curl developer and use gcc, you might want to enable more
|
||||
debug options with the --enable-debug option.
|
||||
|
||||
curl can be built to use a whole range of libraries to provide various
|
||||
useful services, and configure will try to auto-detect a decent
|
||||
default. But if you want to alter it, you can select how to deal with
|
||||
each individual library.
|
||||
|
||||
To build with GnuTLS support instead of OpenSSL for SSL/TLS, note that
|
||||
you need to use both --without-ssl and --with-gnutls.
|
||||
|
||||
To build with yassl support instead of OpenSSL or GunTLS, you must build
|
||||
yassl with its OpenSSL emulation enabled and point to that directory root
|
||||
with configure --with-ssl.
|
||||
|
||||
Win32
|
||||
=====
|
||||
|
||||
@@ -506,13 +518,17 @@ CROSS COMPILE
|
||||
|
||||
./configure --host=ARCH-OS
|
||||
|
||||
REDUCING SIZE
|
||||
=============
|
||||
|
||||
There are a number of configure options that can be used to reduce the
|
||||
size of libcurl for embedded applications where binary size is an
|
||||
important factor. First, be sure to set the CFLAGS environment variable
|
||||
when configuring with any compiler optimization flags to reduce the
|
||||
size of the binary. For gcc, this would mean at minimum:
|
||||
important factor. First, be sure to set the CFLAGS variable when
|
||||
configuring with any relevant compiler optimization flags to reduce the
|
||||
size of the binary. For gcc, this would mean at minimum the -Os option
|
||||
and probably the -march=X option as well, e.g.:
|
||||
|
||||
env CFLAGS='-Os' ./configure ...
|
||||
./configure CFLAGS='-Os' ...
|
||||
|
||||
Be sure to specify as many --disable- and --without- flags on the configure
|
||||
command-line as you can to disable all the libcurl features that you
|
||||
@@ -526,10 +542,24 @@ CROSS COMPILE
|
||||
--disable-crypto-auth (disables HTTP cryptographic authentication)
|
||||
--disable-ipv6 (disables support for IPv6)
|
||||
--disable-verbose (eliminates debugging strings and error code strings)
|
||||
--enable-hidden-symbols (eliminates unneeded symbols in library)
|
||||
--without-libidn (disables support for the libidn DNS library)
|
||||
--without-ssl (disables support for SSL/TLS)
|
||||
--without-zlib (disables support for on-the-fly decompression)
|
||||
|
||||
The GNU linker has a number of options to reduce the size of the libcurl
|
||||
dynamic libraries on some platforms even further. Specify them by giving
|
||||
the options -Wl,-Bsymbolic and -Wl,-s on the gcc command-line.
|
||||
Be sure also to strip debugging symbols from your binaries after
|
||||
compiling using 'strip' (or the appropriate variant if cross-compiling).
|
||||
If space is really tight, you may be able to remove some unneeded
|
||||
sections of the 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 less than 90 KB in
|
||||
size (as of version 7.15.4).
|
||||
|
||||
You may find that statically linking libcurl to your application will
|
||||
result in a lower total size.
|
||||
|
||||
|
@@ -3,6 +3,15 @@ join in and help us correct one or more of these! Also be sure to check the
|
||||
changelog of the current development status, as one or more of these problems
|
||||
may have been fixed since this was written!
|
||||
|
||||
34. The SOCKS connection codes don't properly acknowledge (connect) timeouts.
|
||||
|
||||
33. Doing multi-pass HTTP authentication on a non-default port does not work.
|
||||
This happens because the multi-pass code abuses the redirect following code
|
||||
for doing multiple requests, and when we following redirects to an absolute
|
||||
URL we must use the newly specified port and not the one specified in the
|
||||
original URL. A proper fix to this would need to separate the negotiation
|
||||
"redirect" from an actual redirect.
|
||||
|
||||
32. (At least on Windows) If libcurl is built with c-ares and there's no DNS
|
||||
server configured in the system, the ares_init() call fails and thus
|
||||
curl_easy_init() fails as well. This causes weird effects for people who use
|
||||
@@ -26,8 +35,6 @@ may have been fixed since this was written!
|
||||
|
||||
See http://curl.haxx.se/bug/view.cgi?id=1371118
|
||||
|
||||
28. The TFTP code is not portable and will fail on some architectures.
|
||||
|
||||
26. NTLM authentication using SSPI (on Windows) when (lib)curl is running in
|
||||
"system context" will make it use wrong(?) user name - at least when compared
|
||||
to what winhttp does. See http://curl.haxx.se/bug/view.cgi?id=1281867
|
||||
@@ -59,6 +66,8 @@ may have been fixed since this was written!
|
||||
specification). The receiver will convert the data from the standard
|
||||
form to his own internal form.
|
||||
|
||||
Since 7.15.4 at least line endings are converted.
|
||||
|
||||
19. FTP 3rd party transfers with the multi interface doesn't work. Test:
|
||||
define CURL_MULTIEASY, rebuild curl, run test case 230 - 232.
|
||||
|
||||
@@ -94,10 +103,6 @@ may have been fixed since this was written!
|
||||
http://curl.haxx.se/bug/view.cgi?id=1004841. How?
|
||||
http://curl.haxx.se/mail/lib-2004-08/0182.html
|
||||
|
||||
9. --limit-rate using -d or -F does not work. This is because the limit logic
|
||||
is provided by the curl app in its read/write callbacks, and when doing
|
||||
-d/-F the callbacks aren't used! http://curl.haxx.se/bug/view.cgi?id=921395
|
||||
|
||||
8. Doing resumed upload over HTTP does not work with '-C -', because curl
|
||||
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]'.
|
||||
|
@@ -32,7 +32,8 @@ OpenSSL http://www.openssl.org/source/license.html
|
||||
are not allowed to ship binaries that link with OpenSSL that includes
|
||||
GPL code (unless that specific GPL code includes an exception for
|
||||
OpenSSL - a habit that is growing more and more common). If OpenSSL's
|
||||
licensing is a problem for you, consider using GnuTLS instead.
|
||||
licensing is a problem for you, consider using GnuTLS or yassl
|
||||
instead.
|
||||
|
||||
GnuTLS http://www.gnutls.org/
|
||||
|
||||
@@ -41,6 +42,11 @@ GnuTLS http://www.gnutls.org/
|
||||
GnuTLS itself depends on and uses other libs (libgcrypt and
|
||||
libgpg-error) and they too are LGPL- or GPL-licensed.
|
||||
|
||||
yassl http://www.yassl.com/
|
||||
|
||||
(May be used for SSL/TLS support) Uses the GPL[1] license. If this is
|
||||
a problem for you, consider using OpenSSL or GnuTLS instead.
|
||||
|
||||
c-ares http://daniel.haxx.se/projects/c-ares/license.html
|
||||
|
||||
(Used for asynchronous name resolves) Uses an MIT license that is very
|
||||
|
@@ -726,7 +726,7 @@ LDAP
|
||||
Working with LDAP URLs":
|
||||
http://developer.netscape.com/docs/manuals/dirsdk/csdk30/url.htm
|
||||
|
||||
RFC 2255, "The LDAP URL Format" http://www.rfc-editor.org/rfc/rfc2255.txt
|
||||
RFC 2255, "The LDAP URL Format" http://curl.haxx.se/rfc/rfc2255.txt
|
||||
|
||||
To show you an example, this is now I can get all people from my local LDAP
|
||||
server that has a certain sub-domain in their email address:
|
||||
|
19
docs/THANKS
19
docs/THANKS
@@ -8,6 +8,7 @@ Adrian Schuur
|
||||
Alan Pinstein
|
||||
Albert Chin-A-Young
|
||||
Albert Choy
|
||||
Ale Vesely
|
||||
Aleksandar Milivojevic
|
||||
Alex Neblett
|
||||
Alex Suykov
|
||||
@@ -20,6 +21,7 @@ Alexis Carvalho
|
||||
Amol Pattekar
|
||||
Andi Jahja
|
||||
Andreas Damm
|
||||
Andreas Ntaflos
|
||||
Andreas Olsson
|
||||
Andreas Rieke
|
||||
Andres Garcia
|
||||
@@ -34,6 +36,7 @@ Angus Mackay
|
||||
Antoine Calando
|
||||
Anton Kalmykov
|
||||
Arkadiusz Miskiewicz
|
||||
Ates Goral
|
||||
Augustus Saunders
|
||||
Avery Fay
|
||||
Ben Greear
|
||||
@@ -47,6 +50,7 @@ Brad Burdick
|
||||
Bradford Bruce
|
||||
Brent Beardsley
|
||||
Brian Akins
|
||||
Brian Dessent
|
||||
Brian R Duffy
|
||||
Bruce Mitchener
|
||||
Bryan Henderson
|
||||
@@ -96,6 +100,7 @@ David James
|
||||
David Kimdon
|
||||
David Lang
|
||||
David LeBlanc
|
||||
David McCreedy
|
||||
David Odin
|
||||
David Phillips
|
||||
David Shaw
|
||||
@@ -188,6 +193,7 @@ Ian Wilkes
|
||||
Ignacio Vazquez-Abrams
|
||||
Igor Polyakov
|
||||
Ilguiz Latypov
|
||||
Ilja van Sprundel
|
||||
Ingo Ralf Blum
|
||||
Ingo Wilken
|
||||
Jacky Lam
|
||||
@@ -248,6 +254,7 @@ Kai-Uwe Rommel
|
||||
Kang-Jin Lee
|
||||
Karl Moerder
|
||||
Karol Pietrzak
|
||||
Katie Wang
|
||||
Keith MacDonald
|
||||
Keith McGuigan
|
||||
Ken Hirsch
|
||||
@@ -293,6 +300,8 @@ Marco G. Salvagno
|
||||
Marcus Webster
|
||||
Mario Schroeder
|
||||
Mark Butler
|
||||
Mark Eichin
|
||||
Markus Koetter
|
||||
Markus Moeller
|
||||
Markus Oberhumer
|
||||
Martijn Koster
|
||||
@@ -316,7 +325,9 @@ Michael Mealling
|
||||
Michael Wallner
|
||||
Michal Bonino
|
||||
Michal Marek
|
||||
Michele Bini
|
||||
Mihai Ionescu
|
||||
Mikael Sennerholm
|
||||
Mike Bytnar
|
||||
Mike Dobbs
|
||||
Miklos Nemeth
|
||||
@@ -341,6 +352,7 @@ Nis Jorgensen
|
||||
Nodak Sodak
|
||||
Norbert Novotny
|
||||
Ofer
|
||||
Olaf St<53>ben
|
||||
Oren Tirosh
|
||||
P R Schaffner
|
||||
Patrick Bihan-Faou
|
||||
@@ -349,6 +361,7 @@ Paul Harrington
|
||||
Paul Marquis
|
||||
Paul Moore
|
||||
Paul Nolan
|
||||
Paul Querna
|
||||
Pavel Cenek
|
||||
Pavel Orehov
|
||||
Pawel A. Gajda
|
||||
@@ -356,6 +369,7 @@ Pedro Neves
|
||||
Pete Su
|
||||
Peter Bray
|
||||
Peter Forret
|
||||
Peter Heuchert
|
||||
Peter Pentchev
|
||||
Peter Su
|
||||
Peter Sylvester
|
||||
@@ -397,7 +411,9 @@ Robert D. Young
|
||||
Robert Olson
|
||||
Robert Weaver
|
||||
Robin Kay
|
||||
Robson Braga Araujo
|
||||
Rodney Simmons
|
||||
Roland Blom
|
||||
Roland Krikava
|
||||
Roland Zimmermann
|
||||
Roman Koifman
|
||||
@@ -445,6 +461,7 @@ S
|
||||
T. Bharath
|
||||
T. Yamada
|
||||
Temprimus
|
||||
Thomas Klausner
|
||||
Thomas Schwinge
|
||||
Thomas Tonino
|
||||
Tim Baker
|
||||
@@ -453,6 +470,7 @@ Tim Costello
|
||||
Tim Sneddon
|
||||
Toby Peterson
|
||||
Todd Kulesza
|
||||
Todd Vierling
|
||||
Tom Benoist
|
||||
Tom Lee
|
||||
Tom Mattison
|
||||
@@ -485,6 +503,7 @@ Wesley Laxton
|
||||
Wez Furlong
|
||||
Wilfredo Sanchez
|
||||
Wojciech Zwiefka
|
||||
Xavier Bouchoux
|
||||
Yang Tse
|
||||
Yarram Sunil
|
||||
Zvi Har'El
|
||||
|
29
docs/TODO
29
docs/TODO
@@ -14,12 +14,6 @@ TODO
|
||||
|
||||
LIBCURL
|
||||
|
||||
* Introduce an interface to libcurl that allows applications to easier get to
|
||||
know what cookies that are received. CURLINFO_COOKIELIST to get a
|
||||
curl_slist with cookies (netscape/mozilla cookie file formatted), and
|
||||
CURLOPT_COOKIELIST to set a list of cookies (using the same format).
|
||||
http://curl.haxx.se/mail/lib-2004-12/0195.html
|
||||
|
||||
* Introduce another callback interface for upload/download that makes one
|
||||
less copy of data and thus a faster operation.
|
||||
[http://curl.haxx.se/dev/no_copy_callbacks.txt]
|
||||
@@ -64,13 +58,8 @@ TODO
|
||||
|
||||
LIBCURL - multi interface
|
||||
|
||||
* Add a curl_multi_fdset() alternative. this allows apps to avoid the
|
||||
FD_SETSIZE problem with select().
|
||||
|
||||
* Add curl_multi_timeout() to make libcurl's ares-functionality better.
|
||||
|
||||
* Make sure we don't ever loop because of non-blocking sockets return
|
||||
EWOULDBLOCK or similar. This FTP command sending, the SSL connection etc.
|
||||
EWOULDBLOCK or similar. The GnuTLS connection etc.
|
||||
|
||||
* Make transfers treated more carefully. We need a way to tell libcurl we
|
||||
have data to write, as the current system expects us to upload data each
|
||||
@@ -80,10 +69,6 @@ TODO
|
||||
ready to accept read data. Today libcurl feeds the data as soon as it is
|
||||
available for reading, no matter what.
|
||||
|
||||
* Add curl_multi_socket() and family to the multi interface that gets file
|
||||
descriptors, as an alternative to the curl_multi_fdset(). This is necessary
|
||||
to allow apps to properly avoid the FD_SETSIZE problem.
|
||||
|
||||
* Make curl_easy_perform() a wrapper-function that simply creates a multi
|
||||
handle, adds the easy handle to it, runs curl_multi_perform() until the
|
||||
transfer is done, then detach the easy handle, destroy the multi handle and
|
||||
@@ -150,6 +135,10 @@ TODO
|
||||
|
||||
SSL
|
||||
|
||||
* Provide a libcurl API for setting mutex callbacks in the underlying SSL
|
||||
library, so that the same application code can use mutex-locking
|
||||
independently of OpenSSL or GnutTLS being used.
|
||||
|
||||
* Anton Fedorov's "dumpcert" patch:
|
||||
http://curl.haxx.se/mail/lib-2004-03/0088.html
|
||||
|
||||
@@ -201,6 +190,11 @@ TODO
|
||||
* Work out a common method with Peter Sylvester's OpenSSL-patch for SRP
|
||||
on the TLS to provide name and password
|
||||
|
||||
* Fix the connection phase to be non-blocking when multi interface is used
|
||||
|
||||
* Add a way to check if the connection seems to be alive, to corrspond to the
|
||||
SSL_peak() way we use with OpenSSL.
|
||||
|
||||
LDAP
|
||||
|
||||
* Look over the implementation. The looping will have to "go away" from the
|
||||
@@ -212,7 +206,8 @@ TODO
|
||||
* RTSP - RFC2326 (protocol - very HTTP-like, also contains URL description)
|
||||
|
||||
* SFTP/SCP/SSH (no RFCs for protocol nor URI/URL format). An implementation
|
||||
should most probably use an existing ssh library, such as OpenSSH.
|
||||
should most probably use an existing ssh library, such as OpenSSH. or
|
||||
libssh2.org
|
||||
|
||||
* RSYNC (no RFCs for protocol nor URI/URL format). An implementation should
|
||||
most probably use an existing rsync library, such as librsync.
|
||||
|
@@ -5,7 +5,7 @@
|
||||
.\" * | (__| |_| | _ <| |___
|
||||
.\" * \___|\___/|_| \_\_____|
|
||||
.\" *
|
||||
.\" * Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
.\" * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
.\" *
|
||||
.\" * This software is licensed as described in the file COPYING, which
|
||||
.\" * you should have received as part of this distribution. The terms
|
||||
@@ -21,7 +21,7 @@
|
||||
.\" * $Id$
|
||||
.\" **************************************************************************
|
||||
.\"
|
||||
.TH curl-config 1 "25 Jan 2004" "Curl 7.13.0" "curl-config manual"
|
||||
.TH curl-config 1 "25 Jan 2004" "Curl 7.15.4" "curl-config manual"
|
||||
.SH NAME
|
||||
curl-config \- Get information about a libcurl installation
|
||||
.SH SYNOPSIS
|
||||
@@ -37,6 +37,11 @@ Displays the compiler used to build libcurl.
|
||||
.IP "--cflags"
|
||||
Set of compiler options (CFLAGS) to use when compiling files that use
|
||||
libcurl. Currently that is only thw include path to the curl include files.
|
||||
.IP "--checkfor [version]"
|
||||
Specify the oldest possible libcurl version string you want, and this
|
||||
script will return 0 if the current installation is new enough or it
|
||||
returns 1 and outputs a text saying that the current version is not new
|
||||
enough. (Added in 7.15.4)
|
||||
.IP "--feature"
|
||||
Lists what particular main features the installed libcurl was built with. At
|
||||
the time of writing, this list may include SSL, KRB4 or IPv6. Do not assume
|
||||
|
51
docs/curl.1
51
docs/curl.1
@@ -21,7 +21,7 @@
|
||||
.\" * $Id$
|
||||
.\" **************************************************************************
|
||||
.\"
|
||||
.TH curl 1 "21 Feb 2006" "Curl 7.15.2" "Curl Manual"
|
||||
.TH curl 1 "21 Mar 2006" "Curl 7.15.4" "Curl Manual"
|
||||
.SH NAME
|
||||
curl \- transfer a URL
|
||||
.SH SYNOPSIS
|
||||
@@ -43,7 +43,7 @@ curl is powered by libcurl for all transfer-related features. See
|
||||
for details.
|
||||
.SH URL
|
||||
The URL syntax is protocol dependent. You'll find a detailed description in
|
||||
RFC 2396.
|
||||
RFC 3986.
|
||||
|
||||
You can specify multiple URLs or parts of URLs by writing part sets within
|
||||
braces as in:
|
||||
@@ -396,6 +396,11 @@ in 7.11.0)
|
||||
If this option is used several times, the following occurrences make no
|
||||
difference.
|
||||
|
||||
.IP "--ftp-alternative-to-user <command>"
|
||||
(FTP) If authenticating with the USER and PASS commands fails, send this
|
||||
command. When connecting to Tumbleweed's Secure Transport server over FTPS
|
||||
using a client certificate, using "SITE AUTH" will tell the server to retrieve
|
||||
the username from the certificate. (Added in 7.15.5)
|
||||
.IP "--ftp-skip-pasv-ip"
|
||||
(FTP) Tell curl to not use the IP address the server suggests in its response
|
||||
to curl's PASV command when curl connects the data connection. Instead curl
|
||||
@@ -407,7 +412,15 @@ This option has no effect if PORT, EPRT or EPSV is used instead of PASV.
|
||||
If this option is used twice, the second will again use the server's suggested
|
||||
address.
|
||||
.IP "--ftp-ssl"
|
||||
(FTP) Make the FTP connection switch to use SSL/TLS. (Added in 7.11.0)
|
||||
(FTP) Try to use SSL/TLS for the FTP connection.
|
||||
Reverts to a non-secure connection if the server doesn't support SSL/TLS.
|
||||
(Added in 7.11.0)
|
||||
|
||||
If this option is used twice, the second will again disable this.
|
||||
.IP "--ftp-ssl-reqd"
|
||||
(FTP) Require SSL/TLS for the FTP connection.
|
||||
Terminates the connection if the server doesn't support SSL/TLS.
|
||||
(Added in 7.15.5)
|
||||
|
||||
If this option is used twice, the second will again disable this.
|
||||
.IP "-F/--form <name=content>"
|
||||
@@ -1131,6 +1144,10 @@ Number of new connects made in the recent transfer. (Added in 7.12.3)
|
||||
.TP
|
||||
.B num_redirects
|
||||
Number of redirects that were followed in the request. (Added in 7.12.3)
|
||||
.TP
|
||||
.B ftp_entry_path
|
||||
The initial path libcurl ended up in when logging on to the remote FTP
|
||||
server. (Added in 7.15.4)
|
||||
.RE
|
||||
|
||||
If this option is used several times, the last one will be used.
|
||||
@@ -1236,7 +1253,7 @@ If this option is used twice, the second will again disable the progress bar.
|
||||
.SH FILES
|
||||
.I ~/.curlrc
|
||||
.RS
|
||||
Default config file.
|
||||
Default config file, see \fI-K/--config\fP for details.
|
||||
|
||||
.SH ENVIRONMENT
|
||||
.IP "http_proxy [protocol://]<host>[:port]"
|
||||
@@ -1389,6 +1406,32 @@ Unrecognized transfer encoding
|
||||
Invalid LDAP URL
|
||||
.IP 63
|
||||
Maximum file size exceeded
|
||||
.IP 64
|
||||
Requested FTP SSL level failed
|
||||
.IP 65
|
||||
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
|
||||
.IP 68
|
||||
File not found on TFTP server
|
||||
.IP 69
|
||||
Permission problem on TFTP server
|
||||
.IP 70
|
||||
Out of disk space on TFTP server
|
||||
.IP 71
|
||||
Illegal TFTP operation
|
||||
.IP 72
|
||||
Unknown TFTP transfer ID
|
||||
.IP 73
|
||||
File already exists (TFTP)
|
||||
.IP 74
|
||||
No such user (TFTP)
|
||||
.IP 75
|
||||
Character conversion failed
|
||||
.IP 76
|
||||
Character conversion functions required
|
||||
.IP XX
|
||||
There will appear more error codes here in future releases. The existing ones
|
||||
are meant to never change.
|
||||
|
@@ -11,7 +11,7 @@ EXTRA_DIST = README curlgtk.c sepheaders.c simple.c postit2.c \
|
||||
multi-post.c fopen.c simplepost.c makefile.dj curlx.c https.c \
|
||||
multi-debugcallback.c fileupload.c getinfo.c ftp3rdparty.c debug.c \
|
||||
anyauthput.c htmltitle.cc htmltidy.c opensslthreadlock.c \
|
||||
cookie_interface.c cacertinmem.c synctime.c
|
||||
cookie_interface.c cacertinmem.c synctime.c sampleconv.c ftpuploadresume.c
|
||||
|
||||
all:
|
||||
@echo "done"
|
||||
|
154
docs/examples/ftpuploadresume.c
Normal file
154
docs/examples/ftpuploadresume.c
Normal file
@@ -0,0 +1,154 @@
|
||||
/*****************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Upload to FTP, resuming failed transfers
|
||||
*
|
||||
* Compile for MinGW like this:
|
||||
* gcc -Wall -pedantic -std=c99 ftpuploadwithresume.c -o ftpuploadresume.exe
|
||||
* -lcurl -lmsvcr70
|
||||
*
|
||||
* Written by Philip Bock
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
|
||||
/* The MinGW headers are missing a few Win32 function definitions,
|
||||
you shouldn't need this if you use VC++ */
|
||||
int __cdecl _snscanf(const char * input, size_t length, const char * format, ...);
|
||||
|
||||
|
||||
/* parse headers for Content-Length */
|
||||
size_t getcontentlengthfunc(void *ptr, size_t size, size_t nmemb, void *stream) {
|
||||
int r;
|
||||
long len = 0;
|
||||
|
||||
/* _snscanf() is Win32 specific */
|
||||
r = _snscanf(ptr, size * nmemb, "Content-Length: %ld\n", &len);
|
||||
|
||||
if (r) /* Microsoft: we don't read the specs */
|
||||
*((long *) stream) = len;
|
||||
|
||||
return size * nmemb;
|
||||
}
|
||||
|
||||
/* discard downloaded data */
|
||||
size_t discardfunc(void *ptr, size_t size, size_t nmemb, void *stream) {
|
||||
return size * nmemb;
|
||||
}
|
||||
|
||||
/* read data to upload */
|
||||
size_t readfunc(void *ptr, size_t size, size_t nmemb, void *stream)
|
||||
{
|
||||
FILE *f = stream;
|
||||
size_t n;
|
||||
|
||||
if (ferror(f))
|
||||
return CURL_READFUNC_ABORT;
|
||||
|
||||
n = fread(ptr, size, nmemb, f) * size;
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
|
||||
long timeout, long tries)
|
||||
{
|
||||
FILE *f;
|
||||
long uploaded_len = 0;
|
||||
CURLcode r = CURLE_GOT_NOTHING;
|
||||
int c;
|
||||
|
||||
f = fopen(localpath, "rb");
|
||||
if (f == NULL) {
|
||||
perror(NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
curl_easy_setopt(curlhandle, CURLOPT_UPLOAD, TRUE);
|
||||
|
||||
curl_easy_setopt(curlhandle, CURLOPT_URL, remotepath);
|
||||
|
||||
if (timeout)
|
||||
curl_easy_setopt(curlhandle, CURLOPT_FTP_RESPONSE_TIMEOUT, timeout);
|
||||
|
||||
curl_easy_setopt(curlhandle, CURLOPT_HEADERFUNCTION, getcontentlengthfunc);
|
||||
curl_easy_setopt(curlhandle, CURLOPT_HEADERDATA, &uploaded_len);
|
||||
|
||||
curl_easy_setopt(curlhandle, CURLOPT_WRITEFUNCTION, discardfunc);
|
||||
|
||||
curl_easy_setopt(curlhandle, CURLOPT_READFUNCTION, readfunc);
|
||||
curl_easy_setopt(curlhandle, CURLOPT_READDATA, f);
|
||||
|
||||
curl_easy_setopt(curlhandle, CURLOPT_FTPPORT, "-"); /* disable passive mode */
|
||||
curl_easy_setopt(curlhandle, CURLOPT_FTP_CREATE_MISSING_DIRS, TRUE);
|
||||
|
||||
curl_easy_setopt(curlhandle, CURLOPT_VERBOSE, TRUE);
|
||||
|
||||
for (c = 0; (r != CURLE_OK) && (c < tries); c++) {
|
||||
/* are we resuming? */
|
||||
if (c) { /* yes */
|
||||
/* determine the length of the file already written */
|
||||
|
||||
/*
|
||||
* With NOBODY and NOHEADER, libcurl will issue a SIZE
|
||||
* command, but the only way to retrieve the result is
|
||||
* to parse the returned Content-Length header. Thus,
|
||||
* getcontentlengthfunc(). We need discardfunc() above
|
||||
* because HEADER will dump the headers to stdout
|
||||
* without it.
|
||||
*/
|
||||
curl_easy_setopt(curlhandle, CURLOPT_NOBODY, TRUE);
|
||||
curl_easy_setopt(curlhandle, CURLOPT_HEADER, TRUE);
|
||||
|
||||
r = curl_easy_perform(curlhandle);
|
||||
if (r != CURLE_OK)
|
||||
continue;
|
||||
|
||||
curl_easy_setopt(curlhandle, CURLOPT_NOBODY, FALSE);
|
||||
curl_easy_setopt(curlhandle, CURLOPT_HEADER, FALSE);
|
||||
|
||||
fseek(f, uploaded_len, SEEK_SET);
|
||||
|
||||
curl_easy_setopt(curlhandle, CURLOPT_FTPAPPEND, TRUE);
|
||||
}
|
||||
else { /* no */
|
||||
curl_easy_setopt(curlhandle, CURLOPT_FTPAPPEND, FALSE);
|
||||
}
|
||||
|
||||
r = curl_easy_perform(curlhandle);
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
|
||||
if (r == CURLE_OK)
|
||||
return 1;
|
||||
else {
|
||||
fprintf(stderr, "%s\n", curl_easy_strerror(r));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int main(int c, char **argv) {
|
||||
CURL *curlhandle = NULL;
|
||||
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
curlhandle = curl_easy_init();
|
||||
|
||||
upload(curlhandle, "ftp://user:pass@host/path/file", "C:\\file", 0, 3);
|
||||
|
||||
curl_easy_cleanup(curlhandle);
|
||||
curl_global_cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
@@ -87,8 +87,10 @@ int main(int argc, char **argv)
|
||||
/* now specify which file to upload */
|
||||
curl_easy_setopt(curl, CURLOPT_READDATA, hd_src);
|
||||
|
||||
/* and give the size of the upload */
|
||||
curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, file_info.st_size);
|
||||
/* provide the size of the upload, we specicially typecast the value
|
||||
to curl_off_t since we must be sure to use the correct data size */
|
||||
curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE,
|
||||
(curl_off_t)file_info.st_size);
|
||||
|
||||
/* Now run off and do what you've been told! */
|
||||
res = curl_easy_perform(curl);
|
||||
|
@@ -24,12 +24,13 @@ int main(int argc, char *argv[])
|
||||
CURLM *multi_handle;
|
||||
int still_running;
|
||||
|
||||
struct HttpPost *formpost=NULL;
|
||||
struct HttpPost *lastptr=NULL;
|
||||
struct curl_httppost *formpost=NULL;
|
||||
struct curl_httppost *lastptr=NULL;
|
||||
struct curl_slist *headerlist=NULL;
|
||||
char buf[] = "Expect:";
|
||||
|
||||
/* Fill in the file upload field */
|
||||
/* Fill in the file upload field. This makes libcurl load data from
|
||||
the given file name when curl_easy_perform() is called. */
|
||||
curl_formadd(&formpost,
|
||||
&lastptr,
|
||||
CURLFORM_COPYNAME, "sendfile",
|
||||
@@ -43,7 +44,6 @@ int main(int argc, char *argv[])
|
||||
CURLFORM_COPYCONTENTS, "postit2.c",
|
||||
CURLFORM_END);
|
||||
|
||||
|
||||
/* Fill in the submit field too, even if this is rarely needed */
|
||||
curl_formadd(&formpost,
|
||||
&lastptr,
|
||||
|
95
docs/examples/sampleconv.c
Normal file
95
docs/examples/sampleconv.c
Normal file
@@ -0,0 +1,95 @@
|
||||
/*****************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
/*
|
||||
This is a simple example showing how a program on a non-ASCII platform
|
||||
would invoke callbacks to do its own codeset conversions instead of
|
||||
using the built-in iconv functions in libcurl.
|
||||
|
||||
The IBM-1047 EBCDIC codeset is used for this example but the code
|
||||
would be similar for other non-ASCII codesets.
|
||||
|
||||
Three callback functions are created below:
|
||||
my_conv_from_ascii_to_ebcdic,
|
||||
my_conv_from_ebcdic_to_ascii, and
|
||||
my_conv_from_utf8_to_ebcdic
|
||||
|
||||
The "platform_xxx" calls represent platform-specific conversion routines.
|
||||
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLcode my_conv_from_ascii_to_ebcdic(char *buffer, size_t length)
|
||||
{
|
||||
char *tempptrin, *tempptrout;
|
||||
size_t bytes = length;
|
||||
int rc;
|
||||
tempptrin = tempptrout = buffer;
|
||||
rc = platform_a2e(&tempptrin, &bytes, &tempptrout, &bytes);
|
||||
if (rc == PLATFORM_CONV_OK) {
|
||||
return(CURLE_OK);
|
||||
} else {
|
||||
return(CURLE_CONV_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
CURLcode my_conv_from_ebcdic_to_ascii(char *buffer, size_t length)
|
||||
{
|
||||
char *tempptrin, *tempptrout;
|
||||
size_t bytes = length;
|
||||
int rc;
|
||||
tempptrin = tempptrout = buffer;
|
||||
rc = platform_e2a(&tempptrin, &bytes, &tempptrout, &bytes);
|
||||
if (rc == PLATFORM_CONV_OK) {
|
||||
return(CURLE_OK);
|
||||
} else {
|
||||
return(CURLE_CONV_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
CURLcode my_conv_from_utf8_to_ebcdic(char *buffer, size_t length)
|
||||
{
|
||||
char *tempptrin, *tempptrout;
|
||||
size_t bytes = length;
|
||||
int rc;
|
||||
tempptrin = tempptrout = buffer;
|
||||
rc = platform_u2e(&tempptrin, &bytes, &tempptrout, &bytes);
|
||||
if (rc == PLATFORM_CONV_OK) {
|
||||
return(CURLE_OK);
|
||||
} else {
|
||||
return(CURLE_CONV_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
|
||||
|
||||
/* use platform-specific functions for codeset conversions */
|
||||
curl_easy_setopt(curl, CURLOPT_CONV_FROM_NETWORK_FUNCTION,
|
||||
my_conv_from_ascii_to_ebcdic);
|
||||
curl_easy_setopt(curl, CURLOPT_CONV_TO_NETWORK_FUNCTION,
|
||||
my_conv_from_ebcdic_to_ascii);
|
||||
curl_easy_setopt(curl, CURLOPT_CONV_FROM_UTF8_FUNCTION,
|
||||
my_conv_from_utf8_to_ebcdic);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
/* always cleanup */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
return 0;
|
||||
}
|
@@ -59,7 +59,9 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#ifndef __CYGWIN__
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#include <curl/curl.h>
|
||||
|
||||
|
||||
|
@@ -9,14 +9,16 @@ man_MANS = curl_easy_cleanup.3 curl_easy_getinfo.3 curl_easy_init.3 \
|
||||
curl_formadd.3 curl_formfree.3 curl_getdate.3 curl_getenv.3 \
|
||||
curl_slist_append.3 curl_slist_free_all.3 curl_version.3 \
|
||||
curl_version_info.3 curl_escape.3 curl_unescape.3 curl_free.3 \
|
||||
curl_strequal.3 curl_mprintf.3 curl_global_init.3 \
|
||||
curl_global_cleanup.3 curl_multi_add_handle.3 curl_multi_cleanup.3 \
|
||||
curl_multi_fdset.3 curl_multi_info_read.3 curl_multi_init.3 \
|
||||
curl_multi_perform.3 curl_multi_remove_handle.3 curl_share_cleanup.3 \
|
||||
curl_share_init.3 curl_share_setopt.3 libcurl.3 libcurl-easy.3 \
|
||||
libcurl-multi.3 libcurl-share.3 libcurl-errors.3 curl_easy_strerror.3 \
|
||||
curl_strequal.3 curl_mprintf.3 curl_global_init.3 curl_global_cleanup.3 \
|
||||
curl_multi_add_handle.3 curl_multi_cleanup.3 curl_multi_fdset.3 \
|
||||
curl_multi_info_read.3 curl_multi_init.3 curl_multi_perform.3 \
|
||||
curl_multi_remove_handle.3 curl_share_cleanup.3 curl_share_init.3 \
|
||||
curl_share_setopt.3 libcurl.3 libcurl-easy.3 libcurl-multi.3 \
|
||||
libcurl-share.3 libcurl-errors.3 curl_easy_strerror.3 \
|
||||
curl_multi_strerror.3 curl_share_strerror.3 curl_global_init_mem.3 \
|
||||
libcurl-tutorial.3 curl_easy_reset.3
|
||||
libcurl-tutorial.3 curl_easy_reset.3 curl_easy_escape.3 \
|
||||
curl_easy_unescape.3 curl_multi_setopt.3 curl_multi_socket.3 \
|
||||
curl_multi_timeout.3 curl_formget.3 curl_multi_assign.3
|
||||
|
||||
HTMLPAGES = curl_easy_cleanup.html curl_easy_getinfo.html \
|
||||
curl_easy_init.html curl_easy_perform.html curl_easy_setopt.html \
|
||||
@@ -25,30 +27,33 @@ HTMLPAGES = curl_easy_cleanup.html curl_easy_getinfo.html \
|
||||
curl_slist_free_all.html curl_version.html curl_version_info.html \
|
||||
curl_escape.html curl_unescape.html curl_free.html curl_strequal.html \
|
||||
curl_mprintf.html curl_global_init.html curl_global_cleanup.html \
|
||||
curl_multi_add_handle.html curl_multi_cleanup.html \
|
||||
curl_multi_fdset.html curl_multi_info_read.html curl_multi_init.html \
|
||||
curl_multi_perform.html curl_multi_remove_handle.html \
|
||||
curl_share_cleanup.html curl_share_init.html curl_share_setopt.html \
|
||||
libcurl.html libcurl-multi.html libcurl-easy.html libcurl-share.html \
|
||||
curl_multi_add_handle.html curl_multi_cleanup.html curl_multi_fdset.html \
|
||||
curl_multi_info_read.html curl_multi_init.html curl_multi_perform.html \
|
||||
curl_multi_remove_handle.html curl_share_cleanup.html \
|
||||
curl_share_init.html curl_share_setopt.html libcurl.html \
|
||||
libcurl-multi.html libcurl-easy.html libcurl-share.html \
|
||||
libcurl-errors.html curl_easy_strerror.html curl_multi_strerror.html \
|
||||
curl_share_strerror.html curl_global_init_mem.html \
|
||||
libcurl-tutorial.html curl_easy_reset.html
|
||||
curl_share_strerror.html curl_global_init_mem.html libcurl-tutorial.html \
|
||||
curl_easy_reset.html curl_easy_escape.html curl_easy_unescape.html \
|
||||
curl_multi_setopt.html curl_multi_socket.html curl_multi_timeout.html \
|
||||
curl_formget.html curl_multi_assign.html
|
||||
|
||||
PDFPAGES = curl_easy_cleanup.pdf curl_easy_getinfo.pdf \
|
||||
curl_easy_init.pdf curl_easy_perform.pdf curl_easy_setopt.pdf \
|
||||
curl_easy_duphandle.pdf curl_formadd.pdf curl_formfree.pdf \
|
||||
curl_getdate.pdf curl_getenv.pdf curl_slist_append.pdf \
|
||||
curl_slist_free_all.pdf curl_version.pdf curl_version_info.pdf \
|
||||
curl_escape.pdf curl_unescape.pdf curl_free.pdf curl_strequal.pdf \
|
||||
curl_mprintf.pdf curl_global_init.pdf curl_global_cleanup.pdf \
|
||||
curl_multi_add_handle.pdf curl_multi_cleanup.pdf curl_multi_fdset.pdf \
|
||||
curl_multi_info_read.pdf curl_multi_init.pdf curl_multi_perform.pdf \
|
||||
curl_multi_remove_handle.pdf curl_share_cleanup.pdf \
|
||||
curl_share_init.pdf curl_share_setopt.pdf libcurl.pdf \
|
||||
libcurl-multi.pdf libcurl-easy.pdf libcurl-share.pdf \
|
||||
PDFPAGES = curl_easy_cleanup.pdf curl_easy_getinfo.pdf curl_easy_init.pdf \
|
||||
curl_easy_perform.pdf curl_easy_setopt.pdf curl_easy_duphandle.pdf \
|
||||
curl_formadd.pdf curl_formfree.pdf curl_getdate.pdf curl_getenv.pdf \
|
||||
curl_slist_append.pdf curl_slist_free_all.pdf curl_version.pdf \
|
||||
curl_version_info.pdf curl_escape.pdf curl_unescape.pdf curl_free.pdf \
|
||||
curl_strequal.pdf curl_mprintf.pdf curl_global_init.pdf \
|
||||
curl_global_cleanup.pdf curl_multi_add_handle.pdf curl_multi_cleanup.pdf \
|
||||
curl_multi_fdset.pdf curl_multi_info_read.pdf curl_multi_init.pdf \
|
||||
curl_multi_perform.pdf curl_multi_remove_handle.pdf \
|
||||
curl_share_cleanup.pdf curl_share_init.pdf curl_share_setopt.pdf \
|
||||
libcurl.pdf libcurl-multi.pdf libcurl-easy.pdf libcurl-share.pdf \
|
||||
libcurl-errors.pdf curl_easy_strerror.pdf curl_multi_strerror.pdf \
|
||||
curl_share_strerror.pdf curl_global_init_mem.pdf libcurl-tutorial.pdf \
|
||||
curl_easy_reset.pdf
|
||||
curl_easy_reset.pdf curl_easy_escape.pdf curl_easy_unescape.pdf \
|
||||
curl_multi_setopt.pdf curl_multi_socket.pdf curl_multi_timeout.pdf \
|
||||
curl_formget.pdf curl_multi_assign.pdf
|
||||
|
||||
CLEANFILES = $(HTMLPAGES) $(PDFPAGES)
|
||||
|
||||
|
47
docs/libcurl/curl_easy_escape.3
Normal file
47
docs/libcurl/curl_easy_escape.3
Normal file
@@ -0,0 +1,47 @@
|
||||
.\" **************************************************************************
|
||||
.\" * _ _ ____ _
|
||||
.\" * Project ___| | | | _ \| |
|
||||
.\" * / __| | | | |_) | |
|
||||
.\" * | (__| |_| | _ <| |___
|
||||
.\" * \___|\___/|_| \_\_____|
|
||||
.\" *
|
||||
.\" * Copyright (C) 1998 - 2006, 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
|
||||
.\" * are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
.\" *
|
||||
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
.\" * copies of the Software, and permit persons to whom the Software is
|
||||
.\" * furnished to do so, under the terms of the COPYING file.
|
||||
.\" *
|
||||
.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
.\" * KIND, either express or implied.
|
||||
.\" *
|
||||
.\" * $Id$
|
||||
.\" **************************************************************************
|
||||
.\"
|
||||
.TH curl_easy_escape 3 "7 April 2006" "libcurl 7.15.4" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_easy_escape - URL encodes the given string
|
||||
.SH SYNOPSIS
|
||||
.B #include <curl/curl.h>
|
||||
.sp
|
||||
.BI "char *curl_easy_escape( CURL *" curl ", char *" url ", int "length " );"
|
||||
.ad
|
||||
.SH DESCRIPTION
|
||||
This function converts the given input string to an URL encoded string and
|
||||
returns that as a new allocated string. All input characters that are not a-z,
|
||||
A-Z or 0-9 are converted to their "URL escaped" version (%NN where NN is a
|
||||
two-digit hexadecimal number).
|
||||
|
||||
If the \fBlength\fP argument is set to 0 (zero), curl_easy_escape() uses
|
||||
strlen() on the input \fBurl\fP to find out the size.
|
||||
|
||||
You must \fIcurl_free(3)\fP the returned string when you're done with it.
|
||||
.SH AVAILABILITY
|
||||
Added in 7.15.4 and replaces the old curl_escape() function.
|
||||
.SH RETURN VALUE
|
||||
A pointer to a zero terminated string or NULL if it failed.
|
||||
.SH "SEE ALSO"
|
||||
.BR curl_easy_unescape "(3), " curl_free "(3), " RFC 2396
|
@@ -1,8 +1,27 @@
|
||||
.\" You can view this file with:
|
||||
.\" nroff -man [file]
|
||||
.\" $Id$
|
||||
.\" **************************************************************************
|
||||
.\" * _ _ ____ _
|
||||
.\" * Project ___| | | | _ \| |
|
||||
.\" * / __| | | | |_) | |
|
||||
.\" * | (__| |_| | _ <| |___
|
||||
.\" * \___|\___/|_| \_\_____|
|
||||
.\" *
|
||||
.\" * Copyright (C) 1998 - 2006, 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
|
||||
.\" * are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
.\" *
|
||||
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
.\" * copies of the Software, and permit persons to whom the Software is
|
||||
.\" * furnished to do so, under the terms of the COPYING file.
|
||||
.\" *
|
||||
.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
.\" * KIND, either express or implied.
|
||||
.\" *
|
||||
.\" * $Id$
|
||||
.\" **************************************************************************
|
||||
.\"
|
||||
.TH curl_easy_getinfo 3 "6 Oct 2005" "libcurl 7.12.3" "libcurl Manual"
|
||||
.TH curl_easy_getinfo 3 "21 Mar 2006" "libcurl 7.15.4" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_easy_getinfo - extract information from a curl handle
|
||||
.SH SYNOPSIS
|
||||
@@ -44,10 +63,8 @@ information before the transfer is made, by using the CURLOPT_FILETIME option
|
||||
to \fIcurl_easy_setopt(3)\fP or you will unconditionally get a -1 back. (Added
|
||||
in 7.5)
|
||||
.IP CURLINFO_TOTAL_TIME
|
||||
Pass a pointer to a double to receive the total transaction time in seconds
|
||||
for the previous transfer. This time does not include the connect time, so if
|
||||
you want the complete operation time, you should add the
|
||||
CURLINFO_CONNECT_TIME.
|
||||
Pass a pointer to a double to receive the total time in seconds for the
|
||||
previous transfer, including name resolving, TCP connect etc.
|
||||
.IP CURLINFO_NAMELOOKUP_TIME
|
||||
Pass a pointer to a double to receive the time, in seconds, it took from the
|
||||
start until the name resolving was completed.
|
||||
@@ -148,6 +165,11 @@ working with the socket, you must call curl_easy_cleanup() as usual and let
|
||||
libcurl close the socket and cleanup other resources associated with the
|
||||
handle. This is typically used in combination with \fICURLOPT_CONNECT_ONLY\fP.
|
||||
(Added in 7.15.2)
|
||||
.IP CURLINFO_FTP_ENTRY_PATH
|
||||
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)
|
||||
.SH TIMES
|
||||
.NF
|
||||
An overview of the six time values available from curl_easy_getinfo()
|
||||
@@ -158,7 +180,7 @@ curl_easy_perform()
|
||||
|--|--CT
|
||||
|--|--|--PT
|
||||
|--|--|--|--ST
|
||||
|--|--|--TT
|
||||
|--|--|--|--|--TT
|
||||
|--|--|--|--|--RT
|
||||
.FI
|
||||
.IP NT
|
||||
@@ -175,9 +197,7 @@ and negotiations that are specific to the particular protocol(s) involved.
|
||||
\fICURLINFO_STARTTRANSFER_TIME\fP. The time it took from the start until the
|
||||
first byte is just about to be transferred.
|
||||
.IP TT
|
||||
\fICURLINFO_TOTAL_TIME\fP. Time of the previous transfer. This time does not
|
||||
include the connect time (CT), so if you want the complete operation time, you
|
||||
should add that.
|
||||
\fICURLINFO_TOTAL_TIME\fP. Total time of the previous request.
|
||||
.IP RT
|
||||
\fICURLINFO_REDIRECT_TIME\fP. The time it took for all redirection steps
|
||||
include name lookup, connect, pretransfer and transfer before final
|
||||
|
@@ -21,7 +21,7 @@
|
||||
.\" * $Id$
|
||||
.\" **************************************************************************
|
||||
.\"
|
||||
.TH curl_easy_setopt 3 "21 Feb 2006" "libcurl 7.15.2" "libcurl Manual"
|
||||
.TH curl_easy_setopt 3 "19 Apr 2006" "libcurl 7.15.4" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_easy_setopt \- set options for a curl easy handle
|
||||
.SH SYNOPSIS
|
||||
@@ -169,11 +169,12 @@ added in 7.12.3)
|
||||
.IP CURLOPT_PROGRESSFUNCTION
|
||||
Function pointer that should match the \fIcurl_progress_callback\fP prototype
|
||||
found in \fI<curl/curl.h>\fP. This function gets called by libcurl instead of
|
||||
its internal equivalent with a frequent interval during data transfer (roughly
|
||||
once per second). Unknown/unused argument values pass to the callback will be
|
||||
set to zero (like if you only download data, the upload size will remain
|
||||
0). Returning a non-zero value from this callback will cause libcurl to abort
|
||||
the transfer and return \fICURLE_ABORTED_BY_CALLBACK\fP.
|
||||
its internal equivalent with a frequent interval during operation (roughly
|
||||
once per second) no matter if data is being transfered or not. Unknown/unused
|
||||
argument values passed to the callback will be set to zero (like if you only
|
||||
download data, the upload size will remain 0). Returning a non-zero value from
|
||||
this callback will cause libcurl to abort the transfer and return
|
||||
\fICURLE_ABORTED_BY_CALLBACK\fP.
|
||||
|
||||
If you transfer data with the multi interface, this function will not be
|
||||
called during periods of idleness unless you call the appropriate libcurl
|
||||
@@ -263,6 +264,51 @@ and trust file settings.
|
||||
Data pointer to pass to the ssl context callback set by the option
|
||||
\fICURLOPT_SSL_CTX_FUNCTION\fP, this is the pointer you'll get as third
|
||||
parameter, otherwise \fBNULL\fP. (Added in 7.11.0)
|
||||
.IP CURLOPT_CONV_TO_NETWORK_FUNCTION
|
||||
.IP CURLOPT_CONV_FROM_NETWORK_FUNCTION
|
||||
.IP CURLOPT_CONV_FROM_UTF8_FUNCTION
|
||||
Function pointers that should match the following prototype: CURLcode
|
||||
function(char *ptr, size_t length);
|
||||
|
||||
These three options apply to non-ASCII platforms only. They are available
|
||||
only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was built. When
|
||||
this is the case, \fIcurl_version_info(3)\fP will return the CURL_VERSION_CONV
|
||||
feature bit set.
|
||||
|
||||
The data to be converted is in a buffer pointed to by the ptr parameter. The
|
||||
amount of data to convert is indicated by the length parameter. The converted
|
||||
data overlays the input data in the buffer pointed to by the ptr parameter.
|
||||
CURLE_OK should be returned upon successful conversion. A CURLcode return
|
||||
value defined by curl.h, such as CURLE_CONV_FAILED, should be returned if an
|
||||
error was encountered.
|
||||
|
||||
\fBCURLOPT_CONV_TO_NETWORK_FUNCTION\fP and
|
||||
\fBCURLOPT_CONV_FROM_NETWORK_FUNCTION\fP convert between the host encoding and
|
||||
the network encoding. They are used when commands or ASCII data are
|
||||
sent/received over the network.
|
||||
|
||||
\fBCURLOPT_CONV_FROM_UTF8_FUNCTION\fP is called to convert from UTF8 into the
|
||||
host encoding. It is required only for SSL processing.
|
||||
|
||||
If you set a callback pointer to NULL, or don't set it at all, the built-in
|
||||
libcurl iconv functions will be used. If HAVE_ICONV was not defined when
|
||||
libcurl was built, and no callback has been established, conversion will
|
||||
return the CURLE_CONV_REQD error code.
|
||||
|
||||
If HAVE_ICONV is defined, CURL_ICONV_CODESET_OF_HOST must also be defined.
|
||||
For example:
|
||||
|
||||
\&#define CURL_ICONV_CODESET_OF_HOST "IBM-1047"
|
||||
|
||||
The iconv code in libcurl will default the network and UTF8 codeset names as
|
||||
follows:
|
||||
|
||||
\&#define CURL_ICONV_CODESET_OF_NETWORK "ISO8859-1"
|
||||
|
||||
\&#define CURL_ICONV_CODESET_FOR_UTF8 "UTF-8"
|
||||
|
||||
You will need to override these definitions if they are different on your
|
||||
system.
|
||||
.SH ERROR OPTIONS
|
||||
.IP CURLOPT_ERRORBUFFER
|
||||
Pass a char * to a buffer that the libcurl may store human readable error
|
||||
@@ -295,7 +341,10 @@ given protocol of the set URL is not supported, libcurl will return on error
|
||||
\fIcurl_multi_perform(3)\fP. Use \fIcurl_version_info(3)\fP for detailed info
|
||||
on which protocols that are supported.
|
||||
|
||||
\fICURLOPT_URL\fP is the only option that must be set before
|
||||
The string given to CURLOPT_URL must be url-encoded and following the RFC 2396
|
||||
(http://curl.haxx.se/rfc/rfc2396.txt).
|
||||
|
||||
\fICURLOPT_URL\fP is the only option that \fBmust\fP be set before
|
||||
\fIcurl_easy_perform(3)\fP is called.
|
||||
.IP CURLOPT_PROXY
|
||||
Set HTTP proxy to use. The parameter should be a char * to a zero terminated
|
||||
@@ -714,6 +763,8 @@ Pass a char * to a cookie string. Cookie can be either in Netscape / Mozilla
|
||||
format or just regular HTTP-style header (Set-Cookie: ...) format. If cURL
|
||||
cookie engine was not enabled it will enable its cookie engine. Passing a
|
||||
magic string \&"ALL" will erase all cookies known by cURL. (Added in 7.14.1)
|
||||
Passing the special string \&"SESS" will only erase all session cookies known
|
||||
by cURL. (Added in 7.15.4)
|
||||
.IP CURLOPT_HTTPGET
|
||||
Pass a long. If the long is non-zero, this forces the HTTP request to get back
|
||||
to GET. usable if a POST, HEAD, PUT or a custom request have been used
|
||||
@@ -809,6 +860,12 @@ waiting for a response, this value overrides \fICURLOPT_TIMEOUT\fP. It is
|
||||
recommended that if used in conjunction with \fICURLOPT_TIMEOUT\fP, you set
|
||||
\fICURLOPT_FTP_RESPONSE_TIMEOUT\fP to a value smaller than
|
||||
\fICURLOPT_TIMEOUT\fP. (Added in 7.10.8)
|
||||
.IP CURLOPT_FTP_ALTERNATIVE_TO_USER
|
||||
Pass a char * as parameter, pointing to a string which will be used to
|
||||
authenticate if the usual FTP "USER user" and "PASS password" negotiation
|
||||
fails. This is currently only known to be required when connecting to
|
||||
Tumbleweed's Secure Transport FTPS server using client certificates for
|
||||
authentication. (Added in 7.15.5)
|
||||
.IP CURLOPT_FTP_SKIP_PASV_IP
|
||||
Pass a long. If set to a non-zero value, it instructs libcurl to not use the
|
||||
IP address the server suggests in its 227-response to libcurl's PASV command
|
||||
@@ -1001,6 +1058,14 @@ for the library to consider it too slow and abort.
|
||||
Pass a long as parameter. It contains the time in seconds that the transfer
|
||||
should be below the \fICURLOPT_LOW_SPEED_LIMIT\fP for the library to consider
|
||||
it too slow and abort.
|
||||
.IP CURLOPT_MAX_SEND_SPEED_LARGE
|
||||
Pass a curl_off_t as parameter. If an upload exceeds this speed on cumulative
|
||||
average during the transfer, the transfer will pause to keep the average rate
|
||||
less than or equal to the parameter value. (default: 0, unlimited)
|
||||
.IP CURLOPT_MAX_RECV_SPEED_LARGE
|
||||
Pass a curl_off_t as parameter. If an upload exceeds this speed on cumulative
|
||||
average during the transfer, the transfer will pause to keep the average rate
|
||||
less than or equal to the parameter value. (default: 0, unlimited)
|
||||
.IP CURLOPT_MAXCONNECTS
|
||||
Pass a long. The set number will be the persistent connection cache size. The
|
||||
set amount will be the maximum amount of simultaneously open connections that
|
||||
@@ -1061,7 +1126,7 @@ Resolve to ipv4 addresses.
|
||||
.IP CURL_IPRESOLVE_V6
|
||||
Resolve to ipv6 addresses.
|
||||
.RE
|
||||
.SH CURLOPT_CONNECT_ONLY
|
||||
.IP CURLOPT_CONNECT_ONLY
|
||||
Pass a long. A non-zero parameter tells the library to perform any required
|
||||
proxy authentication and connection setup, but no data transfer.
|
||||
|
||||
|
52
docs/libcurl/curl_easy_unescape.3
Normal file
52
docs/libcurl/curl_easy_unescape.3
Normal file
@@ -0,0 +1,52 @@
|
||||
.\" **************************************************************************
|
||||
.\" * _ _ ____ _
|
||||
.\" * Project ___| | | | _ \| |
|
||||
.\" * / __| | | | |_) | |
|
||||
.\" * | (__| |_| | _ <| |___
|
||||
.\" * \___|\___/|_| \_\_____|
|
||||
.\" *
|
||||
.\" * Copyright (C) 1998 - 2006, 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
|
||||
.\" * are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
.\" *
|
||||
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
.\" * copies of the Software, and permit persons to whom the Software is
|
||||
.\" * furnished to do so, under the terms of the COPYING file.
|
||||
.\" *
|
||||
.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
.\" * KIND, either express or implied.
|
||||
.\" *
|
||||
.\" * $Id$
|
||||
.\" **************************************************************************
|
||||
.\"
|
||||
.TH curl_easy_unescape 3 "7 April 2006" "libcurl 7.15.4" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_easy_unescape - URL decodes the given string
|
||||
.SH SYNOPSIS
|
||||
.B #include <curl/curl.h>
|
||||
.sp
|
||||
.BI "char *curl_easy_unescape( CURL *" curl ", char *" url ", int "inlength
|
||||
.BI ", int *" outlength " );"
|
||||
.ad
|
||||
.SH DESCRIPTION
|
||||
This function converts the given URL encoded input string to a "plain string"
|
||||
and returns that in an allocated memory area. All input characters that are
|
||||
URL encoded (%XX where XX is a two-digit hexadecimal number) are converted to
|
||||
their binary versions.
|
||||
|
||||
If the \fBlength\fP argument is set to 0 (zero), curl_easy_unescape() will use
|
||||
strlen() on the input \fIurl\fP string to find out the size.
|
||||
|
||||
If \fBoutlength\fP is non-NULL, the function will write the length of the
|
||||
returned string in the integer it points to. This allows an escaped string
|
||||
containing %00 to still get used properly after unescaping.
|
||||
|
||||
You must \fIcurl_free(3)\fP the returned string when you're done with it.
|
||||
.SH AVAILABILITY
|
||||
Added in 7.15.4 and replaces the old curl_unescape() function.
|
||||
.SH RETURN VALUE
|
||||
A pointer to a zero terminated string or NULL if it failed.
|
||||
.SH "SEE ALSO"
|
||||
.I curl_easy_escape(3), curl_free(3), RFC 2396
|
@@ -11,6 +11,8 @@ curl_escape - URL encodes the given string
|
||||
.BI "char *curl_escape( char *" url ", int "length " );"
|
||||
.ad
|
||||
.SH DESCRIPTION
|
||||
Obsolete function. Use \fIcurl_easy_escape(3)\fP instead!
|
||||
|
||||
This function will convert the given input string to an URL encoded string and
|
||||
return that as a new allocated string. All input characters that are not a-z,
|
||||
A-Z or 0-9 will be converted to their "URL escaped" version (%NN where NN is a
|
||||
@@ -20,6 +22,9 @@ If the 'length' argument is set to 0, curl_escape() will use strlen() on the
|
||||
input 'url' string to find out the size.
|
||||
|
||||
You must curl_free() the returned string when you're done with it.
|
||||
.SH AVAILABILITY
|
||||
Since 7.15.4, \fIcurl_easy_escape(3)\fP should be used. This function will
|
||||
be removed in a future release.
|
||||
.SH RETURN VALUE
|
||||
A pointer to a zero terminated string or NULL if it failed.
|
||||
.SH "SEE ALSO"
|
||||
|
49
docs/libcurl/curl_formget.3
Normal file
49
docs/libcurl/curl_formget.3
Normal file
@@ -0,0 +1,49 @@
|
||||
.\" You can view this file with:
|
||||
.\" nroff -man [file]
|
||||
.\" $Id$
|
||||
.\"
|
||||
.TH curl_formget 3 "20 June 2006" "libcurl 7.15.5" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_formget - serialize a previously build multipart/formdata HTTP POST chain
|
||||
.SH SYNOPSIS
|
||||
.B #include <curl/curl.h>
|
||||
.sp
|
||||
.BI "void curl_formget(struct curl_httppost *" form, " void *" arg,
|
||||
.BI " curl_formget_callback " append ");"
|
||||
.ad
|
||||
.SH DESCRIPTION
|
||||
curl_formget() is used to serialize data previously built/appended with
|
||||
\fIcurl_formadd(3)\fP. Accepts a void pointer as second argument which will be
|
||||
passed to the curl_formget_callback function.
|
||||
|
||||
.BI "typedef size_t (*curl_formget_callback)(void *" arg, " const char *" buf,
|
||||
.BI " size_t " len ");"
|
||||
.nf
|
||||
|
||||
The curl_formget_callback will be executed for each part of the HTTP POST
|
||||
chain. The void *arg pointer will be the one passed as second argument to
|
||||
curl_formget(). The character buffer passed to it must not be freed. The
|
||||
callback should return the buffer length passed to it on success.
|
||||
.SH RETURN VALUE
|
||||
0 means everything was ok, non-zero means an error occurred
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
|
||||
size_t print_httppost_callback(void *arg, const char *buf, size_t len)
|
||||
{
|
||||
fwrite(buf, len, 1, stdout);
|
||||
(*(size_t *) arg) += len;
|
||||
return len;
|
||||
}
|
||||
size_t print_httppost(struct curl_httppost *post)
|
||||
{
|
||||
size_t total_size = 0;
|
||||
if(curl_formget(post, &total_size, print_httppost_callback)) {
|
||||
return (size_t) -1;
|
||||
}
|
||||
return total_size;
|
||||
}
|
||||
.SH AVAILABILITY
|
||||
This function was added in libcurl 7.15.5
|
||||
.SH "SEE ALSO"
|
||||
.BR curl_formadd "(3) "
|
@@ -11,30 +11,30 @@ curl_global_init - Global libcurl initialisation
|
||||
.BI "CURLcode curl_global_init(long " flags ");"
|
||||
.ad
|
||||
.SH DESCRIPTION
|
||||
This function sets up the program environment that libcurl needs. Think
|
||||
of it as an extension of the library loader.
|
||||
This function sets up the program environment that libcurl needs. Think of it
|
||||
as an extension of the library loader.
|
||||
|
||||
This function must be called at least once within a program (a program is
|
||||
all the code that shares a memory space) before the program calls any other
|
||||
function in libcurl. The environment it sets up is constant for the life
|
||||
of the program and is the same for every program, so multiple calls have
|
||||
the same effect as one call.
|
||||
This function must be called at least once within a program (a program is all
|
||||
the code that shares a memory space) before the program calls any other
|
||||
function in libcurl. The environment it sets up is constant for the life of
|
||||
the program and is the same for every program, so multiple calls have the same
|
||||
effect as one call.
|
||||
|
||||
The flags option is a bit pattern that tells libcurl exactly what features to
|
||||
init, as described below. Set the desired bits by ORing the values together.
|
||||
In normal operation, you must specify CURL_GLOBAL_ALL. Don't use any other
|
||||
value unless you are familiar with and mean to control internal operations
|
||||
of libcurl.
|
||||
value unless you are familiar with and mean to control internal operations of
|
||||
libcurl.
|
||||
|
||||
\fBThis function is not thread safe.\fP You must not call it when any
|
||||
other thread in the program (i.e. a thread sharing the same memory) is
|
||||
running. This doesn't just mean no other thread that is using
|
||||
libcurl. Because \fIcurl_global_init()\fP calls functions of other
|
||||
libraries that are similarly thread unsafe, it could conflict with any
|
||||
other thread that uses these other libraries.
|
||||
\fBThis function is not thread safe.\fP You must not call it when any other
|
||||
thread in the program (i.e. a thread sharing the same memory) is running.
|
||||
This doesn't just mean no other thread that is using libcurl. Because
|
||||
\fIcurl_global_init()\fP calls functions of other libraries that are similarly
|
||||
thread unsafe, it could conflict with any other thread that uses these other
|
||||
libraries.
|
||||
|
||||
See the description in \fBlibcurl\fP(3) of global environment
|
||||
requirements for details of how to use this function.
|
||||
See the description in \fBlibcurl\fP(3) of global environment requirements for
|
||||
details of how to use this function.
|
||||
|
||||
.SH FLAGS
|
||||
.TP 5
|
||||
|
@@ -15,6 +15,11 @@ this \fImulti_handle\fP control the specified \fIeasy_handle\fP.
|
||||
When an easy handle has been added to a multi stack, you can not and you must
|
||||
not use \fIcurl_easy_perform(3)\fP on that handle!
|
||||
|
||||
If the easy handle is not set to use a shared (CURLOPT_SHARE) or global DNS
|
||||
cache (CURLOPT_DNS_USE_GLOBAL_CACHE), it will be made to use the DNS cache
|
||||
that is shared between all easy handles within the multi handle when
|
||||
\fIcurl_multi_add_handle(3)\fP is called.
|
||||
|
||||
The easy handle will remain added until you remove it again with
|
||||
\fIcurl_multi_remove_handle(3)\fP. You should remove the easy handle from the
|
||||
multi stack before you terminate first the easy handle and then the multi
|
||||
|
44
docs/libcurl/curl_multi_assign.3
Normal file
44
docs/libcurl/curl_multi_assign.3
Normal file
@@ -0,0 +1,44 @@
|
||||
.\" $Id$
|
||||
.\"
|
||||
.TH curl_multi_assign 3 "9 Jul 2006" "libcurl 7.16.0" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_multi_assign \- set data to associated with an internal socket
|
||||
.SH SYNOPSIS
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLMcode curl_multi_assign(CURLM *multi_handle, curl_socket_t sockfd,
|
||||
void *sockptr);
|
||||
.SH DESCRIPTION
|
||||
This function assigns an association in the multi handle between the given
|
||||
socket and a private pointer of the application. This is (only) useful for
|
||||
\fIcurl_multi_socket(3)\fP uses.
|
||||
|
||||
When set, the \fIsockptr\fP pointer will be passed to all future socket
|
||||
callbacks for the specific \fIsockfd\fP socket.
|
||||
|
||||
If the given \fIsockfd\fP isn't already in use by libcurl, this function will
|
||||
return an error.
|
||||
|
||||
libcurl only keeps one single pointer associated with a socket, so calling
|
||||
this function several times for the same socket will make the last set pointer
|
||||
get used.
|
||||
|
||||
The idea here being that this association (socket to private pointer) is
|
||||
something that just about every application that uses this API will need and
|
||||
then libcurl can just as well do it since it already has an internal hash
|
||||
table lookup for this.
|
||||
.SH "RETURN VALUE"
|
||||
The standard CURLMcode for multi interface error codes.
|
||||
.SH "TYPICAL USAGE"
|
||||
In a typical application you allocate a struct or at least use some kind of
|
||||
semi-dynamic data for each socket that we must wait for action on when using
|
||||
the \fIcurl_multi_socket(3)\fP approach.
|
||||
|
||||
When our socket-callback get called by libcurl and we get to know about yet
|
||||
another socket to wait for, we can use \fIcurl_multi_assign(3)\fP to point out
|
||||
the particular data so that when we get updates about this same socket again,
|
||||
we don't have to find the struct associated with this socket by ourselves.
|
||||
.SH AVAILABILITY
|
||||
This function was added in libcurl 7.15.5, although not deemed stable yet.
|
||||
.SH "SEE ALSO"
|
||||
.BR curl_multi_setopt "(3), " curl_multi_socket "(3) "
|
@@ -25,8 +25,9 @@ the socket (file descriptor) status by doing none, one or multiple calls to
|
||||
the curl_socket_callback given in the \fBparam\fP argument. They update the
|
||||
status with changes since the previous time a \fIcurl_multi_socket(3)\fP
|
||||
function was called. If the given callback pointer is NULL, no callback will
|
||||
be called. Set the callback's fourth argument with \fICURLMOPT_SOCKETDATA\fP.
|
||||
See \fIcurl_multi_socket(3)\fP for more callback details.
|
||||
be called. Set the callback's \fBuserp\fP argument with
|
||||
\fICURLMOPT_SOCKETDATA\fP. See \fIcurl_multi_socket(3)\fP for more callback
|
||||
details.
|
||||
.IP CURLMOPT_SOCKETDATA
|
||||
Pass a pointer to whatever you want passed to the curl_socket_callback's forth
|
||||
argument, the userp pointer. This is not used by libcurl but only passed-thru
|
||||
@@ -36,7 +37,7 @@ The standard CURLMcode for multi interface error codes. Note that it returns a
|
||||
CURLM_UNKNOWN_OPTION if you try setting an option that this version of libcurl
|
||||
doesn't know of.
|
||||
.SH AVAILABILITY
|
||||
This function was added in libcurl 7.16.0
|
||||
This function was added in libcurl 7.15.4.
|
||||
.SH "SEE ALSO"
|
||||
.BR curl_multi_cleanup "(3), " curl_multi_init "(3), "
|
||||
.BR curl_multi_socket "(3), " curl_multi_info_read "(3)"
|
||||
|
@@ -1,37 +1,50 @@
|
||||
.\" $Id$
|
||||
.\"
|
||||
.TH curl_multi_socket 3 "21 Dec 2005" "libcurl 7.16.0" "libcurl Manual"
|
||||
.TH curl_multi_socket 3 "9 Jul 2006" "libcurl 7.16.0" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_multi_socket \- reads/writes available data
|
||||
.SH SYNOPSIS
|
||||
#include <curl/curl.h>
|
||||
|
||||
CURLMcode curl_multi_socket(CURLM * multi_handle, curl_socket_t sockfd);
|
||||
CURLMcode curl_multi_socket(CURLM * multi_handle, curl_socket_t sockfd,
|
||||
int *running_handles);
|
||||
|
||||
CURLMcode curl_multi_socket_all(CURLM *multi_handle);
|
||||
CURLMcode curl_multi_socket_all(CURLM *multi_handle,
|
||||
int *running_handles);
|
||||
.SH DESCRIPTION
|
||||
Alternative versions of \fIcurl_multi_perform()\fP that allows the application
|
||||
to pass in one of the file descriptors/sockets that have been detected to have
|
||||
\&"action" on them and let libcurl perform. This allows libcurl to not have to
|
||||
scan through all possible file descriptors to check for action. When the
|
||||
application has detected action on a socket handled by libcurl, it should call
|
||||
\fIcurl_multi_perform()\fP with the \fBsockfd\fP argument set to the socket
|
||||
with the action.
|
||||
Alternative versions of \fIcurl_multi_perform(3)\fP that allows the
|
||||
application to pass in one of the file descriptors/sockets that have been
|
||||
detected to have \&"action" on them and let libcurl perform. This allows
|
||||
libcurl to not have to scan through all possible file descriptors to check for
|
||||
action. When the application has detected action on a socket handled by
|
||||
libcurl, it should call \fIcurl_multi_socket(3)\fP with the \fBsockfd\fP
|
||||
argument set to the socket with the action.
|
||||
|
||||
These functions inform the application about updates in the socket (file
|
||||
descriptor) status by doing none, one or multiple calls to the
|
||||
curl_socket_callback given with the CURLMOPT_SOCKETFUNCTION option to
|
||||
At return, the int \fBrunning_handles\fP points to will contain the number of
|
||||
still running easy handles within the multi handle. When this number reaches
|
||||
zero, all transfers are complete/done. Note that when you call
|
||||
\fIcurl_multi_socket(3)\fP on a specific socket and the counter decreases by
|
||||
one, it DOES NOT necessarily mean that this exact socket/transfer is the one
|
||||
that completed. Use \fIcurl_multi_info_read(3)\fP to figure out which easy
|
||||
handle that completed.
|
||||
|
||||
The curl_multi_socket functions inform the application about updates in the
|
||||
socket (file descriptor) status by doing none, one or multiple calls to the
|
||||
socket callback function set with the CURLMOPT_SOCKETFUNCTION option to
|
||||
\fIcurl_multi_setopt(3)\fP. They update the status with changes since the
|
||||
previous time this function was called.
|
||||
|
||||
If you want to force libcurl to (re-)check all its internal sockets and
|
||||
transfers instead of just a single one, you call
|
||||
\fBcurl_multi_socket_all(3)\fP instead.
|
||||
To force libcurl to (re-)check all its internal sockets and transfers instead
|
||||
of just a single one, you call \fBcurl_multi_socket_all(3)\fP. This is
|
||||
typically done as the first function call before the application has any
|
||||
knowledge about what sockets libcurl uses.
|
||||
|
||||
An application should call \fBcurl_multi_timeout(3)\fP to figure out how long
|
||||
it should wait for socket actions \- at most \- before doing the timeout
|
||||
action: call the \fBcurl_multi_socket(3)\fP function with the \fBsockfd\fP
|
||||
argument set to CURL_SOCKET_TIMEOUT.
|
||||
Applications should call \fBcurl_multi_timeout(3)\fP to figure out how long to
|
||||
wait for socket actions \- at most \- before doing the timeout action: call
|
||||
the \fBcurl_multi_socket(3)\fP function with the \fBsockfd\fP argument set to
|
||||
CURL_SOCKET_TIMEOUT.
|
||||
|
||||
.SH "CALLBACK DETAILS"
|
||||
|
||||
The socket \fBcallback\fP function uses a prototype like this
|
||||
.nf
|
||||
@@ -39,12 +52,20 @@ The socket \fBcallback\fP function uses a prototype like this
|
||||
int curl_socket_callback(CURL *easy, /* easy handle */
|
||||
curl_socket_t s, /* socket */
|
||||
int action, /* see values below */
|
||||
void *userp); /* "private" pointer */
|
||||
void *userp, /* private callback pointer */
|
||||
void *socketp); /* private socket pointer */
|
||||
|
||||
.fi
|
||||
The callback MUST return 0.
|
||||
|
||||
The \fIaction\fP (third) argument to the callback has one of five values:
|
||||
The \fIeasy\fP argument is a pointer to the easy handle that deals with this
|
||||
particular socket. Note that a single handle may work with several sockets
|
||||
simultaneously.
|
||||
|
||||
The \fIs\fP argument is the actual socket value as you use it within your
|
||||
system.
|
||||
|
||||
The \fIaction\fP argument to the callback has one of five values:
|
||||
.RS
|
||||
.IP "CURL_POLL_NONE (0)"
|
||||
register, not interested in readiness (yet)
|
||||
@@ -57,6 +78,15 @@ register, interested in both read and write readiness
|
||||
.IP "CURL_POLL_REMOVE (4)"
|
||||
deregister
|
||||
.RE
|
||||
|
||||
The \fIsocketp\fP argument is a private pointer you have previously set with
|
||||
\fIcurl_multi_assign(3)\fP to be associated with the \fIs\fP socket. If no
|
||||
pointer has been set, socketp will be NULL. This argument is of course a
|
||||
service to applications that want to keep certain data or structs that are
|
||||
strictly associated to the given socket.
|
||||
|
||||
The \fIuserp\fP argument is a private pointer you have previously set with
|
||||
\fIcurl_multi_setopt(3)\fP and the CURLMOPT_SOCKETDATA option.
|
||||
.SH "RETURN VALUE"
|
||||
CURLMcode type, general libcurl multi interface error code.
|
||||
|
||||
@@ -90,7 +120,7 @@ action.
|
||||
|
||||
9. Go back to step 6.
|
||||
.SH AVAILABILITY
|
||||
This function was added in libcurl 7.16.0
|
||||
This function was added in libcurl 7.15.4, although not deemed stable yet.
|
||||
.SH "SEE ALSO"
|
||||
.BR curl_multi_cleanup "(3), " curl_multi_init "(3), "
|
||||
.BR curl_multi_fdset "(3), " curl_multi_info_read "(3)"
|
||||
|
@@ -30,7 +30,7 @@ Call \fBcurl_multi_timeout(3)\fP, then wait for action on the sockets. You
|
||||
figure out which sockets to wait for by calling \fBcurl_multi_fdset(3)\fP or
|
||||
by a previous call to \fBcurl_multi_socket(3)\fP.
|
||||
.SH AVAILABILITY
|
||||
This function was added in libcurl 7.16.0
|
||||
This function was added in libcurl 7.15.4, although not deemed stable yet.
|
||||
.SH "SEE ALSO"
|
||||
.BR curl_multi_cleanup "(3), " curl_multi_init "(3), "
|
||||
.BR curl_multi_fdset "(3), " curl_multi_info_read "(3), "
|
||||
|
@@ -42,7 +42,9 @@ be set to one of the values described below.
|
||||
Cookie data will be shared across the easy handles using this shared object.
|
||||
.IP CURL_LOCK_DATA_DNS
|
||||
Cached DNS hosts will be shared across the easy handles using this shared
|
||||
object.
|
||||
object. Note that when you use the multi interface, all easy handles added to
|
||||
the same multi handle will share DNS cache by default without this having to
|
||||
be used!
|
||||
.RE
|
||||
.IP CURLSHOPT_UNSHARE
|
||||
This option does the opposite of \fICURLSHOPT_SHARE\fP. It specifies that
|
||||
|
@@ -11,6 +11,8 @@ curl_unescape - URL decodes the given string
|
||||
.BI "char *curl_unescape( char *" url ", int "length " );"
|
||||
.ad
|
||||
.SH DESCRIPTION
|
||||
Obsolete function. Use \fIcurl_easy_unescape(3)\fP instead!
|
||||
|
||||
This function will convert the given URL encoded input string to a "plain
|
||||
string" and return that as a new allocated string. All input characters that
|
||||
are URL encoded (%XX where XX is a two-digit hexadecimal number) will be
|
||||
@@ -20,7 +22,10 @@ If the 'length' argument is set to 0, curl_unescape() will use strlen() on the
|
||||
input 'url' string to find out the size.
|
||||
|
||||
You must curl_free() the returned string when you're done with it.
|
||||
.SH AVAILABILITY
|
||||
Since 7.15.4, \fIcurl_easy_unescape(3)\fP should be used. This function will
|
||||
be removed in a future release.
|
||||
.SH RETURN VALUE
|
||||
A pointer to a zero terminated string or NULL if it failed.
|
||||
.SH "SEE ALSO"
|
||||
.I curl_escape(3), curl_free(3), RFC 2396
|
||||
.I curl_easy_escape(3), curl_easy_unescape(3), curl_free(3), RFC 2396
|
||||
|
@@ -1,6 +1,27 @@
|
||||
.\" $Id$
|
||||
.\" **************************************************************************
|
||||
.\" * _ _ ____ _
|
||||
.\" * Project ___| | | | _ \| |
|
||||
.\" * / __| | | | |_) | |
|
||||
.\" * | (__| |_| | _ <| |___
|
||||
.\" * \___|\___/|_| \_\_____|
|
||||
.\" *
|
||||
.\" * Copyright (C) 1998 - 2006, 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
|
||||
.\" * are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
.\" *
|
||||
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
.\" * copies of the Software, and permit persons to whom the Software is
|
||||
.\" * furnished to do so, under the terms of the COPYING file.
|
||||
.\" *
|
||||
.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
.\" * KIND, either express or implied.
|
||||
.\" *
|
||||
.\" * $Id$
|
||||
.\" **************************************************************************
|
||||
.\"
|
||||
.TH curl_version_info 3 "11 Mar 2005" "libcurl 7.13.2" "libcurl Manual"
|
||||
.TH curl_version_info 3 "19 Apr 2006" "libcurl 7.15.4" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_version_info - returns run-time libcurl version info
|
||||
.SH SYNOPSIS
|
||||
@@ -98,6 +119,9 @@ libcurl was built with support for SSPI. This is only available on Windows and
|
||||
makes libcurl use Windows-provided functions for NTLM authentication. It also
|
||||
allows libcurl to use the current user and the current user's password without
|
||||
the app having to pass them on. (Added in 7.13.2)
|
||||
.IP CURL_VERSION_CONV
|
||||
libcurl was built with support for character conversions, as provided by the
|
||||
CUURLOPT_CONV_* callbacks. (Added in 7.15.4)
|
||||
.RE
|
||||
\fIssl_version\fP is an ascii string for the OpenSSL version used. If libcurl
|
||||
has no SSL support, this is NULL.
|
||||
|
@@ -30,7 +30,7 @@ or problem.
|
||||
.IP "CURLE_URL_MALFORMAT (3)"
|
||||
The URL was not properly formatted.
|
||||
.IP "CURLE_URL_MALFORMAT_USER (4)"
|
||||
URL user malformatted. The user-part of the URL syntax was not correct.
|
||||
This is never returned by current libcurl.
|
||||
.IP "CURLE_COULDNT_RESOLVE_PROXY (5)"
|
||||
Couldn't resolve proxy. The given proxy host could not be resolved.
|
||||
.IP "CURLE_COULDNT_RESOLVE_HOST (6)"
|
||||
@@ -45,9 +45,7 @@ remote server is probably not an OK FTP server.
|
||||
We were denied access when trying to login to an FTP server or when trying to
|
||||
change working directory to the one given in the URL.
|
||||
.IP "CURLE_FTP_USER_PASSWORD_INCORRECT (10)"
|
||||
The FTP server rejected access to the server after the password was sent to
|
||||
it. It might be because the username and/or the password were incorrect or
|
||||
just that the server is not allowing you access for the moment etc.
|
||||
This is never returned by current libcurl.
|
||||
.IP "CURLE_FTP_WEIRD_PASS_REPLY (11)"
|
||||
After having sent the FTP password to the server, libcurl expects a proper
|
||||
reply. This error code indicates that an unexpected code was returned.
|
||||
@@ -87,7 +85,7 @@ returns an error code that is >= 400.
|
||||
An error occurred when writing received data to a local file, or an error was
|
||||
returned to libcurl from a write callback.
|
||||
.IP "CURLE_MALFORMAT_USER (24)"
|
||||
Malformat user. User name badly specified. *Not currently used*
|
||||
This is never returned by current libcurl.
|
||||
.IP "CURLE_FTP_COULDNT_STOR_FILE (25)"
|
||||
FTP couldn't STOR file. The server denied the STOR operation. The error buffer
|
||||
usually contains the server's explanation to this.
|
||||
@@ -138,15 +136,13 @@ Aborted by callback. A callback returned "abort" to libcurl.
|
||||
.IP "CURLE_BAD_FUNCTION_ARGUMENT (43)"
|
||||
Internal error. A function was called with a bad parameter.
|
||||
.IP "CURLE_BAD_CALLING_ORDER (44)"
|
||||
Internal error. A function was called in a bad order.
|
||||
This is never returned by current libcurl.
|
||||
.IP "CURLE_HTTP_PORT_FAILED (45)"
|
||||
Interface error. A specified outgoing interface could not be used. Set which
|
||||
interface to use for outgoing connections' source IP address with
|
||||
CURLOPT_INTERFACE.
|
||||
.IP "CURLE_BAD_PASSWORD_ENTERED (46)"
|
||||
Bad password entered. An error was signaled when the password was
|
||||
entered. This can also be the result of a "bad password" returned from a
|
||||
specified password callback.
|
||||
This is never returned by current libcurl.
|
||||
.IP "CURLE_TOO_MANY_REDIRECTS (47)"
|
||||
Too many redirects. When following redirects, libcurl hit the maximum amount.
|
||||
Set your limit with CURLOPT_MAXREDIRS.
|
||||
@@ -194,6 +190,24 @@ rewinding operation failed
|
||||
Initiating the SSL Engine failed
|
||||
.IP "CURLE_LOGIN_DENIED (67)"
|
||||
The remote server denied curl to login (Added in 7.13.1)
|
||||
.IP "CURLE_TFTP_NOTFOUND (68)"
|
||||
File not found on TFTP server
|
||||
.IP "CURLE_TFTP_PERM (69"
|
||||
Permission problem on TFTP server
|
||||
.IP "CURLE_TFTP_DISKFULL (70)"
|
||||
Out of disk space on TFTP server
|
||||
.IP "CURLE_TFTP_ILLEGAL (71)"
|
||||
Illegal TFTP operation
|
||||
.IP "CURLE_TFTP_UNKNOWNID (72)"
|
||||
Unknown TFTP transfer ID
|
||||
.IP "CURLE_TFTP_EXISTS (73)"
|
||||
TFTP File already exists
|
||||
.IP "CURLE_TFTP_NOSUCHUSER (74)"
|
||||
No such TFTP user
|
||||
.IP "CURLE_CONV_FAILED (75)"
|
||||
Character conversion failed
|
||||
.IP "CURLE_CONV_REQD (76)"
|
||||
Caller must register conversion callbacks
|
||||
.SH "CURLMcode"
|
||||
This is the generic return code used by functions in the libcurl multi
|
||||
interface. Also consider \fIcurl_multi_strerror(3)\fP.
|
||||
@@ -212,7 +226,7 @@ You are doomed.
|
||||
This can only be returned if libcurl bugs. Please report it to us!
|
||||
.IP "CURLM_BAD_SOCKET (5)"
|
||||
The passed-in socket is not a valid one that libcurl already knows about.
|
||||
(Added in 7.16.0)
|
||||
(Added in 7.15.4)
|
||||
.SH "CURLSHcode"
|
||||
The "share" interface will return a CURLSHcode to indicate when an error has
|
||||
occurred. Also consider \fIcurl_share_strerror(3)\fP.
|
||||
|
@@ -1,6 +1,25 @@
|
||||
.\" You can view this file with:
|
||||
.\" nroff -man [file]
|
||||
.\" $Id$
|
||||
.\" **************************************************************************
|
||||
.\" * _ _ ____ _
|
||||
.\" * Project ___| | | | _ \| |
|
||||
.\" * / __| | | | |_) | |
|
||||
.\" * | (__| |_| | _ <| |___
|
||||
.\" * \___|\___/|_| \_\_____|
|
||||
.\" *
|
||||
.\" * Copyright (C) 1998 - 2006, 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
|
||||
.\" * are also available at http://curl.haxx.se/docs/copyright.html.
|
||||
.\" *
|
||||
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||
.\" * copies of the Software, and permit persons to whom the Software is
|
||||
.\" * furnished to do so, under the terms of the COPYING file.
|
||||
.\" *
|
||||
.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
.\" * KIND, either express or implied.
|
||||
.\" *
|
||||
.\" * $Id$
|
||||
.\" **************************************************************************
|
||||
.\"
|
||||
.TH libcurl-multi 3 "13 Oct 2001" "libcurl 7.10.1" "libcurl multi interface"
|
||||
.SH NAME
|
||||
@@ -14,8 +33,8 @@ for an overview of the libcurl easy interface.
|
||||
|
||||
All functions in the multi interface are prefixed with curl_multi.
|
||||
.SH "OBJECTIVES"
|
||||
The multi interface introduces several new abilities that the easy interface
|
||||
refuses to offer. They are mainly:
|
||||
The multi interface offers several abilities that the easy interface doesn't.
|
||||
They are mainly:
|
||||
|
||||
1. Enable a "pull" interface. The application that uses libcurl decides where
|
||||
and when to ask libcurl to get/send data.
|
||||
@@ -23,8 +42,8 @@ and when to ask libcurl to get/send data.
|
||||
2. Enable multiple simultaneous transfers in the same thread without making it
|
||||
complicated for the application.
|
||||
|
||||
3. Enable the application to select() on its own file descriptors and curl's
|
||||
file descriptors simultaneous easily.
|
||||
3. Enable the application to wait for action on its own file descriptors and
|
||||
curl's file descriptors simultaneous easily.
|
||||
.SH "ONE MULTI HANDLE MANY EASY HANDLES"
|
||||
To use the multi interface, you must first create a 'multi handle' with
|
||||
\fIcurl_multi_init(3)\fP. This handle is then used as input to all further
|
||||
|
@@ -212,7 +212,7 @@ opened for writing with the \fICURLOPT_WRITEDATA\fP option.
|
||||
Now, we need to take a step back and have a deep breath. Here's one of those
|
||||
rare platform-dependent nitpicks. Did you spot it? On some platforms[2],
|
||||
libcurl won't be able to operate on files opened by the program. Thus, if you
|
||||
use the default callback and pass in a an open file with
|
||||
use the default callback and pass in an open file with
|
||||
\fICURLOPT_WRITEDATA\fP, it will crash. You should therefore avoid this to
|
||||
make your program run fine virtually everywhere.
|
||||
|
||||
|
@@ -10,8 +10,8 @@ specific man pages for each function mentioned in here. There are also the
|
||||
\fIlibcurl-share(3)\fP man page and the \fIlibcurl-tutorial(3)\fP man page for
|
||||
in-depth understanding on how to program with libcurl.
|
||||
|
||||
There are more than a twenty custom bindings available that bring libcurl
|
||||
access to your favourite language. Look elsewhere for documentation on those.
|
||||
There are more than thirty custom bindings available that bring libcurl access
|
||||
to your favourite language. Look elsewhere for documentation on those.
|
||||
|
||||
libcurl has a global constant environment that you must set up and
|
||||
maintain while using libcurl. This essentially means you call
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# LIBCURL_CHECK_CONFIG ([DEFAULT-ACTION], [MINIMUM-VERSION],
|
||||
# [ACTION-IF-YES], [ACTION-IF-NO])
|
||||
# ----------------------------------------------------------
|
||||
# David Shaw <dshaw@jabberwocky.com> Jan-17-2006
|
||||
# David Shaw <dshaw@jabberwocky.com> May-09-2006
|
||||
#
|
||||
# Checks for libcurl. DEFAULT-ACTION is the string yes or no to
|
||||
# specify whether to default to --with-libcurl or --without-libcurl.
|
||||
@@ -210,6 +210,9 @@ x=CURLOPT_VERBOSE;
|
||||
AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_protocol_$_libcurl_protocol),[1])
|
||||
eval AS_TR_SH(libcurl_protocol_$_libcurl_protocol)=yes
|
||||
done
|
||||
else
|
||||
unset LIBCURL
|
||||
unset LIBCURL_CPPFLAGS
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@@ -1,13 +1,14 @@
|
||||
#
|
||||
# Build a little app for the Hiper project
|
||||
# Build test apps for the Hiper project
|
||||
# During dev at least, we use a static libcurl.
|
||||
#
|
||||
|
||||
LDFLAGS = -lcrypt -lidn -lssl -lcrypto -ldl -lz -lresolv -L../ares/.libs -lcares
|
||||
LDFLAGS = -lcrypt -lidn -lssl -lcrypto -ldl -lz -lresolv -L../ares/.libs \
|
||||
-lcares
|
||||
LIBCURL = -L../lib/.libs/ -lcurl
|
||||
CFLAGS = -I../include -g -DHAVE_CURL_MULTI_SOCKET
|
||||
CFLAGS = -I../include -g
|
||||
|
||||
all: shiper hiper ulimiter
|
||||
all: shiper hiper hipev ulimiter
|
||||
|
||||
hiper: hiper.o $(LIBCURL)
|
||||
$(CC) -o $@ $< $(LIBCURL) $(LDFLAGS)
|
||||
@@ -15,6 +16,12 @@ hiper: hiper.o $(LIBCURL)
|
||||
hiper.o: hiper.c
|
||||
$(CC) $(CFLAGS) -c $<
|
||||
|
||||
hipev: hipev.o $(LIBCURL)
|
||||
$(CC) -o $@ $< $(LIBCURL) $(LDFLAGS) -levent
|
||||
|
||||
hipev.o: hipev.c
|
||||
$(CC) $(CFLAGS) -c $<
|
||||
|
||||
shiper: shiper.o $(LIBCURL)
|
||||
$(CC) -o $@ $< $(LIBCURL) $(LDFLAGS)
|
||||
|
||||
|
60
hiper/STATUS
60
hiper/STATUS
@@ -238,3 +238,63 @@ Roadmap Ahead
|
||||
I plan and hope to return to full-time hiper work later on this spring or
|
||||
possibly summer to continue where I pause now. Of course some spare time
|
||||
might also be spent until then to get us moving forward.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
April 11, 2006
|
||||
|
||||
While sitting staring on my screen trying to write up a *nice* sample script
|
||||
using libevent, it strikes me that since libevent is pretty much based around
|
||||
its structs that you setup for each event/file descriptor, my application
|
||||
wants to figure out the correct struct that is associted with the file
|
||||
descriptor that libcurl provides in the socket callback.
|
||||
|
||||
This feels like an operation most applications will need when using the
|
||||
multi_socket API, so it feels like I should better try to figure out a decent
|
||||
way to offer this basic functionality already in libcurl - and the fact that
|
||||
we already have the file descriptors in a hash we can probably just as well
|
||||
extend it somewhat and store some custom pointers as well.
|
||||
|
||||
We need to offer the app a way to set a private pointer to be associated with
|
||||
the particular file descriptor, and then be able to provide that pointer on
|
||||
subsequent callback calls.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
April 20, 2006
|
||||
|
||||
I was wrong when I previously claimed we could have more than one easy handle
|
||||
using the same socket. I've cleaned up and simplified code now to adjust to
|
||||
this.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
July 9, 2006
|
||||
|
||||
TODO: We need to alter how we use c-ares for getting info about its sockets,
|
||||
as c-ares now provides a callback approach very similar to how libcurl is
|
||||
about to work.
|
||||
|
||||
I'm adding a function called curl_multi_assign() that will set a private
|
||||
pointer added to the internal libcurl hash table for the particular socket
|
||||
passed in to this function:
|
||||
|
||||
CURLMcode curl_multi_assign(CURLM *multi_handle,
|
||||
curl_socket_t sockfd,
|
||||
void *sockp);
|
||||
|
||||
'sockp' being a custom pointer set by the application to be associated with
|
||||
this socket. The socket has to be already existing and in-use by libcurl,
|
||||
like having already called the callback telling about its existance.
|
||||
|
||||
The set hashp pointer will then be passed on to the callback in upcoming
|
||||
calls when this same socket is used (in the brand new 'socketp' argument).
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
July 30, 2006
|
||||
|
||||
Shockingly stupid (of me not having realized this before), but we really need
|
||||
to add a 'running_handles' argument to the curl_multi_socket() and
|
||||
curl_multi_socket_all() prototypes so that the caller can get to know when
|
||||
all the transfers are actually done!
|
||||
|
408
hiper/hipev.c
Normal file
408
hiper/hipev.c
Normal file
@@ -0,0 +1,408 @@
|
||||
/*****************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Connect N connections. Z are idle, and X are active. Transfer as fast as
|
||||
* possible.
|
||||
*
|
||||
* Output detailed timing information.
|
||||
*
|
||||
* Uses libevent.
|
||||
*
|
||||
*/
|
||||
|
||||
/* The maximum number of simultanoues connections/transfers we support */
|
||||
#define NCONNECTIONS 50000
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/poll.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#include <event.h> /* for libevent */
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#define MICROSEC 1000000 /* number of microseconds in one second */
|
||||
|
||||
/* The maximum time (in microseconds) we run the test */
|
||||
#define RUN_FOR_THIS_LONG (5*MICROSEC)
|
||||
|
||||
/* Number of loops (seconds) we allow the total download amount and alive
|
||||
connections to remain the same until we bail out. Set this slightly higher
|
||||
when using asynch supported libcurl. */
|
||||
#define IDLE_TIME 10
|
||||
|
||||
struct globalinfo {
|
||||
size_t dlcounter;
|
||||
};
|
||||
|
||||
struct connection {
|
||||
CURL *e;
|
||||
int id; /* just a counter for easy browsing */
|
||||
char *url;
|
||||
size_t dlcounter;
|
||||
struct globalinfo *global;
|
||||
char error[CURL_ERROR_SIZE];
|
||||
};
|
||||
|
||||
/* this is the struct associated with each file descriptor libcurl tells us
|
||||
it is dealing with */
|
||||
struct fdinfo {
|
||||
/* create a link list of fdinfo structs */
|
||||
struct fdinfo *next;
|
||||
struct fdinfo *prev;
|
||||
curl_socket_t sockfd;
|
||||
CURL *easy;
|
||||
int action; /* as set by libcurl */
|
||||
long timeout; /* as set by libcurl */
|
||||
struct event ev; /* */
|
||||
int evset; /* true if the 'ev' struct has been used in a event_set() call */
|
||||
CURLMcode *multi; /* pointer to the multi handle */
|
||||
int *running_handles; /* pointer to the running_handles counter */
|
||||
};
|
||||
|
||||
static struct fdinfo *allsocks;
|
||||
|
||||
static int running_handles;
|
||||
|
||||
/* we have the timerevent global so that when the final socket-based event is
|
||||
done, we can remove the timerevent as well */
|
||||
static struct event timerevent;
|
||||
|
||||
/* called from libevent on action on a particular socket ("event") */
|
||||
static void eventcallback(int fd, short type, void *userp)
|
||||
{
|
||||
struct fdinfo *fdp = (struct fdinfo *)userp;
|
||||
CURLMcode rc;
|
||||
|
||||
fprintf(stderr, "EVENT callback type %d\n", type);
|
||||
|
||||
/* tell libcurl to deal with the transfer associated with this socket */
|
||||
do {
|
||||
rc = curl_multi_socket(fdp->multi, fd, fdp->running_handles);
|
||||
} while (rc == CURLM_CALL_MULTI_PERFORM);
|
||||
|
||||
if(rc) {
|
||||
fprintf(stderr, "curl_multi_socket() returned %d\n", (int)rc);
|
||||
}
|
||||
|
||||
fprintf(stderr, "running_handles: %d\n", *fdp->running_handles);
|
||||
if(!*fdp->running_handles) {
|
||||
/* last transfer is complete, kill pending timeout */
|
||||
fprintf(stderr, "last transfer done, kill timeout\n");
|
||||
if(evtimer_pending(&timerevent, NULL))
|
||||
evtimer_del(&timerevent);
|
||||
}
|
||||
}
|
||||
|
||||
/* called from libevent when our timer event expires */
|
||||
static void timercallback(int fd, short type, void *userp)
|
||||
{
|
||||
(void)fd; /* not used for this */
|
||||
(void)type; /* ignored in here */
|
||||
CURLM *multi_handle = (CURLM *)userp;
|
||||
long timeout_ms;
|
||||
struct timeval timeout;
|
||||
int running_handles;
|
||||
CURLMcode rc;
|
||||
|
||||
fprintf(stderr, "EVENT timeout\n");
|
||||
|
||||
/* tell libcurl to deal with the transfer associated with this socket */
|
||||
do {
|
||||
rc = curl_multi_socket(multi_handle, CURL_SOCKET_TIMEOUT,
|
||||
&running_handles);
|
||||
} while (rc == CURLM_CALL_MULTI_PERFORM);
|
||||
|
||||
if(running_handles) {
|
||||
/* Get the current timeout value from libcurl and set a new timeout */
|
||||
curl_multi_timeout(multi_handle, &timeout_ms);
|
||||
|
||||
/* convert ms to timeval */
|
||||
timeout.tv_sec = timeout_ms/1000;
|
||||
timeout.tv_usec = (timeout_ms%1000)*1000;
|
||||
evtimer_add(&timerevent, &timeout);
|
||||
}
|
||||
}
|
||||
|
||||
static void remsock(struct fdinfo *f)
|
||||
{
|
||||
if(!f)
|
||||
/* did not find socket to remove! */
|
||||
return;
|
||||
|
||||
if(f->evset)
|
||||
event_del(&f->ev);
|
||||
|
||||
if(f->prev)
|
||||
f->prev->next = f->next;
|
||||
if(f->next)
|
||||
f->next->prev = f->prev;
|
||||
else
|
||||
/* this was the last entry */
|
||||
allsocks = NULL;
|
||||
}
|
||||
|
||||
static void setsock(struct fdinfo *fdp, curl_socket_t s, CURL *easy,
|
||||
int action)
|
||||
{
|
||||
fdp->sockfd = s;
|
||||
fdp->action = action;
|
||||
fdp->easy = easy;
|
||||
|
||||
if(fdp->evset)
|
||||
/* first remove the existing event if the old setup was used */
|
||||
event_del(&fdp->ev);
|
||||
|
||||
/* now use and add the current socket setup to libevent. The EV_PERSIST is
|
||||
the key here as otherwise libevent will automatically remove the event
|
||||
when it occurs the first time */
|
||||
event_set(&fdp->ev, fdp->sockfd,
|
||||
(action&CURL_POLL_IN?EV_READ:0)|
|
||||
(action&CURL_POLL_OUT?EV_WRITE:0)| EV_PERSIST,
|
||||
eventcallback, fdp);
|
||||
|
||||
fdp->evset=1;
|
||||
|
||||
fprintf(stderr, "event_add() for fd %d\n", s);
|
||||
|
||||
/* We don't use any socket-specific timeout but intead we use a single
|
||||
global one. This is (mostly) because libcurl doesn't expose any
|
||||
particular socket- based timeout value. */
|
||||
event_add(&fdp->ev, NULL);
|
||||
}
|
||||
|
||||
static void addsock(curl_socket_t s, CURL *easy, int action, CURLM *multi)
|
||||
{
|
||||
struct fdinfo *fdp = calloc(sizeof(struct fdinfo), 1);
|
||||
|
||||
fdp->multi = multi;
|
||||
fdp->running_handles = &running_handles;
|
||||
setsock(fdp, s, easy, action);
|
||||
|
||||
if(allsocks) {
|
||||
fdp->next = allsocks;
|
||||
allsocks->prev = fdp;
|
||||
|
||||
/* now set allsocks to point to the new struct */
|
||||
allsocks = fdp;
|
||||
}
|
||||
else
|
||||
allsocks = fdp;
|
||||
|
||||
/* Set this association in libcurl */
|
||||
curl_multi_assign(multi, s, fdp);
|
||||
}
|
||||
|
||||
/* on port 8999 we run a fork enabled sws that supports 'idle' and 'stream' */
|
||||
#define PORT "8999"
|
||||
|
||||
#define HOST "127.0.0.1"
|
||||
|
||||
#define URL_IDLE "http://" HOST ":" PORT "/1000"
|
||||
#if 1
|
||||
#define URL_ACTIVE "http://" HOST ":" PORT "/1001"
|
||||
#else
|
||||
#define URL_ACTIVE "http://localhost/"
|
||||
#endif
|
||||
|
||||
static int socket_callback(CURL *easy, /* easy handle */
|
||||
curl_socket_t s, /* socket */
|
||||
int what, /* see above */
|
||||
void *cbp, /* callback pointer */
|
||||
void *socketp) /* socket pointer */
|
||||
{
|
||||
struct fdinfo *fdp = (struct fdinfo *)socketp;
|
||||
char *whatstr[]={
|
||||
"none",
|
||||
"IN",
|
||||
"OUT",
|
||||
"INOUT",
|
||||
"REMOVE"};
|
||||
|
||||
fprintf(stderr, "socket %d easy %p what %s\n", s, easy,
|
||||
whatstr[what]);
|
||||
|
||||
if(what == CURL_POLL_REMOVE)
|
||||
remsock(fdp);
|
||||
else {
|
||||
if(!fdp) {
|
||||
/* not previously known, add it and set association */
|
||||
printf("Add info for socket %d %s%s\n", s,
|
||||
what&CURL_POLL_IN?"READ":"",
|
||||
what&CURL_POLL_OUT?"WRITE":"" );
|
||||
addsock(s, easy, what, cbp);
|
||||
}
|
||||
else {
|
||||
/* we already know about it, just change action/timeout */
|
||||
printf("Changing info for socket %d from %d to %d\n",
|
||||
s, fdp->action, what);
|
||||
setsock(fdp, s, easy, what);
|
||||
}
|
||||
}
|
||||
return 0; /* return code meaning? */
|
||||
}
|
||||
|
||||
|
||||
static size_t
|
||||
writecallback(void *ptr, size_t size, size_t nmemb, void *data)
|
||||
{
|
||||
size_t realsize = size * nmemb;
|
||||
struct connection *c = (struct connection *)data;
|
||||
|
||||
c->dlcounter += realsize;
|
||||
c->global->dlcounter += realsize;
|
||||
|
||||
printf("%02d: %d, total %d\n",
|
||||
c->id, c->dlcounter, c->global->dlcounter);
|
||||
|
||||
return realsize;
|
||||
}
|
||||
|
||||
struct globalinfo info;
|
||||
struct connection *conns;
|
||||
|
||||
int num_total;
|
||||
int num_idle;
|
||||
int num_active;
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
CURLM *multi_handle;
|
||||
CURLMsg *msg;
|
||||
CURLcode code = CURLE_OK;
|
||||
CURLMcode mcode = CURLM_OK;
|
||||
int rc;
|
||||
int i;
|
||||
int selectmaxamount;
|
||||
struct fdinfo *fdp;
|
||||
char act;
|
||||
long timeout_ms;
|
||||
struct timeval timeout;
|
||||
|
||||
memset(&info, 0, sizeof(struct globalinfo));
|
||||
|
||||
if(argc < 3) {
|
||||
printf("Usage: hiper-event [num idle] [num active]\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
num_idle = atoi(argv[1]);
|
||||
num_active = atoi(argv[2]);
|
||||
|
||||
num_total = num_idle + num_active;
|
||||
|
||||
conns = calloc(num_total, sizeof(struct connection));
|
||||
if(!conns) {
|
||||
printf("Out of memory\n");
|
||||
return 3;
|
||||
}
|
||||
|
||||
if(num_total >= NCONNECTIONS) {
|
||||
printf("Too many connections requested, increase NCONNECTIONS!\n");
|
||||
return 2;
|
||||
}
|
||||
|
||||
event_init(); /* Initalize the event library */
|
||||
|
||||
printf("About to do %d connections\n", num_total);
|
||||
|
||||
/* init the multi stack */
|
||||
multi_handle = curl_multi_init();
|
||||
|
||||
for(i=0; i< num_total; i++) {
|
||||
CURL *e;
|
||||
char *nl;
|
||||
|
||||
memset(&conns[i], 0, sizeof(struct connection));
|
||||
|
||||
if(i < num_idle)
|
||||
conns[i].url = URL_IDLE;
|
||||
else
|
||||
conns[i].url = URL_ACTIVE;
|
||||
|
||||
e = curl_easy_init();
|
||||
|
||||
if(!e) {
|
||||
printf("curl_easy_init() for handle %d failed, exiting!\n", i);
|
||||
return 2;
|
||||
}
|
||||
|
||||
conns[i].e = e;
|
||||
conns[i].id = i;
|
||||
conns[i].global = &info;
|
||||
|
||||
curl_easy_setopt(e, CURLOPT_URL, conns[i].url);
|
||||
curl_easy_setopt(e, CURLOPT_WRITEFUNCTION, writecallback);
|
||||
curl_easy_setopt(e, CURLOPT_WRITEDATA, &conns[i]);
|
||||
curl_easy_setopt(e, CURLOPT_VERBOSE, 0);
|
||||
curl_easy_setopt(e, CURLOPT_ERRORBUFFER, conns[i].error);
|
||||
curl_easy_setopt(e, CURLOPT_PRIVATE, &conns[i]);
|
||||
|
||||
/* add the easy to the multi */
|
||||
if(CURLM_OK != curl_multi_add_handle(multi_handle, e)) {
|
||||
printf("curl_multi_add_handle() returned error for %d\n", i);
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
curl_multi_setopt(multi_handle, CURLMOPT_SOCKETFUNCTION, socket_callback);
|
||||
curl_multi_setopt(multi_handle, CURLMOPT_SOCKETDATA, multi_handle);
|
||||
|
||||
/* we start the action by calling *socket_all() */
|
||||
while(CURLM_CALL_MULTI_PERFORM == curl_multi_socket_all(multi_handle,
|
||||
&running_handles));
|
||||
|
||||
/* Since we need a global timeout to occur after a given time of inactivity,
|
||||
we add a single timeout-event. Get the timeout value from libcurl */
|
||||
curl_multi_timeout(multi_handle, &timeout_ms);
|
||||
/* convert ms to timeval */
|
||||
timeout.tv_sec = timeout_ms/1000;
|
||||
timeout.tv_usec = (timeout_ms%1000)*1000;
|
||||
evtimer_set(&timerevent, timercallback, multi_handle);
|
||||
evtimer_add(&timerevent, &timeout);
|
||||
|
||||
/* event_dispatch() runs the event main loop. It ends when no events are
|
||||
left to wait for. */
|
||||
|
||||
event_dispatch();
|
||||
|
||||
{
|
||||
/* something made connections fail, extract the reason and tell */
|
||||
int msgs_left;
|
||||
struct connection *cptr;
|
||||
while ((msg = curl_multi_info_read(multi_handle, &msgs_left))) {
|
||||
if (msg->msg == CURLMSG_DONE) {
|
||||
curl_easy_getinfo(msg->easy_handle, CURLINFO_PRIVATE, &cptr);
|
||||
|
||||
printf("%d => (%d) %s\n",
|
||||
cptr->id, msg->data.result, cptr->error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
curl_multi_cleanup(multi_handle);
|
||||
|
||||
/* cleanup all the easy handles */
|
||||
for(i=0; i< num_total; i++)
|
||||
curl_easy_cleanup(conns[i].e);
|
||||
|
||||
return code;
|
||||
}
|
@@ -16,7 +16,8 @@
|
||||
* The same is hiper.c but instead using the new *socket() API instead of the
|
||||
* "old" *perform() call.
|
||||
*
|
||||
* Uses libevent.
|
||||
* Uses a select() approach but only for keeping the code simple and
|
||||
* stand-alone. See hipev.c for a libevent-based example.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -33,8 +34,6 @@
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#include <event.h> /* for libevent */
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
@@ -84,7 +83,6 @@ struct fdinfo {
|
||||
CURL *easy;
|
||||
int action; /* as set by libcurl */
|
||||
long timeout; /* as set by libcurl */
|
||||
struct event ev;
|
||||
};
|
||||
|
||||
static struct fdinfo *allsocks;
|
||||
@@ -376,6 +374,7 @@ int main(int argc, char **argv)
|
||||
int selectmaxamount;
|
||||
struct fdinfo *fdp;
|
||||
char act;
|
||||
int running_handles;
|
||||
|
||||
memset(&info, 0, sizeof(struct globalinfo));
|
||||
|
||||
@@ -453,7 +452,8 @@ int main(int argc, char **argv)
|
||||
curl_multi_setopt(multi_handle, CURLMOPT_SOCKETDATA, NULL);
|
||||
|
||||
/* we start the action by calling *socket() right away */
|
||||
while(CURLM_CALL_MULTI_PERFORM == curl_multi_socket_all(multi_handle));
|
||||
while(CURLM_CALL_MULTI_PERFORM == curl_multi_socket_all(multi_handle,
|
||||
&running_handles));
|
||||
|
||||
printf("Starting timer, expects to run for %ldus\n", RUN_FOR_THIS_LONG);
|
||||
timer_start();
|
||||
@@ -488,7 +488,7 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
case 0:
|
||||
timeouts++;
|
||||
curl_multi_socket(multi_handle, CURL_SOCKET_TIMEOUT);
|
||||
curl_multi_socket(multi_handle, CURL_SOCKET_TIMEOUT, &running_handles);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -512,7 +512,7 @@ int main(int argc, char **argv)
|
||||
timer_continue();
|
||||
if(act & CURL_POLL_OUT)
|
||||
act--;
|
||||
curl_multi_socket(multi_handle, fdp->sockfd);
|
||||
curl_multi_socket(multi_handle, fdp->sockfd, &running_handles);
|
||||
timer_pause();
|
||||
}
|
||||
}
|
||||
|
@@ -58,8 +58,19 @@ extern "C" {
|
||||
#define CURL_EXTERN __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
|
||||
#ifdef CURL_HIDDEN_SYMBOLS
|
||||
/*
|
||||
* This definition is used to make external definitions visibile in the
|
||||
* shared library when symbols are hidden by default. It makes no
|
||||
* difference when compiling applications whether this is set or not,
|
||||
* only when compiling the library.
|
||||
*/
|
||||
#define CURL_EXTERN CURL_EXTERN_SYMBOL
|
||||
#else
|
||||
#define CURL_EXTERN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We want the typedef curl_off_t setup for large file support on all
|
||||
@@ -242,7 +253,7 @@ typedef enum {
|
||||
CURLE_UNSUPPORTED_PROTOCOL, /* 1 */
|
||||
CURLE_FAILED_INIT, /* 2 */
|
||||
CURLE_URL_MALFORMAT, /* 3 */
|
||||
CURLE_URL_MALFORMAT_USER, /* 4 (NOT USED) */
|
||||
CURLE_URL_MALFORMAT_USER, /* 4 - NOT USED */
|
||||
CURLE_COULDNT_RESOLVE_PROXY, /* 5 */
|
||||
CURLE_COULDNT_RESOLVE_HOST, /* 6 */
|
||||
CURLE_COULDNT_CONNECT, /* 7 */
|
||||
@@ -250,7 +261,7 @@ typedef enum {
|
||||
CURLE_FTP_ACCESS_DENIED, /* 9 a service was denied by the FTP server
|
||||
due to lack of access - when login fails
|
||||
this is not returned. */
|
||||
CURLE_FTP_USER_PASSWORD_INCORRECT, /* 10 */
|
||||
CURLE_FTP_USER_PASSWORD_INCORRECT, /* 10 - NOT USED */
|
||||
CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */
|
||||
CURLE_FTP_WEIRD_USER_REPLY, /* 12 */
|
||||
CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */
|
||||
@@ -268,6 +279,10 @@ typedef enum {
|
||||
CURLE_FTP_COULDNT_STOR_FILE, /* 25 - failed FTP upload */
|
||||
CURLE_READ_ERROR, /* 26 - could open/read from file */
|
||||
CURLE_OUT_OF_MEMORY, /* 27 */
|
||||
/* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
|
||||
instead of a memory allocation error if CURL_DOES_CONVERSIONS
|
||||
is defined
|
||||
*/
|
||||
CURLE_OPERATION_TIMEOUTED, /* 28 - the timeout time was reached */
|
||||
CURLE_FTP_COULDNT_SET_ASCII, /* 29 - TYPE A failed */
|
||||
CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */
|
||||
@@ -318,9 +333,18 @@ typedef enum {
|
||||
CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */
|
||||
CURLE_TFTP_EXISTS, /* 73 - File already exists */
|
||||
CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */
|
||||
CURLE_CONV_FAILED, /* 75 - conversion failed */
|
||||
CURLE_CONV_REQD, /* 76 - caller must register conversion
|
||||
callbacks using curl_easy_setopt options
|
||||
CURLOPT_CONV_FROM_NETWORK_FUNCTION,
|
||||
CURLOPT_CONV_TO_NETWORK_FUNCTION, and
|
||||
CURLOPT_CONV_FROM_UTF8_FUNCTION */
|
||||
CURL_LAST /* never use! */
|
||||
} CURLcode;
|
||||
|
||||
/* This prototype applies to all conversion callbacks */
|
||||
typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length);
|
||||
|
||||
typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */
|
||||
void *ssl_ctx, /* actually an
|
||||
OpenSSL SSL_CTX */
|
||||
@@ -412,7 +436,7 @@ typedef enum {
|
||||
*/
|
||||
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
|
||||
defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
|
||||
defined(__POCC__)
|
||||
defined(__POCC__) || defined(__SALFORDC__)
|
||||
/* This compiler is believed to have an ISO compatible preprocessor */
|
||||
#define CURL_ISOCPP
|
||||
#else
|
||||
@@ -937,6 +961,27 @@ typedef enum {
|
||||
extracting it with CURLINFO_LASTSOCKET */
|
||||
CINIT(CONNECT_ONLY, LONG, 141),
|
||||
|
||||
/* Function that will be called to convert from the
|
||||
network encoding (instead of using the iconv calls in libcurl) */
|
||||
CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142),
|
||||
|
||||
/* Function that will be called to convert to the
|
||||
network encoding (instead of using the iconv calls in libcurl) */
|
||||
CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143),
|
||||
|
||||
/* Function that will be called to convert from UTF8
|
||||
(instead of using the iconv calls in libcurl)
|
||||
Note that this is used only for SSL certificate processing */
|
||||
CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144),
|
||||
|
||||
/* if the connection proceeds too quickly then need to slow it down */
|
||||
/* limit-rate: maximum number of bytes per second to send or receive */
|
||||
CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145),
|
||||
CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),
|
||||
|
||||
/* Pointer to command string to send if USER/PASS fails. */
|
||||
CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147),
|
||||
|
||||
CURLOPT_LASTENTRY /* the last unused */
|
||||
} CURLoption;
|
||||
|
||||
@@ -1117,6 +1162,26 @@ CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost,
|
||||
struct curl_httppost **last_post,
|
||||
...);
|
||||
|
||||
/*
|
||||
* callback function for curl_formget()
|
||||
* The void *arg pointer will be the one passed as second argument to curl_formget().
|
||||
* The character buffer passed to it must not be freed.
|
||||
* Should return the buffer length passed to it as the argument "len" on success.
|
||||
*/
|
||||
typedef size_t (*curl_formget_callback)(void *arg, const char *buf, size_t len);
|
||||
|
||||
/*
|
||||
* NAME curl_formget()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Serialize a curl_httppost struct built with curl_formadd().
|
||||
* Accepts a void pointer as second argument which will be passed to
|
||||
* the curl_formget_callback function.
|
||||
* Returns 0 on success.
|
||||
*/
|
||||
CURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg,
|
||||
curl_formget_callback append);
|
||||
/*
|
||||
* NAME curl_formfree()
|
||||
*
|
||||
@@ -1146,7 +1211,7 @@ CURL_EXTERN char *curl_getenv(const char *variable);
|
||||
CURL_EXTERN char *curl_version(void);
|
||||
|
||||
/*
|
||||
* NAME curl_escape()
|
||||
* NAME curl_easy_escape()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
@@ -1154,18 +1219,34 @@ CURL_EXTERN char *curl_version(void);
|
||||
* %XX versions). This function returns a new allocated string or NULL if an
|
||||
* error occurred.
|
||||
*/
|
||||
CURL_EXTERN char *curl_escape(const char *string, int length);
|
||||
CURL_EXTERN char *curl_easy_escape(CURL *handle,
|
||||
const char *string,
|
||||
int length);
|
||||
|
||||
/* the previous version: */
|
||||
CURL_EXTERN char *curl_escape(const char *string,
|
||||
int length);
|
||||
|
||||
|
||||
/*
|
||||
* NAME curl_unescape()
|
||||
* NAME curl_easy_unescape()
|
||||
*
|
||||
* DESCRIPTION
|
||||
*
|
||||
* Unescapes URL encoding in strings (converts all %XX codes to their 8bit
|
||||
* versions). This function returns a new allocated string or NULL if an error
|
||||
* occurred.
|
||||
* Conversion Note: On non-ASCII platforms the ASCII %XX codes are
|
||||
* converted into the host encoding.
|
||||
*/
|
||||
CURL_EXTERN char *curl_unescape(const char *string, int length);
|
||||
CURL_EXTERN char *curl_easy_unescape(CURL *handle,
|
||||
const char *string,
|
||||
int length,
|
||||
int *outlength);
|
||||
|
||||
/* the previous version */
|
||||
CURL_EXTERN char *curl_unescape(const char *string,
|
||||
int length);
|
||||
|
||||
/*
|
||||
* NAME curl_free()
|
||||
@@ -1292,9 +1373,10 @@ typedef enum {
|
||||
CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27,
|
||||
CURLINFO_COOKIELIST = CURLINFO_SLIST + 28,
|
||||
CURLINFO_LASTSOCKET = CURLINFO_LONG + 29,
|
||||
CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30,
|
||||
/* Fill in new entries below here! */
|
||||
|
||||
CURLINFO_LASTONE = 29
|
||||
CURLINFO_LASTONE = 30
|
||||
} CURLINFO;
|
||||
|
||||
/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
|
||||
@@ -1415,8 +1497,11 @@ typedef struct {
|
||||
const char *ares;
|
||||
int ares_num;
|
||||
|
||||
/* This field was aded in CURLVERSION_THIRD */
|
||||
/* This field was added in CURLVERSION_THIRD */
|
||||
const char *libidn;
|
||||
|
||||
/* Same as '_libiconv_version' if built with HAVE_ICONV */
|
||||
int iconv_ver_num;
|
||||
} curl_version_info_data;
|
||||
|
||||
#define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */
|
||||
@@ -1431,6 +1516,8 @@ typedef struct {
|
||||
#define CURL_VERSION_LARGEFILE (1<<9) /* supports files bigger than 2GB */
|
||||
#define CURL_VERSION_IDN (1<<10) /* International Domain Names support */
|
||||
#define CURL_VERSION_SSPI (1<<11) /* SSPI is supported */
|
||||
#define CURL_VERSION_CONV (1<<12) /* character conversions are
|
||||
supported */
|
||||
|
||||
/*
|
||||
* NAME curl_version_info()
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user