Compare commits
234 Commits
curl-7_14_
...
curl-7_15_
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f49df54a36 | ||
![]() |
952bbc4410 | ||
![]() |
1eb4b85d72 | ||
![]() |
59b6cb9e91 | ||
![]() |
e06afaeb7a | ||
![]() |
8c6f654b26 | ||
![]() |
1d8212e53a | ||
![]() |
083c5e17e1 | ||
![]() |
272231fb09 | ||
![]() |
67b4d9b232 | ||
![]() |
21709e1557 | ||
![]() |
9c312637d1 | ||
![]() |
feacad7f68 | ||
![]() |
6513303498 | ||
![]() |
3e2a52b034 | ||
![]() |
176d4e85e9 | ||
![]() |
84d30dffb6 | ||
![]() |
0fd282b078 | ||
![]() |
cdf4afbe50 | ||
![]() |
b222b2304e | ||
![]() |
fdf9900114 | ||
![]() |
5867eb2dd2 | ||
![]() |
61f145e3de | ||
![]() |
b97e7fc730 | ||
![]() |
01cbf08064 | ||
![]() |
fec632e948 | ||
![]() |
6aab5b57e1 | ||
![]() |
d2a27e02ce | ||
![]() |
b55506a76d | ||
![]() |
afc2aa2b3f | ||
![]() |
d055b269ed | ||
![]() |
8a246a4a9f | ||
![]() |
2f684351bf | ||
![]() |
74e5beab9d | ||
![]() |
b41765f441 | ||
![]() |
05a6013f42 | ||
![]() |
cfff544d67 | ||
![]() |
599d9642ca | ||
![]() |
0264faaa4e | ||
![]() |
4022a60ea7 | ||
![]() |
39e366fc11 | ||
![]() |
096675824f | ||
![]() |
80bfa76ac9 | ||
![]() |
b2e553a82e | ||
![]() |
772b64d9d3 | ||
![]() |
92c0de518e | ||
![]() |
ff96456513 | ||
![]() |
e89adbef51 | ||
![]() |
22a6a6cf81 | ||
![]() |
fd870e4e8a | ||
![]() |
d52ed3fff2 | ||
![]() |
bac17ab7d8 | ||
![]() |
9ace303528 | ||
![]() |
7e81c35cdc | ||
![]() |
0f125d9bcf | ||
![]() |
d4714517c0 | ||
![]() |
280e4bf4c3 | ||
![]() |
adf462fe05 | ||
![]() |
c2862742ab | ||
![]() |
8a712eb5af | ||
![]() |
d58790af17 | ||
![]() |
9ef7a13403 | ||
![]() |
a5da1219bb | ||
![]() |
be524fed38 | ||
![]() |
042016b85e | ||
![]() |
f6da574324 | ||
![]() |
b09d5c3135 | ||
![]() |
ec65c3fd53 | ||
![]() |
7ca2f31c8d | ||
![]() |
2275737a5d | ||
![]() |
5e3836055f | ||
![]() |
37a6a0bb3e | ||
![]() |
6bcca3eca9 | ||
![]() |
ce40b8d531 | ||
![]() |
9f109b94b8 | ||
![]() |
89024febde | ||
![]() |
b7a673c6e2 | ||
![]() |
7f68be770d | ||
![]() |
4f173f35db | ||
![]() |
ae9fbe573e | ||
![]() |
29676f473d | ||
![]() |
a5fcb26ab1 | ||
![]() |
d68b1a1e8c | ||
![]() |
bd8baed138 | ||
![]() |
00a7dda273 | ||
![]() |
4dba07c384 | ||
![]() |
4d39c6b7cc | ||
![]() |
7d6f6158c9 | ||
![]() |
6863dbbc0c | ||
![]() |
28b96efd8b | ||
![]() |
0f82af0f49 | ||
![]() |
f0d839436f | ||
![]() |
f1aa4b4127 | ||
![]() |
ccdb43f7f1 | ||
![]() |
72900f0f90 | ||
![]() |
3ad958ddb1 | ||
![]() |
2c77cc90f4 | ||
![]() |
db4c33b4fb | ||
![]() |
3fb04115fc | ||
![]() |
4faaa32aef | ||
![]() |
cab59b4c32 | ||
![]() |
931eff89f5 | ||
![]() |
175335808b | ||
![]() |
e00216581e | ||
![]() |
23951ec00c | ||
![]() |
a8fc5d0f9f | ||
![]() |
f5e85bab1c | ||
![]() |
9a44fa83dc | ||
![]() |
6b1e54da62 | ||
![]() |
b91421b107 | ||
![]() |
43b3954fa5 | ||
![]() |
80f2e3f263 | ||
![]() |
9ea423b4c1 | ||
![]() |
b259c9c535 | ||
![]() |
80f481a5f7 | ||
![]() |
115fe1b577 | ||
![]() |
06d6ea651e | ||
![]() |
966fa848a0 | ||
![]() |
6f8fe67ace | ||
![]() |
d49edc8e09 | ||
![]() |
3b9c20fe31 | ||
![]() |
bd72c5eacf | ||
![]() |
9d152a77fd | ||
![]() |
33dc28b905 | ||
![]() |
43ce64dcca | ||
![]() |
9e0882ba98 | ||
![]() |
c890149c8c | ||
![]() |
1a1ab2e2e8 | ||
![]() |
715b706caa | ||
![]() |
bfa9c42c25 | ||
![]() |
9d98f97e1b | ||
![]() |
5eb5ce6ff3 | ||
![]() |
be9c873a6e | ||
![]() |
034d80f6cd | ||
![]() |
021e786c71 | ||
![]() |
0c6bb8cb66 | ||
![]() |
4d7f08a99e | ||
![]() |
fdef584681 | ||
![]() |
f335bac8a3 | ||
![]() |
51369753bb | ||
![]() |
82a4c2bce3 | ||
![]() |
e73c6e039e | ||
![]() |
19bad0844f | ||
![]() |
96cec4dfd7 | ||
![]() |
943aea6267 | ||
![]() |
b433e4a1e7 | ||
![]() |
20f1966c0e | ||
![]() |
ab1f5c3edd | ||
![]() |
b2be6799f2 | ||
![]() |
ea2618fc6f | ||
![]() |
62fdf8eaed | ||
![]() |
d3569a3572 | ||
![]() |
89df76e449 | ||
![]() |
e5b2f33b4f | ||
![]() |
934d312f50 | ||
![]() |
68917eb517 | ||
![]() |
3beb2f6b5d | ||
![]() |
b29017f15b | ||
![]() |
db83a0ebbc | ||
![]() |
6d9fddb95d | ||
![]() |
4284190cc4 | ||
![]() |
5e4cbd2d24 | ||
![]() |
06c3bec65d | ||
![]() |
e8c3bb45ba | ||
![]() |
4ec55a964d | ||
![]() |
b9420864c0 | ||
![]() |
bf6588b6a7 | ||
![]() |
e43217e664 | ||
![]() |
e19ee2d102 | ||
![]() |
b4c53e2cfd | ||
![]() |
a2902de67c | ||
![]() |
da192f7955 | ||
![]() |
a2210d23c3 | ||
![]() |
bd5a622400 | ||
![]() |
b9494cb0d6 | ||
![]() |
0f73af4470 | ||
![]() |
45e26b5c02 | ||
![]() |
6af5ea38ce | ||
![]() |
b6f0aa4394 | ||
![]() |
774dab58f6 | ||
![]() |
e3bdb98f7a | ||
![]() |
58d628c9f8 | ||
![]() |
1e69394545 | ||
![]() |
1cf798ad14 | ||
![]() |
da3992d2e9 | ||
![]() |
48908e4633 | ||
![]() |
f5ae149338 | ||
![]() |
3fe5311967 | ||
![]() |
6a48639c68 | ||
![]() |
e7093b3ca8 | ||
![]() |
d0a4104c0c | ||
![]() |
90559bed53 | ||
![]() |
973a18cf03 | ||
![]() |
3c666ce57a | ||
![]() |
a1287ec64f | ||
![]() |
5fbfa1bfa8 | ||
![]() |
da3ecc91f8 | ||
![]() |
09c8f558f7 | ||
![]() |
528a149def | ||
![]() |
29e36afb6b | ||
![]() |
0e39543d35 | ||
![]() |
0de20d8ee6 | ||
![]() |
cd5de5c0e5 | ||
![]() |
bd5afc26bd | ||
![]() |
9542dfdcdc | ||
![]() |
97a6d7b1a8 | ||
![]() |
209b9d4374 | ||
![]() |
0b8ccd0ae7 | ||
![]() |
0b7f5ad508 | ||
![]() |
8a38805e82 | ||
![]() |
836d88a4b8 | ||
![]() |
d5268ed511 | ||
![]() |
0e7d93858d | ||
![]() |
2164d760b7 | ||
![]() |
b9c8de598b | ||
![]() |
9889a811db | ||
![]() |
9e38d882b9 | ||
![]() |
e8635044b5 | ||
![]() |
56dea0ac9a | ||
![]() |
e8b77477c7 | ||
![]() |
64298e528d | ||
![]() |
4f1465e7c7 | ||
![]() |
6120041b69 | ||
![]() |
8c1213627d | ||
![]() |
3e6ae6eeb8 | ||
![]() |
291e9aeabd | ||
![]() |
a3d776187a | ||
![]() |
e55f502e2f | ||
![]() |
e369270f88 | ||
![]() |
7e845e7cfd | ||
![]() |
56d9624b56 | ||
![]() |
911d135deb | ||
![]() |
8107b90678 | ||
![]() |
7722452b98 |
@@ -12,3 +12,4 @@ depcomp
|
|||||||
config.guess
|
config.guess
|
||||||
config.sub
|
config.sub
|
||||||
ltmain.sh
|
ltmain.sh
|
||||||
|
libcurl.pc
|
||||||
|
337
CHANGES
337
CHANGES
@@ -7,6 +7,303 @@
|
|||||||
Changelog
|
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)
|
Version 7.14.1 (1 September 2005)
|
||||||
|
|
||||||
Daniel (29 August 2005)
|
Daniel (29 August 2005)
|
||||||
@@ -93,10 +390,11 @@ Daniel (9 August 2005)
|
|||||||
zone names thus limiting the effect of this bug.
|
zone names thus limiting the effect of this bug.
|
||||||
|
|
||||||
Daniel (8 August 2005)
|
Daniel (8 August 2005)
|
||||||
- Jon Grubbs filed bug report #1249962 which identified a problem with NTLM on
|
- Jon Grubbs filed bug report #1249962
|
||||||
a HTTP proxy if an FTP URL was given. libcurl now properly switches to pure
|
(http://curl.haxx.se/bug/view.cgi?id=1249962) which identified a problem
|
||||||
HTTP internally when an HTTP proxy is used, even for FTP URLs. The problem
|
with NTLM on a HTTP proxy if an FTP URL was given. libcurl now properly
|
||||||
would also occur with other multi-pass auth methods.
|
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)
|
Daniel (7 August 2005)
|
||||||
- When curl is built with GnuTLS, curl-config didn't include "SSL" when
|
- 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.
|
contains a flawed chunked encoding stream that still works the same.
|
||||||
|
|
||||||
Daniel (5 July 2005)
|
Daniel (5 July 2005)
|
||||||
- Gisle Vanem came up with a nice little work-around for bug #1230118. It
|
- Gisle Vanem came up with a nice little work-around for bug #1230118
|
||||||
seems the Windows (MSVC) libc time functions may return data one hour off if
|
(http://curl.haxx.se/bug/view.cgi?id=1230118). It seems the Windows (MSVC)
|
||||||
TZ is not set and automatic DST adjustment is enabled. This made
|
libc time functions may return data one hour off if TZ is not set and
|
||||||
curl_getdate() return wrong value, and it also concerned internal cookie
|
automatic DST adjustment is enabled. This made curl_getdate() return wrong
|
||||||
expirations etc.
|
value, and it also concerned internal cookie expirations etc.
|
||||||
|
|
||||||
Daniel (4 July 2005)
|
Daniel (4 July 2005)
|
||||||
- Andrew Bushnell provided enough info for me to tell that we badly needed to
|
- 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
|
- David Shaw updated libcurl.m4
|
||||||
|
|
||||||
Daniel (14 June 2005)
|
Daniel (14 June 2005)
|
||||||
- Gisle Vanem fixed a potential thread handle leak. Bug report #1216500.
|
- Gisle Vanem fixed a potential thread handle leak. Bug report #1216500
|
||||||
Comment in http://curl.haxx.se/mail/lib-2005-06/0059.html
|
(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)
|
Daniel (13 June 2005)
|
||||||
- Made buildconf run libtoolize in the ares dir too (inspired by Tupone's
|
- 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)
|
Daniel (1 June 2005)
|
||||||
- The configure check for c-ares now adds the cares lib before the other libs,
|
- 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
|
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)
|
Daniel (31 May 2005)
|
||||||
- Todd Kulesza reported a flaw in the proxy option, since a numerical IPv6
|
- 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
|
- 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
|
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
|
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)
|
Daniel (25 May 2005)
|
||||||
- Fixed problems with the test suite, and in particular the FTP test cases
|
- Fixed problems with the test suite, and in particular the FTP test cases
|
||||||
@@ -236,9 +535,10 @@ Daniel (20 May 2005)
|
|||||||
docs.
|
docs.
|
||||||
|
|
||||||
Daniel (18 May 2005)
|
Daniel (18 May 2005)
|
||||||
- John McGowan identified a problem in bug report #1204435 with malformed URLs
|
- John McGowan identified a problem in bug report #1204435
|
||||||
like "http://somehost?data" as it added a slash too much in the request
|
(http://curl.haxx.se/bug/view.cgi?id=1204435) with malformed URLs like
|
||||||
("GET /?data/"...). Added test case 260 to verify.
|
"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
|
- 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
|
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,
|
- 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
|
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
|
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
|
for host auth, which defaults to Basic). Bug report #1200661
|
||||||
the problem and the fix.
|
(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
|
- 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
|
silently discarded. Instead a proper warning message is diplayed that
|
||||||
|
@@ -31,6 +31,9 @@ bin_SCRIPTS = curl-config
|
|||||||
SUBDIRS = lib src
|
SUBDIRS = lib src
|
||||||
DIST_SUBDIRS = $(SUBDIRS) tests include packages docs
|
DIST_SUBDIRS = $(SUBDIRS) tests include packages docs
|
||||||
|
|
||||||
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
|
pkgconfig_DATA = libcurl.pc
|
||||||
|
|
||||||
dist-hook:
|
dist-hook:
|
||||||
rm -rf $(top_builddir)/tests/log
|
rm -rf $(top_builddir)/tests/log
|
||||||
find $(distdir) -name "*.dist" -exec rm {} \;
|
find $(distdir) -name "*.dist" -exec rm {} \;
|
||||||
|
52
README
52
README
@@ -32,31 +32,33 @@ WEB SITE
|
|||||||
|
|
||||||
Visit the curl web site or mirrors for the latest news and downloads:
|
Visit the curl web site or mirrors for the latest news and downloads:
|
||||||
|
|
||||||
Sweden -- http://curl.haxx.se/
|
Sweden http://curl.haxx.se/
|
||||||
Australia -- http://curl.planetmirror.com/
|
Australia http://curl.planetmirror.com/
|
||||||
Austria -- http://curl.gds.tuwien.ac.at/
|
Austria http://curl.gds.tuwien.ac.at/
|
||||||
Canada -- http://curl.meulie.net/
|
Denmark http://curl.cofman.dk/
|
||||||
Denmark -- http://curl.cofman.dk/
|
France http://curl.fastmirror.net/
|
||||||
Estonia -- http://curl.wildyou.net/
|
Germany http://curl.miscellaneousmirror.org/
|
||||||
France -- http://curl.mirror.internet.tp/
|
Germany http://curl.mirror.at.stealer.net/
|
||||||
Germany -- http://curl.miscellaneousmirror.org/
|
Germany http://curl.mirroring.de/
|
||||||
Germany -- http://curl.mirror.at.stealer.net/
|
Germany http://curl.mons-new-media.de/
|
||||||
Germany -- http://curl.mirroring.de/
|
Germany http://curl.triplemind.com/
|
||||||
Germany -- http://curl.mons-new-media.de/
|
Germany http://curl.freemirror.de/
|
||||||
Germany -- http://curl.netmirror.org/
|
Netherlands http://curl.nedmirror.nl/
|
||||||
Russia -- http://curl.tsuren.net/
|
Russia http://curl.tsuren.net/
|
||||||
Taiwan -- http://curl.cs.pu.edu.tw/
|
Taiwan http://curl.cs.pu.edu.tw/
|
||||||
Thailand -- http://curl.siamu.ac.th/
|
Thailand http://curl.siamu.ac.th/
|
||||||
US (AZ) -- http://curl.islandofpoker.com/
|
US (AZ) http://curl.islandofpoker.com/
|
||||||
US (CA) -- http://curl.mirror.redwire.net/
|
US (CA) http://curl.mirror.redwire.net/
|
||||||
US (CA) -- http://curl.mirrormonster.com/
|
US (CA) http://curl.mirrormonster.com/
|
||||||
US (CA) -- http://curl.signal42.com/
|
US (CA) http://curl.signal42.com/
|
||||||
US (CA) -- http://curl.tolix.org/
|
US (CA) http://curl.tolix.org/
|
||||||
US (CA) -- http://curl.webhosting76.com/
|
US (CA) http://curl.webhosting76.com/
|
||||||
US (TX) -- http://curl.109k.com/
|
US (CA) http://curl.meulie.net/
|
||||||
US (TX) -- http://curl.mirrors.cyberservers.net/
|
US (FL) http://curl.hoxt.com/
|
||||||
US (TX) -- http://curl.seekmeup.com/
|
US (TX) http://curl.109k.com/
|
||||||
US (TX) -- http://curl.hostingzero.com/
|
US (TX) http://curl.mirrors.cyberservers.net/
|
||||||
|
US (TX) http://curl.seekmeup.com/
|
||||||
|
US (TX) http://curl.hostingzero.com/
|
||||||
|
|
||||||
CVS
|
CVS
|
||||||
|
|
||||||
|
101
RELEASE-NOTES
101
RELEASE-NOTES
@@ -1,74 +1,61 @@
|
|||||||
Curl and libcurl 7.14.1
|
Curl and libcurl 7.15.1
|
||||||
|
|
||||||
Public curl release number: 89
|
Public curl release number: 91
|
||||||
Releases counted from the very beginning: 116
|
Releases counted from the very beginning: 118
|
||||||
Available command line options: 108
|
Available command line options: 109
|
||||||
Available curl_easy_setopt() options: 123
|
Available curl_easy_setopt() options: 125
|
||||||
Number of public functions in libcurl: 46
|
Number of public functions in libcurl: 46
|
||||||
Amount of public web site mirrors: 25
|
Amount of public web site mirrors: 27
|
||||||
Number of known libcurl bindings: 31
|
Number of known libcurl bindings: 32
|
||||||
Number of contributors: 447
|
Number of contributors: 459
|
||||||
|
|
||||||
This release includes the following changes:
|
This release includes the following changes:
|
||||||
|
|
||||||
o GNU GSS support
|
o the libcurl.pc pkgconfig file now gets installed on make install
|
||||||
o --ignore-content-length and CURLOPT_IGNORE_CONTENT_LENGTH added
|
o URL globbing now offers "range steps": [1-100:10]
|
||||||
o negotiates data connection SSL earlier when doing FTPS with PASV
|
o LDAPv3 is now the preferred LDAP protocol version
|
||||||
o CURLOPT_COOKIELIST and CURLINFO_COOKIELIST
|
o --max-redirs and CURLOPT_MAXREDIRS set to 0 limits redirects
|
||||||
o trailer support for chunked encoded data streams
|
o improved MSVC makefile
|
||||||
o -x/CURL_PROXY strings may now contain user+password
|
|
||||||
o --trace-time now outputs the full microsecond, all 6 digits
|
|
||||||
|
|
||||||
This release includes the following bugfixes:
|
This release includes the following bugfixes:
|
||||||
|
|
||||||
o MSVC build problem with the DSP file
|
o buffer overflow problem: http://curl.haxx.se/docs/adv_20051207.html
|
||||||
o windows threaded resolver access violation with multi interface
|
o using file:// on non-existing files are properly handled
|
||||||
o test suite works with valgrind 3
|
o builds fine on DJGPP
|
||||||
o CA cert verification with GnuTLS builds
|
o CURLOPT_ERRORBUFFER is now always filled in on errors
|
||||||
o handles expiry times in cookie files that go beyond 32 bits in size
|
o curl outputs error on bad --limit-rate units
|
||||||
o several client problems with files, such as doing -d @file when the file
|
o fixed libcurl's use of poll() on cygwin
|
||||||
isn't readable now gets a warning displayed
|
o the GnuTLS code didn't support client certificates
|
||||||
o write callback abort didn't always "take"
|
o TFTP over IPv6 works
|
||||||
o the curl -z "bad syntax" warning is now hidden when -s is used
|
o no reverse lookups on IP addresses when ipv6-enabled
|
||||||
o curl -d @nonexisting no longer makes a GET
|
o SSPI compatibility fix: using the proper DLLs
|
||||||
o minor debug callback data size
|
o binary LDAP properties are now shown base64 encoded
|
||||||
o date parsing of dates including daylight savings time zone names
|
o Windows uploads from stdin using curl can now contain ctrl-Z bytes
|
||||||
o using NTLM over proxy with an FTP URL
|
o -r [num] would produce an invalid HTTP Range: header
|
||||||
o curl-config --features now displays SSL when built with GnuTLS too
|
o multi interface with multi IP hosts could leak socket descriptors
|
||||||
o CURLOPT_HTTPGET, CURLOPT_POST and CURLOPT_HTTPPOST reset CURLOPT_NOBODY
|
o the GnuTLS code didn't handle rehandshakes
|
||||||
o builds fine on AmigaOS again
|
o re-use of a dead FTP connection
|
||||||
o corrected date parsing on Windows with auto-DST-adjust enabled
|
o name resolve error codes fixed for Windows builds
|
||||||
o treats CONNECT 407 responses with bodies better during Digest/NTLM auth
|
o double WWW-Authenticate Digest headers are now handled
|
||||||
o improved strerror_r() API guessing when cross-compiling
|
o curl-config --vernum fixed
|
||||||
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
|
|
||||||
|
|
||||||
Other curl-related news since the previous public release:
|
Other curl-related news since the previous public release:
|
||||||
|
|
||||||
o cURLpp 0.5.2 was released at http://rrette.com/curlpp.html
|
o FTP-SSL is now RFC4217
|
||||||
o Rexx/CURL 1.3 was released at http://rexxcurl.sf.net/
|
o CurlPas 2005-11-05 was released: http://curlpas.sf.net/
|
||||||
o http://curl.miscellaneousmirror.org is a new German curl mirror
|
o pycurl 7.15.0 was released http://pycurl.sf.net
|
||||||
o LuaCURL by Alexander Marinov at http://luacurl.luaforge.net/
|
o New web mirrors:
|
||||||
o http://curl.hostingzero.com/ is a new US curl mirror
|
http://curl.triplemind.com/ located in Mannheim, Germany
|
||||||
o ocurl 0.2.1 was released at http://sourceforge.net/projects/ocurl
|
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
|
This release would not have looked like this without help, code, reports and
|
||||||
advice from friends like these:
|
advice from friends like these:
|
||||||
|
|
||||||
John McGowan, Georg Wicherski, Andres Garcia, Eric Cooper, Todd Kulesza,
|
Dave Dribin, Bradford Bruce, Temprimus, Ofer, Dima Barsky, Amol Pattekar, Jaz
|
||||||
Tupone Alfredo, Gisle Vanem, David Shaw, Andrew Bushnell, Dan Fandrich,
|
Fresh, tommink[at]post.pl, Gisle Vanem, Nis Jorgensen, Vilmos Nebehaj, Dmitry
|
||||||
Adrian Schuur, Diego Casorran, Peteris Krumins, Jon Grubbs, Christopher
|
Bartsevich, David Lang, Eugene Kotlyarov, Jan Kunder, Yang Tse, Quagmire,
|
||||||
R. Palmer, Mario Schroeder, Richard Clayton, James Bursa, Jeff Pohlmeyer,
|
Albert Chin, David Shaw, Doug Kaufman, Bryan Henderson, Jamie Newton, Stefan
|
||||||
Norbert Novotny, Toby Peterson, Simon Josefsson, Igor Polyakov, Kevin Lussier
|
Esser
|
||||||
|
|
||||||
Thanks! (and sorry if I forgot to mention someone)
|
Thanks! (and sorry if I forgot to mention someone)
|
||||||
|
@@ -1,12 +1,7 @@
|
|||||||
Issues not sorted in any particular order.
|
To get fixed in 7.15.0 (planned release: November 2005)
|
||||||
|
|
||||||
To get fixed in 7.14.1 (planned release: August 2005)
|
|
||||||
======================
|
======================
|
||||||
|
|
||||||
To get fixed in 7.14.2 (planned release: October 2005)
|
60 - CONNECT 407 responses that kills the connection (not very likely though)
|
||||||
======================
|
|
||||||
|
|
||||||
60 - CONNECT 407 responses that kills the connection
|
|
||||||
|
|
||||||
63 -
|
63 -
|
||||||
|
|
||||||
|
@@ -141,6 +141,9 @@ AC_DEFUN([TYPE_SOCKADDR_STORAGE],
|
|||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ARPA_INET_H
|
#ifdef HAVE_ARPA_INET_H
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_WINSOCK2_H
|
||||||
|
#include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
])
|
])
|
||||||
|
|
||||||
|
16
ares/CHANGES
16
ares/CHANGES
@@ -1,5 +1,21 @@
|
|||||||
Changelog for the c-ares project
|
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)
|
Version 1.3.0 (August 29, 2004)
|
||||||
|
|
||||||
* August 21
|
* August 21
|
||||||
|
@@ -13,6 +13,7 @@ Makefile.in
|
|||||||
Makefile.dj
|
Makefile.dj
|
||||||
Makefile.m32
|
Makefile.m32
|
||||||
Makefile.netware
|
Makefile.netware
|
||||||
|
Makefile.vc6
|
||||||
install-sh
|
install-sh
|
||||||
mkinstalldirs
|
mkinstalldirs
|
||||||
configure
|
configure
|
||||||
|
@@ -4,10 +4,9 @@ lib_LTLIBRARIES = libcares.la
|
|||||||
|
|
||||||
man_MANS = $(MANPAGES)
|
man_MANS = $(MANPAGES)
|
||||||
|
|
||||||
MSVCFILES = vc/adig/adig.dep vc/adig/adig.dsp vc/adig/adig.mak \
|
MSVCFILES = vc/adig/adig.dep vc/adig/adig.dsp vc/vc.dsw vc/ahost/ahost.dep \
|
||||||
vc/adig/adig.plg vc/vc.dsw vc/ahost/ahost.dep vc/ahost/ahost.dsp \
|
vc/ahost/ahost.dsp vc/areslib/areslib.dep vc/areslib/areslib.dsp \
|
||||||
vc/ahost/ahost.mak vc/ahost/ahost.plg vc/areslib/areslib.dep \
|
vc/areslib/areslib.dsw
|
||||||
vc/areslib/areslib.dsp vc/areslib/areslib.mak vc/areslib/areslib.plg
|
|
||||||
|
|
||||||
# adig and ahost are just sample programs and thus not mentioned with the
|
# adig and ahost are just sample programs and thus not mentioned with the
|
||||||
# regular sources and headers
|
# regular sources and headers
|
||||||
|
@@ -9,7 +9,12 @@ include Makefile.inc
|
|||||||
WATT32_ROOT = $(subst \,/,$(WATT_ROOT))
|
WATT32_ROOT = $(subst \,/,$(WATT_ROOT))
|
||||||
|
|
||||||
CC = gcc
|
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
|
LDFLAGS = -s
|
||||||
EX_LIBS = $(WATT32_ROOT)/lib/libwatt.a
|
EX_LIBS = $(WATT32_ROOT)/lib/libwatt.a
|
||||||
|
|
||||||
|
@@ -7,29 +7,21 @@
|
|||||||
## Quick hack by Guenter; comments to: /dev/nul
|
## Quick hack by Guenter; comments to: /dev/nul
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
AR = ar
|
|
||||||
RANLIB = ranlib
|
RANLIB = ranlib
|
||||||
STRIP = strip -g
|
|
||||||
#RM = rm -f
|
|
||||||
|
|
||||||
########################################################
|
########################################################
|
||||||
## Nothing more to do below this line!
|
## Nothing more to do below this line!
|
||||||
|
|
||||||
LIB=libcares.a
|
LIB=libcares.a
|
||||||
CC=gcc
|
CC=gcc
|
||||||
#CPPFLAGS=@CPPFLAGS@
|
CFLAGS=-O2 -Wall
|
||||||
WARN_FLAGS=-Wall
|
|
||||||
CFLAGS=-O2
|
|
||||||
CFLAGS+=${WARN_CFLAGS} ${ERROR_CFLAGS}
|
|
||||||
DEFS=-DMINGW32
|
|
||||||
LDFLAGS=-s
|
LDFLAGS=-s
|
||||||
LIBS=-lwsock32
|
LIBS=-lwsock32
|
||||||
ALL_CFLAGS=${CPPFLAGS} ${CFLAGS} ${DEFS}
|
|
||||||
|
|
||||||
MANPAGES := $(patsubst %.c,%.o,$(wildcard ares_*.3))
|
MANPAGES := $(patsubst %.c,%.o,$(wildcard ares_*.3))
|
||||||
|
|
||||||
OBJS := $(patsubst %.c,%.o,$(wildcard ares_*.c))
|
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}
|
$(LIB): ${OBJS}
|
||||||
ar cru $@ ${OBJS}
|
ar cru $@ ${OBJS}
|
||||||
@@ -51,7 +43,7 @@ ahost.exe: ahost.o $(LIB)
|
|||||||
${OBJS}: ares.h ares_dns.h ares_private.h
|
${OBJS}: ares.h ares_dns.h ares_private.h
|
||||||
|
|
||||||
.c.o:
|
.c.o:
|
||||||
${CC} -c ${ALL_CFLAGS} $<
|
${CC} -c ${CFLAGS} $<
|
||||||
|
|
||||||
check:
|
check:
|
||||||
|
|
||||||
@@ -73,3 +65,4 @@ clean:
|
|||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
rm -f config.cache config.log config.status Makefile
|
rm -f config.cache config.log config.status Makefile
|
||||||
|
|
||||||
|
188
ares/Makefile.vc6
Normal file
188
ares/Makefile.vc6
Normal 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
|
@@ -242,26 +242,6 @@ AC_DEFUN([CARES_CHECK_STRUCT], [
|
|||||||
fi
|
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 This macro determines if the specified constant exists in the specified file
|
||||||
dnl Syntax:
|
dnl Syntax:
|
||||||
dnl CARES_CHECK_CONSTANT(headers, constant name, if found, [if not found])
|
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
|
||||||
|
])
|
||||||
|
|
||||||
|
41
ares/adig.c
41
ares/adig.c
@@ -27,14 +27,23 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_GETOPT_H
|
||||||
|
#include <getopt.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "ares_dns.h"
|
#include "ares_dns.h"
|
||||||
|
#include "inet_ntop.h"
|
||||||
|
|
||||||
|
#ifdef WATT32
|
||||||
|
#undef WIN32 /* Redefined in MingW headers */
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef INADDR_NONE
|
#ifndef INADDR_NONE
|
||||||
#define INADDR_NONE 0xffffffff
|
#define INADDR_NONE 0xffffffff
|
||||||
@@ -45,8 +54,10 @@
|
|||||||
#define T_SRV 33 /* server selection */
|
#define T_SRV 33 /* server selection */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef optind
|
||||||
extern int optind;
|
extern int optind;
|
||||||
extern char *optarg;
|
extern char *optarg;
|
||||||
|
#endif
|
||||||
|
|
||||||
struct nv {
|
struct nv {
|
||||||
const char *name;
|
const char *name;
|
||||||
@@ -412,7 +423,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
|||||||
char *name;
|
char *name;
|
||||||
int type, dnsclass, ttl, dlen, status;
|
int type, dnsclass, ttl, dlen, status;
|
||||||
long len;
|
long len;
|
||||||
struct in_addr addr;
|
char addr[46];
|
||||||
|
|
||||||
/* Parse the RR name. */
|
/* Parse the RR name. */
|
||||||
status = ares_expand_name(aptr, abuf, alen, &name, &len);
|
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;
|
len = *p;
|
||||||
if (p + len + 1 > aptr + dlen)
|
if (p + len + 1 > aptr + dlen)
|
||||||
return NULL;
|
return NULL;
|
||||||
printf("\t%.*s", len, p + 1);
|
printf("\t%.*s", (int)len, p + 1);
|
||||||
p += len + 1;
|
p += len + 1;
|
||||||
len = *p;
|
len = *p;
|
||||||
if (p + len + 1 > aptr + dlen)
|
if (p + len + 1 > aptr + dlen)
|
||||||
return NULL;
|
return NULL;
|
||||||
printf("\t%.*s", len, p + 1);
|
printf("\t%.*s", (int)len, p + 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_MINFO:
|
case T_MINFO:
|
||||||
@@ -504,7 +515,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
|||||||
*/
|
*/
|
||||||
if (dlen < 2)
|
if (dlen < 2)
|
||||||
return NULL;
|
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);
|
status = ares_expand_name(aptr + 2, abuf, alen, &name, &len);
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -531,12 +542,9 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
|||||||
p += len;
|
p += len;
|
||||||
if (p + 20 > aptr + dlen)
|
if (p + 20 > aptr + dlen)
|
||||||
return NULL;
|
return NULL;
|
||||||
printf("\t\t\t\t\t\t( %d %d %d %d %d )",
|
printf("\t\t\t\t\t\t( %lu %lu %lu %lu %lu )",
|
||||||
(p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3],
|
DNS__32BIT(p), DNS__32BIT(p+4), DNS__32BIT(p+8),
|
||||||
(p[4] << 24) | (p[5] << 16) | (p[6] << 8) | p[7],
|
DNS__32BIT(p+12), DNS__32BIT(p+16));
|
||||||
(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]);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_TXT:
|
case T_TXT:
|
||||||
@@ -548,7 +556,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
|||||||
len = *p;
|
len = *p;
|
||||||
if (p + len + 1 > aptr + dlen)
|
if (p + len + 1 > aptr + dlen)
|
||||||
return NULL;
|
return NULL;
|
||||||
printf("\t%.*s", len, p + 1);
|
printf("\t%.*s", (int)len, p + 1);
|
||||||
p += len + 1;
|
p += len + 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -557,8 +565,14 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
|||||||
/* The RR data is a four-byte Internet address. */
|
/* The RR data is a four-byte Internet address. */
|
||||||
if (dlen != 4)
|
if (dlen != 4)
|
||||||
return NULL;
|
return NULL;
|
||||||
memcpy(&addr, aptr, sizeof(struct in_addr));
|
printf("\t%s", ares_inet_ntop(AF_INET,aptr,addr,sizeof(addr)));
|
||||||
printf("\t%s", inet_ntoa(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;
|
break;
|
||||||
|
|
||||||
case T_WKS:
|
case T_WKS:
|
||||||
@@ -583,6 +597,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
printf("\t[Unknown RR; cannot parse]");
|
printf("\t[Unknown RR; cannot parse]");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
|
48
ares/ahost.c
48
ares/ahost.c
@@ -29,13 +29,23 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "ares_dns.h"
|
#include "ares_dns.h"
|
||||||
|
#include "inet_ntop.h"
|
||||||
|
#include "inet_net_pton.h"
|
||||||
|
|
||||||
#ifndef INADDR_NONE
|
#ifndef INADDR_NONE
|
||||||
#define INADDR_NONE 0xffffffff
|
#define INADDR_NONE 0xffffffff
|
||||||
#endif
|
#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 callback(void *arg, int status, struct hostent *host);
|
||||||
static void usage(void);
|
static void usage(void);
|
||||||
|
|
||||||
@@ -45,7 +55,8 @@ int main(int argc, char **argv)
|
|||||||
int status, nfds;
|
int status, nfds;
|
||||||
fd_set read_fds, write_fds;
|
fd_set read_fds, write_fds;
|
||||||
struct timeval *tvp, tv;
|
struct timeval *tvp, tv;
|
||||||
struct in_addr addr;
|
struct in_addr addr4;
|
||||||
|
struct in6_addr addr6;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
WORD wVersionRequested = MAKEWORD(1,1);
|
WORD wVersionRequested = MAKEWORD(1,1);
|
||||||
@@ -66,13 +77,20 @@ int main(int argc, char **argv)
|
|||||||
/* Initiate the queries, one per command-line argument. */
|
/* Initiate the queries, one per command-line argument. */
|
||||||
for (argv++; *argv; argv++)
|
for (argv++; *argv; argv++)
|
||||||
{
|
{
|
||||||
addr.s_addr = inet_addr(*argv);
|
if (ares_inet_pton(AF_INET, *argv, &addr4) == 1)
|
||||||
if (addr.s_addr == INADDR_NONE)
|
{
|
||||||
ares_gethostbyname(channel, *argv, AF_INET, callback, *argv);
|
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
|
else
|
||||||
{
|
{
|
||||||
ares_gethostbyaddr(channel, &addr, sizeof(addr), AF_INET, callback,
|
/* assume user wants A-records */
|
||||||
*argv);
|
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)
|
static void callback(void *arg, int status, struct hostent *host)
|
||||||
{
|
{
|
||||||
struct in_addr addr;
|
|
||||||
char **p;
|
char **p;
|
||||||
|
|
||||||
if (status != ARES_SUCCESS)
|
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++)
|
for (p = host->h_addr_list; *p; p++)
|
||||||
{
|
{
|
||||||
memcpy(&addr, *p, sizeof(struct in_addr));
|
char addr_buf[46] = "??";
|
||||||
printf("%-32s\t%s\n", host->h_name, inet_ntoa(addr));
|
|
||||||
|
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("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
28
ares/ares.h
28
ares/ares.h
@@ -32,7 +32,7 @@
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <tcp.h>
|
#include <tcp.h>
|
||||||
#elif defined(WIN32)
|
#elif defined(WIN32)
|
||||||
#include <winsock.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#else
|
#else
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
@@ -69,6 +69,10 @@ extern "C" {
|
|||||||
/* ares_getnameinfo error codes */
|
/* ares_getnameinfo error codes */
|
||||||
#define ARES_EBADFLAGS 18
|
#define ARES_EBADFLAGS 18
|
||||||
|
|
||||||
|
/* ares_getaddrinfo error codes */
|
||||||
|
#define ARES_ENONAME 19
|
||||||
|
#define ARES_EBADHINTS 20
|
||||||
|
|
||||||
/* Flag values */
|
/* Flag values */
|
||||||
#define ARES_FLAG_USEVC (1 << 0)
|
#define ARES_FLAG_USEVC (1 << 0)
|
||||||
#define ARES_FLAG_PRIMARY (1 << 1)
|
#define ARES_FLAG_PRIMARY (1 << 1)
|
||||||
@@ -105,8 +109,26 @@ extern "C" {
|
|||||||
#define ARES_NI_LOOKUPSERVICE (1 << 9)
|
#define ARES_NI_LOOKUPSERVICE (1 << 9)
|
||||||
/* Reserved for future use */
|
/* Reserved for future use */
|
||||||
#define ARES_NI_IDN (1 << 10)
|
#define ARES_NI_IDN (1 << 10)
|
||||||
#define ARES_NI_ALLOW_UNASSIGNED (1 << 11)
|
#define ARES_NI_IDN_ALLOW_UNASSIGNED (1 << 11)
|
||||||
#define ARES_NI_USE_STD3_ASCII_RULES (1 << 12)
|
#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 {
|
struct ares_options {
|
||||||
int flags;
|
int flags;
|
||||||
|
@@ -18,6 +18,18 @@
|
|||||||
#ifndef ARES__DNS_H
|
#ifndef ARES__DNS_H
|
||||||
#define ARES__DNS_H
|
#define ARES__DNS_H
|
||||||
|
|
||||||
|
#ifdef ARES_BIG_ENDIAN
|
||||||
|
/* big-endian aware versions */
|
||||||
|
#define DNS__16BIT(p) (((p)[1] << 8) | (p)[0])
|
||||||
|
#define DNS__32BIT(p) (((p)[3] << 24) | ((p)[2] << 16) | \
|
||||||
|
((p)[1] << 8) | (p)[0])
|
||||||
|
#define DNS__SET16BIT(p, v) (((p)[1] = ((v) >> 8) & 0xff), \
|
||||||
|
((p)[0] = (v) & 0xff))
|
||||||
|
#define DNS__SET32BIT(p, v) (((p)[3] = ((v) >> 24) & 0xff), \
|
||||||
|
((p)[2] = ((v) >> 16) & 0xff), \
|
||||||
|
((p)[1] = ((v) >> 8) & 0xff), \
|
||||||
|
((p)[0] = (v) & 0xff))
|
||||||
|
#else
|
||||||
#define DNS__16BIT(p) (((p)[0] << 8) | (p)[1])
|
#define DNS__16BIT(p) (((p)[0] << 8) | (p)[1])
|
||||||
#define DNS__32BIT(p) (((p)[0] << 24) | ((p)[1] << 16) | \
|
#define DNS__32BIT(p) (((p)[0] << 24) | ((p)[1] << 16) | \
|
||||||
((p)[2] << 8) | (p)[3])
|
((p)[2] << 8) | (p)[3])
|
||||||
@@ -27,6 +39,16 @@
|
|||||||
((p)[1] = ((v) >> 16) & 0xff), \
|
((p)[1] = ((v) >> 16) & 0xff), \
|
||||||
((p)[2] = ((v) >> 8) & 0xff), \
|
((p)[2] = ((v) >> 8) & 0xff), \
|
||||||
((p)[3] = (v) & 0xff))
|
((p)[3] = (v) & 0xff))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* 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 */
|
/* Macros for parsing a DNS header */
|
||||||
#define DNS_HEADER_QID(h) DNS__16BIT(h)
|
#define DNS_HEADER_QID(h) DNS__16BIT(h)
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
|
||||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this
|
* Permission to use, copy, modify, and distribute this
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
|
||||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this
|
* Permission to use, copy, modify, and distribute this
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
|
||||||
/* Copyright 2005 by Dominick Meglio
|
/* Copyright 2005 by Dominick Meglio
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this
|
* 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 void nameinfo_callback(void *arg, int status, struct hostent *host);
|
||||||
static char *lookup_service(unsigned short port, int flags, char *buf);
|
static char *lookup_service(unsigned short port, int flags, char *buf);
|
||||||
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
|
#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
|
#endif
|
||||||
static char *ares_striendstr(const char *s1, const char *s2);
|
static char *ares_striendstr(const char *s1, const char *s2);
|
||||||
|
|
||||||
void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t salen,
|
void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t salen,
|
||||||
int flags, ares_nameinfo_callback callback, void *arg)
|
int flags, ares_nameinfo_callback callback, void *arg)
|
||||||
{
|
{
|
||||||
struct sockaddr_in *addr;
|
struct sockaddr_in *addr = NULL;
|
||||||
struct sockaddr_in6 *addr6;
|
struct sockaddr_in6 *addr6 = NULL;
|
||||||
struct nameinfo_query *niquery;
|
struct nameinfo_query *niquery;
|
||||||
|
|
||||||
/* Verify the buffer size */
|
/* Verify the buffer size */
|
||||||
@@ -137,7 +140,7 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t
|
|||||||
port = addr6->sin6_port;
|
port = addr6->sin6_port;
|
||||||
/* If the system supports scope IDs, use it */
|
/* If the system supports scope IDs, use it */
|
||||||
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
|
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
|
||||||
append_scopeid(addr6, flags, ipbuf);
|
append_scopeid(addr6, flags, ipbuf, sizeof(ipbuf));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -194,9 +197,11 @@ static void nameinfo_callback(void *arg, int status, struct hostent *host)
|
|||||||
if (niquery->flags & ARES_NI_LOOKUPSERVICE)
|
if (niquery->flags & ARES_NI_LOOKUPSERVICE)
|
||||||
{
|
{
|
||||||
if (niquery->family == AF_INET)
|
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
|
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.
|
/* NOFQDN means we have to strip off the domain name portion.
|
||||||
We do this by determining our own domain name, then searching the string
|
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);
|
ares_inet_ntop(AF_INET6, &niquery->addr.addr6.sin6_addr, ipbuf, IPBUFSIZ);
|
||||||
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
|
#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
|
#endif
|
||||||
}
|
}
|
||||||
/* They want a service too */
|
/* They want a service too */
|
||||||
if (niquery->flags & ARES_NI_LOOKUPSERVICE)
|
if (niquery->flags & ARES_NI_LOOKUPSERVICE)
|
||||||
{
|
{
|
||||||
if (niquery->family == AF_INET)
|
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
|
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);
|
niquery->callback(niquery->arg, ARES_SUCCESS, ipbuf, service);
|
||||||
return;
|
return;
|
||||||
@@ -245,7 +252,8 @@ static void nameinfo_callback(void *arg, int status, struct hostent *host)
|
|||||||
free(niquery);
|
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)
|
if (port)
|
||||||
{
|
{
|
||||||
@@ -256,7 +264,19 @@ static char *lookup_service(unsigned short port, int flags, char *buf)
|
|||||||
{
|
{
|
||||||
struct servent *se;
|
struct servent *se;
|
||||||
const char *proto;
|
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)
|
if (flags & ARES_NI_UDP)
|
||||||
proto = "udp";
|
proto = "udp";
|
||||||
else if (flags & ARES_NI_SCTP)
|
else if (flags & ARES_NI_SCTP)
|
||||||
@@ -265,9 +285,34 @@ static char *lookup_service(unsigned short port, int flags, char *buf)
|
|||||||
proto = "dccp";
|
proto = "dccp";
|
||||||
else
|
else
|
||||||
proto = "tcp";
|
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);
|
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);
|
strcpy(buf, se->s_name);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
/* too big name to fit the buffer */
|
||||||
|
buf[0]=0;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
sprintf(buf, "%u", ntohs(port));
|
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
|
#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] = '%';
|
tmpbuf[0] = '%';
|
||||||
|
|
||||||
#ifdef HAVE_IF_INDEXTONAME
|
#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)))
|
&& !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
|
else
|
||||||
{
|
{
|
||||||
if (if_indextoname(addr6->sin6_scope_id, &tmpbuf[1]) == NULL)
|
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
|
#else
|
||||||
sprintf(&tmpbuf[1], "%u", addr6->sin6_scope_id);
|
sprintf(&tmpbuf[1], fmt, addr6->sin6_scope_id);
|
||||||
|
(void) flags;
|
||||||
#endif
|
#endif
|
||||||
strcat(buf, tmpbuf);
|
tmpbuf[IF_NAMESIZE + 1] = '\0';
|
||||||
return buf;
|
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
|
#endif
|
||||||
|
|
||||||
|
@@ -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. */
|
/* Can't allocate iovecs; just send the first request. */
|
||||||
sendreq = server->qhead;
|
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)
|
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).
|
* what's left to read of it).
|
||||||
*/
|
*/
|
||||||
count = recv(server->tcp_socket,
|
count = recv(server->tcp_socket,
|
||||||
server->tcp_lenbuf + server->tcp_buffer_pos,
|
(void *)(server->tcp_lenbuf + server->tcp_lenbuf_pos),
|
||||||
2 - server->tcp_buffer_pos, 0);
|
2 - server->tcp_lenbuf_pos, 0);
|
||||||
if (count <= 0)
|
if (count <= 0)
|
||||||
{
|
{
|
||||||
handle_error(channel, i, now);
|
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. */
|
/* Read data into the allocated buffer. */
|
||||||
count = recv(server->tcp_socket,
|
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);
|
server->tcp_length - server->tcp_buffer_pos, 0);
|
||||||
if (count <= 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))
|
!FD_ISSET(server->udp_socket, read_fds))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
count = recv(server->udp_socket, buf, sizeof(buf), 0);
|
count = recv(server->udp_socket, (void *)buf, sizeof(buf), 0);
|
||||||
if (count <= 0)
|
if (count <= 0)
|
||||||
handle_error(channel, i, now);
|
handle_error(channel, i, now);
|
||||||
|
|
||||||
@@ -465,7 +466,8 @@ void ares__send_query(ares_channel channel, struct query *query, time_t now)
|
|||||||
return;
|
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;
|
query->skip_server[query->server] = 1;
|
||||||
next_server(channel, query, now);
|
next_server(channel, query, now);
|
||||||
|
35
ares/config-win32.h
Normal file
35
ares/config-win32.h
Normal 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 */
|
@@ -66,7 +66,9 @@ AC_CHECK_HEADERS(
|
|||||||
sys/select.h \
|
sys/select.h \
|
||||||
sys/socket.h \
|
sys/socket.h \
|
||||||
sys/ioctl.h \
|
sys/ioctl.h \
|
||||||
winsock.h \
|
netdb.h \
|
||||||
|
winsock2.h \
|
||||||
|
ws2tcpip.h \
|
||||||
netinet/in.h \
|
netinet/in.h \
|
||||||
net/if.h \
|
net/if.h \
|
||||||
arpa/nameser.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
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_WINSOCK_H
|
#ifdef HAVE_WINSOCK2_H
|
||||||
#include <winsock.h>
|
#include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@@ -102,8 +104,8 @@ AC_CHECK_TYPE(socklen_t, ,
|
|||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_WINSOCK_H
|
#ifdef HAVE_WINSOCK2_H
|
||||||
#include <winsock.h>
|
#include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -116,8 +118,8 @@ CARES_CHECK_CONSTANT(
|
|||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_WINSOCK_H
|
#ifdef HAVE_WINSOCK2_H
|
||||||
#include <winsock.h>
|
#include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
], [PF_INET6],
|
], [PF_INET6],
|
||||||
@@ -133,8 +135,8 @@ CARES_CHECK_CONSTANT(
|
|||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_WINSOCK_H
|
#ifdef HAVE_WINSOCK2_H
|
||||||
#include <winsock.h>
|
#include <winsock2.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
], [AF_INET6],
|
], [AF_INET6],
|
||||||
@@ -148,8 +150,11 @@ CARES_CHECK_STRUCT(
|
|||||||
#ifdef HAVE_SYS_TYPES_H
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_WINSOCK_H
|
#ifdef HAVE_WINSOCK2_H
|
||||||
#include <winsock.h>
|
#include <winsock2.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_WS2TCPIP_H
|
||||||
|
#include <ws2tcpip.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NETINET_IN_H
|
#ifdef HAVE_NETINET_IN_H
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
@@ -164,8 +169,11 @@ CARES_CHECK_STRUCT(
|
|||||||
#ifdef HAVE_SYS_TYPES_H
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_WINSOCK_H
|
#ifdef HAVE_WINSOCK2_H
|
||||||
#include <winsock.h>
|
#include <winsock2.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_WS2TCPIP_H
|
||||||
|
#include <ws2tcpip.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NETINET_IN_H
|
#ifdef HAVE_NETINET_IN_H
|
||||||
#include <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
|
[Define to 1 if you have struct sockaddr_in6.]) ac_have_sockaddr_in6=yes
|
||||||
)
|
)
|
||||||
|
|
||||||
if test "$ac_have_sockaddr_in6" = "yes" ; then
|
AC_CHECK_MEMBER(struct sockaddr_in6.sin6_scope_id,
|
||||||
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_DEFINE_UNQUOTED(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID,1,
|
AC_DEFINE_UNQUOTED(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID,1,
|
||||||
[Define to 1 if your struct sockaddr_in6 has sin6_scope_id.])
|
[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
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_WINSOCK_H
|
#ifdef HAVE_WINSOCK2_H
|
||||||
#include <winsock.h>
|
#include <winsock2.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_WS2TCPIP_H
|
||||||
|
#include <ws2tcpip.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NETINET_IN_H
|
#ifdef HAVE_NETINET_IN_H
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#endif
|
#endif
|
||||||
], [addrinfo],
|
])
|
||||||
|
|
||||||
|
dnl check for the addrinfo structure
|
||||||
|
AC_CHECK_MEMBER(struct addrinfo.ai_flags,
|
||||||
AC_DEFINE_UNQUOTED(HAVE_STRUCT_ADDRINFO,1,
|
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
|
dnl check for inet_pton
|
||||||
@@ -346,6 +364,15 @@ AC_CHECK_SIZEOF(struct in_addr, ,
|
|||||||
|
|
||||||
AC_CHECK_FUNCS([bitncmp if_indextoname])
|
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
|
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)
|
AC_OUTPUT(Makefile)
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
|
||||||
/* Copyright (c) 1996 by Internet Software Consortium.
|
/* Copyright (c) 1996 by Internet Software Consortium.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this software for any
|
* 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 *
|
const char *
|
||||||
ares_inet_ntop(int af, const void *src, char *dst, size_t size)
|
ares_inet_ntop(int af, const void *src, char *dst, size_t size)
|
||||||
{
|
{
|
||||||
|
switch (af)
|
||||||
switch (af) {
|
{
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
return (inet_ntop4(src, dst, size));
|
return (inet_ntop4(src, dst, size));
|
||||||
case AF_INET6:
|
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";
|
static const char fmt[] = "%u.%u.%u.%u";
|
||||||
char tmp[sizeof "255.255.255.255"];
|
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;
|
errno = ENOSPC;
|
||||||
return (NULL);
|
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.
|
* to use pointer overlays. All the world's not a VAX.
|
||||||
*/
|
*/
|
||||||
char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
|
char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
|
||||||
struct { int base, len; } best, cur;
|
struct { int base, len; } best = { 0,0 }, cur = { 0,0 };
|
||||||
unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ];
|
unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ];
|
||||||
int i;
|
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));
|
words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
|
||||||
best.base = -1;
|
best.base = -1;
|
||||||
cur.base = -1;
|
cur.base = -1;
|
||||||
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
|
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++)
|
||||||
if (words[i] == 0) {
|
{
|
||||||
|
if (words[i] == 0)
|
||||||
|
{
|
||||||
if (cur.base == -1)
|
if (cur.base == -1)
|
||||||
cur.base = i, cur.len = 1;
|
cur.base = i, cur.len = 1;
|
||||||
else
|
else
|
||||||
cur.len++;
|
cur.len++;
|
||||||
} else {
|
}
|
||||||
if (cur.base != -1) {
|
else
|
||||||
|
{
|
||||||
|
if (cur.base != -1)
|
||||||
|
{
|
||||||
if (best.base == -1 || cur.len > best.len)
|
if (best.base == -1 || cur.len > best.len)
|
||||||
best = cur;
|
best = cur;
|
||||||
cur.base = -1;
|
cur.base = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cur.base != -1) {
|
if (cur.base != -1)
|
||||||
|
{
|
||||||
if (best.base == -1 || cur.len > best.len)
|
if (best.base == -1 || cur.len > best.len)
|
||||||
best = cur;
|
best = cur;
|
||||||
}
|
}
|
||||||
@@ -166,10 +175,12 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
|
|||||||
* Format the result.
|
* Format the result.
|
||||||
*/
|
*/
|
||||||
tp = tmp;
|
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? */
|
/* Are we inside the best run of 0x00's? */
|
||||||
if (best.base != -1 && i >= best.base &&
|
if (best.base != -1 && i >= best.base &&
|
||||||
i < (best.base + best.len)) {
|
i < (best.base + best.len))
|
||||||
|
{
|
||||||
if (i == best.base)
|
if (i == best.base)
|
||||||
*tp++ = ':';
|
*tp++ = ':';
|
||||||
continue;
|
continue;
|
||||||
@@ -179,7 +190,8 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
|
|||||||
*tp++ = ':';
|
*tp++ = ':';
|
||||||
/* Is this address an encapsulated IPv4? */
|
/* Is this address an encapsulated IPv4? */
|
||||||
if (i == 6 && best.base == 0 &&
|
if (i == 6 && best.base == 0 &&
|
||||||
(best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
|
(best.len == 6 || (best.len == 5 && words[5] == 0xffff)))
|
||||||
|
{
|
||||||
if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
|
if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
|
||||||
return (NULL);
|
return (NULL);
|
||||||
tp += strlen(tp);
|
tp += strlen(tp);
|
||||||
@@ -187,6 +199,7 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
|
|||||||
}
|
}
|
||||||
tp += SPRINTF((tp, "%x", words[i]));
|
tp += SPRINTF((tp, "%x", words[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Was it a trailing run of 0x00's? */
|
/* Was it a trailing run of 0x00's? */
|
||||||
if (best.base != -1 && (best.base + best.len) == (NS_IN6ADDRSZ / NS_INT16SZ))
|
if (best.base != -1 && (best.base + best.len) == (NS_IN6ADDRSZ / NS_INT16SZ))
|
||||||
*tp++ = ':';
|
*tp++ = ':';
|
||||||
@@ -195,12 +208,13 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
|
|||||||
/*
|
/*
|
||||||
* Check for overflow, copy, and we're done.
|
* Check for overflow, copy, and we're done.
|
||||||
*/
|
*/
|
||||||
if ((size_t)(tp - tmp) > size) {
|
if ((size_t)(tp - tmp) > size)
|
||||||
|
{
|
||||||
errno = ENOSPC;
|
errno = ENOSPC;
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
strcpy(dst, tmp);
|
strcpy(dst, tmp);
|
||||||
return (dst);
|
return (dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
|
||||||
#ifndef ARES_NAMESER_H
|
#ifndef ARES_NAMESER_H
|
||||||
#define ARES_NAMESER_H
|
#define ARES_NAMESER_H
|
||||||
|
|
||||||
|
14
ares/setup.h
14
ares/setup.h
@@ -17,10 +17,19 @@
|
|||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#include "config-win32.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* simple work-around for now, for systems without configure support */
|
/* simple work-around for now, for systems without configure support */
|
||||||
|
#ifndef __DJGPP__
|
||||||
#define ssize_t int
|
#define ssize_t int
|
||||||
|
#endif
|
||||||
|
#ifndef _MSC_VER
|
||||||
#define socklen_t int
|
#define socklen_t int
|
||||||
#endif
|
#endif
|
||||||
|
#endif /* HAVE_CONFIG_H */
|
||||||
|
|
||||||
/* Recent autoconf versions define these symbols in config.h. We don't want
|
/* Recent autoconf versions define these symbols in config.h. We don't want
|
||||||
them (since they collide with the libcurl ones when we build
|
them (since they collide with the libcurl ones when we build
|
||||||
@@ -35,7 +44,8 @@
|
|||||||
|
|
||||||
/* now typedef our socket type */
|
/* now typedef our socket type */
|
||||||
#if defined(WIN32) && !defined(WATT32)
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include <winsock.h>
|
#include <winsock2.h>
|
||||||
|
#include <ws2tcpip.h>
|
||||||
typedef SOCKET ares_socket_t;
|
typedef SOCKET ares_socket_t;
|
||||||
#define ARES_SOCKET_BAD INVALID_SOCKET
|
#define ARES_SOCKET_BAD INVALID_SOCKET
|
||||||
#else
|
#else
|
||||||
@@ -58,7 +68,7 @@ typedef int ares_socket_t;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined(WIN32) || defined(WATT32)) && \
|
#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 */
|
/* protos for the functions we provide in windows_port.c */
|
||||||
int ares_strncasecmp(const char *s1, const char *s2, int n);
|
int ares_strncasecmp(const char *s1, const char *s2, int n);
|
||||||
int ares_strcasecmp(const char *s1, const char *s2);
|
int ares_strcasecmp(const char *s1, const char *s2);
|
||||||
|
@@ -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
|
|
||||||
|
|
@@ -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>
|
|
@@ -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
|
|
||||||
|
|
@@ -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>
|
|
@@ -97,6 +97,10 @@ SOURCE=..\..\ares__read_line.c
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\ares_cancel.c
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\ares_destroy.c
|
SOURCE=..\..\ares_destroy.c
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -137,6 +141,10 @@ SOURCE=..\..\ares_parse_a_reply.c
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\ares_parse_aaaa_reply.c
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\ares_parse_ptr_reply.c
|
SOURCE=..\..\ares_parse_ptr_reply.c
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -153,14 +161,6 @@ SOURCE=..\..\ares_search.c
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin 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
|
SOURCE=..\..\ares_send.c
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -173,6 +173,22 @@ SOURCE=..\..\ares_timeout.c
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin 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
|
SOURCE=..\..\windows_port.c
|
||||||
# End Source File
|
# End Source File
|
||||||
# End Group
|
# End Group
|
||||||
@@ -189,7 +205,7 @@ SOURCE=..\..\ares_dns.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\ares_version.h
|
SOURCE=..\..\ares_ipv6.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
@@ -197,6 +213,22 @@ SOURCE=..\..\ares_private.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin 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
|
SOURCE=..\..\nameser.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# End Group
|
# End Group
|
||||||
|
29
ares/vc/areslib/areslib.dsw
Normal file
29
ares/vc/areslib/areslib.dsw
Normal 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>
|
||||||
|
{{{
|
||||||
|
}}}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
@@ -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
|
|
||||||
|
|
@@ -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>
|
|
@@ -209,7 +209,7 @@ ${LIBTOOLIZE:-libtoolize} --copy --automake --force || die "The libtool command
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "buildconf: running automake"
|
echo "buildconf: running automake"
|
||||||
${AUTOMAKE:-automake} -a || die "The automake command failed"
|
${AUTOMAKE:-automake} -a -c || die "The automake command failed"
|
||||||
|
|
||||||
echo "buildconf: OK"
|
echo "buildconf: OK"
|
||||||
exit 0
|
exit 0
|
||||||
|
50
configure.ac
50
configure.ac
@@ -122,13 +122,13 @@ case $host in
|
|||||||
*-*-mingw*)
|
*-*-mingw*)
|
||||||
AC_DEFINE(BUILDING_LIBCURL, 1, [when building libcurl itself])
|
AC_DEFINE(BUILDING_LIBCURL, 1, [when building libcurl itself])
|
||||||
AC_MSG_RESULT(yes)
|
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"
|
if test "X$enable_shared" = "Xno"
|
||||||
then
|
then
|
||||||
AC_DEFINE(CURL_STATICLIB, 1, [when not building a shared library])
|
AC_DEFINE(CURL_STATICLIB, 1, [when not building a shared library])
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
<EFBFBD> <20>else
|
else
|
||||||
<EFBFBD> <20> <20>AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@@ -251,6 +251,21 @@ AC_HELP_STRING([--disable-telnet],[Disable TELNET support]),
|
|||||||
esac ],
|
esac ],
|
||||||
AC_MSG_RESULT(yes)
|
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 **********************************************************************
|
||||||
dnl Check for built-in manual
|
dnl Check for built-in manual
|
||||||
@@ -1419,6 +1434,8 @@ AC_CHECK_HEADERS(
|
|||||||
libgen.h \
|
libgen.h \
|
||||||
locale.h \
|
locale.h \
|
||||||
errno.h \
|
errno.h \
|
||||||
|
arpa/tftp.h \
|
||||||
|
sys/filio.h \
|
||||||
setjmp.h,
|
setjmp.h,
|
||||||
dnl to do if not found
|
dnl to do if not found
|
||||||
[],
|
[],
|
||||||
@@ -1487,6 +1504,13 @@ dnl Checks for library functions.
|
|||||||
dnl AC_PROG_GCC_TRADITIONAL
|
dnl AC_PROG_GCC_TRADITIONAL
|
||||||
AC_TYPE_SIGNAL
|
AC_TYPE_SIGNAL
|
||||||
dnl AC_FUNC_VPRINTF
|
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 \
|
AC_CHECK_FUNCS( strtoll \
|
||||||
socket \
|
socket \
|
||||||
select \
|
select \
|
||||||
@@ -1525,6 +1549,8 @@ dnl if found
|
|||||||
[],
|
[],
|
||||||
dnl if not found, $ac_func is the name we check for
|
dnl if not found, $ac_func is the name we check for
|
||||||
func="$ac_func"
|
func="$ac_func"
|
||||||
|
eval skipcheck=\$skipcheck_$func
|
||||||
|
if test "x$skipcheck" != "xyes"; then
|
||||||
AC_MSG_CHECKING([deeper for $func])
|
AC_MSG_CHECKING([deeper for $func])
|
||||||
AC_TRY_LINK( [],
|
AC_TRY_LINK( [],
|
||||||
[ $func ();],
|
[ $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_DEFINE_UNQUOTED($def, 1, [If you have $func]),
|
||||||
AC_MSG_RESULT(but still no)
|
AC_MSG_RESULT(but still no)
|
||||||
)
|
)
|
||||||
|
fi
|
||||||
)
|
)
|
||||||
|
|
||||||
dnl For some reason, the check above doesn't properly detect select() with
|
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
|
#ifdef HAVE_LIBGEN_H
|
||||||
#include <libgen.h>
|
#include <libgen.h>
|
||||||
#endif
|
#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)])
|
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)
|
*) AC_MSG_RESULT(yes)
|
||||||
|
|
||||||
if test "x$IPV6_ENABLED" = "x1"; then
|
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
|
fi
|
||||||
|
|
||||||
AC_DEFINE(USE_ARES, 1, [Define if you want to enable ares support])
|
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_MSG_RESULT(yes)
|
||||||
AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
|
AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
|
||||||
AC_SUBST(USE_WINDOWS_SSPI)
|
AC_SUBST(USE_WINDOWS_SSPI)
|
||||||
LIBS="$LIBS -lsecur32"
|
|
||||||
curl_sspi_msg="yes"
|
curl_sspi_msg="yes"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@@ -116,6 +116,9 @@ while test $# -gt 0; do
|
|||||||
if test "@CURL_DISABLE_DICT@" != "1"; then
|
if test "@CURL_DISABLE_DICT@" != "1"; then
|
||||||
echo "DICT"
|
echo "DICT"
|
||||||
fi
|
fi
|
||||||
|
if test "@CURL_DISABLE_TFTP@" != "1"; then
|
||||||
|
echo "TFTP"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
--version)
|
--version)
|
||||||
echo libcurl @VERSION@
|
echo libcurl @VERSION@
|
||||||
|
@@ -150,6 +150,11 @@ Scheme
|
|||||||
Bigloo binding written by Kirill Lisovsky
|
Bigloo binding written by Kirill Lisovsky
|
||||||
http://curl.haxx.se/libcurl/scheme/
|
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
|
Tcl
|
||||||
|
|
||||||
Tclcurl is written by Andr<64>s Garc<72>a
|
Tclcurl is written by Andr<64>s Garc<72>a
|
||||||
@@ -161,7 +166,7 @@ Visual Basic
|
|||||||
http://sourceforge.net/projects/libcurl-vb/
|
http://sourceforge.net/projects/libcurl-vb/
|
||||||
|
|
||||||
Q
|
Q
|
||||||
|
The libcurl module is part of the default install
|
||||||
http://q-lang.sourceforge.net/
|
http://q-lang.sourceforge.net/
|
||||||
|
|
||||||
wxWidgets
|
wxWidgets
|
||||||
|
@@ -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
|
This document is intended to offer guidelines that can be useful to keep in
|
||||||
to keep in mind when you decide to contribute to the project. This concerns
|
mind when you decide to contribute to the project. This concerns new features
|
||||||
new features as well as corrections to existing flaws or bugs.
|
as well as corrections to existing flaws or bugs.
|
||||||
|
|
||||||
Join the Community
|
Join the Community
|
||||||
|
|
||||||
@@ -20,13 +20,26 @@ Join the Community
|
|||||||
The License Issue
|
The License Issue
|
||||||
|
|
||||||
When contributing with code, you agree to put your changes and new code under
|
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
|
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
|
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
|
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
|
GPL licensed (as we don't want copyleft to affect users of libcurl) but they
|
||||||
use "GPL compatible" licenses.
|
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
|
What To Read
|
||||||
|
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
Date: September 1, 2005
|
Date: October 27, 2005
|
||||||
Author: Daniel Stenberg <daniel@haxx.se>
|
Author: Daniel Stenberg <daniel@haxx.se>
|
||||||
URL: http://curl.haxx.se/legal/distro-dilemma.html
|
URL: http://curl.haxx.se/legal/distro-dilemma.html
|
||||||
|
|
||||||
Condition
|
Condition
|
||||||
|
|
||||||
This document is written to describe the sitution as it is right now. libcurl
|
This document is written to describe the situation as it is right
|
||||||
7.14.0 is currently the latest version available. Things may (or perhaps
|
now. libcurl 7.15.0 is currently the latest version available. Things may (or
|
||||||
will) of course change in the future.
|
perhaps will) of course change in the future.
|
||||||
|
|
||||||
This document reflects my view and understanding of these things. Please tell
|
This document reflects my view and understanding of these things. Please tell
|
||||||
me where and how you think I'm wrong, and I'll try to correct my mistakes.
|
me where and how you think I'm wrong, and I'll try to correct my mistakes.
|
||||||
@@ -16,7 +16,7 @@ Background
|
|||||||
The Free Software Foundation has deemed the Original BSD license[1] to be
|
The Free Software Foundation has deemed the Original BSD license[1] to be
|
||||||
"incompatible"[2] with GPL[3]. I'd rather say it is the other way around, but
|
"incompatible"[2] with GPL[3]. I'd rather say it is the other way around, but
|
||||||
the point is the same: if you distribute a binary version of a GPL program,
|
the point is the same: if you distribute a binary version of a GPL program,
|
||||||
it MUST NOT be linked with any Original BSD-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
|
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
|
GPL licensed programs have avoided this license mess by adding an
|
||||||
exception[8] to their license. And many others have just closed their eyes
|
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.
|
tend to), you have a clash. GPL vs Original BSD.
|
||||||
|
|
||||||
This dilemma is not libcurl-specific nor is it specific to any particular
|
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
|
Part of the Operating System
|
||||||
|
|
||||||
This would not be a problem if the used lib would be considered part of the
|
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
|
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
|
allowed to distribute it or its sources. Possibly some distros will claim
|
||||||
that OpenSSL is part of their operating system.
|
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
|
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.
|
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?
|
The Better License, Original BSD or LGPL?
|
||||||
|
|
||||||
It isn't obvious or without debate to any objective interested party that
|
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
|
Instead, I think we should accept the fact that the SSL/TLS libraries and
|
||||||
their different licenses will fit different applications and their authors
|
their different licenses will fit different applications and their authors
|
||||||
differently depending on the applications' licenses and their general usage
|
differently depending on the applications' licenses and their general usage
|
||||||
pattern (considering how LGPL libraries can be burdonsome for embedded
|
pattern (considering how LGPL libraries for example can be burdensome for
|
||||||
systems usage).
|
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
|
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
|
affects users - GPL application authors only - of our lib as it comes
|
||||||
included and delivered on some distros.
|
included and delivered on some distros.
|
||||||
|
|
||||||
|
libcurl has different ABI when built with different SSL/TLS libraries due to
|
||||||
|
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
|
Distro Angle of this Problem
|
||||||
|
|
||||||
A distro can provide separate libcurls built with different SSL/TLS libraries
|
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
|
The only problem is thus for distributions that want to offer libcurl
|
||||||
versions built with more than one SSL/TLS library.
|
versions built with more than one SSL/TLS library.
|
||||||
|
|
||||||
|
Debian is now (since mid September 2005) providing two different devel
|
||||||
|
packages, one for libcurl built with OpenSSL and one built with GnuTLS. They
|
||||||
|
use different .so names and can this both be installed in a single system
|
||||||
|
simultaneously. This has previously been said as a transitional system not
|
||||||
|
desired to keep in the long run.
|
||||||
|
|
||||||
Since multiple libcurl binaries using different names are ruled out, we need
|
Since multiple libcurl binaries using different names are ruled out, we need
|
||||||
to come up with a way to have one single libcurl that someone uses different
|
to come up with a way to have one single libcurl that someone uses different
|
||||||
underlying libraries. The best(?) approach currently suggested involves this:
|
underlying libraries. The best(?) approach currently suggested involves this:
|
||||||
@@ -170,6 +206,10 @@ When Will This Happen
|
|||||||
code like today (without the use of lib2), should you decide to ignore the
|
code like today (without the use of lib2), should you decide to ignore the
|
||||||
problems outlined in this document.
|
problems outlined in this document.
|
||||||
|
|
||||||
|
Update: Work on this has been initiated by Richard Atterer:
|
||||||
|
|
||||||
|
http://curl.haxx.se/mail/lib-2005-09/0066.html
|
||||||
|
|
||||||
Footnotes
|
Footnotes
|
||||||
|
|
||||||
[1] = http://www.xfree86.org/3.3.6/COPYRIGHT2.html#6
|
[1] = http://www.xfree86.org/3.3.6/COPYRIGHT2.html#6
|
||||||
|
123
docs/FAQ
123
docs/FAQ
@@ -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.6 What do you get for making curl?
|
||||||
1.7 What about CURL from curl.com?
|
1.7 What about CURL from curl.com?
|
||||||
1.8 I have a problem who do I mail?
|
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. Install Related Problems
|
||||||
2.1 configure doesn't find OpenSSL even when it is installed
|
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.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.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.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. PHP/CURL Issues
|
||||||
7.1 What is PHP/CURL?
|
7.1 What is PHP/CURL?
|
||||||
@@ -148,6 +151,10 @@ FAQ
|
|||||||
You can use libcurl for free in your application, be it open source,
|
You can use libcurl for free in your application, be it open source,
|
||||||
commercial or closed-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?
|
1.3 What is curl not?
|
||||||
|
|
||||||
Curl is *not* a wget clone. That is a common misconception. Never, during
|
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
|
improvements and have them inserted in the main sources (of course on the
|
||||||
condition that developers agree on that the fixes are good).
|
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.
|
file.
|
||||||
|
|
||||||
curl is developed by a community, with Daniel at the wheel.
|
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
|
flaw is announced to the world, thus lessen the impact the problem will have
|
||||||
on existing users.
|
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
|
2. Install Related Problems
|
||||||
|
|
||||||
@@ -514,22 +567,24 @@ FAQ
|
|||||||
- Server certificate. The server you communicate with has a server
|
- Server certificate. The server you communicate with has a server
|
||||||
certificate. You can and should verify this certificate to make sure that
|
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
|
you are truly talking to the real server and not a server impersonating
|
||||||
it. The server certificate verification process is made by using a
|
it.
|
||||||
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.
|
|
||||||
|
|
||||||
- Certificate Authority certificate ("CA cert"). You often have several CA
|
- 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
|
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
|
that was signed by one of the authorities in the bundle. curl comes with a
|
||||||
default CA cert bundle. You can override the default.
|
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?
|
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
|
There are two ways. The way defined in the RFC is to use an encoded slash
|
||||||
@@ -546,6 +601,8 @@ FAQ
|
|||||||
|
|
||||||
No.
|
No.
|
||||||
|
|
||||||
|
But you could easily write your own program using libcurl to do such stunts.
|
||||||
|
|
||||||
|
|
||||||
4. Running Problems
|
4. Running Problems
|
||||||
|
|
||||||
@@ -751,10 +808,10 @@ FAQ
|
|||||||
curl supports HTTP redirects fine (see item 3.8). Browsers generally support
|
curl supports HTTP redirects fine (see item 3.8). Browsers generally support
|
||||||
at least two other ways to perform directs that curl does not:
|
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.
|
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.
|
that redirects the browser to another given URL.
|
||||||
|
|
||||||
There is no way to make curl follow these redirects. You must either
|
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
|
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
|
pass to the callback function. You set the pointer using the
|
||||||
curl_easy_setopt(CURLOPT_FILE) function. Then that pointer will be passed to
|
CURLOPT_WRITEDATA option. Then that pointer will be passed to the callback
|
||||||
the callback instead of a FILE * to a file:
|
instead of a FILE * to a file:
|
||||||
|
|
||||||
/* imaginary struct */
|
/* imaginary struct */
|
||||||
struct MemoryStruct {
|
struct MemoryStruct {
|
||||||
@@ -901,7 +958,10 @@ FAQ
|
|||||||
|
|
||||||
5.9 How does libcurl resolve host names?
|
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
|
- The non-ipv6 resolver that can use one out of four host name resolve calls
|
||||||
(depending on what your system supports):
|
(depending on what your system supports):
|
||||||
@@ -914,6 +974,8 @@ FAQ
|
|||||||
- The ipv6-resolver that uses getaddrinfo()
|
- The ipv6-resolver that uses getaddrinfo()
|
||||||
|
|
||||||
- The c-ares based name resolver that uses the c-ares library for resolves.
|
- 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:
|
- The Windows threaded resolver. It use:
|
||||||
|
|
||||||
@@ -926,8 +988,8 @@ FAQ
|
|||||||
5.10 How do I prevent libcurl from writing the response to stdout?
|
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
|
libcurl provides a default built-in write function that writes received data
|
||||||
to stdout. Set a WRITEFUNCTION to receive the data, or possibly set
|
to stdout. Set the CURLOPT_WRITEFUNCTION to receive the data, or possibly
|
||||||
WRITEDATA to a different FILE * handle.
|
set CURLOPT_WRITEDATA to a different FILE * handle.
|
||||||
|
|
||||||
5.11 How do I make libcurl not receive the whole HTTP response?
|
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
|
is just a brief summary for the cases we get the most questions. (Parts of
|
||||||
this section was much enhanced by Bjorn Reese.)
|
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?
|
6.1 I have a GPL program, can I use the libcurl library?
|
||||||
|
|
||||||
Yes!
|
Yes!
|
||||||
@@ -1000,6 +1065,26 @@ FAQ
|
|||||||
libraries that use it. It should be possible for everyone to use libcurl or
|
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.
|
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. PHP/CURL Issues
|
||||||
|
|
||||||
7.1 What is PHP/CURL?
|
7.1 What is PHP/CURL?
|
||||||
|
@@ -95,6 +95,9 @@ FTPS (*1)
|
|||||||
- implicit "AUTH TSL" and "AUTH SSL" usage to "upgrade" plain ftp://
|
- implicit "AUTH TSL" and "AUTH SSL" usage to "upgrade" plain ftp://
|
||||||
connection to use SSL for both or one of the connections
|
connection to use SSL for both or one of the connections
|
||||||
|
|
||||||
|
TFTP
|
||||||
|
- download / upload
|
||||||
|
|
||||||
TELNET
|
TELNET
|
||||||
- connection negotiation
|
- connection negotiation
|
||||||
- custom telnet options
|
- custom telnet options
|
||||||
|
@@ -145,3 +145,9 @@ August 2004:
|
|||||||
April 2005:
|
April 2005:
|
||||||
|
|
||||||
GnuTLS can now optionally be used for the secure layer when curl is built.
|
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.
|
||||||
|
109
docs/INSTALL
109
docs/INSTALL
@@ -132,64 +132,33 @@ UNIX
|
|||||||
Win32
|
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. Use 'make mingw32-ssl' to build
|
||||||
Run the 'mingw32.bat' file to get the proper environment variables
|
curl SSL enabled.
|
||||||
set, then run 'make mingw32' in the root dir.
|
|
||||||
|
|
||||||
If you have any problems linking libraries or finding header files, be
|
If you have any problems linking libraries or finding header files, be sure
|
||||||
sure to verify that the provided "Makefile.m32" files use the proper
|
to verify that the provided "Makefile.m32" files use the proper paths, and
|
||||||
paths, and adjust as necessary.
|
adjust as necessary.
|
||||||
|
|
||||||
Cygwin style
|
Cygwin
|
||||||
------------
|
------
|
||||||
Almost identical to the unix installation. Run the configure script in
|
|
||||||
the curl root with 'sh configure'. Make sure you have the sh
|
Almost identical to the unix installation. Run the configure script in the
|
||||||
executable in /bin/ or you'll see the configure fail towards the end.
|
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'
|
Run 'make'
|
||||||
|
|
||||||
Microsoft command line style
|
Dev-Cpp
|
||||||
----------------------------
|
-------
|
||||||
Run the 'vcvars32.bat' file to get the proper environment variables
|
|
||||||
set, then run 'nmake vc' in the root dir.
|
|
||||||
|
|
||||||
The vcvars32.bat file is part of the Microsoft development
|
See the separate INSTALL.devcpp file for details.
|
||||||
environment.
|
|
||||||
|
|
||||||
IDE-style
|
MSVC from command line
|
||||||
-------------------------
|
----------------------
|
||||||
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
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
Run the 'vcvars32.bat' file to get a proper environment. The
|
Run the 'vcvars32.bat' file to get a proper environment. The
|
||||||
vcvars32.bat file is part of the Microsoft development environment and
|
vcvars32.bat file is part of the Microsoft development environment and
|
||||||
@@ -232,22 +201,14 @@ Win32
|
|||||||
at runtime.
|
at runtime.
|
||||||
Run 'nmake vc-ssl-zlib' to build with both ssl and zlib support.
|
Run 'nmake vc-ssl-zlib' to build with both ssl and zlib support.
|
||||||
|
|
||||||
Microsoft / Borland style
|
Borland C++ compiler
|
||||||
-------------------------
|
---------------------
|
||||||
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)
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
compile openssl
|
compile openssl
|
||||||
|
|
||||||
Make sure you include the paths to curl/include and openssl/inc32 in
|
Make sure you include the paths to curl/include and openssl/inc32 in
|
||||||
your bcc32.cnf file
|
your bcc32.cnf file
|
||||||
|
|
||||||
|
|
||||||
eg : -I"c:\Bcc55\include;c:\path_curl\include;c:\path_openssl\inc32"
|
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
|
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
|
-L c:\openssl\out32\ssleay32.lib
|
||||||
simplessl.c
|
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
|
The configure utility, unfortunately, is not available for the Windows
|
||||||
environment, therefore, you cannot use the various disable-protocol
|
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.
|
in the curllib.dsw/curllib.dsp Visual C++ 6 IDE project.
|
||||||
|
|
||||||
|
|
||||||
Important (with SSL or not):
|
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.
|
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
|
IBM OS/2
|
||||||
|
302
docs/INSTALL.devcpp
Normal file
302
docs/INSTALL.devcpp
Normal 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
|
@@ -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
|
changelog of the current development status, as one or more of these problems
|
||||||
may have been fixed since this was written!
|
may have been fixed since this was written!
|
||||||
|
|
||||||
|
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
|
25. When doing a CONNECT request with curl it doesn't properly handle if the
|
||||||
proxy closes the connection within the authentication "negotiation phase".
|
proxy closes the connection within the authentication "negotiation phase".
|
||||||
Like if you do HTTPS or similar over a proxy and you use perhaps
|
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
|
complaining on "unaligned file size" on completion. The problem is related
|
||||||
to VMS file structures and the perceived file sizes stat() returns. A
|
to VMS file structures and the perceived file sizes stat() returns. A
|
||||||
possible fix would involve sending a "STRU VMS" command.
|
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
|
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
|
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
|
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
|
(fake) user name (this concerns both curl and the lib) because the code
|
||||||
wrongly only considers authentication if there's a user name provided.
|
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
|
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
|
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
|
8. Doing resumed upload over HTTP does not work with '-C -', because curl
|
||||||
doesn't do a HEAD first to get the initial size. This needs to be done
|
doesn't do a HEAD first to get the initial size. This needs to be done
|
||||||
|
@@ -17,7 +17,7 @@ CLEANFILES = $(GENHTMLPAGES) $(PDFPAGES)
|
|||||||
EXTRA_DIST = MANUAL BUGS CONTRIBUTE FAQ FEATURES INTERNALS SSLCERTS \
|
EXTRA_DIST = MANUAL BUGS CONTRIBUTE FAQ FEATURES INTERNALS SSLCERTS \
|
||||||
README.win32 RESOURCES TODO TheArtOfHttpScripting THANKS VERSIONS \
|
README.win32 RESOURCES TODO TheArtOfHttpScripting THANKS VERSIONS \
|
||||||
KNOWN_BUGS BINDINGS $(man_MANS) $(HTMLPAGES) HISTORY INSTALL \
|
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 < $< >$@
|
MAN2HTML= roffit < $< >$@
|
||||||
|
|
||||||
|
34
docs/THANKS
34
docs/THANKS
@@ -9,15 +9,14 @@ Alan Pinstein
|
|||||||
Albert Chin-A-Young
|
Albert Chin-A-Young
|
||||||
Albert Choy
|
Albert Choy
|
||||||
Aleksandar Milivojevic
|
Aleksandar Milivojevic
|
||||||
Alex aka WindEagle
|
|
||||||
Alex Neblett
|
Alex Neblett
|
||||||
Alex Suykov
|
Alex Suykov
|
||||||
|
Alex aka WindEagle
|
||||||
Alexander Kourakos
|
Alexander Kourakos
|
||||||
Alexander Krasnostavsky
|
Alexander Krasnostavsky
|
||||||
Alexander Zhuravlev
|
Alexander Zhuravlev
|
||||||
Alexis Carvalho
|
Alexis Carvalho
|
||||||
Andi Jahja
|
Andi Jahja
|
||||||
Andr<EFBFBD>s Garc<72>a
|
|
||||||
Andreas Damm
|
Andreas Damm
|
||||||
Andreas Olsson
|
Andreas Olsson
|
||||||
Andreas Rieke
|
Andreas Rieke
|
||||||
@@ -25,6 +24,7 @@ Andres Garcia
|
|||||||
Andrew Bushnell
|
Andrew Bushnell
|
||||||
Andrew Francis
|
Andrew Francis
|
||||||
Andrew Fuller
|
Andrew Fuller
|
||||||
|
Andr<EFBFBD>s Garc<72>a
|
||||||
Andy Cedilnik
|
Andy Cedilnik
|
||||||
Andy Serpa
|
Andy Serpa
|
||||||
Angus Mackay
|
Angus Mackay
|
||||||
@@ -34,10 +34,11 @@ Arkadiusz Miskiewicz
|
|||||||
Augustus Saunders
|
Augustus Saunders
|
||||||
Avery Fay
|
Avery Fay
|
||||||
Ben Greear
|
Ben Greear
|
||||||
|
Ben Madsen
|
||||||
Benjamin Gerard
|
Benjamin Gerard
|
||||||
Bertrand Demiddelaer
|
Bertrand Demiddelaer
|
||||||
Bj<EFBFBD>rn Stenberg
|
|
||||||
Bjorn Reese
|
Bjorn Reese
|
||||||
|
Bj<EFBFBD>rn Stenberg
|
||||||
Bob Schader
|
Bob Schader
|
||||||
Brad Burdick
|
Brad Burdick
|
||||||
Brent Beardsley
|
Brent Beardsley
|
||||||
@@ -75,8 +76,9 @@ Dan C
|
|||||||
Dan Fandrich
|
Dan Fandrich
|
||||||
Dan Torop
|
Dan Torop
|
||||||
Dan Zitter
|
Dan Zitter
|
||||||
Daniel at touchtunes
|
|
||||||
Daniel Stenberg
|
Daniel Stenberg
|
||||||
|
Daniel at touchtunes
|
||||||
|
Darryl House
|
||||||
Dave Dribin
|
Dave Dribin
|
||||||
Dave Halbakken
|
Dave Halbakken
|
||||||
Dave Hamilton
|
Dave Hamilton
|
||||||
@@ -95,12 +97,14 @@ David Phillips
|
|||||||
David Shaw
|
David Shaw
|
||||||
David Tarendash
|
David Tarendash
|
||||||
David Thiel
|
David Thiel
|
||||||
|
David Yan
|
||||||
Detlef Schmier
|
Detlef Schmier
|
||||||
Diego Casorran
|
Diego Casorran
|
||||||
Dimitris Sarris
|
Dimitris Sarris
|
||||||
Dinar
|
Dinar
|
||||||
Dirk Eddelbuettel
|
Dirk Eddelbuettel
|
||||||
Dirk Manske
|
Dirk Manske
|
||||||
|
Dmitry Bartsevich
|
||||||
Dolbneff A.V
|
Dolbneff A.V
|
||||||
Domenico Andreoli
|
Domenico Andreoli
|
||||||
Dominick Meglio
|
Dominick Meglio
|
||||||
@@ -138,8 +142,6 @@ Frank Ticheler
|
|||||||
Fred New
|
Fred New
|
||||||
Fred Noz
|
Fred Noz
|
||||||
Frederic Lepied
|
Frederic Lepied
|
||||||
G<EFBFBD>nter Knauf
|
|
||||||
G<EFBFBD>tz Babin-Ebell
|
|
||||||
Gautam Mani
|
Gautam Mani
|
||||||
Gaz Iqbal
|
Gaz Iqbal
|
||||||
Georg Horn
|
Georg Horn
|
||||||
@@ -162,6 +164,8 @@ Guenole Bescon
|
|||||||
Guillaume Arluison
|
Guillaume Arluison
|
||||||
Gustaf Hui
|
Gustaf Hui
|
||||||
Gwenole Beauchesne
|
Gwenole Beauchesne
|
||||||
|
G<EFBFBD>tz Babin-Ebell
|
||||||
|
G<EFBFBD>nter Knauf
|
||||||
Hamish Mackenzie
|
Hamish Mackenzie
|
||||||
Hanno Kranzhoff
|
Hanno Kranzhoff
|
||||||
Hans Steegers
|
Hans Steegers
|
||||||
@@ -174,11 +178,10 @@ Ian Ford
|
|||||||
Ian Gulliver
|
Ian Gulliver
|
||||||
Ian Wilkes
|
Ian Wilkes
|
||||||
Ignacio Vazquez-Abrams
|
Ignacio Vazquez-Abrams
|
||||||
|
Igor Polyakov
|
||||||
Ilguiz Latypov
|
Ilguiz Latypov
|
||||||
Ingo Ralf Blum
|
Ingo Ralf Blum
|
||||||
Ingo Wilken
|
Ingo Wilken
|
||||||
J<EFBFBD>rg Mueller-Tolk
|
|
||||||
J<EFBFBD>rn Hartroth
|
|
||||||
Jacky Lam
|
Jacky Lam
|
||||||
Jacob Meuser
|
Jacob Meuser
|
||||||
James Bursa
|
James Bursa
|
||||||
@@ -208,6 +211,7 @@ Johan Anderson
|
|||||||
Johan Nilsson
|
Johan Nilsson
|
||||||
John Crow
|
John Crow
|
||||||
John Janssen
|
John Janssen
|
||||||
|
John Kelly
|
||||||
John Lask
|
John Lask
|
||||||
John McGowan
|
John McGowan
|
||||||
Jon Grubbs
|
Jon Grubbs
|
||||||
@@ -225,6 +229,8 @@ Jukka Pihl
|
|||||||
Julian Noble
|
Julian Noble
|
||||||
Jun-ichiro itojun Hagino
|
Jun-ichiro itojun Hagino
|
||||||
Jurij Smakov
|
Jurij Smakov
|
||||||
|
J<EFBFBD>rg Mueller-Tolk
|
||||||
|
J<EFBFBD>rn Hartroth
|
||||||
Kai Sommerfeld
|
Kai Sommerfeld
|
||||||
Kai-Uwe Rommel
|
Kai-Uwe Rommel
|
||||||
Kang-Jin Lee
|
Kang-Jin Lee
|
||||||
@@ -234,6 +240,7 @@ Keith McGuigan
|
|||||||
Ken Hirsch
|
Ken Hirsch
|
||||||
Ken Rastatter
|
Ken Rastatter
|
||||||
Kevin Fisk
|
Kevin Fisk
|
||||||
|
Kevin Lussier
|
||||||
Kevin Roth
|
Kevin Roth
|
||||||
Kimmo Kinnunen
|
Kimmo Kinnunen
|
||||||
Kjell Ericson
|
Kjell Ericson
|
||||||
@@ -291,6 +298,7 @@ Mettgut Jamalla
|
|||||||
Michael Benedict
|
Michael Benedict
|
||||||
Michael Curtis
|
Michael Curtis
|
||||||
Michael Mealling
|
Michael Mealling
|
||||||
|
Michael Wallner
|
||||||
Michal Bonino
|
Michal Bonino
|
||||||
Mihai Ionescu
|
Mihai Ionescu
|
||||||
Mike Bytnar
|
Mike Bytnar
|
||||||
@@ -310,10 +318,11 @@ Nick Humfrey
|
|||||||
Nico Baggus
|
Nico Baggus
|
||||||
Nicolas Berloquin
|
Nicolas Berloquin
|
||||||
Nicolas Croiset
|
Nicolas Croiset
|
||||||
|
Nicolas Fran<61>ois
|
||||||
Niels van Tongeren
|
Niels van Tongeren
|
||||||
Nikita Schmidt
|
Nikita Schmidt
|
||||||
nk
|
|
||||||
Nodak Sodak
|
Nodak Sodak
|
||||||
|
Norbert Novotny
|
||||||
Oren Tirosh
|
Oren Tirosh
|
||||||
P R Schaffner
|
P R Schaffner
|
||||||
Patrick Bihan-Faou
|
Patrick Bihan-Faou
|
||||||
@@ -376,7 +385,6 @@ Rosimildo da Silva
|
|||||||
Roy Shan
|
Roy Shan
|
||||||
Rune Kleveland
|
Rune Kleveland
|
||||||
Ryan Nelson
|
Ryan Nelson
|
||||||
S<EFBFBD>bastien Willemijns
|
|
||||||
S. Moonesamy
|
S. Moonesamy
|
||||||
Salvador D<>vila
|
Salvador D<>vila
|
||||||
Salvatore Sorrentino
|
Salvatore Sorrentino
|
||||||
@@ -385,6 +393,7 @@ Samuel D
|
|||||||
Samuel Listopad
|
Samuel Listopad
|
||||||
Sander Gates
|
Sander Gates
|
||||||
Saul good
|
Saul good
|
||||||
|
Scott Davis
|
||||||
Sebastien Willemijns
|
Sebastien Willemijns
|
||||||
Sergio Ballestrero
|
Sergio Ballestrero
|
||||||
Seshubabu Pasam
|
Seshubabu Pasam
|
||||||
@@ -392,6 +401,7 @@ Shard
|
|||||||
Shawn Poulson
|
Shawn Poulson
|
||||||
Siddhartha Prakash Jain
|
Siddhartha Prakash Jain
|
||||||
Simon Dick
|
Simon Dick
|
||||||
|
Simon Josefsson
|
||||||
Simon Liu
|
Simon Liu
|
||||||
Spiridonoff A.V
|
Spiridonoff A.V
|
||||||
Stadler Stephan
|
Stadler Stephan
|
||||||
@@ -408,7 +418,7 @@ Steven Bazyl
|
|||||||
Steven G. Johnson
|
Steven G. Johnson
|
||||||
Stoned Elipot
|
Stoned Elipot
|
||||||
Sven Neuhaus
|
Sven Neuhaus
|
||||||
swalkaus at yahoo.com
|
S<EFBFBD>bastien Willemijns
|
||||||
T. Bharath
|
T. Bharath
|
||||||
T. Yamada
|
T. Yamada
|
||||||
Thomas Schwinge
|
Thomas Schwinge
|
||||||
@@ -451,3 +461,5 @@ Wilfredo Sanchez
|
|||||||
Wojciech Zwiefka
|
Wojciech Zwiefka
|
||||||
Yarram Sunil
|
Yarram Sunil
|
||||||
Zvi Har'El
|
Zvi Har'El
|
||||||
|
nk
|
||||||
|
swalkaus at yahoo.com
|
||||||
|
12
docs/TODO
12
docs/TODO
@@ -31,7 +31,7 @@ TODO
|
|||||||
* Introduce a new error code indicating authentication problems (for proxy
|
* Introduce a new error code indicating authentication problems (for proxy
|
||||||
CONNECT error 407 for example). This cannot be an error code, we must not
|
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
|
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
|
* Use 'struct lifreq' and SIOCGLIFADDR instead of 'struct ifreq' and
|
||||||
SIOCGIFADDR on newer Solaris versions as they claim the latter is obsolete.
|
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
|
* Support GSS/Kerberos 5 for ftp file transfer. This will allow user
|
||||||
authentication and file encryption. Possible libraries and example clients
|
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
|
* 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
|
if the server doesn't set the pointer to the requested index. The tricky
|
||||||
@@ -190,12 +190,6 @@ TODO
|
|||||||
|
|
||||||
NEW PROTOCOLS
|
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)
|
* RTSP - RFC2326 (protocol - very HTTP-like, also contains URL description)
|
||||||
|
|
||||||
* SFTP/SCP/SSH (no RFCs for protocol nor URI/URL format). An implementation
|
* SFTP/SCP/SSH (no RFCs for protocol nor URI/URL format). An implementation
|
||||||
@@ -217,7 +211,7 @@ TODO
|
|||||||
* Globbing support for -d and -F, as in 'curl -d "name=foo[0-9]" URL'.
|
* 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.
|
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
|
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
|
(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
|
existing). So that index.html becomes first index.html.1 and then
|
||||||
|
@@ -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;
|
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
|
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
|
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"
|
.SH "EXAMPLES"
|
||||||
What linker options do I need when I link with libcurl?
|
What linker options do I need when I link with libcurl?
|
||||||
|
|
||||||
|
54
docs/curl.1
54
docs/curl.1
@@ -21,7 +21,7 @@
|
|||||||
.\" * $Id$
|
.\" * $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
|
.SH NAME
|
||||||
curl \- transfer a URL
|
curl \- transfer a URL
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@@ -30,8 +30,8 @@ curl \- transfer a URL
|
|||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.B curl
|
.B curl
|
||||||
is a tool to transfer data from or to a server, using one of the supported
|
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
|
protocols (HTTP, HTTPS, FTP, FTPS, TFTP, GOPHER, DICT, TELNET, LDAP or
|
||||||
command is designed to work without user interaction.
|
FILE). The command is designed to work without user interaction.
|
||||||
|
|
||||||
curl offers a busload of useful tricks like proxy support, user
|
curl offers a busload of useful tricks like proxy support, user
|
||||||
authentication, ftp upload, HTTP post, SSL (https:) connections, cookies, file
|
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
|
You can specify any amount of URLs on the command line. They will be fetched
|
||||||
in a sequential manner in the specified order.
|
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
|
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 /
|
getting many files from the same server will not do multiple connects /
|
||||||
handshakes. This improves speed. Of course this is only done on files
|
handshakes. This improves speed. Of course this is only done on files
|
||||||
@@ -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
|
using this option can be used to override a previous --ftp-port option. (Added
|
||||||
in 7.11.0)
|
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.
|
If this option is used twice, the second will again disable silent failure.
|
||||||
.IP "--ftp-ssl"
|
.IP "--ftp-ssl"
|
||||||
(FTP) Make the FTP connection switch to use SSL/TLS. (Added in 7.11.0)
|
(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>"
|
.IP "-m/--max-time <seconds>"
|
||||||
Maximum time in seconds that you allow the whole operation to take. This is
|
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
|
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
|
networks or links going down. See also the \fI--connect-timeout\fP option.
|
||||||
also the \fI--connect-timeout\fP option.
|
|
||||||
|
|
||||||
If this option is used several times, the last one will be used.
|
If this option is used several times, the last one will be used.
|
||||||
.IP "-M/--manual"
|
.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
|
A quick and very simple example of how to setup a \fI.netrc\fP to allow curl
|
||||||
to ftp to the machine host.domain.com with user name \&'myself' and password
|
to ftp to the machine host.domain.com with user name \&'myself' and password
|
||||||
'secret' should look similar to:
|
\&'secret' should look similar to:
|
||||||
|
|
||||||
.B "machine host.domain.com login myself password secret"
|
.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
|
not very common. Use \fI-V/--version\fP to see if your version supports
|
||||||
GSS-Negotiate.
|
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
|
If this option is used several times, the following occurrences make no
|
||||||
difference.
|
difference.
|
||||||
.IP "-N/--no-buffer"
|
.IP "-N/--no-buffer"
|
||||||
@@ -757,7 +780,7 @@ specifies the second 500 bytes
|
|||||||
.B -500
|
.B -500
|
||||||
specifies the last 500 bytes
|
specifies the last 500 bytes
|
||||||
.TP
|
.TP
|
||||||
.B 9500
|
.B 9500-
|
||||||
specifies the bytes from offset 9500 and forward
|
specifies the bytes from offset 9500 and forward
|
||||||
.TP
|
.TP
|
||||||
.B 0-0,-1
|
.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
|
Specify user and password to use for server authentication. Overrides
|
||||||
\fI-n/--netrc\fP and \fI--netrc-optional\fP.
|
\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.
|
If this option is used several times, the last one will be used.
|
||||||
.IP "-U/--proxy-user <user:password>"
|
.IP "-U/--proxy-user <user:password>"
|
||||||
Specify user and password to use for proxy authentication.
|
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.
|
If this option is used several times, the last one will be used.
|
||||||
.IP "--url <URL>"
|
.IP "--url <URL>"
|
||||||
Specify a URL to fetch. This option is mostly handy when you want to specify
|
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>"
|
.IP "--max-redirs <num>"
|
||||||
Set maximum number of redirection-followings allowed. If \fI-L/--location\fP
|
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
|
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.
|
If this option is used several times, the last one will be used.
|
||||||
.IP "-0/--http1.0"
|
.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.
|
Sets proxy server to use if no protocol-specific proxy is set.
|
||||||
.IP "NO_PROXY <comma-separated list of hosts>"
|
.IP "NO_PROXY <comma-separated list of hosts>"
|
||||||
list of host names that shouldn't go through any proxy. If set to a asterisk
|
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
|
.SH EXIT CODES
|
||||||
There exists a bunch of different error codes and their corresponding error
|
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,
|
messages that may appear during bad conditions. At the time of this writing,
|
||||||
@@ -1193,7 +1225,9 @@ Failed to connect to host.
|
|||||||
.IP 8
|
.IP 8
|
||||||
FTP weird server reply. The server sent data curl couldn't parse.
|
FTP weird server reply. The server sent data curl couldn't parse.
|
||||||
.IP 9
|
.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
|
.IP 10
|
||||||
FTP user/password incorrect. Either one or both were not accepted by the
|
FTP user/password incorrect. Either one or both were not accepted by the
|
||||||
server.
|
server.
|
||||||
|
@@ -14,6 +14,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
#include <curl/types.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.
|
* you're done with it, you should free() it as a nice application.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if(chunk.memory)
|
||||||
|
free(chunk.memory);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -52,8 +52,7 @@ PDFPAGES = curl_easy_cleanup.pdf curl_easy_getinfo.pdf \
|
|||||||
|
|
||||||
CLEANFILES = $(HTMLPAGES) $(PDFPAGES)
|
CLEANFILES = $(HTMLPAGES) $(PDFPAGES)
|
||||||
|
|
||||||
EXTRA_DIST = $(man_MANS) $(HTMLPAGES) index.html $(PDFPAGES) libcurl.m4 \
|
EXTRA_DIST = $(man_MANS) $(HTMLPAGES) index.html $(PDFPAGES) libcurl.m4
|
||||||
getinfo-times
|
|
||||||
|
|
||||||
MAN2HTML= roffit --mandir=. < $< >$@
|
MAN2HTML= roffit --mandir=. < $< >$@
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
.\" nroff -man [file]
|
.\" nroff -man [file]
|
||||||
.\" $Id$
|
.\" $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
|
.SH NAME
|
||||||
curl_easy_getinfo - extract information from a curl handle
|
curl_easy_getinfo - extract information from a curl handle
|
||||||
.SH SYNOPSIS
|
.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
|
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
|
received) 'struct curl_slist *' will be set to point to NULL. (Added in
|
||||||
7.14.1)
|
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
|
.SH RETURN VALUE
|
||||||
If the operation was successful, CURLE_OK is returned. Otherwise an
|
If the operation was successful, CURLE_OK is returned. Otherwise an
|
||||||
appropriate error code will be returned.
|
appropriate error code will be returned.
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
.\" * $Id$
|
.\" * $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
|
.SH NAME
|
||||||
curl_easy_setopt - set options for a curl easy handle
|
curl_easy_setopt - set options for a curl easy handle
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@@ -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
|
you must change them between the transfers. You can optionally reset all
|
||||||
options back to internal default with \fIcurl_easy_reset(3)\fP.
|
options back to internal default with \fIcurl_easy_reset(3)\fP.
|
||||||
|
|
||||||
\fBNOTE:\fP strings passed to libcurl as 'char *' arguments, will not be
|
Strings passed to libcurl as 'char *' arguments, will not be copied by the
|
||||||
copied by the library. Instead you should keep them available until libcurl no
|
library. Instead you should keep them available until libcurl no longer needs
|
||||||
longer needs them. Failing to do so will cause very odd behavior or even
|
them. Failing to do so will cause very odd behavior or even crashes. libcurl
|
||||||
crashes. libcurl will need them until you call \fIcurl_easy_cleanup(3)\fP or
|
will need them until you call \fIcurl_easy_cleanup(3)\fP or you set the same
|
||||||
you set the same option again to use a different pointer.
|
option again to use a different pointer.
|
||||||
|
|
||||||
The \fIhandle\fP is the return code from a \fIcurl_easy_init(3)\fP or
|
The \fIhandle\fP is the return code from a \fIcurl_easy_init(3)\fP or
|
||||||
\fIcurl_easy_duphandle(3)\fP call.
|
\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
|
A non-zero parameter tells the library to shut off the built-in progress meter
|
||||||
completely.
|
completely.
|
||||||
|
|
||||||
\fBNOTE:\fP future versions of libcurl is likely to not have any built-in
|
Future versions of libcurl is likely to not have any built-in progress meter
|
||||||
progress meter at all.
|
at all.
|
||||||
.IP CURLOPT_NOSIGNAL
|
.IP CURLOPT_NOSIGNAL
|
||||||
Pass a long. If it is non-zero, libcurl will not use any functions that
|
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
|
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
|
This function may be called with zero bytes data if the transfered file is
|
||||||
empty.
|
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.
|
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
|
The callback function will be passed as much data as possible in all invokes,
|
||||||
you cannot possibly make any assumptions. It may be one byte, it may be
|
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
|
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.
|
is defined in the curl.h header file: CURL_MAX_WRITE_SIZE.
|
||||||
.IP CURLOPT_WRITEDATA
|
.IP CURLOPT_WRITEDATA
|
||||||
Data pointer to pass to the file write function. Note that if you specify the
|
Data pointer to pass to the file write function. If you use the
|
||||||
\fICURLOPT_WRITEFUNCTION\fP, this is the pointer you'll get as input. If you
|
\fICURLOPT_WRITEFUNCTION\fP option, this is the pointer you'll get as
|
||||||
don't use a callback, you must pass a 'FILE *' as libcurl will pass this to
|
input. If you don't use a callback, you must pass a 'FILE *' as libcurl will
|
||||||
fwrite() when writing data.
|
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
|
\fICURLOPT_WRITEFUNCTION\fP if you set this option or you will experience
|
||||||
crashes.
|
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
|
upload less than N bytes), you may experience that the server "hangs" waiting
|
||||||
for the rest of the data that won't come.
|
for the rest of the data that won't come.
|
||||||
|
|
||||||
In libcurl 7.12.1 and later, the read callback may return
|
The read callback may return \fICURL_READFUNC_ABORT\fP to stop the current
|
||||||
\fICURL_READFUNC_ABORT\fP to stop the current operation at once, with a
|
operation immediately, resulting in a \fICURLE_ABORTED_BY_CALLBACK\fP error
|
||||||
\fICURLE_ABORTED_BY_CALLBACK\fP error code from the transfer.
|
code from the transfer (Added in 7.12.1)
|
||||||
.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 *.
|
|
||||||
|
|
||||||
\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.
|
\fICURLOPT_READFUNCTION\fP if you set this option.
|
||||||
|
|
||||||
This option is also known with the older name \fICURLOPT_INFILE\fP, the name
|
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
|
callback will cause libcurl to abort the transfer and return
|
||||||
\fICURLE_ABORTED_BY_CALLBACK\fP.
|
\fICURLE_ABORTED_BY_CALLBACK\fP.
|
||||||
|
|
||||||
Also note that \fICURLOPT_NOPROGRESS\fP must be set to FALSE to make this
|
\fICURLOPT_NOPROGRESS\fP must be set to FALSE to make this function actually
|
||||||
function actually get called.
|
get called.
|
||||||
.IP CURLOPT_PROGRESSDATA
|
.IP CURLOPT_PROGRESSDATA
|
||||||
Pass a pointer that will be untouched by libcurl and passed as the first
|
Pass a pointer that will be untouched by libcurl and passed as the first
|
||||||
argument in the progress callback set with \fICURLOPT_PROGRESSFUNCTION\fP.
|
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
|
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.
|
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
|
To use this properly, a non-trivial amount of knowledge of the openssl
|
||||||
openssl libraries is necessary. Using this function allows for example to use
|
libraries is necessary. Using this function allows for example to use openssl
|
||||||
openssl callbacks to add additional validation code for certificates, and even
|
callbacks to add additional validation code for certificates, and even to
|
||||||
to change the actual URI of an HTTPS request (example used in the lib509 test
|
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
|
case). See also the example section for a replacement of the key, certificate
|
||||||
and trust file settings.
|
and trust file settings.
|
||||||
.IP CURLOPT_SSL_CTX_DATA
|
.IP CURLOPT_SSL_CTX_DATA
|
||||||
@@ -249,14 +261,15 @@ parameter, otherwise \fBNULL\fP. (Added in 7.11.0)
|
|||||||
.SH ERROR OPTIONS
|
.SH ERROR OPTIONS
|
||||||
.IP CURLOPT_ERRORBUFFER
|
.IP CURLOPT_ERRORBUFFER
|
||||||
Pass a char * to a buffer that the libcurl may store human readable error
|
Pass a char * to a buffer that the libcurl may store human readable error
|
||||||
messages in. This may be more helpful than just the return code from the
|
messages in. This may be more helpful than just the return code from
|
||||||
library. The buffer must be at least CURL_ERROR_SIZE big.
|
\fIcurl_easy_perform\fP. The buffer must be at least CURL_ERROR_SIZE big.
|
||||||
|
|
||||||
Use \fICURLOPT_VERBOSE\fP and \fICURLOPT_DEBUGFUNCTION\fP to better
|
Use \fICURLOPT_VERBOSE\fP and \fICURLOPT_DEBUGFUNCTION\fP to better
|
||||||
debug/trace why errors happen.
|
debug/trace why errors happen.
|
||||||
|
|
||||||
\fBNote:\fP if the library does not return an error, the buffer may not have
|
If the library does not return an error, the buffer may not have been
|
||||||
been touched. Do not rely on the contents in those cases.
|
touched. Do not rely on the contents in those cases.
|
||||||
|
|
||||||
.IP CURLOPT_STDERR
|
.IP CURLOPT_STDERR
|
||||||
Pass a FILE * as parameter. Tell libcurl to use this stream instead of 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.
|
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
|
\fIcurl_multi_perform(3)\fP. Use \fIcurl_version_info(3)\fP for detailed info
|
||||||
on which protocols that are supported.
|
on which protocols that are supported.
|
||||||
|
|
||||||
\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.
|
\fIcurl_easy_perform(3)\fP is called.
|
||||||
.IP CURLOPT_PROXY
|
.IP CURLOPT_PROXY
|
||||||
Set HTTP proxy to use. The parameter should be a char * to a zero terminated
|
Set HTTP proxy to use. The parameter should be a char * to a zero terminated
|
||||||
@@ -310,9 +323,9 @@ this are \fICURLPROXY_HTTP\fP and \fICURLPROXY_SOCKS5\fP, with the HTTP one
|
|||||||
being default. (Added in 7.10)
|
being default. (Added in 7.10)
|
||||||
.IP CURLOPT_HTTPPROXYTUNNEL
|
.IP CURLOPT_HTTPPROXYTUNNEL
|
||||||
Set the parameter to non-zero to get the library to tunnel all operations
|
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
|
through a given HTTP proxy. There is a big difference between using a proxy
|
||||||
a proxy and to tunnel through it. If you don't know what this means, you
|
and to tunnel through it. If you don't know what this means, you probably
|
||||||
probably don't want this tunneling option.
|
don't want this tunneling option.
|
||||||
.IP CURLOPT_INTERFACE
|
.IP CURLOPT_INTERFACE
|
||||||
Pass a char * as parameter. This set the interface name to use as outgoing
|
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
|
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
|
to using the share interface instead! See \fICURLOPT_SHARE\fP and
|
||||||
\fIcurl_share_init(3)\fP.
|
\fIcurl_share_init(3)\fP.
|
||||||
.IP CURLOPT_BUFFERSIZE
|
.IP CURLOPT_BUFFERSIZE
|
||||||
Pass a long specifying your preferred size for the receive buffer in libcurl.
|
Pass a long specifying your preferred size (in bytes) for the receive buffer
|
||||||
The main point of this would be that the write callback gets called more often
|
in libcurl. The main point of this would be that the write callback gets
|
||||||
and with smaller chunks. This is just treated as a request, not an order. You
|
called more often and with smaller chunks. This is just treated as a request,
|
||||||
cannot be guaranteed to actually get the given size. (Added in 7.10)
|
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
|
.IP CURLOPT_PORT
|
||||||
Pass a long specifying what remote port number to connect to, instead of the
|
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.
|
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
|
passwords from your \fI~/.netrc\fP file, relative to user names and passwords
|
||||||
in the URL supplied with \fICURLOPT_URL\fP.
|
in the URL supplied with \fICURLOPT_URL\fP.
|
||||||
|
|
||||||
\fBNote:\fP libcurl uses a user name (and supplied or prompted password)
|
libcurl uses a user name (and supplied or prompted password) supplied with
|
||||||
supplied with \fICURLOPT_USERPWD\fP in preference to any of the options
|
\fICURLOPT_USERPWD\fP in preference to any of the options controlled by this
|
||||||
controlled by this parameter.
|
parameter.
|
||||||
|
|
||||||
Pass a long, set to one of the values described below.
|
Pass a long, set to one of the values described below.
|
||||||
.RS
|
.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
|
Only machine name, user name and password are taken into account
|
||||||
(init macros and similar things aren't supported).
|
(init macros and similar things aren't supported).
|
||||||
|
|
||||||
\fBNote:\fP libcurl does not verify that the file has the correct properties
|
libcurl does not verify that the file has the correct properties set (as the
|
||||||
set (as the standard Unix ftp client does). It should only be readable by
|
standard Unix ftp client does). It should only be readable by user.
|
||||||
user.
|
|
||||||
.IP CURLOPT_NETRC_FILE
|
.IP CURLOPT_NETRC_FILE
|
||||||
Pass a char * as parameter, pointing to a zero terminated string containing
|
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
|
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
|
Pass a char * as parameter, which should be [user name]:[password] to use for
|
||||||
the connection. Use \fICURLOPT_HTTPAUTH\fP to decide authentication method.
|
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
|
When using HTTP and \fICURLOPT_FOLLOWLOCATION\fP, libcurl might perform
|
||||||
several requests to possibly different hosts. libcurl will only send this user
|
several requests to possibly different hosts. libcurl will only send this user
|
||||||
and password information to hosts using the initial host name (unless
|
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
|
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
|
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
|
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
|
it to use. For some methods, this will induce an extra network round-trip. Set
|
||||||
round-trip. Set the actual name and password with the \fICURLOPT_USERPWD\fP
|
the actual name and password with the \fICURLOPT_USERPWD\fP option. (Added in
|
||||||
option. (Added in 7.10.6)
|
7.10.6)
|
||||||
.RS
|
.RS
|
||||||
.IP CURLAUTH_BASIC
|
.IP CURLAUTH_BASIC
|
||||||
HTTP Basic authentication. This is the default choice, and the only method
|
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
|
but may be also used along with another authentication methods. For more
|
||||||
information see IETF draft draft-brezak-spnego-http-04.txt.
|
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
|
You need to build libcurl with a suitable GSS-API library for this to work.
|
||||||
this to work.
|
|
||||||
.IP CURLAUTH_NTLM
|
.IP CURLAUTH_NTLM
|
||||||
HTTP NTLM authentication. A proprietary protocol invented and used by
|
HTTP NTLM authentication. A proprietary protocol invented and used by
|
||||||
Microsoft. It uses a challenge-response and hash concept similar to Digest, to
|
Microsoft. It uses a challenge-response and hash concept similar to Digest, to
|
||||||
prevent the password from being eavesdropped.
|
prevent the password from being eavesdropped.
|
||||||
|
|
||||||
\fBNOTE\fP that you need to build libcurl with SSL support for this option to
|
You need to build libcurl with OpenSSL support for this option to work, or
|
||||||
work.
|
build libcurl on Windows.
|
||||||
.IP CURLAUTH_ANY
|
.IP CURLAUTH_ANY
|
||||||
This is a convenience macro that sets all bits and thus makes libcurl pick 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
|
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
|
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
|
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
|
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
|
use. For some methods, this will induce an extra network round-trip. Set the
|
||||||
round-trip. Set the actual name and password with the
|
actual name and password with the \fICURLOPT_PROXYUSERPWD\fP option. The
|
||||||
\fICURLOPT_PROXYUSERPWD\fP option. The bitmask can be constructed by or'ing
|
bitmask can be constructed by or'ing together the bits listed above for the
|
||||||
together the bits listed above for the \fICURLOPT_HTTPAUTH\fP option. As of
|
\fICURLOPT_HTTPAUTH\fP option. As of this writing, only Basic, Digest and NTLM
|
||||||
this writing, only Basic, Digest and NTLM work. (Added in 7.10.7)
|
work. (Added in 7.10.7)
|
||||||
.SH HTTP OPTIONS
|
.SH HTTP OPTIONS
|
||||||
.IP CURLOPT_AUTOREFERER
|
.IP CURLOPT_AUTOREFERER
|
||||||
Pass a non-zero parameter to enable this. When enabled, libcurl will
|
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
|
A non-zero parameter tells the library to follow any Location: header that the
|
||||||
server sends as part of an HTTP header.
|
server sends as part of an HTTP header.
|
||||||
|
|
||||||
\fBNOTE:\fP this means that the library will re-send the same request on the
|
This means that the library will re-send the same request on the new location
|
||||||
new location and follow new Location: headers all the way until no more such
|
and follow new Location: headers all the way until no more such headers are
|
||||||
headers are returned. \fICURLOPT_MAXREDIRS\fP can be used to limit the number
|
returned. \fICURLOPT_MAXREDIRS\fP can be used to limit the number of redirects
|
||||||
of redirects libcurl will follow.
|
libcurl will follow.
|
||||||
.IP CURLOPT_UNRESTRICTED_AUTH
|
.IP CURLOPT_UNRESTRICTED_AUTH
|
||||||
A non-zero parameter tells the library it can continue to send authentication
|
A non-zero parameter tells the library it can continue to send authentication
|
||||||
(user+password) when following locations, even when hostname changed. Note
|
(user+password) when following locations, even when hostname changed. This
|
||||||
that this is meaningful only when setting \fICURLOPT_FOLLOWLOCATION\fP.
|
option is meaningful only when setting \fICURLOPT_FOLLOWLOCATION\fP.
|
||||||
.IP CURLOPT_MAXREDIRS
|
.IP CURLOPT_MAXREDIRS
|
||||||
Pass a long. The set number will be the redirection limit. If that many
|
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
|
redirections have been followed, the next redirect will cause an error
|
||||||
(\fICURLE_TOO_MANY_REDIRECTS\fP). This option only makes sense if the
|
(\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
|
.IP CURLOPT_PUT
|
||||||
A non-zero parameter tells the library to use HTTP PUT to transfer data. The
|
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.
|
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.
|
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.
|
You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual.
|
||||||
|
|
||||||
\fBNote:\fP to make multipart/formdata posts (aka rfc1867-posts), check out
|
To make multipart/formdata posts (aka rfc1867-posts), check out the
|
||||||
the \fICURLOPT_HTTPPOST\fP option.
|
\fICURLOPT_HTTPPOST\fP option.
|
||||||
.IP CURLOPT_POSTFIELDSIZE
|
.IP CURLOPT_POSTFIELDSIZE
|
||||||
If you want to post data to the server without letting libcurl do a strlen()
|
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
|
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.
|
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.
|
\fICURLOPT_COOKIE\fP, \fICURLOPT_USERAGENT\fP and \fICURLOPT_REFERER\fP.
|
||||||
.IP CURLOPT_HTTP200ALIASES
|
.IP CURLOPT_HTTP200ALIASES
|
||||||
Pass a pointer to a linked list of aliases to be treated as valid HTTP 200
|
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
|
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.
|
\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
|
The alias itself is not parsed for any version strings. So if your alias is
|
||||||
alias is "MYHTTP/9.9", Libcurl will not treat the server as responding with
|
\&"MYHTTP/9.9", Libcurl will not treat the server as responding with HTTP
|
||||||
HTTP version 9.9. Instead Libcurl will use the value set by option
|
version 9.9. Instead Libcurl will use the value set by option
|
||||||
\fICURLOPT_HTTP_VERSION\fP.
|
\fICURLOPT_HTTP_VERSION\fP.
|
||||||
.IP CURLOPT_COOKIE
|
.IP CURLOPT_COOKIE
|
||||||
Pass a pointer to a zero terminated string as parameter. It will be used to
|
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
|
cookies for this session, so if you for example follow a location it will make
|
||||||
matching cookies get sent accordingly.
|
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
|
\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
|
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
|
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
|
.IP CURLOPT_FTP_RESPONSE_TIMEOUT
|
||||||
Pass a long. Causes curl to set a timeout period (in seconds) on the amount
|
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
|
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
|
message for a command before the session is considered hung. While curl is
|
||||||
curl is waiting for a response, this value overrides \fICURLOPT_TIMEOUT\fP. It
|
waiting for a response, this value overrides \fICURLOPT_TIMEOUT\fP. It is
|
||||||
is recommended that if used in conjunction with \fICURLOPT_TIMEOUT\fP, you set
|
recommended that if used in conjunction with \fICURLOPT_TIMEOUT\fP, you set
|
||||||
\fICURLOPT_FTP_RESPONSE_TIMEOUT\fP to a value smaller than
|
\fICURLOPT_FTP_RESPONSE_TIMEOUT\fP to a value smaller than
|
||||||
\fICURLOPT_TIMEOUT\fP. (Added in 7.10.8)
|
\fICURLOPT_TIMEOUT\fP. (Added in 7.10.8)
|
||||||
|
.IP CURLOPT_FTP_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
|
.IP CURLOPT_FTP_SSL
|
||||||
Pass a long using one of the values from below, to make libcurl use your
|
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)
|
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
|
between systems with different views on certain characters, such as newlines
|
||||||
or similar.
|
or similar.
|
||||||
|
|
||||||
\fBNOTE:\fP libcurl does not do a complete ASCII conversion when doing ASCII
|
libcurl does not do a complete ASCII conversion when doing ASCII transfers
|
||||||
transfers over FTP. This is a known limitation/flaw that nobody has
|
over FTP. This is a known limitation/flaw that nobody has rectified. libcurl
|
||||||
rectified. libcurl simply sets the mode to ascii and performs a standard
|
simply sets the mode to ascii and performs a standard transfer.
|
||||||
transfer.
|
|
||||||
.IP CURLOPT_CRLF
|
.IP CURLOPT_CRLF
|
||||||
Convert Unix newlines to CRLF newlines on transfers.
|
Convert Unix newlines to CRLF newlines on transfers.
|
||||||
.IP CURLOPT_RANGE
|
.IP CURLOPT_RANGE
|
||||||
@@ -845,11 +874,11 @@ server supports the command first.
|
|||||||
|
|
||||||
Restore to the internal default by setting this to NULL.
|
Restore to the internal default by setting this to NULL.
|
||||||
|
|
||||||
\fBNOTE:\fP Many people have wrongly used this option to replace the entire
|
Many people have wrongly used this option to replace the entire request with
|
||||||
request with their own, including multiple headers and POST contents. While
|
their own, including multiple headers and POST contents. While that might work
|
||||||
that might work in many cases, it will cause libcurl to send invalid requests
|
in many cases, it will cause libcurl to send invalid requests and it could
|
||||||
and it could possibly confuse the remote server badly. Use \fICURLOPT_POST\fP
|
possibly confuse the remote server badly. Use \fICURLOPT_POST\fP and
|
||||||
and \fICURLOPT_POSTFIELDS\fP to set POST data. Use \fICURLOPT_HTTPHEADER\fP to
|
\fICURLOPT_POSTFIELDS\fP to set POST data. Use \fICURLOPT_HTTPHEADER\fP to
|
||||||
replace or extend the set of headers sent by libcurl. Use
|
replace or extend the set of headers sent by libcurl. Use
|
||||||
\fICURLOPT_HTTP_VERSION\fP to change HTTP version.
|
\fICURLOPT_HTTP_VERSION\fP to change HTTP version.
|
||||||
.IP CURLOPT_FILETIME
|
.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,
|
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.
|
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
|
The file size is not always known prior to download, and for such files this
|
||||||
files this option has no effect even if the file transfer ends up being larger
|
option has no effect even if the file transfer ends up being larger than this
|
||||||
than this given limit. This concerns both FTP and HTTP transfers.
|
given limit. This concerns both FTP and HTTP transfers.
|
||||||
.IP CURLOPT_MAXFILESIZE_LARGE
|
.IP CURLOPT_MAXFILESIZE_LARGE
|
||||||
Pass a curl_off_t as parameter. This allows you to specify the maximum size
|
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
|
(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
|
value, the transfer will not start and \fICURLE_FILESIZE_EXCEEDED\fP will be
|
||||||
returned. (Added in 7.11.0)
|
returned. (Added in 7.11.0)
|
||||||
|
|
||||||
\fBNOTE:\fP The file size is not always known prior to download, and for such
|
The file size is not always known prior to download, and for such files this
|
||||||
files this option has no effect even if the file transfer ends up being larger
|
option has no effect even if the file transfer ends up being larger than this
|
||||||
than this given limit. This concerns both FTP and HTTP transfers.
|
given limit. This concerns both FTP and HTTP transfers.
|
||||||
.IP CURLOPT_TIMECONDITION
|
.IP CURLOPT_TIMECONDITION
|
||||||
Pass a long as parameter. This defines how the \fICURLOPT_TIMEVALUE\fP time
|
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
|
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.
|
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
|
The last modification time of a file is not always known and in such instances
|
||||||
instances this feature will have no effect even if the given time condition
|
this feature will have no effect even if the given time condition would have
|
||||||
would have not been met.
|
not been met.
|
||||||
.IP CURLOPT_TIMEVALUE
|
.IP CURLOPT_TIMEVALUE
|
||||||
Pass a long as parameter. This should be the time in seconds since 1 jan 1970,
|
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
|
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
|
aborting perfectly normal operations. This option will cause curl to use the
|
||||||
SIGALRM to enable time-outing system calls.
|
SIGALRM to enable time-outing system calls.
|
||||||
|
|
||||||
\fBNOTE:\fP this is not recommended to use in unix multi-threaded programs, as
|
In unix-like systems, this might cause signals to be used unless
|
||||||
it uses signals unless \fICURLOPT_NOSIGNAL\fP (see above) is set.
|
\fICURLOPT_NOSIGNAL\fP is set.
|
||||||
.IP CURLOPT_LOW_SPEED_LIMIT
|
.IP CURLOPT_LOW_SPEED_LIMIT
|
||||||
Pass a long as parameter. It contains the transfer speed in bytes per second
|
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
|
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
|
figure out which of the existing connections to close to prevent the number of
|
||||||
open connections to increase.
|
open connections to increase.
|
||||||
|
|
||||||
\fBNOTE:\fP if you already have performed transfers with this curl handle,
|
If you already have performed transfers with this curl handle, setting a
|
||||||
setting a smaller MAXCONNECTS than before may cause open connections to get
|
smaller MAXCONNECTS than before may cause open connections to get closed
|
||||||
closed unnecessarily.
|
unnecessarily.
|
||||||
.IP CURLOPT_CLOSEPOLICY
|
.IP CURLOPT_CLOSEPOLICY
|
||||||
Pass a long. This option sets what policy libcurl should use when the
|
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
|
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
|
connection timeout (it will then only timeout on the system's internal
|
||||||
timeouts). See also the \fICURLOPT_TIMEOUT\fP option.
|
timeouts). See also the \fICURLOPT_TIMEOUT\fP option.
|
||||||
|
|
||||||
\fBNOTE:\fP this is not recommended to use in unix multi-threaded programs, as
|
In unix-like systems, this might cause signals to be used unless
|
||||||
it uses signals unless \fICURLOPT_NOSIGNAL\fP (see above) is set.
|
\fICURLOPT_NOSIGNAL\fP is set.
|
||||||
.IP CURLOPT_IPRESOLVE
|
.IP CURLOPT_IPRESOLVE
|
||||||
Allows an application to select what kind of IP addresses to use when
|
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
|
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
|
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".
|
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
|
The format "ENG" enables you to load the private key from a crypto engine. In
|
||||||
engine. In this case \fICURLOPT_SSLKEY\fP is used as an identifier passed to
|
this case \fICURLOPT_SSLKEY\fP is used as an identifier passed to the
|
||||||
the engine. You have to set the crypto engine with \fICURLOPT_SSLENGINE\fP.
|
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.
|
\&"DER" format key file currently does not work because of a bug in OpenSSL.
|
||||||
.IP CURLOPT_SSLKEYPASSWD
|
.IP CURLOPT_SSLKEYPASSWD
|
||||||
Pass a pointer to a zero terminated string as parameter. It will be used as
|
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
|
the identifier for the crypto engine you want to use for your private
|
||||||
key.
|
key.
|
||||||
|
|
||||||
\fBNOTE:\fP If the crypto device cannot be loaded,
|
If the crypto device cannot be loaded, \fICURLE_SSL_ENGINE_NOTFOUND\fP is
|
||||||
\fICURLE_SSL_ENGINE_NOTFOUND\fP is returned.
|
returned.
|
||||||
.IP CURLOPT_SSLENGINE_DEFAULT
|
.IP CURLOPT_SSLENGINE_DEFAULT
|
||||||
Sets the actual crypto engine as the default for (asymmetric) crypto
|
Sets the actual crypto engine as the default for (asymmetric) crypto
|
||||||
operations.
|
operations.
|
||||||
|
|
||||||
\fBNOTE:\fP If the crypto device cannot be set,
|
If the crypto device cannot be set, \fICURLE_SSL_ENGINE_SETFAILED\fP is
|
||||||
\fICURLE_SSL_ENGINE_SETFAILED\fP is returned.
|
returned.
|
||||||
.IP CURLOPT_SSLVERSION
|
.IP CURLOPT_SSLVERSION
|
||||||
Pass a long as parameter to control what version of SSL/TLS to attempt to use.
|
Pass a long as parameter to control what version of SSL/TLS to attempt to use.
|
||||||
The available options are:
|
The available options are:
|
||||||
@@ -1104,26 +1133,25 @@ socket. It will be used to seed the random engine for SSL.
|
|||||||
.IP CURLOPT_SSL_VERIFYHOST
|
.IP CURLOPT_SSL_VERIFYHOST
|
||||||
Pass a long as parameter.
|
Pass a long as parameter.
|
||||||
|
|
||||||
This option determines whether curl verifies that the server claims to be
|
This option determines whether libcurl verifies that the server cert is for
|
||||||
who you want it to be.
|
the server it is known as.
|
||||||
|
|
||||||
When negotiating an SSL connection, the server sends a certificate
|
When negotiating an SSL connection, the server sends a certificate indicating
|
||||||
indicating its identity.
|
its identity.
|
||||||
|
|
||||||
When \fICURLOPT_SSL_VERIFYHOST\fP is 2, that certificate must indicate
|
When \fICURLOPT_SSL_VERIFYHOST\fP is 2, that certificate must indicate that
|
||||||
that the server is the server to which you meant to connect, or the
|
the server is the server to which you meant to connect, or the connection
|
||||||
connection fails.
|
fails.
|
||||||
|
|
||||||
Curl considers the server the intended one when the Common Name field
|
Curl considers the server the intended one when the Common Name field or a
|
||||||
or a Subject Alternate Name field in the certificate matches the host
|
Subject Alternate Name field in the certificate matches the host name in the
|
||||||
name in the URL to which you told Curl to connect.
|
URL to which you told Curl to connect.
|
||||||
|
|
||||||
When the value is 1, the certificate must contain a Common Name field,
|
When the value is 1, the certificate must contain a Common Name field, but it
|
||||||
but it doesn't matter what name it says. (This is not ordinarily a
|
doesn't matter what name it says. (This is not ordinarily a useful setting).
|
||||||
useful setting).
|
|
||||||
|
|
||||||
When the value is 0, the connection succeeds regardless of the names in
|
When the value is 0, the connection succeeds regardless of the names in the
|
||||||
the certificate.
|
certificate.
|
||||||
|
|
||||||
The default, since 7.10, is 2.
|
The default, since 7.10, is 2.
|
||||||
|
|
||||||
|
@@ -23,4 +23,4 @@ You must curl_free() the returned string when you're done with it.
|
|||||||
.SH RETURN VALUE
|
.SH RETURN VALUE
|
||||||
A pointer to a zero terminated string or NULL if it failed.
|
A pointer to a zero terminated string or NULL if it failed.
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
.BR curl_unescape(3), curl_free(3), RFC 2396
|
.BR curl_unescape "(3), " curl_free "(3), " RFC 2396
|
||||||
|
@@ -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
|
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
|
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
|
you intend to make another transfer. libcurl will then attempt to re-use the
|
||||||
previous
|
previous connection.
|
||||||
|
|
||||||
.SH "Multi-threading Issues"
|
.SH "Multi-threading Issues"
|
||||||
The first basic rule is that you must \fBnever\fP share a libcurl handle (be
|
The first basic rule is that you must \fBnever\fP share a libcurl handle (be
|
||||||
|
20
hiper/Makefile
Normal file
20
hiper/Makefile
Normal 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
34
hiper/collecturls.pl
Executable 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
377
hiper/hiper.c
Normal 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;
|
||||||
|
}
|
@@ -309,6 +309,13 @@ typedef enum {
|
|||||||
CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */
|
CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */
|
||||||
CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not
|
CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not
|
||||||
accepted and we failed to login */
|
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! */
|
CURL_LAST /* never use! */
|
||||||
} CURLcode;
|
} CURLcode;
|
||||||
|
|
||||||
@@ -896,6 +903,15 @@ typedef enum {
|
|||||||
/* ignore Content-Length */
|
/* ignore Content-Length */
|
||||||
CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),
|
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 */
|
CURLOPT_LASTENTRY /* the last unused */
|
||||||
} CURLoption;
|
} CURLoption;
|
||||||
|
|
||||||
|
@@ -28,7 +28,13 @@
|
|||||||
|
|
||||||
/* This is the version number of the libcurl package from which this header
|
/* This is the version number of the libcurl package from which this header
|
||||||
file origins: */
|
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
|
/* This is the numeric version of the libcurl version number, meant for easier
|
||||||
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
|
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
|
||||||
@@ -37,19 +43,14 @@
|
|||||||
0xXXYYZZ
|
0xXXYYZZ
|
||||||
|
|
||||||
Where XX, YY and ZZ are the main version, release and patch numbers in
|
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
|
hexadecimal (using 8 bits each). All three numbers are always represented
|
||||||
would appear as "0x010200" while version 9.11.7 appears as "0x090b07".
|
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
|
This 6-digit (24 bits) hexadecimal number does not show pre-release number,
|
||||||
always a greater number in a more recent release. It makes comparisons with
|
and it is always a greater number in a more recent release. It makes
|
||||||
greater than and less than work.
|
comparisons with greater than and less than work.
|
||||||
*/
|
*/
|
||||||
#define LIBCURL_VERSION_NUM 0x070e01
|
#define LIBCURL_VERSION_NUM 0x070f01
|
||||||
|
|
||||||
/* 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
|
|
||||||
|
|
||||||
#endif /* __CURL_CURLVER_H */
|
#endif /* __CURL_CURLVER_H */
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
#ifndef __CURL_MPRINTF_H
|
||||||
|
#define __CURL_MPRINTF_H
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* _ _ ____ _
|
* _ _ ____ _
|
||||||
* Project ___| | | | _ \| |
|
* Project ___| | | | _ \| |
|
||||||
@@ -21,9 +23,6 @@
|
|||||||
* $Id$
|
* $Id$
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#ifndef H_MPRINTF
|
|
||||||
#define H_MPRINTF
|
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h> /* needed for FILE */
|
#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
|
# define vaprintf curl_mvaprintf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* H_MPRINTF */
|
#endif /* __CURL_MPRINTF_H */
|
||||||
|
@@ -66,6 +66,15 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#endif
|
#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"
|
#include "curl.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@@ -8,10 +8,11 @@ TARGETS = libcurl_wc.lib libcurl_wc.dll libcurl_wc_imp.lib
|
|||||||
|
|
||||||
CC = wcc386
|
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") &
|
-d+ -dWIN32 -dHAVE_LONGLONG -dCURL_CA_BUNDLE=getenv("CURL_CA_BUNDLE") &
|
||||||
-dBUILDING_LIBCURL -dWITHOUT_MM_LIB -dHAVE_SPNEGO=1 -dENABLE_IPV6 &
|
-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
|
OBJ_DIR = Watcom_obj
|
||||||
LIB_ARG = $(OBJ_DIR)\wlib.arg
|
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)\hostip6.obj $(OBJ_DIR)\inet_ntop.obj &
|
||||||
$(OBJ_DIR)\hostsyn.obj $(OBJ_DIR)\parsedate.obj &
|
$(OBJ_DIR)\hostsyn.obj $(OBJ_DIR)\parsedate.obj &
|
||||||
$(OBJ_DIR)\select.obj $(OBJ_DIR)\sslgen.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
|
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 &
|
$(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 &
|
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
|
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
|
@@ -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 \
|
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 \
|
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 \
|
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 \
|
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 \
|
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 \
|
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 \
|
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 \
|
setup.h transfer.h select.h easyif.h multiif.h parsedate.h sslgen.h \
|
||||||
gtls.h
|
gtls.h tftp.h sockaddr.h
|
||||||
|
|
||||||
|
|
||||||
|
@@ -301,7 +301,7 @@ config.h: Makefile.netware
|
|||||||
@echo $(DL)*/$(DL) >> $@
|
@echo $(DL)*/$(DL) >> $@
|
||||||
@echo $(DL)#define OS "i586-pc-NetWare"$(DL) >> $@
|
@echo $(DL)#define OS "i586-pc-NetWare"$(DL) >> $@
|
||||||
@echo $(DL)#define VERSION "$(LIBCURL_VERSION_STR)"$(DL) >> $@
|
@echo $(DL)#define VERSION "$(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_ARPA_INET_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@
|
||||||
|
@@ -19,7 +19,6 @@
|
|||||||
# files in the "cfg" directory, but then the make file
|
# files in the "cfg" directory, but then the make file
|
||||||
# in \src would need to be changed.
|
# 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!
|
## Nothing more to do below this line!
|
||||||
|
|
||||||
CCNODBG = cl.exe /MD /O2 /DNDEBUG
|
CCNODBG = cl.exe /O2 /DNDEBUG
|
||||||
CCDEBUG = cl.exe /MDd /Od /Gm /Zi /D_DEBUG /GZ
|
CCDEBUG = cl.exe /Od /Gm /Zi /D_DEBUG /GZ
|
||||||
CFLAGSSSL = /DUSE_SSLEAY /I "$(OPENSSL_PATH)/inc32" /I "$(OPENSSL_PATH)/inc32/openssl"
|
CFLAGSSSL = /DUSE_SSLEAY /I "$(OPENSSL_PATH)/inc32" /I "$(OPENSSL_PATH)/inc32/openssl"
|
||||||
CFLAGSZLIB = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ /I "$(ZLIB_PATH)"
|
CFLAGSZLIB = /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ /I "$(ZLIB_PATH)"
|
||||||
CFLAGS = /I. /I../include /nologo /W3 /GX /DWIN32 /YX /FD /c /DBUILDING_LIBCURL
|
CFLAGS = /I. /I../include /nologo /W3 /GX /DWIN32 /YX /FD /c /DBUILDING_LIBCURL
|
||||||
@@ -90,9 +89,20 @@ CFGSET = FALSE
|
|||||||
|
|
||||||
!IFDEF WINDOWS_SSPI
|
!IFDEF WINDOWS_SSPI
|
||||||
CFLAGS = $(CFLAGS) /DUSE_WINDOWS_SSPI /I$(WINDOWS_SDK_PATH)\include
|
CFLAGS = $(CFLAGS) /DUSE_WINDOWS_SSPI /I$(WINDOWS_SDK_PATH)\include
|
||||||
LFLAGS = $(LFLAGS) $(WINDOWS_SDK_PATH)\lib\secur32.lib
|
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
|
##############################################################
|
||||||
|
# Runtime library configuration
|
||||||
|
|
||||||
|
RTLIB = /MD
|
||||||
|
RTLIBD = /MDd
|
||||||
|
|
||||||
|
!IF "$(RTLIBCFG)" == "static"
|
||||||
|
RTLIB = /MT
|
||||||
|
RTLIBD = /MTd
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
|
||||||
######################
|
######################
|
||||||
# release
|
# release
|
||||||
|
|
||||||
@@ -100,7 +110,7 @@ LFLAGS = $(LFLAGS) $(WINDOWS_SDK_PATH)\lib\secur32.lib
|
|||||||
TARGET = $(LIB_NAME).lib
|
TARGET = $(LIB_NAME).lib
|
||||||
DIROBJ = $(CFG)
|
DIROBJ = $(CFG)
|
||||||
LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET)
|
LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET)
|
||||||
CC = $(CCNODBG) $(CFLAGSLIB)
|
CC = $(CCNODBG) $(RTLIB) $(CFLAGSLIB)
|
||||||
CFGSET = TRUE
|
CFGSET = TRUE
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
@@ -112,7 +122,7 @@ TARGET = $(LIB_NAME).lib
|
|||||||
DIROBJ = $(CFG)
|
DIROBJ = $(CFG)
|
||||||
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
||||||
LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
||||||
CC = $(CCNODBG) $(CFLAGSZLIB) $(CFLAGSLIB)
|
CC = $(CCNODBG) $(RTLIB) $(CFLAGSZLIB) $(CFLAGSLIB)
|
||||||
CFGSET = TRUE
|
CFGSET = TRUE
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
@@ -122,7 +132,7 @@ CFGSET = TRUE
|
|||||||
!IF "$(CFG)" == "release-dll"
|
!IF "$(CFG)" == "release-dll"
|
||||||
TARGET = $(LIB_NAME).dll
|
TARGET = $(LIB_NAME).dll
|
||||||
DIROBJ = $(CFG)
|
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)
|
CC = $(CCNODBG)
|
||||||
CFGSET = TRUE
|
CFGSET = TRUE
|
||||||
RESOURCE = $(DIROBJ)\libcurl.res
|
RESOURCE = $(DIROBJ)\libcurl.res
|
||||||
@@ -136,7 +146,7 @@ TARGET = $(LIB_NAME).lib
|
|||||||
DIROBJ = $(CFG)
|
DIROBJ = $(CFG)
|
||||||
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32"
|
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32"
|
||||||
LNK = $(LNKLIB) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET)
|
LNK = $(LNKLIB) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET)
|
||||||
CC = $(CCNODBG) $(CFLAGSSSL) $(CFLAGSLIB)
|
CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSLIB)
|
||||||
CFGSET = TRUE
|
CFGSET = TRUE
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
@@ -148,7 +158,7 @@ TARGET = $(LIB_NAME).dll
|
|||||||
DIROBJ = $(CFG)
|
DIROBJ = $(CFG)
|
||||||
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"
|
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"
|
||||||
LNK = $(LNKDLL) $(WINLIBS) /out:$(DIROBJ)\$(TARGET) $(SSLLIBS) $(LFLAGSSSL) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME).lib
|
LNK = $(LNKDLL) $(WINLIBS) /out:$(DIROBJ)\$(TARGET) $(SSLLIBS) $(LFLAGSSSL) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME).lib
|
||||||
CC = $(CCNODBG) $(CFLAGSSSL)
|
CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL)
|
||||||
CFGSET = TRUE
|
CFGSET = TRUE
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
@@ -161,7 +171,7 @@ DIROBJ = $(CFG)
|
|||||||
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32"
|
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32"
|
||||||
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
||||||
LNK = $(LNKLIB) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
LNK = $(LNKLIB) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
||||||
CC = $(CCNODBG) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB)
|
CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB)
|
||||||
CFGSET = TRUE
|
CFGSET = TRUE
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
@@ -173,7 +183,7 @@ TARGET = $(LIB_NAME).dll
|
|||||||
DIROBJ = $(CFG)
|
DIROBJ = $(CFG)
|
||||||
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"
|
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"
|
||||||
LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME).lib
|
LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME).lib
|
||||||
CC = $(CCNODBG) $(CFLAGSSSL)
|
CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL)
|
||||||
CFGSET = TRUE
|
CFGSET = TRUE
|
||||||
RESOURCE = $(DIROBJ)\libcurl.res
|
RESOURCE = $(DIROBJ)\libcurl.res
|
||||||
!ENDIF
|
!ENDIF
|
||||||
@@ -186,7 +196,7 @@ TARGET = $(LIB_NAME).lib
|
|||||||
DIROBJ = $(CFG)
|
DIROBJ = $(CFG)
|
||||||
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
||||||
LNK = $(LNKLIB) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
LNK = $(LNKLIB) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
||||||
CC = $(CCNODBG) $(CFLAGSZLIB) $(CFLAGSLIB)
|
CC = $(CCNODBG) $(RTLIB) $(CFLAGSZLIB) $(CFLAGSLIB)
|
||||||
CFGSET = TRUE
|
CFGSET = TRUE
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
@@ -199,7 +209,7 @@ DIROBJ = $(CFG)
|
|||||||
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
||||||
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"
|
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"
|
||||||
LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
||||||
CC = $(CCNODBG) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB)
|
CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB)
|
||||||
CFGSET = TRUE
|
CFGSET = TRUE
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
@@ -211,7 +221,7 @@ TARGET = $(LIB_NAME).dll
|
|||||||
DIROBJ = $(CFG)
|
DIROBJ = $(CFG)
|
||||||
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
||||||
LNK = $(LNKDLL) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME).lib
|
LNK = $(LNKDLL) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME).lib
|
||||||
CC = $(CCNODBG) $(CFLAGSZLIB)
|
CC = $(CCNODBG) $(RTLIB) $(CFLAGSZLIB)
|
||||||
CFGSET = TRUE
|
CFGSET = TRUE
|
||||||
RESOURCE = $(DIROBJ)\libcurl.res
|
RESOURCE = $(DIROBJ)\libcurl.res
|
||||||
!ENDIF
|
!ENDIF
|
||||||
@@ -225,7 +235,7 @@ DIROBJ = $(CFG)
|
|||||||
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
||||||
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"
|
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"
|
||||||
LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME).lib
|
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
|
CFGSET = TRUE
|
||||||
RESOURCE = $(DIROBJ)\libcurl.res
|
RESOURCE = $(DIROBJ)\libcurl.res
|
||||||
!ENDIF
|
!ENDIF
|
||||||
@@ -237,7 +247,7 @@ RESOURCE = $(DIROBJ)\libcurl.res
|
|||||||
TARGET = $(LIB_NAME_DEBUG).lib
|
TARGET = $(LIB_NAME_DEBUG).lib
|
||||||
DIROBJ = $(CFG)
|
DIROBJ = $(CFG)
|
||||||
LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET)
|
LNK = $(LNKLIB) /out:$(DIROBJ)\$(TARGET)
|
||||||
CC = $(CCDEBUG) $(CFLAGSLIB)
|
CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSLIB)
|
||||||
CFGSET = TRUE
|
CFGSET = TRUE
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
@@ -248,8 +258,8 @@ CFGSET = TRUE
|
|||||||
TARGET = $(LIB_NAME_DEBUG).lib
|
TARGET = $(LIB_NAME_DEBUG).lib
|
||||||
DIROBJ = $(CFG)
|
DIROBJ = $(CFG)
|
||||||
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32"
|
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32"
|
||||||
LNK = $(LNKLIB) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET)
|
LNK = $(LNKLIB) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET)
|
||||||
CC = $(CCDEBUG) $(CFLAGSSSL) $(CFLAGSLIB)
|
CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSLIB)
|
||||||
CFGSET = TRUE
|
CFGSET = TRUE
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
@@ -261,7 +271,7 @@ TARGET = $(LIB_NAME_DEBUG).lib
|
|||||||
DIROBJ = $(CFG)
|
DIROBJ = $(CFG)
|
||||||
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
||||||
LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
||||||
CC = $(CCDEBUG) $(CFLAGSZLIB) $(CFLAGSLIB)
|
CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSZLIB) $(CFLAGSLIB)
|
||||||
CFGSET = TRUE
|
CFGSET = TRUE
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
@@ -273,7 +283,7 @@ TARGET = $(LIB_NAME_DEBUG).lib
|
|||||||
DIROBJ = $(CFG)
|
DIROBJ = $(CFG)
|
||||||
LFLAGSSSL = /LIBPATH:$(OPENSSL_PATH)\out32dll
|
LFLAGSSSL = /LIBPATH:$(OPENSSL_PATH)\out32dll
|
||||||
LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET)
|
LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(LFLAGSSSL) /out:$(DIROBJ)\$(TARGET)
|
||||||
CC = $(CCDEBUG) $(CFLAGSSSL) $(CFLAGSLIB)
|
CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSLIB)
|
||||||
CFGSET = TRUE
|
CFGSET = TRUE
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
@@ -285,8 +295,8 @@ TARGET = $(LIB_NAME_DEBUG).lib
|
|||||||
DIROBJ = $(CFG)
|
DIROBJ = $(CFG)
|
||||||
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
||||||
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32"
|
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32"
|
||||||
LNK = $(LNKLIB) $(SSLLIBS) $(ZLIBLIBS) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
LNK = $(LNKLIB) $(ZLIBLIBS) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
||||||
CC = $(CCDEBUG) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB)
|
CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB)
|
||||||
CFGSET = TRUE
|
CFGSET = TRUE
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
@@ -298,7 +308,7 @@ TARGET = $(LIB_NAME_DEBUG).lib
|
|||||||
DIROBJ = $(CFG)
|
DIROBJ = $(CFG)
|
||||||
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
||||||
LNK = $(LNKLIB) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
LNK = $(LNKLIB) $(WINLIBS) $(ZLIBLIBSDLL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
||||||
CC = $(CCDEBUG) $(CFLAGSZLIB) $(CFLAGSLIB)
|
CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSZLIB) $(CFLAGSLIB)
|
||||||
CFGSET = TRUE
|
CFGSET = TRUE
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
@@ -311,7 +321,7 @@ DIROBJ = $(CFG)
|
|||||||
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
||||||
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"
|
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"
|
||||||
LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBSDLL) $(LFLAGSSSL) $(LFLAGSZLIB) /out:$(DIROBJ)\$(TARGET)
|
||||||
CC = $(CCDEBUG) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB)
|
CC = $(CCDEBUG) $(RTLIBD) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB)
|
||||||
CFGSET = TRUE
|
CFGSET = TRUE
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
@@ -322,7 +332,7 @@ CFGSET = TRUE
|
|||||||
TARGET = $(LIB_NAME_DEBUG).dll
|
TARGET = $(LIB_NAME_DEBUG).dll
|
||||||
DIROBJ = $(CFG)
|
DIROBJ = $(CFG)
|
||||||
LNK = $(LNKDLL) $(WINLIBS) /DEBUG /out:$(DIROBJ)\$(TARGET) /IMPLIB:$(DIROBJ)\$(IMPLIB_NAME_DEBUG).lib /PDB:$(DIROBJ)\$(IMPLIB_NAME_DEBUG).pdb
|
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
|
CFGSET = TRUE
|
||||||
RESOURCE = $(DIROBJ)\libcurl.res
|
RESOURCE = $(DIROBJ)\libcurl.res
|
||||||
!ENDIF
|
!ENDIF
|
||||||
@@ -335,7 +345,7 @@ TARGET = $(LIB_NAME_DEBUG).dll
|
|||||||
DIROBJ = $(CFG)
|
DIROBJ = $(CFG)
|
||||||
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"
|
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
|
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
|
CFGSET = TRUE
|
||||||
RESOURCE = $(DIROBJ)\libcurl.res
|
RESOURCE = $(DIROBJ)\libcurl.res
|
||||||
!ENDIF
|
!ENDIF
|
||||||
@@ -348,7 +358,7 @@ TARGET = $(LIB_NAME_DEBUG).dll
|
|||||||
DIROBJ = $(CFG)
|
DIROBJ = $(CFG)
|
||||||
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
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
|
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
|
CFGSET = TRUE
|
||||||
RESOURCE = $(DIROBJ)\libcurl.res
|
RESOURCE = $(DIROBJ)\libcurl.res
|
||||||
!ENDIF
|
!ENDIF
|
||||||
@@ -362,7 +372,7 @@ DIROBJ = $(CFG)
|
|||||||
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)"
|
||||||
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll"
|
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
|
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
|
CFGSET = TRUE
|
||||||
RESOURCE = $(DIROBJ)\libcurl.res
|
RESOURCE = $(DIROBJ)\libcurl.res
|
||||||
!ENDIF
|
!ENDIF
|
||||||
@@ -469,6 +479,7 @@ X_OBJS= \
|
|||||||
$(DIROBJ)\strerror.obj \
|
$(DIROBJ)\strerror.obj \
|
||||||
$(DIROBJ)\select.obj \
|
$(DIROBJ)\select.obj \
|
||||||
$(DIROBJ)\content_encoding.obj \
|
$(DIROBJ)\content_encoding.obj \
|
||||||
|
$(DIROBJ)\tftp.obj \
|
||||||
$(RESOURCE)
|
$(RESOURCE)
|
||||||
|
|
||||||
all : $(TARGET)
|
all : $(TARGET)
|
||||||
|
@@ -27,7 +27,10 @@
|
|||||||
/* #undef size_t */
|
/* #undef size_t */
|
||||||
|
|
||||||
/* Define this to 'int' if ssize_t is not an available typedefed type */
|
/* Define this to 'int' if ssize_t is not an available typedefed type */
|
||||||
|
#if defined(__WATCOMC__) && (__WATCOMC__ >= 1240)
|
||||||
|
#else
|
||||||
#define ssize_t int
|
#define ssize_t int
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Define this to 'int' if socklen_t is not an available typedefed type */
|
/* Define this to 'int' if socklen_t is not an available typedefed type */
|
||||||
#if !defined(ENABLE_IPV6) && ((_MSC_VER < 1300) || !defined(USE_SSLEAY))
|
#if !defined(ENABLE_IPV6) && ((_MSC_VER < 1300) || !defined(USE_SSLEAY))
|
||||||
@@ -232,6 +235,9 @@
|
|||||||
/* use ioctlsocket() for non-blocking sockets */
|
/* use ioctlsocket() for non-blocking sockets */
|
||||||
#define HAVE_IOCTLSOCKET
|
#define HAVE_IOCTLSOCKET
|
||||||
|
|
||||||
|
/* Define this if you have struct sockaddr_storage */
|
||||||
|
#define HAVE_STRUCT_SOCKADDR_STORAGE
|
||||||
|
|
||||||
/* lber dynamic library file */
|
/* lber dynamic library file */
|
||||||
/* #undef DL_LBER_FILE */
|
/* #undef DL_LBER_FILE */
|
||||||
|
|
||||||
|
@@ -472,6 +472,9 @@ static bool trynextip(struct connectdata *conn,
|
|||||||
if(sockindex != FIRSTSOCKET)
|
if(sockindex != FIRSTSOCKET)
|
||||||
return TRUE; /* no next */
|
return TRUE; /* no next */
|
||||||
|
|
||||||
|
/* first close the failed socket */
|
||||||
|
sclose(conn->sock[sockindex]);
|
||||||
|
|
||||||
/* try the next address */
|
/* try the next address */
|
||||||
ai = conn->ip_addr->ai_next;
|
ai = conn->ip_addr->ai_next;
|
||||||
|
|
||||||
@@ -631,8 +634,9 @@ singleipconnect(struct connectdata *conn,
|
|||||||
int error;
|
int error;
|
||||||
bool conected;
|
bool conected;
|
||||||
struct SessionHandle *data = conn->data;
|
struct SessionHandle *data = conn->data;
|
||||||
curl_socket_t sockfd = socket(ai->ai_family, ai->ai_socktype,
|
curl_socket_t sockfd;
|
||||||
ai->ai_protocol);
|
|
||||||
|
sockfd = socket(ai->ai_family, conn->socktype, ai->ai_protocol);
|
||||||
if (sockfd == CURL_SOCKET_BAD)
|
if (sockfd == CURL_SOCKET_BAD)
|
||||||
return CURL_SOCKET_BAD;
|
return CURL_SOCKET_BAD;
|
||||||
|
|
||||||
@@ -660,7 +664,11 @@ singleipconnect(struct connectdata *conn,
|
|||||||
/* set socket non-blocking */
|
/* set socket non-blocking */
|
||||||
Curl_nonblock(sockfd, TRUE);
|
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);
|
rc = connect(sockfd, ai->ai_addr, (socklen_t)ai->ai_addrlen);
|
||||||
|
else
|
||||||
|
rc = 0;
|
||||||
|
|
||||||
if(-1 == rc) {
|
if(-1 == rc) {
|
||||||
error = Curl_ourerrno();
|
error = Curl_ourerrno();
|
||||||
|
@@ -158,12 +158,12 @@ CURLcode Curl_file_connect(struct connectdata *conn)
|
|||||||
#endif
|
#endif
|
||||||
file->freepath = real_path; /* free this when done */
|
file->freepath = real_path; /* free this when done */
|
||||||
|
|
||||||
|
file->fd = fd;
|
||||||
if(!conn->data->set.upload && (fd == -1)) {
|
if(!conn->data->set.upload && (fd == -1)) {
|
||||||
failf(conn->data, "Couldn't open file %s", conn->path);
|
failf(conn->data, "Couldn't open file %s", conn->path);
|
||||||
Curl_file_done(conn, CURLE_FILE_COULDNT_READ_FILE);
|
Curl_file_done(conn, CURLE_FILE_COULDNT_READ_FILE);
|
||||||
return CURLE_FILE_COULDNT_READ_FILE;
|
return CURLE_FILE_COULDNT_READ_FILE;
|
||||||
}
|
}
|
||||||
file->fd = fd;
|
|
||||||
|
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
@@ -105,7 +105,7 @@ Content-Disposition: form-data; name="FILECONTENT"
|
|||||||
/* Length of the random boundary string. */
|
/* Length of the random boundary string. */
|
||||||
#define BOUNDARY_LENGTH 40
|
#define BOUNDARY_LENGTH 40
|
||||||
|
|
||||||
#ifndef CURL_DISABLE_HTTP
|
#if !defined(CURL_DISABLE_HTTP) || defined(USE_SSLEAY)
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -128,6 +128,10 @@ Content-Disposition: form-data; name="FILECONTENT"
|
|||||||
/* The last #include file should be: */
|
/* The last #include file should be: */
|
||||||
#include "memdebug.h"
|
#include "memdebug.h"
|
||||||
|
|
||||||
|
#endif /* !defined(CURL_DISABLE_HTTP) || defined(USE_SSLEAY) */
|
||||||
|
|
||||||
|
#ifndef CURL_DISABLE_HTTP
|
||||||
|
|
||||||
#if defined(HAVE_BASENAME) && defined(NEED_BASENAME_PROTO)
|
#if defined(HAVE_BASENAME) && defined(NEED_BASENAME_PROTO)
|
||||||
/* This system has a basename() but no prototype for it! */
|
/* This system has a basename() but no prototype for it! */
|
||||||
char *basename(char *path);
|
char *basename(char *path);
|
||||||
@@ -1511,7 +1515,7 @@ int main()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif /* _FORM_DEBUG */
|
||||||
|
|
||||||
#else /* CURL_DISABLE_HTTP */
|
#else /* CURL_DISABLE_HTTP */
|
||||||
CURLFORMcode curl_formadd(struct curl_httppost **httppost,
|
CURLFORMcode curl_formadd(struct curl_httppost **httppost,
|
||||||
@@ -1531,6 +1535,8 @@ void curl_formfree(struct curl_httppost *form)
|
|||||||
|
|
||||||
#endif /* CURL_DISABLE_HTTP */
|
#endif /* CURL_DISABLE_HTTP */
|
||||||
|
|
||||||
|
#if !defined(CURL_DISABLE_HTTP) || defined(USE_SSLEAY)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Curl_FormBoundary() creates a suitable boundary string and returns an
|
* 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
|
* 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;
|
return retstring;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* !defined(CURL_DISABLE_HTTP) || defined(USE_SSLEAY) */
|
||||||
|
105
lib/ftp.c
105
lib/ftp.c
@@ -94,6 +94,7 @@
|
|||||||
#include "inet_ntop.h"
|
#include "inet_ntop.h"
|
||||||
#include "select.h"
|
#include "select.h"
|
||||||
#include "parsedate.h" /* for the week day and month names */
|
#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)
|
#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL)
|
||||||
#include "inet_ntoa_r.h"
|
#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
|
* to us. This function will sit and wait here until the server has
|
||||||
* connected.
|
* 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)
|
static CURLcode AllowServerConnect(struct connectdata *conn)
|
||||||
{
|
{
|
||||||
CURLcode result;
|
|
||||||
int timeout_ms;
|
int timeout_ms;
|
||||||
struct SessionHandle *data = conn->data;
|
struct SessionHandle *data = conn->data;
|
||||||
curl_socket_t sock = conn->sock[SECONDARYSOCKET];
|
curl_socket_t sock = conn->sock[SECONDARYSOCKET];
|
||||||
@@ -235,17 +232,6 @@ static CURLcode AllowServerConnect(struct connectdata *conn)
|
|||||||
break;
|
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;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -792,11 +778,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
|
|||||||
/******************************************************************
|
/******************************************************************
|
||||||
* IPv6-specific section
|
* IPv6-specific section
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_STRUCT_SOCKADDR_STORAGE
|
struct Curl_sockaddr_storage ss;
|
||||||
struct sockaddr_storage ss;
|
|
||||||
#else
|
|
||||||
char ss[256]; /* this should be big enough to fit a lot */
|
|
||||||
#endif
|
|
||||||
struct addrinfo *res, *ai;
|
struct addrinfo *res, *ai;
|
||||||
socklen_t sslen;
|
socklen_t sslen;
|
||||||
char hbuf[NI_MAXHOST];
|
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):
|
* Workaround for AIX5 getaddrinfo() problem (it doesn't set ai_socktype):
|
||||||
*/
|
*/
|
||||||
if (ai->ai_socktype == 0)
|
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);
|
portsock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
|
||||||
if (portsock == CURL_SOCKET_BAD) {
|
if (portsock == CURL_SOCKET_BAD) {
|
||||||
@@ -1601,6 +1583,16 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
|
|||||||
return CURLE_FTP_WEIRD_227_FORMAT;
|
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),
|
snprintf(newhost, sizeof(newhost),
|
||||||
"%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
|
"%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
|
||||||
newport = (port[0]<<8) + port[1];
|
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;
|
return CURLE_FTP_WEIRD_PASV_REPLY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we got OK from server */
|
|
||||||
|
|
||||||
if(data->change.proxy && *data->change.proxy) {
|
if(data->change.proxy && *data->change.proxy) {
|
||||||
/*
|
/*
|
||||||
* This is a tunnel through a http proxy and we need to connect to the
|
* 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) {
|
switch(data->set.timecondition) {
|
||||||
case CURL_TIMECOND_IFMODSINCE:
|
case CURL_TIMECOND_IFMODSINCE:
|
||||||
default:
|
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");
|
infof(data, "The requested document is not new enough\n");
|
||||||
ftp->no_transfer = TRUE; /* mark this to not transfer data */
|
ftp->no_transfer = TRUE; /* mark this to not transfer data */
|
||||||
state(conn, FTP_STOP);
|
state(conn, FTP_STOP);
|
||||||
@@ -2032,6 +2022,16 @@ static CURLcode ftp_state_stor_resp(struct connectdata *conn,
|
|||||||
return result;
|
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;
|
*(ftp->bytecountp)=0;
|
||||||
|
|
||||||
/* When we know we're uploading a specified file, we can get the file
|
/* 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;
|
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)
|
if(size > conn->maxdownload && conn->maxdownload > 0)
|
||||||
size = conn->size = conn->maxdownload;
|
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]);
|
NBFTPSENDF(conn, "MKD %s", ftp->dirs[ftp->count1 - 1]);
|
||||||
state(conn, FTP_MKD);
|
state(conn, FTP_MKD);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
/* return failure */
|
/* return failure */
|
||||||
|
failf(data, "Server denied you to change to the given directory");
|
||||||
return CURLE_FTP_ACCESS_DENIED;
|
return CURLE_FTP_ACCESS_DENIED;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
/* success */
|
/* success */
|
||||||
ftp->count2=0;
|
ftp->count2=0;
|
||||||
@@ -3092,18 +3103,6 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
|
|||||||
if(!ftp->no_transfer && !conn->bits.no_body) {
|
if(!ftp->no_transfer && !conn->bits.no_body) {
|
||||||
/* a transfer is about to take place */
|
/* 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) {
|
if(data->set.upload) {
|
||||||
NBFTPSENDF(conn, "TYPE %c", data->set.ftp_ascii?'A':'I');
|
NBFTPSENDF(conn, "TYPE %c", data->set.ftp_ascii?'A':'I');
|
||||||
state(conn, FTP_STOR_TYPE);
|
state(conn, FTP_STOR_TYPE);
|
||||||
@@ -3643,8 +3642,6 @@ static CURLcode ftp_3rdparty_transfer(struct connectdata *conn)
|
|||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* ftp_parse_url_path()
|
* ftp_parse_url_path()
|
||||||
@@ -3668,6 +3665,34 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
|
|||||||
ftp = conn->proto.ftp;
|
ftp = conn->proto.ftp;
|
||||||
ftp->ctl_valid = FALSE;
|
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->dirdepth = 0;
|
||||||
ftp->diralloc = 5; /* default dir depth to allocate */
|
ftp->diralloc = 5; /* default dir depth to allocate */
|
||||||
ftp->dirs = (char **)calloc(ftp->diralloc, sizeof(ftp->dirs[0]));
|
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 */
|
ftp->file = cur_pos; /* the rest is the file name */
|
||||||
|
}
|
||||||
|
|
||||||
if(*ftp->file) {
|
if(*ftp->file) {
|
||||||
ftp->file = curl_unescape(ftp->file, 0);
|
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 */
|
/* Failure detected, close the second socket if it was created already */
|
||||||
sclose(conn->sock[SECONDARYSOCKET]);
|
sclose(conn->sock[SECONDARYSOCKET]);
|
||||||
conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD;
|
conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD;
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ftp->no_transfer)
|
if(ftp->no_transfer)
|
||||||
|
160
lib/gtls.c
160
lib/gtls.c
@@ -110,6 +110,84 @@ static void showtime(struct SessionHandle *data,
|
|||||||
infof(data, "%s", data->state.buffer);
|
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
|
* This function is called after the TCP connect has completed. Setup the TLS
|
||||||
* layer and do all necessary magic.
|
* layer and do all necessary magic.
|
||||||
@@ -187,7 +265,17 @@ Curl_gtls_connect(struct connectdata *conn,
|
|||||||
if(rc < 0)
|
if(rc < 0)
|
||||||
return CURLE_SSL_CONNECT_ERROR;
|
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,
|
rc = gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE,
|
||||||
conn->ssl[sockindex].cred);
|
conn->ssl[sockindex].cred);
|
||||||
|
|
||||||
@@ -206,61 +294,10 @@ Curl_gtls_connect(struct connectdata *conn,
|
|||||||
infof (data, "SSL re-using session ID\n");
|
infof (data, "SSL re-using session ID\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
do {
|
rc = handshake(conn, session, sockindex, TRUE);
|
||||||
rc = gnutls_handshake(session);
|
if(rc)
|
||||||
|
/* handshake() sets its own error message with failf() */
|
||||||
if((rc == GNUTLS_E_AGAIN) || (rc == GNUTLS_E_INTERRUPTED)) {
|
return rc;
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This function will return the peer's raw certificate (chain) as sent by
|
/* This function will return the peer's raw certificate (chain) as sent by
|
||||||
the peer. These certificates are in raw format (DER encoded for
|
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;
|
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;
|
*wouldblock = FALSE;
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
failf(conn->data, "Peer closed the TLS connection");
|
failf(conn->data, "Peer closed the TLS connection");
|
||||||
|
@@ -423,7 +423,11 @@ Curl_addrinfo *Curl_he2ai(struct hostent *he, int port)
|
|||||||
prevai->ai_next = ai;
|
prevai->ai_next = ai;
|
||||||
|
|
||||||
ai->ai_family = AF_INET; /* we only support this */
|
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);
|
ai->ai_addrlen = sizeof(struct sockaddr_in);
|
||||||
/* make the ai_addr point to the address immediately following this struct
|
/* make the ai_addr point to the address immediately following this struct
|
||||||
and use that area to store the address */
|
and use that area to store the address */
|
||||||
|
@@ -73,6 +73,7 @@
|
|||||||
#include "strerror.h"
|
#include "strerror.h"
|
||||||
#include "url.h"
|
#include "url.h"
|
||||||
#include "inet_pton.h"
|
#include "inet_pton.h"
|
||||||
|
#include "connect.h"
|
||||||
|
|
||||||
#define _MPRINTF_REPLACE /* use our functions only */
|
#define _MPRINTF_REPLACE /* use our functions only */
|
||||||
#include <curl/mprintf.h>
|
#include <curl/mprintf.h>
|
||||||
@@ -186,6 +187,26 @@ bool Curl_ipvalid(struct SessionHandle *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef USE_THREADING_GETADDRINFO
|
#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).
|
* Curl_getaddrinfo() when built ipv6-enabled (non-threading version).
|
||||||
*
|
*
|
||||||
@@ -202,11 +223,11 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
|
|||||||
struct addrinfo hints, *res;
|
struct addrinfo hints, *res;
|
||||||
int error;
|
int error;
|
||||||
char sbuf[NI_MAXSERV];
|
char sbuf[NI_MAXSERV];
|
||||||
|
char *sbufptr = NULL;
|
||||||
char addrbuf[128];
|
char addrbuf[128];
|
||||||
curl_socket_t s;
|
curl_socket_t s;
|
||||||
int pf;
|
int pf;
|
||||||
struct SessionHandle *data = conn->data;
|
struct SessionHandle *data = conn->data;
|
||||||
int ai_flags;
|
|
||||||
|
|
||||||
*waitp=0; /* don't wait, we have the response now */
|
*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)) ||
|
if((1 == Curl_inet_pton(AF_INET, hostname, addrbuf)) ||
|
||||||
(1 == Curl_inet_pton(AF_INET6, hostname, addrbuf))) {
|
(1 == Curl_inet_pton(AF_INET6, hostname, addrbuf))) {
|
||||||
/* the given address is numerical only, prevent a reverse lookup */
|
/* 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
|
else
|
||||||
ai_flags = AI_CANONNAME;
|
hints.ai_flags = AI_CANONNAME;
|
||||||
|
#endif
|
||||||
|
|
||||||
memset(&hints, 0, sizeof(hints));
|
if(port) {
|
||||||
hints.ai_family = pf;
|
|
||||||
hints.ai_socktype = SOCK_STREAM;
|
|
||||||
hints.ai_flags = ai_flags;
|
|
||||||
snprintf(sbuf, sizeof(sbuf), "%d", port);
|
snprintf(sbuf, sizeof(sbuf), "%d", port);
|
||||||
error = getaddrinfo(hostname, sbuf, &hints, &res);
|
sbufptr=sbuf;
|
||||||
|
}
|
||||||
|
error = getaddrinfo(hostname, sbufptr, &hints, &res);
|
||||||
if (error) {
|
if (error) {
|
||||||
infof(data, "getaddrinfo(3) failed for %s:%d\n", hostname, port);
|
infof(data, "getaddrinfo(3) failed for %s:%d\n", hostname, port);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dump_addrinfo(conn, res);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
#endif /* USE_THREADING_GETADDRINFO */
|
#endif /* USE_THREADING_GETADDRINFO */
|
||||||
|
@@ -88,6 +88,10 @@
|
|||||||
/* The last #include file should be: */
|
/* The last #include file should be: */
|
||||||
#include "memdebug.h"
|
#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
|
* Only for Windows threaded name resolves builds
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
@@ -177,6 +181,7 @@ struct thread_sync_data {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Destroy resolver thread synchronization data */
|
/* Destroy resolver thread synchronization data */
|
||||||
|
static
|
||||||
void destroy_thread_sync_data(struct thread_sync_data * tsd)
|
void destroy_thread_sync_data(struct thread_sync_data * tsd)
|
||||||
{
|
{
|
||||||
if (tsd->hostname) {
|
if (tsd->hostname) {
|
||||||
@@ -198,6 +203,7 @@ void destroy_thread_sync_data(struct thread_sync_data * tsd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize resolver thread synchronization data */
|
/* Initialize resolver thread synchronization data */
|
||||||
|
static
|
||||||
BOOL init_thread_sync_data(struct thread_data * td,
|
BOOL init_thread_sync_data(struct thread_data * td,
|
||||||
char * hostname,
|
char * hostname,
|
||||||
struct thread_sync_data * tsd)
|
struct thread_sync_data * tsd)
|
||||||
@@ -239,6 +245,7 @@ BOOL init_thread_sync_data(struct thread_data * td,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* acquire resolver thread synchronization */
|
/* acquire resolver thread synchronization */
|
||||||
|
static
|
||||||
BOOL acquire_thread_sync(struct thread_sync_data * tsd)
|
BOOL acquire_thread_sync(struct thread_sync_data * tsd)
|
||||||
{
|
{
|
||||||
/* is the thread initiator still waiting for us ? */
|
/* 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 */
|
/* release resolver thread synchronization */
|
||||||
|
static
|
||||||
void release_thread_sync(struct thread_sync_data * tsd)
|
void release_thread_sync(struct thread_sync_data * tsd)
|
||||||
{
|
{
|
||||||
ReleaseMutex(tsd->mutex_terminate);
|
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
|
* This allows us to use it even after the container gets destroyed
|
||||||
* due to a resolver timeout.
|
* 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)) {
|
if (!init_thread_sync_data(td, conn->async.hostname, &tsd)) {
|
||||||
/* thread synchronization data initialization failed */
|
/* thread synchronization data initialization failed */
|
||||||
return -1;
|
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
|
* This allows us to use it even after the container gets destroyed
|
||||||
* due to a resolver timeout.
|
* 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)) {
|
if (!init_thread_sync_data(td, conn->async.hostname, &tsd)) {
|
||||||
/* thread synchronization data initialization failed */
|
/* thread synchronization data initialization failed */
|
||||||
return -1;
|
return -1;
|
||||||
@@ -559,7 +567,10 @@ static bool init_resolve_thread (struct connectdata *conn,
|
|||||||
*/
|
*/
|
||||||
thread_and_event[0] = td->thread_hnd;
|
thread_and_event[0] = td->thread_hnd;
|
||||||
thread_and_event[1] = td->event_thread_started;
|
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,
|
/* The resolver thread has been created,
|
||||||
* most probably it works now - ignoring this "minor" error
|
* 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;
|
rc = CURLE_OUT_OF_MEMORY;
|
||||||
failf(data, "Could not resolve host: %s", curl_easy_strerror(rc));
|
failf(data, "Could not resolve host: %s", curl_easy_strerror(rc));
|
||||||
}
|
}
|
||||||
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) {
|
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",
|
failf(data, "Could not resolve host: %s; %s",
|
||||||
conn->host.name, Curl_strerror(conn, conn->async.status));
|
conn->host.name, Curl_strerror(conn, conn->async.status));
|
||||||
rc = CURLE_COULDNT_RESOLVE_HOST;
|
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
|
else
|
||||||
rc = CURLE_OPERATION_TIMEDOUT;
|
rc = CURLE_OPERATION_TIMEDOUT;
|
||||||
}
|
}
|
||||||
@@ -804,8 +822,10 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
|
|||||||
|
|
||||||
memset(&hints, 0, sizeof(hints));
|
memset(&hints, 0, sizeof(hints));
|
||||||
hints.ai_family = pf;
|
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;
|
hints.ai_flags = AI_CANONNAME;
|
||||||
|
#endif
|
||||||
itoa(port, sbuf, 10);
|
itoa(port, sbuf, 10);
|
||||||
|
|
||||||
/* fire up a new resolver thread! */
|
/* fire up a new resolver thread! */
|
||||||
|
@@ -621,6 +621,10 @@ CURLcode Curl_http_input_auth(struct connectdata *conn,
|
|||||||
#endif
|
#endif
|
||||||
#ifndef CURL_DISABLE_CRYPTO_AUTH
|
#ifndef CURL_DISABLE_CRYPTO_AUTH
|
||||||
if(checkprefix("Digest", start)) {
|
if(checkprefix("Digest", start)) {
|
||||||
|
if((authp->avail & CURLAUTH_DIGEST) != 0) {
|
||||||
|
infof(data, "Ignoring duplicate digest auth header.\n");
|
||||||
|
}
|
||||||
|
else {
|
||||||
CURLdigest dig;
|
CURLdigest dig;
|
||||||
*availp |= CURLAUTH_DIGEST;
|
*availp |= CURLAUTH_DIGEST;
|
||||||
authp->avail |= CURLAUTH_DIGEST;
|
authp->avail |= CURLAUTH_DIGEST;
|
||||||
@@ -635,6 +639,7 @@ CURLcode Curl_http_input_auth(struct connectdata *conn,
|
|||||||
data->state.authproblem = TRUE;
|
data->state.authproblem = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
if(checkprefix("Basic", start)) {
|
if(checkprefix("Basic", start)) {
|
||||||
|
@@ -76,6 +76,11 @@
|
|||||||
|
|
||||||
#include <rpc.h>
|
#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
|
#endif
|
||||||
|
|
||||||
/* The last #include file should be: */
|
/* The last #include file should be: */
|
||||||
@@ -305,8 +310,8 @@ ntlm_sspi_cleanup(struct ntlmdata *ntlm)
|
|||||||
ntlm->type_2 = NULL;
|
ntlm->type_2 = NULL;
|
||||||
}
|
}
|
||||||
if (ntlm->has_handles) {
|
if (ntlm->has_handles) {
|
||||||
DeleteSecurityContext(&ntlm->c_handle);
|
s_pSecFn->DeleteSecurityContext(&ntlm->c_handle);
|
||||||
FreeCredentialsHandle(&ntlm->handle);
|
s_pSecFn->FreeCredentialsHandle(&ntlm->handle);
|
||||||
ntlm->has_handles = 0;
|
ntlm->has_handles = 0;
|
||||||
}
|
}
|
||||||
if (ntlm->p_identity) {
|
if (ntlm->p_identity) {
|
||||||
@@ -337,7 +342,7 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
|
|||||||
#endif
|
#endif
|
||||||
size_t size;
|
size_t size;
|
||||||
char *base64=NULL;
|
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
|
/* 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 */
|
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)
|
if(!passwdp)
|
||||||
passwdp=(char *)"";
|
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) {
|
switch(ntlm->state) {
|
||||||
case NTLMSTATE_TYPE1:
|
case NTLMSTATE_TYPE1:
|
||||||
default: /* for the weird cases we (re)start here */
|
default: /* for the weird cases we (re)start here */
|
||||||
@@ -387,6 +421,7 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
|
|||||||
ULONG attrs;
|
ULONG attrs;
|
||||||
const char *user;
|
const char *user;
|
||||||
int domlen;
|
int domlen;
|
||||||
|
TimeStamp tsDummy; /* For Windows 9x compatibility of SPPI calls */
|
||||||
|
|
||||||
ntlm_sspi_cleanup(ntlm);
|
ntlm_sspi_cleanup(ntlm);
|
||||||
|
|
||||||
@@ -428,9 +463,9 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
|
|||||||
ntlm->p_identity = NULL;
|
ntlm->p_identity = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AcquireCredentialsHandle(
|
if (s_pSecFn->AcquireCredentialsHandle(
|
||||||
NULL, (char *)"NTLM", SECPKG_CRED_OUTBOUND, NULL, ntlm->p_identity,
|
NULL, (char *)"NTLM", SECPKG_CRED_OUTBOUND, NULL, ntlm->p_identity,
|
||||||
NULL, NULL, &ntlm->handle, NULL
|
NULL, NULL, &ntlm->handle, &tsDummy
|
||||||
) != SEC_E_OK) {
|
) != SEC_E_OK) {
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
@@ -442,20 +477,22 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
|
|||||||
buf.BufferType = SECBUFFER_TOKEN;
|
buf.BufferType = SECBUFFER_TOKEN;
|
||||||
buf.pvBuffer = ntlmbuf;
|
buf.pvBuffer = ntlmbuf;
|
||||||
|
|
||||||
status = InitializeSecurityContext(&ntlm->handle, NULL, (char *) host,
|
status = s_pSecFn->InitializeSecurityContext(&ntlm->handle, NULL,
|
||||||
|
(char *) host,
|
||||||
ISC_REQ_CONFIDENTIALITY |
|
ISC_REQ_CONFIDENTIALITY |
|
||||||
ISC_REQ_REPLAY_DETECT |
|
ISC_REQ_REPLAY_DETECT |
|
||||||
ISC_REQ_CONNECTION,
|
ISC_REQ_CONNECTION,
|
||||||
0, SECURITY_NETWORK_DREP, NULL, 0,
|
0, SECURITY_NETWORK_DREP,
|
||||||
&ntlm->c_handle, &desc, &attrs, NULL
|
NULL, 0,
|
||||||
);
|
&ntlm->c_handle, &desc,
|
||||||
|
&attrs, &tsDummy);
|
||||||
|
|
||||||
if (status == SEC_I_COMPLETE_AND_CONTINUE ||
|
if (status == SEC_I_COMPLETE_AND_CONTINUE ||
|
||||||
status == SEC_I_CONTINUE_NEEDED) {
|
status == SEC_I_CONTINUE_NEEDED) {
|
||||||
CompleteAuthToken(&ntlm->c_handle, &desc);
|
s_pSecFn->CompleteAuthToken(&ntlm->c_handle, &desc);
|
||||||
}
|
}
|
||||||
else if (status != SEC_E_OK) {
|
else if (status != SEC_E_OK) {
|
||||||
FreeCredentialsHandle(&ntlm->handle);
|
s_pSecFn->FreeCredentialsHandle(&ntlm->handle);
|
||||||
return CURLE_RECV_ERROR;
|
return CURLE_RECV_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -553,6 +590,7 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
|
|||||||
SecBufferDesc type_2_desc, type_3_desc;
|
SecBufferDesc type_2_desc, type_3_desc;
|
||||||
SECURITY_STATUS status;
|
SECURITY_STATUS status;
|
||||||
ULONG attrs;
|
ULONG attrs;
|
||||||
|
TimeStamp tsDummy; /* For Windows 9x compatibility of SPPI calls */
|
||||||
|
|
||||||
type_2_desc.ulVersion = type_3_desc.ulVersion = SECBUFFER_VERSION;
|
type_2_desc.ulVersion = type_3_desc.ulVersion = SECBUFFER_VERSION;
|
||||||
type_2_desc.cBuffers = type_3_desc.cBuffers = 1;
|
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.pvBuffer = ntlmbuf;
|
||||||
type_3.cbBuffer = sizeof(ntlmbuf);
|
type_3.cbBuffer = sizeof(ntlmbuf);
|
||||||
|
|
||||||
status = InitializeSecurityContext(&ntlm->handle, &ntlm->c_handle,
|
status = s_pSecFn->InitializeSecurityContext(&ntlm->handle, &ntlm->c_handle,
|
||||||
(char *) host,
|
(char *) host,
|
||||||
ISC_REQ_CONFIDENTIALITY |
|
ISC_REQ_CONFIDENTIALITY |
|
||||||
ISC_REQ_REPLAY_DETECT |
|
ISC_REQ_REPLAY_DETECT |
|
||||||
ISC_REQ_CONNECTION,
|
ISC_REQ_CONNECTION,
|
||||||
0, SECURITY_NETWORK_DREP, &type_2_desc,
|
0, SECURITY_NETWORK_DREP, &type_2_desc,
|
||||||
0, &ntlm->c_handle, &type_3_desc,
|
0, &ntlm->c_handle, &type_3_desc,
|
||||||
&attrs, NULL);
|
&attrs, &tsDummy);
|
||||||
|
|
||||||
if (status != SEC_E_OK)
|
if (status != SEC_E_OK)
|
||||||
return CURLE_RECV_ERROR;
|
return CURLE_RECV_ERROR;
|
||||||
@@ -700,6 +738,13 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
|
|||||||
size=64;
|
size=64;
|
||||||
ntlmbuf[62]=ntlmbuf[63]=0;
|
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);
|
memcpy(&ntlmbuf[size], domain, domlen);
|
||||||
size += domlen;
|
size += domlen;
|
||||||
|
|
||||||
@@ -763,6 +808,11 @@ Curl_ntlm_cleanup(struct connectdata *conn)
|
|||||||
#ifdef USE_WINDOWS_SSPI
|
#ifdef USE_WINDOWS_SSPI
|
||||||
ntlm_sspi_cleanup(&conn->ntlm);
|
ntlm_sspi_cleanup(&conn->ntlm);
|
||||||
ntlm_sspi_cleanup(&conn->proxyntlm);
|
ntlm_sspi_cleanup(&conn->proxyntlm);
|
||||||
|
if (s_hSecDll != NULL) {
|
||||||
|
FreeLibrary(s_hSecDll);
|
||||||
|
s_hSecDll = NULL;
|
||||||
|
s_pSecFn = NULL;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
(void)conn;
|
(void)conn;
|
||||||
#endif
|
#endif
|
||||||
|
@@ -39,8 +39,7 @@ CURLntlm Curl_input_ntlm(struct connectdata *conn, bool proxy, char *header);
|
|||||||
CURLcode Curl_output_ntlm(struct connectdata *conn, bool proxy);
|
CURLcode Curl_output_ntlm(struct connectdata *conn, bool proxy);
|
||||||
|
|
||||||
void Curl_ntlm_cleanup(struct connectdata *conn);
|
void Curl_ntlm_cleanup(struct connectdata *conn);
|
||||||
#if (!defined(USE_SSLEAY) && !defined(USE_WINDOWS_SSPI)) || \
|
#ifndef USE_NTLM
|
||||||
defined(CURL_DISABLE_HTTP)
|
|
||||||
#define Curl_ntlm_cleanup(x)
|
#define Curl_ntlm_cleanup(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -25,13 +25,13 @@
|
|||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
|
char *Curl_inet_ntop(int af, const void *addr, char *buf, size_t size);
|
||||||
|
|
||||||
#ifdef HAVE_INET_NTOP
|
#ifdef HAVE_INET_NTOP
|
||||||
#define Curl_inet_ntop(af,addr,buf,size) inet_ntop(af,addr,buf,size)
|
|
||||||
#ifdef HAVE_ARPA_INET_H
|
#ifdef HAVE_ARPA_INET_H
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#endif
|
#endif
|
||||||
#else
|
#define Curl_inet_ntop(af,addr,buf,size) inet_ntop(af,addr,buf,size)
|
||||||
char *Curl_inet_ntop(int af, const void *addr, char *buf, size_t size);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __INET_NTOP_H */
|
#endif /* __INET_NTOP_H */
|
||||||
|
@@ -25,13 +25,18 @@
|
|||||||
|
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
|
int Curl_inet_pton(int, const char *, void *);
|
||||||
|
|
||||||
#ifdef HAVE_INET_PTON
|
#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
|
#ifdef HAVE_ARPA_INET_H
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#endif
|
#endif
|
||||||
#else
|
#define Curl_inet_pton(x,y,z) inet_pton(x,y,z)
|
||||||
int Curl_inet_pton(int, const char *, void *);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __INET_PTON_H */
|
#endif /* __INET_PTON_H */
|
||||||
|
73
lib/ldap.c
73
lib/ldap.c
@@ -61,6 +61,7 @@
|
|||||||
#include "strtok.h"
|
#include "strtok.h"
|
||||||
#include "ldap.h"
|
#include "ldap.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "base64.h"
|
||||||
|
|
||||||
#define _MPRINTF_REPLACE /* use our functions only */
|
#define _MPRINTF_REPLACE /* use our functions only */
|
||||||
#include <curl/mprintf.h>
|
#include <curl/mprintf.h>
|
||||||
@@ -78,6 +79,15 @@
|
|||||||
#ifndef LDAP_SIZELIMIT_EXCEEDED
|
#ifndef LDAP_SIZELIMIT_EXCEEDED
|
||||||
#define LDAP_SIZELIMIT_EXCEEDED 4
|
#define LDAP_SIZELIMIT_EXCEEDED 4
|
||||||
#endif
|
#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
|
#define DLOPEN_MODE RTLD_LAZY /*! assume all dlopen() implementations have
|
||||||
this */
|
this */
|
||||||
@@ -115,6 +125,11 @@ static void *liblber = NULL;
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
struct bv {
|
||||||
|
unsigned long bv_len;
|
||||||
|
char *bv_val;
|
||||||
|
};
|
||||||
|
|
||||||
static int DynaOpen(const char **mod_name)
|
static int DynaOpen(const char **mod_name)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_DLOPEN) || defined(HAVE_LIBDL)
|
#if defined(HAVE_DLOPEN) || defined(HAVE_LIBDL)
|
||||||
@@ -145,7 +160,7 @@ static int DynaOpen(const char **mod_name)
|
|||||||
return (libldap != NULL);
|
return (libldap != NULL);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
(void) mod_name;
|
*mod_name = "";
|
||||||
return (0);
|
return (0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -247,10 +262,11 @@ CURLcode Curl_ldap(struct connectdata *conn, bool *done)
|
|||||||
char *(__cdecl *ldap_get_dn)(void *, void *);
|
char *(__cdecl *ldap_get_dn)(void *, void *);
|
||||||
char *(__cdecl *ldap_first_attribute)(void *, void *, void **);
|
char *(__cdecl *ldap_first_attribute)(void *, void *, void **);
|
||||||
char *(__cdecl *ldap_next_attribute)(void *, void *, void *);
|
char *(__cdecl *ldap_next_attribute)(void *, void *, void *);
|
||||||
char **(__cdecl *ldap_get_values)(void *, void *, const char *);
|
void **(__cdecl *ldap_get_values_len)(void *, void *, const char *);
|
||||||
void (__cdecl *ldap_value_free)(char **);
|
void (__cdecl *ldap_value_free_len)(void **);
|
||||||
void (__cdecl *ldap_memfree)(void *);
|
void (__cdecl *ldap_memfree)(void *);
|
||||||
void (__cdecl *ber_free)(void *, int);
|
void (__cdecl *ber_free)(void *, int);
|
||||||
|
int (__cdecl *ldap_set_option)(void *, int, void *);
|
||||||
|
|
||||||
void *server;
|
void *server;
|
||||||
LDAPURLDesc *ludp = NULL;
|
LDAPURLDesc *ludp = NULL;
|
||||||
@@ -259,6 +275,9 @@ CURLcode Curl_ldap(struct connectdata *conn, bool *done)
|
|||||||
void *entryIterator; /*! type should be 'LDAPMessage *' */
|
void *entryIterator; /*! type should be 'LDAPMessage *' */
|
||||||
int num = 0;
|
int num = 0;
|
||||||
struct SessionHandle *data=conn->data;
|
struct SessionHandle *data=conn->data;
|
||||||
|
int ldap_proto;
|
||||||
|
char *val_b64;
|
||||||
|
size_t val_b64_sz;
|
||||||
|
|
||||||
*done = TRUE; /* unconditionally */
|
*done = TRUE; /* unconditionally */
|
||||||
infof(data, "LDAP local: %s\n", data->change.url);
|
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.
|
* pointer-to-object (data) and pointer-to-function.
|
||||||
*/
|
*/
|
||||||
DYNA_GET_FUNCTION(void *(__cdecl *)(char *, int), ldap_init);
|
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);
|
DYNA_GET_FUNCTION(int (__cdecl *)(void *), ldap_unbind_s);
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
DYNA_GET_FUNCTION(int (*)(char *, LDAPURLDesc **), ldap_url_parse);
|
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(void *(__cdecl *)(void *, void *), ldap_next_entry);
|
||||||
DYNA_GET_FUNCTION(char *(__cdecl *)(int), ldap_err2string);
|
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 *), ldap_get_dn);
|
||||||
DYNA_GET_FUNCTION(char *(__cdecl *)(void *, void *, void **), ldap_first_attribute);
|
DYNA_GET_FUNCTION(char *(__cdecl *)(void *, void *, void **),
|
||||||
DYNA_GET_FUNCTION(char *(__cdecl *)(void *, void *, void *), ldap_next_attribute);
|
ldap_first_attribute);
|
||||||
DYNA_GET_FUNCTION(char **(__cdecl *)(void *, void *, const char *), ldap_get_values);
|
DYNA_GET_FUNCTION(char *(__cdecl *)(void *, void *, void *),
|
||||||
DYNA_GET_FUNCTION(void (__cdecl *)(char **), ldap_value_free);
|
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 *), ldap_memfree);
|
||||||
DYNA_GET_FUNCTION(void (__cdecl *)(void *, int), ber_free);
|
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);
|
server = (*ldap_init)(conn->host.name, (int)conn->port);
|
||||||
if (server == NULL) {
|
if (server == NULL) {
|
||||||
@@ -299,9 +323,18 @@ CURLcode Curl_ldap(struct connectdata *conn, bool *done)
|
|||||||
goto quit;
|
goto quit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ldap_proto = LDAP_VERSION3;
|
||||||
|
(*ldap_set_option)(server, LDAP_OPT_PROTOCOL_VERSION, &ldap_proto);
|
||||||
rc = (*ldap_simple_bind_s)(server,
|
rc = (*ldap_simple_bind_s)(server,
|
||||||
conn->bits.user_passwd ? conn->user : NULL,
|
conn->bits.user_passwd ? conn->user : NULL,
|
||||||
conn->bits.user_passwd ? conn->passwd : 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) {
|
if (rc != 0) {
|
||||||
failf(data, "LDAP local: %s", (*ldap_err2string)(rc));
|
failf(data, "LDAP local: %s", (*ldap_err2string)(rc));
|
||||||
status = CURLE_LDAP_CANNOT_BIND;
|
status = CURLE_LDAP_CANNOT_BIND;
|
||||||
@@ -346,7 +379,8 @@ CURLcode Curl_ldap(struct connectdata *conn, bool *done)
|
|||||||
attribute;
|
attribute;
|
||||||
attribute = (*ldap_next_attribute)(server, entryIterator, ber))
|
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)
|
if (vals != NULL)
|
||||||
{
|
{
|
||||||
@@ -355,12 +389,25 @@ CURLcode Curl_ldap(struct connectdata *conn, bool *done)
|
|||||||
Curl_client_write(data, CLIENTWRITE_BODY, (char *)"\t", 1);
|
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, (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);
|
Curl_client_write(data, CLIENTWRITE_BODY, (char *)"\n", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free memory used to store values */
|
/* 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);
|
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;
|
return LDAP_NO_MEMORY;
|
||||||
|
|
||||||
p = strchr(ludp->lud_dn, '?');
|
p = strchr(ludp->lud_dn, '?');
|
||||||
LDAP_TRACE (("DN '%.*s'\n", p ? (size_t)(p-ludp->lud_dn) : strlen(ludp->lud_dn),
|
LDAP_TRACE (("DN '%.*s'\n", p ? (size_t)(p-ludp->lud_dn) :
|
||||||
ludp->lud_dn));
|
strlen(ludp->lud_dn), ludp->lud_dn));
|
||||||
|
|
||||||
if (!p)
|
if (!p)
|
||||||
goto success;
|
goto success;
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
LIBRARY LIBCURL
|
LIBRARY LIBCURL
|
||||||
|
|
||||||
DESCRIPTION 'curl libcurl - http://curl.haxx.se'
|
;DESCRIPTION 'curl libcurl - http://curl.haxx.se'
|
||||||
|
|
||||||
EXPORTS
|
EXPORTS
|
||||||
curl_easy_cleanup @ 1 ;
|
curl_easy_cleanup @ 1 ;
|
||||||
|
@@ -92,12 +92,15 @@ CURL_EXTERN int curl_fclose(FILE *file, int line, const char *source);
|
|||||||
#define ogetaddrinfo(host,serv,hint,res) \
|
#define ogetaddrinfo(host,serv,hint,res) \
|
||||||
curl_dogetaddrinfo(host,serv,hint,res,__LINE__,__FILE__)
|
curl_dogetaddrinfo(host,serv,hint,res,__LINE__,__FILE__)
|
||||||
#else
|
#else
|
||||||
|
#undef getaddrinfo
|
||||||
#define getaddrinfo(host,serv,hint,res) \
|
#define getaddrinfo(host,serv,hint,res) \
|
||||||
curl_dogetaddrinfo(host,serv,hint,res,__LINE__,__FILE__)
|
curl_dogetaddrinfo(host,serv,hint,res,__LINE__,__FILE__)
|
||||||
#endif
|
#endif
|
||||||
|
#undef getnameinfo
|
||||||
#define getnameinfo(sa,salen,host,hostlen,serv,servlen,flags) \
|
#define getnameinfo(sa,salen,host,hostlen,serv,servlen,flags) \
|
||||||
curl_dogetnameinfo(sa,salen,host,hostlen,serv,servlen,flags, __LINE__, \
|
curl_dogetnameinfo(sa,salen,host,hostlen,serv,servlen,flags, __LINE__, \
|
||||||
__FILE__)
|
__FILE__)
|
||||||
|
#undef freeaddrinfo
|
||||||
#define freeaddrinfo(data) \
|
#define freeaddrinfo(data) \
|
||||||
curl_dofreeaddrinfo(data,__LINE__,__FILE__)
|
curl_dofreeaddrinfo(data,__LINE__,__FILE__)
|
||||||
|
|
||||||
|
@@ -130,8 +130,8 @@ static const struct tzinfo tz[]= {
|
|||||||
{"CET", -60}, /* Central European */
|
{"CET", -60}, /* Central European */
|
||||||
{"MET", -60}, /* Middle European */
|
{"MET", -60}, /* Middle European */
|
||||||
{"MEWT", -60}, /* Middle European Winter */
|
{"MEWT", -60}, /* Middle European Winter */
|
||||||
{"MEST", -120 tDAYZONE}, /* Middle European Summer */
|
{"MEST", -60 tDAYZONE}, /* Middle European Summer */
|
||||||
{"CEST", -120 tDAYZONE}, /* Central European Summer */
|
{"CEST", -60 tDAYZONE}, /* Central European Summer */
|
||||||
{"MESZ", -60 tDAYZONE}, /* Middle European Summer */
|
{"MESZ", -60 tDAYZONE}, /* Middle European Summer */
|
||||||
{"FWT", -60}, /* French Winter */
|
{"FWT", -60}, /* French Winter */
|
||||||
{"FST", -60 tDAYZONE}, /* French Summer */
|
{"FST", -60 tDAYZONE}, /* French Summer */
|
||||||
|
@@ -104,7 +104,7 @@ int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms)
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
num = 0;
|
num = 0;
|
||||||
if (readfd != CURL_SOCKET_BAD) {
|
if (readfd != CURL_SOCKET_BAD) {
|
||||||
if (pfd[num].revents & POLLIN)
|
if (pfd[num].revents & (POLLIN|POLLHUP))
|
||||||
ret |= CSELECT_IN;
|
ret |= CSELECT_IN;
|
||||||
if (pfd[num].revents & POLLERR)
|
if (pfd[num].revents & POLLERR)
|
||||||
ret |= CSELECT_ERR;
|
ret |= CSELECT_ERR;
|
||||||
|
21
lib/setup.h
21
lib/setup.h
@@ -169,8 +169,10 @@ typedef unsigned char bool;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ENABLE_IPV6) || defined(USE_SSLEAY)
|
#if defined(ENABLE_IPV6) || defined(USE_SSLEAY)
|
||||||
|
#if !defined(_MSC_VER) || (_MSC_VER >= 1300)
|
||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(__GNUC__) || defined(__MINGW32__)
|
#if !defined(__GNUC__) || defined(__MINGW32__)
|
||||||
#define sclose(x) closesocket(x)
|
#define sclose(x) closesocket(x)
|
||||||
@@ -198,6 +200,7 @@ typedef unsigned char bool;
|
|||||||
#define sread(x,y,z) read_s(x,y,z)
|
#define sread(x,y,z) read_s(x,y,z)
|
||||||
#define swrite(x,y,z) write_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 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
|
#define IOCTL_3_ARGS
|
||||||
#include <tcp.h>
|
#include <tcp.h>
|
||||||
#ifdef word
|
#ifdef word
|
||||||
@@ -227,7 +230,9 @@ typedef unsigned char bool;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DIR_CHAR "/"
|
#define DIR_CHAR "/"
|
||||||
|
#ifndef DOT_CHAR
|
||||||
#define DOT_CHAR "."
|
#define DOT_CHAR "."
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef DJGPP
|
#ifdef DJGPP
|
||||||
#undef DOT_CHAR
|
#undef DOT_CHAR
|
||||||
@@ -262,6 +267,14 @@ typedef int curl_socket_t;
|
|||||||
#endif
|
#endif
|
||||||
#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
|
#ifdef mpeix
|
||||||
#define IOCTL_3_ARGS
|
#define IOCTL_3_ARGS
|
||||||
#endif
|
#endif
|
||||||
@@ -291,9 +304,15 @@ typedef int curl_socket_t;
|
|||||||
#define USE_SSL /* Either OpenSSL || GnuTLS */
|
#define USE_SSL /* Either OpenSSL || GnuTLS */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_NTLM)
|
||||||
#if defined(USE_SSLEAY) || defined(USE_WINDOWS_SSPI)
|
#if defined(USE_SSLEAY) || defined(USE_WINDOWS_SSPI)
|
||||||
#define USE_NTLM
|
#define USE_NTLM
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_GOPHER)
|
||||||
|
#define CURL_DISABLE_GOPHER
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CURLDEBUG
|
#ifdef CURLDEBUG
|
||||||
#define DEBUGF(x) x
|
#define DEBUGF(x) x
|
||||||
@@ -301,4 +320,4 @@ typedef int curl_socket_t;
|
|||||||
#define DEBUGF(x)
|
#define DEBUGF(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __CONFIG_H */
|
#endif /* __SETUP_H */
|
||||||
|
38
lib/sockaddr.h
Normal file
38
lib/sockaddr.h
Normal 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 */
|
11
lib/ssluse.c
11
lib/ssluse.c
@@ -104,11 +104,16 @@
|
|||||||
#undef HAVE_PKCS12_SUPPORT
|
#undef HAVE_PKCS12_SUPPORT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if OPENSSL_VERSION_NUMBER >= 0x00906001L
|
#if OPENSSL_VERSION_NUMBER >= 0x00906001L
|
||||||
#define HAVE_ERR_ERROR_STRING_N 1
|
#define HAVE_ERR_ERROR_STRING_N 1
|
||||||
#endif
|
#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
|
* 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
|
* a finite value (because some entropy "files" like /dev/urandom have
|
||||||
@@ -1121,7 +1126,7 @@ Curl_ossl_connect(struct connectdata *conn,
|
|||||||
long lerr;
|
long lerr;
|
||||||
int what;
|
int what;
|
||||||
char * str;
|
char * str;
|
||||||
SSL_METHOD *req_method;
|
SSL_METHOD_QUAL SSL_METHOD *req_method=NULL;
|
||||||
void *ssl_sessionid=NULL;
|
void *ssl_sessionid=NULL;
|
||||||
ASN1_TIME *certdate;
|
ASN1_TIME *certdate;
|
||||||
curl_socket_t sockfd = conn->sock[sockindex];
|
curl_socket_t sockfd = conn->sock[sockindex];
|
||||||
@@ -1162,7 +1167,7 @@ Curl_ossl_connect(struct connectdata *conn,
|
|||||||
#ifdef SSL_CTRL_SET_MSG_CALLBACK
|
#ifdef SSL_CTRL_SET_MSG_CALLBACK
|
||||||
if (data->set.fdebug) {
|
if (data->set.fdebug) {
|
||||||
if (!SSL_CTX_callback_ctrl(connssl->ctx, SSL_CTRL_SET_MSG_CALLBACK,
|
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!");
|
failf(data, "SSL: couldn't set callback!");
|
||||||
return CURLE_SSL_CONNECT_ERROR;
|
return CURLE_SSL_CONNECT_ERROR;
|
||||||
}
|
}
|
||||||
|
@@ -42,7 +42,7 @@
|
|||||||
#define _MPRINTF_REPLACE /* use our functions only */
|
#define _MPRINTF_REPLACE /* use our functions only */
|
||||||
#include <curl/mprintf.h>
|
#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
|
#ifdef HAVE_POSIX_STRERROR_R
|
||||||
/* seen on AIX 5100-02 gcc 2.9 */
|
/* seen on AIX 5100-02 gcc 2.9 */
|
||||||
extern int strerror_r(int errnum, char *strerrbuf, size_t buflen);
|
extern int strerror_r(int errnum, char *strerrbuf, size_t buflen);
|
||||||
@@ -245,6 +245,27 @@ curl_easy_strerror(CURLcode error)
|
|||||||
case CURLE_LOGIN_DENIED:
|
case CURLE_LOGIN_DENIED:
|
||||||
return "FTP: 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_URL_MALFORMAT_USER: /* not used by current libcurl */
|
||||||
case CURLE_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 */
|
case CURLE_BAD_CALLING_ORDER: /* not used by current libcurl */
|
||||||
|
742
lib/tftp.c
Normal file
742
lib/tftp.c
Normal 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(¤t);
|
||||||
|
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
31
lib/tftp.h
Normal 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
|
@@ -214,7 +214,7 @@ CURLcode Curl_readrewind(struct connectdata *conn)
|
|||||||
if(data->set.ioctl) {
|
if(data->set.ioctl) {
|
||||||
curlioerr err;
|
curlioerr err;
|
||||||
|
|
||||||
err = data->set.ioctl(data, CURLIOCMD_RESTARTREAD,
|
err = (data->set.ioctl) (data, CURLIOCMD_RESTARTREAD,
|
||||||
data->set.ioctl_client);
|
data->set.ioctl_client);
|
||||||
infof(data, "the ioctl callback returned %d\n", (int)err);
|
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]-
|
||||||
Content-Range: bytes: [num]-
|
Content-Range: bytes: [num]-
|
||||||
|
|
||||||
The second format was added August 1st 2000 by Igor
|
The second format was added since Sun's webserver
|
||||||
Khristophorov since Sun's webserver JavaWebServer/1.1.1
|
JavaWebServer/1.1.1 obviously sends the header this way!
|
||||||
obviously sends the header this way! :-( */
|
*/
|
||||||
|
|
||||||
char *ptr = strstr(k->p, "bytes");
|
char *ptr = Curl_strcasestr(k->p, "bytes");
|
||||||
ptr+=5;
|
ptr+=5;
|
||||||
|
|
||||||
if(*ptr == ':')
|
if(*ptr == ':')
|
||||||
@@ -1622,9 +1622,11 @@ Transfer(struct connectdata *conn)
|
|||||||
CURLcode Curl_pretransfer(struct SessionHandle *data)
|
CURLcode Curl_pretransfer(struct SessionHandle *data)
|
||||||
{
|
{
|
||||||
CURLcode res;
|
CURLcode res;
|
||||||
if(!data->change.url)
|
if(!data->change.url) {
|
||||||
/* we can't do anything wihout URL */
|
/* we can't do anything wihout URL */
|
||||||
|
failf(data, "No URL set!\n");
|
||||||
return CURLE_URL_MALFORMAT;
|
return CURLE_URL_MALFORMAT;
|
||||||
|
}
|
||||||
|
|
||||||
/* Init the SSL session ID cache here. We do it here since we want to do it
|
/* 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
|
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;
|
size_t newlen;
|
||||||
char *newest;
|
char *newest;
|
||||||
|
|
||||||
if (data->set.maxredirs &&
|
if ((data->set.maxredirs != -1) &&
|
||||||
(data->set.followlocation >= data->set.maxredirs)) {
|
(data->set.followlocation >= data->set.maxredirs)) {
|
||||||
failf(data,"Maximum (%d) redirects followed", data->set.maxredirs);
|
failf(data,"Maximum (%d) redirects followed", data->set.maxredirs);
|
||||||
return CURLE_TOO_MANY_REDIRECTS;
|
return CURLE_TOO_MANY_REDIRECTS;
|
||||||
@@ -2215,6 +2217,19 @@ CURLcode Curl_perform(struct SessionHandle *data)
|
|||||||
if(newurl)
|
if(newurl)
|
||||||
free(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
|
/* run post-transfer uncondionally, but don't clobber the return code if
|
||||||
we already have an error code recorder */
|
we already have an error code recorder */
|
||||||
res2 = Curl_posttransfer(data);
|
res2 = Curl_posttransfer(data);
|
||||||
|
83
lib/url.c
83
lib/url.c
@@ -77,9 +77,7 @@
|
|||||||
#error "We can't compile without socket() support!"
|
#error "We can't compile without socket() support!"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_LIBIDN
|
#ifdef USE_LIBIDN
|
||||||
#include <idna.h>
|
#include <idna.h>
|
||||||
#include <tld.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 "ftp.h"
|
||||||
#include "dict.h"
|
#include "dict.h"
|
||||||
#include "telnet.h"
|
#include "telnet.h"
|
||||||
|
#include "tftp.h"
|
||||||
#include "http.h"
|
#include "http.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
#include "ldap.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.infilesize = -1; /* we don't know any size */
|
||||||
data->set.postfieldsize = -1;
|
data->set.postfieldsize = -1;
|
||||||
|
data->set.maxredirs = -1; /* allow any amount by default */
|
||||||
data->state.current_speed = -1; /* init to negative == impossible */
|
data->state.current_speed = -1; /* init to negative == impossible */
|
||||||
|
|
||||||
data->set.httpreq = HTTPREQ_GET; /* Default HTTP request */
|
data->set.httpreq = HTTPREQ_GET; /* Default HTTP request */
|
||||||
data->set.ftp_use_epsv = TRUE; /* FTP defaults to EPSV operations */
|
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_eprt = TRUE; /* FTP defaults to EPRT operations */
|
||||||
data->set.ftp_use_lprt = 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 */
|
data->set.dns_cache_timeout = 60; /* Timeout every 60 seconds by default */
|
||||||
|
|
||||||
/* make libcurl quiet 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;
|
data->set.ftp_append = va_arg(param, long)?TRUE:FALSE;
|
||||||
break;
|
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:
|
case CURLOPT_NETRC:
|
||||||
/*
|
/*
|
||||||
* Parse the $HOME/.netrc file
|
* 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;
|
data->set.ftp_use_epsv = va_arg(param, long)?TRUE:FALSE;
|
||||||
break;
|
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:
|
case CURLOPT_INFILE:
|
||||||
/*
|
/*
|
||||||
* FILE pointer to read the file to be uploaded from. Or possibly
|
* 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;
|
struct SessionHandle *data = conn->data;
|
||||||
char *hostname = data->change.proxy?conn->proxy.name:conn->host.name;
|
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);
|
hostname, conn->port);
|
||||||
|
|
||||||
/*************************************************************
|
/*************************************************************
|
||||||
@@ -2364,12 +2378,18 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||||||
if(urllen < LEAST_PATH_ALLOC)
|
if(urllen < LEAST_PATH_ALLOC)
|
||||||
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)
|
if(NULL == conn->pathbuffer)
|
||||||
return CURLE_OUT_OF_MEMORY; /* really bad error */
|
return CURLE_OUT_OF_MEMORY; /* really bad error */
|
||||||
conn->path = conn->pathbuffer;
|
conn->path = conn->pathbuffer;
|
||||||
|
|
||||||
conn->host.rawalloc=(char *)malloc(urllen);
|
conn->host.rawalloc=(char *)malloc(urllen+2);
|
||||||
if(NULL == conn->host.rawalloc)
|
if(NULL == conn->host.rawalloc)
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
conn->host.name = conn->host.rawalloc;
|
conn->host.name = conn->host.rawalloc;
|
||||||
@@ -2722,6 +2742,8 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||||||
* Setup internals depending on protocol
|
* Setup internals depending on protocol
|
||||||
*************************************************************/
|
*************************************************************/
|
||||||
|
|
||||||
|
conn->socktype = SOCK_STREAM; /* most of them are TCP streams */
|
||||||
|
|
||||||
if (strequal(conn->protostr, "HTTP")) {
|
if (strequal(conn->protostr, "HTTP")) {
|
||||||
#ifndef CURL_DISABLE_HTTP
|
#ifndef CURL_DISABLE_HTTP
|
||||||
conn->port = PORT_HTTP;
|
conn->port = PORT_HTTP;
|
||||||
@@ -2915,6 +2937,44 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||||||
#else
|
#else
|
||||||
failf(data, LIBCURL_NAME
|
failf(data, LIBCURL_NAME
|
||||||
" was built with FILE disabled!");
|
" 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
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -3796,7 +3856,14 @@ CURLcode Curl_do(struct connectdata **connp, bool *done)
|
|||||||
|
|
||||||
/* conn may no longer be a good pointer */
|
/* 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 async;
|
||||||
bool protocol_done = TRUE;
|
bool protocol_done = TRUE;
|
||||||
|
|
||||||
|
@@ -35,6 +35,7 @@
|
|||||||
#define PORT_HTTPS 443
|
#define PORT_HTTPS 443
|
||||||
#define PORT_DICT 2628
|
#define PORT_DICT 2628
|
||||||
#define PORT_LDAP 389
|
#define PORT_LDAP 389
|
||||||
|
#define PORT_TFTP 69
|
||||||
|
|
||||||
#define DICT_MATCH "/MATCH:"
|
#define DICT_MATCH "/MATCH:"
|
||||||
#define DICT_MATCH2 "/M:"
|
#define DICT_MATCH2 "/M:"
|
||||||
@@ -309,6 +310,12 @@ typedef enum {
|
|||||||
FTP_LAST /* never used */
|
FTP_LAST /* never used */
|
||||||
} ftpstate;
|
} 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 {
|
struct FTP {
|
||||||
curl_off_t *bytecountp;
|
curl_off_t *bytecountp;
|
||||||
char *user; /* user name string */
|
char *user; /* user name string */
|
||||||
@@ -540,6 +547,7 @@ struct connectdata {
|
|||||||
#define PROT_DICT (1<<6)
|
#define PROT_DICT (1<<6)
|
||||||
#define PROT_LDAP (1<<7)
|
#define PROT_LDAP (1<<7)
|
||||||
#define PROT_FILE (1<<8)
|
#define PROT_FILE (1<<8)
|
||||||
|
#define PROT_TFTP (1<<11)
|
||||||
#define PROT_FTPS (1<<9)
|
#define PROT_FTPS (1<<9)
|
||||||
#define PROT_SSL (1<<10) /* protocol requires SSL */
|
#define PROT_SSL (1<<10) /* protocol requires SSL */
|
||||||
|
|
||||||
@@ -560,6 +568,7 @@ struct connectdata {
|
|||||||
char *ip_addr_str;
|
char *ip_addr_str;
|
||||||
|
|
||||||
char protostr[16]; /* store the protocol string in this buffer */
|
char protostr[16]; /* store the protocol string in this buffer */
|
||||||
|
int socktype; /* SOCK_STREAM or SOCK_DGRAM */
|
||||||
|
|
||||||
struct hostname host;
|
struct hostname host;
|
||||||
struct hostname proxy;
|
struct hostname proxy;
|
||||||
@@ -695,6 +704,7 @@ struct connectdata {
|
|||||||
struct HTTP *gopher; /* alias, just for the sake of being more readable */
|
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 HTTP *https; /* alias, just for the sake of being more readable */
|
||||||
struct FTP *ftp;
|
struct FTP *ftp;
|
||||||
|
void *tftp; /* private for tftp.c-eyes only */
|
||||||
struct FILEPROTO *file;
|
struct FILEPROTO *file;
|
||||||
void *telnet; /* private for telnet.c-eyes only */
|
void *telnet; /* private for telnet.c-eyes only */
|
||||||
void *generic;
|
void *generic;
|
||||||
@@ -952,7 +962,8 @@ struct UserDefined {
|
|||||||
char *set_range; /* range, if used. See README for detailed specification
|
char *set_range; /* range, if used. See README for detailed specification
|
||||||
on this syntax. */
|
on this syntax. */
|
||||||
long followlocation; /* as in HTTP Location: */
|
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 */
|
char *set_referer; /* custom string */
|
||||||
bool free_referer; /* set TRUE if 'referer' points to a string we
|
bool free_referer; /* set TRUE if 'referer' points to a string we
|
||||||
allocated */
|
allocated */
|
||||||
@@ -1030,6 +1041,8 @@ struct UserDefined {
|
|||||||
char *source_url; /* for 3rd party transfer */
|
char *source_url; /* for 3rd party transfer */
|
||||||
char *source_userpwd; /* 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
|
/* Here follows boolean settings that define how to behave during
|
||||||
this session. They are STATIC, set by libcurl users or at least initially
|
this session. They are STATIC, set by libcurl users or at least initially
|
||||||
and they don't change during operations. */
|
and they don't change during operations. */
|
||||||
@@ -1069,8 +1082,9 @@ struct UserDefined {
|
|||||||
bool no_signal; /* do not use any signal/alarm handler */
|
bool no_signal; /* do not use any signal/alarm handler */
|
||||||
bool global_dns_cache; /* subject for future removal */
|
bool global_dns_cache; /* subject for future removal */
|
||||||
bool tcp_nodelay; /* whether to enable TCP_NODELAY or not */
|
bool tcp_nodelay; /* whether to enable TCP_NODELAY or not */
|
||||||
|
|
||||||
bool ignorecl; /* ignore content length */
|
bool ignorecl; /* ignore content length */
|
||||||
|
bool ftp_skip_ip; /* skip the IP address the FTP server passes on to
|
||||||
|
us */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -81,6 +81,9 @@ char *curl_version(void)
|
|||||||
/* data for curl_version_info */
|
/* data for curl_version_info */
|
||||||
|
|
||||||
static const char * const protocols[] = {
|
static const char * const protocols[] = {
|
||||||
|
#ifndef CURL_DISABLE_TFTP
|
||||||
|
"tftp",
|
||||||
|
#endif
|
||||||
#ifndef CURL_DISABLE_FTP
|
#ifndef CURL_DISABLE_FTP
|
||||||
"ftp",
|
"ftp",
|
||||||
#endif
|
#endif
|
||||||
|
@@ -3,6 +3,7 @@ Makefile.in
|
|||||||
.deps
|
.deps
|
||||||
.libs
|
.libs
|
||||||
curl
|
curl
|
||||||
|
config.h.in
|
||||||
config.h
|
config.h
|
||||||
hugehelp.c
|
hugehelp.c
|
||||||
stamp-h*
|
stamp-h*
|
||||||
|
@@ -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
|
..\include\curl\multi.h ..\include\curl\curl.h
|
||||||
|
|
||||||
$(OBJ_DIR)/hugehelp.obj: hugehelp.c setup.h config-win32.h ..\lib\setup.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 &
|
..\lib\config-win32.h hugehelp.h
|
||||||
../../../zlib-1.2.1/zconf.h
|
|
||||||
|
|
||||||
$(OBJ_DIR)/main.obj: main.c setup.h config-win32.h ..\lib\setup.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 &
|
..\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 &
|
..\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\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||||
..\include\curl\mprintf.h writeout.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
Reference in New Issue
Block a user