Compare commits

..

377 Commits

Author SHA1 Message Date
Daniel Stenberg
7010e5ea84 release time for 7.15.5 2006-08-07 06:32:35 +00:00
Yang Tse
2cba6b246d Check for network libraries the _same_ way it is done in cURL. 2006-08-06 10:58:47 +00:00
Yang Tse
52cc2a7a0c Check for network libraries the same way it is done in cURL. 2006-08-05 22:02:47 +00:00
Dan Fandrich
c012e2b408 Initial stab at making libcurl compile under Minix 3. 2006-08-04 18:53:47 +00:00
Yang Tse
646a6b604f Minor compatibility fix 2006-08-04 17:35:05 +00:00
Gisle Vanem
cca00a6378 Added version info for iconv. 2006-08-04 16:10:48 +00:00
Gisle Vanem
10b7fc7e51 Added 'curl_version_info_data::iconv_ver_num' for iconv version. 2006-08-04 16:08:41 +00:00
Gisle Vanem
43e4544d51 Fixed typo. 2006-08-04 16:05:09 +00:00
Gisle Vanem
21aa8f0b45 Added dependency for splay.obj. 2006-08-04 15:57:07 +00:00
Gisle Vanem
b708fa51ad Fixed comment. 2006-08-04 15:41:56 +00:00
Daniel Stenberg
8709f6c4b3 oops, the previous commit was incomplete as we made an unconditional call
to multi_runsingle() without it being really necessary or good
2006-08-04 14:39:19 +00:00
Daniel Stenberg
2ac560e58b even when we get a single connection to deal with, we must still check for
timeout'ed connections and possibly deal with them too
2006-08-04 13:06:36 +00:00
Yang Tse
8f8ba9486d Fix compiler warning 2006-08-04 02:49:04 +00:00
Yang Tse
f55924b3e0 Avoid redundant check. configure script takes care of not defining
HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H, neither
HAVE_WS2TCPIP_H when __CYGWIN__ is defined.
2006-08-04 01:13:24 +00:00
Yang Tse
7240acdebc Being unable to link or find out recv() or send() args types is a fatal error. 2006-08-04 00:39:34 +00:00
Daniel Stenberg
b9b06b00bf This is now a working example using libevent and curl_multi_socket() for really
fast treatment of many simultaneous transfers
2006-08-03 22:57:04 +00:00
Daniel Stenberg
51f258d103 adding CURLM_CALL_MULTI_SOCKET that's just the same as CURLM_CALL_MULTI_PERFORM 2006-08-03 21:31:23 +00:00
Yang Tse
4c75f1c7b7 MinGW/MSYS needs lib ws2_32 for proper operation of configure script. 2006-08-03 21:19:40 +00:00
Daniel Stenberg
ed7bff1fec Ravi Pratap fixed ares_getsock() to actually return the proper bitmap and
not always zero!
2006-08-03 18:20:45 +00:00
Daniel Stenberg
01a79be2c9 removed running_handles argument from multi_runsingle() since it wasn't really
used anymore since multi->num_alive was introduced
2006-08-03 11:47:42 +00:00
Yang Tse
d211fcd34f Silence compiler warning 'unused parameter running_handles' in function multi_runsingle(). This is done here returning multi->num_alive in the running_handles parameter even when functions that call multi_runsingle() at this moment overwrite the returned value with the one that is valid when those functions curl_multi_perform() and multi_socket() have removed expired timers from the splay. Most probably, parameter 'running_handles' in function multi_runsingle() should be just removed. 2006-08-03 11:41:49 +00:00
Daniel Stenberg
159834171e keep count of the number of "alive" handles in a struct member, as otherwise
*multi_socket*() can't return the proper number
2006-08-02 22:29:29 +00:00
Daniel Stenberg
8a38c72c48 Mark Lentczner fixed how libcurl was not properly doing chunked encoding
if the header "Transfer-Encoding: chunked" was set by the application.
http://curl.haxx.se/bug/view.cgi?id=1531838
2006-08-02 18:18:47 +00:00
Daniel Stenberg
fbcdc192d5 a CURLOPT_PROGRESSFUNCTION clarification 2006-08-02 09:33:32 +00:00
Daniel Stenberg
ee642859ef Maciej Karpiuk fixed a crash that would occur if we passed Curl_strerror()
an unknown error number on glibc systems.
http://curl.haxx.se/bug/view.cgi?id=1532289
2006-08-01 09:39:01 +00:00
Daniel Stenberg
9f579f12fc spell-fixed a comment 2006-08-01 09:38:35 +00:00
Daniel Stenberg
825a526789 updated docs with the new parameter 2006-08-01 08:57:32 +00:00
Yang Tse
ae8a01ead6 Avoid the risk of a false positive detection of MSG_NOSIGNAL when cross compiling a Windows target. 2006-07-31 18:41:29 +00:00
Yang Tse
9dde0b54a3 Silence warning: empty body in an if-statement 2006-07-31 17:46:28 +00:00
Yang Tse
f1343b2f55 Force compilation failure in case macros sread() or swrite() are not defined. 2006-07-31 17:12:24 +00:00
Yang Tse
962b7985e6 Provide definitions needed for macros sread() and swrite() in config file. 2006-07-31 16:58:10 +00:00
Daniel Stenberg
5a1c64d316 adapt to the new protos 2006-07-30 22:47:53 +00:00
Daniel Stenberg
01b2cf82ec curl_multi_socket() and curl_multi_socket_all() got modified prototypes: they
both now provide the number of running handles back to the calling function.
2006-07-30 22:44:07 +00:00
Yang Tse
c033c4c71c Winsock and Cygwin need address family specification before bind(), this should be harmless for others. 2006-07-29 16:17:36 +00:00
Yang Tse
aa791ee5cf Fix compiler warnings. 2006-07-29 09:15:03 +00:00
Yang Tse
305671e2ab include setup_once.h dependency and adjust to 80 char lines. 2006-07-29 08:39:20 +00:00
Daniel Stenberg
d654736834 new D binding 2006-07-28 22:04:44 +00:00
Yang Tse
2c81bfead5 Replace send() and recv() with swrite() and sread() macros. 2006-07-28 18:01:23 +00:00
Yang Tse
77b3bc239d First step trying to avoid the multiple header inclusion and recursion nightmare.
Reintroduce checking for HAVE_MSG_NOSIGNAL in configure script, so that we don't depend on header inclusion order for a valid check.
2006-07-28 14:19:02 +00:00
Daniel Stenberg
c10d15aa0f test case 277 - HTTP RFC1867-type formposting with custom Content-Type 2006-07-27 22:44:56 +00:00
Daniel Stenberg
a88deadd6f Yves Lejeune fixed so that replacing Content-Type: when doing multipart
formposts work exactly the way you want it (and the way you'd assume it
works)
2006-07-27 22:35:09 +00:00
Daniel Stenberg
e6ea8f1199 put back the correct logic, as the change dated July 11th 2006 added bad
behaviour and a socket leak
2006-07-27 22:28:53 +00:00
Daniel Stenberg
4d4151f6c1 David McCreedy added --ftp-ssl-reqd which makes curl *require* SSL for both
control and data connection, as the existing --ftp-ssl option only requests
it.
2006-07-26 23:20:47 +00:00
Daniel Stenberg
518becfe2e curl_multi_assign() and CURLMOPT_SOCKETFUNCTION proto change 2006-07-26 22:25:00 +00:00
Daniel Stenberg
6f6b93da02 [Hiper-related work] Added 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.
2006-07-26 22:19:42 +00:00
Yang Tse
45b1843dc9 Provide multiple header inclusion prevention definition __ARES_PRIVATE_H 2006-07-26 10:54:08 +00:00
Yang Tse
cb86a302d8 Change multiple header inclusion prevention definition to __ARES_BITNCMP_H 2006-07-26 10:47:11 +00:00
Yang Tse
d15ed439ae Change multiple header inclusion prevention definition to __ARES_INET_NET_PTON_H 2006-07-26 10:43:15 +00:00
Yang Tse
b765e1f3b7 Sync header with source code 2006-07-26 10:33:17 +00:00
Daniel Stenberg
2527b53019 Dan Nelson added the CURLOPT_FTP_ALTERNATIVE_TO_USER libcurl option and curl
tool option named --ftp-alternative-to-user. It provides a mean to send a
particular command if the normal USER/PASS approach fails.
2006-07-25 22:45:21 +00:00
Daniel Stenberg
78a47826b2 Michael Jerris added magic that builds lib/curllib.vcproj automatically (for
newer MSVC versions)
2006-07-25 22:06:42 +00:00
Yang Tse
ecfaa4f869 Fix warning: no newline at end of file 2006-07-25 18:48:12 +00:00
Daniel Stenberg
f36adcdb73 Georg Horn made the transfer timeout error message include more details 2006-07-25 18:38:51 +00:00
Yang Tse
13616f8f96 Simplify check for NEED_MALLOC_H, and make more explicit that NEED_MALLOC_H shall be defined if <malloc.h> header file must be included even when including <stdlib.h>. 2006-07-25 13:49:49 +00:00
Gisle Vanem
ab486d1e27 Silence iconv() warnings. 2006-07-25 11:35:35 +00:00
Gisle Vanem
9111909c1d Added CURL_VERSION_CONV feature string. 2006-07-25 11:08:42 +00:00
Gisle Vanem
4a1a1a75fb Added note for CURLRES_ARES and CURLRES_IPV6. 2006-07-25 10:49:12 +00:00
Gisle Vanem
e4d6ade4b3 Moved functions common to IPv4 and C-ares to hostip.c;
Curl_freeaddrinfo() and Curl_ip2addr().
2006-07-25 10:31:31 +00:00
Gisle Vanem
c82e880f5b Remove comment about c-ares not supporting IPv6. 2006-07-25 10:23:15 +00:00
Gisle Vanem
f2aa3b21e0 Use the proper Curl_freeaddrinfo() for CURLRES_ARES. 2006-07-24 15:58:33 +00:00
Gisle Vanem
385db0e97d Fix typo. 2006-07-24 15:56:40 +00:00
Gisle Vanem
4e58da5222 Ares needs CURLRES_ADDRINFO_COPY. Curl_hostent_relocate() is gone. 2006-07-24 15:48:48 +00:00
Daniel Stenberg
1c6ebb0782 added splay.o 2006-07-23 12:01:06 +00:00
Gisle Vanem
7e8b84c3e7 Added getopt() processing. 2006-07-23 10:10:52 +00:00
Gisle Vanem
132067b081 Added getopt() processing of [-t {a|aaaa}]. 2006-07-22 17:31:00 +00:00
Gisle Vanem
8c36fc8f31 Added CVS id. 2006-07-22 15:38:35 +00:00
Gisle Vanem
93858efe73 2nd try adding CVS id. 2006-07-22 15:37:10 +00:00
Gisle Vanem
ba7f27a3f6 Added CVS id. 2006-07-22 15:21:13 +00:00
Gisle Vanem
2f70fb7015 Use ares_free_string() to avoid detecting leaks. 2006-07-22 15:12:34 +00:00
Gisle Vanem
655ec6bf8e If CURLDEBUG defined, call curl_memdebug() if $CARES_MEMDEBUG is set. 2006-07-22 14:51:39 +00:00
Gisle Vanem
c4ad533300 Constify some arguments in Curl_connecthost() and singleipconnect(). 2006-07-21 06:50:39 +00:00
Gisle Vanem
5cdbd0cf4a Constify arguments to Curl_he2ai() and Curl_addrinfo_copy(). 2006-07-21 06:21:46 +00:00
Gisle Vanem
a55c70d4ae Constify 'hostname' and 'service' to various resolver functions. 2006-07-21 05:51:12 +00:00
Gisle Vanem
02938a010d Changes for combination ENABLE_IPV6 and USE_ARES. 2006-07-21 04:22:44 +00:00
Gisle Vanem
e40641bf7c Use calloc() instead. 2006-07-21 04:19:44 +00:00
Daniel Stenberg
27c0b43897 David McCreedy fixed a build error when building libcurl with HTTP disabled,
problem added with the curl_formget() patch.
2006-07-20 20:04:52 +00:00
Gisle Vanem
d46de5ab8b Avoid warning "comparison of unsigned expression < 0 is always false" 2006-07-20 16:37:05 +00:00
Gisle Vanem
73ebb0edde Avoid warning 'port' might be used uninitialized in this function. 2006-07-20 15:54:01 +00:00
Dan Fandrich
684245d6ce Changes to support building for eCos 1.3.1. This has been tested with
file: URLs only.
2006-07-19 22:27:49 +00:00
Yang Tse
d157c29269 Fix compiler warnings 2006-07-19 21:14:02 +00:00
Yang Tse
4d2e81661b Avoid variable declaration shadowing previously declared one 2006-07-19 19:09:56 +00:00
Yang Tse
483a586d55 Avoid variable declaration shadowing previously declared one 2006-07-19 18:46:56 +00:00
Yang Tse
4ac54f8c2c remove variable declaration shadowing previously declared one 2006-07-19 18:32:38 +00:00
Yang Tse
840aacf7dd Remove variable declaration shadowing previously declared one 2006-07-19 18:19:30 +00:00
Yang Tse
ab4256d53a Abort if unable to write pid file, and close socket when aborting. 2006-07-19 15:28:30 +00:00
Yang Tse
46c5e562bf Abort if unable to write pid file. 2006-07-19 15:26:28 +00:00
Yang Tse
42f5a90d09 -Use curl_socket_t instead of int.
-Log errno in message if setsockopt() fails.

-Close listener socket on major errors.
2006-07-17 22:44:40 +00:00
Yang Tse
ef82da93fb "*connected" must be set to FALSE if trynextip() fails. 2006-07-17 19:22:28 +00:00
Daniel Stenberg
06d05b18b2 Jari Sundell did some excellent research and bug tracking, figured out that
we did wrong and patched it: When nodes were removed from the splay tree,
and we didn't properly remove it from the splay tree when an easy handle was
removed from a multi stack and thus we could wrongly leave a node in the
splay tree pointing to (bad) memory.
2006-07-17 18:35:58 +00:00
Yang Tse
431c4bd6e3 tests/libtest/lib506.c version 1.11 is now also logging CURLSHOPT_LOCKFUNC, CURLSHOPT_UNLOCKFUNC and CURLSHOPT_USERDATA, so we now also have to check them here. 2006-07-17 16:47:07 +00:00
Yang Tse
f72c4e82fd Return NULL if argument is NULL. 2006-07-17 15:25:37 +00:00
Yang Tse
9c83a20a27 Fix compiler warning "enumerated type mixed with another type" 2006-07-17 14:52:31 +00:00
Yang Tse
773bec5ae5 Fix compiler warning "enumerated type mixed with another type" 2006-07-17 14:32:19 +00:00
Yang Tse
f3c508f6e8 Update error buffer size used for SSL_strerror() 2006-07-17 05:05:57 +00:00
Yang Tse
2aa4710745 Minor cleanup 2006-07-17 03:38:13 +00:00
Daniel Stenberg
3b0a920fad don't use 'new' in the proto 2006-07-15 18:57:51 +00:00
Daniel Stenberg
daef1cf34d David McCreedy fixed a flaw where the CRLF counter wasn't properly cleared
for FTP ASCII transfers.
2006-07-14 18:58:42 +00:00
Yang Tse
bd8d4637a3 Fix compiler warning 2006-07-14 11:04:19 +00:00
Yang Tse
d2cefc140a Change the ai_addrlen type of struct addrinfo from size_t to socklen_t, per RFC 3493. 2006-07-14 10:30:44 +00:00
Yang Tse
ccfce89423 Null terminate string in buffer before feeding it to strtol() 2006-07-14 06:31:41 +00:00
Yang Tse
700cd5805c Oops, missing "u" 2006-07-13 18:57:34 +00:00
Yang Tse
498aad8587 Change to meaningful var names and take care of a compiler warning on IRIX 6.5.22 MIPSPro C 7.3 64bit 2006-07-13 18:50:51 +00:00
Yang Tse
73f407b7ae Fix compiler warning. 2006-07-13 18:44:24 +00:00
Gisle Vanem
4be7dcba48 Remove unneeded stuff. 2006-07-12 13:57:18 +00:00
Yang Tse
f0694c582e Remove var not used. 2006-07-12 10:41:07 +00:00
Yang Tse
f90f0c98d9 Log a message if not all data is sent. 2006-07-12 09:39:35 +00:00
Yang Tse
95aecc5dbb Fix compiler warning: comparison between signed and unsigned 2006-07-12 09:03:48 +00:00
Yang Tse
f975fd03a1 Read the return value of the swrite() macro and 'print' a message in case of failure. 2006-07-12 07:33:54 +00:00
Yang Tse
8272874704 Place parenthesis surrounding macro parameters so that the use of sread and swrite is more intuitive. 2006-07-12 06:52:40 +00:00
Yang Tse
86f4cead16 sread now returns ssize_t 2006-07-12 06:14:49 +00:00
Yang Tse
88a1a10e6f Pay attention when typecasting an operation 2006-07-12 06:09:53 +00:00
Yang Tse
624e657210 sread now returns ssize_t 2006-07-12 05:54:06 +00:00
Yang Tse
2278e8f1ba DJGPP/WATT32 does not have functions named recv() send() getnameinfo(). 2006-07-12 05:20:05 +00:00
Yang Tse
58176d1484 Use platform's native types for recv() and send() arguments. 2006-07-12 05:19:00 +00:00
Dan Fandrich
10489879f7 Enable --enable-hidden-symbols for SunPro C 2006-07-11 21:35:35 +00:00
Yang Tse
fe22872d14 include <malloc.h> only if HAVE_MALLOC_H and NEED_MALLOC_H are both defined. 2006-07-11 21:34:23 +00:00
Yang Tse
4d95d23d99 Define NEED_MALLOC_H if including <stdlib.h> is not enough for proper compilation and <malloc.h> must also be included. 2006-07-11 20:40:38 +00:00
Dan Fandrich
c6fc5a1a26 Moved strdup replacement from src/main.c into src/strdup.c so it's available
in libcurl as well, if necessary.
2006-07-11 17:02:06 +00:00
Gisle Vanem
012d75442a Added comment and CVS id. 2006-07-11 13:12:57 +00:00
Yang Tse
dcc7900e7c Socket must be set to CURL_SOCKET_BAD after closing it. 2006-07-11 00:23:21 +00:00
Yang Tse
34f5e8ad0e DNS cache must use the multi DNS cache if the easy handle's one is not using anyone in curl_multi_add_handle. 2006-07-10 16:14:36 +00:00
Daniel Stenberg
c2fee9894a the tool is named curl with lowercase c 2006-07-08 21:30:56 +00:00
Daniel Stenberg
abd983e851 just some more blurb 2006-07-08 21:29:45 +00:00
Daniel Stenberg
28611704d9 Ates Goral pointed out that libcurl's cookie parser did case insensitive
string comparisons on the path which is incorrect and provided a patch that
fixes this. I edited test case 8 to include details that test for this.
2006-07-08 18:52:08 +00:00
Daniel Stenberg
305dddeab0 7.15.5 is planned for August 2006 2006-07-08 18:49:41 +00:00
Daniel Stenberg
ee8112b42f mention the shared DNS stuff 2006-07-07 23:08:03 +00:00
Daniel Stenberg
ca319f63ad Ingmar Runge provided a source snippet that caused a crash. The reason for
the crash was that libcurl internally was a bit confused about who owned the
DNS cache at all times so if you created an easy handle that uses a shared
DNS cache and added that to a multi handle it would crash. Now we keep more
careful internal track of exactly what kind of DNS cache each easy handle
uses: None, Private (allocated for and used only by this single handle),
Shared (points to a cache held by a shared object), Global (points to the
global cache) or Multi (points to the cache within the multi handle that is
automatically shared between all easy handles that are added with private
caches).
2006-07-07 22:58:06 +00:00
Daniel Stenberg
a09a8164db mention the by-default "sharing" 2006-07-07 22:07:10 +00:00
Daniel Stenberg
e5cf6a20a7 yassl can be used now 2006-07-07 20:48:51 +00:00
Daniel Stenberg
af5e6e7e6d HTTP Pipelining is for GET and HEAD requests only. 2006-07-07 20:45:56 +00:00
Dan Fandrich
70f2b5e877 Fixed building curllib.dsp when running make outside the source tree. 2006-07-07 18:37:14 +00:00
Yang Tse
8ef454dcbe Finally get rid of CURL_CHECK_HEADERS_ONCE since it adds very little value and has portability issues.
Change some shell if...then...fi tests into case...esac tests which demand less resources.
2006-07-07 17:34:40 +00:00
Yang Tse
551a041283 Substitution of the literal '-' is only done if it's the first or last character. 2006-07-07 14:03:17 +00:00
Yang Tse
03288943af Using backslashes and slashes in the strings of the sed 'y' command shall be avoided since its interpretation is not the same across platforms.
Now we use the sed 's' command with a bracket expression.
2006-07-07 12:59:45 +00:00
Gisle Vanem
725f734bae Correct the trace for WinCE. 2006-07-07 07:49:16 +00:00
Gisle Vanem
0f32460656 WinCE uses CreateThread(). Hence error is not in 'errno'. 2006-07-07 07:46:40 +00:00
Gisle Vanem
25180cc850 Removed copying 'stderr' since it doesn't have the desired
effect.
2006-07-07 07:41:47 +00:00
Daniel Stenberg
2a0e41cab9 updated after discussions and thinking 2006-07-07 07:22:05 +00:00
Yang Tse
05edd48ad0 Fix excessive escaping. 2006-07-07 05:39:13 +00:00
Yang Tse
266ab95557 Fix CURL_CHECK_HEADERS_ONCE 2006-07-07 04:42:11 +00:00
Yang Tse
0a4bba565c Fix MinGW/MSYS support in CURL_CHECK_FUNC_RECV and CURL_CHECK_FUNC_SEND. 2006-07-06 15:51:03 +00:00
Gisle Vanem
2ddb9d57aa Undefine symbols before redefining them. 2006-07-06 13:57:26 +00:00
Gisle Vanem
4f012ad703 Undefine correct symbol. 2006-07-06 13:33:56 +00:00
Yang Tse
a1cd180082 Oops ! 2006-07-05 23:16:28 +00:00
Yang Tse
bc2f0c7dcb Prevent definition of HAVE_WINxxx_H symbols and avoid inclusion of Windows headers when compiled with Cygwin in POSIX emulation mode. 2006-07-05 23:10:37 +00:00
Gisle Vanem
c6ae0ebcbf Cludge fix for djgpp 2.03 or older; it doesn't have snprintf() etc.
So avoid using x_was_used().
2006-07-05 14:23:09 +00:00
Gisle Vanem
c6ec576cbb Add types and qualifiers for getnameifo(), send() and recv().
(Yang Tse forgot about djgpp)
2006-07-05 14:15:21 +00:00
Yang Tse
55329b56cb Use a more descriptive var name. 2006-07-04 17:19:15 +00:00
Yang Tse
7e43d06b60 Get qualifier of arg 2 for send() apart into SEND_QUAL_ARG2. 2006-07-04 16:54:10 +00:00
Yang Tse
89f54f3739 Platforms that don't have/run configure need default values in their config files for:
HAVE_GETNAMEINFO, GETNAMEINFO_QUAL_ARG1, GETNAMEINFO_TYPE_ARG1, GETNAMEINFO_TYPE_ARG2, GETNAMEINFO_TYPE_ARG46, GETNAMEINFO_TYPE_ARG7

HAVE_RECV, RECV_TYPE_ARG1, RECV_TYPE_ARG2, RECV_TYPE_ARG3, RECV_TYPE_ARG4, RECV_TYPE_RETV

