Compare commits

..

234 Commits

Author SHA1 Message Date
Daniel Stenberg
f49df54a36 7.15.1 with the now to be announced security flaw fixed 2005-12-06 23:05:51 +00:00
Daniel Stenberg
952bbc4410 my first collect-random-urls script, just for reference 2005-12-06 13:56:56 +00:00
Daniel Stenberg
1eb4b85d72 ok, these are the test build I've used so far 2005-12-06 13:56:28 +00:00
Daniel Stenberg
59b6cb9e91 Yang Tse: fixed compiler warning 2005-12-06 07:47:37 +00:00
Daniel Stenberg
e06afaeb7a Yang Tse: With last change logging directory needs to be created sooner. 2005-12-06 07:44:18 +00:00
Dan Fandrich
8c6f654b26 Added a run-time check to warn if TFTP is going to fail due to portability
issues in the code.
2005-12-05 20:07:05 +00:00
Daniel Stenberg
1d8212e53a Yang Tse: make runtests.pl more talkative when unable to find out curl's
version.
2005-12-05 19:23:56 +00:00
Daniel Stenberg
083c5e17e1 Yang Tse fixed: Openssl 0.9.9 makes 'const' the SSL_METHOD parameter in
SSL_CTX_new and others, and also makes functions SSLv23_client_method,
TLSv1_client_method, etc return a 'const' SSL_METHOD pointer. Previous
versions do not use the 'const' qualifier.
2005-12-05 15:14:04 +00:00
Daniel Stenberg
272231fb09 Another Yang Tse warning cleanup raid! 2005-12-05 14:10:48 +00:00
Gisle Vanem
67b4d9b232 Recent OpenSSL returns a 'const' in '*_client_method()'. So avoid
'assignment discards qualifiers from pointer target type' warning.
2005-12-04 18:47:36 +00:00
Daniel Stenberg
21709e1557 Yang Tse adjusted the multiple header inclusion prevention definition
H_MPRINTF to our more used style __CURL_MPRINTF_H
2005-12-02 23:23:49 +00:00
Daniel Stenberg
9c312637d1 Yang Tse's fix to only provide the proto if there is such a function and
we didn't find any proto
2005-12-02 23:22:45 +00:00
Daniel Stenberg
feacad7f68 Yang Tse fixed the 4th argument in the sendto() calls 2005-12-02 23:22:00 +00:00
Daniel Stenberg
6513303498 Jamie Newton pointed out that libcurl's file:// code would close() a zero
file descriptor if given a non-existing file.
2005-12-01 23:42:03 +00:00
Daniel Stenberg
3e2a52b034 #27 is fixed 2005-11-30 22:09:24 +00:00
Daniel Stenberg
176d4e85e9 cast the va_arg() assignment to ftp_filemethod properly 2005-11-30 13:09:48 +00:00
Daniel Stenberg
84d30dffb6 Yang Tse's fix of the inet_pton check 2005-11-29 16:17:53 +00:00
Daniel Stenberg
0fd282b078 new experimental "ftp method" code 2005-11-28 23:06:00 +00:00
Daniel Stenberg
cdf4afbe50 Bryan Henderson 2005-11-28 23:05:29 +00:00
Daniel Stenberg
b222b2304e Yang Tse's changes to provide an inet_pton() proto for the platforms who
don't have one in order to fix a remaining warning on IRIX 6.2.
2005-11-28 20:21:35 +00:00
Daniel Stenberg
fdf9900114 added note about the inclusion of curl.h from within this file 2005-11-28 07:43:53 +00:00
Daniel Stenberg
5867eb2dd2 Bryan Henderson: added missing ignores 2005-11-25 22:45:50 +00:00
Daniel Stenberg
61f145e3de Yang Tse fixed compiler warnings 2005-11-25 22:45:06 +00:00
Daniel Stenberg
b97e7fc730 read_tcp_data() fix to get the proper buffer pointer and size 2005-11-25 22:23:28 +00:00
Daniel Stenberg
01cbf08064 Yang Tse: fixes the use of Curl_inet_ntop and Curl_inet_pton with no
prototypes on some platforms, ie IRIX 6.2 MIPS C 6.2
2005-11-25 22:20:02 +00:00
Daniel Stenberg
fec632e948 Yang Tse: fixed compiler warnings 2005-11-25 22:14:53 +00:00
Daniel Stenberg
6aab5b57e1 Change based on Yang Tse's excellent fix to reduce buffer overflow risk and
fixing a compiler warning in the append_scopeid() function.
2005-11-25 22:14:28 +00:00
Daniel Stenberg
d2a27e02ce Doug Kaufman corrected my attempt to a generic "skip extra test for function
F"
2005-11-25 09:52:19 +00:00
Daniel Stenberg
b55506a76d avoid doing #if an a predef symbol that might not be defined 2005-11-24 23:03:25 +00:00
Daniel Stenberg
afc2aa2b3f Yang Tse: use static on file-private functions 2005-11-24 20:39:00 +00:00
Daniel Stenberg
d055b269ed Yang Tse: fix compilation errors when SSL is not disabled and HTTP is
disabled
2005-11-24 20:38:20 +00:00
Daniel Stenberg
8a246a4a9f Yang Tse: removes GOPHER protocol when HTTP is disabled 2005-11-24 20:37:13 +00:00
Gisle Vanem
2f684351bf Changes for OpenWatcom 1.4. 2005-11-24 20:33:38 +00:00
Daniel Stenberg
74e5beab9d Doug Kaufman's set of patches to make curl build fine on DJGPP again using
configure.
2005-11-24 10:22:46 +00:00
Daniel Stenberg
b41765f441 mention the colon-only thing for -u and SSPI+NTLM 2005-11-24 07:20:13 +00:00
Daniel Stenberg
05a6013f42 Yang Tse's patch to silence MSVC warnings 2005-11-23 22:59:24 +00:00
Daniel Stenberg
cfff544d67 only enable NTLM if HTTP and NTLM is not disabled, and if NTLM is disabled
we define an empty macro for the ntlm cleanup function
2005-11-23 11:51:31 +00:00
Daniel Stenberg
599d9642ca Yang Tse fixed MSVC 6.0 warnings 2005-11-23 09:10:00 +00:00
Daniel Stenberg
0264faaa4e fix compiler warning 2005-11-18 07:23:50 +00:00
Daniel Stenberg
4022a60ea7 I extended a patch from David Shaw to make libcurl _always_ provide an error
string in the given error buffer to address the flaw mention on 21 sep 2005.
2005-11-17 14:29:54 +00:00
Daniel Stenberg
39e366fc11 TFTP 2005-11-17 14:28:58 +00:00
Daniel Stenberg
096675824f Applied Albert Chin's patch that makes the libcurl.pc pkgconfig file get
installed on 'make install' time.
2005-11-16 07:20:57 +00:00
Daniel Stenberg
80bfa76ac9 check for and use winsock2.h instead of winsock.h and I fixed a typo in the
ifdefs where . was used instead of _!
2005-11-16 07:12:37 +00:00
Daniel Stenberg
b2e553a82e include ws2tcpip.h in an attempt to detect some of the ipv6 structs better
in mingw builds
2005-11-15 14:39:52 +00:00
Daniel Stenberg
772b64d9d3 Detect big/little endian in the configure script and adjust the ares_dns.h
macros accordingly.
2005-11-14 23:14:54 +00:00
Daniel Stenberg
92c0de518e Quagmire reported that he needed to raise a NTLM buffer for SSPI to work
properly for a case, and so we did. We raised it even for non-SSPI builds
but it should not do any harm. http://curl.haxx.se/bug/view.cgi?id=1356715
2005-11-14 22:10:52 +00:00
Gisle Vanem
ff96456513 Added '-DHAVE_SOCKADDR_IN6_SIN6_SCOPE_ID'. 2005-11-14 13:40:16 +00:00
Gisle Vanem
e89adbef51 Added CVS id.
Avoid warning 'x might be used uninitialized in this function'.
2005-11-14 13:26:17 +00:00
Gisle Vanem
22a6a6cf81 We have HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID. 2005-11-14 12:32:56 +00:00
Daniel Stenberg
fd870e4e8a Yang Tse: msvc7+ has deprecated the 'DESCRIPTION' section in
module-definition files. this section is not mandatory for msvc60 so it
could be completely removed from libcurl.def.
2005-11-14 07:48:05 +00:00
Daniel Stenberg
d52ed3fff2 Jan Kunder's debian bug report
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=338680 identified a weird
error message for when you try to upload a file and the requested directory
doesn't exist on the target server.
2005-11-14 00:18:12 +00:00
Daniel Stenberg
bac17ab7d8 extended the description for exit code 9 2005-11-14 00:17:03 +00:00
Daniel Stenberg
9ace303528 Yang Tse fixed compiler warnings 2005-11-13 23:53:14 +00:00
Daniel Stenberg
7e81c35cdc to build with old gnutls verions, don't use the *_t types 2005-11-13 23:04:28 +00:00
Daniel Stenberg
0f125d9bcf prevent compiler warning 2005-11-13 22:54:00 +00:00
Gisle Vanem
d4714517c0 Add HAVE_STRUCT_SOCKADDR_STORAGE.
My mistake; WinCE has it's own config-file.
2005-11-13 13:32:19 +00:00
Gisle Vanem
280e4bf4c3 Fix for WIN32. WIN32 does have 'struct sockaddr_storage', but
that's in <winsock2.h>. Hence tftp.c wouldn't compile on WinCE.
2005-11-13 13:20:37 +00:00
Daniel Stenberg
adf462fe05 Debian bug report 338681 by Jan Kunder: make curl better detect and report bad
limit-rate units: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=338681 Now
curl will return error if a bad unit is used.
2005-11-13 11:06:48 +00:00
Daniel Stenberg
c2862742ab Thanks to this nice summary of poll() implementations:
http://www.greenend.org.uk/rjk/2001/06/poll.html and further tests by Eugene
Kotlyarov, we now know that cygwin's poll returns only POLLHUP on remote
connection closure so we check for that case (too) and re-enable poll for
cygwin builds.
2005-11-13 09:24:06 +00:00
Daniel Stenberg
8a712eb5af Eugene Kotlyarov found out that cygwin's poll() function isn't doing things
right: http://curl.haxx.se/mail/archive-2005-11/0045.html so we now disable
poll() and use select() on cygwin too (we already do the same choice on Mac OS
X)
2005-11-12 22:49:19 +00:00
Daniel Stenberg
d58790af17 oops * 2 2005-11-12 22:13:20 +00:00
Daniel Stenberg
9ef7a13403 oops 2005-11-12 22:12:42 +00:00
Daniel Stenberg
a5da1219bb Reversed the logic for sockaddr_storage and made our own Curl_sockaddr_storage
struct instead to use.
2005-11-12 22:10:42 +00:00
Daniel Stenberg
be524fed38 on windows (mingw32) the sockaddr_storage struct is in winsock2.h 2005-11-12 19:11:02 +00:00
Gisle Vanem
042016b85e Fixed typo. Detabified. 2005-11-12 18:33:32 +00:00
Gisle Vanem
f6da574324 Support big-endian machines. 2005-11-12 15:15:27 +00:00
Gisle Vanem
b09d5c3135 Added CVS id, Detabified, applied c-ares coding-style. 2005-11-12 14:59:33 +00:00
Gisle Vanem
ec65c3fd53 Added CVS id. Detabified. 2005-11-12 14:44:26 +00:00
Gisle Vanem
7ca2f31c8d Include <getopt.h>.
Use DNS__32BIT() and DNS__16BIT()  (How about BE machines?).
Display T_AAAA resource.
2005-11-12 14:41:12 +00:00
Daniel Stenberg
2275737a5d removed files no longer existing 2005-11-12 00:01:50 +00:00
Daniel Stenberg
5e3836055f Dima Barsky patched problem #1348930: the GnuTLS code completely ignored
client certificates! (http://curl.haxx.se/bug/view.cgi?id=1348930).
2005-11-11 23:20:07 +00:00
Daniel Stenberg
37a6a0bb3e Moved the sockaddr_storage definition to lib/sockaddr.h and only include that
in files that actually need the struct.
2005-11-11 22:04:11 +00:00
Gisle Vanem
6bcca3eca9 Squelch gcc 4.x warning. 2005-11-11 19:25:29 +00:00
Gisle Vanem
ce40b8d531 Detabified. Added CVS id. 2005-11-11 19:20:22 +00:00
Gisle Vanem
9f109b94b8 HAVE_xx defines moved to config-win32.h. 2005-11-11 19:14:51 +00:00
Daniel Stenberg
89024febde mention how to set domain when using NTLM 2005-11-11 08:52:29 +00:00
Gisle Vanem
b7a673c6e2 Update using ares_inet_pton() and ares_inet_ntop(). 2005-11-11 04:28:23 +00:00
Daniel Stenberg
7f68be770d one in, one out 2005-11-10 23:30:54 +00:00
Daniel Stenberg
4f173f35db Fun while it lasted. New mirror already out-of-date. 2005-11-10 23:24:09 +00:00
Daniel Stenberg
ae9fbe573e David Lang fixed IPv6 support for TFTP! 2005-11-10 22:25:07 +00:00
Daniel Stenberg
29676f473d David Lang: if there is no sockaddr_storage, make up our own and use that 2005-11-10 22:24:49 +00:00
Daniel Stenberg
a5fcb26ab1 modified to the new error text for range error 2005-11-10 22:22:38 +00:00
Daniel Stenberg
d68b1a1e8c just implemented 2005-11-10 22:11:27 +00:00
Daniel Stenberg
bd8baed138 Introducing range stepping to the curl globbing support. Now you can specify
step counter by adding :[num] within the brackets when specifying a range.
2005-11-10 22:11:01 +00:00
Gisle Vanem
00a7dda273 Use config-win32.h on Windows. Fixes for djgpp. 2005-11-10 16:55:59 +00:00
Gisle Vanem
4dba07c384 Defines moved to config-win32.h. 2005-11-10 16:52:43 +00:00
Gisle Vanem
4d39c6b7cc Easy configuration with this file. 2005-11-10 16:50:21 +00:00
Gisle Vanem
7d6f6158c9 Remove generated files areslib.plg areslib.mak from CVS. 2005-11-10 16:42:07 +00:00
Gisle Vanem
6863dbbc0c Remove generated files ahost.plg ahost.mak from CVS. 2005-11-10 16:40:08 +00:00
Gisle Vanem
28b96efd8b Remove generated files adig.plg adig.mak from CVS. 2005-11-10 16:38:17 +00:00
Daniel Stenberg
0f82af0f49 * Add step parameter to the globbing. Like [0-1000;10] that would walk the
range increasing the number with 10 for every step. Requested by Jose:
  http://curl.haxx.se/feedback/display.cgi?id=11315662266802
2005-11-09 23:15:04 +00:00
Gisle Vanem
f0d839436f Update with "new" HAVE_xx. 2005-11-09 22:52:45 +00:00
Gisle Vanem
f1aa4b4127 Replace <winsock.h> with <winsock2.h>
since IPv6 support is required.
2005-11-09 22:32:45 +00:00
Gisle Vanem
ccdb43f7f1 Add cvs id. 2005-11-09 22:18:13 +00:00
Gisle Vanem
72900f0f90 Added Makefile.vc6. 2005-11-09 22:17:13 +00:00
Gisle Vanem
3ad958ddb1 I hate MS-devstudio project files. 2005-11-09 22:16:58 +00:00
Gisle Vanem
2c77cc90f4 Updated for MingW. Added inet_ntop.o inet_net_pton.o bitncmp.o.
Added -D'efines'.
2005-11-09 21:51:44 +00:00
Gisle Vanem
db4c33b4fb MSVC fix for 'socklen_t'. Replace <winsock.h> with <winsock2.h> +
<ws2tcpip.h> since IPv6 is no longer optional (was it ever?)
2005-11-09 21:38:58 +00:00
Gisle Vanem
3fb04115fc Fixes for building with MSVC-6/7. Added inet*.c.
Replace <winsock.h> with <winsock2.h> + <ws2tcpip.h>
(ala libcurl since IPv6 is not optional now).
2005-11-09 21:32:47 +00:00
Gisle Vanem
4faaa32aef Fixes for building ahost with MSVC-6/7. Added inet*.c. 2005-11-09 21:29:34 +00:00
Daniel Stenberg
cab59b4c32 Removed the use of AI_CANONNAME in the IPv6-enabled resolver functions since
we really have no use for reverse lookups of the address.

I truly hope these are the last reverse lookups we had lingering in the
code!
2005-11-08 14:45:58 +00:00
Daniel Stenberg
931eff89f5 SSPI-fix and a new mirror 2005-11-08 14:37:15 +00:00
Daniel Stenberg
175335808b Dmitry Bartsevich discovered some issues in compatibilty of SSPI-enabled
version of libcurl with different Windows versions. Current version of
libcurl imports SSPI functions from secur32.dll. However, under Windows NT
4.0 these functions are located in security.dll, under Windows 9x - in
secur32.dll and Windows 2000 and XP contains both these DLLs (security.dll
just forwards calls to secur32.dll).

Dmitry's patch loads proper library dynamically depending on Windows
version. Function InitSecurityInterface() is used to obtain pointers to all
of SSPI function in one structure.
: ----------------------------------------------------------------------
2005-11-08 14:15:34 +00:00
Daniel Stenberg
e00216581e 27. "libcurl built with GNUTLS ignores the SSLCERT option" - Unlike
Curl_ossl_connect(), the Curl_gtls_connect() function does not send the user
  certificate to the peer. In fact, it ignores the conn->data->set.cert field
  completely, it always uses the anonymous credentials. See
  http://curl.haxx.se/bug/view.cgi?id=1348930
2005-11-07 13:54:14 +00:00
Daniel Stenberg
23951ec00c mention the need for a "fake" -u when --negotiate is used 2005-11-07 08:37:08 +00:00
Daniel Stenberg
a8fc5d0f9f CurlPas 2005-11-05 was released: http://curlpas.sf.net/ 2005-11-05 23:39:08 +00:00
Daniel Stenberg
f5e85bab1c oops 2005-11-02 09:38:58 +00:00
Daniel Stenberg
9a44fa83dc Added:
1.9 Where do I buy commercial support for curl?
 1.10 How many are using curl?
 6.7 What are my obligations when using libcurl in my commerical apps?

Edited a few other paragraphs slightly.
2005-11-02 09:34:53 +00:00
Gisle Vanem
6b1e54da62 Use an empty '*mod_name'. 2005-11-01 16:27:27 +00:00
Daniel Stenberg
b91421b107 Vilmos Nebehaj improved libcurl's LDAP abilities:
The LDAP code in libcurl can't handle LDAP servers of LDAPv3 nor binary
attributes in LDAP objects. So, I made a quick patch to address these
problems.

The solution is simple: if we connect to an LDAP server, first try LDAPv3
(which is the preferred protocol as of now) and then fall back to LDAPv2.
In case of binary attributes, we first convert them to base64, just like the
openldap client does. It uses ldap_get_values_len() instead of
ldap_get_values() to be able to retrieve binary attributes correctly. I
defined the necessary LDAP macros in lib/ldap.c to be able to compile
libcurl without the presence of libldap
2005-10-31 08:55:01 +00:00
Daniel Stenberg
43b3954fa5 kill trailing whitespace 2005-10-31 08:47:54 +00:00
Daniel Stenberg
80f2e3f263 test 275 makes a CONNECT through a proxy and then gets two pages from the
same server
2005-10-30 23:15:49 +00:00
Daniel Stenberg
9ea423b4c1 --max-redirs 0 2005-10-29 22:22:18 +00:00
Daniel Stenberg
b259c9c535 re-arranged the win32 section and added a pointer to the INSTALL.devcpp
document
2005-10-29 22:18:58 +00:00
Daniel Stenberg
80f481a5f7 Tom Kyer's DevCpp-Mingw Install & Compilation guide 2005-10-28 21:34:51 +00:00
Daniel Stenberg
115fe1b577 mention brokenness 2005-10-28 12:59:37 +00:00
Daniel Stenberg
06d6ea651e elaborated somewhat in the license chapter 2005-10-28 07:22:45 +00:00
Daniel Stenberg
966fa848a0 Nis Jorgensen filed bug report #1338648
(http://curl.haxx.se/bug/view.cgi?id=1338648) which really is more of a
feature request, but anyway. It pointed out that --max-redirs did not allow
it to be set to 0, which then would return an error code on the first
Location: found. Based on Nis' patch, now libcurl supports CURLOPT_MAXREDIRS
set to 0, or -1 for infinity. Added test case 274 to verify.
2005-10-27 22:05:38 +00:00
Daniel Stenberg
6f8fe67ace tommink[at]post.pl reported in bug report #1337723
(http://curl.haxx.se/bug/view.cgi?id=1337723) that curl could not upload
binary data from stdin on Windows if the data contained control-Z (hex 1a)
since that is treated as end-of-file when read in text mode. Gisle Vanem
pointed out the fix, and I made both -T and --data-binary take advantage of
it.
2005-10-27 21:02:01 +00:00
Daniel Stenberg
d49edc8e09 updates to reflect current status in Debian land, and added some known
differences between OpenSSL and GnuTLS (that is probably a suitable subject
for a separate document...)
2005-10-27 20:51:43 +00:00
Gisle Vanem
3b9c20fe31 Removed dependency on zlib.h. Added dependency for
..\lib\timeval.c.
2005-10-27 12:56:05 +00:00
Gisle Vanem
bd72c5eacf Added option '-zc' puts const data in code-segment.
Added CURL_DISABLE_TFTP; tftp.c doesn't compile as-is.
2005-10-27 12:45:31 +00:00
Daniel Stenberg
9d152a77fd Jaz Fresh pointed out that if you used "-r [number]" as was wrongly described
in the man page, curl would send an invalid HTTP Range: header. The correct
way would be to use "-r [number]-" or even "-r -[number]". Starting now,
curl will warn if this is discovered, and automatically append a dash to the
range before passing it to libcurl.
2005-10-27 12:05:36 +00:00
Daniel Stenberg
33dc28b905 multi IP socket description leak with multi interface 2005-10-25 14:05:21 +00:00
Daniel Stenberg
43ce64dcca added new dutch mirror and removed the "--" separators 2005-10-25 14:04:54 +00:00
Daniel Stenberg
9e0882ba98 close the existing socket when trying next IP, as otherwise we leak one!
bug #1326306
2005-10-25 13:15:11 +00:00
Daniel Stenberg
c890149c8c Dima Barsky reported a problem with GnuTLS-enabled libcurl in bug report
#1334338 (http://curl.haxx.se/bug/view.cgi?id=1334338). When reading an SSL
  stream from a server and the server requests a "rehandshake", the current
  code simply returns this as an error. I have no good way to test this, but
  I've added a crude attempt of dealing with this situation slightly better -
  it makes a blocking handshake if this happens. Done like this because fixing
  this the "proper" way (that would handshake asynchronously) will require
  quite some work and I really need a good way to test this to do such a
  change.
2005-10-22 21:05:07 +00:00
Daniel Stenberg
1a1ab2e2e8 "Ofer" reported a problem when libcurl re-used a connection and failed to do
it, it could then accidentally actually crash. Presumably, this concerns FTP
connections.  http://curl.haxx.se/bug/view.cgi?id=1330310
2005-10-21 21:00:44 +00:00
Daniel Stenberg
715b706caa Temprimus improved the MSVC makefile so that the static debug SSL libs are
linked to the executable and not to the libcurld.lib
http://curl.haxx.se/bug/view.cgi?id=1326676
2005-10-21 19:32:12 +00:00
Daniel Stenberg
bfa9c42c25 Bradford Bruce made the windows resolver code properly return
CURLE_COULDNT_RESOLVE_PROXY and CURLE_COULDNT_RESOLVE_HOST on resolving
errors (as documented).
2005-10-21 19:21:19 +00:00
Daniel Stenberg
9d98f97e1b shorted and unified language in the --help output 2005-10-20 21:19:19 +00:00
Daniel Stenberg
5eb5ce6ff3 2 gone, 2 added, 1 moved, 1 changed name 2005-10-20 21:01:51 +00:00
Daniel Stenberg
be9c873a6e Dave Dribin made libcurl understand and handle cases when the server
(wrongly) sends *two* WWW-Authenticate headers for Digest. While this should
never happen in a sane world, libcurl previously got into an infinite loop
when this occurred. Dave added test 273 to verify this.
2005-10-20 20:07:32 +00:00
Daniel Stenberg
034d80f6cd 2 mirrors, 1 binding release 2005-10-20 19:40:30 +00:00
Daniel Stenberg
021e786c71 Added a dump_addrinfo() function to ease debugging of resolved names. Define
DEBUG_ADDRINFO to enable.
2005-10-20 19:40:02 +00:00
Daniel Stenberg
0c6bb8cb66 Temprimus improved the MSVC makefile: "makes a build option available so if
you set rtlibcfg=static for the make, then it would build with /MT. The
default behaviour is /MD (the original)."
http://curl.haxx.se/bug/view.cgi?id=1326665
2005-10-20 19:07:33 +00:00
Dan Fandrich
4d7f08a99e Removed mention of TFTP now that it's implemented. 2005-10-18 18:15:01 +00:00
Daniel Stenberg
fdef584681 Mohun Biswas' suggested change to prevent GNU indent to warn on the =-1 line. 2005-10-18 07:26:43 +00:00
Daniel Stenberg
f335bac8a3 Reverted the LIBCURL_VERSION_NUM change from October 6. As Dave Dribin
reported, the define is used by the configure script and is assumed to use
the 0xYYXXZZ format. This made "curl-config --vernum" fail in the 7.15.0
release version.
2005-10-14 21:21:51 +00:00
Daniel Stenberg
51369753bb Reported by 'TemPRImus' in bug 1326665: use the "Multi-Threaded" options even
when building the static library. http://curl.haxx.se/bug/view.cgi?id=1326665
2005-10-14 13:22:49 +00:00
Daniel Stenberg
82a4c2bce3 Slight editing of wording in the CURLOPT_SSL_VERIFYHOST section. 2005-10-13 21:49:28 +00:00
Daniel Stenberg
e73c6e039e start working on 7.15.1 2005-10-13 09:23:51 +00:00
Daniel Stenberg
19bad0844f added names from the 7.15.0 release 2005-10-13 09:22:31 +00:00
Daniel Stenberg
96cec4dfd7 7.15.0 time 2005-10-13 08:19:09 +00:00
Daniel Stenberg
943aea6267 Make sure that the user and domain strings fit in the target buffer before we
copy them there.
2005-10-13 07:57:51 +00:00
Daniel Stenberg
b433e4a1e7 NTLM requires windows or OpenSSL. If you build with GnuTLS for example you
do not get NTLM support enabled.
2005-10-13 06:20:43 +00:00
Daniel Stenberg
20f1966c0e 7.15.0 in november? 2005-10-11 12:54:44 +00:00
Daniel Stenberg
ab1f5c3edd make it compile warning-free and free() the memory before exit 2005-10-10 20:58:18 +00:00
Daniel Stenberg
b2be6799f2 pass a NULL pointer in the service argument (the second) if the port number
was 0 as it seems at least some AIX versions don't like a "0" string there
2005-10-10 18:28:05 +00:00
Gisle Vanem
ea2618fc6f Added tftp.obj. 2005-10-06 18:47:05 +00:00
Daniel Stenberg
62fdf8eaed we all the next version 7.15.0 due to the new TFTP support 2005-10-06 12:56:13 +00:00
Daniel Stenberg
d3569a3572 remove getinfo-times from the dist archive since the info is now in the
curl_easy_getinfo man page
2005-10-06 09:05:08 +00:00
Daniel Stenberg
89df76e449 end the .nf section, mark the option names properly so that they end up
as links in the html version
2005-10-06 09:03:36 +00:00
Daniel Stenberg
e5b2f33b4f Added the info from getinfo-times as it really belongs in this man page. 2005-10-06 08:58:44 +00:00
Daniel Stenberg
934d312f50 mention the recent fixes 2005-10-05 09:15:20 +00:00
Daniel Stenberg
68917eb517 added test case 272 for -z download over FTP when the timestamp is identical
to the remote one
2005-10-05 06:23:45 +00:00
Daniel Stenberg
3beb2f6b5d CURL_TIMECOND_IFMODSINCE actually requires that the remote document has been
modded since the given time, so we should compare <= and not just <.
2005-10-05 06:09:20 +00:00
Daniel Stenberg
b29017f15b Domenico Andreoli's patch that removes a few 0xa0(!) bytes 2005-10-04 20:32:17 +00:00
Daniel Stenberg
db83a0ebbc Michael Wallner reported that the date parser had wrong offset stored for
the MEST and CEST time zones.
2005-10-04 18:15:33 +00:00
Daniel Stenberg
6d9fddb95d Domenico Andreoli's SEE ALSO patch 2005-10-04 10:58:14 +00:00
Daniel Stenberg
4284190cc4 Ok, based on the online docs for AIX'es getservbyport_r() I adjusted to code
to do (what I believe is) "right". See docs on:
http://publib.boulder.ibm.com/infocenter/pseries/index.jsp?topic=/com.ibm.aix.doc/libs/commtrf2/getservbyport_r.htm
2005-10-03 10:12:06 +00:00
Daniel Stenberg
5e4cbd2d24 recent action 2005-10-03 08:38:07 +00:00
Gisle Vanem
06c3bec65d Avoid gcc warning "dereferencing type-punned pointer
will break strict-aliasing rules".
2005-10-02 18:22:45 +00:00
Gisle Vanem
e8c3bb45ba Fix for building with MS Visual-C and single-threaded
runtime libs.
2005-10-02 16:52:07 +00:00
Daniel Stenberg
4ec55a964d fixed the proper path to the tftpd server 2005-09-30 14:25:50 +00:00
Daniel Stenberg
b9420864c0 a new mirror, but we don't increase the amount since one of the former ones
are now officially no longer considered a mirror... ;-)
2005-09-30 08:59:33 +00:00
Daniel Stenberg
bf6588b6a7 Update in the "which license is best" section as it seems Debian people have
made up their mind. Spell-checked as well.
2005-09-30 08:34:51 +00:00
Daniel Stenberg
e43217e664 Starting now, the verbose text that goes like "About to connect() to" will
now contain the word "proxy" is the hostname is in fact a proxy. This will
help users detect situations when they mistakenly use a proxy.
2005-09-29 11:37:52 +00:00
Daniel Stenberg
e19ee2d102 David Yan brought the Content-Range report 2005-09-27 20:22:13 +00:00
Daniel Stenberg
b4c53e2cfd An anonymous submitter filed bug #1299181
(http://curl.haxx.se/bug/view.cgi?id=1299181) that identified a silly problem
with Content-Range: headers with the 'bytes' keyword written in a different
case than all lowercase! It would cause a segfault!
2005-09-27 09:13:39 +00:00
Daniel Stenberg
a2902de67c TJ Saunders of the proftpd project identified and pointed out problems with
the modified FTPS negotiation change of August 19 2005. Thus, we revert the
change back to pre-7.14.1 status.
2005-09-27 08:46:54 +00:00
Daniel Stenberg
da192f7955 clarify what the default read callback does and how it uses the READDATA
option
2005-09-22 10:15:10 +00:00
Daniel Stenberg
a2210d23c3 three debian bug reports addressed 2005-09-21 11:29:03 +00:00
Daniel Stenberg
bd5a622400 stricter type usage for time variables to avoid picky compiler warnings 2005-09-21 11:28:40 +00:00
Daniel Stenberg
b9494cb0d6 1 - attempted fix of uninitialized variable
2 - indented and edited to fit better within 80 columns
3 - fixed possible buffer overflow in the service name lookup function
2005-09-21 10:45:25 +00:00
Daniel Stenberg
0f73af4470 simplified the sin6_scope_id test and removed some left-overs from the previous
way of detecting it
2005-09-21 09:10:17 +00:00
Daniel Stenberg
45e26b5c02 fixed the check for the addrinfo struct 2005-09-21 09:01:44 +00:00
Daniel Stenberg
6af5ea38ce clarified ERRORBUFFER - some errors just don't write a string even though
they should. And I removed all uses 'Note' (as they are pretty useless) and
did some other language and phrasing cleanups.
2005-09-21 06:59:01 +00:00
Daniel Stenberg
b6f0aa4394 return an error string for the missing URL case 2005-09-21 06:38:33 +00:00
Daniel Stenberg
774dab58f6 mention what WRITEFUNCTION and WRITEDATA do by default 2005-09-21 06:12:41 +00:00
Daniel Stenberg
e3bdb98f7a oops, broken sentence fixed:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=329305
2005-09-21 06:07:41 +00:00
Daniel Stenberg
58d628c9f8 Uses __stdcall instead of SEC_ENTRY since it seems (at least) mingw doesn't
define SEC_ENTRY and thus fails unless this is done!
2005-09-20 08:29:56 +00:00
Daniel Stenberg
1e69394545 Since newer ares versions should work with ipv6, I modified the error message
to a warning message as a first step. We should persue to make curl use
c-ares properly even when built with ipv6 support.
2005-09-20 07:53:44 +00:00
Daniel Stenberg
1cf798ad14 typecasts added in an attempt to please the picky compilers 2005-09-20 06:51:23 +00:00
Daniel Stenberg
da3992d2e9 added test 271 2005-09-19 22:04:14 +00:00
Daniel Stenberg
48908e4633 test 271, the first ever TFTP test 2005-09-19 22:04:06 +00:00
Daniel Stenberg
f5ae149338 seems to work for test 271 on Linux now! 2005-09-19 22:03:16 +00:00
Daniel Stenberg
3fe5311967 Dmitry Bartsevich made the SSPI support work on Windows 9x as well 2005-09-19 21:45:16 +00:00
Dominick Meglio
6a48639c68 Added constants that will be used by ares_getaddrinfo. Made ares_getnameinfo use the reentrant getservbyport (getservbyport_r) if it isavailable to ensure it works properly in a threaded environment 2005-09-18 16:44:49 +00:00
Daniel Stenberg
e7093b3ca8 keep 'socktype' in the connectdata struct and make sure we use that for all
protocol sockets even if the resolved address may say otherwise
2005-09-16 21:30:08 +00:00
Daniel Stenberg
d0a4104c0c recent changes 2005-09-16 21:03:26 +00:00
Daniel Stenberg
90559bed53 renamed sendfile() since some systems have a system call named like this -
now the functions are named sendtftp() and recvtftp() instead.
2005-09-16 10:52:38 +00:00
Daniel Stenberg
973a18cf03 In the Solaris 7 header files for tftp, the th_stuff struct member is an
unsigned short. Trying a typecast here to fix.
2005-09-16 10:50:43 +00:00
Daniel Stenberg
3c666ce57a prevent warnings on re-defining MIN 2005-09-16 07:19:54 +00:00
Daniel Stenberg
a1287ec64f added URLs to bug reports 2005-09-16 07:18:25 +00:00
Daniel Stenberg
5fbfa1bfa8 Added known bugs #26, started using my new "bounce URL" that jumps to the
correct (and overly complicated) sourceforge bug tracker URL given the bug
report ID number.
2005-09-16 07:09:07 +00:00
Daniel Stenberg
da3ecc91f8 use int "subscripts" to prevent warnings from picky compilers 2005-09-16 06:14:30 +00:00
Daniel Stenberg
09c8f558f7 use internal *printf() clones 2005-09-16 05:49:53 +00:00
Daniel Stenberg
528a149def ifdef for includes, added checking for two not previously checked files (one
being necessary for solaris builds)
2005-09-15 21:50:50 +00:00
Daniel Stenberg
29e36afb6b use make -k when running the tests 2005-09-15 21:49:26 +00:00
Daniel Stenberg
0e39543d35 ignore this too 2005-09-15 20:36:58 +00:00
Daniel Stenberg
0de20d8ee6 build tftpd too! 2005-09-15 20:36:28 +00:00
Daniel Stenberg
cd5de5c0e5 First version of the TFTP server. Basic functionality is there. 2005-09-15 20:32:59 +00:00
Daniel Stenberg
bd5afc26bd added TFTP and TFTP-ipv6 support 2005-09-15 20:25:02 +00:00
Daniel Stenberg
9542dfdcdc moved test2file() to util.c 2005-09-15 20:22:43 +00:00
Daniel Stenberg
97a6d7b1a8 minor changes, the biggest one being using Curl_select() 2005-09-15 20:21:27 +00:00
Daniel Stenberg
209b9d4374 mention the configure change 2005-09-15 19:23:31 +00:00
Daniel Stenberg
0b8ccd0ae7 oops, return error if an error did occur! 2005-09-14 15:04:01 +00:00
Daniel Stenberg
0b7f5ad508 CURLOPT_BUFFERSIZE clarification 2005-09-12 20:36:17 +00:00
Daniel Stenberg
8a38805e82 Use the AC_CHECK_MEMBER() function for check struct members instead of
inventing and providing our own. Hopefully this solves a HP-UX 11.00 problem.
2005-09-10 21:09:44 +00:00
Daniel Stenberg
836d88a4b8 --max-time should work just as good on win32 these days 2005-09-08 20:21:52 +00:00
Daniel Stenberg
d5268ed511 mention the protocol-guessing when no protocol part is given in the URL
added TFTP to the list of supported protocols
2005-09-08 06:16:46 +00:00
Daniel Stenberg
0e7d93858d added tftp.c 2005-09-07 14:42:15 +00:00
Daniel Stenberg
2164d760b7 Ben Madsen reported a problem that only seemed to occur with certain specific
glibc versions, and with this patch applied it no longer shows up to me. The
problem was indeed a flaw that made curl use a file handle already closed.
2005-09-07 11:05:34 +00:00
Daniel Stenberg
b9c8de598b Thanks to Scott Davis' detailed reports, I found this premature detection
of the end of a chunked-encoded POST request.
2005-09-07 10:51:37 +00:00
Gisle Vanem
9889a811db Fix warning about missing initializers. 2005-09-06 15:58:09 +00:00
Gisle Vanem
9e38d882b9 Fix for bind() on Winsock; AF_UNSPEC (0) is illegal.
Should we do this for all targets?
2005-09-06 15:43:14 +00:00
Daniel Stenberg
e8635044b5 Now curl warns if an unknown variable is used in the -w/--writeout argument. 2005-09-06 13:27:18 +00:00
Daniel Stenberg
56dea0ac9a binding updates 2005-09-06 11:53:24 +00:00
Daniel Stenberg
e8b77477c7 sockets are curl_socket_t to build cleaner 2005-09-06 10:39:01 +00:00
Daniel Stenberg
64298e528d Use SOCK_DGRAM for TFTP. Consider setting this up at one central place, we
have this check done on far too many places by now...
2005-09-06 10:37:57 +00:00
Gunter Knauf
4f1465e7c7 minor Makefile fixes. 2005-09-06 00:39:41 +00:00
Daniel Stenberg
6120041b69 Added the people from the 7.14.1 release announcement. 2005-09-05 14:22:01 +00:00
Daniel Stenberg
8c1213627d new release, work has been "initiated" 2005-09-05 06:03:06 +00:00
Daniel Stenberg
3e6ae6eeb8 mention the recent improvements 2005-09-04 22:10:03 +00:00
Daniel Stenberg
291e9aeabd don't start lines with apostrophes! 2005-09-04 21:53:10 +00:00
Daniel Stenberg
a3d776187a check that bind() returns success 2005-09-04 18:33:20 +00:00
Daniel Stenberg
e55f502e2f --protocols now supports TFTP 2005-09-04 18:15:24 +00:00
Daniel Stenberg
e369270f88 7.14.2 actually 2005-09-04 05:23:08 +00:00
Daniel Stenberg
7e845e7cfd Added FTP_SKIP_PASV_IP and --ftp-skip-pasv-ip 2005-09-04 05:16:06 +00:00
Daniel Stenberg
56d9624b56 John Kelly added TFTP support to libcurl. A bunch of new error codes was
added. TODO: add them to docs. add TFTP server to test suite. add TFTP to
list of protocols whereever those are mentioned.
2005-09-02 15:11:08 +00:00
Daniel Stenberg
911d135deb explain why the ABI depends on the SSL libs 2005-09-02 13:40:07 +00:00
Daniel Stenberg
8107b90678 use -c to automake to copy the new files 2005-09-01 21:41:35 +00:00
Daniel Stenberg
7722452b98 work on 7.14.2 starts now 2005-09-01 21:08:56 +00:00
129 changed files with 6301 additions and 2767 deletions

View File

@@ -12,3 +12,4 @@ depcomp
config.guess
config.sub
ltmain.sh
libcurl.pc

337
CHANGES
View File

@@ -7,6 +7,303 @@
Changelog
Version 7.15.1 (7 December 2005)
Daniel (6 December 2005)
- Full text here: http://curl.haxx.se/docs/adv_20051207.html Pointed out by
Stefan Esser.
VULNERABILITY
libcurl's URL parser function can overflow a malloced buffer in two ways, if
given a too long URL.
These overflows happen if you
1 - pass in a URL with no protocol (like "http://") prefix, using no slash
and the string is 256 bytes or longer. This leads to a single zero byte
overflow of the malloced buffer.
2 - pass in a URL with only a question mark as separator (no slash) between
the host and the query part of the URL. This leads to a single zero byte
overflow of the malloced buffer.
Both overflows can be made with the same input string, leading to two single
zero byte overwrites.
The affected flaw cannot be triggered by a redirect, but the long URL must
be passed in "directly" to libcurl. It makes this a "local" problem. Of
course, lots of programs may still pass in user-provided URLs to libcurl
without doing much syntax checking of their own, allowing a user to exploit
this vulnerability.
There is no known exploit at the time of this writing.
Daniel (2 December 2005)
- Jamie Newton pointed out that libcurl's file:// code would close() a zero
file descriptor if given a non-existing file.
Daniel (24 November 2005)
- Doug Kaufman provided a set of patches to make curl build fine on DJGPP
again using configure.
- Yang Tse provided a whole series of patches to clear up compiler warnings on
MSVC 6.
Daniel (17 November 2005)
- I extended a patch from David Shaw to make libcurl _always_ provide an error
string in the given error buffer to address the flaw mention on 21 sep 2005.
Daniel (16 November 2005)
- Applied Albert Chin's patch that makes the libcurl.pc pkgconfig file get
installed on 'make install' time.
Daniel (14 November 2005)
- Quagmire reported that he needed to raise a NTLM buffer for SSPI to work
properly for a case, and so we did. We raised it even for non-SSPI builds
but it should not do any harm. http://curl.haxx.se/bug/view.cgi?id=1356715
- Jan Kunder's debian bug report
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=338680 identified a weird
error message for when you try to upload a file and the requested directory
doesn't exist on the target server.
- Yang Tse fixed compiler warnings in lib/ssluse.c with OpenSSL 0.9.8 and in
lib/memdebug.h that showed up in his msvc builds.
Daniel (13 November 2005)
- Debian bug report 338681 by Jan Kunder: make curl better detect and report
bad limit-rate units:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=338681 Now curl will return
error if a bad unit is used.
- Thanks to this nice summary of poll() implementations:
http://www.greenend.org.uk/rjk/2001/06/poll.html and further tests by Eugene
Kotlyarov, we now know that cygwin's poll returns only POLLHUP on remote
connectin closure so we check for that case (too) and re-enable poll for
cygwin builds.
Daniel (12 November 2005)
- Eugene Kotlyarov found out that cygwin's poll() function isn't doing things
right: http://curl.haxx.se/mail/archive-2005-11/0045.html so we now disable
poll() and use select() on cygwin too (we already do the same choice on Mac
OS X)
- Dima Barsky patched problem #1348930: the GnuTLS code completely ignored
client certificates! (http://curl.haxx.se/bug/view.cgi?id=1348930).
Daniel (10 November 2005)
- David Lang fixed IPv6 support for TFTP!
- Introducing range stepping to the curl globbing support. Now you can specify
step counter by adding :[num] within the brackets when specifying a range:
[1-100:10]
[a-z:2]
If no step counter is set, it defaults to 1 as before:
[1-100]
[d-h]
Daniel (8 November 2005)
- Removed the use of AI_CANONNAME in the IPv6-enabled resolver functions since
we really have no use for reverse lookups of the address.
I truly hope these are the last reverse lookups we had lingering in the
code!
- Dmitry Bartsevich discovered some issues in compatibilty of SSPI-enabled
version of libcurl with different Windows versions. Current version of
libcurl imports SSPI functions from secur32.dll. However, under Windows NT
4.0 these functions are located in security.dll, under Windows 9x - in
secur32.dll and Windows 2000 and XP contains both these DLLs (security.dll
just forwards calls to secur32.dll).
Dmitry's patch loads proper library dynamically depending on Windows
version. Function InitSecurityInterface() is used to obtain pointers to all
of SSPI function in one structure.
Daniel (31 October 2005)
- Vilmos Nebehaj improved libcurl's LDAP abilities:
The LDAP code in libcurl can't handle LDAP servers of LDAPv3 nor binary
attributes in LDAP objects. So, I made a quick patch to address these
problems.
The solution is simple: if we connect to an LDAP server, first try LDAPv3
(which is the preferred protocol as of now) and then fall back to LDAPv2.
In case of binary attributes, we first convert them to base64, just like the
openldap client does. It uses ldap_get_values_len() instead of
ldap_get_values() to be able to retrieve binary attributes correctly. I
defined the necessary LDAP macros in lib/ldap.c to be able to compile
libcurl without the presence of libldap
Daniel (27 October 2005)
- Nis Jorgensen filed bug report #1338648
(http://curl.haxx.se/bug/view.cgi?id=1338648) which really is more of a
feature request, but anyway. It pointed out that --max-redirs did not allow
it to be set to 0, which then would return an error code on the first
Location: found. Based on Nis' patch, now libcurl supports CURLOPT_MAXREDIRS
set to 0, or -1 for infinity. Added test case 274 to verify.
- tommink[at]post.pl reported in bug report #1337723
(http://curl.haxx.se/bug/view.cgi?id=1337723) that curl could not upload
binary data from stdin on Windows if the data contained control-Z (hex 1a)
since that is treated as end-of-file when read in text mode. Gisle Vanem
pointed out the fix, and I made both -T and --data-binary take advantage of
it.
- Jaz Fresh pointed out that if you used "-r [number]" as was wrongly described
in the man page, curl would send an invalid HTTP Range: header. The correct
way would be to use "-r [number]-" or even "-r -[number]". Starting now,
curl will warn if this is discovered, and automatically append a dash to the
range before passing it to libcurl.
Daniel (25 October 2005)
- Amol Pattekar reported a bug with great detail and a fine example in bug
#1326306 (http://curl.haxx.se/bug/view.cgi?id=1326306). When using the multi
interface and connecting to a host with multiple IP addresses, and one of
the addresses fails to connect (the server must exist and respond, just not
accept connections) libcurl leaks a socket descriptor. Thanks to the fine
report, I could find and fix this.
Daniel (22 October 2005)
- Dima Barsky reported a problem with GnuTLS-enabled libcurl in bug report
#1334338 (http://curl.haxx.se/bug/view.cgi?id=1334338). When reading an SSL
stream from a server and the server requests a "rehandshake", the current
code simply returns this as an error. I have no good way to test this, but
I've added a crude attempt of dealing with this situation slightly better -
it makes a blocking handshake if this happens. Done like this because fixing
this the "proper" way (that would handshake asynchronously) will require
quite some work and I really need a good way to test this to do such a
change.
Daniel (21 October 2005)
- "Ofer" reported a problem when libcurl re-used a connection and failed to do
it, it could then accidentally actually crash. Presumably, this concerns FTP
connections. http://curl.haxx.se/bug/view.cgi?id=1330310
- Temprimus improved the MSVC makefile so that the static debug SSL libs are
linked to the executable and not to the libcurld.lib
http://curl.haxx.se/bug/view.cgi?id=1326676
- Bradford Bruce made the windows resolver code properly return
CURLE_COULDNT_RESOLVE_PROXY and CURLE_COULDNT_RESOLVE_HOST on resolving
errors (as documented).
Daniel (20 October 2005)
- Dave Dribin made libcurl understand and handle cases when the server
(wrongly) sends *two* WWW-Authenticate headers for Digest. While this should
never happen in a sane world, libcurl previously got into an infinite loop
when this occurred. Dave added test 273 to verify this.
- Temprimus improved the MSVC makefile: "makes a build option available so if
you set rtlibcfg=static for the make, then it would build with /MT. The
default behaviour is /MD (the original)."
http://curl.haxx.se/bug/view.cgi?id=1326665
Daniel (14 October 2005)
- Reverted the LIBCURL_VERSION_NUM change from October 6. As Dave Dribin
reported, the define is used by the configure script and is assumed to use
the 0xYYXXZZ format. This made "curl-config --vernum" fail in the 7.15.0
release version.
Version 7.15.0 (13 October 2005)
Daniel (12 October 2005)
- Michael Sutton of iDEFENSE reported and I fixed a securitfy flaw in the NTLM
code that would overflow a buffer if given a too long user name or domain
name. This would happen if you enable NTLM authentication and either
A - pass in a user name and domain name to libcurl that together are longer
than 192 bytes
B - allow (lib)curl to follow HTTP "redirects" (Location: and the
appropriate HTTP 30x response code) and the new URL contains a URL with
a user name and domain name that together are longer than 192 bytes
See http://curl.haxx.se/docs/security.html for further details and updates
Daniel (5 October 2005)
- Darryl House reported a problem with using -z to download files from FTP.
It turned out that if the given time stamp was exact the same as the remote
time stamp, the file would still wrongly be downloaded. Added test case 272
to verify.
Daniel (4 October 2005)
- Domenico Andreoli fixed a man page malformat and removed odd (0xa0) bytes
from the configure script.
- Michael Wallner reported that the date parser had wrong offset stored for
the MEST and CEST time zones.
Daniel (27 September 2005)
- David Yan filed bug #1299181 (http://curl.haxx.se/bug/view.cgi?id=1299181)
that identified a silly problem with Content-Range: headers with the 'bytes'
keyword written in a different case than all lowercase! It would cause a
segfault!
- TJ Saunders of the proftpd project identified and pointed out problems with
the modified FTPS negotiation change of August 19 2005. Thus, we revert the
change back to pre-7.14.1 status.
Daniel (21 September 2005)
- Fixed "cut off" sentence in the libcurl-tutorial man page:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=329305
- Clarified in the curl_easy_setopt man page what the default
CURLOPT_WRITEFUNCTION and CURLOPT_WRITEDATA mean:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=329311
- Clarified in the curl_easy_setopt man page that CURLOPT_ERRORBUFFER
sometimes doesn't fill in the buffer even though it is supposed to:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=329313
- When CURLE_URL_MALFORMAT is returned due to a missing URL, it now has an
error string set.
Daniel (19 September 2005)
- Dmitry Bartsevich made the SSPI support work on Windows 9x as well.
Daniel (15 September 2005)
- Added a TFTP server to the test suite and made the test suite capable of
using it.
Daniel (7 September 2005)
- Ben Madsen's detailed reports that funnily enough only occurred with certain
glibc versions turned out to be curl using an already closed file handle
during certain conditions (like when saving FTP server "headers").
- Scott Davis helped me track down a problem in the test HTTP server that made
test case 56 wrongly fail at times. It turned out it was due to the server
finding the end of a chunked-encoded POST too early.
Daniel (6 September 2005)
- Now curl warns if an unknown variable is used in the -w/--writeout argument.
Daniel (4 September 2005)
- I applied Nicolas Fran<61>ois' man page patch he posted to the Debian bug
tracker. It corrected two lines that started with apostrophes, which isn't
legal nroff format. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=326511
- Added --ftp-skip-pasv-ip to the command line tool, that sets the new
CURLOPT_FTP_SKIP_PASV_IP option. It makes libcurl re-use the control
connection's IP address when setting up the data connection instead of
extractting the IP address from the PASV response. It has turned out this
feature is frequently needed by people to circumvent silly servers and silly
firewalls, especially when FTPS is used and the PASV command-response is
sent encrtyped.
Sponsored by CU*Answers
Daniel (1 September 2005)
- John Kelly added TFTP support to libcurl. A bunch of new error codes was
added. TODO: add them to docs. add TFTP server to test suite. add TFTP to
list of protocols whereever those are mentioned.
Version 7.14.1 (1 September 2005)
Daniel (29 August 2005)
@@ -93,10 +390,11 @@ Daniel (9 August 2005)
zone names thus limiting the effect of this bug.
Daniel (8 August 2005)
- Jon Grubbs filed bug report #1249962 which identified a problem with NTLM on
a HTTP proxy if an FTP URL was given. libcurl now properly switches to pure
HTTP internally when an HTTP proxy is used, even for FTP URLs. The problem
would also occur with other multi-pass auth methods.
- Jon Grubbs filed bug report #1249962
(http://curl.haxx.se/bug/view.cgi?id=1249962) which identified a problem
with NTLM on a HTTP proxy if an FTP URL was given. libcurl now properly
switches to pure HTTP internally when an HTTP proxy is used, even for FTP
URLs. The problem would also occur with other multi-pass auth methods.
Daniel (7 August 2005)
- When curl is built with GnuTLS, curl-config didn't include "SSL" when
@@ -125,11 +423,11 @@ Daniel (12 July 2005)
contains a flawed chunked encoding stream that still works the same.
Daniel (5 July 2005)
- Gisle Vanem came up with a nice little work-around for bug #1230118. It
seems the Windows (MSVC) libc time functions may return data one hour off if
TZ is not set and automatic DST adjustment is enabled. This made
curl_getdate() return wrong value, and it also concerned internal cookie
expirations etc.
- Gisle Vanem came up with a nice little work-around for bug #1230118
(http://curl.haxx.se/bug/view.cgi?id=1230118). It seems the Windows (MSVC)
libc time functions may return data one hour off if TZ is not set and
automatic DST adjustment is enabled. This made curl_getdate() return wrong
value, and it also concerned internal cookie expirations etc.
Daniel (4 July 2005)
- Andrew Bushnell provided enough info for me to tell that we badly needed to
@@ -165,8 +463,9 @@ Daniel (22 June 2005)
- David Shaw updated libcurl.m4
Daniel (14 June 2005)
- Gisle Vanem fixed a potential thread handle leak. Bug report #1216500.
Comment in http://curl.haxx.se/mail/lib-2005-06/0059.html
- Gisle Vanem fixed a potential thread handle leak. Bug report #1216500
(http://curl.haxx.se/bug/view.cgi?id=1216500). Comment in
http://curl.haxx.se/mail/lib-2005-06/0059.html
Daniel (13 June 2005)
- Made buildconf run libtoolize in the ares dir too (inspired by Tupone's
@@ -202,7 +501,7 @@ Daniel (3 June 2005)
Daniel (1 June 2005)
- The configure check for c-ares now adds the cares lib before the other libs,
to make it build fine with mingw. Inspired by Tupone Alfredo's bug report
(and patch) #1212940
and patch: http://curl.haxx.se/bug/view.cgi?id=1212940
Daniel (31 May 2005)
- Todd Kulesza reported a flaw in the proxy option, since a numerical IPv6
@@ -214,7 +513,7 @@ Daniel (30 May 2005)
- Eric Cooper reported about a problem with HTTP servers that responds with
binary zeroes within the headers. They confused libcurl to do wrong so the
downloaded headers become incomplete. The fix is now verified with test case
262.
262. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=310948
Daniel (25 May 2005)
- Fixed problems with the test suite, and in particular the FTP test cases
@@ -236,9 +535,10 @@ Daniel (20 May 2005)
docs.
Daniel (18 May 2005)
- John McGowan identified a problem in bug report #1204435 with malformed URLs
like "http://somehost?data" as it added a slash too much in the request
("GET /?data/"...). Added test case 260 to verify.
- John McGowan identified a problem in bug report #1204435
(http://curl.haxx.se/bug/view.cgi?id=1204435) with malformed URLs like
"http://somehost?data" as it added a slash too much in the request ("GET
/?data/"...). Added test case 260 to verify.
- The configure check for strerror_r() failed to detect the proper API at
times, like on HP-UX 10.20. Then lib/strerror.c badly assumed the glibc
@@ -261,8 +561,9 @@ Daniel (12 May 2005)
- When doing a second request (after a disconnect) using the same easy handle,
over a proxy that uses NTLM authentication, libcurl failed to use NTLM again
properly (the auth method was accidentally reset to the same as had been set
for host auth, which defaults to Basic). Bug report #1200661 identified the
the problem and the fix.
for host auth, which defaults to Basic). Bug report #1200661
(http://curl.haxx.se/bug/view.cgi?id=1200661) identified the the problem and
the fix.
- If -z/--time-cond is used with an invalid date syntax, this is no longer
silently discarded. Instead a proper warning message is diplayed that

View File

@@ -31,6 +31,9 @@ bin_SCRIPTS = curl-config
SUBDIRS = lib src
DIST_SUBDIRS = $(SUBDIRS) tests include packages docs
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libcurl.pc
dist-hook:
rm -rf $(top_builddir)/tests/log
find $(distdir) -name "*.dist" -exec rm {} \;

52
README
View File

@@ -32,31 +32,33 @@ WEB SITE
Visit the curl web site or mirrors for the latest news and downloads:
Sweden -- http://curl.haxx.se/
Australia -- http://curl.planetmirror.com/
Austria -- http://curl.gds.tuwien.ac.at/
Canada -- http://curl.meulie.net/
Denmark -- http://curl.cofman.dk/
Estonia -- http://curl.wildyou.net/
France -- http://curl.mirror.internet.tp/
Germany -- http://curl.miscellaneousmirror.org/
Germany -- http://curl.mirror.at.stealer.net/
Germany -- http://curl.mirroring.de/
Germany -- http://curl.mons-new-media.de/
Germany -- http://curl.netmirror.org/
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.mirror.redwire.net/
US (CA) -- http://curl.mirrormonster.com/
US (CA) -- http://curl.signal42.com/
US (CA) -- http://curl.tolix.org/
US (CA) -- http://curl.webhosting76.com/
US (TX) -- http://curl.109k.com/
US (TX) -- http://curl.mirrors.cyberservers.net/
US (TX) -- http://curl.seekmeup.com/
US (TX) -- http://curl.hostingzero.com/
Sweden http://curl.haxx.se/
Australia http://curl.planetmirror.com/
Austria http://curl.gds.tuwien.ac.at/
Denmark http://curl.cofman.dk/
France http://curl.fastmirror.net/
Germany http://curl.miscellaneousmirror.org/
Germany http://curl.mirror.at.stealer.net/
Germany http://curl.mirroring.de/
Germany http://curl.mons-new-media.de/
Germany http://curl.triplemind.com/
Germany http://curl.freemirror.de/
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.mirror.redwire.net/
US (CA) http://curl.mirrormonster.com/
US (CA) http://curl.signal42.com/
US (CA) http://curl.tolix.org/
US (CA) http://curl.webhosting76.com/
US (CA) http://curl.meulie.net/
US (FL) http://curl.hoxt.com/
US (TX) http://curl.109k.com/
US (TX) http://curl.mirrors.cyberservers.net/
US (TX) http://curl.seekmeup.com/
US (TX) http://curl.hostingzero.com/
CVS

View File

@@ -1,74 +1,61 @@
Curl and libcurl 7.14.1
Curl and libcurl 7.15.1
Public curl release number: 89
Releases counted from the very beginning: 116
Available command line options: 108
Available curl_easy_setopt() options: 123
Public curl release number: 91
Releases counted from the very beginning: 118
Available command line options: 109
Available curl_easy_setopt() options: 125
Number of public functions in libcurl: 46
Amount of public web site mirrors: 25
Number of known libcurl bindings: 31
Number of contributors: 447
Amount of public web site mirrors: 27
Number of known libcurl bindings: 32
Number of contributors: 459
This release includes the following changes:
o GNU GSS support
o --ignore-content-length and CURLOPT_IGNORE_CONTENT_LENGTH added
o negotiates data connection SSL earlier when doing FTPS with PASV
o CURLOPT_COOKIELIST and CURLINFO_COOKIELIST
o trailer support for chunked encoded data streams
o -x/CURL_PROXY strings may now contain user+password
o --trace-time now outputs the full microsecond, all 6 digits
o the libcurl.pc pkgconfig file now gets installed on make install
o URL globbing now offers "range steps": [1-100:10]
o LDAPv3 is now the preferred LDAP protocol version
o --max-redirs and CURLOPT_MAXREDIRS set to 0 limits redirects
o improved MSVC makefile
This release includes the following bugfixes:
o MSVC build problem with the DSP file
o windows threaded resolver access violation with multi interface
o test suite works with valgrind 3
o CA cert verification with GnuTLS builds
o handles expiry times in cookie files that go beyond 32 bits in size
o several client problems with files, such as doing -d @file when the file
isn't readable now gets a warning displayed
o write callback abort didn't always "take"
o the curl -z "bad syntax" warning is now hidden when -s is used
o curl -d @nonexisting no longer makes a GET
o minor debug callback data size
o date parsing of dates including daylight savings time zone names
o using NTLM over proxy with an FTP URL
o curl-config --features now displays SSL when built with GnuTLS too
o CURLOPT_HTTPGET, CURLOPT_POST and CURLOPT_HTTPPOST reset CURLOPT_NOBODY
o builds fine on AmigaOS again
o corrected date parsing on Windows with auto-DST-adjust enabled
o treats CONNECT 407 responses with bodies better during Digest/NTLM auth
o improved strerror_r() API guessing when cross-compiling
o debug builds work on Tru64
o improved libcurl.m4
o possible memory leak in windows name resolves
o c-ares enabled build with mingw
o proxy host set with numerical IPv6 address
o better treatment of binary zeroes in HTTP response headers
o fixed the notorious FTP server failure in the test suite
o better checking of text output in the test suite on windows
o FTP servers' TYPE command response check made less strict
o URL-without-slash as in http://somehost?data
o strerror_r() configure check for HP-UX 10.20 (and others)
o time parse work-around on HP-UX 10.20 since its gmtime_r() is broken
o buffer overflow problem: http://curl.haxx.se/docs/adv_20051207.html
o using file:// on non-existing files are properly handled
o builds fine on DJGPP
o CURLOPT_ERRORBUFFER is now always filled in on errors
o curl outputs error on bad --limit-rate units
o fixed libcurl's use of poll() on cygwin
o the GnuTLS code didn't support client certificates
o TFTP over IPv6 works
o no reverse lookups on IP addresses when ipv6-enabled
o SSPI compatibility fix: using the proper DLLs
o binary LDAP properties are now shown base64 encoded
o Windows uploads from stdin using curl can now contain ctrl-Z bytes
o -r [num] would produce an invalid HTTP Range: header
o multi interface with multi IP hosts could leak socket descriptors
o the GnuTLS code didn't handle rehandshakes
o re-use of a dead FTP connection
o name resolve error codes fixed for Windows builds
o double WWW-Authenticate Digest headers are now handled
o curl-config --vernum fixed
Other curl-related news since the previous public release:
o cURLpp 0.5.2 was released at http://rrette.com/curlpp.html
o Rexx/CURL 1.3 was released at http://rexxcurl.sf.net/
o http://curl.miscellaneousmirror.org is a new German curl mirror
o LuaCURL by Alexander Marinov at http://luacurl.luaforge.net/
o http://curl.hostingzero.com/ is a new US curl mirror
o ocurl 0.2.1 was released at http://sourceforge.net/projects/ocurl
o FTP-SSL is now RFC4217
o CurlPas 2005-11-05 was released: http://curlpas.sf.net/
o pycurl 7.15.0 was released http://pycurl.sf.net
o New web mirrors:
http://curl.triplemind.com/ located in Mannheim, Germany
http://curl.nedmirror.nl located in Amsterdam, the Netherlands
http://curl.hoxt.com located in Florida, US
This release would not have looked like this without help, code, reports and
advice from friends like these:
John McGowan, Georg Wicherski, Andres Garcia, Eric Cooper, Todd Kulesza,
Tupone Alfredo, Gisle Vanem, David Shaw, Andrew Bushnell, Dan Fandrich,
Adrian Schuur, Diego Casorran, Peteris Krumins, Jon Grubbs, Christopher
R. Palmer, Mario Schroeder, Richard Clayton, James Bursa, Jeff Pohlmeyer,
Norbert Novotny, Toby Peterson, Simon Josefsson, Igor Polyakov, Kevin Lussier
Dave Dribin, Bradford Bruce, Temprimus, Ofer, Dima Barsky, Amol Pattekar, Jaz
Fresh, tommink[at]post.pl, Gisle Vanem, Nis Jorgensen, Vilmos Nebehaj, Dmitry
Bartsevich, David Lang, Eugene Kotlyarov, Jan Kunder, Yang Tse, Quagmire,
Albert Chin, David Shaw, Doug Kaufman, Bryan Henderson, Jamie Newton, Stefan
Esser
Thanks! (and sorry if I forgot to mention someone)

View File

@@ -1,12 +1,7 @@
Issues not sorted in any particular order.
To get fixed in 7.14.1 (planned release: August 2005)
To get fixed in 7.15.0 (planned release: November 2005)
======================
To get fixed in 7.14.2 (planned release: October 2005)
======================
60 - CONNECT 407 responses that kills the connection
60 - CONNECT 407 responses that kills the connection (not very likely though)
63 -

View File

@@ -141,6 +141,9 @@ AC_DEFUN([TYPE_SOCKADDR_STORAGE],
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
])

View File

@@ -1,5 +1,21 @@
Changelog for the c-ares project
* November 25
- Yang Tse fixed some send() / recv() compiler warnings
* September 18
- Added constants that will be used by ares_getaddrinfo
- Made ares_getnameinfo use the reentrant getservbyport (getservbyport_r) if it is
available to ensure it works properly in a threaded environment.
* September 10
- configure fix for detecting a member in the sockaddr_in6 struct which failed
on ipv6-enabled HP-UX 11.00
Version 1.3.0 (August 29, 2004)
* August 21

View File

@@ -13,6 +13,7 @@ Makefile.in
Makefile.dj
Makefile.m32
Makefile.netware
Makefile.vc6
install-sh
mkinstalldirs
configure

View File

@@ -4,10 +4,9 @@ lib_LTLIBRARIES = libcares.la
man_MANS = $(MANPAGES)
MSVCFILES = vc/adig/adig.dep vc/adig/adig.dsp vc/adig/adig.mak \
vc/adig/adig.plg vc/vc.dsw vc/ahost/ahost.dep vc/ahost/ahost.dsp \
vc/ahost/ahost.mak vc/ahost/ahost.plg vc/areslib/areslib.dep \
vc/areslib/areslib.dsp vc/areslib/areslib.mak vc/areslib/areslib.plg
MSVCFILES = vc/adig/adig.dep vc/adig/adig.dsp vc/vc.dsw vc/ahost/ahost.dep \
vc/ahost/ahost.dsp vc/areslib/areslib.dep vc/areslib/areslib.dsp \
vc/areslib/areslib.dsw
# adig and ahost are just sample programs and thus not mentioned with the
# regular sources and headers

View File

@@ -9,7 +9,12 @@ include Makefile.inc
WATT32_ROOT = $(subst \,/,$(WATT_ROOT))
CC = gcc
CFLAGS = -O2 -Wall -DWATT32 -Dselect=select_s -I$(WATT32_ROOT)/inc
CFLAGS = -O2 -Wall -DWATT32 -Dselect=select_s -DHAVE_AF_INET6 \
-DHAVE_PF_INET6 -DHAVE_IOCTLSOCKET -DHAVE_STRUCT_IN6_ADDR \
-DHAVE_STRUCT_SOCKADDR_IN6 -DHAVE_STRUCT_ADDRINFO \
-DHAVE_ARPA_NAMESER_H -DNS_INADDRSZ=4 \
-DHAVE_SOCKADDR_IN6_SIN6_SCOPE_ID -I$(WATT32_ROOT)/inc
LDFLAGS = -s
EX_LIBS = $(WATT32_ROOT)/lib/libwatt.a

View File

@@ -7,29 +7,21 @@
## Quick hack by Guenter; comments to: /dev/nul
CC = gcc
AR = ar
RANLIB = ranlib
STRIP = strip -g
#RM = rm -f
########################################################
## Nothing more to do below this line!
LIB=libcares.a
CC=gcc
#CPPFLAGS=@CPPFLAGS@
WARN_FLAGS=-Wall
CFLAGS=-O2
CFLAGS+=${WARN_CFLAGS} ${ERROR_CFLAGS}
DEFS=-DMINGW32
CFLAGS=-O2 -Wall
LDFLAGS=-s
LIBS=-lwsock32
ALL_CFLAGS=${CPPFLAGS} ${CFLAGS} ${DEFS}
MANPAGES := $(patsubst %.c,%.o,$(wildcard ares_*.3))
OBJS := $(patsubst %.c,%.o,$(wildcard ares_*.c))
OBJS += windows_port.o
OBJS += windows_port.o inet_ntop.o inet_net_pton.o bitncmp.o
$(LIB): ${OBJS}
ar cru $@ ${OBJS}
@@ -51,7 +43,7 @@ ahost.exe: ahost.o $(LIB)
${OBJS}: ares.h ares_dns.h ares_private.h
.c.o:
${CC} -c ${ALL_CFLAGS} $<
${CC} -c ${CFLAGS} $<
check:
@@ -73,3 +65,4 @@ clean:
distclean: clean
rm -f config.cache config.log config.status Makefile

188
ares/Makefile.vc6 Normal file
View File

@@ -0,0 +1,188 @@
# $Id$
#
# C-ares makefile for MSVC6+
# G. Vanem <giva@bgnett.no>.
#
CFG_MODEL = MD
DEBUG_MODEL = d
USE_WATT32 = 0
#
# Configurations:
# -MD - msvcrt.dll, threads, release (normal)
# -MDd - msvcrtd.dll, threads, debug
# -ML - libc, no threads, release
# -MLd - libc, no threads, debug
# -MT - libc, threads, release
# -MTd - libc, threads, debug
CC = cl
CFLAGS = -nologo -$(CFG_MODEL)$(DEBUG_MODEL) -W2 -Yd -Zi
LDFLAGS = -machine:i386 -map -warn:2
OBJ_DIR = VC6_obj
DEF_FILE = cares.def
!if "$(USE_WATT32)" == "1"
CFLAGS = $(CFLAGS) -UWIN32 -DWATT32 -I$(WATT_ROOT)\inc
EX_LIBS = $(WATT_ROOT)\lib\wattcpvc_imp.lib
!else
CFLAGS = $(CFLAGS) -DWIN32 -DWIN32_LEAN_AND_MEAN
EX_LIBS = advapi32.lib ws2_32.lib
!endif
!if "$(DEBUG_MODEL)" == "d"
CFLAGS = $(CFLAGS) -D_DEBUG -GZ
LDFLAGS = $(LDFLAGS) -debug -debugtype:coff -fixed:no
!else
CFLAGS = $(CFLAGS) -O2 -Og
LDFLAGS = $(LDFLAGS) -release
!endif
OBJECTS = $(OBJ_DIR)\ares_fds.obj \
$(OBJ_DIR)\ares_process.obj \
$(OBJ_DIR)\ares_free_hostent.obj \
$(OBJ_DIR)\ares_query.obj \
$(OBJ_DIR)\ares__close_sockets.obj \
$(OBJ_DIR)\ares_free_string.obj \
$(OBJ_DIR)\ares_search.obj \
$(OBJ_DIR)\ares__get_hostent.obj \
$(OBJ_DIR)\ares_gethostbyaddr.obj \
$(OBJ_DIR)\ares_send.obj \
$(OBJ_DIR)\ares__read_line.obj \
$(OBJ_DIR)\ares_gethostbyname.obj \
$(OBJ_DIR)\ares_getnameinfo.obj \
$(OBJ_DIR)\ares_strerror.obj \
$(OBJ_DIR)\ares_cancel.obj \
$(OBJ_DIR)\ares_init.obj \
$(OBJ_DIR)\ares_timeout.obj \
$(OBJ_DIR)\ares_destroy.obj \
$(OBJ_DIR)\ares_mkquery.obj \
$(OBJ_DIR)\ares_version.obj \
$(OBJ_DIR)\ares_expand_name.obj \
$(OBJ_DIR)\ares_parse_a_reply.obj \
$(OBJ_DIR)\ares_parse_aaaa_reply.obj \
$(OBJ_DIR)\windows_port.obj \
$(OBJ_DIR)\ares_expand_string.obj \
$(OBJ_DIR)\ares_parse_ptr_reply.obj \
$(OBJ_DIR)\bitncmp.obj \
$(OBJ_DIR)\inet_net_pton.obj \
$(OBJ_DIR)\inet_ntop.obj
all: $(OBJ_DIR) cares.lib cares.dll cares_imp.lib ahost.exe adig.exe
$(OBJ_DIR):
mkdir $(OBJ_DIR)
cares.lib: $(OBJECTS)
lib -nologo -out:$@ $(OBJECTS)
cares_imp.lib cares.dll: $(DEF_FILE) $(OBJECTS)
link $(LDFLAGS) -dll -implib:cares_imp.lib -out:cares.dll \
-def:$(DEF_FILE) $(OBJECTS) $(EX_LIBS)
$(DEF_FILE): $(OBJECTS) Makefile.VC6
@echo ; Generated. DO NOT EDIT > $@
@echo LIBRARY cares.dll >> $@
@echo EXPORTS >> $@
@echo ares_cancel >> $@
@echo ares_destroy >> $@
@echo ares_expand_name >> $@
@echo ares_expand_string >> $@
@echo ares_fds >> $@
@echo ares_free_hostent >> $@
@echo ares_free_string >> $@
@echo ares_gethostbyaddr >> $@
@echo ares_gethostbyname >> $@
@echo ares_init >> $@
@echo ares_init_options >> $@
@echo ares_mkquery >> $@
@echo ares_parse_a_reply >> $@
@echo ares_parse_ptr_reply >> $@
@echo ares_process >> $@
@echo ares_query >> $@
@echo ares_search >> $@
@echo ares_strerror >> $@
@echo ares_strncasecmp >> $@
@echo ares_strcasecmp >> $@
@echo ares_timeout >> $@
@echo ares_version >> $@
@echo ares_inet_net_pton >> $@
@echo ares_inet_ntop >> $@
@echo ares_inet_pton >> $@
@echo ares_writev >> $@
@echo ares_getnameinfo >> $@
@echo ares_gettimeofday >> $@
@echo ares_parse_aaaa_reply >> $@
ahost.exe: $(OBJ_DIR)\ahost.obj cares_imp.lib
link $(LDFLAGS) -out:$@ $(OBJ_DIR)\ahost.obj cares_imp.lib $(EX_LIBS)
adig.exe: $(OBJ_DIR)\adig.obj $(OBJ_DIR)\getopt.obj cares_imp.lib
link $(LDFLAGS) -out:$@ $(OBJ_DIR)\adig.obj $(OBJ_DIR)\getopt.obj cares_imp.lib $(EX_LIBS)
clean:
- del $(OBJ_DIR)\*.obj *.ilk *.pdb *.pbt *.pbi *.pbo *._xe *.map
vclean realclean: clean
- del $(DEF_FILE) cares.lib cares_imp.* cares.dll ahost.exe adig.exe
- rd $(OBJ_DIR)
.c{$(OBJ_DIR)}.obj:
$(CC) $(CFLAGS) -Fo$*.obj -c $<
#
# Copyright "gcc -MM .."
#
$(OBJ_DIR)\ares_fds.obj: ares_fds.c setup.h ares.h ares_private.h ares_ipv6.h
$(OBJ_DIR)\ares_process.obj: ares_process.c setup.h nameser.h ares.h ares_dns.h \
ares_private.h ares_ipv6.h
$(OBJ_DIR)\ares_free_hostent.obj: ares_free_hostent.c setup.h ares.h ares_private.h \
ares_ipv6.h
$(OBJ_DIR)\ares_query.obj: ares_query.c setup.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 ares.h \
ares_private.h ares_ipv6.h
$(OBJ_DIR)\ares_free_string.obj: ares_free_string.c setup.h ares.h
$(OBJ_DIR)\ares_search.obj: ares_search.c setup.h nameser.h ares.h ares_private.h \
ares_ipv6.h
$(OBJ_DIR)\ares__get_hostent.obj: ares__get_hostent.c setup.h ares.h ares_private.h \
ares_ipv6.h inet_net_pton.h
$(OBJ_DIR)\ares_gethostbyaddr.obj: ares_gethostbyaddr.c setup.h nameser.h ares.h \
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 \
ares_private.h ares_ipv6.h
$(OBJ_DIR)\ares__read_line.obj: ares__read_line.c setup.h ares.h ares_private.h \
ares_ipv6.h
$(OBJ_DIR)\ares_gethostbyname.obj: ares_gethostbyname.c setup.h nameser.h ares.h \
ares_private.h ares_ipv6.h inet_net_pton.h bitncmp.h
$(OBJ_DIR)\ares_strerror.obj: ares_strerror.c setup.h ares.h
$(OBJ_DIR)\ares_cancel.obj: ares_cancel.c setup.h ares.h ares_private.h ares_ipv6.h
$(OBJ_DIR)\ares_init.obj: ares_init.c setup.h nameser.h ares.h ares_private.h \
ares_ipv6.h inet_net_pton.h
$(OBJ_DIR)\ares_timeout.obj: ares_timeout.c setup.h ares.h ares_private.h ares_ipv6.h
$(OBJ_DIR)\ares_destroy.obj: ares_destroy.c setup.h ares.h ares_private.h ares_ipv6.h
$(OBJ_DIR)\ares_mkquery.obj: ares_mkquery.c setup.h nameser.h ares.h ares_dns.h
$(OBJ_DIR)\ares_version.obj: ares_version.c setup.h ares_version.h
$(OBJ_DIR)\ares_expand_name.obj: ares_expand_name.c setup.h nameser.h ares.h \
ares_private.h ares_ipv6.h
$(OBJ_DIR)\ares_parse_a_reply.obj: ares_parse_a_reply.c setup.h nameser.h ares.h \
ares_dns.h ares_private.h ares_ipv6.h
$(OBJ_DIR)\windows_port.obj: windows_port.c setup.h nameser.h ares.h ares_private.h \
ares_ipv6.h
$(OBJ_DIR)\ares_expand_string.obj: ares_expand_string.c setup.h nameser.h ares.h \
ares_private.h ares_ipv6.h
$(OBJ_DIR)\ares_parse_ptr_reply.obj: ares_parse_ptr_reply.c setup.h nameser.h ares.h \
ares_dns.h ares_private.h ares_ipv6.h
$(OBJ_DIR)\ares_parse_aaaa_reply.obj: ares_parse_aaaa_reply.c setup.h nameser.h ares.h \
ares_dns.h inet_net_pton.h ares_private.h ares_ipv6.h
$(OBJ_DIR)\ares_getnameinfo.obj: ares_getnameinfo.c setup.h nameser.h ares.h \
ares_private.h ares_ipv6.h inet_ntop.h
$(OBJ_DIR)\inet_net_pton.obj: inet_net_pton.c setup.h nameser.h ares_ipv6.h \
inet_net_pton.h
$(OBJ_DIR)\bitncmp.obj: bitncmp.c bitncmp.h
$(OBJ_DIR)\inet_ntop.obj: inet_ntop.c setup.h nameser.h ares_ipv6.h inet_ntop.h

View File

@@ -242,26 +242,6 @@ AC_DEFUN([CARES_CHECK_STRUCT], [
fi
])
dnl This macro determins if the specified struct contains a specific member.
dnl Syntax:
dnl CARES_CHECK_STRUCT_MEMBER(headers, struct name, member name, if found, [if not found])
AC_DEFUN([CARES_CHECK_STRUCT_MEMBER], [
AC_MSG_CHECKING([if struct $2 has member $3])
AC_TRY_COMPILE([$1],
[
struct $2 struct_instance;
struct_instance.$3 = 0;
], ac_struct="yes", ac_found="no")
if test "$ac_struct" = "yes" ; then
AC_MSG_RESULT(yes)
$4
else
AC_MSG_RESULT(no)
$5
fi
])
dnl This macro determines if the specified constant exists in the specified file
dnl Syntax:
dnl CARES_CHECK_CONSTANT(headers, constant name, if found, [if not found])
@@ -289,3 +269,50 @@ AC_DEFUN([CARES_CHECK_CONSTANT], [
])
dnl This macro determines how many parameters getservbyport_r takes
AC_DEFUN([CARES_CHECK_GETSERVBYPORT_R], [
AC_MSG_CHECKING([how many arguments getservbyport_r takes])
AC_TRY_COMPILE(
[#include <netdb.h>],
[
int p1, p5;
char *p2, p4[4096];
struct servent *p3, *p6;
getservbyport_r(p1, p2, p3, p4, p5, &p6);
], ac_func_getservbyport_r=6,
[AC_TRY_COMPILE(
[#include <netdb.h>],
[
int p1, p5;
char *p2, p4[4096];
struct servent *p3;
getservbyport_r(p1, p2, p3, p4, p5);
], ac_func_getservbyport_r=5,
[AC_TRY_COMPILE(
[#include <netdb.h>],
[
int p1;
char *p2;
struct servent *p3;
struct servent_data p4;
getservbyport_r(p1, p2, p3, &p4);
], ac_func_getservbyport_r=4, ac_func_getservbyport_r=0
)]
)]
)
if test $ac_func_getservbyport_r != "0" ; then
AC_MSG_RESULT($ac_func_getservbyport_r)
AC_DEFINE(HAVE_GETSERVBYPORT_R, 1, [Specifies whether getservbyport_r is present])
AC_DEFINE_UNQUOTED(GETSERVBYPORT_R_ARGS, $ac_func_getservbyport_r, [Specifies the number of arguments to
getservbyport_r])
if test $ac_func_getservbyport_r = "4" ; then
AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, sizeof(struct servent_data), [Specifies the size of the buffer to pass to
getservbyport_r])
else
AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, 4096, [Specifies the size of the buffer to pass to getservbyport_r])
fi
else
AC_MSG_RESULT([not found])
fi
])

View File

@@ -27,14 +27,23 @@
#include <unistd.h>
#include <netdb.h>
#endif
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include "ares.h"
#include "ares_dns.h"
#include "inet_ntop.h"
#ifdef WATT32
#undef WIN32 /* Redefined in MingW headers */
#endif
#ifndef INADDR_NONE
#define INADDR_NONE 0xffffffff
@@ -45,8 +54,10 @@
#define T_SRV 33 /* server selection */
#endif
#ifndef optind
extern int optind;
extern char *optarg;
#endif
struct nv {
const char *name;
@@ -412,7 +423,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
char *name;
int type, dnsclass, ttl, dlen, status;
long len;
struct in_addr addr;
char addr[46];
/* Parse the RR name. */
status = ares_expand_name(aptr, abuf, alen, &name, &len);
@@ -474,12 +485,12 @@ static const unsigned char *display_rr(const unsigned char *aptr,
len = *p;
if (p + len + 1 > aptr + dlen)
return NULL;
printf("\t%.*s", len, p + 1);
printf("\t%.*s", (int)len, p + 1);
p += len + 1;
len = *p;
if (p + len + 1 > aptr + dlen)
return NULL;
printf("\t%.*s", len, p + 1);
printf("\t%.*s", (int)len, p + 1);
break;
case T_MINFO:
@@ -504,7 +515,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
*/
if (dlen < 2)
return NULL;
printf("\t%d", (aptr[0] << 8) | aptr[1]);
printf("\t%d", DNS__16BIT(aptr));
status = ares_expand_name(aptr + 2, abuf, alen, &name, &len);
if (status != ARES_SUCCESS)
return NULL;
@@ -531,12 +542,9 @@ static const unsigned char *display_rr(const unsigned char *aptr,
p += len;
if (p + 20 > aptr + dlen)
return NULL;
printf("\t\t\t\t\t\t( %d %d %d %d %d )",
(p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3],
(p[4] << 24) | (p[5] << 16) | (p[6] << 8) | p[7],
(p[8] << 24) | (p[9] << 16) | (p[10] << 8) | p[11],
(p[12] << 24) | (p[13] << 16) | (p[14] << 8) | p[15],
(p[16] << 24) | (p[17] << 16) | (p[18] << 8) | p[19]);
printf("\t\t\t\t\t\t( %lu %lu %lu %lu %lu )",
DNS__32BIT(p), DNS__32BIT(p+4), DNS__32BIT(p+8),
DNS__32BIT(p+12), DNS__32BIT(p+16));
break;
case T_TXT:
@@ -548,7 +556,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
len = *p;
if (p + len + 1 > aptr + dlen)
return NULL;
printf("\t%.*s", len, p + 1);
printf("\t%.*s", (int)len, p + 1);
p += len + 1;
}
break;
@@ -557,8 +565,14 @@ static const unsigned char *display_rr(const unsigned char *aptr,
/* The RR data is a four-byte Internet address. */
if (dlen != 4)
return NULL;
memcpy(&addr, aptr, sizeof(struct in_addr));
printf("\t%s", inet_ntoa(addr));
printf("\t%s", ares_inet_ntop(AF_INET,aptr,addr,sizeof(addr)));
break;
case T_AAAA:
/* The RR data is a 16-byte IPv6 address. */
if (dlen != 16)
return NULL;
printf("\t%s", ares_inet_ntop(AF_INET6,aptr,addr,sizeof(addr)));
break;
case T_WKS:
@@ -583,6 +597,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
default:
printf("\t[Unknown RR; cannot parse]");
break;
}
printf("\n");

View File

@@ -29,13 +29,23 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ares.h"
#include "ares_dns.h"
#include "inet_ntop.h"
#include "inet_net_pton.h"
#ifndef INADDR_NONE
#define INADDR_NONE 0xffffffff
#endif
#ifndef HAVE_STRUCT_IN6_ADDR
struct in6_addr
{
unsigned char s6_addr[16];
};
#endif
static void callback(void *arg, int status, struct hostent *host);
static void usage(void);
@@ -45,7 +55,8 @@ int main(int argc, char **argv)
int status, nfds;
fd_set read_fds, write_fds;
struct timeval *tvp, tv;
struct in_addr addr;
struct in_addr addr4;
struct in6_addr addr6;
#ifdef WIN32
WORD wVersionRequested = MAKEWORD(1,1);
@@ -66,13 +77,20 @@ int main(int argc, char **argv)
/* Initiate the queries, one per command-line argument. */
for (argv++; *argv; argv++)
{
addr.s_addr = inet_addr(*argv);
if (addr.s_addr == INADDR_NONE)
ares_gethostbyname(channel, *argv, AF_INET, callback, *argv);
if (ares_inet_pton(AF_INET, *argv, &addr4) == 1)
{
ares_gethostbyaddr(channel, &addr4, sizeof(addr4), AF_INET, callback,
*argv);
}
else if (ares_inet_pton(AF_INET6, *argv, &addr6) == 1)
{
ares_gethostbyaddr(channel, &addr6, sizeof(addr6), AF_INET6, callback,
*argv);
}
else
{
ares_gethostbyaddr(channel, &addr, sizeof(addr), AF_INET, callback,
*argv);
/* assume user wants A-records */
ares_gethostbyname(channel, *argv, AF_INET, callback, *argv);
}
}
@@ -95,7 +113,6 @@ int main(int argc, char **argv)
static void callback(void *arg, int status, struct hostent *host)
{
struct in_addr addr;
char **p;
if (status != ARES_SUCCESS)
@@ -106,8 +123,21 @@ static void callback(void *arg, int status, struct hostent *host)
for (p = host->h_addr_list; *p; p++)
{
memcpy(&addr, *p, sizeof(struct in_addr));
printf("%-32s\t%s\n", host->h_name, inet_ntoa(addr));
char addr_buf[46] = "??";
ares_inet_ntop(host->h_addrtype, *p, addr_buf, sizeof(addr_buf));
printf("%-32s\t%s", host->h_name, addr_buf);
#if 0
if (host->h_aliases[0])
{
int i;
printf (", Aliases: ");
for (i = 0; host->h_aliases[i]; i++)
printf("%s ", host->h_aliases[i]);
}
#endif
puts("");
}
}

View File

@@ -32,7 +32,7 @@
#include <sys/socket.h>
#include <tcp.h>
#elif defined(WIN32)
#include <winsock.h>
#include <winsock2.h>
#include <windows.h>
#else
#include <netinet/in.h>
@@ -69,6 +69,10 @@ extern "C" {
/* ares_getnameinfo error codes */
#define ARES_EBADFLAGS 18
/* ares_getaddrinfo error codes */
#define ARES_ENONAME 19
#define ARES_EBADHINTS 20
/* Flag values */
#define ARES_FLAG_USEVC (1 << 0)
#define ARES_FLAG_PRIMARY (1 << 1)
@@ -105,8 +109,26 @@ extern "C" {
#define ARES_NI_LOOKUPSERVICE (1 << 9)
/* Reserved for future use */
#define ARES_NI_IDN (1 << 10)
#define ARES_NI_ALLOW_UNASSIGNED (1 << 11)
#define ARES_NI_USE_STD3_ASCII_RULES (1 << 12)
#define ARES_NI_IDN_ALLOW_UNASSIGNED (1 << 11)
#define ARES_NI_IDN_USE_STD3_ASCII_RULES (1 << 12)
/* Addrinfo flag values */
#define ARES_AI_CANONNAME (1 << 0)
#define ARES_AI_NUMERICHOST (1 << 1)
#define ARES_AI_PASSIVE (1 << 2)
#define ARES_AI_NUMERICSERV (1 << 3)
#define ARES_AI_V4MAPPED (1 << 4)
#define ARES_AI_ALL (1 << 5)
#define ARES_AI_ADDRCONFIG (1 << 6)
/* Reserved for future use */
#define ARES_AI_IDN (1 << 10)
#define ARES_AI_IDN_ALLOW_UNASSIGNED (1 << 11)
#define ARES_AI_IDN_USE_STD3_ASCII_RULES (1 << 12)
#define ARES_AI_CANONIDN (1 << 13)
#define ARES_AI_MASK (ARES_AI_CANONNAME|ARES_AI_NUMERICHOST|ARES_AI_PASSIVE| \
ARES_AI_NUMERICSERV|ARES_AI_V4MAPPED|ARES_AI_ALL| \
ARES_AI_ADDRCONFIG)
struct ares_options {
int flags;

View File

@@ -18,6 +18,18 @@
#ifndef ARES__DNS_H
#define ARES__DNS_H
#ifdef ARES_BIG_ENDIAN
/* big-endian aware versions */
#define DNS__16BIT(p) (((p)[1] << 8) | (p)[0])
#define DNS__32BIT(p) (((p)[3] << 24) | ((p)[2] << 16) | \
((p)[1] << 8) | (p)[0])
#define DNS__SET16BIT(p, v) (((p)[1] = ((v) >> 8) & 0xff), \
((p)[0] = (v) & 0xff))
#define DNS__SET32BIT(p, v) (((p)[3] = ((v) >> 24) & 0xff), \
((p)[2] = ((v) >> 16) & 0xff), \
((p)[1] = ((v) >> 8) & 0xff), \
((p)[0] = (v) & 0xff))
#else
#define DNS__16BIT(p) (((p)[0] << 8) | (p)[1])
#define DNS__32BIT(p) (((p)[0] << 24) | ((p)[1] << 16) | \
((p)[2] << 8) | (p)[3])
@@ -27,6 +39,16 @@
((p)[1] = ((v) >> 16) & 0xff), \
((p)[2] = ((v) >> 8) & 0xff), \
((p)[3] = (v) & 0xff))
#endif
#if 0
/* we cannot use this approach on systems where we can't access 16/32 bit
data on un-aligned addresses */
#define DNS__16BIT(p) ntohs(*(unsigned short*)(p))
#define DNS__32BIT(p) ntohl(*(unsigned long*)(p))
#define DNS__SET16BIT(p, v) *(unsigned short*)(p) = htons(v)
#define DNS__SET32BIT(p, v) *(unsigned long*)(p) = htonl(v)
#endif
/* Macros for parsing a DNS header */
#define DNS_HEADER_QID(h) DNS__16BIT(h)

View File

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

View File

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

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright 2005 by Dominick Meglio
*
* Permission to use, copy, modify, and distribute this
@@ -70,15 +72,16 @@ struct nameinfo_query {
static void nameinfo_callback(void *arg, int status, struct hostent *host);
static char *lookup_service(unsigned short port, int flags, char *buf);
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
static char *append_scopeid(struct sockaddr_in6 *addr6, unsigned int scopeid, char *buf);
static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int scopeid,
char *buf, size_t buflen);
#endif
static char *ares_striendstr(const char *s1, const char *s2);
void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t salen,
int flags, ares_nameinfo_callback callback, void *arg)
{
struct sockaddr_in *addr;
struct sockaddr_in6 *addr6;
struct sockaddr_in *addr = NULL;
struct sockaddr_in6 *addr6 = NULL;
struct nameinfo_query *niquery;
/* Verify the buffer size */
@@ -137,7 +140,7 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t
port = addr6->sin6_port;
/* If the system supports scope IDs, use it */
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
append_scopeid(addr6, flags, ipbuf);
append_scopeid(addr6, flags, ipbuf, sizeof(ipbuf));
#endif
}
else
@@ -194,9 +197,11 @@ static void nameinfo_callback(void *arg, int status, struct hostent *host)
if (niquery->flags & ARES_NI_LOOKUPSERVICE)
{
if (niquery->family == AF_INET)
service = lookup_service(niquery->addr.addr4.sin_port, niquery->flags, srvbuf);
service = lookup_service(niquery->addr.addr4.sin_port,
niquery->flags, srvbuf);
else
service = lookup_service(niquery->addr.addr6.sin6_port, niquery->flags, srvbuf);
service = lookup_service(niquery->addr.addr6.sin6_port,
niquery->flags, srvbuf);
}
/* NOFQDN means we have to strip off the domain name portion.
We do this by determining our own domain name, then searching the string
@@ -227,16 +232,18 @@ static void nameinfo_callback(void *arg, int status, struct hostent *host)
{
ares_inet_ntop(AF_INET6, &niquery->addr.addr6.sin6_addr, ipbuf, IPBUFSIZ);
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
append_scopeid(&niquery->addr.addr6, niquery->flags, ipbuf);
append_scopeid(&niquery->addr.addr6, niquery->flags, ipbuf, sizeof(ipbuf));
#endif
}
/* They want a service too */
if (niquery->flags & ARES_NI_LOOKUPSERVICE)
{
if (niquery->family == AF_INET)
service = lookup_service(niquery->addr.addr4.sin_port, niquery->flags, srvbuf);
service = lookup_service(niquery->addr.addr4.sin_port,
niquery->flags, srvbuf);
else
service = lookup_service(niquery->addr.addr6.sin6_port, niquery->flags, srvbuf);
service = lookup_service(niquery->addr.addr6.sin6_port,
niquery->flags, srvbuf);
}
niquery->callback(niquery->arg, ARES_SUCCESS, ipbuf, service);
return;
@@ -245,7 +252,8 @@ static void nameinfo_callback(void *arg, int status, struct hostent *host)
free(niquery);
}
static char *lookup_service(unsigned short port, int flags, char *buf)
static char *lookup_service(unsigned short port, int flags,
char *buf) /* 33 bytes buffer */
{
if (port)
{
@@ -256,7 +264,19 @@ static char *lookup_service(unsigned short port, int flags, char *buf)
{
struct servent *se;
const char *proto;
#ifdef HAVE_GETSERVBYPORT_R
#if GETSERVBYPORT_R_ARGS == 6
struct servent ret;
char buf[4096];
int len = 4096;
#elif GETSERVBYPORT_R_ARGS == 5
char buf[4096];
int len = 4096;
#elif GETSERVBYPORT_R_ARGS == 4
struct servent ret;
struct servent_data sed;
#endif
#endif /* HAVE_GETSERVBYPORT_R */
if (flags & ARES_NI_UDP)
proto = "udp";
else if (flags & ARES_NI_SCTP)
@@ -265,9 +285,34 @@ static char *lookup_service(unsigned short port, int flags, char *buf)
proto = "dccp";
else
proto = "tcp";
#ifdef HAVE_GETSERVBYPORT_R
#if GETSERVBYPORT_R_ARGS == 6
se = &ret;
if (getservbyport_r(port, proto, se, buf, len, &ret))
se = NULL;
#elif GETSERVBYPORT_R_ARGS == 5
se = getservbyport_r(port, proto, se, buf, len);
#elif GETSERVBYPORT_R_ARGS == 4
se = &ret;
if (getservbyport_r(port, proto, se, &sed) == -1)
se = NULL;
#else
/* Lets just hope the OS uses TLS! */
se = getservbyport(port, proto);
if (se && se->s_name)
#endif
#else
/* Lets just hope the OS uses TLS! */
se = getservbyport(port, proto);
#endif
if (se && se->s_name) {
size_t len = strlen(se->s_name);
if(len < 33) {
strcpy(buf, se->s_name);
}
else
/* too big name to fit the buffer */
buf[0]=0;
}
else
sprintf(buf, "%u", ntohs(port));
}
@@ -277,27 +322,39 @@ static char *lookup_service(unsigned short port, int flags, char *buf)
}
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
static char *append_scopeid(struct sockaddr_in6 *addr6, unsigned int flags, char *buf)
static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int flags,
char *buf, size_t buflen)
{
char tmpbuf[IF_NAMESIZE + 1];
char fmt_u[] = "%u";
char fmt_lu[] = "%lu";
char tmpbuf[IF_NAMESIZE + 2];
size_t bufl;
char *fmt = (sizeof(addr6->sin6_scope_id) > sizeof(unsigned int))?fmt_lu:fmt_u;
tmpbuf[0] = '%';
#ifdef HAVE_IF_INDEXTONAME
if ((flags & ARES_NI_NUMERICSCOPE) || (!IN6_IS_ADDR_LINKLOCAL(&addr6->sin6_addr)
if ((flags & ARES_NI_NUMERICSCOPE) ||
(!IN6_IS_ADDR_LINKLOCAL(&addr6->sin6_addr)
&& !IN6_IS_ADDR_MC_LINKLOCAL(&addr6->sin6_addr)))
{
sprintf(&tmpbuf[1], "%u", addr6->sin6_scope_id);
sprintf(&tmpbuf[1], fmt, addr6->sin6_scope_id);
}
else
{
if (if_indextoname(addr6->sin6_scope_id, &tmpbuf[1]) == NULL)
sprintf(&tmpbuf[1], "%u", addr6->sin6_scope_id);
sprintf(&tmpbuf[1], fmt, addr6->sin6_scope_id);
}
#else
sprintf(&tmpbuf[1], "%u", addr6->sin6_scope_id);
sprintf(&tmpbuf[1], fmt, addr6->sin6_scope_id);
(void) flags;
#endif
strcat(buf, tmpbuf);
return buf;
tmpbuf[IF_NAMESIZE + 1] = '\0';
bufl = strlen(buf);
if(bufl + strlen(tmpbuf) < buflen)
/* only append the scopeid string if it fits in the target buffer */
strcpy(&buf[bufl], tmpbuf);
}
#endif

View File

@@ -164,7 +164,8 @@ static void write_tcp_data(ares_channel channel, fd_set *write_fds, time_t now)
/* Can't allocate iovecs; just send the first request. */
sendreq = server->qhead;
scount = send(server->tcp_socket, sendreq->data, sendreq->len, 0);
scount = send(server->tcp_socket, (void *)sendreq->data,
sendreq->len, 0);
if (scount < 0)
{
@@ -212,8 +213,8 @@ static void read_tcp_data(ares_channel channel, fd_set *read_fds, time_t now)
* what's left to read of it).
*/
count = recv(server->tcp_socket,
server->tcp_lenbuf + server->tcp_buffer_pos,
2 - server->tcp_buffer_pos, 0);
(void *)(server->tcp_lenbuf + server->tcp_lenbuf_pos),
2 - server->tcp_lenbuf_pos, 0);
if (count <= 0)
{
handle_error(channel, i, now);
@@ -238,7 +239,7 @@ static void read_tcp_data(ares_channel channel, fd_set *read_fds, time_t now)
{
/* Read data into the allocated buffer. */
count = recv(server->tcp_socket,
server->tcp_buffer + server->tcp_buffer_pos,
(void *)(server->tcp_buffer + server->tcp_buffer_pos),
server->tcp_length - server->tcp_buffer_pos, 0);
if (count <= 0)
{
@@ -280,7 +281,7 @@ static void read_udp_packets(ares_channel channel, fd_set *read_fds,
!FD_ISSET(server->udp_socket, read_fds))
continue;
count = recv(server->udp_socket, buf, sizeof(buf), 0);
count = recv(server->udp_socket, (void *)buf, sizeof(buf), 0);
if (count <= 0)
handle_error(channel, i, now);
@@ -465,7 +466,8 @@ void ares__send_query(ares_channel channel, struct query *query, time_t now)
return;
}
}
if (send(server->udp_socket, query->qbuf, query->qlen, 0) == -1)
if (send(server->udp_socket, (void *)query->qbuf,
query->qlen, 0) == -1)
{
query->skip_server[query->server] = 1;
next_server(channel, query, now);

35
ares/config-win32.h Normal file
View File

@@ -0,0 +1,35 @@
/* $Id$ */
/* Copyright (C) 2004 - 2005 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.
*/
#ifndef __CONFIG_WIN32_H
#define __CONFIG_WIN32_H
#if defined(__MINGW32__)
#define HAVE_GETOPT_H
#endif
#if defined(__MINGW32__) || defined(__WATCOMC__)
#define HAVE_UNISTD_H
#endif
#define HAVE_AF_INET6
#define HAVE_PF_INET6
#define HAVE_IOCTLSOCKET
#define HAVE_STRUCT_IN6_ADDR
#define HAVE_STRUCT_SOCKADDR_IN6
#define HAVE_STRUCT_ADDRINFO
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
#endif /* __CONFIG_WIN32_H */

View File

@@ -66,7 +66,9 @@ AC_CHECK_HEADERS(
sys/select.h \
sys/socket.h \
sys/ioctl.h \
winsock.h \
netdb.h \
winsock2.h \
ws2tcpip.h \
netinet/in.h \
net/if.h \
arpa/nameser.h \
@@ -87,8 +89,8 @@ dnl *Sigh* these are needed in order for net/if.h to get properly detected.
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_WINSOCK_H
#include <winsock.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
]
)
@@ -102,8 +104,8 @@ AC_CHECK_TYPE(socklen_t, ,
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_WINSOCK_H
#include <winsock.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
])
@@ -116,8 +118,8 @@ CARES_CHECK_CONSTANT(
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_WINSOCK_H
#include <winsock.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
], [PF_INET6],
@@ -133,8 +135,8 @@ CARES_CHECK_CONSTANT(
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_WINSOCK_H
#include <winsock.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
], [AF_INET6],
@@ -148,8 +150,11 @@ CARES_CHECK_STRUCT(
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_WINSOCK_H
#include <winsock.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#ifdef HAVE_WS2TCPIP_H
#include <ws2tcpip.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
@@ -164,8 +169,11 @@ CARES_CHECK_STRUCT(
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_WINSOCK_H
#include <winsock.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#ifdef HAVE_WS2TCPIP_H
#include <ws2tcpip.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
@@ -175,39 +183,49 @@ CARES_CHECK_STRUCT(
[Define to 1 if you have struct sockaddr_in6.]) ac_have_sockaddr_in6=yes
)
if test "$ac_have_sockaddr_in6" = "yes" ; then
CARES_CHECK_STRUCT_MEMBER(
[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_WINSOCK_H
#include <winsock.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
], [sockaddr_in6], [sin6_scope_id],
AC_CHECK_MEMBER(struct sockaddr_in6.sin6_scope_id,
AC_DEFINE_UNQUOTED(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID,1,
[Define to 1 if your struct sockaddr_in6 has sin6_scope_id.])
)
fi
dnl check for the addrinfo structure
CARES_CHECK_STRUCT(
, ,
[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_WINSOCK_H
#include <winsock.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
#ifdef HAVE_WS2TCPIP_H
#include <ws2tcpip.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
], [addrinfo],
])
dnl check for the addrinfo structure
AC_CHECK_MEMBER(struct addrinfo.ai_flags,
AC_DEFINE_UNQUOTED(HAVE_STRUCT_ADDRINFO,1,
[Define to 1 if you have struct addrinfo.])
[Define to 1 if you have struct addrinfo.]),,
[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_WINSOCaK2_H
#include <winsock2.h>
#endif
#ifdef HAVE_WS2TCPIP_H
#include <ws2tcpip.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
]
)
dnl check for inet_pton
@@ -346,6 +364,15 @@ AC_CHECK_SIZEOF(struct in_addr, ,
AC_CHECK_FUNCS([bitncmp if_indextoname])
dnl God bless non-standardized functions! We need to see which getservbyport_r variant is available
CARES_CHECK_GETSERVBYPORT_R
CURL_CHECK_NONBLOCKING_SOCKET
AC_C_BIGENDIAN(
[AC_DEFINE(ARES_BIG_ENDIAN, 1, [define this if ares is built for a big endian system])],
,
[AC_MSG_WARN([couldn't figure out endianess, assuming little endian!])]
)
AC_OUTPUT(Makefile)

View File

@@ -1,3 +1,5 @@
/* $Id$ */
/* Copyright (c) 1996 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -72,8 +74,8 @@ static const char *inet_ntop6(const unsigned char *src, char *dst, size_t size);
const char *
ares_inet_ntop(int af, const void *src, char *dst, size_t size)
{
switch (af) {
switch (af)
{
case AF_INET:
return (inet_ntop4(src, dst, size));
case AF_INET6:
@@ -102,7 +104,8 @@ inet_ntop4(const unsigned char *src, char *dst, size_t size)
static const char fmt[] = "%u.%u.%u.%u";
char tmp[sizeof "255.255.255.255"];
if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) > size) {
if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) > size)
{
errno = ENOSPC;
return (NULL);
}
@@ -127,7 +130,7 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
* to use pointer overlays. All the world's not a VAX.
*/
char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
struct { int base, len; } best, cur;
struct { int base, len; } best = { 0,0 }, cur = { 0,0 };
unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ];
int i;
@@ -141,21 +144,27 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
best.base = -1;
cur.base = -1;
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
if (words[i] == 0) {
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++)
{
if (words[i] == 0)
{
if (cur.base == -1)
cur.base = i, cur.len = 1;
else
cur.len++;
} else {
if (cur.base != -1) {
}
else
{
if (cur.base != -1)
{
if (best.base == -1 || cur.len > best.len)
best = cur;
cur.base = -1;
}
}
}
if (cur.base != -1) {
if (cur.base != -1)
{
if (best.base == -1 || cur.len > best.len)
best = cur;
}
@@ -166,10 +175,12 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
* Format the result.
*/
tp = tmp;
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++)
{
/* Are we inside the best run of 0x00's? */
if (best.base != -1 && i >= best.base &&
i < (best.base + best.len)) {
i < (best.base + best.len))
{
if (i == best.base)
*tp++ = ':';
continue;
@@ -179,7 +190,8 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
*tp++ = ':';
/* Is this address an encapsulated IPv4? */
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)))
return (NULL);
tp += strlen(tp);
@@ -187,6 +199,7 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
}
tp += SPRINTF((tp, "%x", words[i]));
}
/* Was it a trailing run of 0x00's? */
if (best.base != -1 && (best.base + best.len) == (NS_IN6ADDRSZ / NS_INT16SZ))
*tp++ = ':';
@@ -195,12 +208,13 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
/*
* Check for overflow, copy, and we're done.
*/
if ((size_t)(tp - tmp) > size) {
if ((size_t)(tp - tmp) > size)
{
errno = ENOSPC;
return (NULL);
}
strcpy(dst, tmp);
return (dst);
}
#endif

View File

@@ -1,3 +1,5 @@
/* $Id$ */
#ifndef ARES_NAMESER_H
#define ARES_NAMESER_H

View File

@@ -17,10 +17,19 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#else
#ifdef WIN32
#include "config-win32.h"
#endif
/* simple work-around for now, for systems without configure support */
#ifndef __DJGPP__
#define ssize_t int
#endif
#ifndef _MSC_VER
#define socklen_t int
#endif
#endif /* HAVE_CONFIG_H */
/* Recent autoconf versions define these symbols in config.h. We don't want
them (since they collide with the libcurl ones when we build
@@ -35,7 +44,8 @@
/* now typedef our socket type */
#if defined(WIN32) && !defined(WATT32)
#include <winsock.h>
#include <winsock2.h>
#include <ws2tcpip.h>
typedef SOCKET ares_socket_t;
#define ARES_SOCKET_BAD INVALID_SOCKET
#else
@@ -58,7 +68,7 @@ typedef int ares_socket_t;
#endif
#if (defined(WIN32) || defined(WATT32)) && \
!(defined(__MINGW32__) || defined(NETWARE))
!(defined(__MINGW32__) || defined(NETWARE) || defined(__DJGPP__))
/* protos for the functions we provide in windows_port.c */
int ares_strncasecmp(const char *s1, const char *s2, int n);
int ares_strcasecmp(const char *s1, const char *s2);

View File

@@ -1,213 +0,0 @@
# Microsoft Developer Studio Generated NMAKE File, Based on adig.dsp
!IF "$(CFG)" == ""
CFG=adig - Win32 Debug
!MESSAGE No configuration specified. Defaulting to adig - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "adig - Win32 Release" && "$(CFG)" != "adig - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "adig.mak" CFG="adig - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "adig - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "adig - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "adig - Win32 Release"
OUTDIR=.\Release
INTDIR=.\Release
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\adig.exe"
!ELSE
ALL : "areslib - Win32 Release" "$(OUTDIR)\adig.exe"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"areslib - Win32 ReleaseCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\adig.obj"
-@erase "$(INTDIR)\getopt.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(OUTDIR)\adig.exe"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\adig.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\adig.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=wsock32.lib areslib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\adig.pdb" /machine:I386 /out:"$(OUTDIR)\adig.exe" /libpath:"..\areslib\Release"
LINK32_OBJS= \
"$(INTDIR)\adig.obj" \
"$(INTDIR)\getopt.obj" \
"..\areslib\Release\areslib.lib"
"$(OUTDIR)\adig.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ELSEIF "$(CFG)" == "adig - Win32 Debug"
OUTDIR=.\Debug
INTDIR=.\Debug
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\adig.exe"
!ELSE
ALL : "areslib - Win32 Debug" "$(OUTDIR)\adig.exe"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"areslib - Win32 DebugCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\adig.obj"
-@erase "$(INTDIR)\getopt.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(INTDIR)\vc60.pdb"
-@erase "$(OUTDIR)\adig.exe"
-@erase "$(OUTDIR)\adig.ilk"
-@erase "$(OUTDIR)\adig.pdb"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\adig.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\adig.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=wsock32.lib areslib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\adig.pdb" /debug /machine:I386 /out:"$(OUTDIR)\adig.exe" /pdbtype:sept /libpath:"..\areslib\Debug"
LINK32_OBJS= \
"$(INTDIR)\adig.obj" \
"$(INTDIR)\getopt.obj" \
"..\areslib\Debug\areslib.lib"
"$(OUTDIR)\adig.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ENDIF
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("adig.dep")
!INCLUDE "adig.dep"
!ELSE
!MESSAGE Warning: cannot find "adig.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "adig - Win32 Release" || "$(CFG)" == "adig - Win32 Debug"
SOURCE=..\..\adig.c
"$(INTDIR)\adig.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\getopt.c
"$(INTDIR)\getopt.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
!IF "$(CFG)" == "adig - Win32 Release"
"areslib - Win32 Release" :
cd "..\areslib"
$(MAKE) /$(MAKEFLAGS) /F ".\areslib.mak" CFG="areslib - Win32 Release"
cd "..\adig"
"areslib - Win32 ReleaseCLEAN" :
cd "..\areslib"
$(MAKE) /$(MAKEFLAGS) /F ".\areslib.mak" CFG="areslib - Win32 Release" RECURSE=1 CLEAN
cd "..\adig"
!ELSEIF "$(CFG)" == "adig - Win32 Debug"
"areslib - Win32 Debug" :
cd "..\areslib"
$(MAKE) /$(MAKEFLAGS) /F ".\areslib.mak" CFG="areslib - Win32 Debug"
cd "..\adig"
"areslib - Win32 DebugCLEAN" :
cd "..\areslib"
$(MAKE) /$(MAKEFLAGS) /F ".\areslib.mak" CFG="areslib - Win32 Debug" RECURSE=1 CLEAN
cd "..\adig"
!ENDIF
!ENDIF

View File

@@ -1,77 +0,0 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: areslib - Win32 Release--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\liren\LOCALS~1\Temp\RSP615A.tmp" with contents
[
/nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /Fp"Release/areslib.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c
"Z:\ARES-1.1.1\ares_gethostbyname.c"
"Z:\ARES-1.1.1\ares_init.c"
]
Creating command line "cl.exe @C:\DOCUME~1\liren\LOCALS~1\Temp\RSP615A.tmp"
Creating temporary file "C:\DOCUME~1\liren\LOCALS~1\Temp\RSP615B.tmp" with contents
[
/nologo /out:"Release\areslib.lib"
".\Release\ares__close_sockets.obj"
".\Release\ares__get_hostent.obj"
".\Release\ares__read_line.obj"
".\Release\ares_destroy.obj"
".\Release\ares_expand_name.obj"
".\Release\ares_fds.obj"
".\Release\ares_free_errmem.obj"
".\Release\ares_free_hostent.obj"
".\Release\ares_free_string.obj"
".\Release\ares_gethostbyaddr.obj"
".\Release\ares_gethostbyname.obj"
".\Release\ares_init.obj"
".\Release\ares_mkquery.obj"
".\Release\ares_parse_a_reply.obj"
".\Release\ares_parse_ptr_reply.obj"
".\Release\ares_process.obj"
".\Release\ares_query.obj"
".\Release\ares_search.obj"
".\Release\ares_send.obj"
".\Release\ares_strerror.obj"
".\Release\ares_timeout.obj"
".\Release\windows_port.obj"
]
Creating command line "link.exe -lib @C:\DOCUME~1\liren\LOCALS~1\Temp\RSP615B.tmp"
<h3>Output Window</h3>
Compiling...
ares_gethostbyname.c
Z:\ARES-1.1.1\nameser.h(153) : warning C4005: 'NOERROR' : macro redefinition
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\winerror.h(8022) : see previous definition of 'NOERROR'
ares_init.c
Z:\ARES-1.1.1\nameser.h(153) : warning C4005: 'NOERROR' : macro redefinition
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\winerror.h(8022) : see previous definition of 'NOERROR'
Z:\ARES-1.1.1\ares_init.c(141) : warning C4013: '_getpid' undefined; assuming extern returning int
Z:\ARES-1.1.1\ares_init.c(236) : warning C4101: 'p' : unreferenced local variable
Z:\ARES-1.1.1\ares_init.c(237) : warning C4101: 'linesize' : unreferenced local variable
Z:\ARES-1.1.1\ares_init.c(235) : warning C4101: 'fp' : unreferenced local variable
Creating library...
<h3>
--------------------Configuration: adig - Win32 Release--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\liren\LOCALS~1\Temp\RSP615C.tmp" with contents
[
wsock32.lib areslib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"Release/adig.pdb" /machine:I386 /out:"Release/adig.exe" /libpath:"..\areslib\Release"
".\Release\adig.obj"
".\Release\getopt.obj"
"\ARES-1.1.1\vc\areslib\Release\areslib.lib"
]
Creating command line "link.exe @C:\DOCUME~1\liren\LOCALS~1\Temp\RSP615C.tmp"
<h3>Output Window</h3>
Linking...
<h3>Results</h3>
adig.exe - 0 error(s), 6 warning(s)
</pre>
</body>
</html>

View File

@@ -1,223 +0,0 @@
# Microsoft Developer Studio Generated NMAKE File, Based on ahost.dsp
!IF "$(CFG)" == ""
CFG=ahost - Win32 Debug
!MESSAGE No configuration specified. Defaulting to ahost - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "ahost - Win32 Release" && "$(CFG)" != "ahost - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "ahost.mak" CFG="ahost - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "ahost - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "ahost - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "ahost - Win32 Release"
OUTDIR=.\Release
INTDIR=.\Release
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\ahost.exe"
!ELSE
ALL : "areslib - Win32 Release" "$(OUTDIR)\ahost.exe"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"areslib - Win32 ReleaseCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\ahost.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(OUTDIR)\ahost.exe"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\ahost.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ahost.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=wsock32.lib areslib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\ahost.pdb" /machine:I386 /out:"$(OUTDIR)\ahost.exe" /libpath:"..\areslib\Release"
LINK32_OBJS= \
"$(INTDIR)\ahost.obj" \
"..\areslib\Release\areslib.lib"
"$(OUTDIR)\ahost.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ELSEIF "$(CFG)" == "ahost - Win32 Debug"
OUTDIR=.\Debug
INTDIR=.\Debug
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\ahost.exe" "$(OUTDIR)\ahost.bsc"
!ELSE
ALL : "areslib - Win32 Debug" "$(OUTDIR)\ahost.exe" "$(OUTDIR)\ahost.bsc"
!ENDIF
!IF "$(RECURSE)" == "1"
CLEAN :"areslib - Win32 DebugCLEAN"
!ELSE
CLEAN :
!ENDIF
-@erase "$(INTDIR)\ahost.obj"
-@erase "$(INTDIR)\ahost.sbr"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(INTDIR)\vc60.pdb"
-@erase "$(OUTDIR)\ahost.bsc"
-@erase "$(OUTDIR)\ahost.exe"
-@erase "$(OUTDIR)\ahost.ilk"
-@erase "$(OUTDIR)\ahost.pdb"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\ahost.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ahost.bsc"
BSC32_SBRS= \
"$(INTDIR)\ahost.sbr"
"$(OUTDIR)\ahost.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
$(BSC32) @<<
$(BSC32_FLAGS) $(BSC32_SBRS)
<<
LINK32=link.exe
LINK32_FLAGS=wsock32.lib areslib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\ahost.pdb" /debug /machine:I386 /out:"$(OUTDIR)\ahost.exe" /pdbtype:sept /libpath:"..\areslib\Debug"
LINK32_OBJS= \
"$(INTDIR)\ahost.obj" \
"..\areslib\Debug\areslib.lib"
"$(OUTDIR)\ahost.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ENDIF
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("ahost.dep")
!INCLUDE "ahost.dep"
!ELSE
!MESSAGE Warning: cannot find "ahost.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "ahost - Win32 Release" || "$(CFG)" == "ahost - Win32 Debug"
SOURCE=..\..\ahost.c
!IF "$(CFG)" == "ahost - Win32 Release"
"$(INTDIR)\ahost.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
!ELSEIF "$(CFG)" == "ahost - Win32 Debug"
"$(INTDIR)\ahost.obj" "$(INTDIR)\ahost.sbr" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
!ENDIF
!IF "$(CFG)" == "ahost - Win32 Release"
"areslib - Win32 Release" :
cd "..\areslib"
$(MAKE) /$(MAKEFLAGS) /F ".\areslib.mak" CFG="areslib - Win32 Release"
cd "..\ahost"
"areslib - Win32 ReleaseCLEAN" :
cd "..\areslib"
$(MAKE) /$(MAKEFLAGS) /F ".\areslib.mak" CFG="areslib - Win32 Release" RECURSE=1 CLEAN
cd "..\ahost"
!ELSEIF "$(CFG)" == "ahost - Win32 Debug"
"areslib - Win32 Debug" :
cd "..\areslib"
$(MAKE) /$(MAKEFLAGS) /F ".\areslib.mak" CFG="areslib - Win32 Debug"
cd "..\ahost"
"areslib - Win32 DebugCLEAN" :
cd "..\areslib"
$(MAKE) /$(MAKEFLAGS) /F ".\areslib.mak" CFG="areslib - Win32 Debug" RECURSE=1 CLEAN
cd "..\ahost"
!ENDIF
!ENDIF

View File

@@ -1,16 +0,0 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: ahost - Win32 Release--------------------
</h3>
<h3>Command Lines</h3>
<h3>Results</h3>
ahost.exe - 0 error(s), 0 warning(s)
</pre>
</body>
</html>

View File

@@ -97,6 +97,10 @@ SOURCE=..\..\ares__read_line.c
# End Source File
# Begin Source File
SOURCE=..\..\ares_cancel.c
# End Source File
# Begin Source File
SOURCE=..\..\ares_destroy.c
# End Source File
# Begin Source File
@@ -137,6 +141,10 @@ SOURCE=..\..\ares_parse_a_reply.c
# End Source File
# Begin Source File
SOURCE=..\..\ares_parse_aaaa_reply.c
# End Source File
# Begin Source File
SOURCE=..\..\ares_parse_ptr_reply.c
# End Source File
# Begin Source File
@@ -153,14 +161,6 @@ SOURCE=..\..\ares_search.c
# End Source File
# Begin Source File
SOURCE=..\..\ares_cancel.c
# End Source File
# Begin Source File
SOURCE=..\..\ares_version.c
# End Source File
# Begin Source File
SOURCE=..\..\ares_send.c
# End Source File
# Begin Source File
@@ -173,6 +173,22 @@ SOURCE=..\..\ares_timeout.c
# End Source File
# Begin Source File
SOURCE=..\..\ares_version.c
# End Source File
# Begin Source File
SOURCE=..\..\bitncmp.c
# End Source File
# Begin Source File
SOURCE=..\..\inet_net_pton.c
# End Source File
# Begin Source File
SOURCE=..\..\inet_ntop.c
# End Source File
# Begin Source File
SOURCE=..\..\windows_port.c
# End Source File
# End Group
@@ -189,7 +205,7 @@ SOURCE=..\..\ares_dns.h
# End Source File
# Begin Source File
SOURCE=..\..\ares_version.h
SOURCE=..\..\ares_ipv6.h
# End Source File
# Begin Source File
@@ -197,6 +213,22 @@ SOURCE=..\..\ares_private.h
# End Source File
# Begin Source File
SOURCE=..\..\ares_version.h
# End Source File
# Begin Source File
SOURCE=..\..\bitncmp.h
# End Source File
# Begin Source File
SOURCE=..\..\inet_net_pton.h
# End Source File
# Begin Source File
SOURCE=..\..\inet_ntop.h
# End Source File
# Begin Source File
SOURCE=..\..\nameser.h
# End Source File
# End Group

View File

@@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "areslib"=.\areslib.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@@ -1,367 +0,0 @@
# Microsoft Developer Studio Generated NMAKE File, Based on areslib.dsp
!IF "$(CFG)" == ""
CFG=areslib - Win32 Debug
!MESSAGE No configuration specified. Defaulting to areslib - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "areslib - Win32 Release" && "$(CFG)" != "areslib - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "areslib.mak" CFG="areslib - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "areslib - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "areslib - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "areslib - Win32 Release"
OUTDIR=.\Release
INTDIR=.\Release
# Begin Custom Macros
OutDir=.\Release
# End Custom Macros
ALL : "$(OUTDIR)\areslib.lib"
CLEAN :
-@erase "$(INTDIR)\ares__close_sockets.obj"
-@erase "$(INTDIR)\ares__get_hostent.obj"
-@erase "$(INTDIR)\ares__read_line.obj"
-@erase "$(INTDIR)\ares_destroy.obj"
-@erase "$(INTDIR)\ares_expand_name.obj"
-@erase "$(INTDIR)\ares_fds.obj"
-@erase "$(INTDIR)\ares_free_hostent.obj"
-@erase "$(INTDIR)\ares_free_string.obj"
-@erase "$(INTDIR)\ares_gethostbyaddr.obj"
-@erase "$(INTDIR)\ares_gethostbyname.obj"
-@erase "$(INTDIR)\ares_init.obj"
-@erase "$(INTDIR)\ares_mkquery.obj"
-@erase "$(INTDIR)\ares_parse_a_reply.obj"
-@erase "$(INTDIR)\ares_parse_ptr_reply.obj"
-@erase "$(INTDIR)\ares_process.obj"
-@erase "$(INTDIR)\ares_query.obj"
-@erase "$(INTDIR)\ares_search.obj"
-@erase "$(INTDIR)\ares_send.obj"
-@erase "$(INTDIR)\ares_strerror.obj"
-@erase "$(INTDIR)\ares_timeout.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(INTDIR)\windows_port.obj"
-@erase "$(OUTDIR)\areslib.lib"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /Fp"$(INTDIR)\areslib.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\areslib.bsc"
BSC32_SBRS= \
LIB32=link.exe -lib
LIB32_FLAGS=/nologo /out:"$(OUTDIR)\areslib.lib"
LIB32_OBJS= \
"$(INTDIR)\ares__close_sockets.obj" \
"$(INTDIR)\ares__get_hostent.obj" \
"$(INTDIR)\ares__read_line.obj" \
"$(INTDIR)\ares_destroy.obj" \
"$(INTDIR)\ares_expand_name.obj" \
"$(INTDIR)\ares_fds.obj" \
"$(INTDIR)\ares_free_hostent.obj" \
"$(INTDIR)\ares_free_string.obj" \
"$(INTDIR)\ares_gethostbyaddr.obj" \
"$(INTDIR)\ares_gethostbyname.obj" \
"$(INTDIR)\ares_init.obj" \
"$(INTDIR)\ares_mkquery.obj" \
"$(INTDIR)\ares_parse_a_reply.obj" \
"$(INTDIR)\ares_parse_ptr_reply.obj" \
"$(INTDIR)\ares_process.obj" \
"$(INTDIR)\ares_query.obj" \
"$(INTDIR)\ares_search.obj" \
"$(INTDIR)\ares_cancel.obj" \
"$(INTDIR)\ares_version.obj" \
"$(INTDIR)\ares_send.obj" \
"$(INTDIR)\ares_strerror.obj" \
"$(INTDIR)\ares_timeout.obj" \
"$(INTDIR)\windows_port.obj"
"$(OUTDIR)\areslib.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
$(LIB32) @<<
$(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
<<
!ELSEIF "$(CFG)" == "areslib - Win32 Debug"
OUTDIR=.\Debug
INTDIR=.\Debug
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
ALL : "$(OUTDIR)\areslib.lib"
CLEAN :
-@erase "$(INTDIR)\ares__close_sockets.obj"
-@erase "$(INTDIR)\ares__get_hostent.obj"
-@erase "$(INTDIR)\ares__read_line.obj"
-@erase "$(INTDIR)\ares_destroy.obj"
-@erase "$(INTDIR)\ares_expand_name.obj"
-@erase "$(INTDIR)\ares_fds.obj"
-@erase "$(INTDIR)\ares_free_hostent.obj"
-@erase "$(INTDIR)\ares_free_string.obj"
-@erase "$(INTDIR)\ares_gethostbyaddr.obj"
-@erase "$(INTDIR)\ares_gethostbyname.obj"
-@erase "$(INTDIR)\ares_init.obj"
-@erase "$(INTDIR)\ares_mkquery.obj"
-@erase "$(INTDIR)\ares_parse_a_reply.obj"
-@erase "$(INTDIR)\ares_parse_ptr_reply.obj"
-@erase "$(INTDIR)\ares_process.obj"
-@erase "$(INTDIR)\ares_query.obj"
-@erase "$(INTDIR)\ares_search.obj"
-@erase "$(INTDIR)\ares_cancel.obj"
-@erase "$(INTDIR)\ares_version.obj"
-@erase "$(INTDIR)\ares_send.obj"
-@erase "$(INTDIR)\ares_strerror.obj"
-@erase "$(INTDIR)\ares_timeout.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(INTDIR)\vc60.pdb"
-@erase "$(INTDIR)\windows_port.obj"
-@erase "$(OUTDIR)\areslib.lib"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /ZI /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /Fp"$(INTDIR)\areslib.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\areslib.bsc"
BSC32_SBRS= \
LIB32=link.exe -lib
LIB32_FLAGS=/nologo /out:"$(OUTDIR)\areslib.lib"
LIB32_OBJS= \
"$(INTDIR)\ares__close_sockets.obj" \
"$(INTDIR)\ares__get_hostent.obj" \
"$(INTDIR)\ares__read_line.obj" \
"$(INTDIR)\ares_destroy.obj" \
"$(INTDIR)\ares_expand_name.obj" \
"$(INTDIR)\ares_fds.obj" \
"$(INTDIR)\ares_free_hostent.obj" \
"$(INTDIR)\ares_free_string.obj" \
"$(INTDIR)\ares_gethostbyaddr.obj" \
"$(INTDIR)\ares_gethostbyname.obj" \
"$(INTDIR)\ares_init.obj" \
"$(INTDIR)\ares_mkquery.obj" \
"$(INTDIR)\ares_parse_a_reply.obj" \
"$(INTDIR)\ares_parse_ptr_reply.obj" \
"$(INTDIR)\ares_process.obj" \
"$(INTDIR)\ares_query.obj" \
"$(INTDIR)\ares_search.obj" \
"$(INTDIR)\ares_send.obj" \
"$(INTDIR)\ares_strerror.obj" \
"$(INTDIR)\ares_timeout.obj" \
"$(INTDIR)\windows_port.obj"
"$(OUTDIR)\areslib.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
$(LIB32) @<<
$(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
<<
!ENDIF
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("areslib.dep")
!INCLUDE "areslib.dep"
!ELSE
!MESSAGE Warning: cannot find "areslib.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "areslib - Win32 Release" || "$(CFG)" == "areslib - Win32 Debug"
SOURCE=..\..\ares__close_sockets.c
"$(INTDIR)\ares__close_sockets.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\ares__get_hostent.c
"$(INTDIR)\ares__get_hostent.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\ares__read_line.c
"$(INTDIR)\ares__read_line.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\ares_destroy.c
"$(INTDIR)\ares_destroy.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\ares_expand_name.c
"$(INTDIR)\ares_expand_name.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\ares_fds.c
"$(INTDIR)\ares_fds.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\ares_free_hostent.c
"$(INTDIR)\ares_free_hostent.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\ares_free_string.c
"$(INTDIR)\ares_free_string.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\ares_gethostbyaddr.c
"$(INTDIR)\ares_gethostbyaddr.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\ares_gethostbyname.c
"$(INTDIR)\ares_gethostbyname.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\ares_init.c
"$(INTDIR)\ares_init.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\ares_mkquery.c
"$(INTDIR)\ares_mkquery.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\ares_parse_a_reply.c
"$(INTDIR)\ares_parse_a_reply.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\ares_parse_ptr_reply.c
"$(INTDIR)\ares_parse_ptr_reply.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\ares_process.c
"$(INTDIR)\ares_process.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\ares_query.c
"$(INTDIR)\ares_query.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\ares_search.c
"$(INTDIR)\ares_search.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\ares_version.c
"$(INTDIR)\ares_version.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\ares_cancel.c
"$(INTDIR)\ares_cancel.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\ares_send.c
"$(INTDIR)\ares_send.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\ares_strerror.c
"$(INTDIR)\ares_strerror.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\ares_timeout.c
"$(INTDIR)\ares_timeout.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=..\..\windows_port.c
"$(INTDIR)\windows_port.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
!ENDIF

View File

@@ -1,125 +0,0 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: areslib - Win32 Release--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\liren\LOCALS~1\Temp\RSP603D.tmp" with contents
[
/nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /Fp"Release/areslib.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c
"Z:\ares-1.1.1\ares__close_sockets.c"
"Z:\ares-1.1.1\ares__get_hostent.c"
"Z:\ares-1.1.1\ares__read_line.c"
"Z:\ares-1.1.1\ares_destroy.c"
"Z:\ares-1.1.1\ares_expand_name.c"
"Z:\ares-1.1.1\ares_fds.c"
"Z:\ares-1.1.1\ares_free_errmem.c"
"Z:\ares-1.1.1\ares_free_hostent.c"
"Z:\ares-1.1.1\ares_free_string.c"
"Z:\ares-1.1.1\ares_gethostbyaddr.c"
"Z:\ares-1.1.1\ares_gethostbyname.c"
"Z:\ares-1.1.1\ares_init.c"
"Z:\ares-1.1.1\ares_mkquery.c"
"Z:\ares-1.1.1\ares_parse_a_reply.c"
"Z:\ares-1.1.1\ares_parse_ptr_reply.c"
"Z:\ares-1.1.1\ares_process.c"
"Z:\ares-1.1.1\ares_query.c"
"Z:\ares-1.1.1\ares_search.c"
"Z:\ares-1.1.1\ares_send.c"
"Z:\ares-1.1.1\ares_strerror.c"
"Z:\ares-1.1.1\ares_timeout.c"
"Z:\ares-1.1.1\windows_port.c"
]
Creating command line "cl.exe @C:\DOCUME~1\liren\LOCALS~1\Temp\RSP603D.tmp"
Creating temporary file "C:\DOCUME~1\liren\LOCALS~1\Temp\RSP603E.tmp" with contents
[
/nologo /out:"Release\areslib.lib"
".\Release\ares__close_sockets.obj"
".\Release\ares__get_hostent.obj"
".\Release\ares__read_line.obj"
".\Release\ares_destroy.obj"
".\Release\ares_expand_name.obj"
".\Release\ares_fds.obj"
".\Release\ares_free_errmem.obj"
".\Release\ares_free_hostent.obj"
".\Release\ares_free_string.obj"
".\Release\ares_gethostbyaddr.obj"
".\Release\ares_gethostbyname.obj"
".\Release\ares_init.obj"
".\Release\ares_mkquery.obj"
".\Release\ares_parse_a_reply.obj"
".\Release\ares_parse_ptr_reply.obj"
".\Release\ares_process.obj"
".\Release\ares_query.obj"
".\Release\ares_search.obj"
".\Release\ares_send.obj"
".\Release\ares_strerror.obj"
".\Release\ares_timeout.obj"
".\Release\windows_port.obj"
]
Creating command line "link.exe -lib @C:\DOCUME~1\liren\LOCALS~1\Temp\RSP603E.tmp"
<h3>Output Window</h3>
Compiling...
ares__close_sockets.c
Z:\ares-1.1.1\ares__close_sockets.c(46) : warning C4013: 'close' undefined; assuming extern returning int
ares__get_hostent.c
ares__read_line.c
ares_destroy.c
ares_expand_name.c
Z:\ares-1.1.1\nameser.h(153) : warning C4005: 'NOERROR' : macro redefinition
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\winerror.h(8022) : see previous definition of 'NOERROR'
ares_fds.c
ares_free_errmem.c
ares_free_hostent.c
ares_free_string.c
ares_gethostbyaddr.c
Z:\ares-1.1.1\nameser.h(153) : warning C4005: 'NOERROR' : macro redefinition
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\winerror.h(8022) : see previous definition of 'NOERROR'
ares_gethostbyname.c
Z:\ares-1.1.1\nameser.h(153) : warning C4005: 'NOERROR' : macro redefinition
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\winerror.h(8022) : see previous definition of 'NOERROR'
ares_init.c
Z:\ares-1.1.1\nameser.h(153) : warning C4005: 'NOERROR' : macro redefinition
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\winerror.h(8022) : see previous definition of 'NOERROR'
Z:\ares-1.1.1\ares_init.c(141) : warning C4013: '_getpid' undefined; assuming extern returning int
Z:\ares-1.1.1\ares_init.c(236) : warning C4101: 'p' : unreferenced local variable
Z:\ares-1.1.1\ares_init.c(237) : warning C4101: 'linesize' : unreferenced local variable
Z:\ares-1.1.1\ares_init.c(235) : warning C4101: 'fp' : unreferenced local variable
ares_mkquery.c
Z:\ares-1.1.1\nameser.h(153) : warning C4005: 'NOERROR' : macro redefinition
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\winerror.h(8022) : see previous definition of 'NOERROR'
ares_parse_a_reply.c
Z:\ares-1.1.1\nameser.h(153) : warning C4005: 'NOERROR' : macro redefinition
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\winerror.h(8022) : see previous definition of 'NOERROR'
Z:\ares-1.1.1\ares_parse_a_reply.c(90) : warning C4018: '<' : signed/unsigned mismatch
ares_parse_ptr_reply.c
Z:\ares-1.1.1\nameser.h(153) : warning C4005: 'NOERROR' : macro redefinition
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\winerror.h(8022) : see previous definition of 'NOERROR'
Z:\ares-1.1.1\ares_parse_ptr_reply.c(71) : warning C4018: '<' : signed/unsigned mismatch
ares_process.c
Z:\ares-1.1.1\nameser.h(153) : warning C4005: 'NOERROR' : macro redefinition
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\winerror.h(8022) : see previous definition of 'NOERROR'
ares_query.c
Z:\ares-1.1.1\nameser.h(153) : warning C4005: 'NOERROR' : macro redefinition
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\winerror.h(8022) : see previous definition of 'NOERROR'
ares_search.c
Z:\ares-1.1.1\ares_search.c(229) : warning C4013: 'strncasecmp' undefined; assuming extern returning int
ares_send.c
Z:\ares-1.1.1\nameser.h(153) : warning C4005: 'NOERROR' : macro redefinition
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\winerror.h(8022) : see previous definition of 'NOERROR'
ares_strerror.c
ares_timeout.c
windows_port.c
Z:\ares-1.1.1\nameser.h(153) : warning C4005: 'NOERROR' : macro redefinition
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\winerror.h(8022) : see previous definition of 'NOERROR'
Creating library...
<h3>Results</h3>
areslib.lib - 0 error(s), 19 warning(s)
</pre>
</body>
</html>

View File

@@ -209,7 +209,7 @@ ${LIBTOOLIZE:-libtoolize} --copy --automake --force || die "The libtool command
fi
echo "buildconf: running automake"
${AUTOMAKE:-automake} -a || die "The automake command failed"
${AUTOMAKE:-automake} -a -c || die "The automake command failed"
echo "buildconf: OK"
exit 0

View File

@@ -122,13 +122,13 @@ case $host in
*-*-mingw*)
AC_DEFINE(BUILDING_LIBCURL, 1, [when building libcurl itself])
AC_MSG_RESULT(yes)
<EFBFBD> <20>AC_MSG_CHECKING([if we need CURL_STATICLIB])
AC_MSG_CHECKING([if we need CURL_STATICLIB])
if test "X$enable_shared" = "Xno"
then
AC_DEFINE(CURL_STATICLIB, 1, [when not building a shared library])
AC_MSG_RESULT(yes)
<EFBFBD> <20>else
<EFBFBD> <20> <20>AC_MSG_RESULT(no)
else
AC_MSG_RESULT(no)
fi
;;
*)
@@ -251,6 +251,21 @@ AC_HELP_STRING([--disable-telnet],[Disable TELNET support]),
esac ],
AC_MSG_RESULT(yes)
)
AC_MSG_CHECKING([whether to support tftp])
AC_ARG_ENABLE(tftp,
AC_HELP_STRING([--enable-tftp],[Enable TFTP support])
AC_HELP_STRING([--disable-tftp],[Disable TFTP support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
AC_SUBST(CURL_DISABLE_TFTP, [1])
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
dnl **********************************************************************
dnl Check for built-in manual
@@ -1419,6 +1434,8 @@ AC_CHECK_HEADERS(
libgen.h \
locale.h \
errno.h \
arpa/tftp.h \
sys/filio.h \
setjmp.h,
dnl to do if not found
[],
@@ -1487,6 +1504,13 @@ dnl Checks for library functions.
dnl AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIGNAL
dnl AC_FUNC_VPRINTF
case $host in
*msdosdjgpp)
ac_cv_func_pipe=no
skipcheck_pipe=yes
AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
;;
esac
AC_CHECK_FUNCS( strtoll \
socket \
select \
@@ -1524,7 +1548,9 @@ AC_CHECK_FUNCS( strtoll \
dnl if found
[],
dnl if not found, $ac_func is the name we check for
func="$ac_func"
func="$ac_func"
eval skipcheck=\$skipcheck_$func
if test "x$skipcheck" != "xyes"; then
AC_MSG_CHECKING([deeper for $func])
AC_TRY_LINK( [],
[ $func ();],
@@ -1534,7 +1560,7 @@ dnl if not found, $ac_func is the name we check for
AC_DEFINE_UNQUOTED($def, 1, [If you have $func]),
AC_MSG_RESULT(but still no)
)
fi
)
dnl For some reason, the check above doesn't properly detect select() with
@@ -1572,6 +1598,19 @@ AC_CHECK_DECL(basename, ,
#ifdef HAVE_LIBGEN_H
#include <libgen.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
)
AC_CHECK_DECL(inet_pton, ,
AC_DEFINE(HAVE_NO_INET_PTON_PROTO, 1,
[Defined if no inet_pton() prototype available]),
[
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
]
)
AC_MSG_CHECKING([if we are Mac OS X (to disable poll)])
@@ -1673,7 +1712,7 @@ AC_HELP_STRING([--disable-ares],[Disable ares for name lookups]),
*) AC_MSG_RESULT(yes)
if test "x$IPV6_ENABLED" = "x1"; then
AC_MSG_ERROR([ares doesn't work with ipv6, disable ipv6 to use ares])
AC_MSG_NOTICE([ares may not work properly with ipv6])
fi
AC_DEFINE(USE_ARES, 1, [Define if you want to enable ares support])
@@ -1767,7 +1806,6 @@ AC_HELP_STRING([--disable-sspi],[Disable SSPI]),
AC_MSG_RESULT(yes)
AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
AC_SUBST(USE_WINDOWS_SSPI)
LIBS="$LIBS -lsecur32"
curl_sspi_msg="yes"
;;
*)

View File

@@ -116,6 +116,9 @@ while test $# -gt 0; do
if test "@CURL_DISABLE_DICT@" != "1"; then
echo "DICT"
fi
if test "@CURL_DISABLE_TFTP@" != "1"; then
echo "TFTP"
fi
;;
--version)
echo libcurl @VERSION@

View File

@@ -150,6 +150,11 @@ Scheme
Bigloo binding written by Kirill Lisovsky
http://curl.haxx.se/libcurl/scheme/
S-Lang
S-Lang binding written by John E Davis
http://www.jedsoft.org/slang/modules/curl.html
Tcl
Tclcurl is written by Andr<64>s Garc<72>a
@@ -161,7 +166,7 @@ Visual Basic
http://sourceforge.net/projects/libcurl-vb/
Q
The libcurl module is part of the default install
http://q-lang.sourceforge.net/
wxWidgets

View File

@@ -4,11 +4,11 @@
| (__| |_| | _ <| |___
\___|\___/|_| \_\_____|
To Think About When Contributing Source Code
When Contributing Source Code
This document is intended to offer some simple guidelines that can be useful
to keep in mind when you decide to contribute to the project. This concerns
new features as well as corrections to existing flaws or bugs.
This document is intended to offer guidelines that can be useful to keep in
mind when you decide to contribute to the project. This concerns new features
as well as corrections to existing flaws or bugs.
Join the Community
@@ -20,13 +20,26 @@ Join the Community
The License Issue
When contributing with code, you agree to put your changes and new code under
the same license curl and libcurl is already using unless stated otherwise.
the same license curl and libcurl is already using unless stated and agreed
otherwise.
If you add a larger piece of code, you can opt to make that file or set of
files to use a different license as long as they don't enforce any changes to
the rest of the package and they make sense. Such "separate parts" can not be
GPL (as we don't want the GPL virus to attack users of libcurl) but they must
use "GPL compatible" licenses.
GPL licensed (as we don't want copyleft to affect users of libcurl) but they
must use "GPL compatible" licenses (as we want to allow users to use libcurl
properly in GPL licensed environments).
When changing existing source code, you do not alter the copyright of the
original file(s). The copyright will still be owned by the original
creator(s) or those who have been assigned copyright by the original
author(s).
By submitting a patch to the curl project, you are assumed to have the right
to the code and to be allowed by your employer or whatever to hand over that
patch/code to us. We will credit you for your changes as far as possible, to
give credit but also to keep a trace back to who made what changes. Please
always provide us with your full real name when contributing!
What To Read

View File

@@ -1,12 +1,12 @@
Date: September 1, 2005
Author: Daniel Stenberg <daniel@haxx.se>
URL: http://curl.haxx.se/legal/distro-dilemma.html
Date: October 27, 2005
Author: Daniel Stenberg <daniel@haxx.se>
URL: http://curl.haxx.se/legal/distro-dilemma.html
Condition
This document is written to describe the sitution as it is right now. libcurl
7.14.0 is currently the latest version available. Things may (or perhaps
will) of course change in the future.
This document is written to describe the situation as it is right
now. libcurl 7.15.0 is currently the latest version available. Things may (or
perhaps will) of course change in the future.
This document reflects my view and understanding of these things. Please tell
me where and how you think I'm wrong, and I'll try to correct my mistakes.
@@ -16,7 +16,7 @@ Background
The Free Software Foundation has deemed the Original BSD license[1] to be
"incompatible"[2] with GPL[3]. I'd rather say it is the other way around, but
the point is the same: if you distribute a binary version of a GPL program,
it MUST NOT be linked with any Original BSD-licenced parts or
it MUST NOT be linked with any Original BSD-licensed parts or
libraries. Doing so will violate the GPL license. For a long time, very many
GPL licensed programs have avoided this license mess by adding an
exception[8] to their license. And many others have just closed their eyes
@@ -33,12 +33,15 @@ Background
tend to), you have a clash. GPL vs Original BSD.
This dilemma is not libcurl-specific nor is it specific to any particular
Linux distro.
Linux distro. (This article mentions and refers to Debian several times, but
only because Debian seems to be the only Linux distro to have faced this
issue yet since no other distro is shipping libcurl built with two SSL
libraries.)
Part of the Operating System
This would not be a problem if the used lib would be considered part of the
uderlying operating system, as then the GPL license has an exception
underlying operating system, as then the GPL license has an exception
clause[6] that allows applications to use such libs without having to be
allowed to distribute it or its sources. Possibly some distros will claim
that OpenSSL is part of their operating system.
@@ -83,6 +86,18 @@ GnuTLS vs OpenSSL
the application authors didn't want to or was unable to add an exception to
their GPL license. Alas, the license problem hit the fan again.
GnuTLS
- LGPL licensened
- supports SRP
- lacks SSLv2 support
- lacks MD2 support (used by at least some CA certs)
OpenSSL
- Original BSD licensened
- lacks SRP
- supports SSLv2
- older and more widely used
The Better License, Original BSD or LGPL?
It isn't obvious or without debate to any objective interested party that
@@ -92,8 +107,13 @@ The Better License, Original BSD or LGPL?
Instead, I think we should accept the fact that the SSL/TLS libraries and
their different licenses will fit different applications and their authors
differently depending on the applications' licenses and their general usage
pattern (considering how LGPL libraries can be burdonsome for embedded
systems usage).
pattern (considering how LGPL libraries for example can be burdensome for
embedded systems usage).
In Debian land, there seems to be a common opinion that LGPL is "maximally
compatible" with apps while Original BSD is not. Like this:
http://lists.debian.org/debian-devel/2005/09/msg01417.html
More SSL Libraries
@@ -116,6 +136,16 @@ Project cURL Angle of this Problem
affects users - GPL application authors only - of our lib as it comes
included and delivered on some distros.
libcurl has different ABI when built with different SSL/TLS libraries due to
two reasons:
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
functions.
2. The CURLOPT_SSL_CTX_FUNCTION option is not possible to "emulate" on GnuTLS
but simply requires OpenSSL.
Distro Angle of this Problem
A distro can provide separate libcurls built with different SSL/TLS libraries
@@ -129,6 +159,12 @@ Fixing the Only Problem
The only problem is thus for distributions that want to offer libcurl
versions built with more than one SSL/TLS library.
Debian is now (since mid September 2005) providing two different devel
packages, one for libcurl built with OpenSSL and one built with GnuTLS. They
use different .so names and can this both be installed in a single system
simultaneously. This has previously been said as a transitional system not
desired to keep in the long run.
Since multiple libcurl binaries using different names are ruled out, we need
to come up with a way to have one single libcurl that someone uses different
underlying libraries. The best(?) approach currently suggested involves this:
@@ -170,6 +206,10 @@ When Will This Happen
code like today (without the use of lib2), should you decide to ignore the
problems outlined in this document.
Update: Work on this has been initiated by Richard Atterer:
http://curl.haxx.se/mail/lib-2005-09/0066.html
Footnotes
[1] = http://www.xfree86.org/3.3.6/COPYRIGHT2.html#6

123
docs/FAQ
View File

@@ -1,4 +1,4 @@
Updated: August 26, 2005 (http://curl.haxx.se/docs/faq.html)
Updated: November 2, 2005 (http://curl.haxx.se/docs/faq.html)
_ _ ____ _
___| | | | _ \| |
/ __| | | | |_) | |
@@ -16,6 +16,8 @@ FAQ
1.6 What do you get for making curl?
1.7 What about CURL from curl.com?
1.8 I have a problem who do I mail?
1.9 Where do I buy commercial support for curl?
1.10 How many are using curl?
2. Install Related Problems
2.1 configure doesn't find OpenSSL even when it is installed
@@ -88,6 +90,7 @@ FAQ
6.4 I have a program that uses LGPL libraries, can I use libcurl?
6.5 Can I modify curl/libcurl for my program and keep the changes secret?
6.6 Can you please change the curl/libcurl license to XXXX?
6.7 What are my obligations when using libcurl in my commerical apps?
7. PHP/CURL Issues
7.1 What is PHP/CURL?
@@ -148,6 +151,10 @@ FAQ
You can use libcurl for free in your application, be it open source,
commercial or closed-source.
libcurl is most probably the most portable, most powerful and most often
used C-based multi-platform file transfer library on this planet - be it
open source or commercial.
1.3 What is curl not?
Curl is *not* a wget clone. That is a common misconception. Never, during
@@ -205,7 +212,7 @@ FAQ
improvements and have them inserted in the main sources (of course on the
condition that developers agree on that the fixes are good).
The full list of the more than 400 contributors is found in the docs/THANKS
The full list of the more than 450 contributors is found in the docs/THANKS
file.
curl is developed by a community, with Daniel at the wheel.
@@ -259,6 +266,52 @@ FAQ
flaw is announced to the world, thus lessen the impact the problem will have
on existing users.
1.9 Where do I buy commercial support for curl?
curl is fully open source. It means you can hire any skilled engineer to fix
your curl-related problems.
We list available alternatives on the curl web site:
http://curl.haxx.se/support.html
1.10 How many are using curl?
It is impossible to tell.
We don't know how many users that knowingly have installed and use curl.
We don't know how many users that use curl without knowing that they are in
fact using it.
We don't know how many users that downloaded or installed curl and then
never use it.
Some facts to use as input to the math:
curl packages have been downloaded from the curl.haxx.se site well over a
million times. curl is installed by default with most Linux
distributions. curl is installed by default with Mac OS X. curl and libcurl
as used by numerous applications that include libcurl binaries in their
distribution packages (like Adobe Acrobat Reader and Google Earth).
More than 40 known named companies use curl in commercial environments and
products. More than 100 known named open source projects depend on
(lib)curl.
In a poll on the curl web site mid-2005, more than 50% of the 300+ answers
estimated a user base of one million users or more.
In March 2005, the "Linux Counter project" estimated a total Linux user base
of some 29 millions, while Netcraft detected some 4 million "active" Linux
based web servers. A guess is that a fair amount of these Linux
installations have curl installed.
http://curl.haxx.se/docs/companies.html
http://curl.haxx.se/docs/programs.html
http://curl.haxx.se/libcurl/using/apps.html
http://counter.li.org/estimates.php
http://news.netcraft.com/archives/2005/03/14/fedora_makes_rapid_progress.html
2. Install Related Problems
@@ -514,22 +567,24 @@ FAQ
- Server certificate. The server you communicate with has a server
certificate. You can and should verify this certificate to make sure that
you are truly talking to the real server and not a server impersonating
it. The server certificate verification process is made by using a
Certificate Authority certificate ("CA cert") that was used to sign the
server certificate. Server certificate verification is enabled by default
in curl and libcurl and is often the reason for problems as explained in
FAQ entry 4.12 and the SSLCERTS document
(http://curl.haxx.se/docs/sslcerts.html). Server certificates that are
"self-signed" or otherwise signed by a CA that you do not have a CA cert
for, cannot be verified. If the verification during a connect fails, you
are refused access. You then need to explicitly disable the verification
to connect to the server.
it.
- Certificate Authority certificate ("CA cert"). You often have several CA
certs in a CA cert bundle that can be used to verify a server certificate
that was signed by one of the authorities in the bundle. curl comes with a
default CA cert bundle. You can override the default.
The server certificate verification process is made by using a Certificate
Authority certificate ("CA cert") that was used to sign the server
certificate. Server certificate verification is enabled by default in curl
and libcurl and is often the reason for problems as explained in FAQ entry
4.12 and the SSLCERTS document
(http://curl.haxx.se/docs/sslcerts.html). Server certificates that are
"self-signed" or otherwise signed by a CA that you do not have a CA cert
for, cannot be verified. If the verification during a connect fails, you
are refused access. You then need to explicitly disable the verification
to connect to the server.
3.17 How do I list the root dir of an FTP server?
There are two ways. The way defined in the RFC is to use an encoded slash
@@ -546,6 +601,8 @@ FAQ
No.
But you could easily write your own program using libcurl to do such stunts.
4. Running Problems
@@ -751,10 +808,10 @@ FAQ
curl supports HTTP redirects fine (see item 3.8). Browsers generally support
at least two other ways to perform directs that curl does not:
1 - Meta tags. You can write a HTML tag that will cause the browser to
- Meta tags. You can write a HTML tag that will cause the browser to
redirect to another given URL after a certain time.
2 - Javascript. You can write a javascript program embeded in a HTML page
- Javascript. You can write a javascript program embeded in a HTML page
that redirects the browser to another given URL.
There is no way to make curl follow these redirects. You must either
@@ -793,8 +850,8 @@ FAQ
One solution to this problem could be to have a pointer to a struct that you
pass to the callback function. You set the pointer using the
curl_easy_setopt(CURLOPT_FILE) function. Then that pointer will be passed to
the callback instead of a FILE * to a file:
CURLOPT_WRITEDATA option. Then that pointer will be passed to the callback
instead of a FILE * to a file:
/* imaginary struct */
struct MemoryStruct {
@@ -901,7 +958,10 @@ FAQ
5.9 How does libcurl resolve host names?
libcurl includes a number of different name resolve functions:
libcurl supports a large a number of different name resolve functions. One
of them is picked at build-time and will be used unconditionally. Thus, if
you want to change name resolver function you must rebuild libcurl and tell
it to use a different function.
- The non-ipv6 resolver that can use one out of four host name resolve calls
(depending on what your system supports):
@@ -914,6 +974,8 @@ FAQ
- The ipv6-resolver that uses getaddrinfo()
- The c-ares based name resolver that uses the c-ares library for resolves.
Using this offers asynchronous name resolves but it currently has no IPv6
support.
- The Windows threaded resolver. It use:
@@ -926,8 +988,8 @@ FAQ
5.10 How do I prevent libcurl from writing the response to stdout?
libcurl provides a default built-in write function that writes received data
to stdout. Set a WRITEFUNCTION to receive the data, or possibly set
WRITEDATA to a different FILE * handle.
to stdout. Set the CURLOPT_WRITEFUNCTION to receive the data, or possibly
set CURLOPT_WRITEDATA to a different FILE * handle.
5.11 How do I make libcurl not receive the whole HTTP response?
@@ -956,6 +1018,9 @@ FAQ
is just a brief summary for the cases we get the most questions. (Parts of
this section was much enhanced by Bjorn Reese.)
We are not lawyers and this is not legal advice. You should probably consult
one if you want true and accurate legal insights without our prejudice.
6.1 I have a GPL program, can I use the libcurl library?
Yes!
@@ -1000,6 +1065,26 @@ FAQ
libraries that use it. It should be possible for everyone to use libcurl or
curl in their projects, no matter what license they already have in use.
6.7 What are my obligations when using libcurl in my commerical apps?
Next to none. All you need to adhere to is the MIT-style license (stated in
the COPYING file) which basically says you have to include the copyright
notice in "all copies" and that you may not use the copyright holder's name
when promoting your software.
You do not have to release any of your source code.
You do not have to reveal or make public any changes to the libcurl source
code.
You do not have to reveal or make public that you are using libcurl within
your app.
As can be seen here: http://curl.haxx.se/docs/companies.html and
elsewhere, more and more companies are dicovering the power
of libcurl and take advantage of it even in commercial environments.
7. PHP/CURL Issues
7.1 What is PHP/CURL?

View File

@@ -95,6 +95,9 @@ FTPS (*1)
- implicit "AUTH TSL" and "AUTH SSL" usage to "upgrade" plain ftp://
connection to use SSL for both or one of the connections
TFTP
- download / upload
TELNET
- connection negotiation
- custom telnet options

View File

@@ -145,3 +145,9 @@ August 2004:
April 2005:
GnuTLS can now optionally be used for the secure layer when curl is built.
September 2005:
TFTP support was added.
More than 100,000 unique visitors of the curl web site. 25 mirrors.

View File

@@ -132,64 +132,33 @@ UNIX
Win32
=====
Without SSL:
MingW32
-------
MingW32 (GCC-2.95) style
------------------------
Run the 'mingw32.bat' file to get the proper environment variables
set, then run 'make mingw32' in the root dir.
Run the 'mingw32.bat' file to get the proper environment variables set,
then run 'make mingw32' in the root dir. Use 'make mingw32-ssl' to build
curl SSL enabled.
If you have any problems linking libraries or finding header files, be
sure to verify that the provided "Makefile.m32" files use the proper
paths, and adjust as necessary.
If you have any problems linking libraries or finding header files, be sure
to verify that the provided "Makefile.m32" files use the proper paths, and
adjust as necessary.
Cygwin style
------------
Almost identical to the unix installation. Run the configure script in
the curl root with 'sh configure'. Make sure you have the sh
executable in /bin/ or you'll see the configure fail towards the end.
Cygwin
------
Almost identical to the unix installation. Run the configure script in the
curl root with 'sh configure'. Make sure you have the sh executable in
/bin/ or you'll see the configure fail towards the end.
Run 'make'
Microsoft command line style
----------------------------
Run the 'vcvars32.bat' file to get the proper environment variables
set, then run 'nmake vc' in the root dir.
Dev-Cpp
-------
The vcvars32.bat file is part of the Microsoft development
environment.
See the separate INSTALL.devcpp file for details.
IDE-style
-------------------------
If you use VC++, Borland or similar compilers. Include all lib source
files in a static lib "project" (all .c and .h files that is).
(you should name it libcurl or similar)
Make the sources in the src/ drawer be a "win32 console application"
project. Name it curl.
For VC++ 6, there's an included Makefile.vc6 that should be possible
to use out-of-the-box.
With SSL:
MingW32 (GCC-2.95) style
------------------------
Run the 'mingw32.bat' file to get the proper environment variables
set, then run 'make mingw32-ssl' in the root dir.
If you have any problems linking libraries or finding header files, be
sure to look at the provided "Makefile.m32" files for the proper
paths, and adjust as necessary.
Cygwin style
------------
Haven't done, nor got any reports on how to do. It should although be
identical to the unix setup for the same purpose. See above.
Microsoft command line style
----------------------------
MSVC from command line
----------------------
Run the 'vcvars32.bat' file to get a proper environment. The
vcvars32.bat file is part of the Microsoft development environment and
@@ -232,22 +201,14 @@ Win32
at runtime.
Run 'nmake vc-ssl-zlib' to build with both ssl and zlib support.
Microsoft / Borland style
-------------------------
If you have OpenSSL, and want curl to take advantage of it, edit your
project properties to use the SSL include path, link with the SSL libs
and define the USE_SSLEAY symbol.
Using Borland C++ compiler version 5.5.1 (available as free download
from Borland's site)
---------------------------------------------------------------------
Borland C++ compiler
---------------------
compile openssl
Make sure you include the paths to curl/include and openssl/inc32 in
your bcc32.cnf file
eg : -I"c:\Bcc55\include;c:\path_curl\include;c:\path_openssl\inc32"
Check to make sure that all of the sources listed in lib/Makefile.b32
@@ -268,7 +229,23 @@ Win32
-L c:\openssl\out32\ssleay32.lib
simplessl.c
Disabling Specific Protocols:
MSVC IDE
--------
If you use VC++, Borland or similar compilers. Include all lib source
files in a static lib "project" (all .c and .h files that is).
(you should name it libcurl or similar)
Make the sources in the src/ drawer be a "win32 console application"
project. Name it curl.
For VC++ 6, there's an included Makefile.vc6 that should be possible
to use out-of-the-box.
Disabling Specific Protocols in Win32 builds
--------------------------------------------
The configure utility, unfortunately, is not available for the Windows
environment, therefore, you cannot use the various disable-protocol
@@ -294,10 +271,12 @@ Win32
in the curllib.dsw/curllib.dsp Visual C++ 6 IDE project.
Important (with SSL or not):
When building an application that uses the static libcurl library, you
must add '-DCURL_STATICLIB' to your CFLAGS. Otherwise the linker will
look for dynamic import symbols.
Important static libcurl usage note
-----------------------------------
When building an application that uses the static libcurl library, you must
add '-DCURL_STATICLIB' to your CFLAGS. Otherwise the linker will look for
dynamic import symbols.
IBM OS/2

302
docs/INSTALL.devcpp Normal file
View File

@@ -0,0 +1,302 @@
DevCpp-Mingw Install & Compilation Sept 2005
==================================
Reference Emails available at curl@haxx.se:
Libcurl Install and Use Issues
Awaiting an Answer for Win 32 Install
res = curl_easy_perform(curl); Error
Makefile Issues
Having previously done a thorough review of what was available that met my
requirements under GPL, I settled for Libcurl as the software of choice for
many reasons not the least of which was the support.
Background
----------
This quest started when I innocently tried to incorporate the libcurl library
into my simple source code. I figured that a few easy steps would accomplish
this without major headaches. I had no idea that I would be facing an almost
insurmountable challenge.
The main problem lies in two areas. First the bulk of support for libcurl
exists for a Unix/linux command line environments. This is of little help when
it comes to Windows O/S.
Secondly the help that does exist for the Windows O/S focused around mingw
thru a command line argument environment.
You may ask "Why is this a problem?"
I'm using a Windows O/S with DevCpp. For those of you who are unfamiliar with
DevCpp, it is a window shell GUI that replaces the command line environment
for gcc. A definite improvement that I am unwilling to give up. However using
DevCpp presented its own set of issues. Inadvertently I also made some
careless errors such as compiling the 7.14 version of Makefile with an older
version of source code. Thanks to Dan Fandrich for picking this up.
I did eventually with the help of Daniel, Phillipe and others manage to
implement successfully (the only mingw available version)
curl-7.13.0-win32-ssl-devel-mingw32 into the DevCpp environment. Only the
dynamic libcurl.dll libcurldll.a libraries worked. The static library which I
was interested in did not. Furthermore when I tried to implement one of the
examples included with the curl package (get info.c) it caused the executable
to crash. Tracing the bug I found it in the code and function res =
curl_easy_perform(curl);.
At this point I had to make a choice as to whether invest my limited
time-energy resource to fixing the bug or to compile the new version
available. After searching the archives I found a very similar or the same bug
reported from version 7.12x on. Daniel did inform me that he thought that this
bug had been fixed with the latest version. So I proceeded to compile the
latest SSL version where I faced other challenges.
In order to make this process unremarkable for others using the same
environment I decided to document the process so that others will find it
routine. It would be a shame if newbies could not implement this excellent
package for their use.
I would like to thank the many others in this forum and in the DevCpp forum
for their help. Without your help I may either have given up or it would have
taken me many times longer to achieve success.
The Cookbook Approach
---------------------
This discussion will be confined to a SSL static library compilation and
installation. Limited mention and comments will be inserted where appropriate
to help with non-SSL, dynamic libraries and executables.
Using Makefile from DevCpp to compile Libcurl libraries
Preamble
--------
Using the latest version release - curl-7.14.0.tar.gz. Curl source code is
platform independent. This simply means that the source code can be compiled
for any Operating System (Linux/Unix Windows etc. and variations of thereof).
The first thing to note is that inside curl-7.14.0 you will find two folders
lib and src. Both contain Makefile.m32 (required for win mingw library or exe
compilation) files which are different. The main difference between these two
folders and the makefiles is that the src folder contents are used to compile
an executable file(curl.exe) while the lib folder contents are used to compile
a static (libcurl.a) and dynamic (libcurl.dll & libcurldll.a) file that can be
used to compile libcurl with your own source code so that one can use and
access all libcurl functions.
Before we start please make sure that DevCpp is installed properly. In
particular make sure you have no spaces in the name of any of the directories
and subdirectories where DevCpp is installed. Failure to comply with the
install instructions may produce erratic behaviour in DevCpp. For further info
check the following sites
http://aditsu.freeunixhost.com/dev-cpp-faq.html
http://sourceforge.net/forum/message.php?msg_id=3252213
As I have mentioned before I will confine this to the SSL Library compilations
but the process is very similar for compilation of the executable - curl.exe;
just substitute the src folder makefile in its stead.
First use a text processor Notepad, or your own favourite text processor. To
engage your favourite text processor, select Makefile.m32 click once with your
mouse on file icon; icon turns blue, press the shift key and right-click on
mouse, menu appears select "Open with", select your favourite text processor.
Next read the contents of Makefile.m32. It includes instructions on its use.
Method I - DOS Command Line
---------------------------
Note - The only reason I have included this method is that Method II which is
the preferred method for compiling does not allow for the setting of option
switches (e.g. SSL = 1 or SSL =0). At least that's what they tell me at the
Dev-Cpp forum.
1 - Make a copy of (D:\Dev-Cpp\bin) bin folder and name it "bin Original"
place it in the Dev-Cpp installed directory (D:\Dev-Cpp\ for this example)
2 - Copy the entire contents of the LIB folder of curl-7.14.0.tar.gz or zip
version into the bin folder above (D:\Dev-Cpp\bin). The reason being is that
the make.exe file resides in this folder. Make.exe will use - Makefile.m32,
Makefile.inc, and the source code included in the lib folder to compile the
source code. There is a PATH issue with make.exe that remains unresolved at
least for me. Unless the entire source code to be compiled is placed entirely
within the directory of make.exe an error message will be generated - "file
xxxx.yyy not available".
3- Go to Dev-Cpp\bin and double click on make .exe. You will see a DOS window
quickly pop up and close very quickly. Not to worry! Please do not skip this
step.
4- Click on the start button\Programs\MS-DOS Prompt.Once the DOS Window is up
Type the disk drive letter (e.g. E: ) engage the enter button. The path should
automatically take you to the directory of the make.exe file.
5- To compile the source code simply type at the DOS prompt make -f
Makefile.m32 as per instructions contained in the Makefile.m32 file (use any
text processor to read instructions). I don't believe that this makefile
allows for the option of non SSL. Ignore any warnings.
6- Collect and make copies of libcurl.a, libcurl.dll, libcurldll.a and any *.o
compilations you might need in another directory outside of the bin directory
as you will need this files shortly to set up libcurl for use with
Dev-cpp. For most apps *.o is not required. Later on we will show what to do
with these files.
7- You are finished but before closing we need to do cleanup - erase the bin
folder and rename the "bin Original" folder created in step 1 to bin.
Note to compile a curl executable the process is probably similar but instead
of using the LIB folder contents use the SRC folder contents and Makefiles in
curl-7.14.0.tar.gz. File directories relative placements must be respected for
compiling to take place successfully. This may not be possible with the PATH
problem that make.exe experiences. If anyone has solved this PATH issue and
please make sure it actually works on Win 9x/2000/XP before letting me
know. Then please let me or Daniel in on the solution so that it can be
included with these instructions. Thanks.
or
Method II - Dev-Cpp GUI
-----------------------
1- Copy the entire contents of the LIB folder of curl-7.14.0.tar.gz or zip
version into any folder outside of (Dev-Cpp\bin).
2- Drop the File/New/click on Project.
3- New Project Dialogue box appears. Double click on the Static Library.
4- Create Project Dialogue box appears. Select the LIB folder location to
place and locate your Project File Name. Placing the Project File Name
elsewhere may cause problems (PATH issue problem again).
5- Drop down the Project/Project Options. Project Options Dialogue box
appears.
6- Select the Makefile tab in the Project Options Dialogue Box. Check Box -
Use Custom Makefile. Click on the Folder icon at the extreme right of the
Check Box. Select Makefile.m32 in the folder wherever you have placed the
contents of the LIB Folder. Press OK and close the Dialogue Box.
7- Drop the Menu Project/Click on Add to Project. Open File Dialogue Box
appears. The Dialogue Box should open in the folder wherever you have placed
the contents of the LIB Folder. If not go there.
8- Select Crtl-A to select all files in the LIB folder. Click on open to add
files and close box. Wait till all files are added. This may take 30 seconds
or longer.
9- Drop the Menu Execute/Click on Compile.
10- That's it.
The following steps must be completed if Curl is to work properly
=================================================================
LIB folder inclusions (*.a placement)
-------------------------------------
1- Refer to Method I - DOS Command Line point # 6 Take libcurl.a, libcurldll.a
and install it in the directory C( or whichever drive Dev is installed)
:\Dev-Cpp\lib.
Include Folder
--------------
1- Create a new folder by the name of curl (do not change the name curl to
some other name as it will cause major issues) in the directory
C:\Dev-Cpp\include.
2- Copy the entire contents of the curl folder of curl-7.14.0.tar.gz or zip
version into the newly created curl directory - C:\Dev-Cpp\include\curl.
Links To Include And Lib Folder
-------------------------------
1- Drop the Menu - Tools\Compiler Options\Directories\Libraries. Make sure
that C( or whichever drive Dev is installed):\DEV-CPP\lib is included.
2- Next select the Menu - Tools\Compiler Options\Directories\C Includes. Make
sure that C:\DEV-CPP\include and C:\Dev-Cpp\include\curl are included.
3- Next select the Menu - Tools\Compiler Options\Directories\C++
Includes. Make sure that C:\DEV-CPP\include and C:\Dev-Cpp\include\curl are
included.
Linker Links
------------
1- Drop the Menu - Tools\Compiler Options\Directories\Compiler.
2- Make sure that the box "Add these commands to the linker command line" is
checked.
3- Include in the white space immediately below the box referred in 2 -lcurl
-lws2_32 -lwinmm.
SSL Files
---------
1- Get the latest openSSL (as of time of this writing)
openssl-0.9.7e-win32-bin.zip for the minimalist package of the openssl-0.9.7e
binaries ported to MS Windows 95/98/NT/XP using the MingW32/GCC-3.1
development environment. The file may be downloaded at
http://curl.haxx.se/download/.
2- Open the above zip file. You will find two files - SDL.dll,
SDL_mixer.dll. Install them in the directory C:\WINDOWS\SYSTEM32 for Win 9x
users and c:\winnt\system32 for NT-family users.
Multithreading Files
--------------------
To be completed
#define
-------
1- Make sure that your program includes the following - #define CURL_STATICLIB
must be declared FIRST before any other define functions may be
added. Otherwise you may experience link errors.
2- Don't forget to include #include "curl/curl.h".
e.g.
#define CURL_STATICLIB
#include <windows.h>
#include "curl/curl.h"
#include <fstream>
#include <iostream>
#include <vector>
etc...
Static or Dynamic Library
-------------------------
The above steps apply for the use by a static library. Should you choose to
use a dynamic library you will be required to perform these additional steps.
1- Refer to Method I - DOS Command Line point # 6. Install libcurl.dll in the
directory C:\WINDOWS\SYSTEM32 for Win 9x users and c:\winnt\system32 for
NT-family users.
2- Refer to Linker Links point 3 - Replace -lcurl with -lcurldll.
Voila you're done.
The non-SSL static Library build may not be possible to use at least as of the
time of this writing - v7.14. Check reference emails - Phillipe and I found it
impossible to fully compile as certain files were missing for linking. No big
loss as SSL is a major plus.
Hope this Helps
Tom

View File

@@ -3,6 +3,12 @@ join in and help us correct one or more of these! Also be sure to check the
changelog of the current development status, as one or more of these problems
may have been fixed since this was written!
28. The TFTP code is not portable and will fail on some architectures.
26. NTLM authentication using SSPI (on Windows) when (lib)curl is running in
"system context" will make it use wrong(?) user name - at least when compared
to what winhttp does. See http://curl.haxx.se/bug/view.cgi?id=1281867
25. When doing a CONNECT request with curl it doesn't properly handle if the
proxy closes the connection within the authentication "negotiation phase".
Like if you do HTTPS or similar over a proxy and you use perhaps
@@ -23,7 +29,7 @@ may have been fixed since this was written!
complaining on "unaligned file size" on completion. The problem is related
to VMS file structures and the perceived file sizes stat() returns. A
possible fix would involve sending a "STRU VMS" command.
http://sourceforge.net/support/tracker.php?aid=1156287
http://curl.haxx.se/bug/view.cgi?id=1156287
21. FTP ASCII transfers do not follow RFC959. They don't convert the data
accordingly (not for sending nor for receiving). RFC 959 section 3.1.1.1
@@ -69,11 +75,12 @@ may have been fixed since this was written!
10. To get HTTP Negotiate authentication to work fine, you need to provide a
(fake) user name (this concerns both curl and the lib) because the code
wrongly only considers authentication if there's a user name provided.
Bug report #1004841. How? http://curl.haxx.se/mail/lib-2004-08/0182.html
http://curl.haxx.se/bug/view.cgi?id=1004841. How?
http://curl.haxx.se/mail/lib-2004-08/0182.html
9. --limit-rate using -d or -F does not work. This is because the limit logic
is provided by the curl app in its read/write callbacks, and when doing
-d/-F the callbacks aren't used! Bug report #921395.
-d/-F the callbacks aren't used! http://curl.haxx.se/bug/view.cgi?id=921395
8. Doing resumed upload over HTTP does not work with '-C -', because curl
doesn't do a HEAD first to get the initial size. This needs to be done

View File

@@ -17,7 +17,7 @@ CLEANFILES = $(GENHTMLPAGES) $(PDFPAGES)
EXTRA_DIST = MANUAL BUGS CONTRIBUTE FAQ FEATURES INTERNALS SSLCERTS \
README.win32 RESOURCES TODO TheArtOfHttpScripting THANKS VERSIONS \
KNOWN_BUGS BINDINGS $(man_MANS) $(HTMLPAGES) HISTORY INSTALL \
$(PDFPAGES) LICENSE-MIXING README.netware DISTRO-DILEMMA
$(PDFPAGES) LICENSE-MIXING README.netware DISTRO-DILEMMA INSTALL.devcpp
MAN2HTML= roffit < $< >$@

View File

@@ -9,15 +9,14 @@ Alan Pinstein
Albert Chin-A-Young
Albert Choy
Aleksandar Milivojevic
Alex aka WindEagle
Alex Neblett
Alex Suykov
Alex aka WindEagle
Alexander Kourakos
Alexander Krasnostavsky
Alexander Zhuravlev
Alexis Carvalho
Andi Jahja
Andr<EFBFBD>s Garc<72>a
Andreas Damm
Andreas Olsson
Andreas Rieke
@@ -25,6 +24,7 @@ Andres Garcia
Andrew Bushnell
Andrew Francis
Andrew Fuller
Andr<EFBFBD>s Garc<72>a
Andy Cedilnik
Andy Serpa
Angus Mackay
@@ -34,10 +34,11 @@ Arkadiusz Miskiewicz
Augustus Saunders
Avery Fay
Ben Greear
Ben Madsen
Benjamin Gerard
Bertrand Demiddelaer
Bj<EFBFBD>rn Stenberg
Bjorn Reese
Bj<EFBFBD>rn Stenberg
Bob Schader
Brad Burdick
Brent Beardsley
@@ -75,8 +76,9 @@ Dan C
Dan Fandrich
Dan Torop
Dan Zitter
Daniel at touchtunes
Daniel Stenberg
Daniel at touchtunes
Darryl House
Dave Dribin
Dave Halbakken
Dave Hamilton
@@ -95,12 +97,14 @@ David Phillips
David Shaw
David Tarendash
David Thiel
David Yan
Detlef Schmier
Diego Casorran
Dimitris Sarris
Dinar
Dirk Eddelbuettel
Dirk Manske
Dmitry Bartsevich
Dolbneff A.V
Domenico Andreoli
Dominick Meglio
@@ -138,8 +142,6 @@ Frank Ticheler
Fred New
Fred Noz
Frederic Lepied
G<EFBFBD>nter Knauf
G<EFBFBD>tz Babin-Ebell
Gautam Mani
Gaz Iqbal
Georg Horn
@@ -162,6 +164,8 @@ Guenole Bescon
Guillaume Arluison
Gustaf Hui
Gwenole Beauchesne
G<EFBFBD>tz Babin-Ebell
G<EFBFBD>nter Knauf
Hamish Mackenzie
Hanno Kranzhoff
Hans Steegers
@@ -174,11 +178,10 @@ Ian Ford
Ian Gulliver
Ian Wilkes
Ignacio Vazquez-Abrams
Igor Polyakov
Ilguiz Latypov
Ingo Ralf Blum
Ingo Wilken
J<EFBFBD>rg Mueller-Tolk
J<EFBFBD>rn Hartroth
Jacky Lam
Jacob Meuser
James Bursa
@@ -208,6 +211,7 @@ Johan Anderson
Johan Nilsson
John Crow
John Janssen
John Kelly
John Lask
John McGowan
Jon Grubbs
@@ -225,6 +229,8 @@ Jukka Pihl
Julian Noble
Jun-ichiro itojun Hagino
Jurij Smakov
J<EFBFBD>rg Mueller-Tolk
J<EFBFBD>rn Hartroth
Kai Sommerfeld
Kai-Uwe Rommel
Kang-Jin Lee
@@ -234,6 +240,7 @@ Keith McGuigan
Ken Hirsch
Ken Rastatter
Kevin Fisk
Kevin Lussier
Kevin Roth
Kimmo Kinnunen
Kjell Ericson
@@ -291,6 +298,7 @@ Mettgut Jamalla
Michael Benedict
Michael Curtis
Michael Mealling
Michael Wallner
Michal Bonino
Mihai Ionescu
Mike Bytnar
@@ -310,10 +318,11 @@ Nick Humfrey
Nico Baggus
Nicolas Berloquin
Nicolas Croiset
Nicolas Fran<61>ois
Niels van Tongeren
Nikita Schmidt
nk
Nodak Sodak
Norbert Novotny
Oren Tirosh
P R Schaffner
Patrick Bihan-Faou
@@ -376,7 +385,6 @@ Rosimildo da Silva
Roy Shan
Rune Kleveland
Ryan Nelson
S<EFBFBD>bastien Willemijns
S. Moonesamy
Salvador D<>vila
Salvatore Sorrentino
@@ -385,6 +393,7 @@ Samuel D
Samuel Listopad
Sander Gates
Saul good
Scott Davis
Sebastien Willemijns
Sergio Ballestrero
Seshubabu Pasam
@@ -392,6 +401,7 @@ Shard
Shawn Poulson
Siddhartha Prakash Jain
Simon Dick
Simon Josefsson
Simon Liu
Spiridonoff A.V
Stadler Stephan
@@ -408,7 +418,7 @@ Steven Bazyl
Steven G. Johnson
Stoned Elipot
Sven Neuhaus
swalkaus at yahoo.com
S<EFBFBD>bastien Willemijns
T. Bharath
T. Yamada
Thomas Schwinge
@@ -451,3 +461,5 @@ Wilfredo Sanchez
Wojciech Zwiefka
Yarram Sunil
Zvi Har'El
nk
swalkaus at yahoo.com

View File

@@ -31,7 +31,7 @@ TODO
* Introduce a new error code indicating authentication problems (for proxy
CONNECT error 407 for example). This cannot be an error code, we must not
return informational stuff as errors, consider a new info returned by
curl_easy_getinfo() #845941
curl_easy_getinfo() http://curl.haxx.se/bug/view.cgi?id=845941
* Use 'struct lifreq' and SIOCGLIFADDR instead of 'struct ifreq' and
SIOCGIFADDR on newer Solaris versions as they claim the latter is obsolete.
@@ -83,7 +83,7 @@ TODO
* Support GSS/Kerberos 5 for ftp file transfer. This will allow user
authentication and file encryption. Possible libraries and example clients
are available from MIT or Heimdal. Requsted by Markus Moeller.
are available from MIT or Heimdal. Requested by Markus Moeller.
* REST fix for servers not behaving well on >2GB requests. This should fail
if the server doesn't set the pointer to the requested index. The tricky
@@ -190,12 +190,6 @@ TODO
NEW PROTOCOLS
* TFTP - RFC1350 (protocol) and RFC3617 (URI format)
Dan Fandrich: I wrote a tftp protocol module as part of the I-Boot
bootloader under a BSD-style license with attribution clause
http://download.intrinsyc.com/supported/tools/i-boot-lite/i-boot-lite-1.8/src/libs/net/tftp.c
* RTSP - RFC2326 (protocol - very HTTP-like, also contains URL description)
* SFTP/SCP/SSH (no RFCs for protocol nor URI/URL format). An implementation
@@ -217,7 +211,7 @@ TODO
* Globbing support for -d and -F, as in 'curl -d "name=foo[0-9]" URL'.
Requested by Dane Jensen and others. This is easily scripted though.
* Add an option that prevents cURL from overwiting existing local files. When
* Add an option that prevents cURL from overwriting existing local files. When
used, and there already is an existing file with the target file name
(either -O or -o), a number should be appended (and increased if already
existing). So that index.html becomes first index.html.1 and then

View File

@@ -64,7 +64,7 @@ Outputs version information about the installed libcurl, in numerical mode.
This outputs the version number, in hexadecimal, with 8 bits for each part;
major, minor, patch. So that libcurl 7.7.4 would appear as 070704 and libcurl
12.13.14 would appear as 0c0d0e... Note that the initial zero might be
omitted.
omitted. (This option was broken in the 7.15.0 release.)
.SH "EXAMPLES"
What linker options do I need when I link with libcurl?

View File

@@ -21,7 +21,7 @@
.\" * $Id$
.\" **************************************************************************
.\"
.TH curl 1 "12 Aug 2005" "Curl 7.14.1" "Curl Manual"
.TH curl 1 "24 Nov 2005" "Curl 7.15.1" "Curl Manual"
.SH NAME
curl \- transfer a URL
.SH SYNOPSIS
@@ -30,8 +30,8 @@ curl \- transfer a URL
.SH DESCRIPTION
.B curl
is a tool to transfer data from or to a server, using one of the supported
protocols (HTTP, HTTPS, FTP, FTPS, GOPHER, DICT, TELNET, LDAP or FILE). The
command is designed to work without user interaction.
protocols (HTTP, HTTPS, FTP, FTPS, TFTP, GOPHER, DICT, TELNET, LDAP or
FILE). The command is designed to work without user interaction.
curl offers a busload of useful tricks like proxy support, user
authentication, ftp upload, HTTP post, SSL (https:) connections, cookies, file
@@ -64,6 +64,17 @@ several ones next to each other:
You can specify any amount of URLs on the command line. They will be fetched
in a sequential manner in the specified order.
Since curl 7.15.1 you can also specify step counter for the ranges, so that
you can get every Nth number or letter:
http://www.numericals.com/file[1-100:10].txt
http://www.letters.com/file[a-z:2].txt
If you specify URL without protocol:// prefix, curl will attempt to guess what
protocol you might want. It will then default to HTTP but try other protocols
based on often-used host name prefixes. For example, for host names starting
with "ftp." curl will assume you want to speak FTP.
Curl will attempt to re-use connections for multiple file transfers, so that
getting many files from the same server will not do multiple connects /
handshakes. This improves speed. Of course this is only done on files
@@ -347,6 +358,15 @@ If this option is used twice, the second will again disable silent failure.
using this option can be used to override a previous --ftp-port option. (Added
in 7.11.0)
If this option is used twice, the second will again disable silent failure.
.IP "--ftp-skip-pasv-ip"
(FTP) Tell curl to not use the IP address the server suggests in its response
to curl's PASV command when curl connects the data connection. Instead curl
will re-use the same IP address it already uses for the control
connection. (Added in 7.14.2)
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 disable silent failure.
.IP "--ftp-ssl"
(FTP) Make the FTP connection switch to use SSL/TLS. (Added in 7.11.0)
@@ -579,8 +599,7 @@ this given limit. This concerns both FTP and HTTP transfers.
.IP "-m/--max-time <seconds>"
Maximum time in seconds that you allow the whole operation to take. This is
useful for preventing your batch jobs from hanging for hours due to slow
networks or links going down. This doesn't work fully in win32 systems. See
also the \fI--connect-timeout\fP option.
networks or links going down. See also the \fI--connect-timeout\fP option.
If this option is used several times, the last one will be used.
.IP "-M/--manual"
@@ -599,7 +618,7 @@ directory.
A quick and very simple example of how to setup a \fI.netrc\fP to allow curl
to ftp to the machine host.domain.com with user name \&'myself' and password
'secret' should look similar to:
\&'secret' should look similar to:
.B "machine host.domain.com login myself password secret"
@@ -618,6 +637,10 @@ This option requires that the library was built with GSSAPI support. This is
not very common. Use \fI-V/--version\fP to see if your version supports
GSS-Negotiate.
When using this option, you must also provide a fake -u/--user option to
activate the authentication code properly. Sending a '-u :' is enough as the
user name and password from the -u option aren't actually used.
If this option is used several times, the following occurrences make no
difference.
.IP "-N/--no-buffer"
@@ -757,7 +780,7 @@ specifies the second 500 bytes
.B -500
specifies the last 500 bytes
.TP
.B 9500
.B 9500-
specifies the bytes from offset 9500 and forward
.TP
.B 0-0,-1
@@ -904,10 +927,18 @@ If this option is used several times, each occurrence will toggle it on/off.
Specify user and password to use for server authentication. Overrides
\fI-n/--netrc\fP and \fI--netrc-optional\fP.
If you use an SSPI-enabled curl binary and do NTLM autentication, you can
force curl to pick up the user name and password from your environment by
simply specifying a single colon with this option: "-u :".
If this option is used several times, the last one will be used.
.IP "-U/--proxy-user <user:password>"
Specify user and password to use for proxy authentication.
If you use an SSPI-enabled curl binary and do NTLM autentication, you can
force curl to pick up the user name and password from your environment by
simply specifying a single colon with this option: "-U :".
If this option is used several times, the last one will be used.
.IP "--url <URL>"
Specify a URL to fetch. This option is mostly handy when you want to specify
@@ -1114,7 +1145,8 @@ If this option is used several times, the last one will be used.
.IP "--max-redirs <num>"
Set maximum number of redirection-followings allowed. If \fI-L/--location\fP
is used, this option can be used to prevent curl from following redirections
\&"in absurdum".
\&"in absurdum". By default, the limit is set to 50 redirections. Set this
option to -1 to make it limitless.
If this option is used several times, the last one will be used.
.IP "-0/--http1.0"
@@ -1171,7 +1203,7 @@ Sets proxy server to use for GOPHER.
Sets proxy server to use if no protocol-specific proxy is set.
.IP "NO_PROXY <comma-separated list of hosts>"
list of host names that shouldn't go through any proxy. If set to a asterisk
'*' only, it matches all hosts.
\&'*' only, it matches all hosts.
.SH EXIT CODES
There exists a bunch of different error codes and their corresponding error
messages that may appear during bad conditions. At the time of this writing,
@@ -1193,7 +1225,9 @@ Failed to connect to host.
.IP 8
FTP weird server reply. The server sent data curl couldn't parse.
.IP 9
FTP access denied. The server denied login.
FTP access denied. The server denied login or denied access to the particular
resource or directory you wanted to reach. Most often you tried to change to a
directory that doesn't exist on the server.
.IP 10
FTP user/password incorrect. Either one or both were not accepted by the
server.

View File

@@ -14,6 +14,8 @@
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <curl/curl.h>
#include <curl/types.h>
@@ -93,5 +95,8 @@ int main(int argc, char **argv)
* you're done with it, you should free() it as a nice application.
*/
if(chunk.memory)
free(chunk.memory);
return 0;
}

View File

@@ -52,8 +52,7 @@ PDFPAGES = curl_easy_cleanup.pdf curl_easy_getinfo.pdf \
CLEANFILES = $(HTMLPAGES) $(PDFPAGES)
EXTRA_DIST = $(man_MANS) $(HTMLPAGES) index.html $(PDFPAGES) libcurl.m4 \
getinfo-times
EXTRA_DIST = $(man_MANS) $(HTMLPAGES) index.html $(PDFPAGES) libcurl.m4
MAN2HTML= roffit --mandir=. < $< >$@

View File

@@ -2,7 +2,7 @@
.\" nroff -man [file]
.\" $Id$
.\"
.TH curl_easy_getinfo 3 "22 Dec 2004" "libcurl 7.12.3" "libcurl Manual"
.TH curl_easy_getinfo 3 "6 Oct 2005" "libcurl 7.12.3" "libcurl Manual"
.SH NAME
curl_easy_getinfo - extract information from a curl handle
.SH SYNOPSIS
@@ -141,6 +141,40 @@ cookies cURL knows (expired ones, too). Don't forget to
cookies (cookies for the handle have not been enabled or simply none have been
received) 'struct curl_slist *' will be set to point to NULL. (Added in
7.14.1)
.SH TIMES
.NF
An overview of the six time values available from curl_easy_getinfo()
curk_easy_perform()
|
|--NT
|--|--CT
|--|--|--PT
|--|--|--|--ST
|--|--|--TT
|--|--|--|--|--RT
.FI
.IP NT
\fICURLINFO_NAMELOOKUP_TIME\fP. The time it took from the start until the name
resolving was completed.
.IP CT
\fICURLINFO_CONNECT_TIME\fP. The time it took from the start until the connect
to the remote host (or proxy) was completed.
.IP PT
\fICURLINFO_PRETRANSFER_TIME\fP. The time it took from the start until the
file transfer is just about to begin. This includes all pre-transfer commands
and negotiations that are specific to the particular protocol(s) involved.
.IP ST
\fICURLINFO_STARTTRANSFER_TIME\fP. The time it took from the start until the
first byte is just about to be transferred.
.IP TT
\fICURLINFO_TOTAL_TIME\fP. Time of the previous transfer. This time does not
include the connect time (CT), so if you want the complete operation time, you
should add that.
.IP RT
\fICURLINFO_REDIRECT_TIME\fP. The time it took for all redirection steps
include name lookup, connect, pretransfer and transfer before final
transaction was started. So, this is zero if no redirection took place.
.SH RETURN VALUE
If the operation was successful, CURLE_OK is returned. Otherwise an
appropriate error code will be returned.

View File

@@ -21,7 +21,7 @@
.\" * $Id$
.\" **************************************************************************
.\"
.TH curl_easy_setopt 3 "28 Jul 2005" "libcurl 7.14.1" "libcurl Manual"
.TH curl_easy_setopt 3 "27 Oct 2005" "libcurl 7.14.2" "libcurl Manual"
.SH NAME
curl_easy_setopt - set options for a curl easy handle
.SH SYNOPSIS
@@ -44,11 +44,11 @@ between transfers, so if you want subsequent transfers with different options,
you must change them between the transfers. You can optionally reset all
options back to internal default with \fIcurl_easy_reset(3)\fP.
\fBNOTE:\fP strings passed to libcurl as 'char *' arguments, will not be
copied by the library. Instead you should keep them available until libcurl no
longer needs them. Failing to do so will cause very odd behavior or even
crashes. libcurl will need them until you call \fIcurl_easy_cleanup(3)\fP or
you set the same option again to use a different pointer.
Strings passed to libcurl as 'char *' arguments, will not be copied by the
library. Instead you should keep them available until libcurl no longer needs
them. Failing to do so will cause very odd behavior or even crashes. libcurl
will need them until you call \fIcurl_easy_cleanup(3)\fP or you set the same
option again to use a different pointer.
The \fIhandle\fP is the return code from a \fIcurl_easy_init(3)\fP or
\fIcurl_easy_duphandle(3)\fP call.
@@ -70,8 +70,8 @@ preceding the data (like HTTP).
A non-zero parameter tells the library to shut off the built-in progress meter
completely.
\fBNOTE:\fP future versions of libcurl is likely to not have any built-in
progress meter at all.
Future versions of libcurl is likely to not have any built-in progress meter
at all.
.IP CURLOPT_NOSIGNAL
Pass a long. If it is non-zero, libcurl will not use any functions that
install signal handlers or any functions that cause signals to be sent to the
@@ -96,19 +96,26 @@ transfer and return \fICURLE_WRITE_ERROR\fP.
This function may be called with zero bytes data if the transfered file is
empty.
Set this option to NULL to get the internal default function. The internal
default function will write the data to the FILE * given with
\fICURLOPT_WRITEDATA\fP.
Set the \fIstream\fP argument with the \fICURLOPT_WRITEDATA\fP option.
\fBNOTE:\fP you will be passed as much data as possible in all invokes, but
you cannot possibly make any assumptions. It may be one byte, it may be
The callback function will be passed as much data as possible in all invokes,
but you cannot possibly make any assumptions. It may be one byte, it may be
thousands. The maximum amount of data that can be passed to the write callback
is defined in the curl.h header file: CURL_MAX_WRITE_SIZE.
.IP CURLOPT_WRITEDATA
Data pointer to pass to the file write function. Note that if you specify the
\fICURLOPT_WRITEFUNCTION\fP, this is the pointer you'll get as input. If you
don't use a callback, you must pass a 'FILE *' as libcurl will pass this to
fwrite() when writing data.
Data pointer to pass to the file write function. If you use the
\fICURLOPT_WRITEFUNCTION\fP option, this is the pointer you'll get as
input. If you don't use a callback, you must pass a 'FILE *' as libcurl will
pass this to fwrite() when writing data.
\fBNOTE:\fP If you're using libcurl as a win32 DLL, you MUST use the
The internal \fICURLOPT_WRITEFUNCTION\fP will write the data to the FILE *
given with this option, or to stdout if this option hasn't been set.
If you're using libcurl as a win32 DLL, you \fBMUST\fP use the
\fICURLOPT_WRITEFUNCTION\fP if you set this option or you will experience
crashes.
@@ -129,15 +136,20 @@ server expected it, like when you've told you will upload N bytes and you
upload less than N bytes), you may experience that the server "hangs" waiting
for the rest of the data that won't come.
In libcurl 7.12.1 and later, the read callback may return
\fICURL_READFUNC_ABORT\fP to stop the current operation at once, with a
\fICURLE_ABORTED_BY_CALLBACK\fP error code from the transfer.
.IP CURLOPT_READDATA
Data pointer to pass to the file read function. Note that if you specify the
\fICURLOPT_READFUNCTION\fP, this is the pointer you'll get as input. If you
don't specify a read callback, this must be a valid FILE *.
The read callback may return \fICURL_READFUNC_ABORT\fP to stop the current
operation immediately, resulting in a \fICURLE_ABORTED_BY_CALLBACK\fP error
code from the transfer (Added in 7.12.1)
\fBNOTE:\fP If you're using libcurl as a win32 DLL, you MUST use a
If you set the callback pointer to NULL, or doesn't set it at all, the default
internal read function will be used. It is simply doing an fread() on the FILE
* stream set with \fICURLOPT_READDATA\fP.
.IP CURLOPT_READDATA
Data pointer to pass to the file read function. If you use the
\fICURLOPT_READFUNCTION\fP option, this is the pointer you'll get as input. If
you don't specify a read callback but instead rely on the default internal
read function, this data must be a valid readable FILE *.
If you're using libcurl as a win32 DLL, you MUST use a
\fICURLOPT_READFUNCTION\fP if you set this option.
This option is also known with the older name \fICURLOPT_INFILE\fP, the name
@@ -163,8 +175,8 @@ data, the upload size will remain 0). Returning a non-zero value from this
callback will cause libcurl to abort the transfer and return
\fICURLE_ABORTED_BY_CALLBACK\fP.
Also note that \fICURLOPT_NOPROGRESS\fP must be set to FALSE to make this
function actually get called.
\fICURLOPT_NOPROGRESS\fP must be set to FALSE to make this function actually
get called.
.IP CURLOPT_PROGRESSDATA
Pass a pointer that will be untouched by libcurl and passed as the first
argument in the progress callback set with \fICURLOPT_PROGRESSFUNCTION\fP.
@@ -236,10 +248,10 @@ option was introduced in 7.11.0.
This function will get called on all new connections made to a server, during
the SSL negotiation. The SSL_CTX pointer will be a new one every time.
\fBNOTE:\fP To use this properly, a non-trivial amount of knowledge of the
openssl libraries is necessary. Using this function allows for example to use
openssl callbacks to add additional validation code for certificates, and even
to change the actual URI of an HTTPS request (example used in the lib509 test
To use this properly, a non-trivial amount of knowledge of the openssl
libraries is necessary. Using this function allows for example to use openssl
callbacks to add additional validation code for certificates, and even to
change the actual URI of an HTTPS request (example used in the lib509 test
case). See also the example section for a replacement of the key, certificate
and trust file settings.
.IP CURLOPT_SSL_CTX_DATA
@@ -249,14 +261,15 @@ parameter, otherwise \fBNULL\fP. (Added in 7.11.0)
.SH ERROR OPTIONS
.IP CURLOPT_ERRORBUFFER
Pass a char * to a buffer that the libcurl may store human readable error
messages in. This may be more helpful than just the return code from the
library. The buffer must be at least CURL_ERROR_SIZE big.
messages in. This may be more helpful than just the return code from
\fIcurl_easy_perform\fP. The buffer must be at least CURL_ERROR_SIZE big.
Use \fICURLOPT_VERBOSE\fP and \fICURLOPT_DEBUGFUNCTION\fP to better
debug/trace why errors happen.
\fBNote:\fP if the library does not return an error, the buffer may not have
been touched. Do not rely on the contents in those cases.
If the library does not return an error, the buffer may not have been
touched. Do not rely on the contents in those cases.
.IP CURLOPT_STDERR
Pass a FILE * as parameter. Tell libcurl to use this stream instead of stderr
when showing the progress meter and displaying \fICURLOPT_VERBOSE\fP data.
@@ -277,7 +290,7 @@ given protocol of the set URL is not supported, libcurl will return on error
\fIcurl_multi_perform(3)\fP. Use \fIcurl_version_info(3)\fP for detailed info
on which protocols that are supported.
\fBNOTE:\fP \fICURLOPT_URL\fP is the only option that must be set before
\fICURLOPT_URL\fP is the only option that must be set before
\fIcurl_easy_perform(3)\fP is called.
.IP CURLOPT_PROXY
Set HTTP proxy to use. The parameter should be a char * to a zero terminated
@@ -310,9 +323,9 @@ this are \fICURLPROXY_HTTP\fP and \fICURLPROXY_SOCKS5\fP, with the HTTP one
being default. (Added in 7.10)
.IP CURLOPT_HTTPPROXYTUNNEL
Set the parameter to non-zero to get the library to tunnel all operations
through a given HTTP proxy. Note that there is a big difference between using
a proxy and to tunnel through it. If you don't know what this means, you
probably don't want this tunneling option.
through a given HTTP proxy. There is a big difference between using a proxy
and to tunnel through it. If you don't know what this means, you probably
don't want this tunneling option.
.IP CURLOPT_INTERFACE
Pass a char * as parameter. This set the interface name to use as outgoing
network interface. The name can be an interface name, an IP address or a host
@@ -331,10 +344,14 @@ thread-safe and this will use a global variable.
to using the share interface instead! See \fICURLOPT_SHARE\fP and
\fIcurl_share_init(3)\fP.
.IP CURLOPT_BUFFERSIZE
Pass a long specifying your preferred size for the receive buffer in libcurl.
The main point of this would be that the write callback gets called more often
and with smaller chunks. This is just treated as a request, not an order. You
cannot be guaranteed to actually get the given size. (Added in 7.10)
Pass a long specifying your preferred size (in bytes) for the receive buffer
in libcurl. The main point of this would be that the write callback gets
called more often and with smaller chunks. This is just treated as a request,
not an order. You cannot be guaranteed to actually get the given size. (Added
in 7.10)
This size is by default set as big as possible (CURL_MAX_WRITE_SIZE), so it
only makse sense to use this option if you want it smaller.
.IP CURLOPT_PORT
Pass a long specifying what remote port number to connect to, instead of the
one specified in the URL or the default port for the used protocol.
@@ -360,9 +377,9 @@ This parameter controls the preference of libcurl between using user names and
passwords from your \fI~/.netrc\fP file, relative to user names and passwords
in the URL supplied with \fICURLOPT_URL\fP.
\fBNote:\fP libcurl uses a user name (and supplied or prompted password)
supplied with \fICURLOPT_USERPWD\fP in preference to any of the options
controlled by this parameter.
libcurl uses a user name (and supplied or prompted password) supplied with
\fICURLOPT_USERPWD\fP in preference to any of the options controlled by this
parameter.
Pass a long, set to one of the values described below.
.RS
@@ -386,9 +403,8 @@ and to search the file with the host only.
Only machine name, user name and password are taken into account
(init macros and similar things aren't supported).
\fBNote:\fP libcurl does not verify that the file has the correct properties
set (as the standard Unix ftp client does). It should only be readable by
user.
libcurl does not verify that the file has the correct properties set (as the
standard Unix ftp client does). It should only be readable by user.
.IP CURLOPT_NETRC_FILE
Pass a char * as parameter, pointing to a zero terminated string containing
the full path name to the file you want libcurl to use as .netrc file. If this
@@ -398,6 +414,11 @@ find the a .netrc file in the current user's home directory. (Added in 7.10.9)
Pass a char * as parameter, which should be [user name]:[password] to use for
the connection. Use \fICURLOPT_HTTPAUTH\fP to decide authentication method.
When using NTLM, you can set domain by prepending it to the user name and
separating the domain and name with a forward (/) or backward slash (\\). Like
this: "domain/user:password" or "domain\\user:password". Some HTTP servers (on
Windows) support this style even for Basic authentication.
When using HTTP and \fICURLOPT_FOLLOWLOCATION\fP, libcurl might perform
several requests to possibly different hosts. libcurl will only send this user
and password information to hosts using the initial host name (unless
@@ -413,9 +434,9 @@ Pass a long as parameter, which is set to a bitmask, to tell libcurl what
authentication method(s) you want it to use. The available bits are listed
below. If more than one bit is set, libcurl will first query the site to see
what authentication methods it supports and then pick the best one you allow
it to use. Note that for some methods, this will induce an extra network
round-trip. Set the actual name and password with the \fICURLOPT_USERPWD\fP
option. (Added in 7.10.6)
it to use. For some methods, this will induce an extra network round-trip. Set
the actual name and password with the \fICURLOPT_USERPWD\fP option. (Added in
7.10.6)
.RS
.IP CURLAUTH_BASIC
HTTP Basic authentication. This is the default choice, and the only method
@@ -433,15 +454,14 @@ applications. It is primarily meant as a support for Kerberos5 authentication
but may be also used along with another authentication methods. For more
information see IETF draft draft-brezak-spnego-http-04.txt.
\fBNOTE\fP that you need to build libcurl with a suitable GSS-API library for
this to work.
You need to build libcurl with a suitable GSS-API library for this to work.
.IP CURLAUTH_NTLM
HTTP NTLM authentication. A proprietary protocol invented and used by
Microsoft. It uses a challenge-response and hash concept similar to Digest, to
prevent the password from being eavesdropped.
\fBNOTE\fP that you need to build libcurl with SSL support for this option to
work.
You need to build libcurl with OpenSSL support for this option to work, or
build libcurl on Windows.
.IP CURLAUTH_ANY
This is a convenience macro that sets all bits and thus makes libcurl pick any
it finds suitable. libcurl will automatically select the one it finds most
@@ -456,11 +476,11 @@ Pass a long as parameter, which is set to a bitmask, to tell libcurl what
authentication method(s) you want it to use for your proxy authentication. If
more than one bit is set, libcurl will first query the site to see what
authentication methods it supports and then pick the best one you allow it to
use. Note that for some methods, this will induce an extra network
round-trip. Set the actual name and password with the
\fICURLOPT_PROXYUSERPWD\fP option. The bitmask can be constructed by or'ing
together the bits listed above for the \fICURLOPT_HTTPAUTH\fP option. As of
this writing, only Basic, Digest and NTLM work. (Added in 7.10.7)
use. For some methods, this will induce an extra network round-trip. Set the
actual name and password with the \fICURLOPT_PROXYUSERPWD\fP option. The
bitmask can be constructed by or'ing together the bits listed above for the
\fICURLOPT_HTTPAUTH\fP option. As of this writing, only Basic, Digest and NTLM
work. (Added in 7.10.7)
.SH HTTP OPTIONS
.IP CURLOPT_AUTOREFERER
Pass a non-zero parameter to enable this. When enabled, libcurl will
@@ -483,19 +503,21 @@ lib/README.encoding for details.
A non-zero parameter tells the library to follow any Location: header that the
server sends as part of an HTTP header.
\fBNOTE:\fP this means that the library will re-send the same request on the
new location and follow new Location: headers all the way until no more such
headers are returned. \fICURLOPT_MAXREDIRS\fP can be used to limit the number
of redirects libcurl will follow.
This means that the library will re-send the same request on the new location
and follow new Location: headers all the way until no more such headers are
returned. \fICURLOPT_MAXREDIRS\fP can be used to limit the number of redirects
libcurl will follow.
.IP CURLOPT_UNRESTRICTED_AUTH
A non-zero parameter tells the library it can continue to send authentication
(user+password) when following locations, even when hostname changed. Note
that this is meaningful only when setting \fICURLOPT_FOLLOWLOCATION\fP.
(user+password) when following locations, even when hostname changed. This
option is meaningful only when setting \fICURLOPT_FOLLOWLOCATION\fP.
.IP CURLOPT_MAXREDIRS
Pass a long. The set number will be the redirection limit. If that many
redirections have been followed, the next redirect will cause an error
(\fICURLE_TOO_MANY_REDIRECTS\fP). This option only makes sense if the
\fICURLOPT_FOLLOWLOCATION\fP is used at the same time.
\fICURLOPT_FOLLOWLOCATION\fP is used at the same time. Added in 7.15.1:
Setting the limit to 0 will make libcurl refuse any redirect. Set it to -1 for
an infinite number of redirects (which is the default)
.IP CURLOPT_PUT
A non-zero parameter tells the library to use HTTP PUT to transfer data. The
data should be set with \fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE\fP.
@@ -549,8 +571,8 @@ commonly used one by HTML forms. See also the \fICURLOPT_POST\fP. Using
Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual.
\fBNote:\fP to make multipart/formdata posts (aka rfc1867-posts), check out
the \fICURLOPT_HTTPPOST\fP option.
To make multipart/formdata posts (aka rfc1867-posts), check out the
\fICURLOPT_HTTPPOST\fP option.
.IP CURLOPT_POSTFIELDSIZE
If you want to post data to the server without letting libcurl do a strlen()
to measure the data size, this option must be used. When this option is used
@@ -605,7 +627,7 @@ request-line are headers.
Pass a NULL to this to reset back to no custom headers.
\fBNOTE:\fP The most commonly replaced headers have "shortcuts" in the options
The most commonly replaced headers have "shortcuts" in the options
\fICURLOPT_COOKIE\fP, \fICURLOPT_USERAGENT\fP and \fICURLOPT_REFERER\fP.
.IP CURLOPT_HTTP200ALIASES
Pass a pointer to a linked list of aliases to be treated as valid HTTP 200
@@ -618,9 +640,9 @@ The linked list should be a fully valid list of struct curl_slist structs, and
be properly filled in. Use \fIcurl_slist_append(3)\fP to create the list and
\fIcurl_slist_free_all(3)\fP to clean up an entire list.
\fBNOTE:\fP The alias itself is not parsed for any version strings. So if your
alias is "MYHTTP/9.9", Libcurl will not treat the server as responding with
HTTP version 9.9. Instead Libcurl will use the value set by option
The alias itself is not parsed for any version strings. So if your alias is
\&"MYHTTP/9.9", Libcurl will not treat the server as responding with HTTP
version 9.9. Instead Libcurl will use the value set by option
\fICURLOPT_HTTP_VERSION\fP.
.IP CURLOPT_COOKIE
Pass a pointer to a zero terminated string as parameter. It will be used to
@@ -655,7 +677,7 @@ instead have the cookies written to stdout. Using this option also enables
cookies for this session, so if you for example follow a location it will make
matching cookies get sent accordingly.
\fBNOTE:\fP If the cookie jar file can't be created or written to (when the
If the cookie jar file can't be created or written to (when the
\fIcurl_easy_cleanup(3)\fP is called), libcurl will not and cannot report an
error for this. Using \fICURLOPT_VERBOSE\fP or \fICURLOPT_DEBUGFUNCTION\fP
will get a warning to display, but that is the only visible feedback you get
@@ -762,11 +784,19 @@ directory. (Added in 7.10.7)
.IP CURLOPT_FTP_RESPONSE_TIMEOUT
Pass a long. Causes curl to set a timeout period (in seconds) on the amount
of time that the server is allowed to take in order to generate a response
message for a command before the session is considered hung. Note that while
curl is waiting for a response, this value overrides \fICURLOPT_TIMEOUT\fP. It
is recommended that if used in conjunction with \fICURLOPT_TIMEOUT\fP, you set
message for a command before the session is considered hung. While curl is
waiting for a response, this value overrides \fICURLOPT_TIMEOUT\fP. It is
recommended that if used in conjunction with \fICURLOPT_TIMEOUT\fP, you set
\fICURLOPT_FTP_RESPONSE_TIMEOUT\fP to a value smaller than
\fICURLOPT_TIMEOUT\fP. (Added in 7.10.8)
.IP CURLOPT_FTP_SKIP_PASV_IP
Pass a long. If set to a non-zero value, it instructs libcurl to not use the
IP address the server suggests in its 227-response to libcurl's PASV command
when libcurl connects the data connection. Instead libcurl will re-use the
same IP address it already uses for the control connection. But it will use
the port number from the 227-response. (Added in 7.14.2)
This option has no effect if PORT, EPRT or EPSV is used instead of PASV.
.IP CURLOPT_FTP_SSL
Pass a long using one of the values from below, to make libcurl use your
desired level of SSL for the ftp transfer. (Added in 7.11.0)
@@ -816,10 +846,9 @@ stdout to binary mode. This option can be usable when transferring text data
between systems with different views on certain characters, such as newlines
or similar.
\fBNOTE:\fP libcurl does not do a complete ASCII conversion when doing ASCII
transfers over FTP. This is a known limitation/flaw that nobody has
rectified. libcurl simply sets the mode to ascii and performs a standard
transfer.
libcurl does not do a complete ASCII conversion when doing ASCII transfers
over FTP. This is a known limitation/flaw that nobody has rectified. libcurl
simply sets the mode to ascii and performs a standard transfer.
.IP CURLOPT_CRLF
Convert Unix newlines to CRLF newlines on transfers.
.IP CURLOPT_RANGE
@@ -845,11 +874,11 @@ server supports the command first.
Restore to the internal default by setting this to NULL.
\fBNOTE:\fP Many people have wrongly used this option to replace the entire
request with their own, including multiple headers and POST contents. While
that might work in many cases, it will cause libcurl to send invalid requests
and it could possibly confuse the remote server badly. Use \fICURLOPT_POST\fP
and \fICURLOPT_POSTFIELDS\fP to set POST data. Use \fICURLOPT_HTTPHEADER\fP to
Many people have wrongly used this option to replace the entire request with
their own, including multiple headers and POST contents. While that might work
in many cases, it will cause libcurl to send invalid requests and it could
possibly confuse the remote server badly. Use \fICURLOPT_POST\fP and
\fICURLOPT_POSTFIELDS\fP to set POST data. Use \fICURLOPT_HTTPHEADER\fP to
replace or extend the set of headers sent by libcurl. Use
\fICURLOPT_HTTP_VERSION\fP to change HTTP version.
.IP CURLOPT_FILETIME
@@ -893,26 +922,26 @@ Pass a long as parameter. This allows you to specify the maximum size (in
bytes) of a file to download. If the file requested is larger than this value,
the transfer will not start and CURLE_FILESIZE_EXCEEDED will be returned.
\fBNOTE:\fP The file size is not always known prior to download, and for such
files this option has no effect even if the file transfer ends up being larger
than this given limit. This concerns both FTP and HTTP transfers.
The file size is not always known prior to download, and for such files this
option has no effect even if the file transfer ends up being larger than this
given limit. This concerns both FTP and HTTP transfers.
.IP CURLOPT_MAXFILESIZE_LARGE
Pass a curl_off_t as parameter. This allows you to specify the maximum size
(in bytes) of a file to download. If the file requested is larger than this
value, the transfer will not start and \fICURLE_FILESIZE_EXCEEDED\fP will be
returned. (Added in 7.11.0)
\fBNOTE:\fP The file size is not always known prior to download, and for such
files this option has no effect even if the file transfer ends up being larger
than this given limit. This concerns both FTP and HTTP transfers.
The file size is not always known prior to download, and for such files this
option has no effect even if the file transfer ends up being larger than this
given limit. This concerns both FTP and HTTP transfers.
.IP CURLOPT_TIMECONDITION
Pass a long as parameter. This defines how the \fICURLOPT_TIMEVALUE\fP time
value is treated. You can set this parameter to \fICURL_TIMECOND_IFMODSINCE\fP
or \fICURL_TIMECOND_IFUNMODSINCE\fP. This feature applies to HTTP and FTP.
\fBNOTE:\fP The last modification time of a file is not always known and in such
instances this feature will have no effect even if the given time condition
would have not been met.
The last modification time of a file is not always known and in such instances
this feature will have no effect even if the given time condition would have
not been met.
.IP CURLOPT_TIMEVALUE
Pass a long as parameter. This should be the time in seconds since 1 jan 1970,
and the time will be used in a condition as specified with
@@ -925,8 +954,8 @@ considerable time and limiting operations to less than a few minutes risk
aborting perfectly normal operations. This option will cause curl to use the
SIGALRM to enable time-outing system calls.
\fBNOTE:\fP this is not recommended to use in unix multi-threaded programs, as
it uses signals unless \fICURLOPT_NOSIGNAL\fP (see above) is set.
In unix-like systems, this might cause signals to be used unless
\fICURLOPT_NOSIGNAL\fP is set.
.IP CURLOPT_LOW_SPEED_LIMIT
Pass a long as parameter. It contains the transfer speed in bytes per second
that the transfer should be below during \fICURLOPT_LOW_SPEED_TIME\fP seconds
@@ -947,9 +976,9 @@ When reaching the maximum limit, curl uses the \fICURLOPT_CLOSEPOLICY\fP to
figure out which of the existing connections to close to prevent the number of
open connections to increase.
\fBNOTE:\fP if you already have performed transfers with this curl handle,
setting a smaller MAXCONNECTS than before may cause open connections to get
closed unnecessarily.
If you already have performed transfers with this curl handle, setting a
smaller MAXCONNECTS than before may cause open connections to get closed
unnecessarily.
.IP CURLOPT_CLOSEPOLICY
Pass a long. This option sets what policy libcurl should use when the
connection cache is filled and one of the open connections has to be closed to
@@ -981,8 +1010,8 @@ it has connected, this option is of no more use. Set to zero to disable
connection timeout (it will then only timeout on the system's internal
timeouts). See also the \fICURLOPT_TIMEOUT\fP option.
\fBNOTE:\fP this is not recommended to use in unix multi-threaded programs, as
it uses signals unless \fICURLOPT_NOSIGNAL\fP (see above) is set.
In unix-like systems, this might cause signals to be used unless
\fICURLOPT_NOSIGNAL\fP is set.
.IP CURLOPT_IPRESOLVE
Allows an application to select what kind of IP addresses to use when
resolving host names. This is only interesting when using host names that
@@ -1019,9 +1048,9 @@ changed with \fICURLOPT_SSLKEYTYPE\fP.
Pass a pointer to a zero terminated string as parameter. The string should be
the format of your private key. Supported formats are "PEM", "DER" and "ENG".
\fBNOTE:\fP The format "ENG" enables you to load the private key from a crypto
engine. In this case \fICURLOPT_SSLKEY\fP is used as an identifier passed to
the engine. You have to set the crypto engine with \fICURLOPT_SSLENGINE\fP.
The format "ENG" enables you to load the private key from a crypto engine. In
this case \fICURLOPT_SSLKEY\fP is used as an identifier passed to the
engine. You have to set the crypto engine with \fICURLOPT_SSLENGINE\fP.
\&"DER" format key file currently does not work because of a bug in OpenSSL.
.IP CURLOPT_SSLKEYPASSWD
Pass a pointer to a zero terminated string as parameter. It will be used as
@@ -1031,14 +1060,14 @@ Pass a pointer to a zero terminated string as parameter. It will be used as
the identifier for the crypto engine you want to use for your private
key.
\fBNOTE:\fP If the crypto device cannot be loaded,
\fICURLE_SSL_ENGINE_NOTFOUND\fP is returned.
If the crypto device cannot be loaded, \fICURLE_SSL_ENGINE_NOTFOUND\fP is
returned.
.IP CURLOPT_SSLENGINE_DEFAULT
Sets the actual crypto engine as the default for (asymmetric) crypto
operations.
\fBNOTE:\fP If the crypto device cannot be set,
\fICURLE_SSL_ENGINE_SETFAILED\fP is returned.
If the crypto device cannot be set, \fICURLE_SSL_ENGINE_SETFAILED\fP is
returned.
.IP CURLOPT_SSLVERSION
Pass a long as parameter to control what version of SSL/TLS to attempt to use.
The available options are:
@@ -1104,26 +1133,25 @@ socket. It will be used to seed the random engine for SSL.
.IP CURLOPT_SSL_VERIFYHOST
Pass a long as parameter.
This option determines whether curl verifies that the server claims to be
who you want it to be.
This option determines whether libcurl verifies that the server cert is for
the server it is known as.
When negotiating an SSL connection, the server sends a certificate
indicating its identity.
When negotiating an SSL connection, the server sends a certificate indicating
its identity.
When \fICURLOPT_SSL_VERIFYHOST\fP is 2, that certificate must indicate
that the server is the server to which you meant to connect, or the
connection fails.
When \fICURLOPT_SSL_VERIFYHOST\fP is 2, that certificate must indicate that
the server is the server to which you meant to connect, or the connection
fails.
Curl considers the server the intended one when the Common Name field
or a Subject Alternate Name field in the certificate matches the host
name in the URL to which you told Curl to connect.
Curl considers the server the intended one when the Common Name field or a
Subject Alternate Name field in the certificate matches the host name in the
URL to which you told Curl to connect.
When the value is 1, the certificate must contain a Common Name field,
but it doesn't matter what name it says. (This is not ordinarily a
useful setting).
When the value is 1, the certificate must contain a Common Name field, but it
doesn't matter what name it says. (This is not ordinarily a useful setting).
When the value is 0, the connection succeeds regardless of the names in
the certificate.
When the value is 0, the connection succeeds regardless of the names in the
certificate.
The default, since 7.10, is 2.

View File

@@ -23,4 +23,4 @@ You must curl_free() the returned string when you're done with it.
.SH RETURN VALUE
A pointer to a zero terminated string or NULL if it failed.
.SH "SEE ALSO"
.BR curl_unescape(3), curl_free(3), RFC 2396
.BR curl_unescape "(3), " curl_free "(3), " RFC 2396

View File

@@ -243,7 +243,7 @@ where it'll store a human readable error message as well.
If you then want to transfer another file, the handle is ready to be used
again. Mind you, it is even preferred that you re-use an existing handle if
you intend to make another transfer. libcurl will then attempt to re-use the
previous
previous connection.
.SH "Multi-threading Issues"
The first basic rule is that you must \fBnever\fP share a libcurl handle (be

20
hiper/Makefile Normal file
View File

@@ -0,0 +1,20 @@
#
# Build a little app for the Hiper project
# During dev at least, we use a static libcurl.
#
LDFLAGS = -lcrypt -lidn -lssl -lcrypto -ldl -lz -lresolv -L../ares/.libs -lcares
LIBCURL = -L../lib/.libs/ -lcurl
CFLAGS = -I../include -g -DHAVE_CURL_MULTI_SOCKET
hiper: hiper.o $(LIBCURL)
$(CC) -o $@ $< $(LIBCURL) $(LDFLAGS)
hiper.o: hiper.c
$(CC) $(CFLAGS) -c $<
clean:
rm hiper.o hiper
$(LIBCURL):
(cd ../lib && make)

34
hiper/collecturls.pl Executable file
View File

@@ -0,0 +1,34 @@
#!/usr/bin/perl
# 1) http://randomurl.com/body.php
# 2) http://random.yahoo.com/fast/ryl
# 3) http://www.uroulette.com/visit
# 1) very slow, responds with URL in body meta style:
# <meta http-equiv="refresh" content="0; url=http://www.webmasterworld.com/forum85/735.htm">
# 2) Responds with non-HTTP headers like:
# Status: 301
# Location: http://www.adaptive.net/
# 3) ordinary 30X code and Location:
my $url;
map { $url .= " http://www.uroulette.com/visit"; } (1 .. 12);
print $url."\n";
my $count=0;
open(DUMP, ">>dump");
while(1) {
my @getit = `curl -si $url`;
for my $l (@getit) {
if($l =~ /^Location: (.*)/) {
print DUMP "$1\n";
print STDERR "$count\r";
$count++;
}
}
}

377
hiper/hiper.c Normal file
View File

@@ -0,0 +1,377 @@
/*****************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* $Id$
*
* Connect to N sites simultanouesly and download data.
*
*/
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#include <sys/poll.h>
#include <curl/curl.h>
/* The number of simultanoues connections/transfers we do */
#define NCONNECTIONS 2000
/* The least number of connections we are interested in, so when we go below
this amount we can just as well stop */
#define NMARGIN 50
/* 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[80];
size_t dlcounter;
struct globalinfo *global;
};
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;
#if 0
printf("%02d: %d, total %d\n",
c->id, c->dlcounter, c->global->dlcounter);
#endif
return realsize;
}
/* return the diff between two timevals, in us */
static long tvdiff(struct timeval *newer, struct timeval *older)
{
return (newer->tv_sec-older->tv_sec)*1000000+
(newer->tv_usec-older->tv_usec);
}
/* store the start time of the program in this variable */
static struct timeval timer;
static void timer_start(void)
{
/* capture the time of the start moment */
gettimeofday(&timer, NULL);
}
static struct timeval cont; /* at this moment we continued */
int still_running; /* keep number of running handles */
struct conncount {
long time_us;
long laps;
long maxtime;
};
struct conncount timecount[NCONNECTIONS+1];
static struct timeval timerpause;
static void timer_pause(void)
{
/* capture the time of the pause moment */
gettimeofday(&timerpause, NULL);
/* If we have a previous continue (all times except the first), we can now
store the time for a whole "lap" */
if(cont.tv_sec) {
long lap;
lap = tvdiff(&timerpause, &cont);
timecount[still_running].time_us += lap;
timecount[still_running].laps++; /* number of times added */
if(lap > timecount[still_running].maxtime) {
timecount[still_running].maxtime = lap;
}
}
}
static long paused; /* amount of us we have been pausing */
static void timer_continue(void)
{
/* Capture the time of the restored operation moment, now calculate how long
time we were paused and added that to the 'paused' variable.
*/
gettimeofday(&cont, NULL);
paused += tvdiff(&cont, &timerpause);
}
static long total; /* amount of us from start to stop */
static void timer_stop(void)
{
struct timeval stop;
/* Capture the time of the operation stopped moment, now calculate how long
time we were running and how much of that pausing.
*/
gettimeofday(&stop, NULL);
total = tvdiff(&stop, &timer);
}
struct globalinfo info;
struct connection conns[NCONNECTIONS];
long selects;
long selectsalive;
long timeouts;
long perform;
long performalive;
long performselect;
long topselect;
static void report(void)
{
int i;
long active = total - paused;
long numdl = 0;
for(i=0; i < NCONNECTIONS; i++) {
if(conns[i].dlcounter)
numdl++;
}
printf("Summary from %d simultanoues transfers:\n",
NCONNECTIONS);
printf("Total time %ldus - Paused %ldus = Active %ldus =\n Active/total"
" %ldus\n",
total, paused, active, active/NCONNECTIONS);
printf(" Active/(connections that delivered data) = %ldus\n",
active/numdl);
printf("%d out of %d connections provided data\n", numdl, NCONNECTIONS);
printf("%d calls to curl_multi_perform(), average %d alive. "
"Average time: %dus\n",
perform, performalive/perform, active/perform);
printf("%d calls to select(), average %d alive\n",
selects, selectsalive/selects);
printf(" Average number of readable connections per select() return: %d\n",
performselect/selects);
printf(" Max number of readable connections for a single select() "
"return: %d\n",
topselect);
printf("%ld select() timeouts\n", timeouts);
for(i=1; i< NCONNECTIONS; i++) {
if(timecount[i].laps) {
printf("Time %d connections, average %ld max %ld (%ld laps) average/conn: %ld\n",
i,
timecount[i].time_us/timecount[i].laps,
timecount[i].maxtime,
timecount[i].laps,
(timecount[i].time_us/timecount[i].laps)/i );
}
}
}
int main(int argc, char **argv)
{
CURLM *multi_handle;
CURLMsg *msg;
CURLcode code = CURLE_OK;
CURLMcode mcode = CURLM_OK;
int rc;
int i;
FILE *urls;
int startindex=0;
char buffer[256];
int prevalive=-1;
int prevsamecounter=0;
int prevtotal = -1;
memset(&info, 0, sizeof(struct globalinfo));
if(argc < 2) {
printf("Usage: hiper [file] [start index]\n");
return 1;
}
urls = fopen(argv[1], "r");
if(!urls)
/* failed to open list of urls */
return 1;
if(argc > 2)
startindex = atoi(argv[2]);
if(startindex) {
/* Pass this many lines before we start using URLs from the file. On
repeated invokes, try using different indexes to avoid torturing the
same servers. */
while(startindex--) {
if(!fgets(buffer, sizeof(buffer), urls))
break;
}
}
/* init the multi stack */
multi_handle = curl_multi_init();
for(i=0; i< NCONNECTIONS; i++) {
CURL *e;
char *nl;
memset(&conns[i], 0, sizeof(struct connection));
/* read a line from the file of URLs */
if(!fgets(conns[i].url, sizeof(conns[i].url), urls))
/* failed to read a line */
break;
/* strip off trailing newlines */
nl = strchr(conns[i].url, '\n');
if(nl)
*nl=0; /* cut */
printf("%d: Add URL %s\n", i, conns[i].url);
e = curl_easy_init();
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]);
#if 0
curl_easy_setopt(e, CURLOPT_VERBOSE, 1);
curl_easy_setopt(e, CURLOPT_ERRORBUFFER, errorbuffer);
#endif
/* add the easy to the multi */
curl_multi_add_handle(multi_handle, e);
}
/* we start some action by calling perform right away */
while(CURLM_CALL_MULTI_PERFORM ==
curl_multi_perform(multi_handle, &still_running));
printf("Starting timer!\n");
timer_start();
while(still_running) {
struct timeval timeout;
int rc; /* select() return code */
fd_set fdread;
fd_set fdwrite;
fd_set fdexcep;
int maxfd;
FD_ZERO(&fdread);
FD_ZERO(&fdwrite);
FD_ZERO(&fdexcep);
/* set a suitable timeout to play around with */
timeout.tv_sec = 0;
timeout.tv_usec = 50000;
/* get file descriptors from the transfers */
curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
timer_pause();
selects++;
selectsalive += still_running;
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
/* Output this here to make it outside the timer */
printf("Running: %d (%d bytes)\n", still_running, info.dlcounter);
timer_continue();
switch(rc) {
case -1:
/* select error */
break;
case 0:
timeouts++;
default:
/* timeout or readable/writable sockets */
do {
perform++;
performalive += still_running;
}
while(CURLM_CALL_MULTI_PERFORM ==
curl_multi_perform(multi_handle, &still_running));
performselect += rc;
if(rc > topselect)
topselect = rc;
break;
}
if(still_running < NMARGIN) {
printf("Only %d connections left alive, existing\n",
still_running);
break;
}
if((prevalive == still_running) && (prevtotal == info.dlcounter) &&
info.dlcounter) {
/* The same amount of still alive transfers as last lap, increase
counter. Only do this if _anything_ has been downloaded since it
tends to come here during the initial name lookup phase when using
asynch DNS libcurl otherwise.
*/
prevsamecounter++;
if(prevsamecounter >= IDLE_TIME) {
/* for the sake of being efficient, we stop the operation when
IDLE_TIME has passed without any bytes transfered */
printf("Idle time (%d secs) reached (with %d still claimed alive),"
" exiting\n",
IDLE_TIME, still_running);
break;
}
}
else {
prevsamecounter=0;
}
prevalive = still_running;
prevtotal = info.dlcounter;
}
timer_stop();
curl_multi_cleanup(multi_handle);
/* cleanup all the easy handles */
for(i=0; i< NCONNECTIONS; i++)
curl_easy_cleanup(conns[i].e);
report();
return code;
}

View File

@@ -309,6 +309,13 @@ typedef enum {
CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */
CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not
accepted and we failed to login */
CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */
CURLE_TFTP_PERM, /* 69 - permission problem on server */
CURLE_TFTP_DISKFULL, /* 70 - out of disk space on server */
CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */
CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */
CURLE_TFTP_EXISTS, /* 73 - File already exists */
CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */
CURL_LAST /* never use! */
} CURLcode;
@@ -896,6 +903,15 @@ typedef enum {
/* ignore Content-Length */
CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),
/* Set to non-zero to skip the IP address received in a 227 PASV FTP server
response. Typically used for FTP-SSL purposes but is not restricted to
that. libcurl will then instead use the same IP address it used for the
control connection. */
CINIT(FTP_SKIP_PASV_IP, LONG, 137),
/* Select "file method" to use when doing FTP */
CINIT(FTP_FILEMETHOD, LONG, 138),
CURLOPT_LASTENTRY /* the last unused */
} CURLoption;

View File

@@ -28,7 +28,13 @@
/* This is the version number of the libcurl package from which this header
file origins: */
#define LIBCURL_VERSION "7.14.1-CVS"
#define LIBCURL_VERSION "7.15.1-CVS"
/* The numeric version number is also available "in parts" by using these
defines: */
#define LIBCURL_VERSION_MAJOR 7
#define LIBCURL_VERSION_MINOR 15
#define LIBCURL_VERSION_PATCH 1
/* This is the numeric version of the libcurl version number, meant for easier
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
@@ -37,19 +43,14 @@
0xXXYYZZ
Where XX, YY and ZZ are the main version, release and patch numbers in
hexadecimal. All three numbers are always represented using two digits. 1.2
would appear as "0x010200" while version 9.11.7 appears as "0x090b07".
hexadecimal (using 8 bits each). All three numbers are always represented
using two digits. 1.2 would appear as "0x010200" while version 9.11.7
appears as "0x090b07".
This 6-digit hexadecimal number does not show pre-release number, and it is
always a greater number in a more recent release. It makes comparisons with
greater than and less than work.
This 6-digit (24 bits) hexadecimal number does not show pre-release number,
and it is always a greater number in a more recent release. It makes
comparisons with greater than and less than work.
*/
#define LIBCURL_VERSION_NUM 0x070e01
/* The numeric version number is also available "in parts" by using these
defines: */
#define LIBCURL_VERSION_MAJOR 7
#define LIBCURL_VERSION_MINOR 14
#define LIBCURL_VERSION_PATCH 1
#define LIBCURL_VERSION_NUM 0x070f01
#endif /* __CURL_CURLVER_H */

View File

@@ -1,3 +1,5 @@
#ifndef __CURL_MPRINTF_H
#define __CURL_MPRINTF_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
@@ -21,9 +23,6 @@
* $Id$
***************************************************************************/
#ifndef H_MPRINTF
#define H_MPRINTF
#include <stdarg.h>
#include <stdio.h> /* needed for FILE */
@@ -53,4 +52,4 @@ CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
# define vaprintf curl_mvaprintf
#endif
#endif /* H_MPRINTF */
#endif /* __CURL_MPRINTF_H */

View File

@@ -66,6 +66,15 @@
#include <sys/types.h>
#endif
/*
* This header file should not really need to include "curl.h" since curl.h
* itself includes this file and we expect user applications to do #include
* <curl/curl.h> without the need for especially including multi.h.
*
* For some reason we added this include here at one point, and rather than to
* break existing (wrongly written) libcurl applications, we leave it as-is
* but with this warning attached.
*/
#include "curl.h"
#ifdef __cplusplus
@@ -91,7 +100,7 @@ typedef int curl_socket_t;
#endif /* HAVE_CURL_MULTI_SOCKET */
typedef enum {
CURLM_CALL_MULTI_PERFORM=-1, /* please call curl_multi_perform() soon */
CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() soon */
CURLM_OK,
CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */
CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */

View File

@@ -8,10 +8,11 @@ TARGETS = libcurl_wc.lib libcurl_wc.dll libcurl_wc_imp.lib
CC = wcc386
CFLAGS = -3r -mf -d3 -hc -zff -zgf -zq -zm -s -fr=con -w2 -fpi -oilrtfm -bt=nt -bd &
CFLAGS = -3r -mf -d3 -hc -zff -zgf -zq -zm -zc -s -fr=con -w2 -fpi -oilrtfm -bt=nt -bd &
-d+ -dWIN32 -dHAVE_LONGLONG -dCURL_CA_BUNDLE=getenv("CURL_CA_BUNDLE") &
-dBUILDING_LIBCURL -dWITHOUT_MM_LIB -dHAVE_SPNEGO=1 -dENABLE_IPV6 &
-dDEBUG_THREADING_GETADDRINFO -dDEBUG=1 -dCURLDEBUG -I. -I..\include
-dDEBUG_THREADING_GETADDRINFO -dDEBUG=1 -dCURLDEBUG -d_WIN32_WINNT=0x0501 &
-I. -I..\include
OBJ_DIR = Watcom_obj
LIB_ARG = $(OBJ_DIR)\wlib.arg
@@ -44,7 +45,7 @@ OBJS = $(OBJ_DIR)\transfer.obj $(OBJ_DIR)\file.obj &
$(OBJ_DIR)\hostip6.obj $(OBJ_DIR)\inet_ntop.obj &
$(OBJ_DIR)\hostsyn.obj $(OBJ_DIR)\parsedate.obj &
$(OBJ_DIR)\select.obj $(OBJ_DIR)\sslgen.obj &
$(OBJ_DIR)\gtls.obj
$(OBJ_DIR)\gtls.obj $(OBJ_DIR)\tftp.obj
RESOURCE = $(OBJ_DIR)\libcurl.res
@@ -362,3 +363,9 @@ $(OBJ_DIR)\gtls.obj: gtls.c setup.h config-win32.h
$(OBJ_DIR)\sslgen.obj: sslgen.c setup.h config-win32.h urldata.h cookie.h &
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h sslgen.h &
ssluse.h gtls.h sendf.h strequal.h url.h memory.h memdebug.h
$(OBJ_DIR)\tftp.obj: tftp.c setup.h config-win32.h urldata.h cookie.h &
..\include\curl\curl.h ..\include\curl\curlver.h ..\include\curl\easy.h &
..\include\curl\multi.h formdata.h http_chunks.h hostip.h hash.h llist.h &
transfer.h sendf.h tftp.h progress.h ..\include\curl\mprintf.h memory.h &
select.h memdebug.h

View File

@@ -8,7 +8,7 @@ CSOURCES = file.c timeval.c base64.c hostip.c progress.c formdata.c \
content_encoding.c share.c http_digest.c md5.c http_negotiate.c \
http_ntlm.c inet_pton.c strtoofft.c strerror.c hostares.c hostasyn.c \
hostip4.c hostip6.c hostsyn.c hostthre.c inet_ntop.c parsedate.c \
select.c gtls.c sslgen.c
select.c gtls.c sslgen.c tftp.c
HHEADERS = arpa_telnet.h netrc.h file.h timeval.h base64.h hostip.h \
progress.h formdata.h cookie.h http.h sendf.h ftp.h url.h dict.h \
@@ -18,5 +18,6 @@ HHEADERS = arpa_telnet.h netrc.h file.h timeval.h base64.h hostip.h \
share.h md5.h http_digest.h http_negotiate.h http_ntlm.h ca-bundle.h \
inet_pton.h strtoofft.h strerror.h inet_ntop.h curlx.h memory.h \
setup.h transfer.h select.h easyif.h multiif.h parsedate.h sslgen.h \
gtls.h
gtls.h tftp.h sockaddr.h

View File

@@ -301,7 +301,7 @@ config.h: Makefile.netware
@echo $(DL)*/$(DL) >> $@
@echo $(DL)#define OS "i586-pc-NetWare"$(DL) >> $@
@echo $(DL)#define VERSION "$(LIBCURL_VERSION_STR)"$(DL) >> $@
@echo $(DL)#define PACKAGE_BUGREPORT "curl-bug@haxx.se"$(DL) >> $@
@echo $(DL)#define 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_ASSERT_H 1$(DL) >> $@
@echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@

View File

@@ -19,7 +19,6 @@
# files in the "cfg" directory, but then the make file
# in \src would need to be changed.
#
# $Id: Makefile.vc6,v 1.17 2004/01/13 08:57:01 bagder Exp $
##############################################################
#
@@ -67,8 +66,8 @@ USEMM_LIBS = YES
#############################################################
## Nothing more to do below this line!
CCNODBG = cl.exe /MD /O2 /DNDEBUG
CCDEBUG = cl.exe /MDd /Od /Gm /Zi /D_DEBUG /GZ
CCNODBG = cl.exe /O2 /DNDEBUG
CCDEBUG = cl.exe /Od /Gm /Zi /D_DEBUG /GZ
CFLAGSSSL = /DUSE_SSLEAY /I "$(OPENSSL_PATH)/inc32" /I "$(OPENSSL_PATH)/inc32/openssl"
CFLAGSZLIB = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ /I "$(ZLIB_PATH)"
CFLAGS = /I. /I../include /nologo /W3 /GX /DWIN32 /YX /FD /c /DBUILDING_LIBCURL
@@ -90,9 +89,20 @@ CFGSET = FALSE
!IFDEF WINDOWS_SSPI
CFLAGS = $(CFLAGS) /DUSE_WINDOWS_SSPI /I$(WINDOWS_SDK_PATH)\include
LFLAGS = $(LFLAGS) $(WINDOWS_SDK_PATH)\lib\secur32.lib
!ENDIF
##############################################################
# Runtime library configuration
RTLIB = /MD
RTLIBD = /MDd
!IF "$(RTLIBCFG)" == "static"
RTLIB = /MT
RTLIBD = /MTd
!ENDIF
######################
# release
@@ -100,7 +110,7 @@ LFLAGS = $(LFLAGS) $(WINDOWS_SDK_PATH)\lib\secur32.lib
TARGET = $(LIB_NAME).lib
DIROBJ = $(CFG)
LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET)
CC = $(CCNODBG) $(CFLAGSLIB)
CC = $(CCNODBG) $(RTLIB) $(CFLAGSLIB)
CFGSET = TRUE
!ENDIF
@@ -112,7 +122,7 @@ TARGET = $(LIB_NAME).lib
DIROBJ = $(CFG)
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
CC = $(CCNODBG) $(CFLAGSZLIB) $(CFLAGSLIB)
CC = $(CCNODBG) $(RTLIB) $(CFLAGSZLIB) $(CFLAGSLIB)
CFGSET = TRUE
!ENDIF
@@ -122,7 +132,7 @@ CFGSET = TRUE
!IF "$(CFG)" == "release-dll"
TARGET = $(LIB_NAME).dll
DIROBJ = $(CFG)
LNK = $(LNKDLL) $(WINLIBS) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME).lib
LNK = $(LNKDLL) $(RTLIB) $(WINLIBS) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME).lib
CC = $(CCNODBG)
CFGSET = TRUE
RESOURCE = $(DIROBJ)\libcurl.res
@@ -136,7 +146,7 @@ TARGET = $(LIB_NAME).lib
DIROBJ = $(CFG)
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32"
LNK = $(LNKLIB) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET)
CC = $(CCNODBG) $(CFLAGSSSL) $(CFLAGSLIB)
CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSLIB)
CFGSET = TRUE
!ENDIF
@@ -148,7 +158,7 @@ TARGET = $(LIB_NAME).dll
DIROBJ = $(CFG)
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"
LNK = $(LNKDLL) $(WINLIBS) /out:$(DIROBJ)\$(TARGET) $(SSLLIBS) $(LFLAGSSSL) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME).lib
CC = $(CCNODBG) $(CFLAGSSSL)
CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL)
CFGSET = TRUE
!ENDIF
@@ -161,7 +171,7 @@ DIROBJ = $(CFG)
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32"
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
LNK = $(LNKLIB) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
CC = $(CCNODBG) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB)
CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB)
CFGSET = TRUE
!ENDIF
@@ -173,7 +183,7 @@ TARGET = $(LIB_NAME).dll
DIROBJ = $(CFG)
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"
LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME).lib
CC = $(CCNODBG) $(CFLAGSSSL)
CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL)
CFGSET = TRUE
RESOURCE = $(DIROBJ)\libcurl.res
!ENDIF
@@ -186,7 +196,7 @@ TARGET = $(LIB_NAME).lib
DIROBJ = $(CFG)
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
LNK = $(LNKLIB) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
CC = $(CCNODBG) $(CFLAGSZLIB) $(CFLAGSLIB)
CC = $(CCNODBG) $(RTLIB) $(CFLAGSZLIB) $(CFLAGSLIB)
CFGSET = TRUE
!ENDIF
@@ -199,7 +209,7 @@ DIROBJ = $(CFG)
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"
LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
CC = $(CCNODBG) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB)
CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB)
CFGSET = TRUE
!ENDIF
@@ -211,7 +221,7 @@ TARGET = $(LIB_NAME).dll
DIROBJ = $(CFG)
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
LNK = $(LNKDLL) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME).lib
CC = $(CCNODBG) $(CFLAGSZLIB)
CC = $(CCNODBG) $(RTLIB) $(CFLAGSZLIB)
CFGSET = TRUE
RESOURCE = $(DIROBJ)\libcurl.res
!ENDIF
@@ -225,7 +235,7 @@ DIROBJ = $(CFG)
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"
LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME).lib
CC = $(CCNODBG) $(CFLAGSSSL) $(CFLAGSZLIB)
CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSZLIB)
CFGSET = TRUE
RESOURCE = $(DIROBJ)\libcurl.res
!ENDIF
@@ -237,7 +247,7 @@ RESOURCE = $(DIROBJ)\libcurl.res
TARGET = $(LIB_NAME_DEBUG).lib
DIROBJ = $(CFG)
LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET)
CC = $(CCDEBUG) $(CFLAGSLIB)
CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSLIB)
CFGSET = TRUE
!ENDIF
@@ -248,8 +258,8 @@ CFGSET = TRUE
TARGET = $(LIB_NAME_DEBUG).lib
DIROBJ = $(CFG)
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32"
LNK = $(LNKLIB) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET)
CC = $(CCDEBUG) $(CFLAGSSSL) $(CFLAGSLIB)
LNK = $(LNKLIB) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET)
CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSLIB)
CFGSET = TRUE
!ENDIF
@@ -261,7 +271,7 @@ TARGET = $(LIB_NAME_DEBUG).lib
DIROBJ = $(CFG)
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
CC = $(CCDEBUG) $(CFLAGSZLIB) $(CFLAGSLIB)
CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSZLIB) $(CFLAGSLIB)
CFGSET = TRUE
!ENDIF
@@ -273,7 +283,7 @@ TARGET = $(LIB_NAME_DEBUG).lib
DIROBJ = $(CFG)
LFLAGSSSL = /LIBPATH:$(OPENSSL_PATH)\out32dll
LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET)
CC = $(CCDEBUG) $(CFLAGSSSL) $(CFLAGSLIB)
CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSLIB)
CFGSET = TRUE
!ENDIF
@@ -285,8 +295,8 @@ TARGET = $(LIB_NAME_DEBUG).lib
DIROBJ = $(CFG)
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32"
LNK = $(LNKLIB) $(SSLLIBS) $(ZLIBLIBS) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
CC = $(CCDEBUG) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB)
LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB)
CFGSET = TRUE
!ENDIF
@@ -298,7 +308,7 @@ TARGET = $(LIB_NAME_DEBUG).lib
DIROBJ = $(CFG)
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
LNK = $(LNKLIB) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
CC = $(CCDEBUG) $(CFLAGSZLIB) $(CFLAGSLIB)
CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSZLIB) $(CFLAGSLIB)
CFGSET = TRUE
!ENDIF
@@ -311,7 +321,7 @@ DIROBJ = $(CFG)
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"
LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
CC = $(CCDEBUG) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB)
CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB)
CFGSET = TRUE
!ENDIF
@@ -322,7 +332,7 @@ CFGSET = TRUE
TARGET = $(LIB_NAME_DEBUG).dll
DIROBJ = $(CFG)
LNK = $(LNKDLL) $(WINLIBS) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME_DEBUG).lib /PDB:$(DIROBJ)\$(IMPLIB_NAME_DEBUG).pdb
CC = $(CCDEBUG)
CC = $(CCDEBUG) $(RTLIBD)
CFGSET = TRUE
RESOURCE = $(DIROBJ)\libcurl.res
!ENDIF
@@ -335,7 +345,7 @@ TARGET = $(LIB_NAME_DEBUG).dll
DIROBJ = $(CFG)
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"
LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME_DEBUG).lib /PDB:$(DIROBJ)\$(IMPLIB_NAME_DEBUG).pdb
CC = $(CCDEBUG) $(CFLAGSSSL)
CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL)
CFGSET = TRUE
RESOURCE = $(DIROBJ)\libcurl.res
!ENDIF
@@ -348,7 +358,7 @@ TARGET = $(LIB_NAME_DEBUG).dll
DIROBJ = $(CFG)
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
LNK = $(LNKDLL) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME_DEBUG).lib /PDB:$(DIROBJ)\$(IMPLIB_NAME_DEBUG).pdb
CC = $(CCDEBUG) $(CFLAGSZLIB)
CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSZLIB)
CFGSET = TRUE
RESOURCE = $(DIROBJ)\libcurl.res
!ENDIF
@@ -362,7 +372,7 @@ DIROBJ = $(CFG)
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"
LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME_DEBUG).lib /PDB:$(DIROBJ)\$(IMPLIB_NAME_DEBUG).pdb
CC = $(CCDEBUG) $(CFLAGSSSL) $(CFLAGSZLIB)
CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSZLIB)
CFGSET = TRUE
RESOURCE = $(DIROBJ)\libcurl.res
!ENDIF
@@ -469,6 +479,7 @@ X_OBJS= \
$(DIROBJ)\strerror.obj \
$(DIROBJ)\select.obj \
$(DIROBJ)\content_encoding.obj \
$(DIROBJ)\tftp.obj \
$(RESOURCE)
all : $(TARGET)

View File

@@ -27,7 +27,10 @@
/* #undef size_t */
/* Define this to 'int' if ssize_t is not an available typedefed type */
#if defined(__WATCOMC__) && (__WATCOMC__ >= 1240)
#else
#define ssize_t int
#endif
/* Define this to 'int' if socklen_t is not an available typedefed type */
#if !defined(ENABLE_IPV6) && ((_MSC_VER < 1300) || !defined(USE_SSLEAY))
@@ -232,6 +235,9 @@
/* use ioctlsocket() for non-blocking sockets */
#define HAVE_IOCTLSOCKET
/* Define this if you have struct sockaddr_storage */
#define HAVE_STRUCT_SOCKADDR_STORAGE
/* lber dynamic library file */
/* #undef DL_LBER_FILE */

View File

@@ -472,6 +472,9 @@ static bool trynextip(struct connectdata *conn,
if(sockindex != FIRSTSOCKET)
return TRUE; /* no next */
/* first close the failed socket */
sclose(conn->sock[sockindex]);
/* try the next address */
ai = conn->ip_addr->ai_next;
@@ -631,8 +634,9 @@ singleipconnect(struct connectdata *conn,
int error;
bool conected;
struct SessionHandle *data = conn->data;
curl_socket_t sockfd = socket(ai->ai_family, ai->ai_socktype,
ai->ai_protocol);
curl_socket_t sockfd;
sockfd = socket(ai->ai_family, conn->socktype, ai->ai_protocol);
if (sockfd == CURL_SOCKET_BAD)
return CURL_SOCKET_BAD;
@@ -660,7 +664,11 @@ singleipconnect(struct connectdata *conn,
/* set socket non-blocking */
Curl_nonblock(sockfd, TRUE);
/* Connect TCP sockets, bind UDP */
if(conn->socktype == SOCK_STREAM)
rc = connect(sockfd, ai->ai_addr, (socklen_t)ai->ai_addrlen);
else
rc = 0;
if(-1 == rc) {
error = Curl_ourerrno();

View File

@@ -158,12 +158,12 @@ CURLcode Curl_file_connect(struct connectdata *conn)
#endif
file->freepath = real_path; /* free this when done */
file->fd = fd;
if(!conn->data->set.upload && (fd == -1)) {
failf(conn->data, "Couldn't open file %s", conn->path);
Curl_file_done(conn, CURLE_FILE_COULDNT_READ_FILE);
return CURLE_FILE_COULDNT_READ_FILE;
}
file->fd = fd;
return CURLE_OK;
}

View File

@@ -105,7 +105,7 @@ Content-Disposition: form-data; name="FILECONTENT"
/* Length of the random boundary string. */
#define BOUNDARY_LENGTH 40
#ifndef CURL_DISABLE_HTTP
#if !defined(CURL_DISABLE_HTTP) || defined(USE_SSLEAY)
#include <stdio.h>
#include <stdlib.h>
@@ -128,6 +128,10 @@ Content-Disposition: form-data; name="FILECONTENT"
/* The last #include file should be: */
#include "memdebug.h"
#endif /* !defined(CURL_DISABLE_HTTP) || defined(USE_SSLEAY) */
#ifndef CURL_DISABLE_HTTP
#if defined(HAVE_BASENAME) && defined(NEED_BASENAME_PROTO)
/* This system has a basename() but no prototype for it! */
char *basename(char *path);
@@ -1511,7 +1515,7 @@ int main()
return 0;
}
#endif
#endif /* _FORM_DEBUG */
#else /* CURL_DISABLE_HTTP */
CURLFORMcode curl_formadd(struct curl_httppost **httppost,
@@ -1531,6 +1535,8 @@ void curl_formfree(struct curl_httppost *form)
#endif /* CURL_DISABLE_HTTP */
#if !defined(CURL_DISABLE_HTTP) || defined(USE_SSLEAY)
/*
* Curl_FormBoundary() creates a suitable boundary string and returns an
* allocated one. This is also used by SSL-code so it must be present even
@@ -1563,3 +1569,5 @@ char *Curl_FormBoundary(void)
return retstring;
}
#endif /* !defined(CURL_DISABLE_HTTP) || defined(USE_SSLEAY) */

105
lib/ftp.c
View File

@@ -94,6 +94,7 @@
#include "inet_ntop.h"
#include "select.h"
#include "parsedate.h" /* for the week day and month names */
#include "sockaddr.h" /* required for Curl_sockaddr_storage */
#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL)
#include "inet_ntoa_r.h"
@@ -174,13 +175,9 @@ static bool isBadFtpString(const char *string)
* to us. This function will sit and wait here until the server has
* connected.
*
* If FTP-SSL is used and SSL is requested for the data connection, this
* function will do that transport layer handshake too.
*
*/
static CURLcode AllowServerConnect(struct connectdata *conn)
{
CURLcode result;
int timeout_ms;
struct SessionHandle *data = conn->data;
curl_socket_t sock = conn->sock[SECONDARYSOCKET];
@@ -235,17 +232,6 @@ static CURLcode AllowServerConnect(struct connectdata *conn)
break;
}
/* If PASV is used, this is is made elsewhere */
if(conn->ssl[SECONDARYSOCKET].use) {
/* since we only have a plaintext TCP connection here, we must now
do the TLS stuff */
infof(data, "Doing the SSL/TLS handshake on the data stream\n");
/* BLOCKING */
result = Curl_ssl_connect(conn, SECONDARYSOCKET);
if(result)
return result;
}
return CURLE_OK;
}
@@ -792,11 +778,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
/******************************************************************
* IPv6-specific section
*/
#ifdef HAVE_STRUCT_SOCKADDR_STORAGE
struct sockaddr_storage ss;
#else
char ss[256]; /* this should be big enough to fit a lot */
#endif
struct Curl_sockaddr_storage ss;
struct addrinfo *res, *ai;
socklen_t sslen;
char hbuf[NI_MAXHOST];
@@ -858,7 +840,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
* Workaround for AIX5 getaddrinfo() problem (it doesn't set ai_socktype):
*/
if (ai->ai_socktype == 0)
ai->ai_socktype = SOCK_STREAM;
ai->ai_socktype = conn->socktype;
portsock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
if (portsock == CURL_SOCKET_BAD) {
@@ -1601,6 +1583,16 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
return CURLE_FTP_WEIRD_227_FORMAT;
}
/* we got OK from server */
if(data->set.ftp_skip_ip) {
/* told to ignore the remotely given IP but instead use the one we used
for the control connection */
infof(data, "Skips %d.%d.%d.%d for data connection, uses %s instead\n",
ip[0], ip[1], ip[2], ip[3],
conn->ip_addr_str);
snprintf(newhost, sizeof(newhost), "%s", conn->ip_addr_str);
}
else
snprintf(newhost, sizeof(newhost),
"%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
newport = (port[0]<<8) + port[1];
@@ -1622,8 +1614,6 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
return CURLE_FTP_WEIRD_PASV_REPLY;
}
/* we got OK from server */
if(data->change.proxy && *data->change.proxy) {
/*
* This is a tunnel through a http proxy and we need to connect to the
@@ -1805,7 +1795,7 @@ static CURLcode ftp_state_mdtm_resp(struct connectdata *conn,
switch(data->set.timecondition) {
case CURL_TIMECOND_IFMODSINCE:
default:
if(data->info.filetime < data->set.timevalue) {
if(data->info.filetime <= data->set.timevalue) {
infof(data, "The requested document is not new enough\n");
ftp->no_transfer = TRUE; /* mark this to not transfer data */
state(conn, FTP_STOP);
@@ -2032,6 +2022,16 @@ static CURLcode ftp_state_stor_resp(struct connectdata *conn,
return result;
}
if(conn->ssl[SECONDARYSOCKET].use) {
/* since we only have a plaintext TCP connection here, we must now
do the TLS stuff */
infof(data, "Doing the SSL/TLS handshake on the data stream\n");
/* BLOCKING */
result = Curl_ssl_connect(conn, SECONDARYSOCKET);
if(result)
return result;
}
*(ftp->bytecountp)=0;
/* When we know we're uploading a specified file, we can get the file
@@ -2131,6 +2131,15 @@ static CURLcode ftp_state_get_resp(struct connectdata *conn,
return result;
}
if(conn->ssl[SECONDARYSOCKET].use) {
/* since we only have a plaintext TCP connection here, we must now
do the TLS stuff */
infof(data, "Doing the SSL/TLS handshake on the data stream\n");
result = Curl_ssl_connect(conn, SECONDARYSOCKET);
if(result)
return result;
}
if(size > conn->maxdownload && conn->maxdownload > 0)
size = conn->size = conn->maxdownload;
@@ -2517,10 +2526,12 @@ static CURLcode ftp_statemach_act(struct connectdata *conn)
NBFTPSENDF(conn, "MKD %s", ftp->dirs[ftp->count1 - 1]);
state(conn, FTP_MKD);
}
else
else {
/* return failure */
failf(data, "Server denied you to change to the given directory");
return CURLE_FTP_ACCESS_DENIED;
}
}
else {
/* success */
ftp->count2=0;
@@ -3092,18 +3103,6 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
if(!ftp->no_transfer && !conn->bits.no_body) {
/* a transfer is about to take place */
if(conn->ssl[SECONDARYSOCKET].use &&
!data->set.ftp_use_port) {
/* PASV is used and we just got the data connection connected, then
it is time to handshake the secure stuff. */
infof(data, "Doing the SSL/TLS handshake on the data stream\n");
/* BLOCKING */
result = Curl_ssl_connect(conn, SECONDARYSOCKET);
if(result)
return result;
}
if(data->set.upload) {
NBFTPSENDF(conn, "TYPE %c", data->set.ftp_ascii?'A':'I');
state(conn, FTP_STOR_TYPE);
@@ -3643,8 +3642,6 @@ static CURLcode ftp_3rdparty_transfer(struct connectdata *conn)
return CURLE_OK;
}
/***********************************************************************
*
* ftp_parse_url_path()
@@ -3668,6 +3665,34 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
ftp = conn->proto.ftp;
ftp->ctl_valid = FALSE;
switch(data->set.ftp_filemethod) {
case FTPFILE_NOCWD:
/* fastest, but less standard-compliant */
ftp->file = conn->path; /* this is a full file path */
break;
case FTPFILE_SINGLECWD:
/* get the last slash */
slash_pos=strrchr(cur_pos, '/');
if(slash_pos) {
ftp->dirdepth = 1; /* we consider it to be a single dir */
ftp->dirs = (char **)calloc(1, sizeof(ftp->dirs[0]));
if(!ftp->dirs)
return CURLE_OUT_OF_MEMORY;
ftp->dirs[0] = curl_unescape(cur_pos, (int)(slash_pos-cur_pos));
if(!ftp->dirs[0]) {
free(ftp->dirs);
return CURLE_OUT_OF_MEMORY;
}
ftp->file = slash_pos+1; /* the rest is the file name */
}
else
ftp->file = cur_pos; /* this is a file name only */
break;
default: /* allow pretty much anything */
case FTPFILE_MULTICWD:
ftp->dirdepth = 0;
ftp->diralloc = 5; /* default dir depth to allocate */
ftp->dirs = (char **)calloc(ftp->diralloc, sizeof(ftp->dirs[0]));
@@ -3720,6 +3745,7 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
}
ftp->file = cur_pos; /* the rest is the file name */
}
if(*ftp->file) {
ftp->file = curl_unescape(ftp->file, 0);
@@ -3811,6 +3837,7 @@ static CURLcode ftp_dophase_done(struct connectdata *conn,
/* Failure detected, close the second socket if it was created already */
sclose(conn->sock[SECONDARYSOCKET]);
conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD;
return result;
}
if(ftp->no_transfer)

View File

@@ -110,6 +110,84 @@ static void showtime(struct SessionHandle *data,
infof(data, "%s", data->state.buffer);
}
/* this function does a BLOCKING SSL/TLS (re-)handshake */
static CURLcode handshake(struct connectdata *conn,
gnutls_session session,
int sockindex,
bool duringconnect)
{
struct SessionHandle *data = conn->data;
int rc;
do {
rc = gnutls_handshake(session);
if((rc == GNUTLS_E_AGAIN) || (rc == GNUTLS_E_INTERRUPTED)) {
long timeout_ms = DEFAULT_CONNECT_TIMEOUT;
long has_passed;
if(duringconnect && data->set.connecttimeout)
timeout_ms = data->set.connecttimeout*1000;
if(data->set.timeout) {
/* get the strictest timeout of the ones converted to milliseconds */
if((data->set.timeout*1000) < timeout_ms)
timeout_ms = data->set.timeout*1000;
}
/* Evaluate in milliseconds how much time that has passed */
has_passed = Curl_tvdiff(Curl_tvnow(), data->progress.t_startsingle);
/* subtract the passed time */
timeout_ms -= has_passed;
if(timeout_ms < 0) {
/* a precaution, no need to continue if time already is up */
failf(data, "SSL connection timeout");
return CURLE_OPERATION_TIMEOUTED;
}
rc = Curl_select(conn->sock[sockindex],
conn->sock[sockindex], (int)timeout_ms);
if(rc > 0)
/* reabable or writable, go loop*/
continue;
else if(0 == rc) {
/* timeout */
failf(data, "SSL connection timeout");
return CURLE_OPERATION_TIMEDOUT;
}
else {
/* anything that gets here is fatally bad */
failf(data, "select on SSL socket, errno: %d", Curl_ourerrno());
return CURLE_SSL_CONNECT_ERROR;
}
}
else
break;
} while(1);
if (rc < 0) {
failf(data, "gnutls_handshake() failed: %d", rc);
/* gnutls_perror(ret); */
return CURLE_SSL_CONNECT_ERROR;
}
return CURLE_OK;
}
static gnutls_x509_crt_fmt do_file_type(const char *type)
{
if(!type || !type[0])
return GNUTLS_X509_FMT_PEM;
if(curl_strequal(type, "PEM"))
return GNUTLS_X509_FMT_PEM;
if(curl_strequal(type, "DER"))
return GNUTLS_X509_FMT_DER;
return -1;
}
/*
* This function is called after the TCP connect has completed. Setup the TLS
* layer and do all necessary magic.
@@ -187,7 +265,17 @@ Curl_gtls_connect(struct connectdata *conn,
if(rc < 0)
return CURLE_SSL_CONNECT_ERROR;
/* put the anonymous credentials to the current session */
if(data->set.cert) {
if( gnutls_certificate_set_x509_key_file(
conn->ssl[sockindex].cred, data->set.cert,
data->set.key != 0 ? data->set.key : data->set.cert,
do_file_type(data->set.cert_type) ) ) {
failf(data, "error reading X.509 key or certificate file");
return CURLE_SSL_CONNECT_ERROR;
}
}
/* put the credentials to the current session */
rc = gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE,
conn->ssl[sockindex].cred);
@@ -206,61 +294,10 @@ Curl_gtls_connect(struct connectdata *conn,
infof (data, "SSL re-using session ID\n");
}
do {
rc = gnutls_handshake(session);
if((rc == GNUTLS_E_AGAIN) || (rc == GNUTLS_E_INTERRUPTED)) {
long timeout_ms;
long has_passed;
if(data->set.timeout || data->set.connecttimeout) {
/* get the most strict timeout of the ones converted to milliseconds */
if(data->set.timeout &&
(data->set.timeout>data->set.connecttimeout))
timeout_ms = data->set.timeout*1000;
else
timeout_ms = data->set.connecttimeout*1000;
}
else
timeout_ms = DEFAULT_CONNECT_TIMEOUT;
/* Evaluate in milliseconds how much time that has passed */
has_passed = Curl_tvdiff(Curl_tvnow(), data->progress.t_startsingle);
/* subtract the passed time */
timeout_ms -= has_passed;
if(timeout_ms < 0) {
/* a precaution, no need to continue if time already is up */
failf(data, "SSL connection timeout");
return CURLE_OPERATION_TIMEOUTED;
}
rc = Curl_select(conn->sock[sockindex],
conn->sock[sockindex], (int)timeout_ms);
if(rc > 0)
/* reabable or writable, go loop*/
continue;
else if(0 == rc) {
/* timeout */
failf(data, "SSL connection timeout");
return CURLE_OPERATION_TIMEDOUT;
}
else {
/* anything that gets here is fatally bad */
failf(data, "select on SSL socket, errno: %d", Curl_ourerrno());
return CURLE_SSL_CONNECT_ERROR;
}
}
else
break;
} while(1);
if (rc < 0) {
failf(data, "gnutls_handshake() failed: %d", rc);
/* gnutls_perror(ret); */
return CURLE_SSL_CONNECT_ERROR;
}
rc = handshake(conn, session, sockindex, TRUE);
if(rc)
/* handshake() sets its own error message with failf() */
return rc;
/* This function will return the peer's raw certificate (chain) as sent by
the peer. These certificates are in raw format (DER encoded for
@@ -467,6 +504,17 @@ ssize_t Curl_gtls_recv(struct connectdata *conn, /* connection data */
return -1;
}
if(ret == GNUTLS_E_REHANDSHAKE) {
/* BLOCKING call, this is bad but a work-around for now. Fixing this "the
proper way" takes a whole lot of work. */
CURLcode rc = handshake(conn, conn->ssl[num].session, num, FALSE);
if(rc)
/* handshake() writes error message on its own */
return rc;
*wouldblock = TRUE; /* then return as if this was a wouldblock */
return -1;
}
*wouldblock = FALSE;
if (!ret) {
failf(conn->data, "Peer closed the TLS connection");

View File

@@ -423,7 +423,11 @@ Curl_addrinfo *Curl_he2ai(struct hostent *he, int port)
prevai->ai_next = ai;
ai->ai_family = AF_INET; /* we only support this */
ai->ai_socktype = SOCK_STREAM; /* we only support this */
/* we return all names as STREAM, so when using this address for TFTP
the type must be ignored and conn->socktype be used instead! */
ai->ai_socktype = SOCK_STREAM;
ai->ai_addrlen = sizeof(struct sockaddr_in);
/* make the ai_addr point to the address immediately following this struct
and use that area to store the address */

View File

@@ -73,6 +73,7 @@
#include "strerror.h"
#include "url.h"
#include "inet_pton.h"
#include "connect.h"
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
@@ -186,6 +187,26 @@ bool Curl_ipvalid(struct SessionHandle *data)
}
#ifndef USE_THREADING_GETADDRINFO
#ifdef DEBUG_ADDRINFO
static void dump_addrinfo(struct connectdata *conn, const struct addrinfo *ai)
{
printf("dump_addrinfo:\n");
for ( ; ai; ai = ai->ai_next) {
char buf[INET6_ADDRSTRLEN];
printf(" fam %2d, CNAME %s, ",
ai->ai_family, ai->ai_canonname ? ai->ai_canonname : "<none>");
if (Curl_printable_address(ai, buf, sizeof(buf)))
printf("%s\n", buf);
else
printf("failed; %s\n", Curl_strerror(conn, Curl_ourerrno()));
}
}
#else
#define dump_addrinfo(x,y)
#endif
/*
* Curl_getaddrinfo() when built ipv6-enabled (non-threading version).
*
@@ -202,11 +223,11 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
struct addrinfo hints, *res;
int error;
char sbuf[NI_MAXSERV];
char *sbufptr = NULL;
char addrbuf[128];
curl_socket_t s;
int pf;
struct SessionHandle *data = conn->data;
int ai_flags;
*waitp=0; /* don't wait, we have the response now */
@@ -241,25 +262,32 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
}
}
memset(&hints, 0, sizeof(hints));
hints.ai_family = pf;
hints.ai_socktype = conn->socktype;
if((1 == Curl_inet_pton(AF_INET, hostname, addrbuf)) ||
(1 == Curl_inet_pton(AF_INET6, hostname, addrbuf))) {
/* the given address is numerical only, prevent a reverse lookup */
ai_flags = AI_NUMERICHOST;
hints.ai_flags = AI_NUMERICHOST;
}
#if 0 /* removed nov 8 2005 before 7.15.1 */
else
ai_flags = AI_CANONNAME;
hints.ai_flags = AI_CANONNAME;
#endif
memset(&hints, 0, sizeof(hints));
hints.ai_family = pf;
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = ai_flags;
if(port) {
snprintf(sbuf, sizeof(sbuf), "%d", port);
error = getaddrinfo(hostname, sbuf, &hints, &res);
sbufptr=sbuf;
}
error = getaddrinfo(hostname, sbufptr, &hints, &res);
if (error) {
infof(data, "getaddrinfo(3) failed for %s:%d\n", hostname, port);
return NULL;
}
dump_addrinfo(conn, res);
return res;
}
#endif /* USE_THREADING_GETADDRINFO */

View File

@@ -88,6 +88,10 @@
/* The last #include file should be: */
#include "memdebug.h"
#if defined(_MSC_VER) && defined(CURL_NO__BEGINTHREADEX)
#pragma message ("No _beginthreadex() available in this RTL")
#endif
/***********************************************************************
* Only for Windows threaded name resolves builds
**********************************************************************/
@@ -177,6 +181,7 @@ struct thread_sync_data {
};
/* Destroy resolver thread synchronization data */
static
void destroy_thread_sync_data(struct thread_sync_data * tsd)
{
if (tsd->hostname) {
@@ -198,6 +203,7 @@ void destroy_thread_sync_data(struct thread_sync_data * tsd)
}
/* Initialize resolver thread synchronization data */
static
BOOL init_thread_sync_data(struct thread_data * td,
char * hostname,
struct thread_sync_data * tsd)
@@ -239,6 +245,7 @@ BOOL init_thread_sync_data(struct thread_data * td,
}
/* acquire resolver thread synchronization */
static
BOOL acquire_thread_sync(struct thread_sync_data * tsd)
{
/* is the thread initiator still waiting for us ? */
@@ -265,6 +272,7 @@ BOOL acquire_thread_sync(struct thread_sync_data * tsd)
}
/* release resolver thread synchronization */
static
void release_thread_sync(struct thread_sync_data * tsd)
{
ReleaseMutex(tsd->mutex_terminate);
@@ -289,7 +297,7 @@ static unsigned __stdcall gethostbyname_thread (void *arg)
* This allows us to use it even after the container gets destroyed
* due to a resolver timeout.
*/
struct thread_sync_data tsd = {0};
struct thread_sync_data tsd = { 0,0,0,NULL };
if (!init_thread_sync_data(td, conn->async.hostname, &tsd)) {
/* thread synchronization data initialization failed */
return -1;
@@ -356,7 +364,7 @@ static unsigned __stdcall getaddrinfo_thread (void *arg)
* This allows us to use it even after the container gets destroyed
* due to a resolver timeout.
*/
struct thread_sync_data tsd = {0};
struct thread_sync_data tsd = { 0,0,0,NULL };
if (!init_thread_sync_data(td, conn->async.hostname, &tsd)) {
/* thread synchronization data initialization failed */
return -1;
@@ -559,7 +567,10 @@ static bool init_resolve_thread (struct connectdata *conn,
*/
thread_and_event[0] = td->thread_hnd;
thread_and_event[1] = td->event_thread_started;
if (WaitForMultipleObjects(sizeof(thread_and_event) / sizeof(thread_and_event[0]), thread_and_event, FALSE, INFINITE) == WAIT_FAILED) {
if (WaitForMultipleObjects(sizeof(thread_and_event) /
sizeof(thread_and_event[0]),
thread_and_event, FALSE,
INFINITE) == WAIT_FAILED) {
/* The resolver thread has been created,
* most probably it works now - ignoring this "minor" error
*/
@@ -653,15 +664,22 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn,
rc = CURLE_OUT_OF_MEMORY;
failf(data, "Could not resolve host: %s", curl_easy_strerror(rc));
}
else if(conn->async.done) {
if(conn->bits.httpproxy) {
failf(data, "Could not resolve proxy: %s; %s",
conn->proxy.dispname, Curl_strerror(conn, conn->async.status));
rc = CURLE_COULDNT_RESOLVE_PROXY;
}
else {
failf(data, "Could not resolve host: %s; %s",
conn->host.name, Curl_strerror(conn, conn->async.status));
rc = CURLE_COULDNT_RESOLVE_HOST;
}
}
else if (td->thread_status == (DWORD)-1 || conn->async.status == NO_DATA) {
failf(data, "Resolving host timed out: %s", conn->host.name);
rc = CURLE_OPERATION_TIMEDOUT;
}
else if(conn->async.done) {
failf(data, "Could not resolve host: %s; %s",
conn->host.name, Curl_strerror(conn,conn->async.status));
rc = CURLE_COULDNT_RESOLVE_HOST;
}
else
rc = CURLE_OPERATION_TIMEDOUT;
}
@@ -804,8 +822,10 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
memset(&hints, 0, sizeof(hints));
hints.ai_family = pf;
hints.ai_socktype = SOCK_STREAM;
hints.ai_socktype = conn->socktype;
#if 0 /* removed nov 8 2005 before 7.15.1 */
hints.ai_flags = AI_CANONNAME;
#endif
itoa(port, sbuf, 10);
/* fire up a new resolver thread! */

View File

@@ -621,6 +621,10 @@ CURLcode Curl_http_input_auth(struct connectdata *conn,
#endif
#ifndef CURL_DISABLE_CRYPTO_AUTH
if(checkprefix("Digest", start)) {
if((authp->avail & CURLAUTH_DIGEST) != 0) {
infof(data, "Ignoring duplicate digest auth header.\n");
}
else {
CURLdigest dig;
*availp |= CURLAUTH_DIGEST;
authp->avail |= CURLAUTH_DIGEST;
@@ -635,6 +639,7 @@ CURLcode Curl_http_input_auth(struct connectdata *conn,
data->state.authproblem = TRUE;
}
}
}
else
#endif
if(checkprefix("Basic", start)) {

View File

@@ -76,6 +76,11 @@
#include <rpc.h>
/* Handle of security.dll or secur32.dll, depending on Windows version */
static HMODULE s_hSecDll = NULL;
/* Pointer to SSPI dispatch table */
static PSecurityFunctionTable s_pSecFn = NULL;
#endif
/* The last #include file should be: */
@@ -305,8 +310,8 @@ ntlm_sspi_cleanup(struct ntlmdata *ntlm)
ntlm->type_2 = NULL;
}
if (ntlm->has_handles) {
DeleteSecurityContext(&ntlm->c_handle);
FreeCredentialsHandle(&ntlm->handle);
s_pSecFn->DeleteSecurityContext(&ntlm->c_handle);
s_pSecFn->FreeCredentialsHandle(&ntlm->handle);
ntlm->has_handles = 0;
}
if (ntlm->p_identity) {
@@ -337,7 +342,7 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
#endif
size_t size;
char *base64=NULL;
unsigned char ntlmbuf[256]; /* enough, unless the host/domain is very long */
unsigned char ntlmbuf[512]; /* enough, unless the host/domain is very long */
/* point to the address of the pointer that holds the string to sent to the
server, which is for a plain host or for a HTTP proxy */
@@ -376,6 +381,35 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
if(!passwdp)
passwdp=(char *)"";
#ifdef USE_WINDOWS_SSPI
/* If security interface is not yet initialized try to do this */
if (s_hSecDll == NULL) {
/* Determine Windows version. Security functions are located in
* security.dll on WinNT 4.0 and in secur32.dll on Win9x. Win2K and XP
* contain both these DLLs (security.dll just forwards calls to
* secur32.dll)
*/
OSVERSIONINFO osver;
osver.dwOSVersionInfoSize = sizeof(osver);
GetVersionEx(&osver);
if (osver.dwPlatformId == VER_PLATFORM_WIN32_NT
&& osver.dwMajorVersion == 4)
s_hSecDll = LoadLibrary("security.dll");
else
s_hSecDll = LoadLibrary("secur32.dll");
if (s_hSecDll != NULL) {
INIT_SECURITY_INTERFACE pInitSecurityInterface;
pInitSecurityInterface =
(INIT_SECURITY_INTERFACE)GetProcAddress(s_hSecDll,
"InitSecurityInterfaceA");
if (pInitSecurityInterface != NULL)
s_pSecFn = pInitSecurityInterface();
}
}
if (s_pSecFn == NULL)
return CURLE_RECV_ERROR;
#endif
switch(ntlm->state) {
case NTLMSTATE_TYPE1:
default: /* for the weird cases we (re)start here */
@@ -387,6 +421,7 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
ULONG attrs;
const char *user;
int domlen;
TimeStamp tsDummy; /* For Windows 9x compatibility of SPPI calls */
ntlm_sspi_cleanup(ntlm);
@@ -428,9 +463,9 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
ntlm->p_identity = NULL;
}
if (AcquireCredentialsHandle(
if (s_pSecFn->AcquireCredentialsHandle(
NULL, (char *)"NTLM", SECPKG_CRED_OUTBOUND, NULL, ntlm->p_identity,
NULL, NULL, &ntlm->handle, NULL
NULL, NULL, &ntlm->handle, &tsDummy
) != SEC_E_OK) {
return CURLE_OUT_OF_MEMORY;
}
@@ -442,20 +477,22 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
buf.BufferType = SECBUFFER_TOKEN;
buf.pvBuffer = ntlmbuf;
status = InitializeSecurityContext(&ntlm->handle, NULL, (char *) host,
status = s_pSecFn->InitializeSecurityContext(&ntlm->handle, NULL,
(char *) host,
ISC_REQ_CONFIDENTIALITY |
ISC_REQ_REPLAY_DETECT |
ISC_REQ_CONNECTION,
0, SECURITY_NETWORK_DREP, NULL, 0,
&ntlm->c_handle, &desc, &attrs, NULL
);
0, SECURITY_NETWORK_DREP,
NULL, 0,
&ntlm->c_handle, &desc,
&attrs, &tsDummy);
if (status == SEC_I_COMPLETE_AND_CONTINUE ||
status == SEC_I_CONTINUE_NEEDED) {
CompleteAuthToken(&ntlm->c_handle, &desc);
s_pSecFn->CompleteAuthToken(&ntlm->c_handle, &desc);
}
else if (status != SEC_E_OK) {
FreeCredentialsHandle(&ntlm->handle);
s_pSecFn->FreeCredentialsHandle(&ntlm->handle);
return CURLE_RECV_ERROR;
}
@@ -553,6 +590,7 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
SecBufferDesc type_2_desc, type_3_desc;
SECURITY_STATUS status;
ULONG attrs;
TimeStamp tsDummy; /* For Windows 9x compatibility of SPPI calls */
type_2_desc.ulVersion = type_3_desc.ulVersion = SECBUFFER_VERSION;
type_2_desc.cBuffers = type_3_desc.cBuffers = 1;
@@ -566,14 +604,14 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
type_3.pvBuffer = ntlmbuf;
type_3.cbBuffer = sizeof(ntlmbuf);
status = InitializeSecurityContext(&ntlm->handle, &ntlm->c_handle,
status = s_pSecFn->InitializeSecurityContext(&ntlm->handle, &ntlm->c_handle,
(char *) host,
ISC_REQ_CONFIDENTIALITY |
ISC_REQ_REPLAY_DETECT |
ISC_REQ_CONNECTION,
0, SECURITY_NETWORK_DREP, &type_2_desc,
0, &ntlm->c_handle, &type_3_desc,
&attrs, NULL);
&attrs, &tsDummy);
if (status != SEC_E_OK)
return CURLE_RECV_ERROR;
@@ -700,6 +738,13 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
size=64;
ntlmbuf[62]=ntlmbuf[63]=0;
/* Make sure that the user and domain strings fit in the target buffer
before we copy them there. */
if(size + userlen + domlen >= sizeof(ntlmbuf)) {
failf(conn->data, "user + domain name too big");
return CURLE_OUT_OF_MEMORY;
}
memcpy(&ntlmbuf[size], domain, domlen);
size += domlen;
@@ -763,6 +808,11 @@ Curl_ntlm_cleanup(struct connectdata *conn)
#ifdef USE_WINDOWS_SSPI
ntlm_sspi_cleanup(&conn->ntlm);
ntlm_sspi_cleanup(&conn->proxyntlm);
if (s_hSecDll != NULL) {
FreeLibrary(s_hSecDll);
s_hSecDll = NULL;
s_pSecFn = NULL;
}
#else
(void)conn;
#endif

View File

@@ -39,8 +39,7 @@ CURLntlm Curl_input_ntlm(struct connectdata *conn, bool proxy, char *header);
CURLcode Curl_output_ntlm(struct connectdata *conn, bool proxy);
void Curl_ntlm_cleanup(struct connectdata *conn);
#if (!defined(USE_SSLEAY) && !defined(USE_WINDOWS_SSPI)) || \
defined(CURL_DISABLE_HTTP)
#ifndef USE_NTLM
#define Curl_ntlm_cleanup(x)
#endif

View File

@@ -25,13 +25,13 @@
#include "setup.h"
char *Curl_inet_ntop(int af, const void *addr, char *buf, size_t size);
#ifdef HAVE_INET_NTOP
#define Curl_inet_ntop(af,addr,buf,size) inet_ntop(af,addr,buf,size)
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#else
char *Curl_inet_ntop(int af, const void *addr, char *buf, size_t size);
#define Curl_inet_ntop(af,addr,buf,size) inet_ntop(af,addr,buf,size)
#endif
#endif /* __INET_NTOP_H */

View File

@@ -25,13 +25,18 @@
#include "setup.h"
int Curl_inet_pton(int, const char *, void *);
#ifdef HAVE_INET_PTON
#define Curl_inet_pton(x,y,z) inet_pton(x,y,z)
#if defined(HAVE_NO_INET_PTON_PROTO)
int inet_pton(int af, const char *src, void *dst);
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#else
int Curl_inet_pton(int, const char *, void *);
#define Curl_inet_pton(x,y,z) inet_pton(x,y,z)
#endif
#endif /* __INET_PTON_H */

View File

@@ -61,6 +61,7 @@
#include "strtok.h"
#include "ldap.h"
#include "memory.h"
#include "base64.h"
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
@@ -78,6 +79,15 @@
#ifndef LDAP_SIZELIMIT_EXCEEDED
#define LDAP_SIZELIMIT_EXCEEDED 4
#endif
#ifndef LDAP_VERSION2
#define LDAP_VERSION2 2
#endif
#ifndef LDAP_VERSION3
#define LDAP_VERSION3 3
#endif
#ifndef LDAP_OPT_PROTOCOL_VERSION
#define LDAP_OPT_PROTOCOL_VERSION 0x0011
#endif
#define DLOPEN_MODE RTLD_LAZY /*! assume all dlopen() implementations have
this */
@@ -115,6 +125,11 @@ static void *liblber = NULL;
#endif
#endif
struct bv {
unsigned long bv_len;
char *bv_val;
};
static int DynaOpen(const char **mod_name)
{
#if defined(HAVE_DLOPEN) || defined(HAVE_LIBDL)
@@ -145,7 +160,7 @@ static int DynaOpen(const char **mod_name)
return (libldap != NULL);
#else
(void) mod_name;
*mod_name = "";
return (0);
#endif
}
@@ -247,10 +262,11 @@ CURLcode Curl_ldap(struct connectdata *conn, bool *done)
char *(__cdecl *ldap_get_dn)(void *, void *);
char *(__cdecl *ldap_first_attribute)(void *, void *, void **);
char *(__cdecl *ldap_next_attribute)(void *, void *, void *);
char **(__cdecl *ldap_get_values)(void *, void *, const char *);
void (__cdecl *ldap_value_free)(char **);
void **(__cdecl *ldap_get_values_len)(void *, void *, const char *);
void (__cdecl *ldap_value_free_len)(void **);
void (__cdecl *ldap_memfree)(void *);
void (__cdecl *ber_free)(void *, int);
int (__cdecl *ldap_set_option)(void *, int, void *);
void *server;
LDAPURLDesc *ludp = NULL;
@@ -259,6 +275,9 @@ CURLcode Curl_ldap(struct connectdata *conn, bool *done)
void *entryIterator; /*! type should be 'LDAPMessage *' */
int num = 0;
struct SessionHandle *data=conn->data;
int ldap_proto;
char *val_b64;
size_t val_b64_sz;
*done = TRUE; /* unconditionally */
infof(data, "LDAP local: %s\n", data->change.url);
@@ -272,7 +291,8 @@ CURLcode Curl_ldap(struct connectdata *conn, bool *done)
* pointer-to-object (data) and pointer-to-function.
*/
DYNA_GET_FUNCTION(void *(__cdecl *)(char *, int), ldap_init);
DYNA_GET_FUNCTION(int (__cdecl *)(void *, char *, char *), ldap_simple_bind_s);
DYNA_GET_FUNCTION(int (__cdecl *)(void *, char *, char *),
ldap_simple_bind_s);
DYNA_GET_FUNCTION(int (__cdecl *)(void *), ldap_unbind_s);
#ifndef WIN32
DYNA_GET_FUNCTION(int (*)(char *, LDAPURLDesc **), ldap_url_parse);
@@ -284,12 +304,16 @@ CURLcode Curl_ldap(struct connectdata *conn, bool *done)
DYNA_GET_FUNCTION(void *(__cdecl *)(void *, void *), ldap_next_entry);
DYNA_GET_FUNCTION(char *(__cdecl *)(int), ldap_err2string);
DYNA_GET_FUNCTION(char *(__cdecl *)(void *, void *), ldap_get_dn);
DYNA_GET_FUNCTION(char *(__cdecl *)(void *, void *, void **), ldap_first_attribute);
DYNA_GET_FUNCTION(char *(__cdecl *)(void *, void *, void *), ldap_next_attribute);
DYNA_GET_FUNCTION(char **(__cdecl *)(void *, void *, const char *), ldap_get_values);
DYNA_GET_FUNCTION(void (__cdecl *)(char **), ldap_value_free);
DYNA_GET_FUNCTION(char *(__cdecl *)(void *, void *, void **),
ldap_first_attribute);
DYNA_GET_FUNCTION(char *(__cdecl *)(void *, void *, void *),
ldap_next_attribute);
DYNA_GET_FUNCTION(void **(__cdecl *)(void *, void *, const char *),
ldap_get_values_len);
DYNA_GET_FUNCTION(void (__cdecl *)(void **), ldap_value_free_len);
DYNA_GET_FUNCTION(void (__cdecl *)(void *), ldap_memfree);
DYNA_GET_FUNCTION(void (__cdecl *)(void *, int), ber_free);
DYNA_GET_FUNCTION(int (__cdecl *)(void *, int, void *), ldap_set_option);
server = (*ldap_init)(conn->host.name, (int)conn->port);
if (server == NULL) {
@@ -299,9 +323,18 @@ CURLcode Curl_ldap(struct connectdata *conn, bool *done)
goto quit;
}
ldap_proto = LDAP_VERSION3;
(*ldap_set_option)(server, LDAP_OPT_PROTOCOL_VERSION, &ldap_proto);
rc = (*ldap_simple_bind_s)(server,
conn->bits.user_passwd ? conn->user : NULL,
conn->bits.user_passwd ? conn->passwd : NULL);
if (rc != 0) {
ldap_proto = LDAP_VERSION2;
(*ldap_set_option)(server, LDAP_OPT_PROTOCOL_VERSION, &ldap_proto);
rc = (*ldap_simple_bind_s)(server,
conn->bits.user_passwd ? conn->user : NULL,
conn->bits.user_passwd ? conn->passwd : NULL);
}
if (rc != 0) {
failf(data, "LDAP local: %s", (*ldap_err2string)(rc));
status = CURLE_LDAP_CANNOT_BIND;
@@ -346,21 +379,35 @@ CURLcode Curl_ldap(struct connectdata *conn, bool *done)
attribute;
attribute = (*ldap_next_attribute)(server, entryIterator, ber))
{
char **vals = (*ldap_get_values)(server, entryIterator, attribute);
struct bv **vals = (struct bv **)
(*ldap_get_values_len)(server, entryIterator, attribute);
if (vals != NULL)
{
for (i = 0; (vals[i] != NULL); i++)
{
Curl_client_write(data, CLIENTWRITE_BODY, (char *)"\t", 1);
Curl_client_write(data, CLIENTWRITE_BODY, (char*) attribute, 0);
Curl_client_write(data, CLIENTWRITE_BODY, (char *) attribute, 0);
Curl_client_write(data, CLIENTWRITE_BODY, (char *)": ", 2);
Curl_client_write(data, CLIENTWRITE_BODY, vals[i], 0);
if ((strlen(attribute) > 7) &&
(strcmp(";binary",
(char *)attribute +
(strlen((char *)attribute) - 7)) == 0)) {
/* Binary attribute, encode to base64. */
val_b64_sz = Curl_base64_encode(vals[i]->bv_val, vals[i]->bv_len,
&val_b64);
if (val_b64_sz > 0) {
Curl_client_write(data, CLIENTWRITE_BODY, val_b64, val_b64_sz);
free(val_b64);
}
} else
Curl_client_write(data, CLIENTWRITE_BODY, vals[i]->bv_val,
vals[i]->bv_len);
Curl_client_write(data, CLIENTWRITE_BODY, (char *)"\n", 0);
}
/* Free memory used to store values */
(*ldap_value_free)(vals);
(*ldap_value_free_len)((void **)vals);
}
Curl_client_write(data, CLIENTWRITE_BODY, (char *)"\n", 1);
@@ -518,8 +565,8 @@ static int _ldap_url_parse2 (const struct connectdata *conn, LDAPURLDesc *ludp)
return LDAP_NO_MEMORY;
p = strchr(ludp->lud_dn, '?');
LDAP_TRACE (("DN '%.*s'\n", p ? (size_t)(p-ludp->lud_dn) : strlen(ludp->lud_dn),
ludp->lud_dn));
LDAP_TRACE (("DN '%.*s'\n", p ? (size_t)(p-ludp->lud_dn) :
strlen(ludp->lud_dn), ludp->lud_dn));
if (!p)
goto success;

View File

@@ -4,7 +4,7 @@
LIBRARY LIBCURL
DESCRIPTION 'curl libcurl - http://curl.haxx.se'
;DESCRIPTION 'curl libcurl - http://curl.haxx.se'
EXPORTS
curl_easy_cleanup @ 1 ;

View File

@@ -92,12 +92,15 @@ CURL_EXTERN int curl_fclose(FILE *file, int line, const char *source);
#define ogetaddrinfo(host,serv,hint,res) \
curl_dogetaddrinfo(host,serv,hint,res,__LINE__,__FILE__)
#else
#undef getaddrinfo
#define getaddrinfo(host,serv,hint,res) \
curl_dogetaddrinfo(host,serv,hint,res,__LINE__,__FILE__)
#endif
#undef getnameinfo
#define getnameinfo(sa,salen,host,hostlen,serv,servlen,flags) \
curl_dogetnameinfo(sa,salen,host,hostlen,serv,servlen,flags, __LINE__, \
__FILE__)
#undef freeaddrinfo
#define freeaddrinfo(data) \
curl_dofreeaddrinfo(data,__LINE__,__FILE__)

View File

@@ -130,8 +130,8 @@ static const struct tzinfo tz[]= {
{"CET", -60}, /* Central European */
{"MET", -60}, /* Middle European */
{"MEWT", -60}, /* Middle European Winter */
{"MEST", -120 tDAYZONE}, /* Middle European Summer */
{"CEST", -120 tDAYZONE}, /* Central European Summer */
{"MEST", -60 tDAYZONE}, /* Middle European Summer */
{"CEST", -60 tDAYZONE}, /* Central European Summer */
{"MESZ", -60 tDAYZONE}, /* Middle European Summer */
{"FWT", -60}, /* French Winter */
{"FST", -60 tDAYZONE}, /* French Summer */

View File

@@ -104,7 +104,7 @@ int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms)
ret = 0;
num = 0;
if (readfd != CURL_SOCKET_BAD) {
if (pfd[num].revents & POLLIN)
if (pfd[num].revents & (POLLIN|POLLHUP))
ret |= CSELECT_IN;
if (pfd[num].revents & POLLERR)
ret |= CSELECT_ERR;

View File

@@ -169,8 +169,10 @@ typedef unsigned char bool;
#endif
#if defined(ENABLE_IPV6) || defined(USE_SSLEAY)
#if !defined(_MSC_VER) || (_MSC_VER >= 1300)
#include <ws2tcpip.h>
#endif
#endif
#if !defined(__GNUC__) || defined(__MINGW32__)
#define sclose(x) closesocket(x)
@@ -198,6 +200,7 @@ typedef unsigned char bool;
#define sread(x,y,z) read_s(x,y,z)
#define swrite(x,y,z) write_s(x,y,z)
#define select(n,r,w,x,t) select_s(n,r,w,x,t)
#define ioctl(x,y,z) ioctlsocket(x,y,(char *)(z))
#define IOCTL_3_ARGS
#include <tcp.h>
#ifdef word
@@ -227,7 +230,9 @@ typedef unsigned char bool;
#endif
#define DIR_CHAR "/"
#ifndef DOT_CHAR
#define DOT_CHAR "."
#endif
#ifdef DJGPP
#undef DOT_CHAR
@@ -262,6 +267,14 @@ typedef int curl_socket_t;
#endif
#endif
/* "cl -ML" or "cl -MLd" implies a single-threaded runtime library where
_beginthreadex() is not available */
#if defined(_MSC_VER) && !defined(_MT) && !defined(USE_ARES)
#undef USE_THREADING_GETADDRINFO
#undef USE_THREADING_GETHOSTBYNAME
#define CURL_NO__BEGINTHREADEX
#endif
#ifdef mpeix
#define IOCTL_3_ARGS
#endif
@@ -291,9 +304,15 @@ typedef int curl_socket_t;
#define USE_SSL /* Either OpenSSL || GnuTLS */
#endif
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_NTLM)
#if defined(USE_SSLEAY) || defined(USE_WINDOWS_SSPI)
#define USE_NTLM
#endif
#endif
#if defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_GOPHER)
#define CURL_DISABLE_GOPHER
#endif
#ifdef CURLDEBUG
#define DEBUGF(x) x
@@ -301,4 +320,4 @@ typedef int curl_socket_t;
#define DEBUGF(x)
#endif
#endif /* __CONFIG_H */
#endif /* __SETUP_H */

38
lib/sockaddr.h Normal file
View File

@@ -0,0 +1,38 @@
#ifndef __SOCKADDR_H
#define __SOCKADDR_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2005, 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$
***************************************************************************/
#include "setup.h"
#ifdef HAVE_STRUCT_SOCKADDR_STORAGE
struct Curl_sockaddr_storage {
struct sockaddr_storage buffer;
};
#else
struct Curl_sockaddr_storage {
char buffer[256]; /* this should be big enough to fit a lot */
};
#endif
#endif /* __SOCKADDR_H */

View File

@@ -104,11 +104,16 @@
#undef HAVE_PKCS12_SUPPORT
#endif
#if OPENSSL_VERSION_NUMBER >= 0x00906001L
#define HAVE_ERR_ERROR_STRING_N 1
#endif
#if OPENSSL_VERSION_NUMBER >= 0x00909000L
#define SSL_METHOD_QUAL const
#else
#define SSL_METHOD_QUAL
#endif
/*
* Number of bytes to read from the random number seed file. This must be
* a finite value (because some entropy "files" like /dev/urandom have
@@ -1121,7 +1126,7 @@ Curl_ossl_connect(struct connectdata *conn,
long lerr;
int what;
char * str;
SSL_METHOD *req_method;
SSL_METHOD_QUAL SSL_METHOD *req_method=NULL;
void *ssl_sessionid=NULL;
ASN1_TIME *certdate;
curl_socket_t sockfd = conn->sock[sockindex];
@@ -1162,7 +1167,7 @@ Curl_ossl_connect(struct connectdata *conn,
#ifdef SSL_CTRL_SET_MSG_CALLBACK
if (data->set.fdebug) {
if (!SSL_CTX_callback_ctrl(connssl->ctx, SSL_CTRL_SET_MSG_CALLBACK,
ssl_tls_trace)) {
(void (*)(void))ssl_tls_trace)) {
failf(data, "SSL: couldn't set callback!");
return CURLE_SSL_CONNECT_ERROR;
}

View File

@@ -42,7 +42,7 @@
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
#ifdef HAVE_NO_STRERROR_R_DECL
#if defined(HAVE_STRERROR_R) && defined(HAVE_NO_STRERROR_R_DECL)
#ifdef HAVE_POSIX_STRERROR_R
/* seen on AIX 5100-02 gcc 2.9 */
extern int strerror_r(int errnum, char *strerrbuf, size_t buflen);
@@ -245,6 +245,27 @@ curl_easy_strerror(CURLcode error)
case CURLE_LOGIN_DENIED:
return "FTP: login denied";;
case CURLE_TFTP_NOTFOUND:
return "TFTP: File Not Found";;
case CURLE_TFTP_PERM:
return "TFTP: Access Violation";;
case CURLE_TFTP_DISKFULL:
return "TFTP: Disk full or allocation exceeded";;
case CURLE_TFTP_ILLEGAL:
return "TFTP: Illegal operation";;
case CURLE_TFTP_UNKNOWNID:
return "TFTP: Unknown transfer ID";;
case CURLE_TFTP_EXISTS:
return "TFTP: File already exists";;
case CURLE_TFTP_NOSUCHUSER:
return "TFTP: No such user";;
case CURLE_URL_MALFORMAT_USER: /* not used by current libcurl */
case CURLE_MALFORMAT_USER: /* not used by current libcurl */
case CURLE_BAD_CALLING_ORDER: /* not used by current libcurl */

742
lib/tftp.c Normal file
View File

@@ -0,0 +1,742 @@
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2005, 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$
***************************************************************************/
#include "setup.h"
#ifndef CURL_DISABLE_TFTP
/* -- WIN32 approved -- */
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <ctype.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#include <errno.h>
#if defined(WIN32)
#include <time.h>
#include <io.h>
#else
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include <netinet/in.h>
#include <sys/time.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <netdb.h>
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef HAVE_NET_IF_H
#include <net/if.h>
#endif
#include <sys/ioctl.h>
#include <signal.h>
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#endif
#include "urldata.h"
#include <curl/curl.h>
#include "transfer.h"
#include "sendf.h"
#include "tftp.h"
#include "progress.h"
#include "connect.h"
#include "strerror.h"
#include "sockaddr.h" /* required for Curl_sockaddr_storage */
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
#include "memory.h"
#include "select.h"
/* The last #include file should be: */
#include "memdebug.h"
typedef enum {
TFTP_MODE_NETASCII=0,
TFTP_MODE_OCTET
} tftp_mode_t;
typedef enum {
TFTP_STATE_START=0,
TFTP_STATE_RX,
TFTP_STATE_TX,
TFTP_STATE_FIN
} tftp_state_t;
typedef enum {
TFTP_EVENT_INIT=0,
TFTP_EVENT_RRQ = 1,
TFTP_EVENT_WRQ = 2,
TFTP_EVENT_DATA = 3,
TFTP_EVENT_ACK = 4,
TFTP_EVENT_ERROR = 5,
TFTP_EVENT_TIMEOUT
} tftp_event_t;
typedef enum {
TFTP_ERR_UNDEF=0,
TFTP_ERR_NOTFOUND,
TFTP_ERR_PERM,
TFTP_ERR_DISKFULL,
TFTP_ERR_ILLEGAL,
TFTP_ERR_UNKNOWNID,
TFTP_ERR_EXISTS,
TFTP_ERR_NOSUCHUSER,
TFTP_ERR_TIMEOUT,
TFTP_ERR_NORESPONSE
} tftp_error_t;
typedef struct tftp_packet {
unsigned short event;
union {
struct {
unsigned char data[512];
} request;
struct {
unsigned short block;
unsigned char data[512];
} data;
struct {
unsigned short block;
} ack;
struct {
unsigned short code;
unsigned char data[512];
} error;
} u;
} tftp_packet_t;
typedef struct tftp_state_data {
tftp_state_t state;
tftp_mode_t mode;
tftp_error_t error;
struct connectdata *conn;
curl_socket_t sockfd;
int retries;
int retry_time;
int retry_max;
time_t start_time;
time_t max_time;
unsigned short block;
struct Curl_sockaddr_storage local_addr;
socklen_t local_addrlen;
struct Curl_sockaddr_storage remote_addr;
socklen_t remote_addrlen;
int rbytes;
int sbytes;
tftp_packet_t rpacket;
tftp_packet_t spacket;
} tftp_state_data_t;
/* Forward declarations */
static void tftp_rx(tftp_state_data_t *state, tftp_event_t event) ;
static void tftp_tx(tftp_state_data_t *state, tftp_event_t event) ;
void tftp_set_timeouts(tftp_state_data_t *state) ;
/**********************************************************
*
* tftp_set_timeouts -
*
* Set timeouts based on state machine state.
* Use user provided connect timeouts until DATA or ACK
* packet is received, then use user-provided transfer timeouts
*
*
**********************************************************/
void tftp_set_timeouts(tftp_state_data_t *state)
{
struct SessionHandle *data = state->conn->data;
time_t maxtime, timeout;
time(&state->start_time);
if(state->state == TFTP_STATE_START) {
/* Compute drop-dead time */
maxtime = (time_t)(data->set.connecttimeout?data->set.connecttimeout:30);
state->max_time = state->start_time+maxtime;
/* Set per-block timeout to total */
timeout = maxtime ;
/* Average restart after 5 seconds */
state->retry_max = timeout/5;
/* Compute the re-start interval to suit the timeout */
state->retry_time = timeout/state->retry_max;
if(state->retry_time<1) state->retry_time=1;
}
else {
/* Compute drop-dead time */
maxtime = data->set.timeout?data->set.timeout:3600;
state->max_time = state->start_time+maxtime;
/* Set per-block timeout to 10% of total */
timeout = maxtime/10 ;
/* Average reposting an ACK after 15 seconds */
state->retry_max = timeout/15;
}
/* But bound the total number */
if(state->retry_max<3) state->retry_max=3;
if(state->retry_max>50) state->retry_max=50;
/* Compute the re-ACK interval to suit the timeout */
state->retry_time = timeout/state->retry_max;
if(state->retry_time<1) state->retry_time=1;
infof(data, "set timeouts for state %d; Total %d, retry %d maxtry %d\n",
state->state, (state->max_time-state->start_time),
state->retry_time, state->retry_max);
}
/**********************************************************
*
* tftp_set_send_first
*
* Event handler for the START state
*
**********************************************************/
static void tftp_send_first(tftp_state_data_t *state, tftp_event_t event)
{
int sbytes;
const char *mode = "octet";
char *filename = state->conn->path;
struct SessionHandle *data = state->conn->data;
/* Set ascii mode if -B flag was used */
if(data->set.ftp_ascii)
mode = "netascii";
switch(event) {
case TFTP_EVENT_INIT: /* Send the first packet out */
case TFTP_EVENT_TIMEOUT: /* Resend the first packet out */
/* Increment the retry counter, quit if over the limit */
state->retries++;
if(state->retries>state->retry_max) {
state->error = TFTP_ERR_NORESPONSE;
state->state = TFTP_STATE_FIN;
return;
}
if(data->set.upload) {
/* If we are uploading, send an WRQ */
state->spacket.event = htons(TFTP_EVENT_WRQ);
filename = curl_unescape(filename, (int)strlen(filename));
state->conn->upload_fromhere = (char *)state->spacket.u.data.data;
if(data->set.infilesize != -1) {
Curl_pgrsSetUploadSize(data, data->set.infilesize);
}
}
else {
/* If we are downloading, send an RRQ */
state->spacket.event = htons(TFTP_EVENT_RRQ);
}
sprintf((char *)state->spacket.u.request.data, "%s%c%s%c",
filename, '\0', mode, '\0');
sbytes = 4 + (int)strlen(filename) + (int)strlen(mode);
sbytes = sendto(state->sockfd, (void *)&state->spacket,
sbytes, 0,
state->conn->ip_addr->ai_addr,
state->conn->ip_addr->ai_addrlen);
if(sbytes < 0) {
failf(data, "%s\n", strerror(errno));
}
break;
case TFTP_EVENT_ACK: /* Connected for transmit */
infof(data, "%s\n", "Connected for transmit");
state->state = TFTP_STATE_TX;
tftp_set_timeouts(state);
tftp_tx(state, event);
break;
case TFTP_EVENT_DATA: /* connected for receive */
infof(data, "%s\n", "Connected for receive");
state->state = TFTP_STATE_RX;
tftp_set_timeouts(state);
tftp_rx(state, event);
break;
case TFTP_EVENT_ERROR:
state->state = TFTP_STATE_FIN;
break;
default:
failf(state->conn->data, "tftp_send_first: internal error\n");
break;
}
}
/**********************************************************
*
* tftp_rx
*
* Event handler for the RX state
*
**********************************************************/
static void tftp_rx(tftp_state_data_t *state, tftp_event_t event)
{
int sbytes;
int rblock;
struct SessionHandle *data = state->conn->data;
switch(event) {
case TFTP_EVENT_DATA:
/* Is this the block we expect? */
rblock = ntohs(state->rpacket.u.data.block);
if ((state->block+1) != rblock) {
/* No, log it, up the retry count and fail if over the limit */
infof(data,
"Received unexpected DATA packet block %d\n", rblock);
state->retries++;
if (state->retries>state->retry_max) {
failf(data, "tftp_rx: giving up waiting for block %d\n",
state->block+1);
return;
}
}
/* This is the expected block. Reset counters and ACK it. */
state->block = rblock;
state->retries = 0;
state->spacket.event = htons(TFTP_EVENT_ACK);
state->spacket.u.ack.block = htons(state->block);
sbytes = sendto(state->sockfd, (void *)&state->spacket,
4, SEND_4TH_ARG,
(struct sockaddr *)&state->remote_addr,
state->remote_addrlen);
if(sbytes < 0) {
failf(data, "%s\n", strerror(errno));
}
/* Check if completed (That is, a less than full packet is recieved) */
if (state->rbytes < (int)sizeof(state->spacket)){
state->state = TFTP_STATE_FIN;
}
else {
state->state = TFTP_STATE_RX;
}
break;
case TFTP_EVENT_TIMEOUT:
/* Increment the retry count and fail if over the limit */
state->retries++;
infof(data,
"Timeout waiting for block %d ACK. Retries = %d\n", state->retries);
if(state->retries > state->retry_max) {
state->error = TFTP_ERR_TIMEOUT;
state->state = TFTP_STATE_FIN;
} else {
/* Resend the previous ACK */
sbytes = sendto(state->sockfd, (void *)&state->spacket,
4, SEND_4TH_ARG,
(struct sockaddr *)&state->remote_addr,
state->remote_addrlen);
/* Check all sbytes were sent */
if(sbytes<0) {
failf(data, "%s\n", strerror(errno));
}
}
break;
case TFTP_EVENT_ERROR:
state->state = TFTP_STATE_FIN;
break;
default:
failf(data, "%s\n", "tftp_rx: internal error");
break;
}
Curl_pgrsSetDownloadCounter(data,
(curl_off_t) state->block*512);
}
/**********************************************************
*
* tftp_tx
*
* Event handler for the TX state
*
**********************************************************/
static void tftp_tx(tftp_state_data_t *state, tftp_event_t event)
{
struct SessionHandle *data = state->conn->data;
int sbytes;
int rblock;
switch(event) {
case TFTP_EVENT_ACK:
/* Ack the packet */
rblock = ntohs(state->rpacket.u.data.block);
if(rblock != state->block) {
/* This isn't the expected block. Log it and up the retry counter */
infof(data, "Received ACK for block %d, expecting %d\n",
rblock, state->block);
state->retries++;
/* Bail out if over the maximum */
if(state->retries>state->retry_max) {
failf(data, "%s\n",
"tftp_tx: giving up waiting for block %d ack",
state->block);
}
return;
}
/* This is the expected packet. Reset the counters and send the next
block */
state->block++;
state->retries = 0;
state->spacket.event = htons(TFTP_EVENT_DATA);
state->spacket.u.ack.block = htons(state->block);
if(state->block > 1 && state->sbytes < 512) {
state->state = TFTP_STATE_FIN;
return;
}
Curl_fillreadbuffer(state->conn, 512, &state->sbytes);
sbytes = sendto(state->sockfd, (void *)&state->spacket,
4+state->sbytes, SEND_4TH_ARG,
(struct sockaddr *)&state->remote_addr,
state->remote_addrlen);
/* Check all sbytes were sent */
if(sbytes<0) {
failf(data, "%s\n", strerror(errno));
}
break;
case TFTP_EVENT_TIMEOUT:
/* Increment the retry counter and log the timeout */
state->retries++;
infof(data, "Timeout waiting for block %d ACK. "
" Retries = %d\n", state->retries);
/* Decide if we've had enough */
if(state->retries > state->retry_max) {
state->error = TFTP_ERR_TIMEOUT;
state->state = TFTP_STATE_FIN;
} else {
/* Re-send the data packet */
sbytes = sendto(state->sockfd, (void *)&state->spacket,
4+state->sbytes, SEND_4TH_ARG,
(struct sockaddr *)&state->remote_addr,
state->remote_addrlen);
/* Check all sbytes were sent */
if(sbytes<0) {
failf(data, "%s\n", strerror(errno));
}
}
break;
case TFTP_EVENT_ERROR:
state->state = TFTP_STATE_FIN;
break;
default:
failf(data, "%s\n", "tftp_tx: internal error");
break;
}
/* Update the progress meter */
Curl_pgrsSetUploadCounter(data, (curl_off_t) state->block*512);
}
/**********************************************************
*
* tftp_state_machine
*
* The tftp state machine event dispatcher
*
**********************************************************/
static CURLcode tftp_state_machine(tftp_state_data_t *state,
tftp_event_t event)
{
struct SessionHandle *data = state->conn->data;
switch(state->state) {
case TFTP_STATE_START:
DEBUGF(infof(data, "TFTP_STATE_START\n"));
tftp_send_first(state, event);
break;
case TFTP_STATE_RX:
DEBUGF(infof(data, "TFTP_STATE_RX\n"));
tftp_rx(state, event);
break;
case TFTP_STATE_TX:
DEBUGF(infof(data, "TFTP_STATE_TX\n"));
tftp_tx(state, event);
break;
case TFTP_STATE_FIN:
infof(data, "%s\n", "TFTP finished");
break;
default:
DEBUGF(infof(data, "STATE: %d\n", state->state));
failf(data, "%s\n", "Internal state machine error");
break;
}
return CURLE_OK;
}
/**********************************************************
*
* Curl_tftp_connect
*
* The connect callback
*
**********************************************************/
CURLcode Curl_tftp_connect(struct connectdata *conn, bool *done)
{
CURLcode code;
tftp_state_data_t *state;
int rc;
/*
* The TFTP code is not portable because it sends C structs directly over
* the wire. Since C gives compiler writers a wide latitude in padding and
* aligning structs, this fails on many architectures (e.g. ARM).
*
* The only portable way to fix this is to copy each struct item into a
* flat buffer and send the flat buffer instead of the struct. The
* alternative, trying to get the compiler to eliminate padding bytes
* within the struct, is a nightmare to maintain (each compiler does it
* differently), and is still not guaranteed to work because some
* architectures can't handle the resulting alignment.
*
* This check can be removed once the code has been fixed.
*/
if(sizeof(struct tftp_packet) != 516) {
failf(conn->data, "tftp not supported on this architecture");
return CURLE_FAILED_INIT;
}
if((state = conn->proto.tftp = calloc(sizeof(tftp_state_data_t), 1))==NULL) {
return CURLE_OUT_OF_MEMORY;
}
state->conn = conn;
state->sockfd = state->conn->sock[FIRSTSOCKET];
state->state = TFTP_STATE_START;
#ifdef WIN32
/* AF_UNSPEC == 0 (from above calloc) doesn't work on Winsock */
((struct sockaddr_in*)&state->local_addr)->sin_family = conn->ip_addr->ai_family;
#endif
tftp_set_timeouts(state);
/* Bind to any interface, random UDP port */
rc = bind(state->sockfd, (struct sockaddr *)&state->local_addr,
sizeof(state->local_addr));
if(rc) {
failf(conn->data, "bind() failed; %s\n",
Curl_strerror(conn,Curl_ourerrno()));
return CURLE_COULDNT_CONNECT;
}
Curl_pgrsStartNow(conn->data);
*done = TRUE;
code = CURLE_OK;
return(code);
}
/**********************************************************
*
* Curl_tftp_done
*
* The done callback
*
**********************************************************/
CURLcode Curl_tftp_done(struct connectdata *conn, CURLcode status)
{
(void)status; /* unused */
free(conn->proto.tftp);
conn->proto.tftp = NULL;
Curl_pgrsDone(conn);
return CURLE_OK;
}
/**********************************************************
*
* Curl_tftp
*
* The do callback
*
* This callback handles the entire TFTP transfer
*
**********************************************************/
CURLcode Curl_tftp(struct connectdata *conn, bool *done)
{
struct SessionHandle *data = conn->data;
tftp_state_data_t *state = (tftp_state_data_t *)(conn->proto.tftp);
tftp_event_t event;
CURLcode code;
int rc;
struct Curl_sockaddr_storage fromaddr;
socklen_t fromlen;
int check_time = 0;
(void)done; /* prevent compiler warning */
/* Run the TFTP State Machine */
for(tftp_state_machine(state, TFTP_EVENT_INIT);
state->state != TFTP_STATE_FIN;
tftp_state_machine(state, event) ) {
/* Wait until ready to read or timeout occurs */
rc=Curl_select(state->sockfd, CURL_SOCKET_BAD, state->retry_time * 1000);
if(rc == -1) {
/* bail out */
int error = Curl_ourerrno();
failf(data, "%s\n", Curl_strerror(conn, error));
event = TFTP_EVENT_ERROR;
}
else if (rc==0) {
/* A timeout occured */
event = TFTP_EVENT_TIMEOUT;
/* Force a look at transfer timeouts */
check_time = 0;
}
else {
/* Receive the packet */
fromlen=sizeof(fromaddr);
state->rbytes = recvfrom(state->sockfd,
(void *)&state->rpacket, sizeof(state->rpacket),
0, (struct sockaddr *)&fromaddr, &fromlen);
if(state->remote_addrlen==0) {
memcpy(&state->remote_addr, &fromaddr, fromlen);
state->remote_addrlen = fromlen;
}
/* The event is given by the TFTP packet time */
event = (tftp_event_t)ntohs(state->rpacket.event);
switch(event) {
case TFTP_EVENT_DATA:
Curl_client_write(data, CLIENTWRITE_BODY,
(char *)state->rpacket.u.data.data, state->rbytes-4);
break;
case TFTP_EVENT_ERROR:
state->error = (tftp_error_t)ntohs(state->rpacket.u.error.code);
infof(conn->data, "%s\n", (char *)state->rpacket.u.error.data);
break;
case TFTP_EVENT_ACK:
break;
case TFTP_EVENT_RRQ:
case TFTP_EVENT_WRQ:
default:
failf(conn->data, "%s\n", "Internal error: Unexpected packet");
break;
}
/* Update the progress meter */
Curl_pgrsUpdate(conn);
}
/* Check for transfer timeout every 10 blocks, or after timeout */
if(check_time%10==0) {
time_t current;
time(&current);
if(current>state->max_time) {
DEBUGF(infof(data, "timeout: %d > %d\n",
current, state->max_time));
state->error = TFTP_ERR_TIMEOUT;
state->state = TFTP_STATE_FIN;
}
}
}
/* Tell curl we're done */
Curl_Transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
/* If we have encountered an error */
if(state->error) {
/* Translate internal error codes to curl error codes */
switch(state->error) {
case TFTP_ERR_NOTFOUND:
code = CURLE_TFTP_NOTFOUND;
break;
case TFTP_ERR_PERM:
code = CURLE_TFTP_PERM;
break;
case TFTP_ERR_DISKFULL:
code = CURLE_TFTP_DISKFULL;
break;
case TFTP_ERR_ILLEGAL:
code = CURLE_TFTP_ILLEGAL;
break;
case TFTP_ERR_UNKNOWNID:
code = CURLE_TFTP_UNKNOWNID;
break;
case TFTP_ERR_EXISTS:
code = CURLE_TFTP_EXISTS;
break;
case TFTP_ERR_NOSUCHUSER:
code = CURLE_TFTP_NOSUCHUSER;
break;
case TFTP_ERR_TIMEOUT:
code = CURLE_OPERATION_TIMEOUTED;
break;
case TFTP_ERR_NORESPONSE:
code = CURLE_COULDNT_CONNECT;
break;
default:
code= CURLE_ABORTED_BY_CALLBACK;
break;
}
}
else
code = CURLE_OK;
return code;
}
#endif

31
lib/tftp.h Normal file
View File

@@ -0,0 +1,31 @@
#ifndef __TFTP_H
#define __TFTP_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2005, 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$
***************************************************************************/
#ifndef CURL_DISABLE_TFTP
CURLcode Curl_tftp_connect(struct connectdata *conn, bool *done);
CURLcode Curl_tftp(struct connectdata *conn, bool *done);
CURLcode Curl_tftp_done(struct connectdata *conn, CURLcode);
#endif
#endif

View File

@@ -214,7 +214,7 @@ CURLcode Curl_readrewind(struct connectdata *conn)
if(data->set.ioctl) {
curlioerr err;
err = data->set.ioctl(data, CURLIOCMD_RESTARTREAD,
err = (data->set.ioctl) (data, CURLIOCMD_RESTARTREAD,
data->set.ioctl_client);
infof(data, "the ioctl callback returned %d\n", (int)err);
@@ -880,11 +880,11 @@ CURLcode Curl_readwrite(struct connectdata *conn,
/* Content-Range: bytes [num]-
Content-Range: bytes: [num]-
The second format was added August 1st 2000 by Igor
Khristophorov since Sun's webserver JavaWebServer/1.1.1
obviously sends the header this way! :-( */
The second format was added since Sun's webserver
JavaWebServer/1.1.1 obviously sends the header this way!
*/
char *ptr = strstr(k->p, "bytes");
char *ptr = Curl_strcasestr(k->p, "bytes");
ptr+=5;
if(*ptr == ':')
@@ -1622,9 +1622,11 @@ Transfer(struct connectdata *conn)
CURLcode Curl_pretransfer(struct SessionHandle *data)
{
CURLcode res;
if(!data->change.url)
if(!data->change.url) {
/* we can't do anything wihout URL */
failf(data, "No URL set!\n");
return CURLE_URL_MALFORMAT;
}
/* Init the SSL session ID cache here. We do it here since we want to do it
after the *_setopt() calls (that could change the size of the cache) but
@@ -1763,7 +1765,7 @@ CURLcode Curl_follow(struct SessionHandle *data,
size_t newlen;
char *newest;
if (data->set.maxredirs &&
if ((data->set.maxredirs != -1) &&
(data->set.followlocation >= data->set.maxredirs)) {
failf(data,"Maximum (%d) redirects followed", data->set.maxredirs);
return CURLE_TOO_MANY_REDIRECTS;
@@ -2215,6 +2217,19 @@ CURLcode Curl_perform(struct SessionHandle *data)
if(newurl)
free(newurl);
if(res && !data->state.errorbuf) {
/*
* As an extra precaution: if no error string has been set and there was
* an error, use the strerror() string or if things are so bad that not
* even that is good, set a bad string that mentions the error code.
*/
const char *str = curl_easy_strerror(res);
if(!str)
failf(data, "unspecified error %d", (int)res);
else
failf(data, "%s", str);
}
/* run post-transfer uncondionally, but don't clobber the return code if
we already have an error code recorder */
res2 = Curl_posttransfer(data);

View File

@@ -77,9 +77,7 @@
#error "We can't compile without socket() support!"
#endif
#endif
#ifdef USE_LIBIDN
#include <idna.h>
#include <tld.h>
@@ -123,6 +121,7 @@ void idn_free (void *ptr); /* prototype from idn-free.h, not provided by
#include "ftp.h"
#include "dict.h"
#include "telnet.h"
#include "tftp.h"
#include "http.h"
#include "file.h"
#include "ldap.h"
@@ -321,14 +320,14 @@ CURLcode Curl_open(struct SessionHandle **curl)
data->set.infilesize = -1; /* we don't know any size */
data->set.postfieldsize = -1;
data->set.maxredirs = -1; /* allow any amount by default */
data->state.current_speed = -1; /* init to negative == impossible */
data->set.httpreq = HTTPREQ_GET; /* Default HTTP request */
data->set.ftp_use_epsv = TRUE; /* FTP defaults to EPSV operations */
data->set.ftp_use_eprt = TRUE; /* FTP defaults to EPRT operations */
data->set.ftp_use_lprt = TRUE; /* FTP defaults to EPRT operations */
data->set.ftp_filemethod = FTPFILE_MULTICWD;
data->set.dns_cache_timeout = 60; /* Timeout every 60 seconds by default */
/* make libcurl quiet by default: */
@@ -558,6 +557,12 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
*/
data->set.ftp_append = va_arg(param, long)?TRUE:FALSE;
break;
case CURLOPT_FTP_FILEMETHOD:
/*
* How do access files over FTP.
*/
data->set.ftp_filemethod = (curl_ftpfile)va_arg(param, long);
break;
case CURLOPT_NETRC:
/*
* Parse the $HOME/.netrc file
@@ -966,6 +971,14 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
data->set.ftp_use_epsv = va_arg(param, long)?TRUE:FALSE;
break;
case CURLOPT_FTP_SKIP_PASV_IP:
/*
* Enable or disable FTP_SKIP_PASV_IP, which will disable/enable the
* bypass of the IP address in PASV responses.
*/
data->set.ftp_skip_ip = (bool)va_arg(param, long);
break;
case CURLOPT_INFILE:
/*
* FILE pointer to read the file to be uploaded from. Or possibly
@@ -1994,7 +2007,8 @@ static CURLcode ConnectPlease(struct connectdata *conn,
struct SessionHandle *data = conn->data;
char *hostname = data->change.proxy?conn->proxy.name:conn->host.name;
infof(data, "About to connect() to %s port %d\n",
infof(data, "About to connect() to %s%s port %d\n",
data->change.proxy?"proxy ":"",
hostname, conn->port);
/*************************************************************
@@ -2364,12 +2378,18 @@ static CURLcode CreateConnection(struct SessionHandle *data,
if(urllen < LEAST_PATH_ALLOC)
urllen=LEAST_PATH_ALLOC;
conn->pathbuffer=(char *)malloc(urllen);
/*
* We malloc() the buffers below urllen+2 to make room for to possibilities:
* 1 - an extra terminating zero
* 2 - an extra slash (in case a syntax like "www.host.com?moo" is used)
*/
conn->pathbuffer=(char *)malloc(urllen+2);
if(NULL == conn->pathbuffer)
return CURLE_OUT_OF_MEMORY; /* really bad error */
conn->path = conn->pathbuffer;
conn->host.rawalloc=(char *)malloc(urllen);
conn->host.rawalloc=(char *)malloc(urllen+2);
if(NULL == conn->host.rawalloc)
return CURLE_OUT_OF_MEMORY;
conn->host.name = conn->host.rawalloc;
@@ -2722,6 +2742,8 @@ static CURLcode CreateConnection(struct SessionHandle *data,
* Setup internals depending on protocol
*************************************************************/
conn->socktype = SOCK_STREAM; /* most of them are TCP streams */
if (strequal(conn->protostr, "HTTP")) {
#ifndef CURL_DISABLE_HTTP
conn->port = PORT_HTTP;
@@ -2915,6 +2937,44 @@ static CURLcode CreateConnection(struct SessionHandle *data,
#else
failf(data, LIBCURL_NAME
" was built with FILE disabled!");
#endif
}
else if (strequal(conn->protostr, "TFTP")) {
#ifndef CURL_DISABLE_TFTP
char *type;
conn->socktype = SOCK_DGRAM; /* UDP datagram based */
conn->protocol |= PROT_TFTP;
conn->port = PORT_TFTP;
conn->remote_port = PORT_TFTP;
conn->curl_connect = Curl_tftp_connect;
conn->curl_do = Curl_tftp;
conn->curl_done = Curl_tftp_done;
/* TFTP URLs support an extension like ";mode=<typecode>" that
* we'll try to get now! */
type=strstr(conn->path, ";mode=");
if(!type) {
type=strstr(conn->host.rawalloc, ";mode=");
}
if(type) {
char command;
*type=0; /* it was in the middle of the hostname */
command = toupper((int)type[6]);
switch(command) {
case 'A': /* ASCII mode */
case 'N': /* NETASCII mode */
data->set.ftp_ascii = 1;
break;
case 'O': /* octet mode */
case 'I': /* binary mode */
default:
/* switch off ASCII */
data->set.ftp_ascii = 0;
break;
}
}
#else
failf(data, LIBCURL_NAME
" was built with TFTP disabled!");
#endif
}
else {
@@ -3796,7 +3856,14 @@ CURLcode Curl_do(struct connectdata **connp, bool *done)
/* conn may no longer be a good pointer */
if(CURLE_OK == result) {
/*
* According to bug report #1330310. We need to check for
* CURLE_SEND_ERROR here as well. I figure this could happen when the
* request failed on a FTP connection and thus Curl_done() itself tried
* to use the connection (again). Slight Lack of feedback in the report,
* but I don't think this extra check can do much harm.
*/
if((CURLE_OK == result) || (CURLE_SEND_ERROR == result)) {
bool async;
bool protocol_done = TRUE;

View File

@@ -35,6 +35,7 @@
#define PORT_HTTPS 443
#define PORT_DICT 2628
#define PORT_LDAP 389
#define PORT_TFTP 69
#define DICT_MATCH "/MATCH:"
#define DICT_MATCH2 "/M:"
@@ -309,6 +310,12 @@ typedef enum {
FTP_LAST /* never used */
} ftpstate;
typedef enum {
FTPFILE_MULTICWD = 1, /* as defined by RFC1738 */
FTPFILE_NOCWD = 2, /* use SIZE / RETR / STOR on the full path */
FTPFILE_SINGLECWD = 3 /* make one CWD, then SIZE / RETR / STOR on the file */
} curl_ftpfile;
struct FTP {
curl_off_t *bytecountp;
char *user; /* user name string */
@@ -540,6 +547,7 @@ struct connectdata {
#define PROT_DICT (1<<6)
#define PROT_LDAP (1<<7)
#define PROT_FILE (1<<8)
#define PROT_TFTP (1<<11)
#define PROT_FTPS (1<<9)
#define PROT_SSL (1<<10) /* protocol requires SSL */
@@ -560,6 +568,7 @@ struct connectdata {
char *ip_addr_str;
char protostr[16]; /* store the protocol string in this buffer */
int socktype; /* SOCK_STREAM or SOCK_DGRAM */
struct hostname host;
struct hostname proxy;
@@ -695,6 +704,7 @@ struct connectdata {
struct HTTP *gopher; /* alias, just for the sake of being more readable */
struct HTTP *https; /* alias, just for the sake of being more readable */
struct FTP *ftp;
void *tftp; /* private for tftp.c-eyes only */
struct FILEPROTO *file;
void *telnet; /* private for telnet.c-eyes only */
void *generic;
@@ -952,7 +962,8 @@ struct UserDefined {
char *set_range; /* range, if used. See README for detailed specification
on this syntax. */
long followlocation; /* as in HTTP Location: */
long maxredirs; /* maximum no. of http(s) redirects to follow */
long maxredirs; /* maximum no. of http(s) redirects to follow, set to -1
for infinity */
char *set_referer; /* custom string */
bool free_referer; /* set TRUE if 'referer' points to a string we
allocated */
@@ -1030,6 +1041,8 @@ struct UserDefined {
char *source_url; /* for 3rd party transfer */
char *source_userpwd; /* for 3rd party transfer */
curl_ftpfile ftp_filemethod; /* how to get to a file when FTP is used */
/* Here follows boolean settings that define how to behave during
this session. They are STATIC, set by libcurl users or at least initially
and they don't change during operations. */
@@ -1069,8 +1082,9 @@ struct UserDefined {
bool no_signal; /* do not use any signal/alarm handler */
bool global_dns_cache; /* subject for future removal */
bool tcp_nodelay; /* whether to enable TCP_NODELAY or not */
bool ignorecl; /* ignore content length */
bool ftp_skip_ip; /* skip the IP address the FTP server passes on to
us */
};
/*

View File

@@ -81,6 +81,9 @@ char *curl_version(void)
/* data for curl_version_info */
static const char * const protocols[] = {
#ifndef CURL_DISABLE_TFTP
"tftp",
#endif
#ifndef CURL_DISABLE_FTP
"ftp",
#endif

View File

@@ -3,6 +3,7 @@ Makefile.in
.deps
.libs
curl
config.h.in
config.h
hugehelp.c
stamp-h*

View File

@@ -82,8 +82,7 @@ $(OBJ_DIR)/homedir.obj: homedir.c setup.h config-win32.h ..\lib\setup.h &
..\include\curl\multi.h ..\include\curl\curl.h
$(OBJ_DIR)/hugehelp.obj: hugehelp.c setup.h config-win32.h ..\lib\setup.h &
..\lib\config-win32.h hugehelp.h ../../../zlib-1.2.1/zlib.h &
../../../zlib-1.2.1/zconf.h
..\lib\config-win32.h hugehelp.h
$(OBJ_DIR)/main.obj: main.c setup.h config-win32.h ..\lib\setup.h &
..\lib\config-win32.h ..\include\curl\curl.h ..\include\curl\curlver.h &
@@ -105,3 +104,6 @@ $(OBJ_DIR)/writeout.obj: writeout.c setup.h config-win32.h ..\lib\setup.h &
..\lib\config-win32.h ..\include\curl\curl.h ..\include\curl\curlver.h &
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
..\include\curl\mprintf.h writeout.h
$(OBJ_DIR)\timeval.obj: ..\lib\timeval.c ..\lib\timeval.h ..\lib\setup.h &
..\lib\config-win32.h

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