HAVE_SEND, SEND_TYPE_ARG1, SEND_TYPE_ARG2, SEND_TYPE_ARG3, SEND_TYPE_ARG4, SEND_TYPE_RETV
2006-07-04 16:10:13 +00:00
Yang Tse
01fa02d0b5 Find out return types and argument types for functions recv() and send() at configuration stage. 2006-07-04 13:03:32 +00:00
Daniel Stenberg
8bed45340a Toshiyuki Maezawa fixed a problem where you couldn't override the
Proxy-Connection: header when using a proxy and not doing CONNECT.
2006-07-04 12:01:59 +00:00
Yang Tse
55138753c6 Test HAVE_GETNAMEINFO definition before using GETNAMEINFO_XXX definitions. 2006-07-04 02:27:11 +00:00
Yang Tse
43369b8096 Fix compiler warning. 2006-07-03 18:38:03 +00:00
Yang Tse
bec1977137 Use CURL_CHECK_FUNC_GETNAMEINFO results in CURL_CHECK_NI_WITHSCOPEID 2006-07-03 15:32:12 +00:00
Yang Tse
4c08eb4b11 Make CURL_CHECK_NI_WITHSCOPEID actually try to compile NI_WITHSCOPEID when cross-compiling. 2006-07-02 23:09:46 +00:00
Yang Tse
0163730437 Fix shell globbing in CURL_CHECK_FUNC_GETNAMEINFO 2006-07-02 01:21:54 +00:00
Yang Tse
39745ac38e Fix shell globbing in CURL_CHECK_FUNC_GETNAMEINFO 2006-07-02 01:17:37 +00:00
Yang Tse
cacf8bbb58 Fix shell globbing in CURL_CHECK_FUNC_GETNAMEINFO 2006-07-02 01:17:37 +00:00
Yang Tse
a1c6d5861a Get some debug info 2006-07-01 17:07:12 +00:00
Yang Tse
589c4596d8 Get some debug info 2006-07-01 15:01:48 +00:00
Yang Tse
7a6d7fca42 Avoid shell globbing 2006-07-01 12:53:24 +00:00
Yang Tse
5305c9f1e8 Get qualifier of arg 1 for getnameinfo apart. Take 3. 2006-07-01 11:21:38 +00:00
Yang Tse
b1022ea4c1 Get qualifier of arg 1 for getnameinfo apart. 2006-07-01 03:07:07 +00:00
Yang Tse
380a74a4ed Get qualifier of arg 1 for getnameinfo apart. Take 2. 2006-07-01 02:53:18 +00:00
Yang Tse
ff709848a6 Get qualifier of arg 1 for getnameinfo apart. 2006-06-30 19:20:16 +00:00
Daniel Stenberg
279dd6d878 typecast the number passed to CURLOPT_INFILESIZE_LARGE as a curl_off_t 2006-06-30 10:26:26 +00:00
Yang Tse
2e0ad842d0 Remove experimental notice from CURL_CHECK_FUNC_GETNAMEINFO 2006-06-30 00:22:38 +00:00
Daniel Stenberg
a3949c7786 with a very recent yassl, we now can display 'yassl' when the OpenSSL API is
in fact provided by yassl instead
2006-06-29 07:35:02 +00:00
Daniel Stenberg
2320606262 changed wording on the curl_multi_fdset() problem and moved the -K change from
bugfixes
2006-06-28 11:31:50 +00:00
Yang Tse
b01286d280 fix better minor compiler warning 2006-06-28 05:22:47 +00:00
Yang Tse
64f72c22b9 fix minor compiler warning 2006-06-28 04:17:04 +00:00
Yang Tse
856114d05c fix minor compiler warning 2006-06-28 02:45:27 +00:00
Daniel Stenberg
98b8c4b0c9 include config-win32.h in release archives 2006-06-26 08:56:04 +00:00
Daniel Stenberg
01f5f0be5a changed wording slightly, and added standard boiler-plate header 2006-06-26 06:43:45 +00:00
Daniel Stenberg
eb6d404753 Wallner's update 2006-06-24 23:11:36 +00:00
Daniel Stenberg
c508ab1aef Added README.pipelining but also extracted the "docs" files to a separate list
to get a better overview
2006-06-24 21:54:22 +00:00
Daniel Stenberg
0793dc922c thoughts and ideas as posted to the list the other day 2006-06-24 21:51:28 +00:00
Daniel Stenberg
00a41ab296 corrected introduction version number 2006-06-24 21:49:40 +00:00
Daniel Stenberg
37f4877e56 Michael Wallner added curl_formget(), which allows an application to extract
(serialise) a previously built formpost (as with curl_formadd()).
2006-06-24 21:46:41 +00:00
Daniel Stenberg
a6fc45c02f 1.3.1 2006-06-24 18:29:18 +00:00
Daniel Stenberg
25411e01db 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.
2006-06-24 15:21:49 +00:00
Daniel Stenberg
a8ac6f1dc1 Arve Knudsen found a flaw in curl_multi_fdset() for systems where
curl_socket_t is unsigned (like Windows) that could cause it to wrongly
return a max fd of -1.
2006-06-23 22:07:06 +00:00
Daniel Stenberg
dfe1884c25 Peter Silva introduced CURLOPT_MAX_SEND_SPEED_LARGE and
CURLOPT_MAX_RECV_SPEED_LARGE that limit tha maximum rate libcurl is allowed
to send or receive data. This kind of adds the the command line tool's
option --limit-rate to the library.

The rate limiting logic in the curl app is now removed and is instead
provided by libcurl itself. Transfer rate limiting will now also work for -d
and -F, which it didn't before.
2006-06-22 21:36:53 +00:00
Daniel Stenberg
3e5dcc8bcd minor language edits bug reports 1510080 1510098 2006-06-21 17:34:29 +00:00
Daniel Stenberg
ff81900784 the D binding link is dead but we know of no new one! 2006-06-20 07:27:10 +00:00
Daniel Stenberg
4cb30a3057 bad syntax 2006-06-20 07:03:29 +00:00
Daniel Stenberg
72f80b88f7 make -K on a bad file now displays a warning 2006-06-19 21:39:57 +00:00
William Ahern
3008d8133c Remove "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).
2006-06-19 06:41:55 +00:00
William Ahern
4524618bf2 Handle EAGAIN/EWOULDBLOCK readiness errors, which can occur for both TCP and
UDP even when a poll(2) or select(2) suggest otherwise.
2006-06-19 01:18:05 +00:00
Daniel Stenberg
55d22ba10c when mentioning the default config file, point back to the actual description
of how to write such a file
2006-06-16 07:27:06 +00:00
Daniel Stenberg
76cf020750 select_res is not a socket, it should be a plain int 2006-06-15 21:30:32 +00:00
Dan Fandrich
f13ac35edf Check whether gcc supports --enable-hidden-symbols before allowing it. 2006-06-13 17:43:00 +00:00
Dan Fandrich
59582a9d9d Implemented --enable-hidden-symbols configure option to enable
-fvisibility=hidden on gcc >= 4.0.  This reduces the size of the libcurl
binary and speeds up dynamic linking by hiding all the internal symbols from
the symbol table.
2006-06-12 20:33:04 +00:00
Daniel Stenberg
6246bbc656 oops 2006-06-12 09:32:39 +00:00
Daniel Stenberg
1b028b419b added contributors from the 7.15.4 release 2006-06-12 09:30:14 +00:00
Daniel Stenberg
4c6c768422 starting the journey towards the next release 2006-06-12 07:24:14 +00:00
Daniel Stenberg
1d3969b215 7.15.4 coming up 2006-06-12 06:53:10 +00:00
Daniel Stenberg
94116d9ebc Nah, we refer people to the generic site that lists the mirrors instead of
trying to maintain an accurate list in this file (too).
2006-06-12 06:51:15 +00:00
Gisle Vanem
cc5174a89a Fix "'x' might be used uninitialized in this function" warnings. 2006-06-10 17:35:28 +00:00
Daniel Stenberg
31552100c5 sync with existing list of up-to-date mirrors 2006-06-09 21:08:02 +00:00
Daniel Stenberg
8df5dcb193 proper use of newlines 2006-06-09 12:07:34 +00:00
Daniel Stenberg
7929600798 stricter type use to please compilers 2006-06-09 08:25:16 +00:00
Daniel Stenberg
a05ea124b9 oops, serious breakage in the fdset() function 2006-06-09 07:08:34 +00:00
Daniel Stenberg
6a03ab3ad4 lib525.c does a FTP upload with PORT using multi interface 2006-06-08 22:43:21 +00:00
Daniel Stenberg
6a151c1312 corrected the CURLINFO_TOTAL_TIME description 2006-06-08 11:06:26 +00:00
Daniel Stenberg
990e56fb13 Brian Dessent's fixes for cygwin builds 2006-06-08 06:12:30 +00:00
Daniel Stenberg
2bd3033f68 NTLM2 session response support 2006-06-07 14:14:04 +00:00
Daniel Stenberg
fe105a07e3 two new mirrors and a recount of them 2006-05-31 05:49:37 +00:00
Daniel Stenberg
a5782defd3 Added config-tpf.h to the release package 2006-05-31 05:17:27 +00:00
Daniel Stenberg
bcccd2fe74 Removed a few fixed issues and a few issues currently in progress in the Hiper
project. Also added a few obvious ones.
2006-05-30 08:45:59 +00:00
Daniel Stenberg
404e23734b correct explicit/implicit terms for FTPS 2006-05-28 11:28:40 +00:00
Daniel Stenberg
973d63f4f2 one modified proto and one removed proto 2006-05-27 22:26:41 +00:00
Daniel Stenberg
405d98ee63 adapted to the new Curl_splayremovebyaddr() proto 2006-05-27 22:26:16 +00:00
Daniel Stenberg
f81724969d Ifdef'ed out unused function, added lots of comments and renamed a few
variables, simplified the splayprint function, modified
Curl_splayremovebyaddr() to return error code. All in an effort to track down
the reported splay problem, but I've failed to do that so far...
2006-05-27 22:25:55 +00:00
Daniel Stenberg
edb5444fa3 reverted the previous .libs check for libs, but instead make mingw32 builds
more similar to other configure builds (== use .la for libext and no binext)
2006-05-27 11:36:05 +00:00
Daniel Stenberg
e877cb7bd7 scar Morales Viv updated the libcurl.framework.make file. 2006-05-26 22:23:54 +00:00
Daniel Stenberg
482b3ba702 long/int cleanup to silence picky compiler warnings 2006-05-26 11:26:42 +00:00
Daniel Stenberg
752acedc0b Olaf Stben fixed a bug that caused Digest authentication with md5-sess to
fail. When using the md5-sess, the result was not Md5 encoded and Base64
transformed.
2006-05-25 23:04:20 +00:00
Daniel Stenberg
fb88723afc minor RFC updates, Dan Fandrich brought my attention to them 2006-05-25 11:15:25 +00:00
Daniel Stenberg
3718737091 better check for libs created in the .libs directory since libtool does this
kind of magic
2006-05-25 11:04:08 +00:00
Daniel Stenberg
3d3f056f7e added some missing items 2006-05-24 23:16:22 +00:00
Daniel Stenberg
c60621c367 Copied the NO_UNDEFINED magic from libcurl to make this build fine again with
libtool cross-compiled on linux with mingw32
2006-05-24 23:02:51 +00:00
Daniel Stenberg
606562aa7e Michael Wallner provided a patch that allows "SESS" to be set with
CURLOPT_COOKIELIST, which then makes all session cookies get cleared. (slightly
edited by me, and the re-indent in cookie.c was also done by me)
2006-05-24 22:46:38 +00:00
Daniel Stenberg
f689d06ca9 make sure we pass a time_t * to localtime(), and the timeval struct members
are not always time_t ones
2006-05-24 21:39:52 +00:00
Daniel Stenberg
7cfd7f3fb1 minor fix to make Curl_splayremove() return a NULL as "removed" in case
nothing matched fine
2006-05-24 16:11:31 +00:00
Daniel Stenberg
4a8dfb3461 based on Tor Arntsen's fix, this should correct test case 271 to again run
fine
2006-05-24 15:22:03 +00:00
Daniel Stenberg
3752b3aead Fixed a shell script syntax error that all of a sudden started causing this
script to fail on debian unstable (some specific bash version perhaps?)
2006-05-23 22:55:46 +00:00
Daniel Stenberg
b81d41df22 David McCreedy's update 2006-05-23 21:19:36 +00:00
Daniel Stenberg
dadf3f06ee updated with more recent facts 2006-05-15 08:09:07 +00:00
Daniel Stenberg
8ed0d5675f The SOCKS connection codes don't properly acknowledge (connect) timeouts. 2006-05-14 22:49:23 +00:00
Daniel Stenberg
d5e9041344 The new ftpuploadresume.c example by Philip Bock 2006-05-11 22:24:44 +00:00
Daniel Stenberg
d99c20f628 Ok, when checking for old-style SSLeay headers we cannot just use
AC_CHECK_HEADERS() and the action-if-found since that action is run even if
just one of the six headers is found and I just now fell over a case with
a duplicate file name (a krb4 implementation with an err.h file).

I converted the check to manually make sure three of the headers are present
before considering them fine.
2006-05-11 21:37:58 +00:00
Daniel Stenberg
973ed24dc8 1 - allow much longer time for the test FTP server to startup and get verified
2 - store the time it took to verify it and allow that time to be used as
  %FTPTIME[23] in command lines to allow us to adjust better to slow hosts
  since test 190 failed on my slow solaris machine just because it hadn't
  gotten time to run all the way the test assumed all machines would reach
  before the time-out elapsed.
2006-05-11 06:34:30 +00:00
Daniel Stenberg
5d5f5e3be8 make sure the LASTSOCKET check only checks for SSL status if the socket
truly use SSL
2006-05-11 05:17:40 +00:00
Daniel Stenberg
d9e14408f0 silence warning 2006-05-11 05:16:38 +00:00
Daniel Stenberg
c9c5ce2365 David McCreedy provided a fix for CURLINFO_LASTSOCKET that does extended
checks on the to-be-returned socket to make sure it truly seems to be alive
and well. For SSL connection it (only) uses OpenSSL functions.
2006-05-10 22:17:42 +00:00
Daniel Stenberg
975534370f My Solaris test server was simply too slow to be able to respond within 4
seconds even when everything is fine! Now we allow a test server 8 seconds
to respond to still be considered ok.
2006-05-10 21:38:46 +00:00
Daniel Stenberg
28605f6bd3 cvsignore these files 2006-05-10 14:16:30 +00:00
Daniel Stenberg
3c6d3b69c2 1 - allow DICT with properly URL-escaped words, like using %20 for spaces
2 - properly escape certain letters within a DICT word to comply to the RFC2229
2006-05-10 11:44:31 +00:00
Daniel Stenberg
00312e95fe removed variable declarations shadowing previously declared variables 2006-05-10 09:53:52 +00:00
Daniel Stenberg
4223130bb0 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.
2006-05-10 08:03:54 +00:00
Daniel Stenberg
c811e1ce70 oops, could return an uninitialized variable 2006-05-09 13:02:53 +00:00
Daniel Stenberg
77475f2ad0 Andreas Ntaflos reported a bug in libcurl.m4: When configuring my GNU
autotools project, which optionally (default=yes) uses libcurl on a system
without a (usable) libcurl installation, but not specifying
`--without-libcurl', configure determines correctly that no libcurl is
available, however, the LIBCURL variable gets expanded to `LIBCURL = -lcurl'
in the resulting Makefiles.

David Shaw fixed the flaw.
2006-05-09 12:56:35 +00:00
Daniel Stenberg
3680a2f6f5 mention the other TFTP cleanup sweep from yday 2006-05-09 12:44:11 +00:00
Daniel Stenberg
1946058e7b Robson Braga Araujo fixed two problems in the recently added non-blocking SSL
connects. The state machine was not reset properly so that subsequent
connects using the same handle would fail, and there were two memory leaks.
2006-05-09 12:43:49 +00:00
Daniel Stenberg
73daf8ce33 Robson Braga Araujo fixed a memory leak when you added an easy handle to a
multi stack and that easy handle had already been used to do one or more
easy interface transfers, as then the code threw away the previously used
DNS cache without properly freeing it.
2006-05-09 11:33:00 +00:00
Daniel Stenberg
094ceeba14 check more return codes and skip the initial slash in given file names 2006-05-08 22:23:33 +00:00
Daniel Stenberg
3b7359a27a no longer uses errno but Curl_sockerrno() and now acknowledges return codes
from Curl_client_write
2006-05-08 21:00:44 +00:00
Dan Fandrich
df9108e19b Stop sending retransmitted received blocks up to client
Fixed handling of retransmitted blocks on transmit
Properly aligned data to transmit within packet
Replaced calls to strerror() with Curl_strerror()
2006-05-08 19:41:26 +00:00
Daniel Stenberg
6307e783d8 Fixed known bug #28. The TFTP code no longer assumes a packed struct and
thus works reliably on more platforms.
2006-05-08 15:09:50 +00:00
Daniel Stenberg
b9cd73c76d Fix GnuTLS compile warning. Risking breakage with some older version of GnuTLS? 2006-05-07 18:27:36 +00:00
Daniel Stenberg
b62c230ca2 Curl_https_getsock() was OpenSSL-specific and really should not be present
like this in this source file. The quickfix for now is to provide a simple
version for GnuTLS builds. The GnuTLS version of libcurl doesn't yet allow
fully non-blocking connects anyway so this function doesn't get used.
2006-05-05 22:14:40 +00:00
Daniel Stenberg
800193da9b get the Curl_sockerrno proto 2006-05-05 22:07:01 +00:00
Daniel Stenberg
577ba5783c two more contributors 2006-05-05 21:08:09 +00:00
Daniel Stenberg
9bece2b313 additional renames of Curl_ourerrno => Curl_sockerrno 2006-05-05 10:24:27 +00:00
Daniel Stenberg
e85e30546c Roland Blom filed bug report #1481217
(http://curl.haxx.se/bug/view.cgi?id=1481217), with follow-ups by Michele Bini
and David Byron. libcurl previously wrongly used GetLastError() on windows to
get error details after socket-related function calls, when it really should
use WSAGetLastError() instead.

When changing to this, the former function Curl_ourerrno() is now instead
called Curl_sockerrno() as it is necessary to only use it to get errno from
socket-related functions as otherwise it won't work as intended on Windows.
2006-05-04 22:39:47 +00:00
Daniel Stenberg
758f6eed51 Mark Eichin submitted bug report #1480821
(http://curl.haxx.se/bug/view.cgi?id=1480821) He found and identified a
problem with how libcurl dealt with GnuTLS and a case where gnutls returned
GNUTLS_E_AGAIN indicating it would block. It would then return an unexpected
return code, making Curl_ssl_send() confuse the upper layer - causing random
28 bytes trash data to get inserted in the transfered stream.

The proper fix was to make the Curl_gtls_send() function return the proper
return codes that the callers would expect. The Curl_ossl_send() function
already did this.
2006-05-04 06:00:40 +00:00
Daniel Stenberg
80ee5d3bd8 moved the curl_off_t check to within the --enable-debug block where it belongs since it is a somewhat ugly hack 2006-05-03 22:39:49 +00:00
Daniel Stenberg
dd06c60ada 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.
2006-05-03 06:11:44 +00:00
Daniel Stenberg
6ca627ae74 curl-config got a --checkfor option 2006-05-02 22:48:22 +00:00
Daniel Stenberg
80a0b81c2a Make this code use the proper pointers 2006-05-02 09:19:31 +00:00
Gisle Vanem
06a7b0561b Added revision ID-tag. 2006-04-26 17:27:36 +00:00
Gisle Vanem
12db20be4e Fixed signed/unsigned convertion errors in Salford-C.
#ifdef around WSAEDISCON in strerror.c.
2006-04-26 17:26:22 +00:00
Gisle Vanem
3cbb1b2b64 Use the HAVE_MALLOC_H and HAVE_PROCESS_H defines
(more logical).
2006-04-26 17:23:28 +00:00
Gisle Vanem
d75e587613 djgpp has <process.h> too. 2006-04-26 17:15:57 +00:00
Gisle Vanem
414c57d138 Added support for Salford-C under Win32 (scc). HAVE_MALLOC_H and
HAVE_PROCESS_H added for all except scc.
2006-04-26 17:11:05 +00:00
Gisle Vanem
c14a84e6f2 Added SalfordC support. 2006-04-26 17:04:47 +00:00
Daniel Stenberg
def0db30e7 crlf_conversions needs to be a curl_off_t for ASCII transfers > 4GB on 32bit
systems
2006-04-26 13:08:12 +00:00
Daniel Stenberg
6ef7a81a3b updated with more error codes 2006-04-26 13:00:45 +00:00
Daniel Stenberg
95152aec68 David McCreedy brought line end conversions when doing FTP ASCII
transfers. They are done on non-windows systems and translate CRLF to LF.
2006-04-26 07:40:37 +00:00
Daniel Stenberg
8ed6762363 --ftp-method was missing in the --help output, as mentioned by Manfred Schwarb 2006-04-25 21:41:05 +00:00
Daniel Stenberg
87c5ed8bec Paul Querna fixed libcurl to better deal with deflate content encoding when
the stream (wrongly) lacks a proper zlib header. This seems to be the case on
too many actual server implementations.
2006-04-25 20:49:40 +00:00
Daniel Stenberg
ecc6c1f501 prevent signed/unsigned warnings 2006-04-25 05:32:05 +00:00
Daniel Stenberg
3d8338b0d4 Mention my April 20 thoughts. I already changed the README in the lib dir
to be accurate on this.
2006-04-24 22:41:07 +00:00
Daniel Stenberg
c91e25518f added the hipev build 2006-04-24 22:40:20 +00:00
Daniel Stenberg
a8dddeab61 the example that _is_ supposed to use libevent 2006-04-24 22:40:04 +00:00
Daniel Stenberg
8f0a5ab660 this example does NOT use libevent! 2006-04-24 22:39:39 +00:00
Daniel Stenberg
db03d4bdd0 Ale Vesely fixed CURLOPT_INTERFACE when using a hostname 2006-04-21 13:46:19 +00:00
Daniel Stenberg
0ec96e4279 each socket is used by exactly one easy handle, but of course each easy handle
can and will use more than one socket
2006-04-21 13:40:07 +00:00
Daniel Stenberg
6e520c4cdc added SPL and XBLite 2006-04-21 11:17:54 +00:00
Gunter Knauf
1e8683d72d removed -fpack-struct because gcc4 seems to know its obsolete and warns... 2006-04-20 10:26:51 +00:00
Daniel Stenberg
2df622fd14 detect ICC and pass on "-we 147" so that the configure checks for function
arguments work properly - and the option is not harmful for the rest of the
curl build either!
2006-04-19 11:11:10 +00:00
Daniel Stenberg
fede784fa2 the new conversion stuff documented (mostly by David McCreedy) 2006-04-19 09:08:15 +00:00
Daniel Stenberg
f191b143e9 CURL_VERSION_CONV is returned by curl_version_info if libcurl has been built
to allow/support character conversions
2006-04-19 09:03:21 +00:00
Daniel Stenberg
59212553b5 mention the recent thoughts/progress I had 2006-04-18 23:24:23 +00:00
Daniel Stenberg
e532b196cc Robson Braga Araujo provided a patch that makes libcurl less eager to close
the control connection when using FTP, for example when you remove an easy
handle from a multi stack.
2006-04-18 23:14:30 +00:00
Daniel Stenberg
0f5232280c mention Katie Wang as author of the patch 2006-04-18 22:12:22 +00:00
Daniel Stenberg
38898ba4af corrected the SSL timeout, as Ates Goral's patch did it and that works (opposed
to my previous brain-damaged version)
2006-04-18 22:10:19 +00:00
Daniel Stenberg
48f56d9600 attempt to silence the MIPSPro compiler warning 2006-04-18 10:55:41 +00:00
Daniel Stenberg
17bf5ac2fc avoid a warning about declaring a variable that shadows an earlier declared
one
2006-04-18 10:51:07 +00:00
Daniel Stenberg
343b882d80 there's an curl_easy_unescape too now 2006-04-18 09:23:03 +00:00
Gunter Knauf
db06d21339 minor Makefile fix - let's go 2006;
use correct version var.
2006-04-17 18:04:27 +00:00
Gunter Knauf
19240f08bb added missing symbol export. 2006-04-17 17:06:10 +00:00
Daniel Stenberg
d774730f83 added splay 2006-04-12 18:12:46 +00:00
Gisle Vanem
c2edf42567 Added splay.c. 2006-04-12 14:01:21 +00:00
Gisle Vanem
08f0e55b4f Add "multiif.h" for GETSOCK_WRITESOCK() macro. 2006-04-12 13:54:07 +00:00
Daniel Stenberg
deeb74b7e4 #1468330 (http://curl.haxx.se/bug/view.cgi?id=1468330) pointed out a bad
typecast in the curl tool leading to a crash with (64bit?) VS2005 (at least)
since the struct timeval field tv_sec is an int while time_t is 64bit.
2006-04-11 10:49:51 +00:00
Daniel Stenberg
0542002d7a adjusted to the new internal *_getsock() concept for providing info internally
about what sockets to wait for what action on
2006-04-11 07:23:30 +00:00
Daniel Stenberg
c1e307f585 added docs and removed proto 2006-04-11 07:22:55 +00:00
Daniel Stenberg
7b4ba43dcf mention recent additions 2006-04-10 21:57:45 +00:00
Daniel Stenberg
b0e4debaab adding the new man pages to the package 2006-04-10 21:55:48 +00:00
Daniel Stenberg
676597e961 Ates Goral found out that if you specified both CURLOPT_CONNECTTIMEOUT and
CURLOPT_TIMEOUT, the _longer_ time would wrongly be used for the SSL
connection time-out!
2006-04-10 21:49:55 +00:00
Daniel Stenberg
686d90745b First curl_multi_socket() commit. Should primarily be considered as an internal
code rearrange to fit the future better.
2006-04-10 15:00:53 +00:00
Daniel Stenberg
5dc02d53c3 This no longer needs the extra define! 2006-04-10 14:58:38 +00:00
Daniel Stenberg
0598547b58 added README.multi_socket 2006-04-10 14:54:12 +00:00
Daniel Stenberg
67c7745f5d state of the multi_socket API works 2006-04-10 14:44:23 +00:00
Daniel Stenberg
a2c289646d check for fork() as well, so that we can build the sws http test server with
fork support for cooler tests
2006-04-10 13:31:35 +00:00
Daniel Stenberg
e6efecd054 avoid duplicate typedefs, as this type is also defined in our public headers 2006-04-10 13:14:14 +00:00
Daniel Stenberg
778b6a86c0 curl_multi_socket() updates 2006-04-10 13:12:52 +00:00
Daniel Stenberg
e5babd086d if configure found a fork(), sws supports --fork which is *NOT* used by the
ordinary test suite. Also removed the perror() calls and instead made the
logging output the errno code to ease error tracking using logs.
2006-04-10 13:11:52 +00:00
Daniel Stenberg
c212ebbdda output the exit code from stunnel to stderr in case it is non-zero 2006-04-10 13:10:25 +00:00
Daniel Stenberg
83b8de3d43 support --fork and pass that on to sws 2006-04-10 13:09:56 +00:00
Daniel Stenberg
e174d374f2 Scan for 'stunnel4' before 'stunnel' since debian have them setup this way
and it should break most other systems. The "funny" part is that debian
actually have a 'stunnel' setup to simulate stunnel v3 but it breaks our own
stunnel-version-detect-and-adjust-to-it system.

Added initial support for optionally running servers with fork support.
2006-04-10 13:03:20 +00:00
Daniel Stenberg
4edb93508d Use correct content-length. Found out by patching the libcurl read to only
read one byte at a time...
2006-04-10 12:26:08 +00:00
Daniel Stenberg
38c994b83b 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.
2006-04-10 08:24:57 +00:00
Daniel Stenberg
1b8643d4c9 65 - curl_multi_socket() added but not extensively tested nor particularly
documented or pushed for.
2006-04-10 08:17:08 +00:00
Daniel Stenberg
d3c796f5b0 we haven't been using yacc/bison in a long time! 2006-04-10 08:16:03 +00:00
Daniel Stenberg
83d8a6a450 forked off the changes from 2005 into its own file 2006-04-10 08:14:05 +00:00
Daniel Stenberg
a21a77d230 CURLE_FTP_USER_PASSWORD_INCORRECT is not returned by libcurl anymore! 2006-04-09 22:41:22 +00:00
Daniel Stenberg
260b88c197 mention RFC 2396 for URL syntax spec 2006-04-09 22:40:49 +00:00
Daniel Stenberg
655331a91b new little example using the new conversion callbacks added in 7.15.4 2006-04-09 08:39:08 +00:00
Daniel Stenberg
09e569f83d mention the outlength argument 2006-04-08 21:29:01 +00:00
Gisle Vanem
e4a4b562c4 readint_le() not needed in USE_WINDOWS_SSPI code. 2006-04-08 11:04:53 +00:00
Gisle Vanem
35b4a755f9 curl_easy_unescape() takes 4 arguments. 2006-04-08 11:01:40 +00:00
Daniel Stenberg
5a4b43848a First commit of David McCreedy's EBCDIC and TPF changes. 2006-04-07 21:50:47 +00:00
Daniel Stenberg
d98869a088 minor re-arrange to return a value in order to avoid compiler warnings
for not returning a value from a non-void function (even though the code
never actually reached that point before)
2006-04-07 12:10:34 +00:00
Daniel Stenberg
4d33cf739d added typedefed function pointers and typecast the NULL assignments in an
attempt to silence picky compilers when assigning data pointers to a function
pointer variable
2006-04-07 11:47:21 +00:00
Daniel Stenberg
34e7daf989 attempt to avoid warnings in picky environments by storing options as
unsigned chars
2006-04-07 11:46:16 +00:00
Daniel Stenberg
b0adcd6a46 cut off a bit more of the type-2 ntlm message since it differs between
hosts
2006-04-05 12:46:03 +00:00
Daniel Stenberg
be285cde3f Michele Bini modified the NTLM code to work for his "weird IIS case"
(http://curl.haxx.se/mail/lib-2006-02/0154.html) by adding the NTLM hash
function in addition to the LM one and making some other adjustments in the
order the different parts of the data block are sent in the Type-2 reply.
Inspiration for this work was taken from the Firefox NTLM implementation.

I edited the existing 21(!) NTLM test cases to run fine with these news. Due
to the fact that we now properly include the host name in the Type-2 message
the test cases now only compare parts of that chunk.
2006-04-05 12:35:48 +00:00
Daniel Stenberg
0ff1faf7f2 for the CURLDEBUG case, we redefine sprintf and vsprintf to make us notice
if any use of such a function slip through
2006-03-28 10:08:54 +00:00
Daniel Stenberg
bcc62cc9e3 #1451929 (http://curl.haxx.se/bug/view.cgi?id=1451929) detailed a bug that
occurred when asking libcurl to follow HTTP redirects and the original URL had
more than one question mark (?). Added test case 276 to verify.
2006-03-28 08:03:25 +00:00
Daniel Stenberg
97b466d409 converted sprintf() to snprintf() to reduce risk 2006-03-28 07:51:59 +00:00
Daniel Stenberg
f17d9bba14 David Byron found a problem multiple -d options when libcurl was built with
--enable-debug, as then curl used free() on memory allocated both with
normal malloc() and with libcurl-provided functions, when the latter MUST be
freed with curl_free() in debug builds.
2006-03-27 21:59:40 +00:00
Gunter Knauf
d74725ce67 minor Makefile fix - let's go 2006;
avoid kiling hugehelp.c when not built from CVS.
2006-03-27 14:34:19 +00:00
Daniel Stenberg
3dad55d7a8 Tor Arntsen figured out that TFTP was broken on a lot of systems since we
called bind() with a too big argument in the 3rd parameter and at least
Tru64, AIX and IRIX seem to be very picky about it.
2006-03-26 08:52:43 +00:00
Daniel Stenberg
598ffeea89 David McCreedy added CURLINFO_FTP_ENTRY_PATH to export the FTP entry path 2006-03-21 22:30:03 +00:00
Daniel Stenberg
83367f67de Xavier Bouchoux made the SSL connection non-blocking for the multi interface
(when using OpenSSL).
2006-03-21 21:54:44 +00:00
Daniel Stenberg
15f2647d71 Tor Arntsen fixed the AIX Toolbox RPM spec 2006-03-21 13:34:41 +00:00
Daniel Stenberg
6421d69bff David McCreedy fixed libcurl to no longer ignore AUTH failures and now it
reacts properly according to the CURLOPT_FTP_SSL setting.
2006-03-20 22:51:08 +00:00
Daniel Stenberg
18081e30e1 mention today's fixes 2006-03-20 22:25:14 +00:00
Daniel Stenberg
97181b5c0d 7.15.3 contributors 2006-03-20 22:24:02 +00:00
Dan Fandrich
a63f9887b9 Fixed a bug whereby a received file whose length was a multiple of
512 bytes could have random garbage appended.  Also, stop processing TFTP
packets which are too short to be legal.
2006-03-20 22:15:22 +00:00
Daniel Stenberg
1282aad4a5 off-by-one for the case when it adds /? and a terminating zero to the URL 2006-03-20 13:14:01 +00:00
Daniel Stenberg
b8fad99f09 start working towards 7.15.4 2006-03-20 09:03:09 +00:00
Daniel Stenberg
c7e9e60b05 fixed the AIX packages 2006-03-20 07:59:45 +00:00
Daniel Stenberg
47f2e1da73 missing in CVS 2006-03-20 07:37:10 +00:00
Daniel Stenberg
5975229919 fixed tftp packet overflow risk 2006-03-20 07:32:50 +00:00
Daniel Stenberg
38295e8a75 slight rewording based on debian bug report #357388 by Justin Pryzby 2006-03-17 08:22:50 +00:00
Daniel Stenberg
f9612b5eaf fixed in CVS 2006-03-16 22:31:04 +00:00
Daniel Stenberg
5cf2ef2ef7 AIX Toolbox RPM spec file by Tor Arntsen 2006-03-16 21:23:41 +00:00
Daniel Stenberg
938b5c886e slightly edited explanation for -f/--fail by the help of Kjell Ericson 2006-03-15 21:21:35 +00:00
Daniel Stenberg
0618e68200 use the new types accordingly 2006-03-14 00:07:21 +00:00
Daniel Stenberg
bac52f3969 --ftp-method and CURLOPT_FTP_FILEMETHOD are now documented and usable 2006-03-14 00:05:15 +00:00
Daniel Stenberg
d494d62953 David McCreedy found a use of the wrong variable when display the error
text from OpenSSL.
2006-03-13 23:34:25 +00:00
Daniel Stenberg
7206181385 David McCreedy found a missing return code assignment 2006-03-13 23:33:46 +00:00
Daniel Stenberg
3f22901a43 Scott Worley's typo fixes 2006-03-13 19:44:36 +00:00
Daniel Stenberg
f70f11fc70 Peter Heuchert's correction for the clear control connection case 2006-03-08 15:46:21 +00:00
Daniel Stenberg
cffebd7fd6 Markus Koetter filed debian bug report #355715 which identified a problem
with the multi interface and multi-part formposts. The fix from February
22nd could make the Curl_done() function get called twice on the same
connection and it was not designed for that and thus tried to call free() on
an already freed memory area!
2006-03-07 23:11:41 +00:00
Daniel Stenberg
b8c8e7349f Peter Heuchert made sure the CURLFTPSSL_CONTROL setting for CURLOPT_FTP_SSL
is used properly.
2006-03-07 22:28:08 +00:00
Daniel Stenberg
8bba99ae56 Lots of users on Windows have reported getting the "SSL: couldn't set
callback" error message so I've now made the setting of that callback not be
as critical as before. The function is only used for additional loggging/
trace anyway so a failure just means slightly less data. It should still be
able to proceed and connect fine to the server.
2006-03-06 22:35:51 +00:00
Daniel Stenberg
b5c5f57613 build fix for Interix 2006-03-04 22:39:31 +00:00
Daniel Stenberg
33df856925 If run on a curl built shared, detect this and invoke libtool for gdb
accordingly.
2006-03-03 14:37:44 +00:00
Daniel Stenberg
ce09cedd2e added test524 2006-03-03 13:12:39 +00:00
Daniel Stenberg
7d68101f83 Prevent uploading to a URL that has no file name part. 2006-03-03 13:09:30 +00:00
Daniel Stenberg
aa50a00898 point out that CAINFO points out a file name by default 2006-03-02 22:09:30 +00:00
Daniel Stenberg
26f112ba55 added large chunk of blurb about the progress meter 2006-03-02 22:04:39 +00:00
Daniel Stenberg
159b9162f8 I'm pretty sure #24 is fixed in 7.15.2 2006-03-02 13:35:54 +00:00
Daniel Stenberg
d7999f9fcb mention Dan F's out-of-file handles fix from the other day 2006-03-02 11:41:23 +00:00
Daniel Stenberg
f13eba4c78 check for and use getprotobyname 2006-03-02 11:37:05 +00:00
Dan Fandrich
050e82e088 Don't lock up at start when there aren't any free file descriptors. 2006-02-28 18:21:33 +00:00
Daniel Stenberg
88377e5b61 added missing files 2006-02-27 21:32:42 +00:00
Daniel Stenberg
241af465fd ack, removed duplicate 2006-02-27 18:17:50 +00:00
Daniel Stenberg
59510a554d 7.15.2 contributors added 2006-02-27 18:16:47 +00:00
Daniel Stenberg
b10aa95d28 start over on what might become 7.15.3 2006-02-27 18:14:14 +00:00
Daniel Stenberg
097bee681a hehe, wrong year but who reads these lines anyway? ;-) 2006-02-27 16:09:24 +00:00
261 changed files with 12985 additions and 4151 deletions

1629
CHANGES

File diff suppressed because it is too large Load Diff

1183
CHANGES.2005 Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -53,12 +53,6 @@ installed:
give you an older version of the file that isn't up-to-date. That file was 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. 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 MAC OS X
With Mac OS X 10.2 and the associated Developer Tools, the installed versions With Mac OS X 10.2 and the associated Developer Tools, the installed versions

31
README
View File

@@ -7,7 +7,7 @@
README README
Curl is a command line tool for transferring data specified with URL 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 MANUAL document. Find out how to install Curl by reading the INSTALL
document. document.
@@ -33,34 +33,7 @@ WEB SITE
Visit the curl web site or mirrors for the latest news and downloads: Visit the curl web site or mirrors for the latest news and downloads:
Sweden http://curl.haxx.se/ Sweden http://curl.haxx.se/
Australia http://curl.planetmirror.com/ Mirrors http://curlm.haxx.se/
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/
CVS CVS

View File

@@ -1,73 +1,57 @@
Curl and libcurl 7.15.2 Curl and libcurl 7.15.5
Public curl release number: 92 Public curl release number: 95
Releases counted from the very beginning: 119 Releases counted from the very beginning: 122
Available command line options: 112 Available command line options: 114
Available curl_easy_setopt() options: 129 Available curl_easy_setopt() options: 133
Number of public functions in libcurl: 46 Number of public functions in libcurl: 54
Amount of public web site mirrors: 31 Amount of public web site mirrors: 33
Number of known libcurl bindings: 32 Number of known libcurl bindings: 32
Number of contributors: 474 Number of contributors: 506
This release includes the following changes: This release includes the following changes:
o Support for SOCKS4 proxies (added --socks4) o added --ftp-ssl-reqd
o CURLOPT_CONNECT_ONLY and CURLINFO_LASTSOCKET added o modified the prototype for the socket callback set with
o CURLOPT_LOCALPORT and CURLOPT_LOCALPORTRANGE (--local-port) added CURLMOPT_SOCKETFUNCTION
o Dropped support for the LPRT ftp command o added curl_multi_assign()
o Gopher is now officially abandoned as a protocol (lib)curl tries to support o added CURLOPT_FTP_ALTERNATIVE_TO_USER and --ftp-alternative-to-user
o curl_global_init() and curl_global_cleanup() are now using a refcount so o added a vcproj file for building libcurl
that it is now legal to call them multiple times. See updated info for o added curl_formget()
details 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: This release includes the following bugfixes:
o two bugs concerning using curl_multi_remove_handle() before the transfer o chunked encoding when custom header "Transfer-Encoding: chunked" is set
was complete o Curl_strerror() crash on unknown errors
o multi-pass authentication and compressed content o changing Content-Type when doing formposts
o minor format string mistake in the GSS/Negotiate code o added CURL_EXTERN to a few recent multi functions that lacked them
o cached DNS entries could remain in the cache too long o splay-tree related problems for internal expire time handling
o improved GnuTLS check in configure o FTP ASCII CRLF counter reset
o re-used FTP connections when the second request didn't do a transfer o cookie parser now compares paths case sensitive
o plain --limit-rate [num] means bytes o an easy handle with shared DNS cache added to a multi handle caused a crash
o re-creating a dead connection is no longer counted internally as a followed o couldn't override the Proxy-Connection: header for non-CONNECT requests
redirect and thus prevents a weird error that would occur if a FTP o curl_multi_fdset() could wrongly return -1 as max_fd value
connection died on an attempted re-use
o Try PASV after failing to connect to the port the EPSV response contained
o -P [IP] with non-local address with ipv6-enabled curl
o -P [hostname] with ipv6-disabled curl
o libcurl.m4 was updated
o configure no longer warns if the current path contains a space
o test suite kill race condition
o FTP_SKIP_PASV_IP and FTP_USE_EPSV when doing FTP over HTTP proxy
o Doing a second request with FTP on the same bath path, would make libcurl
confuse what current working directory it had
o FTP over HTTP proxy now sends the second CONNECT properly
o numerous compiler warnings and build quirks for various compilers have
been addressed
o supports name and passwords up to 255 bytes long, embedded in URLs
o the HTTP_ONLY define disables the TFTP support
Other curl-related news since the previous public release: Other curl-related news:
o http://curlm.haxx.se/ is new service that automatically redirects you to a o yassl 1.3.7 can now be used with libcurl as an optional TLS library for
curl web mirror that is close to you! 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
o http://curl.hkmirror.org/ is a new curl web mirror in Hong Kong New curl mirrors:
o http://curl.storemypix.com/ is a new curl web mirror in Germany
o http://curl.s-lines.net/ is a new curl web mirror in Japan o
o http://curl.oss-mirror.org/ is a new curl web mirror in Ireland
o http://curl.linux-mirror.org/ is a new curl web mirror in Germany
o pycurl 7.15.1 was released: http://pycurl.sf.net/
o TclCurl 0.15.1 was released:
http://personal1.iddeo.es/andresgarci/tclcurl/english/
This release would not have looked like this without help, code, reports and This release would not have looked like this without help, code, reports and
advice from friends like these: advice from friends like these:
Dov Murik, Jean Jacques Drouin, Andres Garcia, Yang Tse, Gisle Vanem, Dan Dan Fandrich, Peter Silva, Arve Knudsen, Michael Wallner, Toshiyuki Maezawa,
Fandrich, Alexander Lazic, Michael Jahn, Andrew Benham, Bryan Henderson, Ingmar Runge, Ates Goral, David McCreedy, Jari Sundell, Georg Horn,
David Shaw, Jon Turner, Duane Cathey, Michal Marek, Philippe Vaucher, Kent Gisle Vanem, Yang Tse, Michael Jerris, Dan Nelson, Yves Lejeune,
Boortz, Karl Moerder, Shmulik Regev, Ulf H<>rnhammar, Peter Su Maciej Karpiuk, Mark Lentczner
Thanks! (and sorry if I forgot to mention someone) Thanks! (and sorry if I forgot to mention someone)

View File

@@ -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 -

View File

@@ -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 # This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms # you should have received as part of this distribution. The terms
@@ -21,6 +21,7 @@
# $Id$ # $Id$
########################################################################### ###########################################################################
dnl CURL_CHECK_HEADER_WINDOWS dnl CURL_CHECK_HEADER_WINDOWS
dnl ------------------------------------------------- dnl -------------------------------------------------
dnl Check for compilable and valid windows.h header dnl Check for compilable and valid windows.h header
@@ -35,7 +36,11 @@ AC_DEFUN([CURL_CHECK_HEADER_WINDOWS], [
#endif #endif
#include <windows.h> #include <windows.h>
],[ ],[
#ifdef __CYGWIN__
HAVE_WINDOWS_H shall not be defined.
#else
int dummy=2*WINVER; int dummy=2*WINVER;
#endif
]) ])
],[ ],[
ac_cv_header_windows_h="yes" ac_cv_header_windows_h="yes"
@@ -43,12 +48,14 @@ AC_DEFUN([CURL_CHECK_HEADER_WINDOWS], [
ac_cv_header_windows_h="no" ac_cv_header_windows_h="no"
]) ])
]) ])
if test "x$ac_cv_header_windows_h" = "xyes"; then case "$ac_cv_header_windows_h" in
AC_DEFINE_UNQUOTED(HAVE_WINDOWS_H, 1, yes)
[Define to 1 if you have the windows.h header file.]) AC_DEFINE_UNQUOTED(HAVE_WINDOWS_H, 1,
AC_DEFINE_UNQUOTED(WIN32_LEAN_AND_MEAN, 1, [Define to 1 if you have the windows.h header file.])
[Define to avoid automatic inclusion of winsock.h]) AC_DEFINE_UNQUOTED(WIN32_LEAN_AND_MEAN, 1,
fi [Define to avoid automatic inclusion of winsock.h])
;;
esac
]) ])
@@ -68,7 +75,11 @@ AC_DEFUN([CURL_CHECK_HEADER_WINSOCK], [
#include <windows.h> #include <windows.h>
#include <winsock.h> #include <winsock.h>
],[ ],[
#ifdef __CYGWIN__
HAVE_WINSOCK_H shall not be defined.
#else
int dummy=WSACleanup(); int dummy=WSACleanup();
#endif
]) ])
],[ ],[
ac_cv_header_winsock_h="yes" ac_cv_header_winsock_h="yes"
@@ -76,10 +87,12 @@ AC_DEFUN([CURL_CHECK_HEADER_WINSOCK], [
ac_cv_header_winsock_h="no" ac_cv_header_winsock_h="no"
]) ])
]) ])
if test "x$ac_cv_header_winsock_h" = "xyes"; then case "$ac_cv_header_winsock_h" in
AC_DEFINE_UNQUOTED(HAVE_WINSOCK_H, 1, yes)
[Define to 1 if you have the winsock.h header file.]) AC_DEFINE_UNQUOTED(HAVE_WINSOCK_H, 1,
fi [Define to 1 if you have the winsock.h header file.])
;;
esac
]) ])
@@ -99,7 +112,11 @@ AC_DEFUN([CURL_CHECK_HEADER_WINSOCK2], [
#include <windows.h> #include <windows.h>
#include <winsock2.h> #include <winsock2.h>
],[ ],[
#ifdef __CYGWIN__
HAVE_WINSOCK2_H shall not be defined.
#else
int dummy=2*IPPROTO_ESP; int dummy=2*IPPROTO_ESP;
#endif
]) ])
],[ ],[
ac_cv_header_winsock2_h="yes" ac_cv_header_winsock2_h="yes"
@@ -107,10 +124,12 @@ AC_DEFUN([CURL_CHECK_HEADER_WINSOCK2], [
ac_cv_header_winsock2_h="no" ac_cv_header_winsock2_h="no"
]) ])
]) ])
if test "x$ac_cv_header_winsock2_h" = "xyes"; then case "$ac_cv_header_winsock2_h" in
AC_DEFINE_UNQUOTED(HAVE_WINSOCK2_H, 1, yes)
[Define to 1 if you have the winsock2.h header file.]) AC_DEFINE_UNQUOTED(HAVE_WINSOCK2_H, 1,
fi [Define to 1 if you have the winsock2.h header file.])
;;
esac
]) ])
@@ -131,7 +150,11 @@ AC_DEFUN([CURL_CHECK_HEADER_WS2TCPIP], [
#include <winsock2.h> #include <winsock2.h>
#include <ws2tcpip.h> #include <ws2tcpip.h>
],[ ],[
#ifdef __CYGWIN__
HAVE_WS2TCPIP_H shall not be defined.
#else
int dummy=2*IP_PKTINFO; int dummy=2*IP_PKTINFO;
#endif
]) ])
],[ ],[
ac_cv_header_ws2tcpip_h="yes" ac_cv_header_ws2tcpip_h="yes"
@@ -139,9 +162,62 @@ AC_DEFUN([CURL_CHECK_HEADER_WS2TCPIP], [
ac_cv_header_ws2tcpip_h="no" ac_cv_header_ws2tcpip_h="no"
]) ])
]) ])
if test "x$ac_cv_header_ws2tcpip_h" = "xyes"; then case "$ac_cv_header_ws2tcpip_h" in
AC_DEFINE_UNQUOTED(HAVE_WS2TCPIP_H, 1, yes)
[Define to 1 if you have the ws2tcpip.h header file.]) 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 fi
]) ])
@@ -194,12 +270,15 @@ AC_DEFUN([CURL_CHECK_TYPE_SOCKLEN_T], [
done done
done done
]) ])
if test "$curl_cv_socklen_t_equiv" = "unknown"; then case "$curl_cv_socklen_t_equiv" in
AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) unknown)
else AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv, ;;
[type to use in place of socklen_t if not defined]) *)
fi AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv,
[type to use in place of socklen_t if not defined])
;;
esac
],[ ],[
#undef inline #undef inline
#ifdef HAVE_WINDOWS_H #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 If the function succeeds HAVE_GETNAMEINFO will be
dnl defined, defining the types of the arguments in dnl defined, defining the types of the arguments in
dnl GETNAMEINFO_TYPE_ARG1, GETNAMEINFO_TYPE_ARG2, dnl GETNAMEINFO_TYPE_ARG1, GETNAMEINFO_TYPE_ARG2,
dnl GETNAMEINFO_TYPE_ARG46 and GETNAMEINFO_TYPE_ARG7. dnl GETNAMEINFO_TYPE_ARG46 and GETNAMEINFO_TYPE_ARG7,
dnl This function is experimental and its results shall dnl and also defining the type qualifier of first
dnl not be trusted while this notice is in place ------ dnl argument in GETNAMEINFO_QUAL_ARG1.
AC_DEFUN([CURL_CHECK_FUNC_GETNAMEINFO], [ AC_DEFUN([CURL_CHECK_FUNC_GETNAMEINFO], [
AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl 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'` set dummy `echo "$curl_cv_func_getnameinfo_args" | sed 's/\*/\*/g'`
IFS=$gni_prev_IFS IFS=$gni_prev_IFS
shift 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], AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG2, $[2],
[Define to the type of arg 2 for getnameinfo.]) [Define to the type of arg 2 for getnameinfo.])
AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG46, $[3], AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG46, $[3],
[Define to the type of args 4 and 6 for getnameinfo.]) [Define to the type of args 4 and 6 for getnameinfo.])
AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG7, $[4], AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG7, $[4],
[Define to the type of arg 7 for getnameinfo.]) [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, AC_DEFINE_UNQUOTED(HAVE_GETNAMEINFO, 1,
[Define to 1 if you have the getnameinfo function.]) [Define to 1 if you have the getnameinfo function.])
ac_cv_func_getnameinfo="yes" ac_cv_func_getnameinfo="yes"
@@ -386,6 +501,481 @@ AC_DEFUN([CURL_CHECK_FUNC_GETNAMEINFO], [
]) # AC_DEFUN ]) # 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 CURL_CHECK_NONBLOCKING_SOCKET
dnl ------------------------------------------------- dnl -------------------------------------------------
dnl Check for how to set a socket to non-blocking state. There seems to exist 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 TYPE_IN_ADDR_T
dnl ------------------------------------------------- dnl -------------------------------------------------
dnl Check for in_addr_t: it is used to receive the return code of inet_addr() 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 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], 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 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 pendantic compiler options as possible for that particular compiler. The
dnl options are only used for debug-builds. dnl options are only used for debug-builds.
AC_DEFUN([CURL_CC_DEBUG_OPTS], AC_DEFUN([CURL_CC_DEBUG_OPTS],
[ [
if test "z$ICC" = "z"; then
CURL_DETECT_ICC
fi
if test "$GCC" = "yes"; then if test "$GCC" = "yes"; then
dnl figure out gcc version! dnl figure out gcc version!
@@ -1121,17 +1628,6 @@ AC_DEFUN([CURL_CC_DEBUG_OPTS],
gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null` gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null`
AC_MSG_RESULT($gccver) 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 if test "$ICC" = "yes"; then
dnl this is icc, not gcc. dnl this is icc, not gcc.

View File

@@ -12,3 +12,5 @@ Gisle Vanem
Gunter Knauf Gunter Knauf
Henrik Stoerner Henrik Stoerner
Yang Tse Yang Tse
Nick Mathewson
Alexander Lazic

View File

@@ -1,5 +1,46 @@
Changelog for the c-ares project 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 * January 9, 2006
- Alexander Lazic improved the getservbyport_r() configure check. - Alexander Lazic improved the getservbyport_r() configure check.
@@ -28,15 +69,15 @@
- Added constants that will be used by ares_getaddrinfo - Added constants that will be used by ares_getaddrinfo
- Made ares_getnameinfo use the reentrant getservbyport (getservbyport_r) if it is - Made ares_getnameinfo use the reentrant getservbyport (getservbyport_r) if it
available to ensure it works properly in a threaded environment. is available to ensure it works properly in a threaded environment.
* September 10 * September 10
- configure fix for detecting a member in the sockaddr_in6 struct which failed - configure fix for detecting a member in the sockaddr_in6 struct which failed
on ipv6-enabled HP-UX 11.00 on ipv6-enabled HP-UX 11.00
Version 1.3.0 (August 29, 2004) Version 1.3.0 (August 29, 2005)
* August 21 * August 21

View File

@@ -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 # adig and ahost are just sample programs and thus not mentioned with the
# regular sources and headers # regular sources and headers
EXTRA_DIST = CHANGES README.cares Makefile.inc adig.c ahost.c $(man_MANS) \ 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 VER=-version-info 1:0:0
@@ -43,7 +43,13 @@ VER=-version-info 1:0:0
# set age to 0. (c:r:a=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 # Makefile.inc provides the CSOURCES and HHEADERS defines
include Makefile.inc include Makefile.inc

View File

@@ -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 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 \ 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 \ 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 \ ares_free_hostent.3 ares_free_string.3 ares_gethostbyaddr.3 \

View File

@@ -20,7 +20,7 @@ endif
TARGETS = adig.nlm ahost.nlm TARGETS = adig.nlm ahost.nlm
LTARGET = libcares.lib LTARGET = libcares.lib
VERSION = $(LIBCARES_VERSION) 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 DESCR = cURL $(subst .def,,$(notdir $@)) $(LIBCARES_VERSION_STR) - http://curl.haxx.se
MTSAFE = YES MTSAFE = YES
STACK = 64000 STACK = 64000
@@ -88,7 +88,7 @@ LD = nlmconv
LDFLAGS = -T LDFLAGS = -T
AR = ar AR = ar
ARFLAGS = -cq 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 CFLAGS += -Wall -Wno-format -Wno-uninitialized # -pedantic
ifeq ($(LIBARCH),LIBC) ifeq ($(LIBARCH),LIBC)
PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o 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)** All your changes will be lost!!$(DL) >> $@
@echo $(DL)*/$(DL) >> $@ @echo $(DL)*/$(DL) >> $@
@echo $(DL)#define OS "i586-pc-NetWare"$(DL) >> $@ @echo $(DL)#define OS "i586-pc-NetWare"$(DL) >> $@
@echo $(DL)#define VERSION "$(LIBCURL_VERSION_STR)"$(DL) >> $@ @echo $(DL)#define VERSION "$(LIBCARES_VERSION_STR)"$(DL) >> $@
@echo $(DL)#define PACKAGE_BUGREPORT "curl-bug@haxx.se"$(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_INET_H 1$(DL) >> $@
@echo $(DL)#define HAVE_ARPA_NAMESER_H 1$(DL) >> $@ @echo $(DL)#define HAVE_ARPA_NAMESER_H 1$(DL) >> $@
@echo $(DL)#define HAVE_ASSERT_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_LONGLONG 1$(DL) >> $@
@echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@ @echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
@echo $(DL)#define HAVE_NETINET_IN_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_SELECT 1$(DL) >> $@
@echo $(DL)#define HAVE_SEND 1$(DL) >> $@
@echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@ @echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@
@echo $(DL)#define HAVE_SIGNAL 1$(DL) >> $@ @echo $(DL)#define HAVE_SIGNAL 1$(DL) >> $@
@echo $(DL)#define HAVE_SOCKET 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_TIME_H 1$(DL) >> $@
@echo $(DL)#define HAVE_UNAME 1$(DL) >> $@ @echo $(DL)#define HAVE_UNAME 1$(DL) >> $@
@echo $(DL)#define HAVE_UNISTD_H 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 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 SIZEOF_CURL_OFF_T 4$(DL) >> $@
@echo $(DL)#define STDC_HEADERS 1$(DL) >> $@ @echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
@echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@ @echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@

View File

@@ -140,51 +140,58 @@ vclean realclean: clean
# #
# Copyright "gcc -MM .." # Copyright "gcc -MM .."
# #
$(OBJ_DIR)\ares_fds.obj: ares_fds.c setup.h ares.h ares_private.h ares_ipv6.h $(OBJ_DIR)\ares_fds.obj: ares_fds.c setup.h setup_once.h ares.h ares_private.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 \
ares_ipv6.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 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 ares_private.h ares_ipv6.h
$(OBJ_DIR)\ares_free_string.obj: ares_free_string.c setup.h ares.h $(OBJ_DIR)\ares_init.obj: ares_init.c setup.h setup_once.h nameser.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 \
ares_private.h ares_ipv6.h inet_net_pton.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 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 ares_ipv6.h
$(OBJ_DIR)\ares_gethostbyname.obj: ares_gethostbyname.c setup.h nameser.h ares.h \ $(OBJ_DIR)\ares_getnameinfo.obj: ares_getnameinfo.c setup.h setup_once.h \
ares_private.h ares_ipv6.h inet_net_pton.h bitncmp.h nameser.h ares.h ares_private.h ares_ipv6.h inet_ntop.h
$(OBJ_DIR)\ares_strerror.obj: ares_strerror.c setup.h ares.h $(OBJ_DIR)\inet_net_pton.obj: inet_net_pton.c setup.h setup_once.h nameser.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 \
ares_ipv6.h inet_net_pton.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)\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

View File

@@ -14,7 +14,11 @@ AC_DEFUN([CURL_CHECK_HEADER_WINDOWS], [
#endif #endif
#include <windows.h> #include <windows.h>
],[ ],[
#ifdef __CYGWIN__
HAVE_WINDOWS_H shall not be defined.
#else
int dummy=2*WINVER; int dummy=2*WINVER;
#endif
]) ])
],[ ],[
ac_cv_header_windows_h="yes" ac_cv_header_windows_h="yes"
@@ -22,12 +26,14 @@ AC_DEFUN([CURL_CHECK_HEADER_WINDOWS], [
ac_cv_header_windows_h="no" ac_cv_header_windows_h="no"
]) ])
]) ])
if test "x$ac_cv_header_windows_h" = "xyes"; then case "$ac_cv_header_windows_h" in
AC_DEFINE_UNQUOTED(HAVE_WINDOWS_H, 1, yes)
[Define to 1 if you have the windows.h header file.]) AC_DEFINE_UNQUOTED(HAVE_WINDOWS_H, 1,
AC_DEFINE_UNQUOTED(WIN32_LEAN_AND_MEAN, 1, [Define to 1 if you have the windows.h header file.])
[Define to avoid automatic inclusion of winsock.h]) AC_DEFINE_UNQUOTED(WIN32_LEAN_AND_MEAN, 1,
fi [Define to avoid automatic inclusion of winsock.h])
;;
esac
]) ])
@@ -47,7 +53,11 @@ AC_DEFUN([CURL_CHECK_HEADER_WINSOCK], [
#include <windows.h> #include <windows.h>
#include <winsock.h> #include <winsock.h>
],[ ],[
#ifdef __CYGWIN__
HAVE_WINSOCK_H shall not be defined.
#else
int dummy=WSACleanup(); int dummy=WSACleanup();
#endif
]) ])
],[ ],[
ac_cv_header_winsock_h="yes" ac_cv_header_winsock_h="yes"
@@ -55,10 +65,12 @@ AC_DEFUN([CURL_CHECK_HEADER_WINSOCK], [
ac_cv_header_winsock_h="no" ac_cv_header_winsock_h="no"
]) ])
]) ])
if test "x$ac_cv_header_winsock_h" = "xyes"; then case "$ac_cv_header_winsock_h" in
AC_DEFINE_UNQUOTED(HAVE_WINSOCK_H, 1, yes)
[Define to 1 if you have the winsock.h header file.]) AC_DEFINE_UNQUOTED(HAVE_WINSOCK_H, 1,
fi [Define to 1 if you have the winsock.h header file.])
;;
esac
]) ])
@@ -78,7 +90,11 @@ AC_DEFUN([CURL_CHECK_HEADER_WINSOCK2], [
#include <windows.h> #include <windows.h>
#include <winsock2.h> #include <winsock2.h>
],[ ],[
#ifdef __CYGWIN__
HAVE_WINSOCK2_H shall not be defined.
#else
int dummy=2*IPPROTO_ESP; int dummy=2*IPPROTO_ESP;
#endif
]) ])
],[ ],[
ac_cv_header_winsock2_h="yes" ac_cv_header_winsock2_h="yes"
@@ -86,10 +102,12 @@ AC_DEFUN([CURL_CHECK_HEADER_WINSOCK2], [
ac_cv_header_winsock2_h="no" ac_cv_header_winsock2_h="no"
]) ])
]) ])
if test "x$ac_cv_header_winsock2_h" = "xyes"; then case "$ac_cv_header_winsock2_h" in
AC_DEFINE_UNQUOTED(HAVE_WINSOCK2_H, 1, yes)
[Define to 1 if you have the winsock2.h header file.]) AC_DEFINE_UNQUOTED(HAVE_WINSOCK2_H, 1,
fi [Define to 1 if you have the winsock2.h header file.])
;;
esac
]) ])
@@ -110,7 +128,11 @@ AC_DEFUN([CURL_CHECK_HEADER_WS2TCPIP], [
#include <winsock2.h> #include <winsock2.h>
#include <ws2tcpip.h> #include <ws2tcpip.h>
],[ ],[
#ifdef __CYGWIN__
HAVE_WS2TCPIP_H shall not be defined.
#else
int dummy=2*IP_PKTINFO; int dummy=2*IP_PKTINFO;
#endif
]) ])
],[ ],[
ac_cv_header_ws2tcpip_h="yes" ac_cv_header_ws2tcpip_h="yes"
@@ -118,9 +140,62 @@ AC_DEFUN([CURL_CHECK_HEADER_WS2TCPIP], [
ac_cv_header_ws2tcpip_h="no" ac_cv_header_ws2tcpip_h="no"
]) ])
]) ])
if test "x$ac_cv_header_ws2tcpip_h" = "xyes"; then case "$ac_cv_header_ws2tcpip_h" in
AC_DEFINE_UNQUOTED(HAVE_WS2TCPIP_H, 1, yes)
[Define to 1 if you have the ws2tcpip.h header file.]) 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 fi
]) ])
@@ -173,12 +248,15 @@ AC_DEFUN([CURL_CHECK_TYPE_SOCKLEN_T], [
done done
done done
]) ])
if test "$curl_cv_socklen_t_equiv" = "unknown"; then case "$curl_cv_socklen_t_equiv" in
AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) unknown)
else AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv, ;;
[type to use in place of socklen_t if not defined]) *)
fi AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv,
[type to use in place of socklen_t if not defined])
;;
esac
],[ ],[
#undef inline #undef inline
#ifdef HAVE_WINDOWS_H #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 If the function succeeds HAVE_GETNAMEINFO will be
dnl defined, defining the types of the arguments in dnl defined, defining the types of the arguments in
dnl GETNAMEINFO_TYPE_ARG1, GETNAMEINFO_TYPE_ARG2, dnl GETNAMEINFO_TYPE_ARG1, GETNAMEINFO_TYPE_ARG2,
dnl GETNAMEINFO_TYPE_ARG46 and GETNAMEINFO_TYPE_ARG7. dnl GETNAMEINFO_TYPE_ARG46 and GETNAMEINFO_TYPE_ARG7,
dnl This function is experimental and its results shall dnl and also defining the type qualifier of first
dnl not be trusted while this notice is in place ------ dnl argument in GETNAMEINFO_QUAL_ARG1.
AC_DEFUN([CURL_CHECK_FUNC_GETNAMEINFO], [ AC_DEFUN([CURL_CHECK_FUNC_GETNAMEINFO], [
AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl 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'` set dummy `echo "$curl_cv_func_getnameinfo_args" | sed 's/\*/\*/g'`
IFS=$gni_prev_IFS IFS=$gni_prev_IFS
shift 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], AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG2, $[2],
[Define to the type of arg 2 for getnameinfo.]) [Define to the type of arg 2 for getnameinfo.])
AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG46, $[3], AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG46, $[3],
[Define to the type of args 4 and 6 for getnameinfo.]) [Define to the type of args 4 and 6 for getnameinfo.])
AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG7, $[4], AC_DEFINE_UNQUOTED(GETNAMEINFO_TYPE_ARG7, $[4],
[Define to the type of arg 7 for getnameinfo.]) [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, AC_DEFINE_UNQUOTED(HAVE_GETNAMEINFO, 1,
[Define to 1 if you have the getnameinfo function.]) [Define to 1 if you have the getnameinfo function.])
ac_cv_func_getnameinfo="yes" ac_cv_func_getnameinfo="yes"
@@ -365,6 +479,481 @@ AC_DEFUN([CURL_CHECK_FUNC_GETNAMEINFO], [
]) # AC_DEFUN ]) # 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 CURL_CHECK_NONBLOCKING_SOCKET
dnl ------------------------------------------------- dnl -------------------------------------------------
dnl Check for how to set a socket to non-blocking state. There seems to exist dnl Check for how to set a socket to non-blocking state. There seems to exist
@@ -826,3 +1415,39 @@ else
fi 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
])]
)

View File

@@ -396,7 +396,7 @@ static const unsigned char *display_question(const unsigned char *aptr,
*/ */
if (aptr + QFIXEDSZ > abuf + alen) if (aptr + QFIXEDSZ > abuf + alen)
{ {
free(name); ares_free_string(name);
return NULL; return NULL;
} }
@@ -412,7 +412,7 @@ static const unsigned char *display_question(const unsigned char *aptr,
if (dnsclass != C_IN) if (dnsclass != C_IN)
printf("\t%s", class_name(dnsclass)); printf("\t%s", class_name(dnsclass));
printf("\t%s\n", type_name(type)); printf("\t%s\n", type_name(type));
free(name); ares_free_string(name);
return aptr; return aptr;
} }
@@ -436,7 +436,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
*/ */
if (aptr + RRFIXEDSZ > abuf + alen) if (aptr + RRFIXEDSZ > abuf + alen)
{ {
free(name); ares_free_string(name);
return NULL; return NULL;
} }
@@ -449,7 +449,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
aptr += RRFIXEDSZ; aptr += RRFIXEDSZ;
if (aptr + dlen > abuf + alen) if (aptr + dlen > abuf + alen)
{ {
free(name); ares_free_string(name);
return NULL; return NULL;
} }
@@ -458,7 +458,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
if (dnsclass != C_IN) if (dnsclass != C_IN)
printf("\t%s", class_name(dnsclass)); printf("\t%s", class_name(dnsclass));
printf("\t%s", type_name(type)); printf("\t%s", type_name(type));
free(name); ares_free_string(name);
/* Display the RR data. Don't touch aptr. */ /* Display the RR data. Don't touch aptr. */
switch (type) switch (type)
@@ -476,7 +476,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
if (status != ARES_SUCCESS) if (status != ARES_SUCCESS)
return NULL; return NULL;
printf("\t%s.", name); printf("\t%s.", name);
free(name); ares_free_string(name);
break; break;
case T_HINFO: case T_HINFO:
@@ -500,13 +500,13 @@ static const unsigned char *display_rr(const unsigned char *aptr,
if (status != ARES_SUCCESS) if (status != ARES_SUCCESS)
return NULL; return NULL;
printf("\t%s.", name); printf("\t%s.", name);
free(name); ares_free_string(name);
p += len; p += len;
status = ares_expand_name(p, abuf, alen, &name, &len); status = ares_expand_name(p, abuf, alen, &name, &len);
if (status != ARES_SUCCESS) if (status != ARES_SUCCESS)
return NULL; return NULL;
printf("\t%s.", name); printf("\t%s.", name);
free(name); ares_free_string(name);
break; break;
case T_MX: case T_MX:
@@ -520,7 +520,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
if (status != ARES_SUCCESS) if (status != ARES_SUCCESS)
return NULL; return NULL;
printf("\t%s.", name); printf("\t%s.", name);
free(name); ares_free_string(name);
break; break;
case T_SOA: case T_SOA:
@@ -532,13 +532,13 @@ static const unsigned char *display_rr(const unsigned char *aptr,
if (status != ARES_SUCCESS) if (status != ARES_SUCCESS)
return NULL; return NULL;
printf("\t%s.\n", name); printf("\t%s.\n", name);
free(name); ares_free_string(name);
p += len; p += len;
status = ares_expand_name(p, abuf, alen, &name, &len); status = ares_expand_name(p, abuf, alen, &name, &len);
if (status != ARES_SUCCESS) if (status != ARES_SUCCESS)
return NULL; return NULL;
printf("\t\t\t\t\t\t%s.\n", name); printf("\t\t\t\t\t\t%s.\n", name);
free(name); ares_free_string(name);
p += len; p += len;
if (p + 20 > aptr + dlen) if (p + 20 > aptr + dlen)
return NULL; return NULL;
@@ -592,7 +592,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
if (status != ARES_SUCCESS) if (status != ARES_SUCCESS)
return NULL; return NULL;
printf("\t%s.", name); printf("\t%s.", name);
free(name); ares_free_string(name);
break; break;
default: default:

View File

@@ -1,4 +1,6 @@
/* Copyright 1998 by the Massachusetts Institute of Technology. /* Copyright 1998 by the Massachusetts Institute of Technology.
*
* $Id$
* *
* Permission to use, copy, modify, and distribute this * Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without * software and its documentation for any purpose and without
@@ -30,6 +32,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
#include "ares.h" #include "ares.h"
#include "ares_dns.h" #include "ares_dns.h"
#include "inet_ntop.h" #include "inet_ntop.h"
@@ -52,7 +58,7 @@ static void usage(void);
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
ares_channel channel; ares_channel channel;
int status, nfds; int status, nfds, c, addr_family = AF_INET;
fd_set read_fds, write_fds; fd_set read_fds, write_fds;
struct timeval *tvp, tv; struct timeval *tvp, tv;
struct in_addr addr4; struct in_addr addr4;
@@ -64,7 +70,28 @@ int main(int argc, char **argv)
WSAStartup(wVersionRequested, &wsaData); WSAStartup(wVersionRequested, &wsaData);
#endif #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(); usage();
status = ares_init(&channel); status = ares_init(&channel);
@@ -75,7 +102,7 @@ int main(int argc, char **argv)
} }
/* Initiate the queries, one per command-line argument. */ /* Initiate the queries, one per command-line argument. */
for (argv++; *argv; argv++) for ( ; *argv; argv++)
{ {
if (ares_inet_pton(AF_INET, *argv, &addr4) == 1) if (ares_inet_pton(AF_INET, *argv, &addr4) == 1)
{ {
@@ -89,8 +116,7 @@ int main(int argc, char **argv)
} }
else else
{ {
/* assume user wants A-records */ ares_gethostbyname(channel, *argv, addr_family, callback, *argv);
ares_gethostbyname(channel, *argv, AF_INET, callback, *argv);
} }
} }
@@ -132,8 +158,8 @@ static void callback(void *arg, int status, struct hostent *host)
{ {
int i; int i;
printf (", Aliases: "); printf (", Aliases: ");
for (i = 0; host->h_aliases[i]; i++) for (i = 0; host->h_aliases[i]; i++)
printf("%s ", host->h_aliases[i]); printf("%s ", host->h_aliases[i]);
} }
#endif #endif
@@ -143,6 +169,6 @@ static void callback(void *arg, int status, struct hostent *host)
static void usage(void) static void usage(void)
{ {
fprintf(stderr, "usage: ahost {host|addr} ...\n"); fprintf(stderr, "usage: ahost [-t {a|aaaa}] {host|addr} ...\n");
exit(1); exit(1);
} }

View File

@@ -31,7 +31,7 @@
#include <netinet/in.h> #include <netinet/in.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <tcp.h> #include <tcp.h>
#elif defined(WIN32) #elif defined(WIN32) && !defined(__CYGWIN__)
#include <winsock2.h> #include <winsock2.h>
#include <windows.h> #include <windows.h>
#else #else
@@ -93,6 +93,7 @@ extern "C" {
#define ARES_OPT_SERVERS (1 << 6) #define ARES_OPT_SERVERS (1 << 6)
#define ARES_OPT_DOMAINS (1 << 7) #define ARES_OPT_DOMAINS (1 << 7)
#define ARES_OPT_LOOKUPS (1 << 8) #define ARES_OPT_LOOKUPS (1 << 8)
#define ARES_OPT_SOCK_STATE_CB (1 << 9)
/* Nameinfo flag values */ /* Nameinfo flag values */
#define ARES_NI_NOFQDN (1 << 0) #define ARES_NI_NOFQDN (1 << 0)
@@ -135,6 +136,18 @@ extern "C" {
#define ARES_GETSOCK_WRITABLE(bits,num) (bits & (1 << ((num) + \ #define ARES_GETSOCK_WRITABLE(bits,num) (bits & (1 << ((num) + \
ARES_GETSOCK_MAXNUM))) 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 { struct ares_options {
int flags; int flags;
int timeout; int timeout;
@@ -147,6 +160,8 @@ struct ares_options {
char **domains; char **domains;
int ndomains; int ndomains;
char *lookups; char *lookups;
ares_sock_state_cb sock_state_cb;
void *sock_state_cb_data;
}; };
struct hostent; struct hostent;

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright 1998 by the Massachusetts Institute of Technology. /* Copyright 1998 by the Massachusetts Institute of Technology.
* *
* Permission to use, copy, modify, and distribute this * Permission to use, copy, modify, and distribute this
@@ -23,7 +25,7 @@
#include "ares.h" #include "ares.h"
#include "ares_private.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; struct send_request *sendreq;
@@ -46,11 +48,13 @@ void ares__close_sockets(struct server_state *server)
/* Close the TCP and UDP sockets. */ /* Close the TCP and UDP sockets. */
if (server->tcp_socket != ARES_SOCKET_BAD) if (server->tcp_socket != ARES_SOCKET_BAD)
{ {
SOCK_STATE_CALLBACK(channel, server->tcp_socket, 0, 0);
closesocket(server->tcp_socket); closesocket(server->tcp_socket);
server->tcp_socket = ARES_SOCKET_BAD; server->tcp_socket = ARES_SOCKET_BAD;
} }
if (server->udp_socket != ARES_SOCKET_BAD) if (server->udp_socket != ARES_SOCKET_BAD)
{ {
SOCK_STATE_CALLBACK(channel, server->udp_socket, 0, 0);
closesocket(server->udp_socket); closesocket(server->udp_socket);
server->udp_socket = ARES_SOCKET_BAD; server->udp_socket = ARES_SOCKET_BAD;
} }

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright 1998 by the Massachusetts Institute of Technology. /* Copyright 1998 by the Massachusetts Institute of Technology.
* *
* Permission to use, copy, modify, and distribute this * Permission to use, copy, modify, and distribute this

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright 1998 by the Massachusetts Institute of Technology. /* Copyright 1998 by the Massachusetts Institute of Technology.
* *
* Permission to use, copy, modify, and distribute this * Permission to use, copy, modify, and distribute this

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright (C) 2004 by Daniel Stenberg et al /* Copyright (C) 2004 by Daniel Stenberg et al
* *
* Permission to use, copy, modify, and distribute this software and its * 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)) if (!(channel->flags & ARES_FLAG_STAYOPEN))
{ {
for (i = 0; i < channel->nservers; i++) for (i = 0; i < channel->nservers; i++)
ares__close_sockets(&channel->servers[i]); ares__close_sockets(channel, &channel->servers[i]);
} }
} }

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright 1998 by the Massachusetts Institute of Technology. /* Copyright 1998 by the Massachusetts Institute of Technology.
* *
* Permission to use, copy, modify, and distribute this * Permission to use, copy, modify, and distribute this
@@ -24,7 +26,7 @@ void ares_destroy(ares_channel channel)
struct query *query; struct query *query;
for (i = 0; i < channel->nservers; i++) for (i = 0; i < channel->nservers; i++)
ares__close_sockets(&channel->servers[i]); ares__close_sockets(channel, &channel->servers[i]);
free(channel->servers); free(channel->servers);
for (i = 0; i < channel->ndomains; i++) for (i = 0; i < channel->ndomains; i++)
free(channel->domains[i]); free(channel->domains[i]);

View File

@@ -18,18 +18,6 @@
#ifndef ARES__DNS_H #ifndef ARES__DNS_H
#define 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__16BIT(p) (((p)[0] << 8) | (p)[1])
#define DNS__32BIT(p) (((p)[0] << 24) | ((p)[1] << 16) | \ #define DNS__32BIT(p) (((p)[0] << 24) | ((p)[1] << 16) | \
((p)[2] << 8) | (p)[3]) ((p)[2] << 8) | (p)[3])
@@ -39,7 +27,6 @@
((p)[1] = ((v) >> 16) & 0xff), \ ((p)[1] = ((v) >> 16) & 0xff), \
((p)[2] = ((v) >> 8) & 0xff), \ ((p)[2] = ((v) >> 8) & 0xff), \
((p)[3] = (v) & 0xff)) ((p)[3] = (v) & 0xff))
#endif
#if 0 #if 0
/* we cannot use this approach on systems where we can't access 16/32 bit /* we cannot use this approach on systems where we can't access 16/32 bit

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright 1998 by the Massachusetts Institute of Technology. /* Copyright 1998 by the Massachusetts Institute of Technology.
* *
* Permission to use, copy, modify, and distribute this * Permission to use, copy, modify, and distribute this

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright 1998 by the Massachusetts Institute of Technology. /* Copyright 1998 by the Massachusetts Institute of Technology.
* *
* Permission to use, copy, modify, and distribute this * Permission to use, copy, modify, and distribute this
@@ -53,13 +55,13 @@ int ares_expand_string(const unsigned char *encoded,
*s = malloc(len+1); *s = malloc(len+1);
if (*s == NULL) if (*s == NULL)
return ARES_ENOMEM; return ARES_ENOMEM;
q = *s; q = *s;
strncpy((char *)q, (char *)encoded, len); strncpy((char *)q, (char *)encoded, len);
q[len] = '\0'; q[len] = '\0';
*s = q; *s = q;
*enclen = len+1; *enclen = len+1;
return ARES_SUCCESS; return ARES_SUCCESS;
} }

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright 1998 by the Massachusetts Institute of Technology. /* Copyright 1998 by the Massachusetts Institute of Technology.
* *
* Permission to use, copy, modify, and distribute this * Permission to use, copy, modify, and distribute this

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright 2000 by the Massachusetts Institute of Technology. /* Copyright 2000 by the Massachusetts Institute of Technology.
* *
* Permission to use, copy, modify, and distribute this * Permission to use, copy, modify, and distribute this
@@ -16,6 +18,7 @@
#include "setup.h" #include "setup.h"
#include <stdlib.h> #include <stdlib.h>
#include "ares.h" #include "ares.h"
#include "ares_private.h"
void ares_free_string(void *str) void ares_free_string(void *str)
{ {

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright 1998 by the Massachusetts Institute of Technology. /* Copyright 1998 by the Massachusetts Institute of Technology.
* *
* Permission to use, copy, modify, and distribute this * 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) 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; hquery->family = AF_INET;
ares_search(hquery->channel, hquery->name, C_IN, T_A, host_callback, ares_search(hquery->channel, hquery->name, C_IN, T_A, host_callback,
hquery); hquery);

View File

@@ -28,7 +28,6 @@ int ares_getsock(ares_channel channel,
int numsocks) /* size of the 'socks' array */ int numsocks) /* size of the 'socks' array */
{ {
struct server_state *server; struct server_state *server;
ares_socket_t nfds;
int i; int i;
int sockindex=0; int sockindex=0;
int bitmap = 0; int bitmap = 0;
@@ -40,7 +39,6 @@ int ares_getsock(ares_channel channel,
if (!channel->queries) if (!channel->queries)
return 0; return 0;
nfds = 0;
for (i = 0; i < channel->nservers; i++) for (i = 0; i < channel->nservers; i++)
{ {
server = &channel->servers[i]; server = &channel->servers[i];
@@ -67,5 +65,5 @@ int ares_getsock(ares_channel channel,
} }
} }
return (int)nfds; return bitmap;
} }

View File

@@ -98,6 +98,24 @@ The lookups to perform for host queries.
.I lookups .I lookups
should be set to a string of the characters "b" or "f", where "b" 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. 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 .PP
The The
.I flags .I flags

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright 1998 by the Massachusetts Institute of Technology. /* Copyright 1998 by the Massachusetts Institute of Technology.
* *
* Permission to use, copy, modify, and distribute this * 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 server_state *server;
struct timeval tv; 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)); channel = malloc(sizeof(struct ares_channeldata));
if (!channel) if (!channel)
return ARES_ENOMEM; return ARES_ENOMEM;
@@ -113,6 +125,7 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
channel->queries = NULL; channel->queries = NULL;
channel->domains = NULL; channel->domains = NULL;
channel->sortlist = NULL; channel->sortlist = NULL;
channel->sock_state_cb = NULL;
/* Initialize configuration by each of the four sources, from highest /* Initialize configuration by each of the four sources, from highest
* precedence to lowest. * 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; channel->udp_port = options->udp_port;
if ((optmask & ARES_OPT_TCP_PORT) && channel->tcp_port == -1) if ((optmask & ARES_OPT_TCP_PORT) && channel->tcp_port == -1)
channel->tcp_port = options->tcp_port; 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. */ /* Copy the servers, if given. */
if ((optmask & ARES_OPT_SERVERS) && channel->nservers == -1) if ((optmask & ARES_OPT_SERVERS) && channel->nservers == -1)

View File

@@ -40,14 +40,14 @@ struct sockaddr_in6
#endif #endif
#ifndef HAVE_STRUCT_ADDRINFO #ifndef HAVE_STRUCT_ADDRINFO
struct addrinfo struct addrinfo
{ {
int ai_flags; int ai_flags;
int ai_family; int ai_family;
int ai_socktype; int ai_socktype;
int ai_protocol; int ai_protocol;
size_t ai_addrlen; socklen_t ai_addrlen; /* Follow rfc3493 struct addrinfo */
char *ai_cannonname; char *ai_canonname;
struct sockaddr *ai_addr; struct sockaddr *ai_addr;
struct addrinfo *ai_next; struct addrinfo *ai_next;
}; };

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright 1998 by the Massachusetts Institute of Technology. /* Copyright 1998 by the Massachusetts Institute of Technology.
* *
* Permission to use, copy, modify, and distribute this * Permission to use, copy, modify, and distribute this
@@ -30,6 +32,7 @@
#include <string.h> #include <string.h>
#include "ares.h" #include "ares.h"
#include "ares_dns.h" #include "ares_dns.h"
#include "ares_private.h"
/* Header format, from RFC 1035: /* Header format, from RFC 1035:
* 1 1 1 1 1 1 * 1 1 1 1 1 1

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright 1998 by the Massachusetts Institute of Technology. /* Copyright 1998 by the Massachusetts Institute of Technology.
* *
* Permission to use, copy, modify, and distribute this * Permission to use, copy, modify, and distribute this

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright 2005 Dominick Meglio /* Copyright 2005 Dominick Meglio
* *
* Permission to use, copy, modify, and distribute this * Permission to use, copy, modify, and distribute this

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright 1998 by the Massachusetts Institute of Technology. /* Copyright 1998 by the Massachusetts Institute of Technology.
* *
* Permission to use, copy, modify, and distribute this * Permission to use, copy, modify, and distribute this

View File

@@ -1,3 +1,6 @@
#ifndef __ARES_PRIVATE_H
#define __ARES_PRIVATE_H
/* $Id$ */ /* $Id$ */
/* Copyright 1998 by the Massachusetts Institute of Technology. /* Copyright 1998 by the Massachusetts Institute of Technology.
@@ -176,13 +179,22 @@ struct ares_channeldata {
/* Active queries */ /* Active queries */
struct query *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__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__get_hostent(FILE *fp, int family, struct hostent **host);
int ares__read_line(FILE *fp, char **buf, int *bufsize); 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 #ifdef CURLDEBUG
/* This is low-level hard-hacking memory leak tracking and similar. Using the /* 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 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. */ this anyway for convenience. */
#include "../lib/memdebug.h" #include "../lib/memdebug.h"
#endif #endif
#endif /* __ARES_PRIVATE_H */

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright 1998 by the Massachusetts Institute of Technology. /* Copyright 1998 by the Massachusetts Institute of Technology.
* *
* Permission to use, copy, modify, and distribute this * Permission to use, copy, modify, and distribute this
@@ -63,6 +65,7 @@
#define GET_ERRNO() errno #define GET_ERRNO() errno
#endif #endif
static int try_again(int errnum);
static void write_tcp_data(ares_channel channel, fd_set *write_fds, static void write_tcp_data(ares_channel channel, fd_set *write_fds,
time_t now); time_t now);
static void read_tcp_data(ares_channel channel, fd_set *read_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); 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 /* If any TCP sockets select true for writing, write out queued data
* we have for them. * we have for them.
*/ */
@@ -132,11 +160,12 @@ static void write_tcp_data(ares_channel channel, fd_set *write_fds, time_t now)
vec[n].iov_len = sendreq->len; vec[n].iov_len = sendreq->len;
n++; n++;
} }
wcount = writev(server->tcp_socket, vec, n); wcount = (ssize_t)writev(server->tcp_socket, vec, n);
free(vec); free(vec);
if (wcount < 0) if (wcount < 0)
{ {
handle_error(channel, i, now); if (!try_again(GET_ERRNO()))
handle_error(channel, i, now);
continue; continue;
} }
@@ -149,7 +178,10 @@ static void write_tcp_data(ares_channel channel, fd_set *write_fds, time_t now)
wcount -= sendreq->len; wcount -= sendreq->len;
server->qhead = sendreq->next; server->qhead = sendreq->next;
if (server->qhead == NULL) if (server->qhead == NULL)
server->qtail = NULL; {
SOCK_STATE_CALLBACK(channel, server->tcp_socket, 1, 0);
server->qtail = NULL;
}
free(sendreq); free(sendreq);
} }
else else
@@ -165,12 +197,11 @@ static void write_tcp_data(ares_channel channel, fd_set *write_fds, time_t now)
/* Can't allocate iovecs; just send the first request. */ /* Can't allocate iovecs; just send the first request. */
sendreq = server->qhead; sendreq = server->qhead;
scount = send(server->tcp_socket, (void *)sendreq->data, scount = swrite(server->tcp_socket, sendreq->data, sendreq->len);
sendreq->len, 0);
if (scount < 0) if (scount < 0)
{ {
handle_error(channel, i, now); if (!try_again(GET_ERRNO()))
handle_error(channel, i, now);
continue; continue;
} }
@@ -179,7 +210,10 @@ static void write_tcp_data(ares_channel channel, fd_set *write_fds, time_t now)
{ {
server->qhead = sendreq->next; server->qhead = sendreq->next;
if (server->qhead == NULL) if (server->qhead == NULL)
server->qtail = NULL; {
SOCK_STATE_CALLBACK(channel, server->tcp_socket, 1, 0);
server->qtail = NULL;
}
free(sendreq); free(sendreq);
} }
else 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) static void read_tcp_data(ares_channel channel, fd_set *read_fds, time_t now)
{ {
struct server_state *server; struct server_state *server;
int i, count; int i;
ssize_t count;
for (i = 0; i < channel->nservers; i++) 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 /* We haven't yet read a length word, so read that (or
* what's left to read of it). * what's left to read of it).
*/ */
count = recv(server->tcp_socket, count = sread(server->tcp_socket,
(void *)(server->tcp_lenbuf + server->tcp_lenbuf_pos), server->tcp_lenbuf + server->tcp_lenbuf_pos,
2 - server->tcp_lenbuf_pos, 0); 2 - server->tcp_lenbuf_pos);
if (count <= 0) if (count <= 0)
{ {
handle_error(channel, i, now); if (!(count == -1 && try_again(GET_ERRNO())))
handle_error(channel, i, now);
continue; continue;
} }
server->tcp_lenbuf_pos += count; server->tcp_lenbuf_pos += (int)count;
if (server->tcp_lenbuf_pos == 2) if (server->tcp_lenbuf_pos == 2)
{ {
/* We finished reading the length word. Decode the /* 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 else
{ {
/* Read data into the allocated buffer. */ /* Read data into the allocated buffer. */
count = recv(server->tcp_socket, count = sread(server->tcp_socket,
(void *)(server->tcp_buffer + server->tcp_buffer_pos), server->tcp_buffer + server->tcp_buffer_pos,
server->tcp_length - server->tcp_buffer_pos, 0); server->tcp_length - server->tcp_buffer_pos);
if (count <= 0) if (count <= 0)
{ {
handle_error(channel, i, now); if (!(count == -1 && try_again(GET_ERRNO())))
handle_error(channel, i, now);
continue; continue;
} }
server->tcp_buffer_pos += count; server->tcp_buffer_pos += (int)count;
if (server->tcp_buffer_pos == server->tcp_length) if (server->tcp_buffer_pos == server->tcp_length)
{ {
/* We finished reading this answer; process it and /* 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) time_t now)
{ {
struct server_state *server; struct server_state *server;
int i, count; int i;
ssize_t count;
unsigned char buf[PACKETSZ + 1]; unsigned char buf[PACKETSZ + 1];
for (i = 0; i < channel->nservers; i++) 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)) !FD_ISSET(server->udp_socket, read_fds))
continue; continue;
count = recv(server->udp_socket, (void *)buf, sizeof(buf), 0); count = sread(server->udp_socket, buf, sizeof(buf));
if (count <= 0) if (count == -1 && try_again(GET_ERRNO()))
continue;
else if (count <= 0)
handle_error(channel, i, now); 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; struct query *query, *next;
/* Reset communications with this server. */ /* 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 /* Tell all queries talking to this server to move on and not try
* this server again. * this server again.
@@ -452,7 +492,10 @@ void ares__send_query(ares_channel channel, struct query *query, time_t now)
if (server->qtail) if (server->qtail)
server->qtail->next = sendreq; server->qtail->next = sendreq;
else else
server->qhead = sendreq; {
SOCK_STATE_CALLBACK(channel, server->tcp_socket, 1, 1);
server->qhead = sendreq;
}
server->qtail = sendreq; server->qtail = sendreq;
query->timeout = 0; query->timeout = 0;
} }
@@ -467,9 +510,9 @@ void ares__send_query(ares_channel channel, struct query *query, time_t now)
return; return;
} }
} }
if (send(server->udp_socket, (void *)query->qbuf, if (swrite(server->udp_socket, query->qbuf, query->qlen) == -1)
query->qlen, 0) == -1)
{ {
/* FIXME: Handle EAGAIN here since it likely can happen. */
query->skip_server[query->server] = 1; query->skip_server[query->server] = 1;
next_server(channel, query, now); next_server(channel, query, now);
return; 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_buffer_pos = 0;
server->tcp_socket = s; server->tcp_socket = s;
return 0; return 0;
@@ -604,6 +648,8 @@ static int open_udp_socket(ares_channel channel, struct server_state *server)
return -1; return -1;
} }
SOCK_STATE_CALLBACK(channel, s, 1, 0);
server->udp_socket = s; server->udp_socket = s;
return 0; 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)) if (!channel->queries && !(channel->flags & ARES_FLAG_STAYOPEN))
{ {
for (i = 0; i < channel->nservers; i++) for (i = 0; i < channel->nservers; i++)
ares__close_sockets(&channel->servers[i]); ares__close_sockets(channel, &channel->servers[i]);
} }
return (next); return (next);
} }

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright 1998 by the Massachusetts Institute of Technology. /* Copyright 1998 by the Massachusetts Institute of Technology.
* *
* Permission to use, copy, modify, and distribute this * Permission to use, copy, modify, and distribute this

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright 1998 by the Massachusetts Institute of Technology. /* Copyright 1998 by the Massachusetts Institute of Technology.
* *
* Permission to use, copy, modify, and distribute this * Permission to use, copy, modify, and distribute this

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright 1998 by the Massachusetts Institute of Technology. /* Copyright 1998 by the Massachusetts Institute of Technology.
* *
* Permission to use, copy, modify, and distribute this * Permission to use, copy, modify, and distribute this

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright 1998 by the Massachusetts Institute of Technology. /* Copyright 1998 by the Massachusetts Institute of Technology.
* *
* Permission to use, copy, modify, and distribute this * Permission to use, copy, modify, and distribute this

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright 1998 by the Massachusetts Institute of Technology. /* Copyright 1998 by the Massachusetts Institute of Technology.
* *
* Permission to use, copy, modify, and distribute this * Permission to use, copy, modify, and distribute this

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* /*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996,1999 by Internet Software Consortium. * Copyright (c) 1996,1999 by Internet Software Consortium.

View File

@@ -1,3 +1,6 @@
#ifndef __ARES_BITNCMP_H
#define __ARES_BITNCMP_H
/* $Id$ */ /* $Id$ */
/* /*
@@ -14,13 +17,10 @@
* without express or implied warranty. * without express or implied warranty.
*/ */
#ifndef BITNCMP_H
#define BITNCMP_H
#ifndef HAVE_BITNCMP #ifndef HAVE_BITNCMP
int ares_bitncmp(const void *l, const void *r, int n); int ares_bitncmp(const void *l, const void *r, int n);
#else #else
#define ares_bitncmp(x,y,z) bitncmp(x,y,z) #define ares_bitncmp(x,y,z) bitncmp(x,y,z)
#endif #endif
#endif /* BITNCMP_H */ #endif /* __ARES_BITNCMP_H */

View File

@@ -54,6 +54,63 @@
/* Define if you have the ioctlsocket function. */ /* Define if you have the ioctlsocket function. */
#define HAVE_IOCTLSOCKET 1 #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 */ /* STRUCT RELATED */
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */

View File

@@ -16,10 +16,6 @@ solaris*)
;; ;;
esac esac
AC_SEARCH_LIBS(gethostbyname, nsl)
AC_SEARCH_LIBS(socket, socket)
dnl check for cygwin stuff
AC_LIBTOOL_WIN32_DLL AC_LIBTOOL_WIN32_DLL
dnl ************************************************************ dnl ************************************************************
@@ -47,6 +43,15 @@ AC_HELP_STRING([--disable-debug],[Disable debug options]),
CPPFLAGS="$CPPFLAGS -DCURLDEBUG -I$srcdir/../include" CPPFLAGS="$CPPFLAGS -DCURLDEBUG -I$srcdir/../include"
CFLAGS="$CFLAGS -g" 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 set compiler "debug" options to become more picky, and remove
dnl optimize options from CFLAGS dnl optimize options from CFLAGS
CURL_CC_DEBUG_OPTS CURL_CC_DEBUG_OPTS
@@ -57,8 +62,146 @@ AC_HELP_STRING([--disable-debug],[Disable debug options]),
) )
dnl libtool setup dnl libtool setup
CARES_CLEAR_LIBTOOL_TAGS
AC_PROG_LIBTOOL 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. dnl Checks for header files.
AC_HEADER_STDC AC_HEADER_STDC
@@ -74,6 +217,8 @@ CURL_CHECK_HEADER_WINSOCK
CURL_CHECK_HEADER_WINSOCK2 CURL_CHECK_HEADER_WINSOCK2
CURL_CHECK_HEADER_WS2TCPIP CURL_CHECK_HEADER_WS2TCPIP
CURL_CHECK_HEADER_MALLOC
dnl check for a few basic system headers we need dnl check for a few basic system headers we need
AC_CHECK_HEADERS( AC_CHECK_HEADERS(
sys/types.h \ sys/types.h \
@@ -121,10 +266,6 @@ AC_C_CONST
AC_TYPE_SIZE_T AC_TYPE_SIZE_T
AC_HEADER_TIME 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(size_t)
AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(time_t) AC_CHECK_SIZEOF(time_t)
@@ -155,6 +296,11 @@ TYPE_IN_ADDR_T
TYPE_SOCKADDR_STORAGE TYPE_SOCKADDR_STORAGE
CURL_CHECK_FUNC_RECV
CURL_CHECK_FUNC_SEND
CURL_CHECK_MSG_NOSIGNAL
dnl check for AF_INET6 dnl check for AF_INET6
CARES_CHECK_CONSTANT( CARES_CHECK_CONSTANT(
@@ -428,7 +574,8 @@ int main()
} }
], [ ], [
AC_MSG_RESULT(yes) 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)) ], AC_MSG_RESULT(no),AC_MSG_RESULT(no))
fi fi
@@ -494,13 +641,15 @@ dnl and get the types of five of its arguments.
CURL_CHECK_FUNC_GETNAMEINFO 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 CARES_CHECK_GETSERVBYPORT_R
CURL_CHECK_NONBLOCKING_SOCKET CURL_CHECK_NONBLOCKING_SOCKET
AC_C_BIGENDIAN( 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!])] [AC_MSG_WARN([couldn't figure out endianess, assuming little endian!])]
) )

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* /*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996,1999 by Internet Software Consortium. * Copyright (c) 1996,1999 by Internet Software Consortium.

View File

@@ -1,3 +1,6 @@
#ifndef __ARES_INET_NET_PTON_H
#define __ARES_INET_NET_PTON_H
/* $Id$ */ /* $Id$ */
/* /*
@@ -14,9 +17,6 @@
* without express or implied warranty. * 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) #if defined(HAVE_INET_PTON) && defined(HAVE_INET_PTON_IPV6)
#define ares_inet_pton(x,y,z) inet_pton(x,y,z) #define ares_inet_pton(x,y,z) inet_pton(x,y,z)
#else #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); int ares_inet_net_pton(int af, const char *src, void *dst, size_t size);
#endif #endif
#endif /* INET_NET_PTON_H */ #endif /* __ARES_INET_NET_PTON_H */

View File

@@ -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 * Keep this in mind if you think this function should have been coded
* to use pointer overlays. All the world's not a VAX. * 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; char tmp[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
struct { int base, len; } best = { 0,0 }, cur = { 0,0 }; char *tp;
unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ]; struct {
long base;
long len;
} best, cur;
unsigned long words[NS_IN6ADDRSZ / NS_INT16SZ];
int i; 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. * Copy the input (bytewise) array into a wordwise array.
* Find the longest run of 0x00's in src[] for :: shorthanding. * 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++) for (i = 0; i < NS_IN6ADDRSZ; i++)
words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3)); words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
best.base = -1; best.base = -1;
cur.base = -1; cur.base = -1;
best.len = 0;
cur.len = 0;
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++)
{ {
if (words[i] == 0) 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 && if (i == 6 && best.base == 0 &&
(best.len == 6 || (best.len == 5 && words[5] == 0xffff))) (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); return (NULL);
tp += strlen(tp); tp += strlen(tp);
break; break;
} }
tp += SPRINTF((tp, "%x", words[i])); tp += SPRINTF((tp, "%lx", words[i]));
} }
/* Was it a trailing run of 0x00's? */ /* Was it a trailing run of 0x00's? */

View File

@@ -1,3 +1,6 @@
#ifndef __ARES_INET_NTOP_H
#define __ARES_INET_NTOP_H
/* $Id$ */ /* $Id$ */
/* /*
@@ -14,13 +17,10 @@
* without express or implied warranty. * without express or implied warranty.
*/ */
#ifndef INET_NTOP_H #if defined(HAVE_INET_NTOP) && defined(HAVE_INET_NTOP_IPV6)
#define INET_NTOP_H
#ifdef HAVE_INET_NTOP
#define ares_inet_ntop(w,x,y,z) inet_ntop(w,x,y,z) #define ares_inet_ntop(w,x,y,z) inet_ntop(w,x,y,z)
#else #else
const char *ares_inet_ntop(int af, const void *src, char *dst, size_t size); const char *ares_inet_ntop(int af, const void *src, char *dst, size_t size);
#endif #endif
#endif /* INET_NET_NTOP_H */ #endif /* __ARES_INET_NTOP_H */

View File

@@ -7,7 +7,9 @@
port build */ port build */
#ifndef NETWARE #ifndef NETWARE
#ifndef __CYGWIN__
#include <windows.h> #include <windows.h>
#endif
#include <process.h> /* for the _getpid() proto */ #include <process.h> /* for the _getpid() proto */
#endif /* !NETWARE */ #endif /* !NETWARE */
#include <sys/types.h> #include <sys/types.h>

View File

@@ -1,6 +1,8 @@
#ifndef __ARES_SETUP_H #ifndef __ARES_SETUP_H
#define __ARES_SETUP_H #define __ARES_SETUP_H
/* $Id$ */
/* Copyright (C) 2004 - 2005 by Daniel Stenberg et al /* Copyright (C) 2004 - 2005 by Daniel Stenberg et al
* *
* Permission to use, copy, modify, and distribute this software and its * Permission to use, copy, modify, and distribute this software and its
@@ -43,7 +45,11 @@
* Include header files for windows builds before redefining anything. * Include header files for windows builds before redefining anything.
* Use this preproessor block only to include or exclude windows.h, * Use this preproessor block only to include or exclude windows.h,
* winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs * 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 #ifdef HAVE_WINDOWS_H
@@ -145,4 +151,12 @@ int ares_strcasecmp(const char *s1, const char *s2);
#endif #endif
#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 */ #endif /* __ARES_SETUP_H */

109
ares/setup_once.h Normal file
View 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 */

View File

@@ -1,5 +1,7 @@
#include "setup.h" #include "setup.h"
/* $Id$ */
/* only do the following on windows /* only do the following on windows
*/ */
#if (defined(WIN32) || defined(WATT32)) && !defined(MSDOS) #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); memcpy (bp, vector[i].iov_base, vector[i].iov_len);
bp += 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 */ #endif /* WIN32 builds only */

View File

@@ -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 # This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms # you should have received as part of this distribution. The terms
@@ -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 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 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 **********************************************************************
dnl Checks for libraries. dnl Checks for libraries.
dnl ********************************************************************** dnl **********************************************************************
@@ -366,6 +373,21 @@ then
) )
fi 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" if test "$HAVE_GETHOSTBYNAME" != "1"
then then
dnl gethostbyname in the net lib - for BeOS dnl gethostbyname in the net lib - for BeOS
@@ -465,20 +487,31 @@ dnl **********************************************************************
dnl Check for the presence of the winmm library. dnl Check for the presence of the winmm library.
dnl ********************************************************************** dnl **********************************************************************
AC_MSG_CHECKING([for timeGetTime in winmm]) case $host in
my_ac_save_LIBS=$LIBS *-*-cygwin*)
LIBS="-lwinmm $LIBS" dnl Under Cygwin, winmm exists but is not needed as WIN32 is not #defined
AC_TRY_LINK([#include <windef.h> dnl and gettimeofday() will be used regardless of the outcome of this test.
#include <mmsystem.h> dnl Skip this test, otherwise -lwinmm will be needlessly added to LIBS
], dnl (and recorded as such in the .la file, potentially affecting downstream
[timeGetTime();], dnl clients of the library.)
[ dnl worked! ;;
AC_MSG_RESULT([yes]) *)
], AC_MSG_CHECKING([for timeGetTime in winmm])
[ dnl failed, restore LIBS my_ac_save_LIBS=$LIBS
LIBS=$my_ac_save_LIBS LIBS="-lwinmm $LIBS"
AC_MSG_RESULT(no)] AC_TRY_LINK([#include <windef.h>
) #include <mmsystem.h>
],
[timeGetTime();],
[ dnl worked!
AC_MSG_RESULT([yes])
],
[ dnl failed, restore LIBS
LIBS=$my_ac_save_LIBS
AC_MSG_RESULT(no)]
)
;;
esac
dnl ********************************************************************** dnl **********************************************************************
dnl Checks for IPv6 dnl Checks for IPv6
@@ -519,10 +552,6 @@ main()
if test "$ipv6" = "yes"; then if test "$ipv6" = "yes"; then
curl_ipv6_msg="enabled" curl_ipv6_msg="enabled"
CURL_CHECK_WORKING_GETADDRINFO
CURL_CHECK_NI_WITHSCOPEID
fi fi
dnl ********************************************************************** dnl **********************************************************************
@@ -881,18 +910,26 @@ if test X"$OPT_SSL" != Xno; then
fi fi
dnl This is for Msys/Mingw dnl This is for Msys/Mingw
AC_MSG_CHECKING([for gdi32]) case $host in
my_ac_save_LIBS=$LIBS *-*-cygwin*)
LIBS="-lgdi32 $LIBS" dnl Under Cygwin this is extraneous and causes an unnecessary -lgdi32
AC_TRY_LINK([#include <windef.h> dnl to be added to LIBS and recorded in the .la file.
#include <wingdi.h>], ;;
[GdiFlush();], *)
[ dnl worked! AC_MSG_CHECKING([for gdi32])
AC_MSG_RESULT([yes])], my_ac_save_LIBS=$LIBS
[ dnl failed, restore LIBS LIBS="-lgdi32 $LIBS"
LIBS=$my_ac_save_LIBS AC_TRY_LINK([#include <windef.h>
AC_MSG_RESULT(no)] #include <wingdi.h>],
) [GdiFlush();],
[ dnl worked!
AC_MSG_RESULT([yes])],
[ dnl failed, restore LIBS
LIBS=$my_ac_save_LIBS
AC_MSG_RESULT(no)]
)
;;
esac
AC_CHECK_LIB(crypto, CRYPTO_lock,[ AC_CHECK_LIB(crypto, CRYPTO_lock,[
HAVECRYPTO="yes" HAVECRYPTO="yes"
@@ -940,9 +977,18 @@ if test X"$OPT_SSL" != Xno; then
AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use])) AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]))
if test $ac_cv_header_openssl_x509_h = no; then 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)" curl_ssl_msg="enabled (OpenSSL)"
OPENSSL_ENABLED=1) OPENSSL_ENABLED=1
fi
fi fi
fi fi
@@ -1396,7 +1442,8 @@ if test x$cross_compiling != xyes; then
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
, ,
dnl not invoked when crosscompiling) dnl not invoked when crosscompiling)
]) echo "hej"
)
fi fi
else else
dnl and for crosscompilings dnl and for crosscompilings
@@ -1411,6 +1458,7 @@ dnl **********************************************************************
dnl Checks for header files. dnl Checks for header files.
AC_HEADER_STDC AC_HEADER_STDC
CURL_CHECK_HEADER_MALLOC
dnl Now check for the very most basic headers. Then we can use these dnl Now check for the very most basic headers. Then we can use these
dnl ones as default-headers when checking for the rest! dnl ones as default-headers when checking for the rest!
@@ -1422,7 +1470,6 @@ AC_CHECK_HEADERS(
sys/ioctl.h \ sys/ioctl.h \
assert.h \ assert.h \
unistd.h \ unistd.h \
malloc.h \
stdlib.h \ stdlib.h \
limits.h \ limits.h \
arpa/inet.h \ arpa/inet.h \
@@ -1517,6 +1564,12 @@ TYPE_SOCKADDR_STORAGE
AC_FUNC_SELECT_ARGTYPES AC_FUNC_SELECT_ARGTYPES
CURL_CHECK_FUNC_RECV
CURL_CHECK_FUNC_SEND
CURL_CHECK_MSG_NOSIGNAL
dnl Checks for library functions. dnl Checks for library functions.
dnl AC_PROG_GCC_TRADITIONAL dnl AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIGNAL AC_TYPE_SIGNAL
@@ -1560,8 +1613,10 @@ AC_CHECK_FUNCS( strtoll \
ftruncate \ ftruncate \
pipe \ pipe \
poll \ poll \
getprotobyname \
getrlimit \ getrlimit \
setrlimit, setrlimit \
fork,
dnl if found dnl if found
[], [],
dnl if not found, $ac_func is the name we check for dnl if not found, $ac_func is the name we check for
@@ -1651,6 +1706,11 @@ dnl Check if the getnameinfo function is available
dnl and get the types of five of its arguments. dnl and get the types of five of its arguments.
CURL_CHECK_FUNC_GETNAMEINFO 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)]) AC_MSG_CHECKING([if we are Mac OS X (to disable poll)])
disable_poll=no disable_poll=no
case $host in case $host in
@@ -1916,6 +1976,52 @@ AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
AC_MSG_RESULT(yes) 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 if test "x$ws2" = "xyes"; then
dnl If ws2_32 is wanted, make sure it is the _last_ lib in LIBS (makes dnl If ws2_32 is wanted, make sure it is the _last_ lib in LIBS (makes
@@ -1953,6 +2059,9 @@ AC_CONFIG_FILES([Makefile \
packages/EPM/curl.list \ packages/EPM/curl.list \
packages/EPM/Makefile \ packages/EPM/Makefile \
packages/vms/Makefile \ packages/vms/Makefile \
packages/AIX/Makefile \
packages/AIX/RPM/Makefile \
packages/AIX/RPM/curl.spec \
curl-config \ curl-config \
libcurl.pc libcurl.pc
]) ])

View File

@@ -1,10 +1,30 @@
#! /bin/sh #! /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 # The idea to this kind of setup info script was stolen from numerous
# other packages, such as neon, libxml and gnome. # other packages, such as neon, libxml and gnome.
# #
# $Id$
#
prefix=@prefix@ prefix=@prefix@
exec_prefix=@exec_prefix@ exec_prefix=@exec_prefix@
includedir=@includedir@ includedir=@includedir@
@@ -19,6 +39,7 @@ Available values for OPTION include:
--ca ca bundle install path --ca ca bundle install path
--cc compiler --cc compiler
--cflags pre-processor and compiler flags --cflags pre-processor and compiler flags
--checkfor [version] check for (lib)curl of the specified version
--features newline separated list of enabled features --features newline separated list of enabled features
--protocols newline separated list of enabled protocols --protocols newline separated list of enabled protocols
--help display this help and exit --help display this help and exit
@@ -122,6 +143,26 @@ while test $# -gt 0; do
exit 0 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) --vernum)
echo @VERSIONNUM@ echo @VERSIONNUM@
exit 0 exit 0

View File

@@ -46,8 +46,8 @@ Cocoa
D D
Written by Charles Sanders and James Wavro Written by Kenneth Bogert
http://www.atari-soldiers.com/libcurl.html http://curl.haxx.se/libcurl/d/
Dylan Dylan
@@ -155,6 +155,11 @@ S-Lang
S-Lang binding written by John E Davis S-Lang binding written by John E Davis
http://www.jedsoft.org/slang/modules/curl.html http://www.jedsoft.org/slang/modules/curl.html
SPL
SPL binding written by Clifford Wolf
http://www.clifford.at/spl/
Tcl Tcl
Tclcurl is written by Andr<64>s Garc<72>a Tclcurl is written by Andr<64>s Garc<72>a
@@ -173,3 +178,8 @@ wxWidgets
Written by Casey O'Donnell Written by Casey O'Donnell
http://homepage.mac.com/codonnell/wxcurldav/ http://homepage.mac.com/codonnell/wxcurldav/
XBLite
Written by David Szafranski
http://perso.wanadoo.fr/xblite/libraries.html

View File

@@ -1,12 +1,12 @@
Date: October 27, 2005 Date: May 15, 2006
Author: Daniel Stenberg <daniel@haxx.se> Author: Daniel Stenberg <daniel@haxx.se>
URL: http://curl.haxx.se/legal/distro-dilemma.html URL: http://curl.haxx.se/legal/distro-dilemma.html
Condition Condition
This document is written to describe the situation as it is right 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 now. libcurl 7.15.3 is currently the latest version available. Things may of
perhaps will) of course change in the future. course change in the future.
This document reflects my view and understanding of these things. Please tell 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. 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 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 "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, 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 it MUST NOT be linked with any Original BSD-licensed parts or libraries.
libraries. Doing so will violate the GPL license. For a long time, very many Doing so will violate the GPL license. For a long time, very many GPL
GPL licensed programs have avoided this license mess by adding an licensed programs have avoided this license mess by adding an exception[8] to
exception[8] to their license. And many others have just closed their eyes their license. And many others have just closed their eyes for this problem.
for this problem.
libcurl is MIT-style[4] licensed - how on earth did this dilemma fall onto libcurl is MIT-style[4] licensed - how on earth did this dilemma fall onto
our plates? our plates?
@@ -49,25 +48,13 @@ Part of the Operating System
Debian does however not take this stance and has officially(?) claimed that Debian does however not take this stance and has officially(?) claimed that
OpenSSL is not a required part of the Debian operating system 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 GnuTLS
With the release of libcurl 7.14.0 (May 2005), it can now get built to use With the release of libcurl 7.14.0 (May 2005), libcurl can now get built to
GnuTLS instead of OpenSSL. GnuTLS is a LGPL[7] licensed library that offers a use GnuTLS instead of OpenSSL. GnuTLS is an LGPL[7] licensed library that
matching set of features as OpenSSL does. Now, you can build and distribute offers a matching set of features as OpenSSL does. Now, you can build and
an SSL capable libcurl without including any Original BSD licensed code. 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. 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 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. 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 GnuTLS
- LGPL licensened - LGPL licensened
- supports SRP - supports SRP
- lacks SSLv2 support - lacks SSLv2 support
- lacks MD2 support (used by at least some CA certs) - lacks MD2 support (used by at least some CA certs)
- lacks the crypto functions libcurl uses for NTLM
OpenSSL OpenSSL
- Original BSD licensened - Original BSD licensened
- lacks SRP - lacks SRP
- supports SSLv2 - supports SSLv2
- older and more widely used - 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? The Better License, Original BSD or LGPL?
@@ -124,20 +108,21 @@ More SSL Libraries
Application Angle of this Problem Application Angle of this Problem
libcurl is built to use one SSL/TLS library. It uses a single fixed name (by 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 default) on the built/created lib file, and applications are built/linked to
one libcurl instance with another one that uses the other SSL/TLS library use that single lib. Replacing one libcurl instance with another one that
might break one or more applications (due to ABI differences and/or different uses the other SSL/TLS library might break one or more applications (due to
feature set). You want your application to use the libcurl it was built for. 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 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 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 affects users - GPL application authors only - of our lib as it comes
included and delivered on some distros. included and delivered on some distros.
libcurl has different ABI when built with different SSL/TLS libraries due to 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 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 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 2. The CURLOPT_SSL_CTX_FUNCTION option is not possible to "emulate" on GnuTLS
but simply requires OpenSSL. 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 Distro Angle of this Problem
A distro can provide separate libcurls built with different SSL/TLS libraries To my knowledge there is only one distro that ships libcurl built with either
to work around this, but at least Debian seems to be very hostile against one of the SSL libs supported.
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 Debian Linux is now (since mid September 2005) providing two different
man pages etc. 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 Fixing the Only Problem
The only problem is thus for distributions that want to offer libcurl The only problem is thus for distributions that want to offer libcurl
versions built with more than one SSL/TLS library. 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 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 to come up with a way to have one single libcurl that someone uses different
underlying libraries. The best(?) approach currently suggested involves this: underlying libraries. The best(?) approach currently suggested involves this:
@@ -194,9 +179,9 @@ Fixing the Only Problem
When Will This Happen When Will This Happen
Note again that this is not a problem in curl, it doesn't solve any actual This is not a problem in curl, it doesn't solve any actual technical problems
technical problems in our project. Don't hold your breath for this to happen in our project. Don't hold your breath for this to happen very soon (if at
very soon (if at all) unless you step forward and contribute. all) unless you step forward and contribute.
The suggestion that is outlined above is still only a suggestion. Feel free The suggestion that is outlined above is still only a suggestion. Feel free
to bring a better idea! 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 code like today (without the use of lib2), should you decide to ignore the
problems outlined in this document. 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 http://curl.haxx.se/mail/lib-2005-09/0066.html

View File

@@ -91,8 +91,8 @@ FTP
- no dir depth limit - no dir depth limit
FTPS (*1) FTPS (*1)
- explicit ftps:// support that use SSL on both connections - implicit ftps:// support that use SSL on both connections
- implicit "AUTH TSL" and "AUTH SSL" usage to "upgrade" plain ftp:// - explicit "AUTH TSL" and "AUTH SSL" usage to "upgrade" plain ftp://
connection to use SSL for both or one of the connections connection to use SSL for both or one of the connections
TFTP TFTP

View File

@@ -129,6 +129,18 @@ UNIX
If you're a curl developer and use gcc, you might want to enable more If you're a curl developer and use gcc, you might want to enable more
debug options with the --enable-debug option. 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 Win32
===== =====
@@ -506,13 +518,17 @@ CROSS COMPILE
./configure --host=ARCH-OS ./configure --host=ARCH-OS
REDUCING SIZE
=============
There are a number of configure options that can be used to reduce the 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 size of libcurl for embedded applications where binary size is an
important factor. First, be sure to set the CFLAGS environment variable important factor. First, be sure to set the CFLAGS variable when
when configuring with any compiler optimization flags to reduce the configuring with any relevant compiler optimization flags to reduce the
size of the binary. For gcc, this would mean at minimum: 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 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 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-crypto-auth (disables HTTP cryptographic authentication)
--disable-ipv6 (disables support for IPv6) --disable-ipv6 (disables support for IPv6)
--disable-verbose (eliminates debugging strings and error code strings) --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-libidn (disables support for the libidn DNS library)
--without-ssl (disables support for SSL/TLS) --without-ssl (disables support for SSL/TLS)
--without-zlib (disables support for on-the-fly decompression) --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 You may find that statically linking libcurl to your application will
result in a lower total size. result in a lower total size.

View File

@@ -3,9 +3,14 @@ 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 changelog of the current development status, as one or more of these problems
may have been fixed since this was written! may have been fixed since this was written!
33. Doing FTP upload and specifying a URL that ends with a slash will cause 34. The SOCKS connection codes don't properly acknowledge (connect) timeouts.
a filed named "(nil)" get created. The proper fix should most likely be to
reject the upload early since there's no target file name specified. 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 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 server configured in the system, the ares_init() call fails and thus
@@ -30,8 +35,6 @@ may have been fixed since this was written!
See http://curl.haxx.se/bug/view.cgi?id=1371118 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 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 "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 to what winhttp does. See http://curl.haxx.se/bug/view.cgi?id=1281867
@@ -42,12 +45,6 @@ may have been fixed since this was written!
--proxy-anyauth. There's work in progress on this problem, and a recent --proxy-anyauth. There's work in progress on this problem, and a recent
patch was posted here: http://curl.haxx.se/mail/lib-2005-08/0074.html patch was posted here: http://curl.haxx.se/mail/lib-2005-08/0074.html
24. Harshal Pradhan's Use-after-free with libcurl+ares. This probably occurs
because there is a pending ares callback that gets called after the
connection struct has been freed in libcurl:
http://curl.haxx.se/mail/lib-2005-08/0022.html
Fixing this properly most likely requires a new c-ares function.
23. We don't support SOCKS for IPv6. We don't support FTPS over a SOCKS proxy. 23. We don't support SOCKS for IPv6. We don't support FTPS over a SOCKS proxy.
We don't have any test cases for SOCKS proxy. We probably have even more We don't have any test cases for SOCKS proxy. We probably have even more
bugs and lack of features when a SOCKS proxy is used. And there seem to be a bugs and lack of features when a SOCKS proxy is used. And there seem to be a
@@ -69,6 +66,8 @@ may have been fixed since this was written!
specification). The receiver will convert the data from the standard specification). The receiver will convert the data from the standard
form to his own internal form. 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: 19. FTP 3rd party transfers with the multi interface doesn't work. Test:
define CURL_MULTIEASY, rebuild curl, run test case 230 - 232. define CURL_MULTIEASY, rebuild curl, run test case 230 - 232.
@@ -104,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/bug/view.cgi?id=1004841. How?
http://curl.haxx.se/mail/lib-2004-08/0182.html 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 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 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]'. manually for HTTP PUT resume to work, and then '-C [index]'.

View File

@@ -32,7 +32,8 @@ OpenSSL http://www.openssl.org/source/license.html
are not allowed to ship binaries that link with OpenSSL that includes are not allowed to ship binaries that link with OpenSSL that includes
GPL code (unless that specific GPL code includes an exception for GPL code (unless that specific GPL code includes an exception for
OpenSSL - a habit that is growing more and more common). If OpenSSL's 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/ GnuTLS http://www.gnutls.org/
@@ -41,6 +42,11 @@ GnuTLS http://www.gnutls.org/
GnuTLS itself depends on and uses other libs (libgcrypt and GnuTLS itself depends on and uses other libs (libgcrypt and
libgpg-error) and they too are LGPL- or GPL-licensed. 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 c-ares http://daniel.haxx.se/projects/c-ares/license.html
(Used for asynchronous name resolves) Uses an MIT license that is very (Used for asynchronous name resolves) Uses an MIT license that is very

View File

@@ -726,7 +726,7 @@ LDAP
Working with LDAP URLs": Working with LDAP URLs":
http://developer.netscape.com/docs/manuals/dirsdk/csdk30/url.htm 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 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: server that has a certain sub-domain in their email address:

View File

@@ -8,20 +8,24 @@ Adrian Schuur
Alan Pinstein Alan Pinstein
Albert Chin-A-Young Albert Chin-A-Young
Albert Choy Albert Choy
Ale Vesely
Aleksandar Milivojevic Aleksandar Milivojevic
Alex Neblett Alex Neblett
Alex Suykov Alex Suykov
Alex aka WindEagle Alex aka WindEagle
Alexander Kourakos Alexander Kourakos
Alexander Krasnostavsky Alexander Krasnostavsky
Alexander Lazic
Alexander Zhuravlev Alexander Zhuravlev
Alexis Carvalho Alexis Carvalho
Amol Pattekar Amol Pattekar
Andi Jahja Andi Jahja
Andreas Damm Andreas Damm
Andreas Ntaflos
Andreas Olsson Andreas Olsson
Andreas Rieke Andreas Rieke
Andres Garcia Andres Garcia
Andrew Benham
Andrew Bushnell Andrew Bushnell
Andrew Francis Andrew Francis
Andrew Fuller Andrew Fuller
@@ -32,6 +36,7 @@ Angus Mackay
Antoine Calando Antoine Calando
Anton Kalmykov Anton Kalmykov
Arkadiusz Miskiewicz Arkadiusz Miskiewicz
Ates Goral
Augustus Saunders Augustus Saunders
Avery Fay Avery Fay
Ben Greear Ben Greear
@@ -45,9 +50,10 @@ Brad Burdick
Bradford Bruce Bradford Bruce
Brent Beardsley Brent Beardsley
Brian Akins Brian Akins
Brian Dessent
Brian R Duffy Brian R Duffy
Bruce Mitchener Bruce Mitchener
Bryan Henderson Bryan Henderson
Bryan Kemp Bryan Kemp
Caolan McNamara Caolan McNamara
Casey O'Donnell Casey O'Donnell
@@ -94,6 +100,7 @@ David James
David Kimdon David Kimdon
David Lang David Lang
David LeBlanc David LeBlanc
David McCreedy
David Odin David Odin
David Phillips David Phillips
David Shaw David Shaw
@@ -115,6 +122,8 @@ Doug Kaufman
Doug Porter Doug Porter
Douglas E. Wegscheid Douglas E. Wegscheid
Douglas R. Horner Douglas R. Horner
Dov Murik
Duane Cathey
Dustin Boswell Dustin Boswell
Dylan Ellicott Dylan Ellicott
Dylan Salisbury Dylan Salisbury
@@ -184,6 +193,7 @@ Ian Wilkes
Ignacio Vazquez-Abrams Ignacio Vazquez-Abrams
Igor Polyakov Igor Polyakov
Ilguiz Latypov Ilguiz Latypov
Ilja van Sprundel
Ingo Ralf Blum Ingo Ralf Blum
Ingo Wilken Ingo Wilken
Jacky Lam Jacky Lam
@@ -200,6 +210,7 @@ Jamie Wilkinson
Jan Kunder Jan Kunder
Jason S. Priebe Jason S. Priebe
Jaz Fresh Jaz Fresh
Jean Jacques Drouin
Jean-Claude Chauve Jean-Claude Chauve
Jean-Louis Lemaire Jean-Louis Lemaire
Jean-Marc Ranger Jean-Marc Ranger
@@ -241,11 +252,14 @@ J
Kai Sommerfeld Kai Sommerfeld
Kai-Uwe Rommel Kai-Uwe Rommel
Kang-Jin Lee Kang-Jin Lee
Karl Moerder
Karol Pietrzak Karol Pietrzak
Katie Wang
Keith MacDonald Keith MacDonald
Keith McGuigan Keith McGuigan
Ken Hirsch Ken Hirsch
Ken Rastatter Ken Rastatter
Kent Boortz
Kevin Fisk Kevin Fisk
Kevin Lussier Kevin Lussier
Kevin Roth Kevin Roth
@@ -286,6 +300,8 @@ Marco G. Salvagno
Marcus Webster Marcus Webster
Mario Schroeder Mario Schroeder
Mark Butler Mark Butler
Mark Eichin
Markus Koetter
Markus Moeller Markus Moeller
Markus Oberhumer Markus Oberhumer
Martijn Koster Martijn Koster
@@ -304,10 +320,14 @@ Mekonikum
Mettgut Jamalla Mettgut Jamalla
Michael Benedict Michael Benedict
Michael Curtis Michael Curtis
Michael Jahn
Michael Mealling Michael Mealling
Michael Wallner Michael Wallner
Michal Bonino Michal Bonino
Michal Marek
Michele Bini
Mihai Ionescu Mihai Ionescu
Mikael Sennerholm
Mike Bytnar Mike Bytnar
Mike Dobbs Mike Dobbs
Miklos Nemeth Miklos Nemeth
@@ -332,6 +352,7 @@ Nis Jorgensen
Nodak Sodak Nodak Sodak
Norbert Novotny Norbert Novotny
Ofer Ofer
Olaf St<53>ben
Oren Tirosh Oren Tirosh
P R Schaffner P R Schaffner
Patrick Bihan-Faou Patrick Bihan-Faou
@@ -340,6 +361,7 @@ Paul Harrington
Paul Marquis Paul Marquis
Paul Moore Paul Moore
Paul Nolan Paul Nolan
Paul Querna
Pavel Cenek Pavel Cenek
Pavel Orehov Pavel Orehov
Pawel A. Gajda Pawel A. Gajda
@@ -347,7 +369,9 @@ Pedro Neves
Pete Su Pete Su
Peter Bray Peter Bray
Peter Forret Peter Forret
Peter Heuchert
Peter Pentchev Peter Pentchev
Peter Su
Peter Sylvester Peter Sylvester
Peter Todd Peter Todd
Peter Verhas Peter Verhas
@@ -357,6 +381,7 @@ Phil Karn
Philip Gladstone Philip Gladstone
Philippe Hameau Philippe Hameau
Philippe Raoult Philippe Raoult
Philippe Vaucher
Pierre Pierre
Puneet Pawaia Puneet Pawaia
Quagmire Quagmire
@@ -386,7 +411,9 @@ Robert D. Young
Robert Olson Robert Olson
Robert Weaver Robert Weaver
Robin Kay Robin Kay
Robson Braga Araujo
Rodney Simmons Rodney Simmons
Roland Blom
Roland Krikava Roland Krikava
Roland Zimmermann Roland Zimmermann
Roman Koifman Roman Koifman
@@ -409,6 +436,7 @@ Sergio Ballestrero
Seshubabu Pasam Seshubabu Pasam
Shard Shard
Shawn Poulson Shawn Poulson
Shmulik Regev
Siddhartha Prakash Jain Siddhartha Prakash Jain
Simon Dick Simon Dick
Simon Josefsson Simon Josefsson
@@ -433,6 +461,7 @@ S
T. Bharath T. Bharath
T. Yamada T. Yamada
Temprimus Temprimus
Thomas Klausner
Thomas Schwinge Thomas Schwinge
Thomas Tonino Thomas Tonino
Tim Baker Tim Baker
@@ -441,6 +470,7 @@ Tim Costello
Tim Sneddon Tim Sneddon
Toby Peterson Toby Peterson
Todd Kulesza Todd Kulesza
Todd Vierling
Tom Benoist Tom Benoist
Tom Lee Tom Lee
Tom Mattison Tom Mattison
@@ -458,6 +488,7 @@ Traian Nicolescu
Troels Walsted Hansen Troels Walsted Hansen
Troy Engel Troy Engel
Tupone Alfredo Tupone Alfredo
Ulf H<>rnhammar
Ulrich Zadow Ulrich Zadow
Vilmos Nebehaj Vilmos Nebehaj
Vincent Bronner Vincent Bronner
@@ -472,6 +503,7 @@ Wesley Laxton
Wez Furlong Wez Furlong
Wilfredo Sanchez Wilfredo Sanchez
Wojciech Zwiefka Wojciech Zwiefka
Xavier Bouchoux
Yang Tse Yang Tse
Yarram Sunil Yarram Sunil
Zvi Har'El Zvi Har'El

View File

@@ -14,12 +14,6 @@ TODO
LIBCURL 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 * Introduce another callback interface for upload/download that makes one
less copy of data and thus a faster operation. less copy of data and thus a faster operation.
[http://curl.haxx.se/dev/no_copy_callbacks.txt] [http://curl.haxx.se/dev/no_copy_callbacks.txt]
@@ -64,13 +58,8 @@ TODO
LIBCURL - multi interface 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 * 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 * 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 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 ready to accept read data. Today libcurl feeds the data as soon as it is
available for reading, no matter what. 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 * 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 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 transfer is done, then detach the easy handle, destroy the multi handle and
@@ -150,6 +135,10 @@ TODO
SSL 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: * Anton Fedorov's "dumpcert" patch:
http://curl.haxx.se/mail/lib-2004-03/0088.html 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 * Work out a common method with Peter Sylvester's OpenSSL-patch for SRP
on the TLS to provide name and password 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 LDAP
* Look over the implementation. The looping will have to "go away" from the * 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) * RTSP - RFC2326 (protocol - very HTTP-like, also contains URL description)
* SFTP/SCP/SSH (no RFCs for protocol nor URI/URL format). An implementation * 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 * RSYNC (no RFCs for protocol nor URI/URL format). An implementation should
most probably use an existing rsync library, such as librsync. most probably use an existing rsync library, such as librsync.

View File

@@ -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 .\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms .\" * you should have received as part of this distribution. The terms
@@ -21,7 +21,7 @@
.\" * $Id$ .\" * $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 .SH NAME
curl-config \- Get information about a libcurl installation curl-config \- Get information about a libcurl installation
.SH SYNOPSIS .SH SYNOPSIS
@@ -37,6 +37,11 @@ Displays the compiler used to build libcurl.
.IP "--cflags" .IP "--cflags"
Set of compiler options (CFLAGS) to use when compiling files that use Set of compiler options (CFLAGS) to use when compiling files that use
libcurl. Currently that is only thw include path to the curl include files. libcurl. Currently that is only 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" .IP "--feature"
Lists what particular main features the installed libcurl was built with. At 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 the time of writing, this list may include SSL, KRB4 or IPv6. Do not assume

View File

@@ -21,7 +21,7 @@
.\" * $Id$ .\" * $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 .SH NAME
curl \- transfer a URL curl \- transfer a URL
.SH SYNOPSIS .SH SYNOPSIS
@@ -43,7 +43,7 @@ curl is powered by libcurl for all transfer-related features. See
for details. for details.
.SH URL .SH URL
The URL syntax is protocol dependent. You'll find a detailed description in The URL syntax is protocol dependent. You'll find a detailed description in
RFC 2396. RFC 3986.
You can specify multiple URLs or parts of URLs by writing part sets within You can specify multiple URLs or parts of URLs by writing part sets within
braces as in: braces as in:
@@ -80,6 +80,24 @@ getting many files from the same server will not do multiple connects /
handshakes. This improves speed. Of course this is only done on files handshakes. This improves speed. Of course this is only done on files
specified on a single command line and cannot be used between separate curl specified on a single command line and cannot be used between separate curl
invokes. invokes.
.SH "PROGRESS METER"
curl normally displays a progress meter during operations, indicating amount
of transfered data, transfer speeds and estimated time left etc.
However, since curl displays data to the terminal by default, if you invoke
curl to do an operation and it is about to write data to the terminal, it
\fIdisables\fP the progress meter as otherwise it would mess up the output
mixing progress meter and response data.
If you want a progress meter for HTTP POST or PUT requests, you need to
redirect the response output to a file, using shell redirect (>), -o [file] or
similar.
It is not the same case for FTP upload as that operation is not spitting out
any response data to the terminal.
If you prefer a progress "bar" instead of the regular meter, \fI-#\fP is your
friend.
.SH OPTIONS .SH OPTIONS
.IP "-a/--append" .IP "-a/--append"
(FTP) When used in an FTP upload, this will tell curl to append to the target (FTP) When used in an FTP upload, this will tell curl to append to the target
@@ -337,9 +355,9 @@ If this option is used several times, the last one will be used.
.IP "-f/--fail" .IP "-f/--fail"
(HTTP) Fail silently (no output at all) on server errors. This is mostly done (HTTP) Fail silently (no output at all) on server errors. This is mostly done
like this to better enable scripts etc to better deal with failed attempts. In like this to better enable scripts etc to better deal with failed attempts. In
normal cases when a HTTP server fails to deliver a document, it returns a HTML normal cases when a HTTP server fails to deliver a document, it returns an
document stating so (which often also describes why and more). This flag will HTML document stating so (which often also describes why and more). This flag
prevent curl from outputting that and fail silently instead. will prevent curl from outputting that and return error 22.
If this option is used twice, the second will again disable silent failure. If this option is used twice, the second will again disable silent failure.
.IP "--ftp-account [data]" .IP "--ftp-account [data]"
@@ -354,6 +372,22 @@ the server, the standard behavior of curl is to fail. Using this option, curl
will instead attempt to create missing directories. will instead attempt to create missing directories.
If this option is used twice, the second will again disable directory creation. If this option is used twice, the second will again disable directory creation.
.IP "--ftp-method [method]"
(FTP) Control what method curl should use to reach a file on a FTP(S)
server. The method argument should be one of the following alternatives:
.RS
.IP multicwd
curl does a single CWD operation for each path part in the given URL. For deep
hierarchies this means very many commands. This is how RFC1738 says it should
be done. This is the default but the slowest behavior.
.IP nocwd
curl does no CWD at all. curl will do SIZE, RETR, STOR etc and give a full
path to the server for all these commands. This is the fastest behavior.
.IP singlecwd
curl does one CWD with the full target directory and then operates on the file
\&"normally" (like in the multicwd case). This is somewhat more standards
compliant than 'nocwd' but without the full penalty of 'multicwd'.
.RE
.IP "--ftp-pasv" .IP "--ftp-pasv"
(FTP) Use PASV when transferring. PASV is the internal default behavior, but (FTP) Use PASV when transferring. PASV is the internal default behavior, but
using this option can be used to override a previous --ftp-port option. (Added using this option can be used to override a previous --ftp-port option. (Added
@@ -362,6 +396,11 @@ in 7.11.0)
If this option is used several times, the following occurrences make no If this option is used several times, the following occurrences make no
difference. 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" .IP "--ftp-skip-pasv-ip"
(FTP) Tell curl to not use the IP address the server suggests in its response (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 to curl's PASV command when curl connects the data connection. Instead curl
@@ -373,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 If this option is used twice, the second will again use the server's suggested
address. address.
.IP "--ftp-ssl" .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. If this option is used twice, the second will again disable this.
.IP "-F/--form <name=content>" .IP "-F/--form <name=content>"
@@ -1097,6 +1144,10 @@ Number of new connects made in the recent transfer. (Added in 7.12.3)
.TP .TP
.B num_redirects .B num_redirects
Number of redirects that were followed in the request. (Added in 7.12.3) 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 .RE
If this option is used several times, the last one will be used. If this option is used several times, the last one will be used.
@@ -1202,7 +1253,7 @@ If this option is used twice, the second will again disable the progress bar.
.SH FILES .SH FILES
.I ~/.curlrc .I ~/.curlrc
.RS .RS
Default config file. Default config file, see \fI-K/--config\fP for details.
.SH ENVIRONMENT .SH ENVIRONMENT
.IP "http_proxy [protocol://]<host>[:port]" .IP "http_proxy [protocol://]<host>[:port]"
@@ -1355,6 +1406,32 @@ Unrecognized transfer encoding
Invalid LDAP URL Invalid LDAP URL
.IP 63 .IP 63
Maximum file size exceeded 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 .IP XX
There will appear more error codes here in future releases. The existing ones There will appear more error codes here in future releases. The existing ones
are meant to never change. are meant to never change.

View File

@@ -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-post.c fopen.c simplepost.c makefile.dj curlx.c https.c \
multi-debugcallback.c fileupload.c getinfo.c ftp3rdparty.c debug.c \ multi-debugcallback.c fileupload.c getinfo.c ftp3rdparty.c debug.c \
anyauthput.c htmltitle.cc htmltidy.c opensslthreadlock.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: all:
@echo "done" @echo "done"

View 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;
}

View File

@@ -87,8 +87,10 @@ int main(int argc, char **argv)
/* now specify which file to upload */ /* now specify which file to upload */
curl_easy_setopt(curl, CURLOPT_READDATA, hd_src); curl_easy_setopt(curl, CURLOPT_READDATA, hd_src);
/* and give the size of the upload */ /* provide the size of the upload, we specicially typecast the value
curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, file_info.st_size); 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! */ /* Now run off and do what you've been told! */
res = curl_easy_perform(curl); res = curl_easy_perform(curl);

View File

@@ -24,12 +24,13 @@ int main(int argc, char *argv[])
CURLM *multi_handle; CURLM *multi_handle;
int still_running; int still_running;
struct HttpPost *formpost=NULL; struct curl_httppost *formpost=NULL;
struct HttpPost *lastptr=NULL; struct curl_httppost *lastptr=NULL;
struct curl_slist *headerlist=NULL; struct curl_slist *headerlist=NULL;
char buf[] = "Expect:"; 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, curl_formadd(&formpost,
&lastptr, &lastptr,
CURLFORM_COPYNAME, "sendfile", CURLFORM_COPYNAME, "sendfile",
@@ -43,7 +44,6 @@ int main(int argc, char *argv[])
CURLFORM_COPYCONTENTS, "postit2.c", CURLFORM_COPYCONTENTS, "postit2.c",
CURLFORM_END); CURLFORM_END);
/* Fill in the submit field too, even if this is rarely needed */ /* Fill in the submit field too, even if this is rarely needed */
curl_formadd(&formpost, curl_formadd(&formpost,
&lastptr, &lastptr,

View 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;
}

View File

@@ -59,7 +59,9 @@
#include <stdio.h> #include <stdio.h>
#include <time.h> #include <time.h>
#ifndef __CYGWIN__
#include <windows.h> #include <windows.h>
#endif
#include <curl/curl.h> #include <curl/curl.h>

View File

@@ -4,51 +4,56 @@
AUTOMAKE_OPTIONS = foreign no-dependencies AUTOMAKE_OPTIONS = foreign no-dependencies
man_MANS = curl_easy_cleanup.3 curl_easy_getinfo.3 curl_easy_init.3 \ man_MANS = curl_easy_cleanup.3 curl_easy_getinfo.3 curl_easy_init.3 \
curl_easy_perform.3 curl_easy_setopt.3 curl_easy_duphandle.3 \ curl_easy_perform.3 curl_easy_setopt.3 curl_easy_duphandle.3 \
curl_formadd.3 curl_formfree.3 curl_getdate.3 curl_getenv.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_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_version_info.3 curl_escape.3 curl_unescape.3 curl_free.3 \
curl_strequal.3 curl_mprintf.3 curl_global_init.3 \ curl_strequal.3 curl_mprintf.3 curl_global_init.3 curl_global_cleanup.3 \
curl_global_cleanup.3 curl_multi_add_handle.3 curl_multi_cleanup.3 \ curl_multi_add_handle.3 curl_multi_cleanup.3 curl_multi_fdset.3 \
curl_multi_fdset.3 curl_multi_info_read.3 curl_multi_init.3 \ curl_multi_info_read.3 curl_multi_init.3 curl_multi_perform.3 \
curl_multi_perform.3 curl_multi_remove_handle.3 curl_share_cleanup.3 \ curl_multi_remove_handle.3 curl_share_cleanup.3 curl_share_init.3 \
curl_share_init.3 curl_share_setopt.3 libcurl.3 libcurl-easy.3 \ curl_share_setopt.3 libcurl.3 libcurl-easy.3 libcurl-multi.3 \
libcurl-multi.3 libcurl-share.3 libcurl-errors.3 curl_easy_strerror.3 \ libcurl-share.3 libcurl-errors.3 curl_easy_strerror.3 \
curl_multi_strerror.3 curl_share_strerror.3 curl_global_init_mem.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 \ HTMLPAGES = curl_easy_cleanup.html curl_easy_getinfo.html \
curl_easy_init.html curl_easy_perform.html curl_easy_setopt.html \ curl_easy_init.html curl_easy_perform.html curl_easy_setopt.html \
curl_easy_duphandle.html curl_formadd.html curl_formfree.html \ curl_easy_duphandle.html curl_formadd.html curl_formfree.html \
curl_getdate.html curl_getenv.html curl_slist_append.html \ curl_getdate.html curl_getenv.html curl_slist_append.html \
curl_slist_free_all.html curl_version.html curl_version_info.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_escape.html curl_unescape.html curl_free.html curl_strequal.html \
curl_mprintf.html curl_global_init.html curl_global_cleanup.html \ curl_mprintf.html curl_global_init.html curl_global_cleanup.html \
curl_multi_add_handle.html curl_multi_cleanup.html \ curl_multi_add_handle.html curl_multi_cleanup.html curl_multi_fdset.html \
curl_multi_fdset.html curl_multi_info_read.html curl_multi_init.html \ curl_multi_info_read.html curl_multi_init.html curl_multi_perform.html \
curl_multi_perform.html curl_multi_remove_handle.html \ curl_multi_remove_handle.html curl_share_cleanup.html \
curl_share_cleanup.html curl_share_init.html curl_share_setopt.html \ curl_share_init.html curl_share_setopt.html libcurl.html \
libcurl.html libcurl-multi.html libcurl-easy.html libcurl-share.html \ libcurl-multi.html libcurl-easy.html libcurl-share.html \
libcurl-errors.html curl_easy_strerror.html curl_multi_strerror.html \ libcurl-errors.html curl_easy_strerror.html curl_multi_strerror.html \
curl_share_strerror.html curl_global_init_mem.html \ curl_share_strerror.html curl_global_init_mem.html libcurl-tutorial.html \
libcurl-tutorial.html curl_easy_reset.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 \ PDFPAGES = curl_easy_cleanup.pdf curl_easy_getinfo.pdf curl_easy_init.pdf \
curl_easy_init.pdf curl_easy_perform.pdf curl_easy_setopt.pdf \ curl_easy_perform.pdf curl_easy_setopt.pdf curl_easy_duphandle.pdf \
curl_easy_duphandle.pdf curl_formadd.pdf curl_formfree.pdf \ curl_formadd.pdf curl_formfree.pdf curl_getdate.pdf curl_getenv.pdf \
curl_getdate.pdf curl_getenv.pdf curl_slist_append.pdf \ curl_slist_append.pdf curl_slist_free_all.pdf curl_version.pdf \
curl_slist_free_all.pdf curl_version.pdf curl_version_info.pdf \ curl_version_info.pdf curl_escape.pdf curl_unescape.pdf curl_free.pdf \
curl_escape.pdf curl_unescape.pdf curl_free.pdf curl_strequal.pdf \ curl_strequal.pdf curl_mprintf.pdf curl_global_init.pdf \
curl_mprintf.pdf curl_global_init.pdf curl_global_cleanup.pdf \ curl_global_cleanup.pdf curl_multi_add_handle.pdf curl_multi_cleanup.pdf \
curl_multi_add_handle.pdf curl_multi_cleanup.pdf curl_multi_fdset.pdf \ curl_multi_fdset.pdf curl_multi_info_read.pdf curl_multi_init.pdf \
curl_multi_info_read.pdf curl_multi_init.pdf curl_multi_perform.pdf \ curl_multi_perform.pdf curl_multi_remove_handle.pdf \
curl_multi_remove_handle.pdf curl_share_cleanup.pdf \ curl_share_cleanup.pdf curl_share_init.pdf curl_share_setopt.pdf \
curl_share_init.pdf curl_share_setopt.pdf libcurl.pdf \ libcurl.pdf libcurl-multi.pdf libcurl-easy.pdf libcurl-share.pdf \
libcurl-multi.pdf libcurl-easy.pdf libcurl-share.pdf \ libcurl-errors.pdf curl_easy_strerror.pdf curl_multi_strerror.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_share_strerror.pdf curl_global_init_mem.pdf libcurl-tutorial.pdf \ curl_easy_reset.pdf curl_easy_escape.pdf curl_easy_unescape.pdf \
curl_easy_reset.pdf curl_multi_setopt.pdf curl_multi_socket.pdf curl_multi_timeout.pdf \
curl_formget.pdf curl_multi_assign.pdf
CLEANFILES = $(HTMLPAGES) $(PDFPAGES) CLEANFILES = $(HTMLPAGES) $(PDFPAGES)

View 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

View File

@@ -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 .SH NAME
curl_easy_getinfo - extract information from a curl handle curl_easy_getinfo - extract information from a curl handle
.SH SYNOPSIS .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 to \fIcurl_easy_setopt(3)\fP or you will unconditionally get a -1 back. (Added
in 7.5) in 7.5)
.IP CURLINFO_TOTAL_TIME .IP CURLINFO_TOTAL_TIME
Pass a pointer to a double to receive the total transaction time in seconds Pass a pointer to a double to receive the total time in seconds for the
for the previous transfer. This time does not include the connect time, so if previous transfer, including name resolving, TCP connect etc.
you want the complete operation time, you should add the
CURLINFO_CONNECT_TIME.
.IP CURLINFO_NAMELOOKUP_TIME .IP CURLINFO_NAMELOOKUP_TIME
Pass a pointer to a double to receive the time, in seconds, it took from the Pass a pointer to a double to receive the time, in seconds, it took from the
start until the name resolving was completed. start until the name resolving was completed.
@@ -148,17 +165,22 @@ 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 libcurl close the socket and cleanup other resources associated with the
handle. This is typically used in combination with \fICURLOPT_CONNECT_ONLY\fP. handle. This is typically used in combination with \fICURLOPT_CONNECT_ONLY\fP.
(Added in 7.15.2) (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 .SH TIMES
.NF .NF
An overview of the six time values available from curl_easy_getinfo() An overview of the six time values available from curl_easy_getinfo()
curk_easy_perform() curl_easy_perform()
| |
|--NT |--NT
|--|--CT |--|--CT
|--|--|--PT |--|--|--PT
|--|--|--|--ST |--|--|--|--ST
|--|--|--TT |--|--|--|--|--TT
|--|--|--|--|--RT |--|--|--|--|--RT
.FI .FI
.IP NT .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 \fICURLINFO_STARTTRANSFER_TIME\fP. The time it took from the start until the
first byte is just about to be transferred. first byte is just about to be transferred.
.IP TT .IP TT
\fICURLINFO_TOTAL_TIME\fP. Time of the previous transfer. This time does not \fICURLINFO_TOTAL_TIME\fP. Total time of the previous request.
include the connect time (CT), so if you want the complete operation time, you
should add that.
.IP RT .IP RT
\fICURLINFO_REDIRECT_TIME\fP. The time it took for all redirection steps \fICURLINFO_REDIRECT_TIME\fP. The time it took for all redirection steps
include name lookup, connect, pretransfer and transfer before final include name lookup, connect, pretransfer and transfer before final

View File

@@ -21,7 +21,7 @@
.\" * $Id$ .\" * $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 .SH NAME
curl_easy_setopt \- set options for a curl easy handle curl_easy_setopt \- set options for a curl easy handle
.SH SYNOPSIS .SH SYNOPSIS
@@ -169,11 +169,12 @@ added in 7.12.3)
.IP CURLOPT_PROGRESSFUNCTION .IP CURLOPT_PROGRESSFUNCTION
Function pointer that should match the \fIcurl_progress_callback\fP prototype 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 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 its internal equivalent with a frequent interval during operation (roughly
once per second). Unknown/unused argument values pass to the callback will be once per second) no matter if data is being transfered or not. Unknown/unused
set to zero (like if you only download data, the upload size will remain argument values passed to the callback will be set to zero (like if you only
0). Returning a non-zero value from this callback will cause libcurl to abort download data, the upload size will remain 0). Returning a non-zero value from
the transfer and return \fICURLE_ABORTED_BY_CALLBACK\fP. 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 If you transfer data with the multi interface, this function will not be
called during periods of idleness unless you call the appropriate libcurl 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 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 \fICURLOPT_SSL_CTX_FUNCTION\fP, this is the pointer you'll get as third
parameter, otherwise \fBNULL\fP. (Added in 7.11.0) 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 .SH ERROR OPTIONS
.IP CURLOPT_ERRORBUFFER .IP CURLOPT_ERRORBUFFER
Pass a char * to a buffer that the libcurl may store human readable error 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 \fIcurl_multi_perform(3)\fP. Use \fIcurl_version_info(3)\fP for detailed info
on which protocols that are supported. 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. \fIcurl_easy_perform(3)\fP is called.
.IP CURLOPT_PROXY .IP CURLOPT_PROXY
Set HTTP proxy to use. The parameter should be a char * to a zero terminated 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 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 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) 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 .IP CURLOPT_HTTPGET
Pass a long. If the long is non-zero, this forces the HTTP request to get back 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 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 recommended that if used in conjunction with \fICURLOPT_TIMEOUT\fP, you set
\fICURLOPT_FTP_RESPONSE_TIMEOUT\fP to a value smaller than \fICURLOPT_FTP_RESPONSE_TIMEOUT\fP to a value smaller than
\fICURLOPT_TIMEOUT\fP. (Added in 7.10.8) \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 .IP CURLOPT_FTP_SKIP_PASV_IP
Pass a long. If set to a non-zero value, it instructs libcurl to not use the 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 IP address the server suggests in its 227-response to libcurl's PASV command
@@ -858,6 +915,23 @@ Exactly like \fICURLOPT_POSTQUOTE\fP, but for the source host.
Pass a pointer to a zero-terminated string (or NULL to disable). When an FTP Pass a pointer to a zero-terminated string (or NULL to disable). When an FTP
server asks for "account data" after user name and password has been provided, server asks for "account data" after user name and password has been provided,
this data is sent off using the ACCT command. (Added in 7.13.0) this data is sent off using the ACCT command. (Added in 7.13.0)
.IP CURLOPT_FTP_FILEMETHOD
Pass a long that should have one of the following values. This option controls
what method libcurl should use to reach a file on a FTP(S) server. The
argument should be one of the following alternatives:
.RS
.IP CURLFTPMETHOD_MULTICWD
libcurl does a single CWD operation for each path part in the given URL. For
deep hierarchies this means very many commands. This is how RFC1738 says it
should be done. This is the default but the slowest behavior.
.IP CURLFTPMETHOD_NOCWD
libcurl does no CWD at all. libcurl will do SIZE, RETR, STOR etc and give a
full path to the server for all these commands. This is the fastest behavior.
.IP CURLFTPMETHOD_SINGLECWD
libcurl does one CWD with the full target directory and then operates on the
file \&"normally" (like in the multicwd case). This is somewhat more standards
compliant than 'nocwd' but without the full penalty of 'multicwd'.
.RE
.SH PROTOCOL OPTIONS .SH PROTOCOL OPTIONS
.IP CURLOPT_TRANSFERTEXT .IP CURLOPT_TRANSFERTEXT
A non-zero parameter tells the library to use ASCII mode for ftp transfers, A non-zero parameter tells the library to use ASCII mode for ftp transfers,
@@ -984,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 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 should be below the \fICURLOPT_LOW_SPEED_LIMIT\fP for the library to consider
it too slow and abort. 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 .IP CURLOPT_MAXCONNECTS
Pass a long. The set number will be the persistent connection cache size. The 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 set amount will be the maximum amount of simultaneously open connections that
@@ -1044,7 +1126,7 @@ Resolve to ipv4 addresses.
.IP CURL_IPRESOLVE_V6 .IP CURL_IPRESOLVE_V6
Resolve to ipv6 addresses. Resolve to ipv6 addresses.
.RE .RE
.SH CURLOPT_CONNECT_ONLY .IP CURLOPT_CONNECT_ONLY
Pass a long. A non-zero parameter tells the library to perform any required Pass a long. A non-zero parameter tells the library to perform any required
proxy authentication and connection setup, but no data transfer. proxy authentication and connection setup, but no data transfer.
@@ -1142,6 +1224,9 @@ certificates to verify the peer with. This makes sense only when used in
combination with the \fICURLOPT_SSL_VERIFYPEER\fP option. If combination with the \fICURLOPT_SSL_VERIFYPEER\fP option. If
\fICURLOPT_SSL_VERIFYPEER\fP is zero, \fICURLOPT_CAINFO\fP need not \fICURLOPT_SSL_VERIFYPEER\fP is zero, \fICURLOPT_CAINFO\fP need not
even indicate an accessible file. even indicate an accessible file.
Note that option is by default set to the system path where libcurl's cacert
bundle is assumed to be stored, as established at build time.
.IP CURLOPT_CAPATH .IP CURLOPT_CAPATH
Pass a char * to a zero terminated string naming a directory holding Pass a char * to a zero terminated string naming a directory holding
multiple CA certificates to verify the peer with. The certificate multiple CA certificates to verify the peer with. The certificate

View 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

View File

@@ -11,6 +11,8 @@ curl_escape - URL encodes the given string
.BI "char *curl_escape( char *" url ", int "length " );" .BI "char *curl_escape( char *" url ", int "length " );"
.ad .ad
.SH DESCRIPTION .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 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, 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 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. input 'url' string to find out the size.
You must curl_free() the returned string when you're done with it. 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 .SH RETURN VALUE
A pointer to a zero terminated string or NULL if it failed. A pointer to a zero terminated string or NULL if it failed.
.SH "SEE ALSO" .SH "SEE ALSO"

View 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) "

View File

@@ -18,10 +18,9 @@ will instead be made "available" by source code access only, and then as
curlx_getenv(). curlx_getenv().
.SH RETURN VALUE .SH RETURN VALUE
If successful, curl_getenv() returns a pointer to the value of the specified If successful, curl_getenv() returns a pointer to the value of the specified
environment. The memory it refers to is malloc()ed why the application must environment. The memory it refers to is malloc()ed so the application must
free() this when the data has completed to serve its purpose. When free() this when the data is no longer needed. When \fIcurl_getenv(3)\fP fails
.I curl_getenv(3) to find the specified name, it returns a null pointer.
fails to find the specified name, it returns a null pointer.
.SH NOTE .SH NOTE
Under unix operating systems, there isn't any point in returning an allocated Under unix operating systems, there isn't any point in returning an allocated
memory, although other systems won't work properly if this isn't done. The memory, although other systems won't work properly if this isn't done. The

View File

@@ -11,30 +11,30 @@ curl_global_init - Global libcurl initialisation
.BI "CURLcode curl_global_init(long " flags ");" .BI "CURLcode curl_global_init(long " flags ");"
.ad .ad
.SH DESCRIPTION .SH DESCRIPTION
This function sets up the program environment that libcurl needs. Think This function sets up the program environment that libcurl needs. Think of it
of it as an extension of the library loader. as an extension of the library loader.
This function must be called at least once within a program (a program is This function must be called at least once within a program (a program is all
all the code that shares a memory space) before the program calls any other 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 function in libcurl. The environment it sets up is constant for the life of
of the program and is the same for every program, so multiple calls have the program and is the same for every program, so multiple calls have the same
the same effect as one call. effect as one call.
The flags option is a bit pattern that tells libcurl exactly what features to 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. 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 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 value unless you are familiar with and mean to control internal operations of
of libcurl. libcurl.
\fBThis function is not thread safe.\fP You must not call it when any \fBThis function is not thread safe.\fP You must not call it when any other
other thread in the program (i.e. a thread sharing the same memory) is thread in the program (i.e. a thread sharing the same memory) is running.
running. This doesn't just mean no other thread that is using This doesn't just mean no other thread that is using libcurl. Because
libcurl. Because \fIcurl_global_init()\fP calls functions of other \fIcurl_global_init()\fP calls functions of other libraries that are similarly
libraries that are similarly thread unsafe, it could conflict with any thread unsafe, it could conflict with any other thread that uses these other
other thread that uses these other libraries. libraries.
See the description in \fBlibcurl\fP(3) of global environment See the description in \fBlibcurl\fP(3) of global environment requirements for
requirements for details of how to use this function. details of how to use this function.
.SH FLAGS .SH FLAGS
.TP 5 .TP 5

View File

@@ -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 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! 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 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 \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 multi stack before you terminate first the easy handle and then the multi

View 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) "

View File

@@ -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 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 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 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. be called. Set the callback's \fBuserp\fP argument with
See \fIcurl_multi_socket(3)\fP for more callback details. \fICURLMOPT_SOCKETDATA\fP. See \fIcurl_multi_socket(3)\fP for more callback
details.
.IP CURLMOPT_SOCKETDATA .IP CURLMOPT_SOCKETDATA
Pass a pointer to whatever you want passed to the curl_socket_callback's forth 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 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 CURLM_UNKNOWN_OPTION if you try setting an option that this version of libcurl
doesn't know of. doesn't know of.
.SH AVAILABILITY .SH AVAILABILITY
This function was added in libcurl 7.16.0 This function was added in libcurl 7.15.4.
.SH "SEE ALSO" .SH "SEE ALSO"
.BR curl_multi_cleanup "(3), " curl_multi_init "(3), " .BR curl_multi_cleanup "(3), " curl_multi_init "(3), "
.BR curl_multi_socket "(3), " curl_multi_info_read "(3)" .BR curl_multi_socket "(3), " curl_multi_info_read "(3)"

View File

@@ -1,50 +1,71 @@
.\" $Id$ .\" $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 .SH NAME
curl_multi_socket \- reads/writes available data curl_multi_socket \- reads/writes available data
.SH SYNOPSIS .SH SYNOPSIS
#include <curl/curl.h> #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 .SH DESCRIPTION
Alternative versions of \fIcurl_multi_perform()\fP that allows the application Alternative versions of \fIcurl_multi_perform(3)\fP that allows the
to pass in one of the file descriptors/sockets that have been detected to have application to pass in one of the file descriptors/sockets that have been
\&"action" on them and let libcurl perform. This allows libcurl to not have to detected to have \&"action" on them and let libcurl perform. This allows
scan through all possible file descriptors to check for action. When the libcurl to not have to scan through all possible file descriptors to check for
application has detected action on a socket handled by libcurl, it should call action. When the application has detected action on a socket handled by
\fIcurl_multi_perform()\fP with the \fBsockfd\fP argument set to the socket libcurl, it should call \fIcurl_multi_socket(3)\fP with the \fBsockfd\fP
with the action. argument set to the socket with the action.
These functions inform the application about updates in the socket (file At return, the int \fBrunning_handles\fP points to will contain the number of
descriptor) status by doing none, one or multiple calls to the still running easy handles within the multi handle. When this number reaches
curl_socket_callback given with the CURLMOPT_SOCKETFUNCTION option to 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 \fIcurl_multi_setopt(3)\fP. They update the status with changes since the
previous time this function was called. previous time this function was called.
If you want to force libcurl to (re-)check all its internal sockets and To force libcurl to (re-)check all its internal sockets and transfers instead
transfers instead of just a single one, you call of just a single one, you call \fBcurl_multi_socket_all(3)\fP. This is
\fBcurl_multi_socket_all(3)\fP instead. 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 Applications should call \fBcurl_multi_timeout(3)\fP to figure out how long to
it should wait for socket actions \- at most \- before doing the timeout wait for socket actions \- at most \- before doing the timeout action: call
action: call the \fBcurl_multi_socket(3)\fP function with the \fBsockfd\fP the \fBcurl_multi_socket(3)\fP function with the \fBsockfd\fP argument set to
argument set to CURL_SOCKET_TIMEOUT. CURL_SOCKET_TIMEOUT.
.SH "CALLBACK DETAILS"
The socket \fBcallback\fP function uses a prototype like this The socket \fBcallback\fP function uses a prototype like this
.nf .nf
int curl_socket_callback(CURL *easy, /* easy handle */ int curl_socket_callback(CURL *easy, /* easy handle */
curl_socket_t s, /* socket */ curl_socket_t s, /* socket */
int action, /* see values below */ int action, /* see values below */
void *userp); /* "private" pointer */ void *userp, /* private callback pointer */
void *socketp); /* private socket pointer */
.fi .fi
The callback MUST return 0. 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 .RS
.IP "CURL_POLL_NONE (0)" .IP "CURL_POLL_NONE (0)"
register, not interested in readiness (yet) register, not interested in readiness (yet)
@@ -57,6 +78,15 @@ register, interested in both read and write readiness
.IP "CURL_POLL_REMOVE (4)" .IP "CURL_POLL_REMOVE (4)"
deregister deregister
.RE .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" .SH "RETURN VALUE"
CURLMcode type, general libcurl multi interface error code. CURLMcode type, general libcurl multi interface error code.
@@ -90,7 +120,7 @@ action.
9. Go back to step 6. 9. Go back to step 6.
.SH AVAILABILITY .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" .SH "SEE ALSO"
.BR curl_multi_cleanup "(3), " curl_multi_init "(3), " .BR curl_multi_cleanup "(3), " curl_multi_init "(3), "
.BR curl_multi_fdset "(3), " curl_multi_info_read "(3)" .BR curl_multi_fdset "(3), " curl_multi_info_read "(3)"

View File

@@ -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 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. by a previous call to \fBcurl_multi_socket(3)\fP.
.SH AVAILABILITY .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" .SH "SEE ALSO"
.BR curl_multi_cleanup "(3), " curl_multi_init "(3), " .BR curl_multi_cleanup "(3), " curl_multi_init "(3), "
.BR curl_multi_fdset "(3), " curl_multi_info_read "(3), " .BR curl_multi_fdset "(3), " curl_multi_info_read "(3), "

View File

@@ -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. Cookie data will be shared across the easy handles using this shared object.
.IP CURL_LOCK_DATA_DNS .IP CURL_LOCK_DATA_DNS
Cached DNS hosts will be shared across the easy handles using this shared 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 .RE
.IP CURLSHOPT_UNSHARE .IP CURLSHOPT_UNSHARE
This option does the opposite of \fICURLSHOPT_SHARE\fP. It specifies that This option does the opposite of \fICURLSHOPT_SHARE\fP. It specifies that

View File

@@ -11,6 +11,8 @@ curl_unescape - URL decodes the given string
.BI "char *curl_unescape( char *" url ", int "length " );" .BI "char *curl_unescape( char *" url ", int "length " );"
.ad .ad
.SH DESCRIPTION .SH DESCRIPTION
Obsolete function. Use \fIcurl_easy_unescape(3)\fP instead!
This function will convert the given URL encoded input string to a "plain 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 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 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. input 'url' string to find out the size.
You must curl_free() the returned string when you're done with it. 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 .SH RETURN VALUE
A pointer to a zero terminated string or NULL if it failed. A pointer to a zero terminated string or NULL if it failed.
.SH "SEE ALSO" .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

View File

@@ -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 .SH NAME
curl_version_info - returns run-time libcurl version info curl_version_info - returns run-time libcurl version info
.SH SYNOPSIS .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 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 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) 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 .RE
\fIssl_version\fP is an ascii string for the OpenSSL version used. If libcurl \fIssl_version\fP is an ascii string for the OpenSSL version used. If libcurl
has no SSL support, this is NULL. has no SSL support, this is NULL.

View File

@@ -30,7 +30,7 @@ or problem.
.IP "CURLE_URL_MALFORMAT (3)" .IP "CURLE_URL_MALFORMAT (3)"
The URL was not properly formatted. The URL was not properly formatted.
.IP "CURLE_URL_MALFORMAT_USER (4)" .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)" .IP "CURLE_COULDNT_RESOLVE_PROXY (5)"
Couldn't resolve proxy. The given proxy host could not be resolved. Couldn't resolve proxy. The given proxy host could not be resolved.
.IP "CURLE_COULDNT_RESOLVE_HOST (6)" .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 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. change working directory to the one given in the URL.
.IP "CURLE_FTP_USER_PASSWORD_INCORRECT (10)" .IP "CURLE_FTP_USER_PASSWORD_INCORRECT (10)"
The FTP server rejected access to the server after the password was sent to This is never returned by current libcurl.
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.
.IP "CURLE_FTP_WEIRD_PASS_REPLY (11)" .IP "CURLE_FTP_WEIRD_PASS_REPLY (11)"
After having sent the FTP password to the server, libcurl expects a proper After having sent the FTP password to the server, libcurl expects a proper
reply. This error code indicates that an unexpected code was returned. 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 An error occurred when writing received data to a local file, or an error was
returned to libcurl from a write callback. returned to libcurl from a write callback.
.IP "CURLE_MALFORMAT_USER (24)" .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)" .IP "CURLE_FTP_COULDNT_STOR_FILE (25)"
FTP couldn't STOR file. The server denied the STOR operation. The error buffer FTP couldn't STOR file. The server denied the STOR operation. The error buffer
usually contains the server's explanation to this. 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)" .IP "CURLE_BAD_FUNCTION_ARGUMENT (43)"
Internal error. A function was called with a bad parameter. Internal error. A function was called with a bad parameter.
.IP "CURLE_BAD_CALLING_ORDER (44)" .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)" .IP "CURLE_HTTP_PORT_FAILED (45)"
Interface error. A specified outgoing interface could not be used. Set which Interface error. A specified outgoing interface could not be used. Set which
interface to use for outgoing connections' source IP address with interface to use for outgoing connections' source IP address with
CURLOPT_INTERFACE. CURLOPT_INTERFACE.
.IP "CURLE_BAD_PASSWORD_ENTERED (46)" .IP "CURLE_BAD_PASSWORD_ENTERED (46)"
Bad password entered. An error was signaled when the password was This is never returned by current libcurl.
entered. This can also be the result of a "bad password" returned from a
specified password callback.
.IP "CURLE_TOO_MANY_REDIRECTS (47)" .IP "CURLE_TOO_MANY_REDIRECTS (47)"
Too many redirects. When following redirects, libcurl hit the maximum amount. Too many redirects. When following redirects, libcurl hit the maximum amount.
Set your limit with CURLOPT_MAXREDIRS. Set your limit with CURLOPT_MAXREDIRS.
@@ -194,6 +190,24 @@ rewinding operation failed
Initiating the SSL Engine failed Initiating the SSL Engine failed
.IP "CURLE_LOGIN_DENIED (67)" .IP "CURLE_LOGIN_DENIED (67)"
The remote server denied curl to login (Added in 7.13.1) 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" .SH "CURLMcode"
This is the generic return code used by functions in the libcurl multi This is the generic return code used by functions in the libcurl multi
interface. Also consider \fIcurl_multi_strerror(3)\fP. 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! This can only be returned if libcurl bugs. Please report it to us!
.IP "CURLM_BAD_SOCKET (5)" .IP "CURLM_BAD_SOCKET (5)"
The passed-in socket is not a valid one that libcurl already knows about. 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" .SH "CURLSHcode"
The "share" interface will return a CURLSHcode to indicate when an error has The "share" interface will return a CURLSHcode to indicate when an error has
occurred. Also consider \fIcurl_share_strerror(3)\fP. occurred. Also consider \fIcurl_share_strerror(3)\fP.

View File

@@ -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" .TH libcurl-multi 3 "13 Oct 2001" "libcurl 7.10.1" "libcurl multi interface"
.SH NAME .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. All functions in the multi interface are prefixed with curl_multi.
.SH "OBJECTIVES" .SH "OBJECTIVES"
The multi interface introduces several new abilities that the easy interface The multi interface offers several abilities that the easy interface doesn't.
refuses to offer. They are mainly: They are mainly:
1. Enable a "pull" interface. The application that uses libcurl decides where 1. Enable a "pull" interface. The application that uses libcurl decides where
and when to ask libcurl to get/send data. 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 2. Enable multiple simultaneous transfers in the same thread without making it
complicated for the application. complicated for the application.
3. Enable the application to select() on its own file descriptors and curl's 3. Enable the application to wait for action on its own file descriptors and
file descriptors simultaneous easily. curl's file descriptors simultaneous easily.
.SH "ONE MULTI HANDLE MANY EASY HANDLES" .SH "ONE MULTI HANDLE MANY EASY HANDLES"
To use the multi interface, you must first create a 'multi handle' with 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 \fIcurl_multi_init(3)\fP. This handle is then used as input to all further

View File

@@ -133,10 +133,11 @@ Repeated calls to \fIcurl_global_init(3)\fP and \fIcurl_global_cleanup(3)\fP
should be avoided. They should only be called once each. should be avoided. They should only be called once each.
.SH "Features libcurl Provides" .SH "Features libcurl Provides"
It is considered best-practice to determine libcurl features run-time rather It is considered best-practice to determine libcurl features at run-time
than build-time (if possible of course). By calling curl_version_info() and rather than at build-time (if possible of course). By calling
checking tout he details of the returned struct, your program can figure out \fIcurl_version_info(3)\fP and checking out the details of the returned
exactly what the currently running libcurl supports. struct, your program can figure out exactly what the currently running libcurl
supports.
.SH "Handle the Easy libcurl" .SH "Handle the Easy libcurl"
libcurl first introduced the so called easy interface. All operations in the libcurl first introduced the so called easy interface. All operations in the
@@ -211,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 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], 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 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 \fICURLOPT_WRITEDATA\fP, it will crash. You should therefore avoid this to
make your program run fine virtually everywhere. make your program run fine virtually everywhere.

View File

@@ -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 \fIlibcurl-share(3)\fP man page and the \fIlibcurl-tutorial(3)\fP man page for
in-depth understanding on how to program with libcurl. in-depth understanding on how to program with libcurl.
There are more than a twenty custom bindings available that bring libcurl There are more than thirty custom bindings available that bring libcurl access
access to your favourite language. Look elsewhere for documentation on those. to your favourite language. Look elsewhere for documentation on those.
libcurl has a global constant environment that you must set up and libcurl has a global constant environment that you must set up and
maintain while using libcurl. This essentially means you call maintain while using libcurl. This essentially means you call

View File

@@ -1,7 +1,7 @@
# LIBCURL_CHECK_CONFIG ([DEFAULT-ACTION], [MINIMUM-VERSION], # LIBCURL_CHECK_CONFIG ([DEFAULT-ACTION], [MINIMUM-VERSION],
# [ACTION-IF-YES], [ACTION-IF-NO]) # [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 # Checks for libcurl. DEFAULT-ACTION is the string yes or no to
# specify whether to default to --with-libcurl or --without-libcurl. # 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]) AC_DEFINE_UNQUOTED(AS_TR_CPP(libcurl_protocol_$_libcurl_protocol),[1])
eval AS_TR_SH(libcurl_protocol_$_libcurl_protocol)=yes eval AS_TR_SH(libcurl_protocol_$_libcurl_protocol)=yes
done done
else
unset LIBCURL
unset LIBCURL_CPPFLAGS
fi fi
fi fi

View File

@@ -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. # 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 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) hiper: hiper.o $(LIBCURL)
$(CC) -o $@ $< $(LIBCURL) $(LDFLAGS) $(CC) -o $@ $< $(LIBCURL) $(LDFLAGS)
@@ -15,6 +16,12 @@ hiper: hiper.o $(LIBCURL)
hiper.o: hiper.c hiper.o: hiper.c
$(CC) $(CFLAGS) -c $< $(CC) $(CFLAGS) -c $<
hipev: hipev.o $(LIBCURL)
$(CC) -o $@ $< $(LIBCURL) $(LDFLAGS) -levent
hipev.o: hipev.c
$(CC) $(CFLAGS) -c $<
shiper: shiper.o $(LIBCURL) shiper: shiper.o $(LIBCURL)
$(CC) -o $@ $< $(LIBCURL) $(LDFLAGS) $(CC) -o $@ $< $(LIBCURL) $(LDFLAGS)

View File

@@ -238,3 +238,63 @@ Roadmap Ahead
I plan and hope to return to full-time hiper work later on this spring or 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 possibly summer to continue where I pause now. Of course some spare time
might also be spent until then to get us moving forward. 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
View 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;
}

View File

@@ -16,7 +16,8 @@
* The same is hiper.c but instead using the new *socket() API instead of the * The same is hiper.c but instead using the new *socket() API instead of the
* "old" *perform() call. * "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 <curl/curl.h>
#include <event.h> /* for libevent */
#ifndef FALSE #ifndef FALSE
#define FALSE 0 #define FALSE 0
#endif #endif
@@ -84,7 +83,6 @@ struct fdinfo {
CURL *easy; CURL *easy;
int action; /* as set by libcurl */ int action; /* as set by libcurl */
long timeout; /* as set by libcurl */ long timeout; /* as set by libcurl */
struct event ev;
}; };
static struct fdinfo *allsocks; static struct fdinfo *allsocks;
@@ -376,6 +374,7 @@ int main(int argc, char **argv)
int selectmaxamount; int selectmaxamount;
struct fdinfo *fdp; struct fdinfo *fdp;
char act; char act;
int running_handles;
memset(&info, 0, sizeof(struct globalinfo)); memset(&info, 0, sizeof(struct globalinfo));
@@ -453,7 +452,8 @@ int main(int argc, char **argv)
curl_multi_setopt(multi_handle, CURLMOPT_SOCKETDATA, NULL); curl_multi_setopt(multi_handle, CURLMOPT_SOCKETDATA, NULL);
/* we start the action by calling *socket() right away */ /* 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); printf("Starting timer, expects to run for %ldus\n", RUN_FOR_THIS_LONG);
timer_start(); timer_start();
@@ -488,7 +488,7 @@ int main(int argc, char **argv)
break; break;
case 0: case 0:
timeouts++; timeouts++;
curl_multi_socket(multi_handle, CURL_SOCKET_TIMEOUT); curl_multi_socket(multi_handle, CURL_SOCKET_TIMEOUT, &running_handles);
break; break;
default: default:
@@ -512,7 +512,7 @@ int main(int argc, char **argv)
timer_continue(); timer_continue();
if(act & CURL_POLL_OUT) if(act & CURL_POLL_OUT)
act--; act--;
curl_multi_socket(multi_handle, fdp->sockfd); curl_multi_socket(multi_handle, fdp->sockfd, &running_handles);
timer_pause(); timer_pause();
} }
} }

Some files were not shown because too many files have changed in this diff Show More