Compare commits
229 Commits
curl-7_12_
...
curl-7_12_
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4f0258ec09 | ||
![]() |
db4d0d307a | ||
![]() |
2baf22e184 | ||
![]() |
21d5aead47 | ||
![]() |
f40c9b83df | ||
![]() |
b9e082b811 | ||
![]() |
0bfa601a9f | ||
![]() |
e356420123 | ||
![]() |
e8f85cba0f | ||
![]() |
1aba99b1e7 | ||
![]() |
12815d7cd6 | ||
![]() |
9deb76ce3e | ||
![]() |
c98676068e | ||
![]() |
b534f74bf4 | ||
![]() |
411e9b0c45 | ||
![]() |
3fa1879f6a | ||
![]() |
d30cf22c12 | ||
![]() |
557b6cfd3f | ||
![]() |
84bf03b365 | ||
![]() |
34342bcd19 | ||
![]() |
5322a86313 | ||
![]() |
1dc50e21c4 | ||
![]() |
1eddbb1b47 | ||
![]() |
bb8591cf54 | ||
![]() |
a7913a62a9 | ||
![]() |
6d1b37b3da | ||
![]() |
34750cc738 | ||
![]() |
af677c4e1d | ||
![]() |
298076e00f | ||
![]() |
0d2cdd9773 | ||
![]() |
eb5d3b5a7c | ||
![]() |
7663775971 | ||
![]() |
fe46572f2b | ||
![]() |
a6d4d3eeac | ||
![]() |
62f97f1817 | ||
![]() |
253ff7b2ad | ||
![]() |
c274e51654 | ||
![]() |
1239e48304 | ||
![]() |
52313cbac9 | ||
![]() |
071218a201 | ||
![]() |
f0d6cc23ae | ||
![]() |
ceefe2e248 | ||
![]() |
9a2aed7d7a | ||
![]() |
a91a75355d | ||
![]() |
01acbfa1a5 | ||
![]() |
49b2896a3b | ||
![]() |
39af394a1c | ||
![]() |
5c7dcc6c33 | ||
![]() |
6c5ea2af27 | ||
![]() |
93e084e097 | ||
![]() |
1a61bcecfc | ||
![]() |
3d9fb701e2 | ||
![]() |
19a568a983 | ||
![]() |
70c3f6a8dd | ||
![]() |
bb999d8213 | ||
![]() |
121197bc87 | ||
![]() |
d5dd8e0fdc | ||
![]() |
c368800877 | ||
![]() |
6eb58549a9 | ||
![]() |
95def48071 | ||
![]() |
2ee6c33412 | ||
![]() |
be7ce435c0 | ||
![]() |
f4252f8672 | ||
![]() |
f4f961c4ea | ||
![]() |
e2fe03df8e | ||
![]() |
19b284c214 | ||
![]() |
6b3e3095ea | ||
![]() |
fd2aad1d9b | ||
![]() |
d239fc5d04 | ||
![]() |
ec4da97a35 | ||
![]() |
bb48ccedd7 | ||
![]() |
afc0dfb141 | ||
![]() |
8e87223195 | ||
![]() |
be1cece69b | ||
![]() |
45be6d6645 | ||
![]() |
d4db35c125 | ||
![]() |
94c6a5eeab | ||
![]() |
35292e794a | ||
![]() |
c2043a7f94 | ||
![]() |
e752588e8d | ||
![]() |
8f30dbd4f0 | ||
![]() |
29eb80dbd1 | ||
![]() |
6cf6f9a21e | ||
![]() |
6af6a2bbe8 | ||
![]() |
2576ac1c76 | ||
![]() |
bfeea8e6b7 | ||
![]() |
2f89f2311c | ||
![]() |
75e5967afd | ||
![]() |
1003628103 | ||
![]() |
3451e888b9 | ||
![]() |
12dc142a28 | ||
![]() |
cb80670885 | ||
![]() |
c189687188 | ||
![]() |
595016d393 | ||
![]() |
23550fe5de | ||
![]() |
8420de971f | ||
![]() |
17f8f32b2e | ||
![]() |
7676f40218 | ||
![]() |
2de62cb06f | ||
![]() |
be1df3ca0a | ||
![]() |
543ab6f331 | ||
![]() |
2b6f7ef2a9 | ||
![]() |
0d37f8564e | ||
![]() |
6cd2536048 | ||
![]() |
60fccf4e37 | ||
![]() |
8a8028394f | ||
![]() |
6a06667cc0 | ||
![]() |
25bf23105d | ||
![]() |
2544c78083 | ||
![]() |
40b9b6f6dc | ||
![]() |
f5e1beddf1 | ||
![]() |
d4076c9a8a | ||
![]() |
106695d45e | ||
![]() |
f71b3f48a1 | ||
![]() |
aa8dd932c1 | ||
![]() |
adbe3eefb6 | ||
![]() |
33f69c0546 | ||
![]() |
6c3a87a599 | ||
![]() |
13cc010e38 | ||
![]() |
e99bf99829 | ||
![]() |
2e7dcc1e2a | ||
![]() |
b85a036e4a | ||
![]() |
7885264b29 | ||
![]() |
73dd450147 | ||
![]() |
96efa990f9 | ||
![]() |
4e0aee9408 | ||
![]() |
27d509cfe9 | ||
![]() |
ade8e47a8c | ||
![]() |
ca52c963c7 | ||
![]() |
17acdb5acf | ||
![]() |
f6433211ae | ||
![]() |
0ec4c66fba | ||
![]() |
1faa9d6fd5 | ||
![]() |
23d64e720d | ||
![]() |
b8b56248bd | ||
![]() |
33929117f9 | ||
![]() |
2b1673c9c8 | ||
![]() |
702f549a6a | ||
![]() |
428741d7cf | ||
![]() |
6fa624cf8c | ||
![]() |
5f60188b8a | ||
![]() |
75a6fdeb58 | ||
![]() |
5f3fa92062 | ||
![]() |
66077ae48b | ||
![]() |
92637303db | ||
![]() |
811dfd710b | ||
![]() |
b08dc2cadb | ||
![]() |
f7c5a097e3 | ||
![]() |
5eb3102cd1 | ||
![]() |
05825a8a9f | ||
![]() |
24353c4372 | ||
![]() |
e89ea07626 | ||
![]() |
b99c95ba46 | ||
![]() |
9432bfe90c | ||
![]() |
37bf6da9c8 | ||
![]() |
b3ebbd60a2 | ||
![]() |
e942394bdb | ||
![]() |
4adfcd4fd7 | ||
![]() |
c10196afc0 | ||
![]() |
49746d1dce | ||
![]() |
d46e235c2a | ||
![]() |
ee44677d7e | ||
![]() |
20057aee2e | ||
![]() |
7119679080 | ||
![]() |
d869b51a57 | ||
![]() |
dbacc81af7 | ||
![]() |
b233c13dca | ||
![]() |
464be27479 | ||
![]() |
d736ac51c0 | ||
![]() |
e8b295ff7d | ||
![]() |
4a4490d5f1 | ||
![]() |
46313be2f5 | ||
![]() |
723bfe42e7 | ||
![]() |
e35c7dcd72 | ||
![]() |
fa83a0573e | ||
![]() |
7b97371ab1 | ||
![]() |
b17e32baa7 | ||
![]() |
cd52b9f0da | ||
![]() |
c3d74ffe48 | ||
![]() |
a231a96841 | ||
![]() |
93b61bf0d3 | ||
![]() |
06d39bd303 | ||
![]() |
52177b1f60 | ||
![]() |
566f7b5e58 | ||
![]() |
c8c47768c7 | ||
![]() |
62ff567c47 | ||
![]() |
ee400f9552 | ||
![]() |
9ac7629e2c | ||
![]() |
d72ca96a43 | ||
![]() |
d0dcb3b554 | ||
![]() |
e139e49826 | ||
![]() |
3838745fdb | ||
![]() |
06a5c70f4d | ||
![]() |
62af3fb7b9 | ||
![]() |
db302a1055 | ||
![]() |
847c91e568 | ||
![]() |
2646af106b | ||
![]() |
7261b4556b | ||
![]() |
071e3cf007 | ||
![]() |
164184b484 | ||
![]() |
8b6e87abee | ||
![]() |
45197b188e | ||
![]() |
559553b169 | ||
![]() |
84ec4068de | ||
![]() |
aea87be19e | ||
![]() |
9f14744d16 | ||
![]() |
1dc8c1dbc8 | ||
![]() |
e9812c53cb | ||
![]() |
ed98565963 | ||
![]() |
1d3233612a | ||
![]() |
8362a34cef | ||
![]() |
edd16d978f | ||
![]() |
4356356305 | ||
![]() |
cb88135220 | ||
![]() |
498a0fe795 | ||
![]() |
0ca1b6afcf | ||
![]() |
d3c9f3d6f8 | ||
![]() |
df59ca1a45 | ||
![]() |
9d84442409 | ||
![]() |
5ab9d72e45 | ||
![]() |
6060e7ed96 | ||
![]() |
7ca7f7a725 | ||
![]() |
355b3d3057 | ||
![]() |
d5bdf5f89c | ||
![]() |
17de7e0f1c | ||
![]() |
2cea484428 | ||
![]() |
fb3e19ae50 | ||
![]() |
99db7fb222 | ||
![]() |
49d0272627 |
256
CHANGES
256
CHANGES
@@ -6,6 +6,262 @@
|
|||||||
|
|
||||||
Changelog
|
Changelog
|
||||||
|
|
||||||
|
Version 7.12.2 (18 October 2004)
|
||||||
|
|
||||||
|
Daniel (16 October 2004)
|
||||||
|
- Alexander Krasnostavsky made the CURLOPT_FTP_CREATE_MISSING_DIRS option work
|
||||||
|
fine even for third party transfers.
|
||||||
|
|
||||||
|
- runekl at opoint.com found out (and provided a fix) that libcurl leaked
|
||||||
|
memory for cookies with the "max-age" field set.
|
||||||
|
|
||||||
|
Gisle (16 October 2004)
|
||||||
|
- Issue 50 in TODO-RELEASE; Added Traian Nicolescu's patches for threaded
|
||||||
|
resolver on Windows. Plugged some potential handle and memory leaks.
|
||||||
|
|
||||||
|
Daniel (14 October 2004)
|
||||||
|
- Eric Vergnaud pointed out that libcurl didn't treat ?-letters in the user
|
||||||
|
name and password fields properly in URLs, like
|
||||||
|
ftp://us?er:pass?word@site.com/. Added test 191 to verify the fix.
|
||||||
|
|
||||||
|
Daniel (11 October 2004)
|
||||||
|
- libcurl now uses SO_NOSIGPIPE for systems that support it (Mac OS X 10.2 or
|
||||||
|
later is one) to inhibit the SIGPIPE signal when writing to a socket while
|
||||||
|
the peer dies. The same effect is provide by the MSG_NOSIGNAL parameter to
|
||||||
|
send() on other systems. Alan Pinstein verified the fix.
|
||||||
|
|
||||||
|
Daniel (10 October 2004)
|
||||||
|
- Systems with 64bit longs no longeruse strtoll() or our strtoll- replacement
|
||||||
|
to parse 64 bit numbers. strtol() works fine. Added a configure check to
|
||||||
|
detect if [constant]LL works and if so, use that in the strtoll replacement
|
||||||
|
code to work around compiler warnings reported by Andy Cedilnik.
|
||||||
|
|
||||||
|
Gisle (6 October 2004)
|
||||||
|
- For USE_LIBIDN builds: Added Top-Level-Domain (TLD) check of host-name
|
||||||
|
used in fix_hostname(). Checks if characters in 'host->name' (indirectly
|
||||||
|
via 'ace_hostname') are legal according to the TLD tables in libidn.
|
||||||
|
|
||||||
|
Daniel (6 October 2004)
|
||||||
|
- Chih-Chung Chang reported that if you use CURLOPT_RESUME_FROM and enabled
|
||||||
|
CURLOPT_FOLLOWLOCATION, libcurl reported error if a redirect happened even
|
||||||
|
if the new URL would provide the resumed file. Test case 188 added to verify
|
||||||
|
the fix (together with existing test 99).
|
||||||
|
|
||||||
|
- Dan Fandrich fixed a configure flaw for systems that need both nsl and socket
|
||||||
|
libs to use gethostbyname().
|
||||||
|
|
||||||
|
- Removed tabs and trailing whitespace from lots of source files.
|
||||||
|
|
||||||
|
Daniel (5 October 2004)
|
||||||
|
- Made configure --with-libidn=PATH try the given PATH before the default
|
||||||
|
paths to make it possible to override.
|
||||||
|
|
||||||
|
- If idna_strerror() is present in libidn, we can use that instead of our
|
||||||
|
internal replacement. This function was added by Simon in libidn 0.5.6 and
|
||||||
|
is detected by configure.
|
||||||
|
|
||||||
|
- It seems basename() on IRIX is in the libgen library and since we don't use
|
||||||
|
that, configure finds libgen.h but not basename and then we get a compiler
|
||||||
|
error because our basename() replacement doesn't match the proto in
|
||||||
|
libgen.h. Starting now, we don't include the file if basename wasn't found
|
||||||
|
as well.
|
||||||
|
|
||||||
|
Daniel (4 October 2004)
|
||||||
|
- Chris found a race condition resulting in CURLE_COULDNT_RESOLVE_HOST and
|
||||||
|
potential crash, in the windows threaded name resolver code.
|
||||||
|
|
||||||
|
Daniel (3 October 2004)
|
||||||
|
- Replaced the use of isspace() in cookie.c with our own version instead since
|
||||||
|
we have most data as 'char *' and that makes us pass in negative values if
|
||||||
|
there is 8bit data in the string. Changing to unsigned causes too much
|
||||||
|
warnings or too many required typecasts to the normal string functions.
|
||||||
|
Harshal Pradhan identified this problem.
|
||||||
|
|
||||||
|
Daniel (2 October 2004)
|
||||||
|
- Bertrand Demiddelaer found a case where libcurl could read already freed
|
||||||
|
data when CURLOPT_VERBOSE is used and a (very) persistent connection. It
|
||||||
|
happened when the dns cache entry for the connection was pruned while the
|
||||||
|
connection was still alive and then again re-used. We worked together on
|
||||||
|
this fix.
|
||||||
|
|
||||||
|
- Gisle Vanem provided code that displays an error message when the (libidn
|
||||||
|
based) IDN conversion fails. This is really due to a missing suitable
|
||||||
|
function in the libidn API that I hope we can remove once libidn gets a
|
||||||
|
function like this.
|
||||||
|
|
||||||
|
Daniel (1 October 2004)
|
||||||
|
- Aleksandar Milivojevic reported a problem in the Redhat bugzilla (see
|
||||||
|
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=134133) and not to
|
||||||
|
anyone involved in the curl project! This happens when you try to curl a
|
||||||
|
file from a proftpd site using SSL. It seems proftpd sends a somewhat
|
||||||
|
unorthodox response code (232 instead of 230). I relaxed the response code
|
||||||
|
check to deal with this and similar cases.
|
||||||
|
|
||||||
|
- Based on Fedor Karpelevitch's formpost path basename patch, file parts in
|
||||||
|
formposts no longer include the path part. If you _really_ want them, you
|
||||||
|
must provide your preferred full file name with CURLFORM_FILENAME.
|
||||||
|
|
||||||
|
Added detection for libgen.h and basename() to configure. My custom
|
||||||
|
basename() replacement function for systems without it, might be a bit too
|
||||||
|
naive...
|
||||||
|
|
||||||
|
Updated 6 test cases to make them work with the stripped paths.
|
||||||
|
|
||||||
|
Daniel (30 September 2004)
|
||||||
|
- Larry Campbell added CURLINFO_OS_ERRNO to curl_easy_getinfo() that allows an
|
||||||
|
app to retrieve the errno variable after a (connect) failure. It will make
|
||||||
|
sense to provide this for more failures in a more generic way, but let's
|
||||||
|
start like this.
|
||||||
|
|
||||||
|
- G<>nter Knauf and Casey O'Donnell worked out an extra #if condition for the
|
||||||
|
curl/multi.h header to work better in winsock-using apps.
|
||||||
|
|
||||||
|
- Jean-Philippe Barrette-LaPierre made buildconf run better on Mac OS X by
|
||||||
|
properly using glibtoolize instead of plain libtoolize. (This is made if
|
||||||
|
glibtool was found and used instead of plain libtool.)
|
||||||
|
|
||||||
|
Daniel (29 September 2004)
|
||||||
|
- Bertrand Demiddelaer fixed curl_easy_reset() so that it doesn't mistakingly
|
||||||
|
enable the progress meter.
|
||||||
|
|
||||||
|
Daniel (28 September 2004)
|
||||||
|
- "Mekonikum" found out that if you built curl without SSL support, although
|
||||||
|
your current SSL installation supports Engine, the compile fails.
|
||||||
|
|
||||||
|
Daniel (27 September 2004)
|
||||||
|
- When --with-ssl=PATH is used to the configure script, it no longer uses
|
||||||
|
pkg-config to figure out extra details. That is now only done if no PATH is
|
||||||
|
included or if SSL is checked for by default without the --with-ssl option.
|
||||||
|
|
||||||
|
Daniel (25 September 2004)
|
||||||
|
- Peter Sylvester pointed out that CURLOPT_SSLENGINE couldn't even be set to
|
||||||
|
NULL when no engine was supported. It can now.
|
||||||
|
|
||||||
|
Daniel (22 September 2004)
|
||||||
|
- Dan Fandrich fixed three test cases to no longer use "localhost" but instead
|
||||||
|
use "127.0.0.1" to avoid requiring that localhost resolves nicely.
|
||||||
|
|
||||||
|
- Jean-Claude Chauve fixed an LDAP crash when more than one record was
|
||||||
|
retrieved.
|
||||||
|
|
||||||
|
Daniel (19 September 2004)
|
||||||
|
- Andreas Rieke pointed out that when attempting to connect to a host without
|
||||||
|
a service on the specified port, curl_easy_perform() didn't properly provide
|
||||||
|
an error message in the CURLOPT_ERRORBUFFER buffer.
|
||||||
|
|
||||||
|
Daniel (16 September 2004)
|
||||||
|
- Daniel at touchtunes uses the FTP+SSL server "BSDFTPD-SSL from
|
||||||
|
http://bsdftpd-ssl.sc.ru/" which accordingly doesn't properly work with curl
|
||||||
|
when "AUTH SSL" is issued (although the server responds fine and everything)
|
||||||
|
but requires that curl issues "AUTH TLS" instead. See
|
||||||
|
http://curl.haxx.se/feedback/display.cgi?id=10951944937603&support=yes
|
||||||
|
|
||||||
|
Introducing CURLOPT_FTPSSLAUTH that allows the application to select which
|
||||||
|
of the AUTH strings to attempt first.
|
||||||
|
|
||||||
|
- Anonymous filed bug report #1029478 which identified a bug when you 1) used
|
||||||
|
a URL without properly seperating the host name and the parameters with a
|
||||||
|
slash. 2) the URL had parameters to the right of a ? that contains a slash
|
||||||
|
3) curl was told to follow Location:s 4) the request got a response that
|
||||||
|
contained a Location: to redirect to "/dir". curl then appended the new path
|
||||||
|
on the wrong position of the original URL.
|
||||||
|
|
||||||
|
Test case 187 was added to verify that this was fixed properly.
|
||||||
|
|
||||||
|
Daniel (11 September 2004)
|
||||||
|
- Added parsedate.c that contains a rewrite of the date parser currently
|
||||||
|
provided by getdate.y. The new one is MUCH smaller and will allow us to run
|
||||||
|
away from the yacc/bison jungle. It is also slightly lacking in features
|
||||||
|
compared to the old one, but it supports parsing of all date formats HTTP
|
||||||
|
involves (and a fair bunch of others).
|
||||||
|
|
||||||
|
Daniel (10 September 2004)
|
||||||
|
- As found out by Jonas Forsman, curl didn't allow -F to set Content-Type on
|
||||||
|
text-parts. Starting now, we can do -F "name=daniel;type=text/extra". Added
|
||||||
|
test case 186 to verify.
|
||||||
|
|
||||||
|
- Bug report #1025986. When following a Location: with a custom Host: header
|
||||||
|
replacement, curl only replaced the Host: header on the initial request
|
||||||
|
and didn't replace it on the following ones. This resulted in requests with
|
||||||
|
two Host: headers.
|
||||||
|
|
||||||
|
Now, curl checks if the location is on the same host as the initial request
|
||||||
|
and then continues to replace the Host: header. And when it moves to another
|
||||||
|
host, it doesn't replace the Host: header but it also doesn't make the
|
||||||
|
second Host: header get used in the request.
|
||||||
|
|
||||||
|
This change is verified by the two new test cases 184 and 185.
|
||||||
|
|
||||||
|
Daniel (8 September 2004)
|
||||||
|
- Modified the test suite to be able to use and run with customized port
|
||||||
|
numbers. This was always intended but never before possible. Now a simple
|
||||||
|
change in the runtests.pl script can make all tests use different ports.
|
||||||
|
The default ports in use from now on are 8990 to 8993.
|
||||||
|
|
||||||
|
Daniel (2 September 2004)
|
||||||
|
- Minor modification of an SSL-related error message.
|
||||||
|
|
||||||
|
Daniel (31 August 2004)
|
||||||
|
- David Tarendash found out that curl_multi_add_handle() returned
|
||||||
|
CURLM_CALL_MULTI_PERFORM instead of CURLM_OK.
|
||||||
|
|
||||||
|
Daniel (30 August 2004)
|
||||||
|
- Make "Proxy-Connection: close" close the current proxy connection, as Roman
|
||||||
|
Koifman found out.
|
||||||
|
|
||||||
|
Daniel (24 August 2004)
|
||||||
|
- Fixed a getdate problem by post-replacing the getdate.c file after the
|
||||||
|
bison/yacc process to add the fix Harshal Pradhan suggested. The problem
|
||||||
|
caused a crash on Windows when parsing some dates.
|
||||||
|
|
||||||
|
Daniel (23 August 2004)
|
||||||
|
- Roman Koifman pointed out that libcurl send Expect: 100-continue on POSTs
|
||||||
|
even when told to use HTTP 1.0, which is not correct. Test case 180 and
|
||||||
|
181 verify this.
|
||||||
|
|
||||||
|
- Added test case 182 to verify that zero byte transfers call the callback
|
||||||
|
properly.
|
||||||
|
|
||||||
|
Daniel (20 August 2004)
|
||||||
|
- Alexander Krasnostavsky made the write callback get called even when a zero
|
||||||
|
byte file is downloaded.
|
||||||
|
|
||||||
|
Daniel (18 August 2004)
|
||||||
|
- Ling Thio pointed out that when libcurl is built ipv6-enabled, it still did
|
||||||
|
reverse DNS lookups when fed with a numerical IP-address (like
|
||||||
|
http://127.0.0.1/), although it doesn't when built ipv6-disabled. libcurl
|
||||||
|
should never do reverse lookups.
|
||||||
|
|
||||||
|
Daniel (17 August 2004)
|
||||||
|
- Kjetil Jacobsen noticed that when transferring a file:// URL pointing to an
|
||||||
|
empty file, libcurl would return with the file still open.
|
||||||
|
|
||||||
|
- Alexander Krasnostavsky pointed out that the configure script needs to define
|
||||||
|
_THREAD_SAFE for AIX systems to make libcurl built really thread-safe.
|
||||||
|
|
||||||
|
Also added a check for the xlc compiler on AIX, and if that is detect we use
|
||||||
|
the -qthreaded compiler option
|
||||||
|
|
||||||
|
Daniel (16 August 2004)
|
||||||
|
- libcurl now allows a custom "Accept-Encoding:" header override the
|
||||||
|
internally set one that gets set with CURLOPT_ENCODING. Pointed out by Alex.
|
||||||
|
|
||||||
|
- Roland Krikava found and fixed a cookie problem when using a proxy (the
|
||||||
|
path matching was wrong). I added test case 179 to verify that we now do
|
||||||
|
right.
|
||||||
|
|
||||||
|
Daniel (15 August 2004)
|
||||||
|
- Casey O'Donnell fixed some MSVC makefile targets to link properly.
|
||||||
|
|
||||||
|
Daniel (11 August 2004)
|
||||||
|
- configure now defines _XOPEN_SOURCE to 500 on systems that need it to build
|
||||||
|
warning-free (the only known one so far is non-gcc builds on 64bit SGI
|
||||||
|
IRIX). (Reverted this change later as it caused compiler errors.)
|
||||||
|
|
||||||
|
- the FTP code now includes the server response in the error message when the
|
||||||
|
server gives back a 530 after the password is provided, as it isn't
|
||||||
|
necessary because of a bad user name or password.
|
||||||
|
|
||||||
Version 7.12.1 (10 August 2004)
|
Version 7.12.1 (10 August 2004)
|
||||||
|
|
||||||
Daniel (10 August 2004)
|
Daniel (10 August 2004)
|
||||||
|
2
README
2
README
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
README
|
README
|
||||||
|
|
||||||
Curl is a command line tool for transfering data specified with URL
|
Curl is a command line tool for transferring data specified with URL
|
||||||
syntax. Find out how to use Curl by reading the curl.1 man page or the
|
syntax. Find out how to use Curl by reading the curl.1 man page or the
|
||||||
MANUAL document. Find out how to install Curl by reading the INSTALL
|
MANUAL document. Find out how to install Curl by reading the INSTALL
|
||||||
document.
|
document.
|
||||||
|
129
RELEASE-NOTES
129
RELEASE-NOTES
@@ -1,83 +1,84 @@
|
|||||||
Curl and libcurl 7.12.1
|
Curl and libcurl 7.12.2
|
||||||
|
|
||||||
Public curl release number: 82
|
Public curl release number: 83
|
||||||
Releases counted from the very beginning: 109
|
Releases counted from the very beginning: 110
|
||||||
Available command line options: 96
|
Available command line options: 96
|
||||||
Available curl_easy_setopt() options: 120
|
Available curl_easy_setopt() options: 121
|
||||||
Number of public functions in libcurl: 36
|
Number of public functions in libcurl: 36
|
||||||
Amount of public web site mirrors: 12
|
Amount of public web site mirrors: 13
|
||||||
Number of known libcurl bindings: 26
|
Number of known libcurl bindings: 27
|
||||||
|
|
||||||
This release includes the following changes:
|
This release includes the following changes:
|
||||||
|
|
||||||
o the version string now only contains info about (sub) package versions,
|
o the IDN code now verifies that only TLD-legitmate letters are used in the
|
||||||
while for example krb4 and ipv6 now only are available as 'features'
|
name or a warning is displayed (when verbose is enabled)
|
||||||
o added curl_easy_reset()
|
o provides error texts for IDN errors
|
||||||
o socks proxy support even when libcurl is built ipv6-enabled
|
o file upload parts in formposts now get their directory names cut off
|
||||||
o read callbacks can stop the transfer by returning CURL_READFUNC_ABORT
|
o added CURLINFO_OS_ERRNO
|
||||||
o libcurl-tutorial.3 is the new man page formerly known as libcurl-the-guide
|
o added CURLOPT_FTPSSLAUTH to allow ftp connects to attempt "AUTH TLS" instead
|
||||||
o additional SSL trace data might be sent to the debug callback using two new
|
before "AUTH SSL"
|
||||||
types: CURLINFO_SSL_DATA_IN and CURLINFO_SSL_DATA_OUT
|
o curl_getdate() completely rewritten: may affect rare curl -z use cases
|
||||||
o multipart formposts can upload files larger than system memory
|
|
||||||
o the curl tool continues with the next URL even if one transfer fails
|
|
||||||
o FTP 3rd party transfer support - seven new setopt() options
|
|
||||||
|
|
||||||
This release includes the following bugfixes:
|
This release includes the following bugfixes:
|
||||||
|
|
||||||
o UTF-8 encoded certificate names can now be verified properly
|
o CURLOPT_FTP_CREATE_MISSING_DIRS works for third party transfers
|
||||||
o krb4 link problem
|
o memory leak for cookies received with max-age set
|
||||||
o HTTP Negotiate service name now provided in uppercase
|
o potential memory leaks in the window name resolver
|
||||||
o no longer accepts any cookies with domain set to just a TLD
|
o URLs with ?-letters in the user name or password fields
|
||||||
o HTTP Digest properties without quotes in the header
|
o libcurl error message is now provided when send() fails
|
||||||
o bad Host: header case on re-used connections over proxy
|
o no more SIGPIPE on Mac OS X and other SO_NOSIGPIPE-supporting platforms
|
||||||
o duplicate Host: header case on re-used connections
|
o HTTP resume was refused if redirected
|
||||||
o curl -o name#[num] now works when no globbing for [num] exists
|
o configure's gethostbyname check when both nsl and socket libs are required
|
||||||
o test suite runs fine with valgrind 2.1.x
|
o configure --with-libidn now checks the given path before defaults
|
||||||
o negative Content-Length is ignored
|
o a race condition sometimes resulting in CURLE_COULDNT_RESOLVE_HOST in the
|
||||||
o test 505 runs fine on windows
|
windows threaded name resolver code
|
||||||
o curl_share_cleanup() crash
|
o isspace() invokes with negative values in the cookie code
|
||||||
o --trace files now get the final info lines too
|
o a case of read-already-freed-data when CURLOPT_VERBOSE is used and a (very)
|
||||||
o multi interface connects fine to multi-IP resolving hosts
|
persistent connection
|
||||||
o --limit-rate works on Mac OS X (and other systems with bad poll()s)
|
o now includes descriptive error messages for IDN errors
|
||||||
o cookies can now hold 4999 bytes of content
|
o more forgivning PASS response code check for better working with proftpd
|
||||||
o HTTP POST/PUT with NTLM/Digest/Negotiate to a URL returning 3XX
|
o curl/multi.h works better included in winsock-using apps
|
||||||
o HTTPS POST/PUT over a proxy requiring NTLM/Digest/Negotiate
|
o curl_easy_reset() no longer enables the progress meter
|
||||||
o less restrictive libidn requirements, 0.4.1 or later is fine
|
o build fix for SSL disabled curl with SSL Engine support present
|
||||||
o HTTP POST or PUT with Digest/Negotiate/NTLM selected but the server
|
o configure --with-ssl=PATH now ignores pkg-config path info
|
||||||
didn't require any authentication
|
o CURLOPT_SSLENGINE can be set to NULL even if no engine support is available
|
||||||
o win32 file:// transfer free memory bug
|
o LDAP crash when more than one record was received
|
||||||
o configure --disable-http builds a libcurl without HTTP support
|
o connect failures properly stores an error message in the errorbuffer
|
||||||
o CURLOPT_FILETIME had wrong type in curl.h, it expects a long argument
|
o Rare Location:-following problem with bad original URL
|
||||||
o builds fine with Borland on Windows
|
o -F can now add Content-Type on non-file sections
|
||||||
o the msvc curllib.dsp now builds the libcurl.lib file
|
o double Host: header when following Location: with replaced Host:
|
||||||
o builds fine on VMS
|
o curl_multi_add_handle() return code
|
||||||
o builds fine on NetWare
|
o "Proxy-Connection: close" is now understood and properly dealt with
|
||||||
o HTTP Digest authentication with proxies uses correct user name + password
|
o curl_getdate() crash
|
||||||
o builds fine with lcc-win32
|
o downloading empty files now calls the write callback properly
|
||||||
|
o no reverse DNS lookups for ip-only addresses with ipv6-enabled libcurl
|
||||||
|
o file handler leak when getting an empty file:// URL
|
||||||
|
o libcurl works better multi-threaded on AIX (when built with xlc)
|
||||||
|
o cookies over proxy didn't match the path properly
|
||||||
|
o MSVC makefile fixes to build better
|
||||||
|
o FTP response 530 on 'PASS' now sends back a better error message
|
||||||
|
|
||||||
Other curl-related news since the previous public release:
|
Other curl-related news since the previous public release:
|
||||||
|
|
||||||
o James Hu took over after Kevin Roth as maintainer of the curl package on
|
o AdacURL version 7.12.1 http://www.almroth.com/adacurl/index.html
|
||||||
cygwin. Many saludos to Kevin for a work well done during many years.
|
o pycurl version 7.12.1 http://pycurl.sourceforge.net/
|
||||||
o Gambas binding: http://gambas.sf.net
|
o tclcurl version 0.12.1
|
||||||
o pycurl 7.12.0 was released http://pycurl.sf.net
|
|
||||||
o wxWidgets binding: http://homepage.mac.com/codonnell/wxcurldav/
|
|
||||||
o New Austrian curl web mirror: http://curl.gds.tuwien.ac.at
|
|
||||||
o TclCurl 0.12.0 was released:
|
|
||||||
http://personal1.iddeo.es/andresgarci/tclcurl/english/
|
http://personal1.iddeo.es/andresgarci/tclcurl/english/
|
||||||
o Ch binding: http://chcurl.sourceforge.net
|
o libcurl.NET was announce: http://www.seasideresearch.com/downloads.html
|
||||||
o New US curl web mirror: http://curl.109k.com
|
o Get your fresh Mozilla-extracted ca cert bundle here:
|
||||||
o glib/GTK+ binding: http://atterer.net/glibcurl/
|
http://curl.haxx.se/docs/caextract.html
|
||||||
o New French curl web mirror: http://curl.mirror.internet.tp
|
o New web mirror in Taiwan: http://curl.cs.pu.edu.tw/
|
||||||
|
|
||||||
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:
|
||||||
|
|
||||||
Gisle Vanem, Vincent Bronner, Alexander Krasnostavsky, Chris Gaukroger,
|
Casey O'Donnell, Roland Krikava, Alex, Alexander Krasnostavsky, Kjetil
|
||||||
G<EFBFBD>nter Knauf, Marty Kuhrt, Kjetil Jacobsen, Steven Bazyl, Seshubabu Pasam,
|
Jacobsen, Ling Thio, Roman Koifman, Harshal Pradhan, Jonas Forsman, David
|
||||||
Luca Alteas, Jean-Louis Lemaire, David Byron, David Cohen, Rob Stanzel,
|
Tarendash, Daniel at touchtunes, Bertrand Demiddelaer, Andreas Rieke,
|
||||||
Niels van Tongeren, Andr<64>s Garc<72>a, Toby Peterson, Casey O'Donnell, Brian
|
Jean-Claude Chauve, Dan Fandrich, Peter Sylvester, "Mekonikum", Jean-Philippe
|
||||||
Akins, Bertrand Demiddelaer, Joel Chen, Dylan Salisbury, Enrico Scholz,
|
Barrette-LaPierre, G<>nter Knauf, Larry Campbell, Fedor Karpelevitch,
|
||||||
Alexis Carvalho
|
Aleksandar Milivojevic, Gisle Vanem, Chris "Bob Bob", Chih-Chung Chang, Andy
|
||||||
|
Cedilnik, Alan Pinstein, Eric Vergnaud, Traian Nicolescu, runekl at
|
||||||
|
opoint.com
|
||||||
|
|
||||||
Thanks! (and sorry if I forgot to mention someone)
|
Thanks! (and sorry if I forgot to mention someone)
|
||||||
|
10
TODO-RELEASE
10
TODO-RELEASE
@@ -1,9 +1,11 @@
|
|||||||
Issues not sorted in any particular order.
|
Issues not sorted in any particular order.
|
||||||
|
|
||||||
To get fixed in 7.12.2 (planned release: December 2004)
|
To get fixed in 7.12.2 (planned release: mid October 2004)
|
||||||
======================
|
======================
|
||||||
|
|
||||||
36. Fix HTTP Negotiate authentication so that no bogus user name needs to be
|
To get fixed in 7.12.3 (planned release: December 2004)
|
||||||
provided to activate it.
|
======================
|
||||||
|
|
||||||
Bugfixes reported until late November
|
47 - Peter Sylvester's patch for SRP on the TLS layer
|
||||||
|
|
||||||
|
48 - MSVC Makefile improvements by Samuel D<>az Garc<72>a
|
||||||
|
@@ -6,3 +6,17 @@ ahost
|
|||||||
config.log
|
config.log
|
||||||
config.status
|
config.status
|
||||||
aclocal.m4
|
aclocal.m4
|
||||||
|
.deps
|
||||||
|
Makefile.in
|
||||||
|
config.guess
|
||||||
|
config.h
|
||||||
|
config.h.in
|
||||||
|
config.sub
|
||||||
|
libtool
|
||||||
|
ltmain.sh
|
||||||
|
stamp-h1
|
||||||
|
*.lo
|
||||||
|
.libs
|
||||||
|
depcomp
|
||||||
|
libcares.la
|
||||||
|
missing
|
||||||
|
50
ares/CHANGES
50
ares/CHANGES
@@ -1,5 +1,55 @@
|
|||||||
Changelog for the c-ares project
|
Changelog for the c-ares project
|
||||||
|
|
||||||
|
* September 29
|
||||||
|
|
||||||
|
- Henrik Stoerner fix: got a report that Tru64 Unix (the unix from Digital
|
||||||
|
when they made Alpha's) uses /etc/svc.conf for the purpose fixed below for
|
||||||
|
other OSes. He made c-ares check for and understand it if present.
|
||||||
|
|
||||||
|
- Now c-ares will use local host name lookup _before_ DNS resolving by default
|
||||||
|
if nothing else is told.
|
||||||
|
|
||||||
|
* September 26
|
||||||
|
|
||||||
|
- Henrik Stoerner: found out that c-ares does not look at the /etc/host.conf
|
||||||
|
file to determine the sequence in which to search /etc/hosts and DNS. So on
|
||||||
|
systems where this order is defined by /etc/host.conf instead of a "lookup"
|
||||||
|
entry in /etc/resolv.conf, c-ares will always default to looking in DNS
|
||||||
|
first, and /etc/hosts second.
|
||||||
|
|
||||||
|
c-ares now looks at
|
||||||
|
|
||||||
|
1) resolv.conf (for the "lookup" line);
|
||||||
|
2) nsswitch.fon (for the "hosts:" line);
|
||||||
|
3) host.conf (for the "order" line).
|
||||||
|
|
||||||
|
First match wins.
|
||||||
|
|
||||||
|
- Dominick Meglio patched: C-ares on Windows assumed that the HOSTS file is
|
||||||
|
located in a static location. It assumed
|
||||||
|
C:\Windows\System32\Drivers\Etc. This is a poor assumption to make. In fact,
|
||||||
|
the location of the HOSTS file can be changed via a registry setting.
|
||||||
|
|
||||||
|
There is a key called DatabasePath which specifies the path to the HOSTS
|
||||||
|
file:
|
||||||
|
http://www.microsoft.com/technet/itsolutions/network/deploy/depovg/tcpip2k.mspx
|
||||||
|
|
||||||
|
The patch will make c-ares correctly consult the registry for the location
|
||||||
|
of this file.
|
||||||
|
|
||||||
|
* August 29
|
||||||
|
|
||||||
|
- Gisle Vanem fixed the MSVC build files.
|
||||||
|
|
||||||
|
* August 20
|
||||||
|
|
||||||
|
- Gisle Vanem made c-ares build and work with his Watt-32 TCP/IP stack.
|
||||||
|
|
||||||
|
* August 13
|
||||||
|
|
||||||
|
- Harshal Pradhan made a minor syntax change in ares_init.c to make it build
|
||||||
|
fine with MSVC 7.1
|
||||||
|
|
||||||
* July 24
|
* July 24
|
||||||
|
|
||||||
- Made the lib get built static only if --enable-debug is used.
|
- Made the lib get built static only if --enable-debug is used.
|
||||||
|
@@ -1,9 +1,11 @@
|
|||||||
#
|
#
|
||||||
# c-ares Makefile for djgpp/gcc/Watt-32
|
# c-ares Makefile for djgpp/gcc/Watt-32.
|
||||||
# By Gisle Vanem <giva@bgnett.no> 2004.
|
# By Gisle Vanem <giva@bgnett.no> 2004.
|
||||||
#
|
#
|
||||||
.SUFFIXES: .exe
|
.SUFFIXES: .exe
|
||||||
|
|
||||||
|
include Makefile.inc
|
||||||
|
|
||||||
WATT32_ROOT = $(subst \,/,$(WATT_ROOT))
|
WATT32_ROOT = $(subst \,/,$(WATT_ROOT))
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
@@ -11,17 +13,9 @@ CFLAGS = -O2 -Wall -DWATT32 -Dselect=select_s -I$(WATT32_ROOT)/inc
|
|||||||
LDFLAGS = -s
|
LDFLAGS = -s
|
||||||
EX_LIBS = $(WATT32_ROOT)/lib/libwatt.a
|
EX_LIBS = $(WATT32_ROOT)/lib/libwatt.a
|
||||||
|
|
||||||
SOURCE = ares_cancel.c ares_destroy.c ares_expand_name.c ares_expand_string.c ares_fds.c \
|
|
||||||
ares_free_hostent.c ares_free_string.c ares_gethostbyaddr.c ares_gethostbyname.c \
|
|
||||||
ares_init.c ares_mkquery.c ares_parse_a_reply.c ares_parse_ptr_reply.c \
|
|
||||||
ares_process.c ares_query.c ares_search.c ares_send.c ares_strerror.c \
|
|
||||||
ares_timeout.c ares__close_sockets.c ares__get_hostent.c ares__read_line.c \
|
|
||||||
ares_version.c
|
|
||||||
|
|
||||||
OBJ_DIR = djgpp
|
OBJ_DIR = djgpp
|
||||||
|
|
||||||
OBJECTS = $(addprefix $(OBJ_DIR)/, $(SOURCE:.c=.o))
|
OBJECTS = $(addprefix $(OBJ_DIR)/, $(CSOURCES:.c=.o))
|
||||||
|
|
||||||
|
|
||||||
all: $(OBJ_DIR) libcares.a ahost.exe adig.exe
|
all: $(OBJ_DIR) libcares.a ahost.exe adig.exe
|
||||||
@echo Welcome to c-ares.
|
@echo Welcome to c-ares.
|
||||||
@@ -50,7 +44,7 @@ $(OBJ_DIR)/%.o: %.c
|
|||||||
@echo
|
@echo
|
||||||
|
|
||||||
depend:
|
depend:
|
||||||
$(CC) -MM $(CFLAGS) $(SOURCE) | \
|
$(CC) -MM $(CFLAGS) $(CSOURCES) | \
|
||||||
sed -e 's/^\([a-zA-Z0-9_-]*\.o:\)/$$(OBJ_DIR)\/\1/' > depend.dj
|
sed -e 's/^\([a-zA-Z0-9_-]*\.o:\)/$$(OBJ_DIR)\/\1/' > depend.dj
|
||||||
|
|
||||||
-include depend.dj
|
-include depend.dj
|
||||||
|
@@ -88,7 +88,7 @@ LD = nlmconv
|
|||||||
LDFLAGS = -T
|
LDFLAGS = -T
|
||||||
AR = ar
|
AR = ar
|
||||||
ARFLAGS = -cq
|
ARFLAGS = -cq
|
||||||
CFLAGS += -fno-builtin -fpack-struct -fpcc-struct-return
|
CFLAGS += -fno-builtin -fpack-struct -fpcc-struct-return -fno-strict-aliasing
|
||||||
CFLAGS += -Wall -Wno-format # -pedantic
|
CFLAGS += -Wall -Wno-format # -pedantic
|
||||||
ifeq ($(LIBARCH),LIBC)
|
ifeq ($(LIBARCH),LIBC)
|
||||||
PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
|
PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
|
||||||
|
11
ares/ares.h
11
ares/ares.h
@@ -27,11 +27,14 @@
|
|||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WATT32)
|
||||||
#include <winsock.h>
|
#include <netinet/in.h>
|
||||||
#include <windows.h>
|
#include <tcp.h>
|
||||||
|
#elif defined(WIN32)
|
||||||
|
#include <winsock.h>
|
||||||
|
#include <windows.h>
|
||||||
#else
|
#else
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ARES_SUCCESS 0
|
#define ARES_SUCCESS 0
|
||||||
|
@@ -16,10 +16,10 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#ifdef WIN32
|
#ifdef HAVE_UNISTD_H
|
||||||
#else
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "ares_private.h"
|
#include "ares_private.h"
|
||||||
|
|
||||||
|
@@ -16,9 +16,7 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if !defined(WIN32) || defined(WATT32)
|
||||||
|
|
||||||
#else
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include "nameser.h"
|
#include "nameser.h"
|
||||||
#else
|
#else
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include "nameser.h"
|
#include "nameser.h"
|
||||||
#else
|
#else
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
@@ -16,9 +16,7 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef HAVE_SYS_TIME_H
|
||||||
|
|
||||||
#else
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -16,9 +16,7 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if !defined(WIN32) || defined(WATT32)
|
||||||
|
|
||||||
#else
|
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include "nameser.h"
|
#include "nameser.h"
|
||||||
#else
|
#else
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
@@ -28,9 +28,14 @@
|
|||||||
#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_private.h"
|
#include "ares_private.h"
|
||||||
|
|
||||||
|
#ifdef WATT32
|
||||||
|
#undef WIN32
|
||||||
|
#endif
|
||||||
|
|
||||||
struct addr_query {
|
struct addr_query {
|
||||||
/* Arguments passed to ares_gethostbyaddr() */
|
/* Arguments passed to ares_gethostbyaddr() */
|
||||||
ares_channel channel;
|
ares_channel channel;
|
||||||
@@ -145,12 +150,23 @@ static int file_lookup(struct in_addr *addr, struct hostent **host)
|
|||||||
|
|
||||||
char PATH_HOSTS[MAX_PATH];
|
char PATH_HOSTS[MAX_PATH];
|
||||||
if (IsNT) {
|
if (IsNT) {
|
||||||
GetSystemDirectory(PATH_HOSTS, MAX_PATH);
|
char tmp[MAX_PATH];
|
||||||
strcat(PATH_HOSTS, PATH_HOSTS_NT);
|
HKEY hkeyHosts;
|
||||||
} else {
|
|
||||||
GetWindowsDirectory(PATH_HOSTS, MAX_PATH);
|
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ, &hkeyHosts)
|
||||||
strcat(PATH_HOSTS, PATH_HOSTS_9X);
|
== ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
DWORD dwLength = MAX_PATH;
|
||||||
|
RegQueryValueEx(hkeyHosts, DATABASEPATH, NULL, NULL, tmp,
|
||||||
|
&dwLength);
|
||||||
|
ExpandEnvironmentStrings(tmp, PATH_HOSTS, MAX_PATH);
|
||||||
|
RegCloseKey(hkeyHosts);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
GetWindowsDirectory(PATH_HOSTS, MAX_PATH);
|
||||||
|
|
||||||
|
strcat(PATH_HOSTS, WIN_PATH_HOSTS);
|
||||||
|
|
||||||
#elif defined(WATT32)
|
#elif defined(WATT32)
|
||||||
extern const char *_w32_GetHostsFile (void);
|
extern const char *_w32_GetHostsFile (void);
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include "nameser.h"
|
#include "nameser.h"
|
||||||
#else
|
#else
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
@@ -30,9 +30,14 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "ares_private.h"
|
#include "ares_private.h"
|
||||||
|
|
||||||
|
#ifdef WATT32
|
||||||
|
#undef WIN32
|
||||||
|
#endif
|
||||||
|
|
||||||
struct host_query {
|
struct host_query {
|
||||||
/* Arguments passed to ares_gethostbyname() */
|
/* Arguments passed to ares_gethostbyname() */
|
||||||
ares_channel channel;
|
ares_channel channel;
|
||||||
@@ -215,15 +220,25 @@ static int file_lookup(const char *name, struct hostent **host)
|
|||||||
int status;
|
int status;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
|
||||||
char PATH_HOSTS[MAX_PATH];
|
char PATH_HOSTS[MAX_PATH];
|
||||||
if (IsNT) {
|
if (IsNT) {
|
||||||
GetSystemDirectory(PATH_HOSTS, MAX_PATH);
|
char tmp[MAX_PATH];
|
||||||
strcat(PATH_HOSTS, PATH_HOSTS_NT);
|
HKEY hkeyHosts;
|
||||||
} else {
|
|
||||||
GetWindowsDirectory(PATH_HOSTS, MAX_PATH);
|
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ, &hkeyHosts)
|
||||||
strcat(PATH_HOSTS, PATH_HOSTS_9X);
|
== ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
DWORD dwLength = MAX_PATH;
|
||||||
|
RegQueryValueEx(hkeyHosts, DATABASEPATH, NULL, NULL, tmp,
|
||||||
|
&dwLength);
|
||||||
|
ExpandEnvironmentStrings(tmp, PATH_HOSTS, MAX_PATH);
|
||||||
|
RegCloseKey(hkeyHosts);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
GetWindowsDirectory(PATH_HOSTS, MAX_PATH);
|
||||||
|
|
||||||
|
strcat(PATH_HOSTS, WIN_PATH_HOSTS);
|
||||||
|
|
||||||
#elif defined(WATT32)
|
#elif defined(WATT32)
|
||||||
extern const char *_w32_GetHostsFile (void);
|
extern const char *_w32_GetHostsFile (void);
|
||||||
|
@@ -16,19 +16,25 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include "nameser.h"
|
#include "nameser.h"
|
||||||
#include <iphlpapi.h>
|
#include <iphlpapi.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
#ifdef HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <arpa/nameser.h>
|
#include <arpa/nameser.h>
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -39,13 +45,18 @@
|
|||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "ares_private.h"
|
#include "ares_private.h"
|
||||||
|
|
||||||
|
#ifdef WATT32
|
||||||
|
#undef WIN32 /* Redefined in MingW/MSVC headers */
|
||||||
|
#endif
|
||||||
|
|
||||||
static int init_by_options(ares_channel channel, struct ares_options *options,
|
static int init_by_options(ares_channel channel, struct ares_options *options,
|
||||||
int optmask);
|
int optmask);
|
||||||
static int init_by_environment(ares_channel channel);
|
static int init_by_environment(ares_channel channel);
|
||||||
static int init_by_resolv_conf(ares_channel channel);
|
static int init_by_resolv_conf(ares_channel channel);
|
||||||
static int init_by_defaults(ares_channel channel);
|
static int init_by_defaults(ares_channel channel);
|
||||||
static int config_domain(ares_channel channel, char *str);
|
static int config_domain(ares_channel channel, char *str);
|
||||||
static int config_lookup(ares_channel channel, const char *str);
|
static int config_lookup(ares_channel channel, const char *str,
|
||||||
|
const char *bindch, const char *filech);
|
||||||
static int config_nameserver(struct server_state **servers, int *nservers,
|
static int config_nameserver(struct server_state **servers, int *nservers,
|
||||||
char *str);
|
char *str);
|
||||||
static int config_sortlist(struct apattern **sortlist, int *nsort,
|
static int config_sortlist(struct apattern **sortlist, int *nsort,
|
||||||
@@ -294,7 +305,7 @@ static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size)
|
|||||||
{
|
{
|
||||||
FIXED_INFO *fi = alloca (sizeof(*fi));
|
FIXED_INFO *fi = alloca (sizeof(*fi));
|
||||||
DWORD size = sizeof (*fi);
|
DWORD size = sizeof (*fi);
|
||||||
DWORD WINAPI (*GetNetworkParams) (FIXED_INFO*, DWORD*); /* available only on Win-98/2000+ */
|
DWORD (WINAPI *GetNetworkParams) (FIXED_INFO*, DWORD*); /* available only on Win-98/2000+ */
|
||||||
HMODULE handle;
|
HMODULE handle;
|
||||||
IP_ADDR_STRING *ipAddr;
|
IP_ADDR_STRING *ipAddr;
|
||||||
int i, count = 0;
|
int i, count = 0;
|
||||||
@@ -539,7 +550,7 @@ DhcpNameServer
|
|||||||
if ((p = try_config(line, "domain")))
|
if ((p = try_config(line, "domain")))
|
||||||
status = config_domain(channel, p);
|
status = config_domain(channel, p);
|
||||||
else if ((p = try_config(line, "lookup")) && !channel->lookups)
|
else if ((p = try_config(line, "lookup")) && !channel->lookups)
|
||||||
status = config_lookup(channel, p);
|
status = config_lookup(channel, p, "bind", "file");
|
||||||
else if ((p = try_config(line, "search")))
|
else if ((p = try_config(line, "search")))
|
||||||
status = set_search(channel, p);
|
status = set_search(channel, p);
|
||||||
else if ((p = try_config(line, "nameserver")) && channel->nservers == -1)
|
else if ((p = try_config(line, "nameserver")) && channel->nservers == -1)
|
||||||
@@ -553,9 +564,49 @@ DhcpNameServer
|
|||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
fclose(fp);
|
||||||
|
|
||||||
|
if (!channel->lookups) {
|
||||||
|
/* Many systems (Solaris, Linux, BSD's) use nsswitch.conf */
|
||||||
|
fp = fopen("/etc/nsswitch.conf", "r");
|
||||||
|
if (fp) {
|
||||||
|
while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS)
|
||||||
|
{
|
||||||
|
if ((p = try_config(line, "hosts:")) && !channel->lookups)
|
||||||
|
status = config_lookup(channel, p, "dns", "files");
|
||||||
|
}
|
||||||
|
fclose(fp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!channel->lookups) {
|
||||||
|
/* Linux / GNU libc 2.x and possibly others have host.conf */
|
||||||
|
fp = fopen("/etc/host.conf", "r");
|
||||||
|
if (fp) {
|
||||||
|
while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS)
|
||||||
|
{
|
||||||
|
if ((p = try_config(line, "order")) && !channel->lookups)
|
||||||
|
status = config_lookup(channel, p, "bind", "hosts");
|
||||||
|
}
|
||||||
|
fclose(fp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!channel->lookups) {
|
||||||
|
/* Tru64 uses /etc/svc.conf */
|
||||||
|
fp = fopen("/etc/svc.conf", "r");
|
||||||
|
if (fp) {
|
||||||
|
while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS)
|
||||||
|
{
|
||||||
|
if ((p = try_config(line, "hosts=")) && !channel->lookups)
|
||||||
|
status = config_lookup(channel, p, "bind", "local");
|
||||||
|
}
|
||||||
|
fclose(fp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(line)
|
if(line)
|
||||||
free(line);
|
free(line);
|
||||||
fclose(fp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -649,7 +700,7 @@ static int init_by_defaults(ares_channel channel)
|
|||||||
|
|
||||||
if (!channel->lookups)
|
if (!channel->lookups)
|
||||||
{
|
{
|
||||||
channel->lookups = strdup("bf");
|
channel->lookups = strdup("fb");
|
||||||
if (!channel->lookups)
|
if (!channel->lookups)
|
||||||
return ARES_ENOMEM;
|
return ARES_ENOMEM;
|
||||||
}
|
}
|
||||||
@@ -669,7 +720,8 @@ static int config_domain(ares_channel channel, char *str)
|
|||||||
return set_search(channel, str);
|
return set_search(channel, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int config_lookup(ares_channel channel, const char *str)
|
static int config_lookup(ares_channel channel, const char *str,
|
||||||
|
const char *bindch, const char *filech)
|
||||||
{
|
{
|
||||||
char lookups[3], *l;
|
char lookups[3], *l;
|
||||||
const char *p;
|
const char *p;
|
||||||
@@ -682,11 +734,13 @@ static int config_lookup(ares_channel channel, const char *str)
|
|||||||
p = str;
|
p = str;
|
||||||
while (*p)
|
while (*p)
|
||||||
{
|
{
|
||||||
if ((*p == 'b' || *p == 'f') && l < lookups + 2)
|
if ((*p == *bindch || *p == *filech) && l < lookups + 2) {
|
||||||
*l++ = *p;
|
if (*p == *bindch) *l++ = 'b';
|
||||||
while (*p && !isspace((unsigned char)*p))
|
else *l++ = 'f';
|
||||||
|
}
|
||||||
|
while (*p && !isspace((unsigned char)*p) && (*p != ','))
|
||||||
p++;
|
p++;
|
||||||
while (isspace((unsigned char)*p))
|
while (*p && (isspace((unsigned char)*p) || (*p == ',')))
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
*l = 0;
|
*l = 0;
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include "nameser.h"
|
#include "nameser.h"
|
||||||
#else
|
#else
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include "nameser.h"
|
#include "nameser.h"
|
||||||
#else
|
#else
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include "nameser.h"
|
#include "nameser.h"
|
||||||
#else
|
#else
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
@@ -18,9 +18,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if !defined(WIN32) || defined(WATT32)
|
||||||
|
|
||||||
#else
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
/* We define closesocket() here so that we can use this function all over
|
/* We define closesocket() here so that we can use this function all over
|
||||||
the source code for closing sockets. */
|
the source code for closing sockets. */
|
||||||
@@ -41,15 +39,15 @@
|
|||||||
#define INADDR_NONE 0xffffffff
|
#define INADDR_NONE 0xffffffff
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
|
|
||||||
#define IsNT ((int)GetVersion()>0)
|
#define IsNT ((int)GetVersion()>0)
|
||||||
#define WIN_NS_9X "System\\CurrentControlSet\\Services\\VxD\\MSTCP"
|
#define WIN_NS_9X "System\\CurrentControlSet\\Services\\VxD\\MSTCP"
|
||||||
#define WIN_NS_NT_KEY "System\\CurrentControlSet\\Services\\Tcpip\\Parameters"
|
#define WIN_NS_NT_KEY "System\\CurrentControlSet\\Services\\Tcpip\\Parameters"
|
||||||
#define NAMESERVER "NameServer"
|
#define NAMESERVER "NameServer"
|
||||||
#define DHCPNAMESERVER "DhcpNameServer"
|
#define DHCPNAMESERVER "DhcpNameServer"
|
||||||
#define PATH_HOSTS_NT "\\drivers\\etc\\hosts"
|
#define DATABASEPATH "DatabasePath"
|
||||||
#define PATH_HOSTS_9X "\\hosts"
|
#define WIN_PATH_HOSTS "\\hosts"
|
||||||
|
|
||||||
#elif defined(WATT32)
|
#elif defined(WATT32)
|
||||||
|
|
||||||
|
@@ -16,27 +16,33 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include "nameser.h"
|
#include "nameser.h"
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#ifdef HAVE_SYS_UIO_H
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
|
#endif
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <arpa/nameser.h>
|
#include <arpa/nameser.h>
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "ares_dns.h"
|
#include "ares_dns.h"
|
||||||
#include "ares_private.h"
|
#include "ares_private.h"
|
||||||
|
|
||||||
#ifdef WIN32
|
#if (defined(WIN32) || defined(WATT32)) && !defined(MSDOS)
|
||||||
#define GET_ERRNO() WSAGetLastError()
|
#define GET_ERRNO() WSAGetLastError()
|
||||||
#else
|
#else
|
||||||
#define GET_ERRNO() errno
|
#define GET_ERRNO() errno
|
||||||
@@ -234,6 +240,7 @@ static void read_tcp_data(ares_channel channel, fd_set *read_fds, time_t now)
|
|||||||
*/
|
*/
|
||||||
process_answer(channel, server->tcp_buffer, server->tcp_length,
|
process_answer(channel, server->tcp_buffer, server->tcp_length,
|
||||||
i, 1, now);
|
i, 1, now);
|
||||||
|
if (server->tcp_buffer)
|
||||||
free(server->tcp_buffer);
|
free(server->tcp_buffer);
|
||||||
server->tcp_buffer = NULL;
|
server->tcp_buffer = NULL;
|
||||||
server->tcp_lenbuf_pos = 0;
|
server->tcp_lenbuf_pos = 0;
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include "nameser.h"
|
#include "nameser.h"
|
||||||
#else
|
#else
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include "nameser.h"
|
#include "nameser.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include "nameser.h"
|
#include "nameser.h"
|
||||||
#else
|
#else
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
@@ -16,13 +16,12 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef HAVE_SYS_TIME_H
|
||||||
|
|
||||||
#else
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "ares_private.h"
|
#include "ares_private.h"
|
||||||
|
|
||||||
|
@@ -221,16 +221,4 @@ typedef enum __ns_rcode {
|
|||||||
#define T_MAILA ns_t_maila
|
#define T_MAILA ns_t_maila
|
||||||
#define T_ANY ns_t_any
|
#define T_ANY ns_t_any
|
||||||
|
|
||||||
#if !(defined(__MINGW32__) || defined(NETWARE))
|
|
||||||
/* protos for the functions we provide in windows_port.c */
|
|
||||||
int ares_strncasecmp(const char *s1, const char *s2, size_t n);
|
|
||||||
int ares_strcasecmp(const char *s1, const char *s2);
|
|
||||||
|
|
||||||
/* use this define magic to prevent us from adding symbol names to the library
|
|
||||||
that is a high-risk to collide with another libraries' attempts to do the
|
|
||||||
same */
|
|
||||||
#define strncasecmp(a,b,c) ares_strncasecmp(a,b,c)
|
|
||||||
#define strcasecmp(a,b) ares_strcasecmp(a,b)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* ARES_NAMESER_H */
|
#endif /* ARES_NAMESER_H */
|
||||||
|
29
ares/setup.h
29
ares/setup.h
@@ -33,7 +33,7 @@
|
|||||||
#undef PACKAGE
|
#undef PACKAGE
|
||||||
|
|
||||||
/* now typedef our socket type */
|
/* now typedef our socket type */
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
typedef SOCKET ares_socket_t;
|
typedef SOCKET ares_socket_t;
|
||||||
#define ARES_SOCKET_BAD INVALID_SOCKET
|
#define ARES_SOCKET_BAD INVALID_SOCKET
|
||||||
@@ -42,4 +42,31 @@ typedef int ares_socket_t;
|
|||||||
#define ARES_SOCKET_BAD -1
|
#define ARES_SOCKET_BAD -1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Assume a few thing unless they're set by configure
|
||||||
|
*/
|
||||||
|
#if !defined(HAVE_SYS_TIME_H) && !defined(_MSC_VER)
|
||||||
|
#define HAVE_SYS_TIME_H
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(HAVE_UNISTD_H) && !defined(_MSC_VER)
|
||||||
|
#define HAVE_UNISTD_H
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(HAVE_SYS_UIO_H) && !defined(WIN32) && !defined(MSDOS)
|
||||||
|
#define HAVE_SYS_UIO_H
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (defined(WIN32) || defined(WATT32)) && \
|
||||||
|
!(defined(__MINGW32__) || defined(NETWARE))
|
||||||
|
/* protos for the functions we provide in windows_port.c */
|
||||||
|
int ares_strncasecmp(const char *s1, const char *s2, int n);
|
||||||
|
int ares_strcasecmp(const char *s1, const char *s2);
|
||||||
|
|
||||||
|
/* use this define magic to prevent us from adding symbol names to the library
|
||||||
|
that is a high-risk to collide with another libraries' attempts to do the
|
||||||
|
same */
|
||||||
|
#define strncasecmp(a,b,c) ares_strncasecmp(a,b,c)
|
||||||
|
#define strcasecmp(a,b) ares_strcasecmp(a,b)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* ARES_SETUP_H */
|
#endif /* ARES_SETUP_H */
|
||||||
|
@@ -109,10 +109,6 @@ SOURCE=..\..\ares_fds.c
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\ares_free_errmem.c
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\..\ares_free_hostent.c
|
SOURCE=..\..\ares_free_hostent.c
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
@@ -46,7 +46,6 @@ CLEAN :
|
|||||||
-@erase "$(INTDIR)\ares_destroy.obj"
|
-@erase "$(INTDIR)\ares_destroy.obj"
|
||||||
-@erase "$(INTDIR)\ares_expand_name.obj"
|
-@erase "$(INTDIR)\ares_expand_name.obj"
|
||||||
-@erase "$(INTDIR)\ares_fds.obj"
|
-@erase "$(INTDIR)\ares_fds.obj"
|
||||||
-@erase "$(INTDIR)\ares_free_errmem.obj"
|
|
||||||
-@erase "$(INTDIR)\ares_free_hostent.obj"
|
-@erase "$(INTDIR)\ares_free_hostent.obj"
|
||||||
-@erase "$(INTDIR)\ares_free_string.obj"
|
-@erase "$(INTDIR)\ares_free_string.obj"
|
||||||
-@erase "$(INTDIR)\ares_gethostbyaddr.obj"
|
-@erase "$(INTDIR)\ares_gethostbyaddr.obj"
|
||||||
@@ -82,7 +81,6 @@ LIB32_OBJS= \
|
|||||||
"$(INTDIR)\ares_destroy.obj" \
|
"$(INTDIR)\ares_destroy.obj" \
|
||||||
"$(INTDIR)\ares_expand_name.obj" \
|
"$(INTDIR)\ares_expand_name.obj" \
|
||||||
"$(INTDIR)\ares_fds.obj" \
|
"$(INTDIR)\ares_fds.obj" \
|
||||||
"$(INTDIR)\ares_free_errmem.obj" \
|
|
||||||
"$(INTDIR)\ares_free_hostent.obj" \
|
"$(INTDIR)\ares_free_hostent.obj" \
|
||||||
"$(INTDIR)\ares_free_string.obj" \
|
"$(INTDIR)\ares_free_string.obj" \
|
||||||
"$(INTDIR)\ares_gethostbyaddr.obj" \
|
"$(INTDIR)\ares_gethostbyaddr.obj" \
|
||||||
@@ -122,7 +120,6 @@ CLEAN :
|
|||||||
-@erase "$(INTDIR)\ares_destroy.obj"
|
-@erase "$(INTDIR)\ares_destroy.obj"
|
||||||
-@erase "$(INTDIR)\ares_expand_name.obj"
|
-@erase "$(INTDIR)\ares_expand_name.obj"
|
||||||
-@erase "$(INTDIR)\ares_fds.obj"
|
-@erase "$(INTDIR)\ares_fds.obj"
|
||||||
-@erase "$(INTDIR)\ares_free_errmem.obj"
|
|
||||||
-@erase "$(INTDIR)\ares_free_hostent.obj"
|
-@erase "$(INTDIR)\ares_free_hostent.obj"
|
||||||
-@erase "$(INTDIR)\ares_free_string.obj"
|
-@erase "$(INTDIR)\ares_free_string.obj"
|
||||||
-@erase "$(INTDIR)\ares_gethostbyaddr.obj"
|
-@erase "$(INTDIR)\ares_gethostbyaddr.obj"
|
||||||
@@ -159,7 +156,6 @@ LIB32_OBJS= \
|
|||||||
"$(INTDIR)\ares_destroy.obj" \
|
"$(INTDIR)\ares_destroy.obj" \
|
||||||
"$(INTDIR)\ares_expand_name.obj" \
|
"$(INTDIR)\ares_expand_name.obj" \
|
||||||
"$(INTDIR)\ares_fds.obj" \
|
"$(INTDIR)\ares_fds.obj" \
|
||||||
"$(INTDIR)\ares_free_errmem.obj" \
|
|
||||||
"$(INTDIR)\ares_free_hostent.obj" \
|
"$(INTDIR)\ares_free_hostent.obj" \
|
||||||
"$(INTDIR)\ares_free_string.obj" \
|
"$(INTDIR)\ares_free_string.obj" \
|
||||||
"$(INTDIR)\ares_gethostbyaddr.obj" \
|
"$(INTDIR)\ares_gethostbyaddr.obj" \
|
||||||
@@ -260,12 +256,6 @@ SOURCE=..\..\ares_fds.c
|
|||||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||||
|
|
||||||
|
|
||||||
SOURCE=..\..\ares_free_errmem.c
|
|
||||||
|
|
||||||
"$(INTDIR)\ares_free_errmem.obj" : $(SOURCE) "$(INTDIR)"
|
|
||||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
|
||||||
|
|
||||||
|
|
||||||
SOURCE=..\..\ares_free_hostent.c
|
SOURCE=..\..\ares_free_hostent.c
|
||||||
|
|
||||||
"$(INTDIR)\ares_free_hostent.obj" : $(SOURCE) "$(INTDIR)"
|
"$(INTDIR)\ares_free_hostent.obj" : $(SOURCE) "$(INTDIR)"
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
#ifdef WIN32 /* only do the following on windows */
|
/* only do the following on windows
|
||||||
|
*/
|
||||||
|
#if (defined(WIN32) || defined(WATT32)) && !defined(MSDOS)
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@@ -8,13 +10,19 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
|
||||||
|
#ifdef WATT32
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#else
|
||||||
#include "nameser.h"
|
#include "nameser.h"
|
||||||
|
#endif
|
||||||
|
#include "ares.h"
|
||||||
|
#include "ares_private.h"
|
||||||
|
|
||||||
#ifndef __MINGW32__
|
#ifndef __MINGW32__
|
||||||
int
|
int
|
||||||
ares_strncasecmp(const char *a, const char *b, size_t n)
|
ares_strncasecmp(const char *a, const char *b, int n)
|
||||||
{
|
{
|
||||||
size_t i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
int c1 = isupper(a[i]) ? tolower(a[i]) : a[i];
|
int c1 = isupper(a[i]) ? tolower(a[i]) : a[i];
|
||||||
@@ -57,7 +65,7 @@ ares_gettimeofday(struct timeval *tv, struct timezone *tz)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ares_writev (SOCKET s, const struct iovec *vector, size_t count)
|
ares_writev (ares_socket_t s, const struct iovec *vector, size_t count)
|
||||||
{
|
{
|
||||||
char *buffer, *bp;
|
char *buffer, *bp;
|
||||||
size_t i, bytes = 0;
|
size_t i, bytes = 0;
|
||||||
|
@@ -101,6 +101,10 @@ libtool=`findtool glibtool 2>/dev/null`
|
|||||||
if test ! -x "$libtool"; then
|
if test ! -x "$libtool"; then
|
||||||
libtool=`findtool libtool`
|
libtool=`findtool libtool`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# set the LIBTOOLIZE here so that glibtoolize is used if glibtool was found
|
||||||
|
LIBTOOLIZE="${libtool}ize"
|
||||||
|
|
||||||
lt_pversion=`$libtool --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//g' -e 's/[- ].*//'`
|
lt_pversion=`$libtool --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//g' -e 's/[- ].*//'`
|
||||||
if test -z "$lt_pversion"; then
|
if test -z "$lt_pversion"; then
|
||||||
echo "buildconf: libtool not found."
|
echo "buildconf: libtool not found."
|
||||||
|
@@ -7,9 +7,6 @@ REM create ca-bundle.h
|
|||||||
echo /* This file is generated automatically */ >lib\ca-bundle.h
|
echo /* This file is generated automatically */ >lib\ca-bundle.h
|
||||||
echo #define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE") >>lib\ca-bundle.h
|
echo #define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE") >>lib\ca-bundle.h
|
||||||
|
|
||||||
REM create getdate.c
|
|
||||||
copy lib\getdate.c.cvs lib\getdate.c
|
|
||||||
|
|
||||||
REM create hugehelp.c
|
REM create hugehelp.c
|
||||||
copy src\hugehelp.c.cvs src\hugehelp.c
|
copy src\hugehelp.c.cvs src\hugehelp.c
|
||||||
|
|
||||||
|
128
configure.ac
128
configure.ac
@@ -102,6 +102,7 @@ AC_MSG_RESULT($need_no_undefined)
|
|||||||
AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
|
AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
|
||||||
|
|
||||||
AC_MSG_CHECKING([if we need -mimpure-text])
|
AC_MSG_CHECKING([if we need -mimpure-text])
|
||||||
|
mimpure=no
|
||||||
case $host in
|
case $host in
|
||||||
*-*-solaris2*)
|
*-*-solaris2*)
|
||||||
if test "$GCC" = "yes"; then
|
if test "$GCC" = "yes"; then
|
||||||
@@ -109,7 +110,6 @@ case $host in
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
mimpure=no
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
AC_MSG_RESULT($mimpure)
|
AC_MSG_RESULT($mimpure)
|
||||||
@@ -287,7 +287,7 @@ then
|
|||||||
AC_TRY_LINK( ,
|
AC_TRY_LINK( ,
|
||||||
[gethostbyname();],
|
[gethostbyname();],
|
||||||
[ dnl found it!
|
[ dnl found it!
|
||||||
HAVE_GETHOSTBYNAME="1",
|
HAVE_GETHOSTBYNAME="1"
|
||||||
AC_MSG_RESULT([yes])],
|
AC_MSG_RESULT([yes])],
|
||||||
[ dnl failed!
|
[ dnl failed!
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
@@ -707,9 +707,29 @@ else
|
|||||||
CLEANCPPFLAGS="$CPPFLAGS"
|
CLEANCPPFLAGS="$CPPFLAGS"
|
||||||
CLEANLIBS="$LIBS"
|
CLEANLIBS="$LIBS"
|
||||||
|
|
||||||
dnl Detect the pkg-config tool, as it may have extra info about the openssl
|
case "$OPT_SSL" in
|
||||||
dnl installation we can use. I *believe* this is what we are expected to do
|
yes)
|
||||||
dnl on really recent Redhat Linux hosts.
|
dnl --with-ssl (without path) used
|
||||||
|
PKGTEST="yes"
|
||||||
|
EXTRA_SSL=/usr/local/ssl ;;
|
||||||
|
off)
|
||||||
|
dnl no --with-ssl option given, just check default places
|
||||||
|
PKGTEST="yes"
|
||||||
|
EXTRA_SSL= ;;
|
||||||
|
*)
|
||||||
|
dnl check the given --with-ssl spot
|
||||||
|
PKGTEST="no"
|
||||||
|
EXTRA_SSL=$OPT_SSL
|
||||||
|
LDFLAGS="$LDFLAGS -L$EXTRA_SSL/lib$libsuff"
|
||||||
|
CPPFLAGS="$CPPFLAGS -I$EXTRA_SSL/include/openssl -I$EXTRA_SSL/include"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if test "$PKGTEST" = "yes"; then
|
||||||
|
|
||||||
|
dnl Detect the pkg-config tool, as it may have extra info about the
|
||||||
|
dnl openssl installation we can use. I *believe* this is what we are
|
||||||
|
dnl expected to do on really recent Redhat Linux hosts.
|
||||||
|
|
||||||
AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
|
AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
|
||||||
if test "$PKGCONFIG" != "no" ; then
|
if test "$PKGCONFIG" != "no" ; then
|
||||||
@@ -732,19 +752,7 @@ else
|
|||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
case "$OPT_SSL" in
|
|
||||||
yes)
|
|
||||||
EXTRA_SSL=/usr/local/ssl ;;
|
|
||||||
off)
|
|
||||||
EXTRA_SSL= ;;
|
|
||||||
*)
|
|
||||||
dnl check the given spot right away!
|
|
||||||
EXTRA_SSL=$OPT_SSL
|
|
||||||
LDFLAGS="$LDFLAGS -L$EXTRA_SSL/lib$libsuff"
|
|
||||||
CPPFLAGS="$CPPFLAGS -I$EXTRA_SSL/include/openssl -I$EXTRA_SSL/include"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
AC_CHECK_LIB(crypto, CRYPTO_lock,[
|
AC_CHECK_LIB(crypto, CRYPTO_lock,[
|
||||||
HAVECRYPTO="yes"
|
HAVECRYPTO="yes"
|
||||||
@@ -945,26 +953,31 @@ case "$LIBIDN" in
|
|||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
;;
|
;;
|
||||||
*) AC_MSG_RESULT(yes)
|
*) AC_MSG_RESULT(yes)
|
||||||
AC_CHECK_LIB(idn, idna_to_ascii_lz, ,
|
|
||||||
[
|
idn=""
|
||||||
dnl if there was a given path, try it
|
dnl if there is a given path, check that FIRST
|
||||||
nolibidn="true"
|
|
||||||
if test "x$LIBIDN" != "xyes"; then
|
if test "x$LIBIDN" != "xyes"; then
|
||||||
nolibidn="" dnl reset to test again
|
|
||||||
oldLDFLAGS=$LDFLAGS
|
oldLDFLAGS=$LDFLAGS
|
||||||
oldCPPFLAGS=$CPPFLAGS
|
oldCPPFLAGS=$CPPFLAGS
|
||||||
LDFLAGS="$LDFLAGS -L$LIBIDN/lib"
|
LDFLAGS="$LDFLAGS -L$LIBIDN/lib"
|
||||||
CPPFLAGS="$CPPFLAGS -I$LIBIDN/include"
|
CPPFLAGS="$CPPFLAGS -I$LIBIDN/include"
|
||||||
|
idn="yes"
|
||||||
AC_CHECK_LIB(idn, idna_to_ascii_4i, ,
|
AC_CHECK_LIB(idn, idna_to_ascii_4i, ,
|
||||||
nolibidn="true"
|
idn=""
|
||||||
LDFLAGS=$oldLDFLAGS
|
LDFLAGS=$oldLDFLAGS
|
||||||
CPPFLAGS=$oldCPPFLAGS)
|
CPPFLAGS=$oldCPPFLAGS)
|
||||||
fi
|
fi
|
||||||
])
|
|
||||||
if test "x$nolibidn" != "xtrue"; then
|
if test "x$idn" != "xyes"; then
|
||||||
|
dnl check with default paths
|
||||||
|
AC_CHECK_LIB(idn, idna_to_ascii_lz, ,
|
||||||
|
idn="")
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "x$idn" = "xyes"; then
|
||||||
curl_idn_msg="enabled"
|
curl_idn_msg="enabled"
|
||||||
dnl different versions of libidn have different setups of these:
|
dnl different versions of libidn have different setups of these:
|
||||||
AC_CHECK_FUNCS( idn_free )
|
AC_CHECK_FUNCS( idn_free idna_strerror tld_strerror)
|
||||||
AC_CHECK_HEADERS( idn-free.h )
|
AC_CHECK_HEADERS( idn-free.h )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -1038,6 +1051,24 @@ dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
|
|||||||
dnl genprogc/thread_quick_ref.htm
|
dnl genprogc/thread_quick_ref.htm
|
||||||
|
|
||||||
if test "x$RECENTAIX" = "xyes"; then
|
if test "x$RECENTAIX" = "xyes"; then
|
||||||
|
|
||||||
|
AC_DEFINE(_THREAD_SAFE, 1, [define this if you need it to compile thread-safe code])
|
||||||
|
|
||||||
|
dnl check if this is the IMB xlc compiler
|
||||||
|
dnl Details thanks to => http://predef.sourceforge.net/
|
||||||
|
AC_MSG_CHECKING([if this is the xlc compiler])
|
||||||
|
AC_EGREP_CPP([^__xlC__], [__xlC__],
|
||||||
|
dnl action if the text is found, this it has not been replaced by the
|
||||||
|
dnl cpp
|
||||||
|
XLC="no"
|
||||||
|
AC_MSG_RESULT([no]),
|
||||||
|
dnl the text was not found, it was replaced by the cpp
|
||||||
|
XLC="yes"
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
CFLAGS="$CFLAGS -qthreaded"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
dnl is there a localtime_r()
|
dnl is there a localtime_r()
|
||||||
CURL_CHECK_LOCALTIME_R()
|
CURL_CHECK_LOCALTIME_R()
|
||||||
|
|
||||||
@@ -1089,6 +1120,7 @@ AC_CHECK_HEADERS(
|
|||||||
utime.h \
|
utime.h \
|
||||||
sys/utime.h \
|
sys/utime.h \
|
||||||
sys/poll.h \
|
sys/poll.h \
|
||||||
|
libgen.h \
|
||||||
setjmp.h,
|
setjmp.h,
|
||||||
dnl to do if not found
|
dnl to do if not found
|
||||||
[],
|
[],
|
||||||
@@ -1124,9 +1156,22 @@ AC_CHECK_SIZEOF(curl_off_t, ,[
|
|||||||
#include "$srcdir/include/curl/curl.h"
|
#include "$srcdir/include/curl/curl.h"
|
||||||
])
|
])
|
||||||
AC_CHECK_SIZEOF(size_t)
|
AC_CHECK_SIZEOF(size_t)
|
||||||
|
AC_CHECK_SIZEOF(long)
|
||||||
|
|
||||||
AC_CHECK_TYPE(long long,
|
AC_CHECK_TYPE(long long,
|
||||||
[AC_DEFINE(HAVE_LONGLONG, 1, [if your compiler supports 'long long'])])
|
[AC_DEFINE(HAVE_LONGLONG, 1, [if your compiler supports long long])]
|
||||||
|
longlong="yes"
|
||||||
|
)
|
||||||
|
|
||||||
|
if test "xyes" = "x$longlong"; then
|
||||||
|
AC_MSG_CHECKING([if numberLL works])
|
||||||
|
AC_COMPILE_IFELSE([long long val = 1000LL;],
|
||||||
|
[AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])]
|
||||||
|
AC_MSG_RESULT(yes),
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# check for ssize_t
|
# check for ssize_t
|
||||||
AC_CHECK_TYPE(ssize_t, ,
|
AC_CHECK_TYPE(ssize_t, ,
|
||||||
@@ -1171,6 +1216,7 @@ AC_CHECK_FUNCS( strtoll \
|
|||||||
dlopen \
|
dlopen \
|
||||||
utime \
|
utime \
|
||||||
sigsetjmp \
|
sigsetjmp \
|
||||||
|
basename \
|
||||||
poll,
|
poll,
|
||||||
dnl if found
|
dnl if found
|
||||||
[],
|
[],
|
||||||
@@ -1201,6 +1247,16 @@ if test "$ac_cv_func_sigsetjmp" != "yes"; then
|
|||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
AC_CHECK_DECL(basename, ,
|
||||||
|
AC_DEFINE(NEED_BASENAME_PROTO, 1, [If you lack a fine basename() prototype]),
|
||||||
|
#ifdef HAVE_STRING_H
|
||||||
|
#include <string.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_LIBGEN_H
|
||||||
|
#include <libgen.h>
|
||||||
|
#endif
|
||||||
|
)
|
||||||
|
|
||||||
dnl poll() might be badly emulated, as in Mac OS X 10.3 (and other BSDs?) and
|
dnl poll() might be badly emulated, as in Mac OS X 10.3 (and other BSDs?) and
|
||||||
dnl to find out we make an extra check here!
|
dnl to find out we make an extra check here!
|
||||||
if test "$ac_cv_func_poll" = "yes"; then
|
if test "$ac_cv_func_poll" = "yes"; then
|
||||||
@@ -1264,22 +1320,6 @@ then
|
|||||||
USE_MANUAL="no";
|
USE_MANUAL="no";
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_PROG_YACC
|
|
||||||
|
|
||||||
if test -z "$YACC"
|
|
||||||
then
|
|
||||||
AC_MSG_CHECKING([if OK to build without bison/yacc])
|
|
||||||
dnl no yacc is a big deal if we have no pre-fixed getdate.y
|
|
||||||
if test -r "$srcdir/lib/getdate.c"
|
|
||||||
then
|
|
||||||
dnl all is well, we don't have to generate it!
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
else
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
AC_MSG_ERROR([no yacc or bison found, can't build libcurl!])
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl *************************************************************************
|
dnl *************************************************************************
|
||||||
dnl If the manual variable still is set, then we go with providing a built-in
|
dnl If the manual variable still is set, then we go with providing a built-in
|
||||||
dnl manual
|
dnl manual
|
||||||
|
@@ -20,6 +20,13 @@
|
|||||||
)
|
)
|
||||||
"Curl C Programming Style")
|
"Curl C Programming Style")
|
||||||
|
|
||||||
|
(defun curl-code-cleanup ()
|
||||||
|
"no docs"
|
||||||
|
(interactive)
|
||||||
|
(untabify (point-min) (point-max))
|
||||||
|
(delete-trailing-whitespace)
|
||||||
|
)
|
||||||
|
|
||||||
;; Customizations for all of c-mode, c++-mode, and objc-mode
|
;; Customizations for all of c-mode, c++-mode, and objc-mode
|
||||||
(defun curl-c-mode-common-hook ()
|
(defun curl-c-mode-common-hook ()
|
||||||
"Curl C mode hook"
|
"Curl C mode hook"
|
||||||
@@ -33,7 +40,7 @@
|
|||||||
;; keybindings for C, C++, and Objective-C. We can put these in
|
;; keybindings for C, C++, and Objective-C. We can put these in
|
||||||
;; c-mode-base-map because of inheritance ...
|
;; c-mode-base-map because of inheritance ...
|
||||||
(define-key c-mode-base-map "\M-q" 'c-fill-paragraph)
|
(define-key c-mode-base-map "\M-q" 'c-fill-paragraph)
|
||||||
(define-key c-mode-base-map "\M-m" 'delete-trailing-whitespace)
|
(define-key c-mode-base-map "\M-m" 'curl-code-cleanup)
|
||||||
(setq c-recognize-knr-p nil)
|
(setq c-recognize-knr-p nil)
|
||||||
;;; (add-hook 'write-file-hooks 'delete-trailing-whitespace t)
|
;;; (add-hook 'write-file-hooks 'delete-trailing-whitespace t)
|
||||||
(setq show-trailing-whitespace t)
|
(setq show-trailing-whitespace t)
|
||||||
|
@@ -17,22 +17,27 @@ archives, but must be downloaded and installed separately.
|
|||||||
|
|
||||||
Ada95
|
Ada95
|
||||||
|
|
||||||
Writtten by Andreas Almroth.
|
Writtten by Andreas Almroth
|
||||||
http://www.almroth.com/adacurl/index.html
|
http://www.almroth.com/adacurl/index.html
|
||||||
|
|
||||||
Basic
|
Basic
|
||||||
|
|
||||||
ScriptBasic bindings to libcurl. Writtten by Peter Verhas.
|
ScriptBasic bindings to libcurl. Writtten by Peter Verhas
|
||||||
http://scriptbasic.com/
|
http://scriptbasic.com/
|
||||||
|
|
||||||
C++
|
C++
|
||||||
|
|
||||||
Written by Jean-Philippe Barrette-LaPierre.
|
Written by Jean-Philippe Barrette-LaPierre
|
||||||
http://www.sourceforge.net/projects/curlpp
|
http://www.sourceforge.net/projects/curlpp
|
||||||
|
|
||||||
|
Ch
|
||||||
|
|
||||||
|
Written by Stephen Nestinger and Jonathan Rogado
|
||||||
|
http://chcurl.sourceforge.net/
|
||||||
|
|
||||||
Cocoa
|
Cocoa
|
||||||
|
|
||||||
Written by Dan Wood.
|
Written by Dan Wood
|
||||||
http://curlhandle.sourceforge.net/
|
http://curlhandle.sourceforge.net/
|
||||||
|
|
||||||
D
|
D
|
||||||
@@ -42,25 +47,33 @@ D
|
|||||||
|
|
||||||
Dylan
|
Dylan
|
||||||
|
|
||||||
Written by Chris Double.
|
Written by Chris Double
|
||||||
http://dylanlibs.sourceforge.net/
|
http://dylanlibs.sourceforge.net/
|
||||||
|
|
||||||
Euphoria
|
Euphoria
|
||||||
|
|
||||||
Written by Ray Smith.
|
Written by Ray Smith
|
||||||
http://rays-web.com/eulibcurl.htm
|
http://rays-web.com/eulibcurl.htm
|
||||||
|
|
||||||
Ferite
|
Ferite
|
||||||
|
Written by Paul Querna
|
||||||
http://www.ferite.org/
|
http://www.ferite.org/
|
||||||
|
|
||||||
|
Gambas
|
||||||
|
http://gambas.sourceforge.net
|
||||||
|
|
||||||
|
glib/GTK+
|
||||||
|
Written by Richard Atterer
|
||||||
|
http://atterer.net/glibcurl/
|
||||||
|
|
||||||
Java
|
Java
|
||||||
|
|
||||||
Written by Daniel Stenberg.
|
Written by Daniel Stenberg
|
||||||
http://curl.haxx.se/libcurl/java/
|
http://curl.haxx.se/libcurl/java/
|
||||||
|
|
||||||
Lua
|
Lua
|
||||||
|
|
||||||
Written by Steve Dekorte.
|
Written by Steve Dekorte
|
||||||
http://curl.haxx.se/libcurl/lua/
|
http://curl.haxx.se/libcurl/lua/
|
||||||
|
|
||||||
Object-Pascal
|
Object-Pascal
|
||||||
@@ -70,7 +83,7 @@ Object-Pascal
|
|||||||
|
|
||||||
O'Caml
|
O'Caml
|
||||||
|
|
||||||
Written by Lars Nilsson.
|
Written by Lars Nilsson
|
||||||
http://sourceforge.net/projects/ocurl/
|
http://sourceforge.net/projects/ocurl/
|
||||||
|
|
||||||
Pascal
|
Pascal
|
||||||
@@ -80,40 +93,49 @@ Pascal
|
|||||||
|
|
||||||
Perl
|
Perl
|
||||||
|
|
||||||
Maintained by Cris Bailiff.
|
Maintained by Cris Bailiff
|
||||||
http://curl.haxx.se/libcurl/perl/
|
http://curl.haxx.se/libcurl/perl/
|
||||||
|
|
||||||
PHP
|
PHP
|
||||||
|
|
||||||
Written by Sterling Hughes.
|
Written by Sterling Hughes
|
||||||
http://curl.haxx.se/libcurl/php/
|
http://curl.haxx.se/libcurl/php/
|
||||||
|
|
||||||
PostgreSQL
|
PostgreSQL
|
||||||
|
|
||||||
Written by Gian Paolo Ciceri.
|
Written by Gian Paolo Ciceri
|
||||||
http://gborg.postgresql.org/project/pgcurl/projdisplay.php
|
http://gborg.postgresql.org/project/pgcurl/projdisplay.php
|
||||||
|
|
||||||
Python
|
Python
|
||||||
|
|
||||||
Written by Kjetil Jacobsen.
|
Written by Kjetil Jacobsen
|
||||||
http://pycurl.sourceforge.net/
|
http://pycurl.sourceforge.net/
|
||||||
|
|
||||||
Rexx
|
Rexx
|
||||||
|
|
||||||
Written Mark Hessling.
|
Written Mark Hessling
|
||||||
http://rexxcurl.sourceforge.net/
|
http://rexxcurl.sourceforge.net/
|
||||||
|
|
||||||
Ruby
|
Ruby
|
||||||
|
|
||||||
Written by Hirotaka Matsuyuki.
|
Written by Hirotaka Matsuyuki
|
||||||
http://www.d1.dion.ne.jp/~matuyuki/ruby.html
|
http://www.d1.dion.ne.jp/~matuyuki/ruby.html
|
||||||
|
|
||||||
Scheme
|
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/
|
||||||
|
|
||||||
Tcl
|
Tcl
|
||||||
|
|
||||||
Written by Andr<64>s Garc<72>a.
|
Written by Andr<64>s Garc<72>a
|
||||||
http://personal1.iddeo.es/andresgarci/tclcurl/english/docs.html
|
http://personal1.iddeo.es/andresgarci/tclcurl/english/docs.html
|
||||||
|
|
||||||
|
Q
|
||||||
|
|
||||||
|
http://q-lang.sourceforge.net/
|
||||||
|
|
||||||
|
wxWidgets
|
||||||
|
|
||||||
|
Written by Casey O'Donnell
|
||||||
|
http://homepage.mac.com/codonnell/wxcurldav/
|
||||||
|
@@ -138,15 +138,15 @@ How To Make a Patch
|
|||||||
|
|
||||||
If you have modified a single file, try something like:
|
If you have modified a single file, try something like:
|
||||||
|
|
||||||
diff -u undmodified-file.c my-changed-one.c > my-fixes.diff
|
diff -u unmodified-file.c my-changed-one.c > my-fixes.diff
|
||||||
|
|
||||||
If you have modified several files, possibly in different directories, you
|
If you have modified several files, possibly in different directories, you
|
||||||
can use diff recursively:
|
can use diff recursively:
|
||||||
|
|
||||||
diff -ur curl-original-dir curl-modfied-sources-dir > my-fixes.diff
|
diff -ur curl-original-dir curl-modified-sources-dir > my-fixes.diff
|
||||||
|
|
||||||
The GNU diff and GNU patch tools exist for virtually all platforms, including
|
The GNU diff and GNU patch tools exist for virtually all platforms, including
|
||||||
all kinds of unixes and Windows:
|
all kinds of Unixes and Windows:
|
||||||
|
|
||||||
For unix-like operating systems:
|
For unix-like operating systems:
|
||||||
|
|
||||||
|
146
docs/FAQ
146
docs/FAQ
@@ -1,4 +1,4 @@
|
|||||||
Updated: August 10, 2004 (http://curl.haxx.se/docs/faq.html)
|
Updated: August 18, 2004 (http://curl.haxx.se/docs/faq.html)
|
||||||
_ _ ____ _
|
_ _ ____ _
|
||||||
___| | | | _ \| |
|
___| | | | _ \| |
|
||||||
/ __| | | | |_) | |
|
/ __| | | | |_) | |
|
||||||
@@ -10,10 +10,10 @@ FAQ
|
|||||||
1. Philosophy
|
1. Philosophy
|
||||||
1.1 What is cURL?
|
1.1 What is cURL?
|
||||||
1.2 What is libcurl?
|
1.2 What is libcurl?
|
||||||
1.3 What is cURL not?
|
1.3 What is curl not?
|
||||||
1.4 When will you make curl do XXXX ?
|
1.4 When will you make curl do XXXX ?
|
||||||
1.5 Who makes cURL?
|
1.5 Who makes curl?
|
||||||
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?
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ FAQ
|
|||||||
2.1.2 only the libssl lib is missing
|
2.1.2 only the libssl lib is missing
|
||||||
2.2 Does curl work/build with other SSL libraries?
|
2.2 Does curl work/build with other SSL libraries?
|
||||||
2.3 Where can I find a copy of LIBEAY32.DLL?
|
2.3 Where can I find a copy of LIBEAY32.DLL?
|
||||||
2.4 Does cURL support Socks (RFC 1928) ?
|
2.4 Does curl support Socks (RFC 1928) ?
|
||||||
|
|
||||||
3. Usage Problems
|
3. Usage Problems
|
||||||
3.1 curl: (1) SSL is disabled, https: not supported
|
3.1 curl: (1) SSL is disabled, https: not supported
|
||||||
@@ -41,6 +41,7 @@ FAQ
|
|||||||
3.13 Why does my single/double quotes fail?
|
3.13 Why does my single/double quotes fail?
|
||||||
3.14 Does curl support javascript or pac (automated proxy config)?
|
3.14 Does curl support javascript or pac (automated proxy config)?
|
||||||
3.15 Can I do recursive fetches with curl?
|
3.15 Can I do recursive fetches with curl?
|
||||||
|
3.16 What certificates do I need when I use SSL?
|
||||||
|
|
||||||
4. Running Problems
|
4. Running Problems
|
||||||
4.1 Problems connecting to SSL servers.
|
4.1 Problems connecting to SSL servers.
|
||||||
@@ -71,6 +72,7 @@ FAQ
|
|||||||
5.6 What about Keep-Alive or persistent connections?
|
5.6 What about Keep-Alive or persistent connections?
|
||||||
5.7 Link errors when building libcurl on Windows!
|
5.7 Link errors when building libcurl on Windows!
|
||||||
5.8 libcurl.so.3: open failed: No such file or directory
|
5.8 libcurl.so.3: open failed: No such file or directory
|
||||||
|
5.9 How does libcurl resolve host names?
|
||||||
|
|
||||||
6. License Issues
|
6. License Issues
|
||||||
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?
|
||||||
@@ -80,24 +82,50 @@ FAQ
|
|||||||
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?
|
||||||
|
|
||||||
|
7. PHP/CURL Issues
|
||||||
|
7.1 What is PHP/CURL?
|
||||||
|
7.2 Who write PHP/CURL?
|
||||||
|
7.3 Can I perform multiple requests using the same handle?
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
1. Philosophy
|
1. Philosophy
|
||||||
|
|
||||||
1.1 What is cURL?
|
1.1 What is cURL?
|
||||||
|
|
||||||
cURL (or simply just 'curl') is a command line tool for getting or sending
|
cURL is the name of the project. The name is a play on 'Client for URLs',
|
||||||
files using URL syntax. The name is a play on 'Client for URLs', originally
|
originally with URL spelled in uppercase to make it obvious it deals with
|
||||||
with URL spelled in uppercase to make it obvious it deals with URLs. The
|
URLs. The fact it can also be pronounced 'see URL' also helped, it works as
|
||||||
fact it can also be pronounced 'see URL' also helped, it works as an
|
an abbrivation for "Client URL Request Library" or why not the recursive
|
||||||
abbrivation for "Client URL Request Library" or why not the recursive
|
|
||||||
version: "Curl URL Request Library".
|
version: "Curl URL Request Library".
|
||||||
|
|
||||||
Curl supports a range of common Internet protocols, currently including
|
The cURL project produces two products:
|
||||||
HTTP, HTTPS, FTP, FTPS, GOPHER, LDAP, DICT, TELNET and FILE.
|
|
||||||
|
|
||||||
We spell it cURL or just curl. We pronounce it with an initial k sound:
|
libcurl
|
||||||
[kurl].
|
|
||||||
|
A free and easy-to-use client-side URL transfer library, supporting FTP,
|
||||||
|
FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FILE and LDAP. libcurl supports
|
||||||
|
HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, kerberos, HTTP
|
||||||
|
form based upload, proxies, cookies, user+password authentication, file
|
||||||
|
transfer resume, http proxy tunneling and more!
|
||||||
|
|
||||||
|
libcurl is highly portable, it builds and works identically on numerous
|
||||||
|
platforms, including Solaris, NetBSD, FreeBSD, OpenBSD, Darwin, HPUX,
|
||||||
|
IRIX, AIX, Tru64, Linux, UnixWare, HURD, Windows, Amiga, OS/2, BeOs, Mac
|
||||||
|
OS X, Ultrix, QNX, OpenVMS, RISC OS, Novell NetWare, DOS and more...
|
||||||
|
|
||||||
|
libcurl is free, thread-safe, IPv6 compatible, feature rich, well
|
||||||
|
supported and fast.
|
||||||
|
|
||||||
|
curl
|
||||||
|
|
||||||
|
A command line tool for getting or sending files using URL syntax.
|
||||||
|
|
||||||
|
Since curl uses libcurl, it supports a range of common Internet protocols,
|
||||||
|
currently including HTTP, HTTPS, FTP, FTPS, GOPHER, LDAP, DICT, TELNET and
|
||||||
|
FILE.
|
||||||
|
|
||||||
|
We pronounce curl and cURL with an initial k sound: [kurl].
|
||||||
|
|
||||||
NOTE: there are numerous sub-projects and related projects that also use the
|
NOTE: there are numerous sub-projects and related projects that also use the
|
||||||
word curl in the project names in various combinations, but you should take
|
word curl in the project names in various combinations, but you should take
|
||||||
@@ -113,7 +141,7 @@ 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.
|
||||||
|
|
||||||
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
|
||||||
curl's development, have we intended curl to replace wget or compete on its
|
curl's development, have we intended curl to replace wget or compete on its
|
||||||
@@ -128,7 +156,7 @@ FAQ
|
|||||||
script (or write a new program that interfaces libcurl) and do it.
|
script (or write a new program that interfaces libcurl) and do it.
|
||||||
|
|
||||||
Curl is not a PHP tool, even though it works perfectly well when used from
|
Curl is not a PHP tool, even though it works perfectly well when used from
|
||||||
or with PHP.
|
or with PHP (when using the PHP/CURL module).
|
||||||
|
|
||||||
Curl is not a single-OS program. Curl exists, compiles, builds and runs
|
Curl is not a single-OS program. Curl exists, compiles, builds and runs
|
||||||
under a wide range of operating systems, including all modern Unixes (and a
|
under a wide range of operating systems, including all modern Unixes (and a
|
||||||
@@ -162,9 +190,9 @@ FAQ
|
|||||||
* If you write the code, chances are bigger that it will get into curl
|
* If you write the code, chances are bigger that it will get into curl
|
||||||
faster.
|
faster.
|
||||||
|
|
||||||
1.5 Who makes cURL?
|
1.5 Who makes curl?
|
||||||
|
|
||||||
cURL and libcurl are not made by any single individual. Sure, Daniel
|
curl and libcurl are not made by any single individual. Sure, Daniel
|
||||||
Stenberg writes the major parts, but other persons' submissions are
|
Stenberg writes the major parts, but other persons' submissions are
|
||||||
important and crucial. Anyone can contribute and post their changes and
|
important and crucial. Anyone can contribute and post their changes and
|
||||||
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
|
||||||
@@ -176,14 +204,16 @@ FAQ
|
|||||||
|
|
||||||
curl is developed by a community, with Daniel at the wheel.
|
curl is developed by a community, with Daniel at the wheel.
|
||||||
|
|
||||||
1.6 What do you get for making cURL?
|
1.6 What do you get for making curl?
|
||||||
|
|
||||||
Project cURL is entirely free and open. No person gets paid for developing
|
Project cURL is entirely free and open. No person gets paid for developing
|
||||||
curl. We do this voluntarily on our spare time.
|
(lib)curl. We do this voluntarily on our spare time.
|
||||||
|
|
||||||
We get some help from companies. Contactor Data hosts the curl web site,
|
We get some help from companies. Contactor Data hosts the curl web site,
|
||||||
Haxx owns the curl web site's domain and sourceforge.net hosts project
|
Haxx owns the curl web site's domain and sourceforge.net hosts project
|
||||||
services we take advantage from, like the bug tracker.
|
services we take advantage from, like the bug tracker. Also, some companies
|
||||||
|
have sponsored certain parts of the development in the past and I hope some
|
||||||
|
will continue to do so in the future.
|
||||||
|
|
||||||
If you want to support our project with a donation or similar, one way of
|
If you want to support our project with a donation or similar, one way of
|
||||||
doing that would be to buy "gift certificates" at useful online shopping
|
doing that would be to buy "gift certificates" at useful online shopping
|
||||||
@@ -279,7 +309,7 @@ FAQ
|
|||||||
accurate and up-to-date pointers to recent OpenSSL DLLs and other binary
|
accurate and up-to-date pointers to recent OpenSSL DLLs and other binary
|
||||||
packages.
|
packages.
|
||||||
|
|
||||||
2.4 Does cURL support Socks (RFC 1928) ?
|
2.4 Does curl support Socks (RFC 1928) ?
|
||||||
|
|
||||||
Yes, SOCKS5 is supported.
|
Yes, SOCKS5 is supported.
|
||||||
|
|
||||||
@@ -370,7 +400,6 @@ FAQ
|
|||||||
|
|
||||||
Find out more about which languages that support curl directly, and how to
|
Find out more about which languages that support curl directly, and how to
|
||||||
install and use them, in the libcurl section of the curl web site:
|
install and use them, in the libcurl section of the curl web site:
|
||||||
|
|
||||||
http://curl.haxx.se/libcurl/
|
http://curl.haxx.se/libcurl/
|
||||||
|
|
||||||
In February 2003, there are interfaces available for the following
|
In February 2003, there are interfaces available for the following
|
||||||
@@ -463,6 +492,34 @@ FAQ
|
|||||||
curlmirror perl script), and you can write programs based on libcurl to do
|
curlmirror perl script), and you can write programs based on libcurl to do
|
||||||
it, but the command line tool curl itself cannot.
|
it, but the command line tool curl itself cannot.
|
||||||
|
|
||||||
|
3.16 What certificates do I need when I use SSL?
|
||||||
|
|
||||||
|
There are three different kinds of "certificates" to keep track of when we
|
||||||
|
talk about using SSL-based protocols (HTTPS or FTPS) using curl or libcurl.
|
||||||
|
|
||||||
|
- Client certificate. The server you communicate may require that you can
|
||||||
|
provide this in order to prove that you actually are who you claim to be.
|
||||||
|
If the server doesn't require this, you don't need a client certificate.
|
||||||
|
|
||||||
|
- Server certificate. The server you communicate with has a server
|
||||||
|
certificate. You can and should verify this certficate to make sure that
|
||||||
|
you are truly talking to the real server and not a server impersonating
|
||||||
|
it. The server certificate verifaction 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.
|
||||||
|
|
||||||
|
- Certificate Authority certificate ("CA cert"). You often have several CA
|
||||||
|
certs in a CA cert bundle that can be used to verify a server certificate
|
||||||
|
that was signed by one of the authorities in the bundle. curl comes with a
|
||||||
|
default CA cert bundle. You can override the default.
|
||||||
|
|
||||||
|
|
||||||
4. Running Problems
|
4. Running Problems
|
||||||
|
|
||||||
@@ -767,6 +824,26 @@ FAQ
|
|||||||
|
|
||||||
'man ld.so' and 'man ld' will tell you more details
|
'man ld.so' and 'man ld' will tell you more details
|
||||||
|
|
||||||
|
5.9 How does libcurl resolve host names?
|
||||||
|
|
||||||
|
libcurl includes a number of different name resolve functions:
|
||||||
|
|
||||||
|
- The non-ipv6 resolver that can use one out of four host name resolve calls
|
||||||
|
(depending on what your system supports):
|
||||||
|
|
||||||
|
A - gethostbyname()
|
||||||
|
B - gethostbyname_r() with 3 arguments
|
||||||
|
C - gethostbyname_r() with 5 arguments
|
||||||
|
D - gethostbyname_r() with 6 arguments
|
||||||
|
|
||||||
|
- The ipv6-resolver that uses getaddrinfo()
|
||||||
|
|
||||||
|
- The c-ares based name resolver that uses the c-ares library for resolves.
|
||||||
|
|
||||||
|
- The Windows threaded resolver. It use:
|
||||||
|
|
||||||
|
A - gethostbyname() on plain ipv4 windows hosts
|
||||||
|
B - getaddrinfo() on ipv6-enabled windows hosts
|
||||||
|
|
||||||
6. License Issues
|
6. License Issues
|
||||||
|
|
||||||
@@ -818,3 +895,26 @@ FAQ
|
|||||||
we want on curl/libcurl and it does not spread to other programs or
|
we want on curl/libcurl and it does not spread to other programs or
|
||||||
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.
|
||||||
|
|
||||||
|
7. PHP/CURL Issues
|
||||||
|
|
||||||
|
7.1 What is PHP/CURL?
|
||||||
|
|
||||||
|
The module for PHP that makes it possible for PHP programs to access curl-
|
||||||
|
functions from within PHP. We often call it PHP/CURL to differentiate from
|
||||||
|
curl the command line tool and libcurl the library.
|
||||||
|
|
||||||
|
7.2 Who write PHP/CURL?
|
||||||
|
|
||||||
|
PHP/CURL is a module that comes with the regular PHP package. It depends and
|
||||||
|
uses libcurl, so you need to have libcurl installed properly first before
|
||||||
|
PHP/CURL can be used. PHP/CURL is written by Sterling Hughes.
|
||||||
|
|
||||||
|
7.3 Can I perform multiple requests using the same handle?
|
||||||
|
|
||||||
|
Yes - at least in PHP version 4.3.8 and later (this has been known to not
|
||||||
|
work in earlier versions, but the exact version when it started to work is
|
||||||
|
unknown to me).
|
||||||
|
|
||||||
|
After a transfer, you just set new options in the handle and make another
|
||||||
|
transfer. This will make libcurl to re-use the same connection if it can.
|
||||||
|
@@ -6,26 +6,33 @@
|
|||||||
|
|
||||||
FEATURES
|
FEATURES
|
||||||
|
|
||||||
Misc
|
curl tool
|
||||||
- full URL syntax
|
- config file support
|
||||||
|
- multiple URLs in a single command line
|
||||||
|
- range "globbing" support: [0-13], {one,two,three}
|
||||||
|
- multiple file upload on a single command line
|
||||||
|
- custom maximum transfer rate
|
||||||
|
- redirectable stderr
|
||||||
|
|
||||||
|
libcurl supports
|
||||||
|
- full URL syntax with no length limit
|
||||||
- custom maximum download time
|
- custom maximum download time
|
||||||
- custom least download speed acceptable
|
- custom least download speed acceptable
|
||||||
- custom output result after completion
|
- custom output result after completion
|
||||||
- multiple URLs
|
|
||||||
- guesses protocol from host name unless specified
|
- guesses protocol from host name unless specified
|
||||||
- uses .netrc
|
- uses .netrc
|
||||||
- progress bar/time specs while downloading
|
- progress bar/time specs while downloading
|
||||||
- "standard" proxy environment variables support
|
- "standard" proxy environment variables support
|
||||||
- config file support
|
|
||||||
- compiles on win32 (reported builds on 40+ operating systems)
|
- compiles on win32 (reported builds on 40+ operating systems)
|
||||||
- redirectable stderr
|
|
||||||
- selectable network interface for outgoing traffic
|
- selectable network interface for outgoing traffic
|
||||||
- IPv6 support
|
- IPv6 support on unix and Windows
|
||||||
- persistant connections
|
- persistant connections
|
||||||
- socks5 support
|
- socks5 support
|
||||||
- supports user name + password in proxy environment variables
|
- supports user name + password in proxy environment variables
|
||||||
- operations through proxy "tunnel" (using CONNECT)
|
- operations through proxy "tunnel" (using CONNECT)
|
||||||
- supports transfers of large files (>2GB and >4GB)
|
- supports large files (>2GB and >4GB) both upload/download
|
||||||
|
- replacable memory functions (malloc, free, realloc, etc)
|
||||||
|
- asynchronous name resolving (*6)
|
||||||
|
|
||||||
HTTP
|
HTTP
|
||||||
- HTTP/1.1 compliant (optionally uses 1.0)
|
- HTTP/1.1 compliant (optionally uses 1.0)
|
||||||
@@ -35,7 +42,7 @@ HTTP
|
|||||||
- POST
|
- POST
|
||||||
- multipart formpost (RFC1867-style)
|
- multipart formpost (RFC1867-style)
|
||||||
- authentication: Basic, Digest, NTLM(*1), GSS-Negotiate/Negotiate(*3) and
|
- authentication: Basic, Digest, NTLM(*1), GSS-Negotiate/Negotiate(*3) and
|
||||||
SPNEGO (*4)
|
SPNEGO (*4) to server and proxy
|
||||||
- resume (both GET and PUT)
|
- resume (both GET and PUT)
|
||||||
- follow redirects
|
- follow redirects
|
||||||
- maximum amount of redirects to follow
|
- maximum amount of redirects to follow
|
||||||
@@ -80,6 +87,8 @@ FTP
|
|||||||
- via http-proxy
|
- via http-proxy
|
||||||
- all operations can be tunneled through a http-proxy
|
- all operations can be tunneled through a http-proxy
|
||||||
- customizable to retrieve file modification date
|
- customizable to retrieve file modification date
|
||||||
|
- third party transfers
|
||||||
|
- no dir depth limit
|
||||||
|
|
||||||
FTPS (*1)
|
FTPS (*1)
|
||||||
- explicit ftps:// support that use SSL on both connections
|
- explicit ftps:// support that use SSL on both connections
|
||||||
@@ -103,6 +112,8 @@ GOPHER
|
|||||||
|
|
||||||
FILE
|
FILE
|
||||||
- URL support
|
- URL support
|
||||||
|
- "uploads"
|
||||||
|
- resume
|
||||||
|
|
||||||
FOOTNOTES
|
FOOTNOTES
|
||||||
=========
|
=========
|
||||||
@@ -112,3 +123,4 @@ FOOTNOTES
|
|||||||
*3 = requires a GSSAPI-compliant library, such as Heimdal or similar.
|
*3 = requires a GSSAPI-compliant library, such as Heimdal or similar.
|
||||||
*4 = requires FBopenssl
|
*4 = requires FBopenssl
|
||||||
*5 = requires a krb4 library, such as the MIT one or similar.
|
*5 = requires a krb4 library, such as the MIT one or similar.
|
||||||
|
*6 = requires c-ares
|
||||||
|
@@ -1,25 +0,0 @@
|
|||||||
Steps To Perform When Building a Public Release
|
|
||||||
|
|
||||||
* "make distcheck"
|
|
||||||
|
|
||||||
* ./maketgz
|
|
||||||
then upload the 3 curl packages maketgz created
|
|
||||||
|
|
||||||
* update these files:
|
|
||||||
www/_download.html
|
|
||||||
www/_changes.html
|
|
||||||
www/_newslog.html
|
|
||||||
www/Makefile
|
|
||||||
|
|
||||||
* commit the web changes
|
|
||||||
|
|
||||||
* 'cvs commit'
|
|
||||||
|
|
||||||
* 'cvs tag'
|
|
||||||
|
|
||||||
* write the release announcement, including:
|
|
||||||
- changes / bugfixes
|
|
||||||
- other curl-related news
|
|
||||||
- contributors
|
|
||||||
|
|
||||||
* mail release-announcement to curl-announce and curl-users
|
|
43
docs/INSTALL
43
docs/INSTALL
@@ -158,17 +158,9 @@ Win32
|
|||||||
Make the sources in the src/ drawer be a "win32 console application"
|
Make the sources in the src/ drawer be a "win32 console application"
|
||||||
project. Name it curl.
|
project. Name it curl.
|
||||||
|
|
||||||
With VC++, add 'ws2_32.lib' to the link libs when you build curl!
|
|
||||||
Borland seems to do that itself magically. Of course you have to make
|
|
||||||
sure it links with the libcurl too!
|
|
||||||
|
|
||||||
For VC++ 6, there's an included Makefile.vc6 that should be possible
|
For VC++ 6, there's an included Makefile.vc6 that should be possible
|
||||||
to use out-of-the-box.
|
to use out-of-the-box.
|
||||||
|
|
||||||
Microsoft note: add /Zm200 to the compiler options to increase the
|
|
||||||
compiler's memory allocation limit, as the hugehelp.c won't compile
|
|
||||||
due to "too long puts string".
|
|
||||||
|
|
||||||
|
|
||||||
With SSL:
|
With SSL:
|
||||||
|
|
||||||
@@ -566,33 +558,10 @@ PORTS
|
|||||||
- s390 Linux
|
- s390 Linux
|
||||||
- XScale/PXA250 Linux 2.4
|
- XScale/PXA250 Linux 2.4
|
||||||
|
|
||||||
OpenSSL
|
Useful URLs
|
||||||
=======
|
===========
|
||||||
|
|
||||||
You'll find OpenSSL information at:
|
|
||||||
|
|
||||||
http://www.openssl.org
|
|
||||||
|
|
||||||
|
|
||||||
MingW32/Cygwin
|
|
||||||
==============
|
|
||||||
|
|
||||||
You'll find MingW32 and Cygwin information at:
|
|
||||||
|
|
||||||
http://www.mingw.org
|
|
||||||
|
|
||||||
OpenLDAP
|
|
||||||
========
|
|
||||||
|
|
||||||
You'll find OpenLDAP information at:
|
|
||||||
|
|
||||||
http://www.openldap.org
|
|
||||||
|
|
||||||
Zlib
|
|
||||||
====
|
|
||||||
|
|
||||||
You'll find Zlib information at:
|
|
||||||
|
|
||||||
http://www.gzip.org/zlib/
|
|
||||||
|
|
||||||
|
|
||||||
|
OpenSSL http://www.openssl.org
|
||||||
|
MingW http://www.mingw.org
|
||||||
|
OpenLDAP http://www.openldap.org
|
||||||
|
Zlib http://www.gzip.org/zlib/
|
||||||
|
@@ -3,10 +3,20 @@ 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!
|
||||||
|
|
||||||
|
* curl version 7.12.2 fails on AIX if compiled with --enable-ares.
|
||||||
|
The workaround is to combine --enable-ares with --disable-shared
|
||||||
|
|
||||||
|
* When connecting to a SOCKS proxy, the (connect) timeout is not properly
|
||||||
|
acknowledged after the actual TCP connect (during the SOCKS "negotiate"
|
||||||
|
phase). Pointed out by Lucas. Fix: need to select() and timeout properly.
|
||||||
|
|
||||||
|
* Using configure --disable-[protocol] may cause 'make test' to fail for
|
||||||
|
tests using the disabled protocol(s).
|
||||||
|
|
||||||
* To get HTTP Negotiate authentication to work fine, you need to provide a
|
* 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.
|
Bug report #1004841. How? http://curl.haxx.se/mail/lib-2004-08/0182.html
|
||||||
|
|
||||||
* If you use a very large amount of file descriptors (more than FD_SETSIZE)
|
* If you use a very large amount of file descriptors (more than FD_SETSIZE)
|
||||||
and then use libcurl, it might crash on its use of select() which then
|
and then use libcurl, it might crash on its use of select() which then
|
||||||
@@ -37,10 +47,6 @@ may have been fixed since this was written!
|
|||||||
libcurl thinks of it as the *compressed* lenght. Some explanations are here:
|
libcurl thinks of it as the *compressed* lenght. Some explanations are here:
|
||||||
http://curl.haxx.se/mail/lib-2003-06/0146.html
|
http://curl.haxx.se/mail/lib-2003-06/0146.html
|
||||||
|
|
||||||
* Downloading 0 (zero) bytes files over FTP will not create a zero byte file
|
|
||||||
locally, which is because libcurl doesn't call the write callback with zero
|
|
||||||
bytes. Explained here: http://curl.haxx.se/mail/archive-2003-04/0143.html
|
|
||||||
|
|
||||||
* IPv6 support on AIX 4.3.3 doesn't work due to a missing sockaddr_storage
|
* IPv6 support on AIX 4.3.3 doesn't work due to a missing sockaddr_storage
|
||||||
struct. It has been reported to work on AIX 5.1 though.
|
struct. It has been reported to work on AIX 5.1 though.
|
||||||
|
|
||||||
|
@@ -10,13 +10,14 @@ can lead to for end users.
|
|||||||
|
|
||||||
I am not a lawyer and this is not legal advice!
|
I am not a lawyer and this is not legal advice!
|
||||||
|
|
||||||
One common dilemma is that GPL[*]-licensed code is not allowed to be linked
|
One common dilemma is that GPL[1]-licensed code is not allowed to be linked
|
||||||
with code licensed under the Original BSD license (with the announcement
|
with code licensed under the Original BSD license (with the announcement
|
||||||
clause, unless there's a specified exception in the GPL-licensed module). You
|
clause, unless there's a specified exception in the GPL-licensed module). You
|
||||||
may still build your own copies that use them all, but distributing them as
|
may still build your own copies that use them all, but distributing them as
|
||||||
binaries would be to violate the GPL license. This particular problem was
|
binaries would be to violate the GPL license - unless you accompany your
|
||||||
addressed when the Modified BSD license was created, which does not have the
|
license with an exception[2]. This particular problem was addressed when the
|
||||||
annoncement clause that collides with GPL.
|
Modified BSD license was created, which does not have the annoncement clause
|
||||||
|
that collides with GPL.
|
||||||
|
|
||||||
libcurl http://curl.haxx.se/docs/copyright.html
|
libcurl http://curl.haxx.se/docs/copyright.html
|
||||||
|
|
||||||
@@ -80,4 +81,6 @@ OpenLDAP http://www.openldap.org/software/release/license.html
|
|||||||
linked with libcurl in an app.
|
linked with libcurl in an app.
|
||||||
|
|
||||||
|
|
||||||
[*] = GPL - GNU General Public License: http://www.gnu.org/licenses/gpl.html
|
[1] = GPL - GNU General Public License: http://www.gnu.org/licenses/gpl.html
|
||||||
|
[2] = http://www.fsf.org/licenses/gpl-faq.html#GPLIncompatibleLibs details on
|
||||||
|
how to write such an exception to the GPL
|
||||||
|
@@ -32,7 +32,41 @@ server, do one of the following:
|
|||||||
configure with the --with-ca-bundle option pointing out the path of your
|
configure with the --with-ca-bundle option pointing out the path of your
|
||||||
choice.
|
choice.
|
||||||
|
|
||||||
If you're using the curl command line tool, you can specify your own CA
|
To do this, you need to get the CA cert for your server in PEM format and
|
||||||
|
then append that to your CA cert bundle.
|
||||||
|
|
||||||
|
If you use Internet Explorer, this is one way to get extract the CA cert
|
||||||
|
for a particular server:
|
||||||
|
|
||||||
|
o View the certificate by double-clicking the padlock
|
||||||
|
o Find out where the CA certificate is kept (Certificate>
|
||||||
|
Authority Information Access>URL)
|
||||||
|
o Get a copy of the crt file using curl
|
||||||
|
o Convert it from crt to PEM using the openssl tool:
|
||||||
|
openssl x509 -inform DES -in yourdownloaded.crt \
|
||||||
|
-out outcert.pem -text
|
||||||
|
o Append the 'outcert.pem' to the CA cert bundle or use it stand-alone
|
||||||
|
as described below.
|
||||||
|
|
||||||
|
(Thanks to Frankie V for this description)
|
||||||
|
|
||||||
|
If you use the 'openssl' tool, this is one way to get extract the CA cert
|
||||||
|
for a particular server:
|
||||||
|
|
||||||
|
o openssl s_client -connect xxxxx.com:443 |tee logfile
|
||||||
|
o type "QUIT", followed by the "ENTER" key
|
||||||
|
o The certificate will have "BEGIN CERTIFICATE" and "END CERTIFICATE"
|
||||||
|
markers.
|
||||||
|
o If you want to see the data in the certificate, you can do: "openssl
|
||||||
|
x509 -inform PEM -in certfile -text -out certdata" where certfile is
|
||||||
|
the cert you extracted from logfile. Look in certdata.
|
||||||
|
o If you want to trust the certificate, you can append it to your
|
||||||
|
cert_bundle or use it stand-alone as described. Just remember that the
|
||||||
|
security is no better than the way you obtained the certificate.
|
||||||
|
|
||||||
|
(Thanks to Doug Kaufman for this description)
|
||||||
|
|
||||||
|
4. If you're using the curl command line tool, you can specify your own CA
|
||||||
cert path by setting the environment variable CURL_CA_BUNDLE to the path
|
cert path by setting the environment variable CURL_CA_BUNDLE to the path
|
||||||
of your choice.
|
of your choice.
|
||||||
|
|
||||||
@@ -45,7 +79,7 @@ server, do one of the following:
|
|||||||
4. Windows Directory (e.g. C:\windows)
|
4. Windows Directory (e.g. C:\windows)
|
||||||
5. all directories along %PATH%
|
5. all directories along %PATH%
|
||||||
|
|
||||||
4. Get a better/different/newer CA cert bundle! One option is to extract the
|
5. Get a better/different/newer CA cert bundle! One option is to extract the
|
||||||
one a recent Mozilla browser uses, by following the instruction found
|
one a recent Mozilla browser uses, by following the instruction found
|
||||||
here:
|
here:
|
||||||
|
|
||||||
@@ -56,9 +90,3 @@ certificate that isn't signed by one of the certificates in the installed CA
|
|||||||
cert bundle, will cause SSL to report an error ("certificate verify failed")
|
cert bundle, will cause SSL to report an error ("certificate verify failed")
|
||||||
during the handshake and SSL will then refuse further communication with that
|
during the handshake and SSL will then refuse further communication with that
|
||||||
server.
|
server.
|
||||||
|
|
||||||
This procedure has been deemed The Right Thing even though it adds this extra
|
|
||||||
trouble for some users, since it adds security to a majority of the SSL
|
|
||||||
connections that previously weren't really secure. It turned out many people
|
|
||||||
were using previous versions of curl/libcurl without realizing the need for
|
|
||||||
the CA cert options to get truly secure SSL connections.
|
|
||||||
|
51
docs/TODO
51
docs/TODO
@@ -33,8 +33,8 @@ TODO
|
|||||||
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() #845941
|
||||||
|
|
||||||
* Option to set the SO_KEEPALIVE socket option to make libcurl notice and
|
* Use 'struct lifreq' and SIOCGLIFADDR instead of 'struct ifreq' and
|
||||||
disconnect very long time idle connections.
|
SIOCGIFADDR on newer Solaris versions as they claim the latter is obsolete.
|
||||||
|
|
||||||
LIBCURL - multi interface
|
LIBCURL - multi interface
|
||||||
|
|
||||||
@@ -57,6 +57,14 @@ TODO
|
|||||||
|
|
||||||
FTP
|
FTP
|
||||||
|
|
||||||
|
* "PASV IP override" - When an FTPS host is behind a NAT firewall, passive
|
||||||
|
mode fails. The PASV response from the host ["227 PASV Entering passive
|
||||||
|
mode (_ip_address_, _port_)."] contains the private network IP address of
|
||||||
|
the host, which since it is encrypted, cannot be modified by the firewall
|
||||||
|
to the public IP address. What is needed is a cURL option to override the
|
||||||
|
IP address passed by the host "227 PASV" response. Requested by Ed
|
||||||
|
Hingsbergen
|
||||||
|
|
||||||
* 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. Requsted by Markus Moeller.
|
||||||
@@ -111,21 +119,19 @@ TODO
|
|||||||
* Evaluate/apply Gertjan van Wingerde's SSL patches:
|
* Evaluate/apply Gertjan van Wingerde's SSL patches:
|
||||||
http://curl.haxx.se/mail/lib-2004-03/0087.html
|
http://curl.haxx.se/mail/lib-2004-03/0087.html
|
||||||
|
|
||||||
* If you really want to improve the SSL situation, you should probably have a
|
* "Look at SSL cafile - quick traces look to me like these are done on every
|
||||||
look at SSL cafile loading as well - quick traces look to me like these are
|
request as well, when they should only be necessary once per ssl context
|
||||||
done on every request as well, when they should only be necessary once per
|
(or once per handle)". The major improvement we can rather easily do is to
|
||||||
ssl context (or once per handle). Even better would be to support the SSL
|
make sure we don't create and kill a new SSL "context" for every request,
|
||||||
CAdir option - instead of loading all of the root CA certs for every
|
but instead make one for every connection and re-use that SSL context in
|
||||||
request, this option allows you to only read the CA chain that is actually
|
the same style connections are re-used. It will make us use slightly more
|
||||||
required (into the cache)...
|
memory but it will libcurl do less creations and deletions of SSL contexts.
|
||||||
|
|
||||||
* Add an interface to libcurl that enables "session IDs" to get
|
* Add an interface to libcurl that enables "session IDs" to get
|
||||||
exported/imported. Cris Bailiff said: "OpenSSL has functions which can
|
exported/imported. Cris Bailiff said: "OpenSSL has functions which can
|
||||||
serialise the current SSL state to a buffer of your choice, and
|
serialise the current SSL state to a buffer of your choice, and
|
||||||
recover/reset the state from such a buffer at a later date - this is used
|
recover/reset the state from such a buffer at a later date - this is used
|
||||||
by mod_ssl for apache to implement and SSL session ID cache". This whole
|
by mod_ssl for apache to implement and SSL session ID cache".
|
||||||
idea might become moot if we enable the 'data sharing' as mentioned in the
|
|
||||||
LIBCURL label above.
|
|
||||||
|
|
||||||
* OpenSSL supports a callback for customised verification of the peer
|
* OpenSSL supports a callback for customised verification of the peer
|
||||||
certificate, but this doesn't seem to be exposed in the libcurl APIs. Could
|
certificate, but this doesn't seem to be exposed in the libcurl APIs. Could
|
||||||
@@ -134,8 +140,12 @@ TODO
|
|||||||
|
|
||||||
* Make curl's SSL layer option capable of using other free SSL libraries.
|
* Make curl's SSL layer option capable of using other free SSL libraries.
|
||||||
Such as the Mozilla Security Services
|
Such as the Mozilla Security Services
|
||||||
(http://www.mozilla.org/projects/security/pki/nss/) and GNUTLS
|
(http://www.mozilla.org/projects/security/pki/nss/) and GnuTLS
|
||||||
(http://gnutls.hellug.gr/)
|
(http://www.gnu.org/software/gnutls/) This subject has been brought up
|
||||||
|
again recently since GPL-licensed applications that link with libcurl MAY
|
||||||
|
NOT distribute binaries that use OpenSSL without adding an exception clause
|
||||||
|
to the GPL license. See the LICENSE-MIXING document and this:
|
||||||
|
http://www.gnome.org/~markmc/openssl-and-the-gpl.html
|
||||||
|
|
||||||
LDAP
|
LDAP
|
||||||
|
|
||||||
@@ -145,6 +155,17 @@ TODO
|
|||||||
|
|
||||||
CLIENT
|
CLIENT
|
||||||
|
|
||||||
|
* "curl --sync http://example.com/feed[1-100].rss" or
|
||||||
|
"curl --sync http://example.net/{index,calendar,history}.html"
|
||||||
|
|
||||||
|
Downloads a range or set of URLs using the remote name, but only if the
|
||||||
|
remote file is newer than the local file. A Last-Modified HTTP date header
|
||||||
|
should also be used to set the mod date on the downloaded file.
|
||||||
|
(idea from "Brianiac")
|
||||||
|
|
||||||
|
* Globbing support for -d and -F, as in 'curl -d "name=foo[0-9]" URL'.
|
||||||
|
Requested by Dane Jensen and others. This is easily scripted though.
|
||||||
|
|
||||||
* Add an option that prevents cURL from overwiting existing local files. When
|
* Add an option that prevents cURL from overwiting 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
|
||||||
@@ -182,7 +203,7 @@ TODO
|
|||||||
command line. Possibly by letting ':' separate options between URLs,
|
command line. Possibly by letting ':' separate options between URLs,
|
||||||
similar to this:
|
similar to this:
|
||||||
|
|
||||||
curl --data foo --url url.com :
|
curl --data foo --url url.com : \
|
||||||
--url url2.com : \
|
--url url2.com : \
|
||||||
--url url3.com --data foo3
|
--url url3.com --data foo3
|
||||||
|
|
||||||
|
22
docs/curl.1
22
docs/curl.1
@@ -335,10 +335,10 @@ 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)
|
||||||
|
|
||||||
If this option is used twice, the second will again disable silent failure.
|
If this option is used twice, the second will again disable this.
|
||||||
.IP "-F/--form <name=content>"
|
.IP "-F/--form <name=content>"
|
||||||
(HTTP) This lets curl emulate a filled in form in which a user has pressed the
|
(HTTP) This lets curl emulate a filled in form in which a user has pressed the
|
||||||
submit button. This causes curl to POST data using the content-type
|
submit button. This causes curl to POST data using the Content-Type
|
||||||
multipart/form-data according to RFC1867. This enables uploading of binary
|
multipart/form-data according to RFC1867. This enables uploading of binary
|
||||||
files etc. To force the 'content' part to be be a file, prefix the file name
|
files etc. To force the 'content' part to be be a file, prefix the file name
|
||||||
with an @ sign. To just get the content part from a file, prefix the file name
|
with an @ sign. To just get the content part from a file, prefix the file name
|
||||||
@@ -355,11 +355,15 @@ input:
|
|||||||
To read the file's content from stdin insted of a file, use - where the file
|
To read the file's content from stdin insted of a file, use - where the file
|
||||||
name should've been. This goes for both @ and < constructs.
|
name should've been. This goes for both @ and < constructs.
|
||||||
|
|
||||||
You can also tell curl what Content-Type to use for the file upload part, by
|
You can also tell curl what Content-Type to use by using 'type=', in a manner
|
||||||
using 'type=', in a manner similar to:
|
similar to:
|
||||||
|
|
||||||
\fBcurl\fP -F "web=@index.html;type=text/html" url.com
|
\fBcurl\fP -F "web=@index.html;type=text/html" url.com
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
\fBcurl\fP -F "name=daniel;type=text/foo" url.com
|
||||||
|
|
||||||
See further examples and details in the MANUAL.
|
See further examples and details in the MANUAL.
|
||||||
|
|
||||||
This option can be used multiple times.
|
This option can be used multiple times.
|
||||||
@@ -972,22 +976,18 @@ not set.
|
|||||||
|
|
||||||
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 "-z/--time-cond <date expression>"
|
.IP "-z/--time-cond <date expression>"
|
||||||
(HTTP)
|
(HTTP) Request a file that has been modified later than the given time and
|
||||||
Request to get a file that has been modified later than the given time and
|
|
||||||
date, or one that has been modified before that time. The date expression can
|
date, or one that has been modified before that time. The date expression can
|
||||||
be all sorts of date strings or if it doesn't match any internal ones, it
|
be all sorts of date strings or if it doesn't match any internal ones, it
|
||||||
tries to get the time from a given file name instead! See the
|
tries to get the time from a given file name instead! See the
|
||||||
.BR "GNU date(1)"
|
\fIcurl_getdate(3)\fP man pages for date expression details.
|
||||||
or
|
|
||||||
.BR "curl_getdate(3)"
|
|
||||||
man pages for date expression details.
|
|
||||||
|
|
||||||
Start the date expression with a dash (-) to make it request for a document
|
Start the date expression with a dash (-) to make it request for a document
|
||||||
that is older than the given date/time, default is a document that is newer
|
that is older than the given date/time, default is a document that is newer
|
||||||
than the specified date/time.
|
than the specified date/time.
|
||||||
|
|
||||||
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 "-Z/--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".
|
||||||
|
@@ -9,7 +9,7 @@ EXTRA_DIST = README curlgtk.c sepheaders.c simple.c postit2.c \
|
|||||||
ftpupload.c httpput.c simplessl.c ftpgetresp.c http-post.c \
|
ftpupload.c httpput.c simplessl.c ftpgetresp.c http-post.c \
|
||||||
post-callback.c multi-app.c multi-double.c multi-single.c \
|
post-callback.c multi-app.c multi-double.c multi-single.c \
|
||||||
multi-post.c fopen.c simplepost.c makefile.dj curlx.c https.c \
|
multi-post.c fopen.c simplepost.c makefile.dj curlx.c https.c \
|
||||||
multi-debugcallback.c fileupload.c getinfo.c ftp3rdparty.c
|
multi-debugcallback.c fileupload.c getinfo.c ftp3rdparty.c debug.c
|
||||||
|
|
||||||
all:
|
all:
|
||||||
@echo "done"
|
@echo "done"
|
||||||
|
128
docs/examples/debug.c
Normal file
128
docs/examples/debug.c
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* _ _ ____ _
|
||||||
|
* Project ___| | | | _ \| |
|
||||||
|
* / __| | | | |_) | |
|
||||||
|
* | (__| |_| | _ <| |___
|
||||||
|
* \___|\___/|_| \_\_____|
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <curl/curl.h>
|
||||||
|
|
||||||
|
struct data {
|
||||||
|
char trace_ascii; /* 1 or 0 */
|
||||||
|
};
|
||||||
|
|
||||||
|
static
|
||||||
|
void dump(const char *text,
|
||||||
|
FILE *stream, unsigned char *ptr, size_t size,
|
||||||
|
char nohex)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
size_t c;
|
||||||
|
|
||||||
|
unsigned int width=0x10;
|
||||||
|
|
||||||
|
if(nohex)
|
||||||
|
/* without the hex output, we can fit more on screen */
|
||||||
|
width = 0x40;
|
||||||
|
|
||||||
|
fprintf(stream, "%s, %zd bytes (0x%zx)\n", text, size, size);
|
||||||
|
|
||||||
|
for(i=0; i<size; i+= width) {
|
||||||
|
|
||||||
|
fprintf(stream, "%04zx: ", i);
|
||||||
|
|
||||||
|
if(!nohex) {
|
||||||
|
/* hex not disabled, show it */
|
||||||
|
for(c = 0; c < width; c++)
|
||||||
|
if(i+c < size)
|
||||||
|
fprintf(stream, "%02x ", ptr[i+c]);
|
||||||
|
else
|
||||||
|
fputs(" ", stream);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(c = 0; (c < width) && (i+c < size); c++) {
|
||||||
|
/* check for 0D0A; if found, skip past and start a new line of output */
|
||||||
|
if (nohex && (i+c+1 < size) && ptr[i+c]==0x0D && ptr[i+c+1]==0x0A) {
|
||||||
|
i+=(c+2-width);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
fprintf(stream, "%c",
|
||||||
|
(ptr[i+c]>=0x20) && (ptr[i+c]<0x80)?ptr[i+c]:'.');
|
||||||
|
/* check again for 0D0A, to avoid an extra \n if it's at width */
|
||||||
|
if (nohex && (i+c+2 < size) && ptr[i+c+1]==0x0D && ptr[i+c+2]==0x0A) {
|
||||||
|
i+=(c+3-width);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fputc('\n', stream); /* newline */
|
||||||
|
}
|
||||||
|
fflush(stream);
|
||||||
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
int my_trace(CURL *handle, curl_infotype type,
|
||||||
|
unsigned char *data, size_t size,
|
||||||
|
void *userp)
|
||||||
|
{
|
||||||
|
struct data *config = (struct data *)userp;
|
||||||
|
const char *text;
|
||||||
|
(void)handle; /* prevent compiler warning */
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case CURLINFO_TEXT:
|
||||||
|
fprintf(stderr, "== Info: %s", data);
|
||||||
|
default: /* in case a new one is introduced to shock us */
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
case CURLINFO_HEADER_OUT:
|
||||||
|
text = "=> Send header";
|
||||||
|
break;
|
||||||
|
case CURLINFO_DATA_OUT:
|
||||||
|
text = "=> Send data";
|
||||||
|
break;
|
||||||
|
case CURLINFO_HEADER_IN:
|
||||||
|
text = "<= Recv header";
|
||||||
|
break;
|
||||||
|
case CURLINFO_DATA_IN:
|
||||||
|
text = "<= Recv data";
|
||||||
|
break;
|
||||||
|
case CURLINFO_SSL_DATA_IN:
|
||||||
|
text = "<= Recv SSL data";
|
||||||
|
break;
|
||||||
|
case CURLINFO_SSL_DATA_OUT:
|
||||||
|
text = "<= Send SSL data";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
dump(text, stderr, data, size, config->trace_ascii);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
CURL *curl;
|
||||||
|
CURLcode res;
|
||||||
|
struct data config;
|
||||||
|
|
||||||
|
config.trace_ascii = 1; /* enable ascii tracing */
|
||||||
|
|
||||||
|
curl = curl_easy_init();
|
||||||
|
if(curl) {
|
||||||
|
curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, my_trace);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &config);
|
||||||
|
|
||||||
|
/* the DEBUGFUNCTION has no effect until we enable VERBOSE */
|
||||||
|
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
||||||
|
|
||||||
|
curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
|
||||||
|
res = curl_easy_perform(curl);
|
||||||
|
|
||||||
|
/* always cleanup */
|
||||||
|
curl_easy_cleanup(curl);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
@@ -22,7 +22,7 @@ int main(void)
|
|||||||
double speed_upload, total_time;
|
double speed_upload, total_time;
|
||||||
FILE *fd;
|
FILE *fd;
|
||||||
|
|
||||||
fd = fopen("debugit", "r"); /* open file to upload */
|
fd = fopen("debugit", "rb"); /* open file to upload */
|
||||||
if(!fd) {
|
if(!fd) {
|
||||||
|
|
||||||
return 1; /* can't continue */
|
return 1; /* can't continue */
|
||||||
|
@@ -52,7 +52,11 @@ int main(void)
|
|||||||
|
|
||||||
curl = curl_easy_init();
|
curl = curl_easy_init();
|
||||||
if(curl) {
|
if(curl) {
|
||||||
/* Get curl 7.9.2 from sunet.se's FTP site: */
|
/*
|
||||||
|
* Get curl 7.9.2 from sunet.se's FTP site. curl 7.9.2 is most likely not
|
||||||
|
* present there by the time you read this, so you'd better replace the
|
||||||
|
* URL with one that works!
|
||||||
|
*/
|
||||||
curl_easy_setopt(curl, CURLOPT_URL,
|
curl_easy_setopt(curl, CURLOPT_URL,
|
||||||
"ftp://ftp.sunet.se/pub/www/utilities/curl/curl-7.9.2.tar.gz");
|
"ftp://ftp.sunet.se/pub/www/utilities/curl/curl-7.9.2.tar.gz");
|
||||||
/* Define our callback to get called when there's data to be written */
|
/* Define our callback to get called when there's data to be written */
|
||||||
|
@@ -98,8 +98,6 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
curl_multi_cleanup(multi_handle);
|
|
||||||
|
|
||||||
/* See how the transfers went */
|
/* See how the transfers went */
|
||||||
while ((msg = curl_multi_info_read(multi_handle, &msgs_left))) {
|
while ((msg = curl_multi_info_read(multi_handle, &msgs_left))) {
|
||||||
if (msg->msg == CURLMSG_DONE) {
|
if (msg->msg == CURLMSG_DONE) {
|
||||||
@@ -120,6 +118,8 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
curl_multi_cleanup(multi_handle);
|
||||||
|
|
||||||
/* Free the CURL handles */
|
/* Free the CURL handles */
|
||||||
for (i=0; i<HANDLECOUNT; i++)
|
for (i=0; i<HANDLECOUNT; i++)
|
||||||
curl_easy_cleanup(handles[i]);
|
curl_easy_cleanup(handles[i]);
|
||||||
|
@@ -57,9 +57,6 @@ int main(void)
|
|||||||
/* Now specify we want to POST data */
|
/* Now specify we want to POST data */
|
||||||
curl_easy_setopt(curl, CURLOPT_POST, TRUE);
|
curl_easy_setopt(curl, CURLOPT_POST, TRUE);
|
||||||
|
|
||||||
/* Set the expected POST size */
|
|
||||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, pooh.sizeleft);
|
|
||||||
|
|
||||||
/* we want to use our own read function */
|
/* we want to use our own read function */
|
||||||
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
|
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
|
||||||
|
|
||||||
@@ -69,6 +66,47 @@ int main(void)
|
|||||||
/* get verbose debug output please */
|
/* get verbose debug output please */
|
||||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
If you use POST to a HTTP 1.1 server, you can send data without knowing
|
||||||
|
the size before starting the POST if you use chunked encoding. You
|
||||||
|
enable this by adding a header like "Transfer-Encoding: chunked" with
|
||||||
|
CURLOPT_HTTPHEADER. With HTTP 1.0 or without chunked transfer, you must
|
||||||
|
specify the size in the request.
|
||||||
|
*/
|
||||||
|
#ifdef USE_CHUNKED
|
||||||
|
{
|
||||||
|
curl_slist *chunk = NULL;
|
||||||
|
|
||||||
|
chunk = curl_slist_append(chunk, "Transfer-Encoding: chunked");
|
||||||
|
res = curl_easy_setopt(curl, CURLOPT_HTTPHEADER);
|
||||||
|
/* use curl_slist_free_all() after the *perform() call to free this
|
||||||
|
list again */
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
/* Set the expected POST size. If you want to POST large amounts of data,
|
||||||
|
consider CURLOPT_POSTFIELDSIZE_LARGE */
|
||||||
|
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, pooh.sizeleft);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DISABLE_EXPECT
|
||||||
|
/*
|
||||||
|
Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue"
|
||||||
|
header. You can disable this header with CURLOPT_HTTPHEADER as usual.
|
||||||
|
NOTE: if you want chunked transfer too, you need to combine these two
|
||||||
|
since you can only set one list of headers with CURLOPT_HTTPHEADER. */
|
||||||
|
|
||||||
|
/* A less good option would be to enforce HTTP 1.0, but that might also
|
||||||
|
have other implications. */
|
||||||
|
{
|
||||||
|
curl_slist *chunk = NULL;
|
||||||
|
|
||||||
|
chunk = curl_slist_append(chunk, "Expect:");
|
||||||
|
res = curl_easy_setopt(curl, CURLOPT_HTTPHEADER);
|
||||||
|
/* use curl_slist_free_all() after the *perform() call to free this
|
||||||
|
list again */
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Perform the request, res will get the return code */
|
/* Perform the request, res will get the return code */
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
|
|
||||||
|
@@ -89,19 +89,25 @@ int main(int argc, char **argv)
|
|||||||
/* cert is stored PEM coded in file... */
|
/* cert is stored PEM coded in file... */
|
||||||
/* since PEM is default, we needn't set it for PEM */
|
/* since PEM is default, we needn't set it for PEM */
|
||||||
curl_easy_setopt(curl,CURLOPT_SSLCERTTYPE,"PEM");
|
curl_easy_setopt(curl,CURLOPT_SSLCERTTYPE,"PEM");
|
||||||
|
|
||||||
/* set the cert for client authentication */
|
/* set the cert for client authentication */
|
||||||
curl_easy_setopt(curl,CURLOPT_SSLCERT,pCertFile);
|
curl_easy_setopt(curl,CURLOPT_SSLCERT,pCertFile);
|
||||||
|
|
||||||
/* sorry, for engine we must set the passphrase
|
/* sorry, for engine we must set the passphrase
|
||||||
(if the key has one...) */
|
(if the key has one...) */
|
||||||
if (pPassphrase)
|
if (pPassphrase)
|
||||||
curl_easy_setopt(curl,CURLOPT_SSLKEYPASSWD,pPassphrase);
|
curl_easy_setopt(curl,CURLOPT_SSLKEYPASSWD,pPassphrase);
|
||||||
|
|
||||||
/* if we use a key stored in a crypto engine,
|
/* if we use a key stored in a crypto engine,
|
||||||
we must set the key type to "ENG" */
|
we must set the key type to "ENG" */
|
||||||
curl_easy_setopt(curl,CURLOPT_SSLKEYTYPE,pKeyType);
|
curl_easy_setopt(curl,CURLOPT_SSLKEYTYPE,pKeyType);
|
||||||
|
|
||||||
/* set the private key (file or ID in engine) */
|
/* set the private key (file or ID in engine) */
|
||||||
curl_easy_setopt(curl,CURLOPT_SSLKEY,pKeyName);
|
curl_easy_setopt(curl,CURLOPT_SSLKEY,pKeyName);
|
||||||
|
|
||||||
/* set the file with the certs vaildating the server */
|
/* set the file with the certs vaildating the server */
|
||||||
curl_easy_setopt(curl,CURLOPT_CAINFO,pCACertFile);
|
curl_easy_setopt(curl,CURLOPT_CAINFO,pCACertFile);
|
||||||
|
|
||||||
/* disconnect if we can't validate server's cert */
|
/* disconnect if we can't validate server's cert */
|
||||||
curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,1);
|
curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,1);
|
||||||
|
|
||||||
|
@@ -19,6 +19,9 @@ this documentation describes further down). The data pointed-to will be
|
|||||||
filled in accordingly and can be relied upon only if the function returns
|
filled in accordingly and can be relied upon only if the function returns
|
||||||
CURLE_OK. This function is intended to get used *AFTER* a performed transfer,
|
CURLE_OK. This function is intended to get used *AFTER* a performed transfer,
|
||||||
all results from this function are undefined until the transfer is completed.
|
all results from this function are undefined until the transfer is completed.
|
||||||
|
|
||||||
|
You should not free the memory returned by this function unless it is
|
||||||
|
explictly mentioned below.
|
||||||
.SH AVAILABLE INFORMATION
|
.SH AVAILABLE INFORMATION
|
||||||
The following information can be extracted:
|
The following information can be extracted:
|
||||||
.IP CURLINFO_EFFECTIVE_URL
|
.IP CURLINFO_EFFECTIVE_URL
|
||||||
@@ -107,6 +110,9 @@ CURLOPT_HTTPAUTH option for \fIcurl_easy_setopt(3)\fP. (Added in 7.10.8)
|
|||||||
.IP CURLINFO_PROXYAUTH_AVAIL
|
.IP CURLINFO_PROXYAUTH_AVAIL
|
||||||
Pass a pointer to a long to receive a bitmask indicating the authentication
|
Pass a pointer to a long to receive a bitmask indicating the authentication
|
||||||
method(s) available for your proxy authentication. (Added in 7.10.8)
|
method(s) available for your proxy authentication. (Added in 7.10.8)
|
||||||
|
.IP CURLINFO_OS_ERRNO
|
||||||
|
Pass a pointer to a long to receive the errno variable from a connect failure.
|
||||||
|
(Added in 7.12.2)
|
||||||
.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.
|
||||||
|
@@ -1,5 +1,3 @@
|
|||||||
.\" You can view this file with:
|
|
||||||
.\" nroff -man [file]
|
|
||||||
.\" $Id$
|
.\" $Id$
|
||||||
.\"
|
.\"
|
||||||
.TH curl_easy_init 3 "4 March 2002" "libcurl 7.8.1" "libcurl Manual"
|
.TH curl_easy_init 3 "4 March 2002" "libcurl 7.8.1" "libcurl Manual"
|
||||||
@@ -20,4 +18,4 @@ initializes curl and this call \fBMUST\fP have a corresponding call to
|
|||||||
If this function returns NULL, something went wrong and you cannot use the
|
If this function returns NULL, something went wrong and you cannot use the
|
||||||
other curl functions.
|
other curl functions.
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
.BR curl_easy_cleanup "(3), " curl_global_init "(3)
|
.BR curl_easy_cleanup "(3), " curl_global_init "(3), " curl_easy_reset "(3)"
|
||||||
|
@@ -32,16 +32,17 @@ CURLcode curl_easy_setopt(CURL *handle, CURLoption option, parameter);
|
|||||||
curl_easy_setopt() is used to tell libcurl how to behave. By using the
|
curl_easy_setopt() is used to tell libcurl how to behave. By using the
|
||||||
appropriate options to \fIcurl_easy_setopt\fP, you can change libcurl's
|
appropriate options to \fIcurl_easy_setopt\fP, you can change libcurl's
|
||||||
behavior. All options are set with the \fIoption\fP followed by a
|
behavior. All options are set with the \fIoption\fP followed by a
|
||||||
\fIparameter\fP. That parameter can be a long, a function pointer or an object
|
\fIparameter\fP. That parameter can be a \fBlong\fP, a \fBfunction pointer\fP,
|
||||||
pointer, all depending on what the specific option expects. Read this manual
|
an \fBobject pointer\fP or a \fBcurl_off_t\fP, depending on what the specific
|
||||||
carefully as bad input values may cause libcurl to behave badly! You can only
|
option expects. Read this manual carefully as bad input values may cause
|
||||||
set one option in each function call. A typical application uses many
|
libcurl to behave badly! You can only set one option in each function call. A
|
||||||
curl_easy_setopt() calls in the setup phase.
|
typical application uses many curl_easy_setopt() calls in the setup phase.
|
||||||
|
|
||||||
Options set with this function call are valid for all forthcoming transfers
|
Options set with this function call are valid for all forthcoming transfers
|
||||||
performed using this \fIhandle\fP. The options are not in any way reset
|
performed using this \fIhandle\fP. The options are not in any way reset
|
||||||
between transfers, so if you want subsequent transfers with different options,
|
between transfers, so if you want subsequent transfers with different options,
|
||||||
you must change them between the transfers.
|
you must change them between the transfers. You can optionally reset all
|
||||||
|
options back to internal default with \fIcurl_easy_reset(3)\fP.
|
||||||
|
|
||||||
\fBNOTE:\fP strings passed to libcurl as 'char *' arguments, will not be
|
\fBNOTE:\fP strings passed to libcurl as 'char *' arguments, will not be
|
||||||
copied by the library. Instead you should keep them available until libcurl no
|
copied by the library. Instead you should keep them available until libcurl no
|
||||||
@@ -92,6 +93,9 @@ of bytes actually taken care of. If that amount differs from the amount passed
|
|||||||
to your function, it'll signal an error to the library and it will abort the
|
to your function, it'll signal an error to the library and it will abort the
|
||||||
transfer and return \fICURLE_WRITE_ERROR\fP.
|
transfer and return \fICURLE_WRITE_ERROR\fP.
|
||||||
|
|
||||||
|
This function may be called with zero bytes data if the transfered file is
|
||||||
|
empty.
|
||||||
|
|
||||||
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
|
\fBNOTE:\fP you will be passed as much data as possible in all invokes, but
|
||||||
@@ -469,22 +473,45 @@ data should be set with \fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE\fP.
|
|||||||
This option is deprecated and starting with version 7.12.1 you should instead
|
This option is deprecated and starting with version 7.12.1 you should instead
|
||||||
use \fICURLOPT_UPLOAD\fP.
|
use \fICURLOPT_UPLOAD\fP.
|
||||||
.IP CURLOPT_POST
|
.IP CURLOPT_POST
|
||||||
A non-zero parameter tells the library to do a regular HTTP post. This is a
|
A non-zero parameter tells the library to do a regular HTTP post. This will
|
||||||
normal application/x-www-form-urlencoded kind, which is the most commonly used
|
also make the library use the a "Content-Type:
|
||||||
one by HTML forms. See the \fICURLOPT_POSTFIELDS\fP option for how to specify
|
application/x-www-form-urlencoded" header. (This is by far the most commonly
|
||||||
the data to post and \fICURLOPT_POSTFIELDSIZE\fP in how to set the data
|
used POST method).
|
||||||
size. Using the \fICURLOPT_POSTFIELDS\fP option implies this option.
|
|
||||||
|
Use the \fICURLOPT_POSTFIELDS\fP option to specify what data to post and
|
||||||
|
\fICURLOPT_POSTFIELDSIZE\fP to set the data size. Optionally, you can provide
|
||||||
|
data to POST using the \fICURLOPT_READFUNCTION\fP and \fICURLOPT_READDATA\fP
|
||||||
|
options.
|
||||||
|
|
||||||
|
You can override the default POST Content-Type: header by setting your own
|
||||||
|
with \fICURLOPT_HTTPHEADER\fP.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
If you use POST to a HTTP 1.1 server, you can send data without knowing the
|
||||||
|
size before starting the POST if you use chunked encoding. You enable this by
|
||||||
|
adding a header like "Transfer-Encoding: chunked" with
|
||||||
|
\fICURLOPT_HTTPHEADER\fP. With HTTP 1.0 or without chunked transfer, you must
|
||||||
|
specify the size in the request.
|
||||||
|
|
||||||
|
NOTE: if you have issued a POST request and want to make a HEAD or GET
|
||||||
|
instead, you must explictly pick the new request type using
|
||||||
|
\fICURLOPT_NOBODY\fP or \fICURLOPT_HTTPGET\fP or similar.
|
||||||
.IP CURLOPT_POSTFIELDS
|
.IP CURLOPT_POSTFIELDS
|
||||||
Pass a char * as parameter, which should be the full data to post in an HTTP
|
Pass a char * as parameter, which should be the full data to post in an HTTP
|
||||||
post operation. You need to make sure that the data is formatted the way you
|
POST operation. You must make sure that the data is formatted the way you want
|
||||||
want the server to receive it. libcurl will not convert or encode it for
|
the server to receive it. libcurl will not convert or encode it for you. Most
|
||||||
you. Most web servers will assume this data to be url-encoded. Take note.
|
web servers will assume this data to be url-encoded. Take note.
|
||||||
|
|
||||||
This POST is a normal application/x-www-form-urlencoded kind (and libcurl will
|
This POST is a normal application/x-www-form-urlencoded kind (and libcurl will
|
||||||
set that Content-Type by default when this option is used), which is the most
|
set that Content-Type by default when this option is used), which is the most
|
||||||
commonly used one by HTML forms. See also the \fICURLOPT_POST\fP. Using
|
commonly used one by HTML forms. See also the \fICURLOPT_POST\fP. Using
|
||||||
\fICURLOPT_POSTFIELDS\fP implies \fICURLOPT_POST\fP.
|
\fICURLOPT_POSTFIELDS\fP implies \fICURLOPT_POST\fP.
|
||||||
|
|
||||||
|
Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
|
||||||
|
You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual.
|
||||||
|
|
||||||
\fBNote:\fP to make multipart/formdata posts (aka rfc1867-posts), check out
|
\fBNote:\fP to make multipart/formdata posts (aka rfc1867-posts), check out
|
||||||
the \fICURLOPT_HTTPPOST\fP option.
|
the \fICURLOPT_HTTPPOST\fP option.
|
||||||
.IP CURLOPT_POSTFIELDSIZE
|
.IP CURLOPT_POSTFIELDSIZE
|
||||||
@@ -505,6 +532,9 @@ list of 'struct HttpPost' structs properly filled in. The best and most
|
|||||||
elegant way to do this, is to use \fIcurl_formadd(3)\fP as documented. The
|
elegant way to do this, is to use \fIcurl_formadd(3)\fP as documented. The
|
||||||
data in this list must remain intact until you close this curl handle again
|
data in this list must remain intact until you close this curl handle again
|
||||||
with \fIcurl_easy_cleanup(3)\fP.
|
with \fIcurl_easy_cleanup(3)\fP.
|
||||||
|
|
||||||
|
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.
|
||||||
.IP CURLOPT_REFERER
|
.IP CURLOPT_REFERER
|
||||||
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
|
||||||
set the Referer: header in the http request sent to the remote server. This
|
set the Referer: header in the http request sent to the remote server. This
|
||||||
@@ -597,7 +627,7 @@ cookies are cookies without expiry date and they are meant to be alive and
|
|||||||
existing for this "session" only.
|
existing for this "session" only.
|
||||||
.IP CURLOPT_HTTPGET
|
.IP CURLOPT_HTTPGET
|
||||||
Pass a long. If the long is non-zero, this forces the HTTP request to get back
|
Pass a long. If the long is non-zero, this forces the HTTP request to get back
|
||||||
to GET. Only really usable if POST, PUT or a custom request have been used
|
to GET. usable if a POST, HEAD, PUT or a custom request have been used
|
||||||
previously using the same curl handle.
|
previously using the same curl handle.
|
||||||
.IP CURLOPT_HTTP_VERSION
|
.IP CURLOPT_HTTP_VERSION
|
||||||
Pass a long, set to one of the values described below. They force libcurl to
|
Pass a long, set to one of the values described below. They force libcurl to
|
||||||
@@ -690,6 +720,18 @@ Require SSL for the control connection or fail with \fICURLE_FTP_SSL_FAILED\fP.
|
|||||||
.IP CURLFTPSSL_ALL
|
.IP CURLFTPSSL_ALL
|
||||||
Require SSL for all communication or fail with \fICURLE_FTP_SSL_FAILED\fP.
|
Require SSL for all communication or fail with \fICURLE_FTP_SSL_FAILED\fP.
|
||||||
.RE
|
.RE
|
||||||
|
.IP CURLOPT_FTPSSLAUTH
|
||||||
|
Pass a long using one of the values from below, to alter how libcurl issues
|
||||||
|
\&"AUTH TLS" or "AUTH SSL" when FTP over SSL is activated (see
|
||||||
|
\fICURLOPT_FTP_SSL\fP).
|
||||||
|
.RS
|
||||||
|
.IP CURLFTPAUTH_DEFAULT
|
||||||
|
Allow libcurl to decide
|
||||||
|
.IP CURLFTPAUTH_SSL
|
||||||
|
Try "AUTH SSL" first, and only if that fails try "AUTH TLS"
|
||||||
|
.IP CURLFTPAUTH_TLS
|
||||||
|
Try "AUTH TLS" first, and only if that fails try "AUTH SSL"
|
||||||
|
.RE
|
||||||
.SH PROTOCOL OPTIONS
|
.SH PROTOCOL OPTIONS
|
||||||
.IP CURLOPT_TRANSFERTEXT
|
.IP CURLOPT_TRANSFERTEXT
|
||||||
A non-zero parameter tells the library to use ASCII mode for ftp transfers,
|
A non-zero parameter tells the library to use ASCII mode for ftp transfers,
|
||||||
@@ -712,8 +754,8 @@ Pass a long as parameter. It contains the offset in number of bytes that you
|
|||||||
want the transfer to start from. Set this option to 0 to make the transfer
|
want the transfer to start from. Set this option to 0 to make the transfer
|
||||||
start from the beginning (effectively disabling resume).
|
start from the beginning (effectively disabling resume).
|
||||||
.IP CURLOPT_RESUME_FROM_LARGE
|
.IP CURLOPT_RESUME_FROM_LARGE
|
||||||
Pass an curl_off_t as parameter. It contains the offset in number of bytes
|
Pass a curl_off_t as parameter. It contains the offset in number of bytes that
|
||||||
that you want the transfer to start from. (Added in 7.11.0)
|
you want the transfer to start from. (Added in 7.11.0)
|
||||||
.IP CURLOPT_CUSTOMREQUEST
|
.IP CURLOPT_CUSTOMREQUEST
|
||||||
Pass a pointer to a zero terminated string as parameter. It will be user
|
Pass a pointer to a zero terminated string as parameter. It will be user
|
||||||
instead of GET or HEAD when doing an HTTP request, or instead of LIST or NLST
|
instead of GET or HEAD when doing an HTTP request, or instead of LIST or NLST
|
||||||
@@ -740,6 +782,10 @@ can be used after a transfer to extract the received time (if any).
|
|||||||
A non-zero parameter tells the library to not include the body-part in the
|
A non-zero parameter tells the library to not include the body-part in the
|
||||||
output. This is only relevant for protocols that have separate header and body
|
output. This is only relevant for protocols that have separate header and body
|
||||||
parts. On HTTP(S) servers, this will make libcurl do a HEAD request.
|
parts. On HTTP(S) servers, this will make libcurl do a HEAD request.
|
||||||
|
|
||||||
|
To change back to GET, you should use \fICURLOPT_HTTPGET\fP. To change back to
|
||||||
|
POST, you should use \fICURLOPT_POST\fP. Setting \fICURLOPT_NOBODY\fP to zero
|
||||||
|
has no effect.
|
||||||
.IP CURLOPT_INFILESIZE
|
.IP CURLOPT_INFILESIZE
|
||||||
When uploading a file to a remote site, this option should be used to tell
|
When uploading a file to a remote site, this option should be used to tell
|
||||||
libcurl what the expected size of the infile is. This value should be passed
|
libcurl what the expected size of the infile is. This value should be passed
|
||||||
@@ -750,9 +796,19 @@ libcurl what the expected size of the infile is. This value should be passed
|
|||||||
as a curl_off_t. (Added in 7.11.0)
|
as a curl_off_t. (Added in 7.11.0)
|
||||||
.IP CURLOPT_UPLOAD
|
.IP CURLOPT_UPLOAD
|
||||||
A non-zero parameter tells the library to prepare for an upload. The
|
A non-zero parameter tells the library to prepare for an upload. The
|
||||||
\fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE_LARGE\fP are also interesting
|
\fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZEE\fP or
|
||||||
for uploads. If the protocol is HTTP, uploading means using the PUT request
|
\fICURLOPT_INFILESIZE_LARGE\fP are also interesting for uploads. If the
|
||||||
unless you tell libcurl otherwise.
|
protocol is HTTP, uploading means using the PUT request unless you tell
|
||||||
|
libcurl otherwise.
|
||||||
|
|
||||||
|
Using PUT with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
|
||||||
|
You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual.
|
||||||
|
|
||||||
|
If you use PUT to a HTTP 1.1 server, you can upload data without knowing the
|
||||||
|
size before starting the transfer if you use chunked encoding. You enable this
|
||||||
|
by adding a header like "Transfer-Encoding: chunked" with
|
||||||
|
\fICURLOPT_HTTPHEADER\fP. With HTTP 1.0 or without chunked transfer, you must
|
||||||
|
specify the size.
|
||||||
.IP CURLOPT_MAXFILESIZE
|
.IP CURLOPT_MAXFILESIZE
|
||||||
Pass a long as parameter. This allows you to specify the maximum size (in
|
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,
|
||||||
@@ -983,4 +1039,4 @@ If you try to set an option that libcurl doesn't know about, perhaps because
|
|||||||
the library is too old to support it or the option was removed in a recent
|
the library is too old to support it or the option was removed in a recent
|
||||||
version, this function will return \fICURLE_FAILED_INIT\fP.
|
version, this function will return \fICURLE_FAILED_INIT\fP.
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
.BR curl_easy_init "(3), " curl_easy_cleanup "(3), "
|
.BR curl_easy_init "(3), " curl_easy_cleanup "(3), " curl_easy_reset "(3), "
|
||||||
|
@@ -12,6 +12,8 @@ curl_easy_strerror - return string describing error code
|
|||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
The curl_easy_strerror() function returns a string describing the CURLcode
|
The curl_easy_strerror() function returns a string describing the CURLcode
|
||||||
error code passed in the argument \fIerrornum\fP.
|
error code passed in the argument \fIerrornum\fP.
|
||||||
|
|
||||||
|
This function was added in libcurl 7.12.0
|
||||||
.SH RETURN VALUE
|
.SH RETURN VALUE
|
||||||
A pointer to a zero terminated string.
|
A pointer to a zero terminated string.
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
|
@@ -26,6 +26,9 @@ NULL in the first call to this function. All list-data will be allocated by
|
|||||||
the function itself. You must call \fIcurl_formfree\fP after the form post has
|
the function itself. You must call \fIcurl_formfree\fP after the form post has
|
||||||
been done to free the resources again.
|
been done to free the resources again.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
First, there are some basics you need to understand about multipart/formdata
|
First, there are some basics you need to understand about multipart/formdata
|
||||||
posts. Each part consists of at least a NAME and a CONTENTS part. If the part
|
posts. Each part consists of at least a NAME and a CONTENTS part. If the part
|
||||||
is made for file upload, there are also a stored CONTENT-TYPE and a
|
is made for file upload, there are also a stored CONTENT-TYPE and a
|
||||||
@@ -126,8 +129,8 @@ defines.
|
|||||||
.SH EXAMPLE
|
.SH EXAMPLE
|
||||||
.nf
|
.nf
|
||||||
|
|
||||||
struct HttpPost* post = NULL;
|
struct curl_httppost* post = NULL;
|
||||||
struct HttpPost* last = NULL;
|
struct curl_httppost* last = NULL;
|
||||||
char namebuffer[] = "name buffer";
|
char namebuffer[] = "name buffer";
|
||||||
long namelength = strlen(namebuffer);
|
long namelength = strlen(namebuffer);
|
||||||
char buffer[] = "test buffer";
|
char buffer[] = "test buffer";
|
||||||
|
@@ -4,35 +4,36 @@
|
|||||||
.\"
|
.\"
|
||||||
.TH curl_getdate 3 "5 March 2001" "libcurl 7.0" "libcurl Manual"
|
.TH curl_getdate 3 "5 March 2001" "libcurl 7.0" "libcurl Manual"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
curl_getdate - Convert an date in a ASCII string to number of seconds since
|
curl_getdate - Convert an date string to number of seconds since January 1,
|
||||||
January 1, 1970
|
1970
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B #include <curl/curl.h>
|
.B #include <curl/curl.h>
|
||||||
.sp
|
.sp
|
||||||
.BI "time_t curl_getdate(char *" datestring ", time_t *"now" );
|
.BI "time_t curl_getdate(char *" datestring ", time_t *"now" );"
|
||||||
.ad
|
.ad
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
This function returns the number of seconds since January 1st 1970, for the
|
This function returns the number of seconds since January 1st 1970 in the UTC
|
||||||
date and time that the
|
time zone, for the date and time that the \fIdatestring\fP parameter
|
||||||
.I datestring
|
specifies. The \fInow\fP parameter is not used, pass a NULL there.
|
||||||
parameter specifies. The
|
|
||||||
.I now
|
\fBNOTE:\fP This function was rewritten for the 7.12.2 release and this
|
||||||
parameter is there and should hold the current time to allow the datestring to
|
documentation covers the functionality of the new one. The new one is not
|
||||||
specify relative dates/times. Read further in the date string parser section
|
feature-complete with the old one, but most of the formats supported by the
|
||||||
below.
|
new one was supported by the old too.
|
||||||
.SH PARSING DATES AND TIMES
|
.SH PARSING DATES AND TIMES
|
||||||
A "date" is a string, possibly empty, containing many items separated by
|
A "date" is a string containing several items separated by whitespace. The
|
||||||
whitespace. The whitespace may be omitted when no ambiguity arises. The
|
order of the items is immaterial. A date string may contain many flavors of
|
||||||
empty string means the beginning of today (i.e., midnight). Order of the
|
items:
|
||||||
items is immaterial. A date string may contain many flavors of items:
|
|
||||||
.TP 0.8i
|
.TP 0.8i
|
||||||
.B calendar date items
|
.B calendar date items
|
||||||
This can be specified in a number of different ways. Including 1970-09-17, 70-9-17, 70-09-17, 9/17/72, 24 September 1972, 24 Sept 72, 24 Sep 72, Sep 24, 1972, 24-sep-72, 24sep72.
|
Can be specified several ways. Month names can only be three-letter
|
||||||
The year can also be omitted, for example: 9/17 or "sep 17".
|
abbrivations, numbers can be zero-prefixed and the year may use 2 or 4 digits.
|
||||||
|
Examples: 06 Nov 1994, 06-Nov-94 and Nov-94 6.
|
||||||
.TP
|
.TP
|
||||||
.B time of the day items
|
.B time of the day items
|
||||||
This string specifies the time on a given day. Syntax supported includes:
|
This string specifies the time on a given day. You must specify it with 6
|
||||||
18:19:0, 18:19, 6:19pm, 18:19-0500 (for specifying the time zone as well).
|
digits with two colons: HH:MM:SS. To not include the time in a date string,
|
||||||
|
will make the function assume 00:00:00. Example: 18:19:21.
|
||||||
.TP
|
.TP
|
||||||
.B time zone items
|
.B time zone items
|
||||||
Specifies international time zone. There are a few acronyms supported, but in
|
Specifies international time zone. There are a few acronyms supported, but in
|
||||||
@@ -40,41 +41,52 @@ general you should instead use the specific relative time compared to
|
|||||||
UTC. Supported formats include: -1200, MST, +0100.
|
UTC. Supported formats include: -1200, MST, +0100.
|
||||||
.TP
|
.TP
|
||||||
.B day of the week items
|
.B day of the week items
|
||||||
Specifies a day of the week. If this is mentioned alone it means that day of
|
Specifies a day of the week. Days of the week may be spelled out in full:
|
||||||
the week in the future.
|
`Sunday', `Monday', etc or they may be abbreviated to their first three
|
||||||
|
letters. This is usually not info that adds anything.
|
||||||
Days of the week may be spelled out in full: `Sunday', `Monday', etc or they
|
|
||||||
may be abbreviated to their first three letters, optionally followed by a
|
|
||||||
period. The special abbreviations `Tues' for `Tuesday', `Wednes' for
|
|
||||||
`Wednesday' and `Thur' or `Thurs' for `Thursday' are also allowed.
|
|
||||||
|
|
||||||
A number may precede a day of the week item to move forward supplementary
|
|
||||||
weeks. It is best used in expression like `third monday'. In this context,
|
|
||||||
`last DAY' or `next DAY' is also acceptable; they move one week before or
|
|
||||||
after the day that DAY by itself would represent.
|
|
||||||
.TP
|
|
||||||
.B relative items
|
|
||||||
A relative item adjusts a date (or the current date if none) forward or
|
|
||||||
backward. Example syntax includes: "1 year", "1 year ago", "2 days", "4
|
|
||||||
weeks".
|
|
||||||
|
|
||||||
The string `tomorrow' is worth one day in the future (equivalent to `day'),
|
|
||||||
the string `yesterday' is worth one day in the past (equivalent to `day ago').
|
|
||||||
.TP
|
.TP
|
||||||
.B pure numbers
|
.B pure numbers
|
||||||
If the decimal number is of the form YYYYMMDD and no other calendar date item
|
If a decimal number of the form YYYYMMDD appears, then YYYY is read as the
|
||||||
appears before it in the date string, then YYYY is read as the year, MM as the
|
year, MM as the month number and DD as the day of the month, for the specified
|
||||||
month number and DD as the day of the month, for the specified calendar date.
|
calendar date.
|
||||||
.PP
|
.PP
|
||||||
|
.SH EXAMPLES
|
||||||
|
.nf
|
||||||
|
Sun, 06 Nov 1994 08:49:37 GMT
|
||||||
|
Sunday, 06-Nov-94 08:49:37 GMT
|
||||||
|
Sun Nov 6 08:49:37 1994
|
||||||
|
06 Nov 1994 08:49:37 GMT
|
||||||
|
06-Nov-94 08:49:37 GMT
|
||||||
|
Nov 6 08:49:37 1994
|
||||||
|
06 Nov 1994 08:49:37
|
||||||
|
06-Nov-94 08:49:37
|
||||||
|
1994 Nov 6 08:49:37
|
||||||
|
GMT 08:49:37 06-Nov-94 Sunday
|
||||||
|
94 6 Nov 08:49:37
|
||||||
|
1994 Nov 6
|
||||||
|
06-Nov-94
|
||||||
|
Sun Nov 6 94
|
||||||
|
1994.Nov.6
|
||||||
|
Sun/Nov/6/94/GMT
|
||||||
|
Sun, 06 Nov 1994 08:49:37 CET
|
||||||
|
06 Nov 1994 08:49:37 EST
|
||||||
|
Sun, 12 Sep 2004 15:05:58 -0700
|
||||||
|
Sat, 11 Sep 2004 21:32:11 +0200
|
||||||
|
20040912 15:05:58 -0700
|
||||||
|
20040911 +0200
|
||||||
|
.fi
|
||||||
|
.SH STANDARDS
|
||||||
|
This parser was written to handle date formats specified in RFC 822 (including
|
||||||
|
the update in RFC 1123) using time zone name or time zone delta and RFC 850
|
||||||
|
(obsoleted by RFC 1036) and ANSI C's asctime() format. These formats are the
|
||||||
|
only ones RFC2616 says HTTP applications may use.
|
||||||
.SH RETURN VALUE
|
.SH RETURN VALUE
|
||||||
This function returns zero when it fails to parse the date string. Otherwise
|
This function returns -1 when it fails to parse the date string. Otherwise it
|
||||||
it returns the number of seconds as described.
|
returns the number of seconds as described.
|
||||||
.SH AUTHORS
|
.SH REWRITE
|
||||||
Originally written by Steven M. Bellovin <smb@research.att.com> while at the
|
The former version of this function was built with yacc and was not only very
|
||||||
University of North Carolina at Chapel Hill. Later tweaked by a couple of
|
large, it was also never quite understood and it wasn't possible to build with
|
||||||
people on Usenet. Completely overhauled by Rich $alz <rsalz@bbn.com> and Jim
|
non-GNU tools since only Bison could make it thread-safe!
|
||||||
Berets <jberets@bbn.com> in August, 1990.
|
|
||||||
|
|
||||||
It has been modified extensively since imported to curl.
|
The rewrite was done for 7.12.2. The new one is much smaller and use simpler
|
||||||
.SH "SEE ALSO"
|
code.
|
||||||
.BR GNU date(1)
|
|
||||||
|
@@ -16,6 +16,13 @@ function does not require that there actually is any data available for
|
|||||||
reading or that data can be written, it can be called just in case. It will
|
reading or that data can be written, it can be called just in case. It will
|
||||||
write the number of handles that still transfer data in the second argument's
|
write the number of handles that still transfer data in the second argument's
|
||||||
integer-pointer.
|
integer-pointer.
|
||||||
|
|
||||||
|
When you call curl_multi_perform() and the amount of \fIrunning_handles\fP is
|
||||||
|
changed from the previous call (or is less than the amount of easy handles
|
||||||
|
you've added to the multi handle), you know that there is one or more
|
||||||
|
transfers less "running". You can then call \fIcurl_multi_info_read(3)\fP to
|
||||||
|
get information about each individual completed transfer, and that returned
|
||||||
|
info includes CURLcode and more.
|
||||||
.SH "RETURN VALUE"
|
.SH "RETURN VALUE"
|
||||||
CURLMcode type, general libcurl multi interface error code.
|
CURLMcode type, general libcurl multi interface error code.
|
||||||
|
|
||||||
@@ -34,4 +41,5 @@ file descriptors, then it'll wait for action on them using select() and as
|
|||||||
soon as one or more of them are ready, \fIcurl_multi_perform(3)\fP gets
|
soon as one or more of them are ready, \fIcurl_multi_perform(3)\fP gets
|
||||||
called.
|
called.
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
.BR curl_multi_cleanup "(3)," curl_multi_init "(3)," curl_multi_fdset "(3)"
|
.BR curl_multi_cleanup "(3), " curl_multi_init "(3), "
|
||||||
|
.BR curl_multi_fdset "(3), " curl_multi_info_read "(3)"
|
||||||
|
@@ -12,6 +12,8 @@ curl_multi_strerror - return string describing error code
|
|||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
The curl_multi_strerror() function returns a string describing the CURLMcode
|
The curl_multi_strerror() function returns a string describing the CURLMcode
|
||||||
error code passed in the argument \fIerrornum\fP.
|
error code passed in the argument \fIerrornum\fP.
|
||||||
|
|
||||||
|
This function was added in libcurl 7.12.0
|
||||||
.SH RETURN VALUE
|
.SH RETURN VALUE
|
||||||
A pointer to a zero terminated string.
|
A pointer to a zero terminated string.
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
|
@@ -6,7 +6,7 @@ curl_share_cleanup - Clean up a shared object
|
|||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B #include <curl/curl.h>
|
.B #include <curl/curl.h>
|
||||||
.sp
|
.sp
|
||||||
.BI "CURLSHcode curl_share_cleanup( );"
|
.BI "CURLSHcode curl_share_cleanup(CURLSH *" share_handle ");"
|
||||||
.ad
|
.ad
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
This function deletes a shared object. The share handle cannot be used anymore
|
This function deletes a shared object. The share handle cannot be used anymore
|
||||||
|
@@ -12,6 +12,8 @@ curl_share_strerror - return string describing error code
|
|||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
The curl_share_strerror() function returns a string describing the CURLSHcode
|
The curl_share_strerror() function returns a string describing the CURLSHcode
|
||||||
error code passed in the argument \fIerrornum\fP.
|
error code passed in the argument \fIerrornum\fP.
|
||||||
|
|
||||||
|
This function was added in libcurl 7.12.0
|
||||||
.SH RETURN VALUE
|
.SH RETURN VALUE
|
||||||
A pointer to a zero terminated string.
|
A pointer to a zero terminated string.
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
|
@@ -45,8 +45,9 @@ server is probably not an OK FTP server.
|
|||||||
We were denied access when trying to login to an FTP server or when trying to
|
We were denied access when trying to login to an FTP server or when trying to
|
||||||
change working directory to the one given in the URL.
|
change working directory to the one given in the URL.
|
||||||
.IP "CURLE_FTP_USER_PASSWORD_INCORRECT (10)"
|
.IP "CURLE_FTP_USER_PASSWORD_INCORRECT (10)"
|
||||||
The username and/or the password were incorrect when trying to login to an FTP
|
The FTP server rejected access to the server after the password was sent to
|
||||||
server.
|
it. It might be because the username and/or the password were incorrect or
|
||||||
|
just that the server is not allowing you access for the moment etc.
|
||||||
.IP "CURLE_FTP_WEIRD_PASS_REPLY (11)"
|
.IP "CURLE_FTP_WEIRD_PASS_REPLY (11)"
|
||||||
After having sent the FTP password to the server, libcurl expects a proper
|
After having sent the FTP password to the server, libcurl expects a proper
|
||||||
reply. This error code indicates that an unexpected code was returned.
|
reply. This error code indicates that an unexpected code was returned.
|
||||||
@@ -173,7 +174,7 @@ Failure with receiving network data.
|
|||||||
.IP "CURLE_SHARE_IN_USE (57)"
|
.IP "CURLE_SHARE_IN_USE (57)"
|
||||||
Share is in use
|
Share is in use
|
||||||
.IP "CURLE_SSL_CERTPROBLEM (58)"
|
.IP "CURLE_SSL_CERTPROBLEM (58)"
|
||||||
problem with the local certificate
|
problem with the local client certificate
|
||||||
.IP "CURLE_SSL_CIPHER (59)"
|
.IP "CURLE_SSL_CIPHER (59)"
|
||||||
couldn't use specified cipher
|
couldn't use specified cipher
|
||||||
.IP "CURLE_SSL_CACERT (60)"
|
.IP "CURLE_SSL_CACERT (60)"
|
||||||
|
@@ -303,6 +303,7 @@ typedef enum {
|
|||||||
|
|
||||||
#define CURL_ERROR_SIZE 256
|
#define CURL_ERROR_SIZE 256
|
||||||
|
|
||||||
|
/* parameter for the CURLOPT_FTP_SSL option */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
CURLFTPSSL_NONE, /* do not attempt to use SSL */
|
CURLFTPSSL_NONE, /* do not attempt to use SSL */
|
||||||
CURLFTPSSL_TRY, /* try using SSL, proceed anyway otherwise */
|
CURLFTPSSL_TRY, /* try using SSL, proceed anyway otherwise */
|
||||||
@@ -311,6 +312,14 @@ typedef enum {
|
|||||||
CURLFTPSSL_LAST /* not an option, never use */
|
CURLFTPSSL_LAST /* not an option, never use */
|
||||||
} curl_ftpssl;
|
} curl_ftpssl;
|
||||||
|
|
||||||
|
/* parameter for the CURLOPT_FTPSSLAUTH option */
|
||||||
|
typedef enum {
|
||||||
|
CURLFTPAUTH_DEFAULT, /* let libcurl decide */
|
||||||
|
CURLFTPAUTH_SSL, /* use "AUTH SSL" */
|
||||||
|
CURLFTPAUTH_TLS, /* use "AUTH TLS" */
|
||||||
|
CURLFTPAUTH_LAST /* not an option, never use */
|
||||||
|
} curl_ftpauth;
|
||||||
|
|
||||||
/* long may be 32 or 64 bits, but we should never depend on anything else
|
/* long may be 32 or 64 bits, but we should never depend on anything else
|
||||||
but 32 */
|
but 32 */
|
||||||
#define CURLOPTTYPE_LONG 0
|
#define CURLOPTTYPE_LONG 0
|
||||||
@@ -813,6 +822,18 @@ typedef enum {
|
|||||||
of commands with this */
|
of commands with this */
|
||||||
CINIT(SOURCE_POSTQUOTE, OBJECTPOINT, 128),
|
CINIT(SOURCE_POSTQUOTE, OBJECTPOINT, 128),
|
||||||
|
|
||||||
|
/* When FTP over SSL/TLS is selected (with CURLOPT_FTP_SSL), this option
|
||||||
|
can be used to change libcurl's default action which is to first try
|
||||||
|
"AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK
|
||||||
|
response has been received.
|
||||||
|
|
||||||
|
Available parameters are:
|
||||||
|
CURLFTPAUTH_DEFAULT - let libcurl decide
|
||||||
|
CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS
|
||||||
|
CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL
|
||||||
|
*/
|
||||||
|
CINIT(FTPSSLAUTH, LONG, 129),
|
||||||
|
|
||||||
CURLOPT_LASTENTRY /* the last unused */
|
CURLOPT_LASTENTRY /* the last unused */
|
||||||
} CURLoption;
|
} CURLoption;
|
||||||
|
|
||||||
@@ -1157,9 +1178,10 @@ typedef enum {
|
|||||||
CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22,
|
CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22,
|
||||||
CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23,
|
CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23,
|
||||||
CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24,
|
CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24,
|
||||||
|
CURLINFO_OS_ERRNO = CURLINFO_LONG + 25,
|
||||||
/* Fill in new entries below here! */
|
/* Fill in new entries below here! */
|
||||||
|
|
||||||
CURLINFO_LASTONE = 23
|
CURLINFO_LASTONE = 26
|
||||||
} CURLINFO;
|
} CURLINFO;
|
||||||
|
|
||||||
/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
|
/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
/* 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.12.1-CVS"
|
#define LIBCURL_VERSION "7.12.2-CVS"
|
||||||
|
|
||||||
/* 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
|
||||||
@@ -44,12 +44,12 @@
|
|||||||
always a greater number in a more recent release. It makes comparisons with
|
always a greater number in a more recent release. It makes comparisons with
|
||||||
greater than and less than work.
|
greater than and less than work.
|
||||||
*/
|
*/
|
||||||
#define LIBCURL_VERSION_NUM 0x070c01
|
#define LIBCURL_VERSION_NUM 0x070c02
|
||||||
|
|
||||||
/* The numeric version number is also available "in parts" by using these
|
/* The numeric version number is also available "in parts" by using these
|
||||||
defines: */
|
defines: */
|
||||||
#define LIBCURL_VERSION_MAJOR 7
|
#define LIBCURL_VERSION_MAJOR 7
|
||||||
#define LIBCURL_VERSION_MINOR 12
|
#define LIBCURL_VERSION_MINOR 12
|
||||||
#define LIBCURL_VERSION_PATCH 1
|
#define LIBCURL_VERSION_PATCH 2
|
||||||
|
|
||||||
#endif /* __CURL_CURLVER_H */
|
#endif /* __CURL_CURLVER_H */
|
||||||
|
@@ -52,7 +52,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
|
||||||
|
#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H))
|
||||||
|
/* The check above prevents the winsock2 inclusion if winsock.h already was
|
||||||
|
included, since they can't co-exist without problems */
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
|
/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
|
||||||
|
@@ -8,3 +8,4 @@ config.h
|
|||||||
stamp-*
|
stamp-*
|
||||||
ca-bundle.h
|
ca-bundle.h
|
||||||
getdate.c
|
getdate.c
|
||||||
|
curllib.dsp
|
||||||
|
@@ -24,7 +24,7 @@ AUTOMAKE_OPTIONS = foreign nostdinc
|
|||||||
|
|
||||||
DSP = curllib.dsp
|
DSP = curllib.dsp
|
||||||
|
|
||||||
EXTRA_DIST = getdate.y Makefile.b32 Makefile.m32 \
|
EXTRA_DIST = Makefile.b32 Makefile.m32 \
|
||||||
Makefile.vc6 Makefile.riscos libcurl.def $(DSP) curllib.dsw \
|
Makefile.vc6 Makefile.riscos libcurl.def $(DSP) curllib.dsw \
|
||||||
config-vms.h config-win32.h config-riscos.h config-mac.h config.h.in \
|
config-vms.h config-win32.h config-riscos.h config-mac.h config.h.in \
|
||||||
ca-bundle.crt README.encoding README.memoryleak README.ares \
|
ca-bundle.crt README.encoding README.memoryleak README.ares \
|
||||||
@@ -33,7 +33,7 @@ EXTRA_DIST = getdate.y Makefile.b32 Makefile.m32 \
|
|||||||
makefile.amiga Makefile.netware nwlib.c libcurl.imp \
|
makefile.amiga Makefile.netware nwlib.c libcurl.imp \
|
||||||
msvcproj.head msvcproj.foot
|
msvcproj.head msvcproj.foot
|
||||||
|
|
||||||
CLEANFILES = $(DSP) getdate.c
|
CLEANFILES = $(DSP)
|
||||||
|
|
||||||
lib_LTLIBRARIES = libcurl.la
|
lib_LTLIBRARIES = libcurl.la
|
||||||
|
|
||||||
@@ -93,13 +93,7 @@ libcurl_la_SOURCES = $(CSOURCES) $(HHEADERS)
|
|||||||
WIN32SOURCES = $(CSOURCES) libcurl.def
|
WIN32SOURCES = $(CSOURCES) libcurl.def
|
||||||
WIN32HEADERS = $(HHEADERS) config-win32.h
|
WIN32HEADERS = $(HHEADERS) config-win32.h
|
||||||
|
|
||||||
BUILT_SOURCES = $(srcdir)/getdate.c $(top_builddir)/lib/ca-bundle.h
|
BUILT_SOURCES = $(top_builddir)/lib/ca-bundle.h
|
||||||
|
|
||||||
# Say $(srcdir), so GNU make does not report an ambiguity with the .y.c rule.
|
|
||||||
$(srcdir)/getdate.c: getdate.y
|
|
||||||
cd $(srcdir) && \
|
|
||||||
$(YACC) $(YFLAGS) getdate.y; \
|
|
||||||
mv -f y.tab.c getdate.c
|
|
||||||
|
|
||||||
$(top_builddir)/lib/ca-bundle.h: Makefile.in Makefile
|
$(top_builddir)/lib/ca-bundle.h: Makefile.in Makefile
|
||||||
@if test -f $@; then \
|
@if test -f $@; then \
|
||||||
|
@@ -70,7 +70,6 @@ all: $(LIBCURLLIB)
|
|||||||
clean:
|
clean:
|
||||||
-$(RM) $(LIBCURLLIB)
|
-$(RM) $(LIBCURLLIB)
|
||||||
-$(RM) *.obj
|
-$(RM) *.obj
|
||||||
-$(RM) getdate.c
|
|
||||||
|
|
||||||
$(LIBCURLLIB): $(OBJECTS)
|
$(LIBCURLLIB): $(OBJECTS)
|
||||||
@-$(RM) $@
|
@-$(RM) $@
|
||||||
@@ -83,9 +82,4 @@ $(LIBCURLDLL): $(OBJECTS) $(LINKLIB)
|
|||||||
@-$(RM) $@
|
@-$(RM) $@
|
||||||
$(LD) $(LDFLAGS) -e$@ $**
|
$(LD) $(LDFLAGS) -e$@ $**
|
||||||
|
|
||||||
getdate.c: getdate.c.cvs
|
|
||||||
@echo Creating $@
|
|
||||||
@-$(RM) getdate.y
|
|
||||||
@$(CP) $** $@
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -2,21 +2,18 @@
|
|||||||
|
|
||||||
CSOURCES = file.c timeval.c base64.c hostip.c progress.c formdata.c \
|
CSOURCES = file.c timeval.c base64.c hostip.c progress.c formdata.c \
|
||||||
cookie.c http.c sendf.c ftp.c url.c dict.c if2ip.c speedcheck.c \
|
cookie.c http.c sendf.c ftp.c url.c dict.c if2ip.c speedcheck.c \
|
||||||
getdate.c ldap.c ssluse.c version.c getenv.c escape.c mprintf.c \
|
ldap.c ssluse.c version.c getenv.c escape.c mprintf.c telnet.c \
|
||||||
telnet.c netrc.c getinfo.c transfer.c strequal.c easy.c security.c \
|
netrc.c getinfo.c transfer.c strequal.c easy.c security.c krb4.c \
|
||||||
krb4.c memdebug.c http_chunks.c strtok.c connect.c llist.c hash.c \
|
memdebug.c http_chunks.c strtok.c connect.c llist.c hash.c multi.c \
|
||||||
multi.c content_encoding.c share.c http_digest.c md5.c \
|
content_encoding.c share.c http_digest.c md5.c http_negotiate.c \
|
||||||
http_negotiate.c http_ntlm.c inet_pton.c strtoofft.c strerror.c \
|
http_ntlm.c inet_pton.c strtoofft.c strerror.c hostares.c hostasyn.c \
|
||||||
hostares.c hostasyn.c hostip4.c hostip6.c hostsyn.c hostthre.c \
|
hostip4.c hostip6.c hostsyn.c hostthre.c inet_ntop.c parsedate.c
|
||||||
inet_ntop.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 \
|
||||||
if2ip.h speedcheck.h urldata.h getdate.h ldap.h ssluse.h escape.h \
|
if2ip.h speedcheck.h urldata.h ldap.h ssluse.h escape.h telnet.h \
|
||||||
telnet.h getinfo.h strequal.h security.h krb4.h memdebug.h \
|
getinfo.h strequal.h security.h krb4.h memdebug.h inet_ntoa_r.h \
|
||||||
inet_ntoa_r.h http_chunks.h strtok.h connect.h llist.h hash.h \
|
http_chunks.h strtok.h connect.h llist.h hash.h content_encoding.h \
|
||||||
content_encoding.h share.h md5.h http_digest.h http_negotiate.h \
|
share.h md5.h http_digest.h http_negotiate.h http_ntlm.h ca-bundle.h \
|
||||||
http_ntlm.h ca-bundle.h inet_pton.h strtoofft.h strerror.h \
|
inet_pton.h strtoofft.h strerror.h inet_ntop.h curlx.h memory.h \
|
||||||
inet_ntop.h curlx.h memory.h setup.h transfer.h
|
setup.h transfer.h
|
||||||
|
|
||||||
|
|
||||||
|
@@ -93,7 +93,7 @@ LD = nlmconv
|
|||||||
LDFLAGS = -T
|
LDFLAGS = -T
|
||||||
AR = ar
|
AR = ar
|
||||||
ARFLAGS = -cq
|
ARFLAGS = -cq
|
||||||
CFLAGS += -fno-builtin -fpack-struct -fpcc-struct-return
|
CFLAGS += -fno-builtin -fpack-struct -fpcc-struct-return -fno-strict-aliasing
|
||||||
CFLAGS += -Wall # -pedantic
|
CFLAGS += -Wall # -pedantic
|
||||||
ifeq ($(LIBARCH),LIBC)
|
ifeq ($(LIBARCH),LIBC)
|
||||||
PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
|
PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
|
||||||
@@ -168,7 +168,7 @@ nlm: prebuild $(TARGET).nlm
|
|||||||
|
|
||||||
lib: prebuild $(TARGET).lib
|
lib: prebuild $(TARGET).lib
|
||||||
|
|
||||||
prebuild: $(OBJDIR) $(OBJDIR)/version.inc config.h ca-bundle.h getdate.c
|
prebuild: $(OBJDIR) $(OBJDIR)/version.inc config.h ca-bundle.h
|
||||||
|
|
||||||
$(OBJDIR)/%.o: %.c
|
$(OBJDIR)/%.o: %.c
|
||||||
# @echo Compiling $<
|
# @echo Compiling $<
|
||||||
@@ -191,7 +191,7 @@ install: $(INSTDIR) all
|
|||||||
@$(CP) ../RELEASE-NOTES $(INSTDIR)
|
@$(CP) ../RELEASE-NOTES $(INSTDIR)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-$(RM) config.h ca-bundle.h y.tab.c getdate.c
|
-$(RM) config.h ca-bundle.h
|
||||||
-$(RM) -r $(OBJDIR)
|
-$(RM) -r $(OBJDIR)
|
||||||
|
|
||||||
$(INSTDIR):
|
$(INSTDIR):
|
||||||
@@ -375,11 +375,6 @@ ca-bundle.h: Makefile.netware
|
|||||||
@echo $(DL)*/$(DL) >> $@
|
@echo $(DL)*/$(DL) >> $@
|
||||||
@echo $(DL)#define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE")$(DL) >> $@
|
@echo $(DL)#define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE")$(DL) >> $@
|
||||||
|
|
||||||
getdate.c:
|
|
||||||
@echo Creating $@
|
|
||||||
@-$(RM) getdate.y
|
|
||||||
@$(CP) getdate.c.cvs $@
|
|
||||||
|
|
||||||
url.c: ca-bundle.h
|
url.c: ca-bundle.h
|
||||||
|
|
||||||
$(LIBCARES):
|
$(LIBCARES):
|
||||||
|
@@ -86,7 +86,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) /out:$(TARGET) /IMPLIB:"$(LIB_NAME).lib"
|
LNK = $(LNKDLL) $(WINLIBS) /out:$(TARGET) /IMPLIB:"$(LIB_NAME).lib"
|
||||||
CC = $(CCNODBG)
|
CC = $(CCNODBG)
|
||||||
CFGSET = TRUE
|
CFGSET = TRUE
|
||||||
RESOURCE = $(DIROBJ)\libcurl.res
|
RESOURCE = $(DIROBJ)\libcurl.res
|
||||||
@@ -111,7 +111,7 @@ CFGSET = TRUE
|
|||||||
TARGET =$(LIB_NAME).dll
|
TARGET =$(LIB_NAME).dll
|
||||||
DIROBJ =.\$(CFG)
|
DIROBJ =.\$(CFG)
|
||||||
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)/out32dll"
|
LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)/out32dll"
|
||||||
LNK = $(LNKDLL) $(SSLLIBS) $(WINLIBS) $(LFLAGSSSL) /out:$(TARGET) /IMPLIB:"$(LIB_NAME).lib"
|
LNK = $(LNKDLL) $(WINLIBS) $(SSLLIBS) $(WINLIBS) $(LFLAGSSSL) /out:$(TARGET) /IMPLIB:"$(LIB_NAME).lib"
|
||||||
CC = $(CCNODBG) $(CFLAGSSSL)
|
CC = $(CCNODBG) $(CFLAGSSSL)
|
||||||
CFGSET = TRUE
|
CFGSET = TRUE
|
||||||
RESOURCE = $(DIROBJ)\libcurl.res
|
RESOURCE = $(DIROBJ)\libcurl.res
|
||||||
@@ -159,7 +159,7 @@ CFGSET = TRUE
|
|||||||
!IF "$(CFG)" == "debug-dll"
|
!IF "$(CFG)" == "debug-dll"
|
||||||
TARGET =$(LIB_NAME_DEBUG).dll
|
TARGET =$(LIB_NAME_DEBUG).dll
|
||||||
DIROBJ =.\$(CFG)
|
DIROBJ =.\$(CFG)
|
||||||
LNK = $(LNKDLL) /DEBUG /out:$(TARGET) /IMPLIB:"$(LIB_NAME_DEBUG).lib" /PDB:"$(LIB_NAME_DEBUG).pdb"
|
LNK = $(LNKDLL) $(WINLIBS) /DEBUG /out:$(TARGET) /IMPLIB:"$(LIB_NAME_DEBUG).lib" /PDB:"$(LIB_NAME_DEBUG).pdb"
|
||||||
CC = $(CCDEBUG)
|
CC = $(CCDEBUG)
|
||||||
CFGSET = TRUE
|
CFGSET = TRUE
|
||||||
RESOURCE = $(DIROBJ)\libcurl.res
|
RESOURCE = $(DIROBJ)\libcurl.res
|
||||||
@@ -194,7 +194,7 @@ CFGSET = TRUE
|
|||||||
TARGET =$(LIB_NAME_DEBUG).dll
|
TARGET =$(LIB_NAME_DEBUG).dll
|
||||||
DIROBJ =.\$(CFG)
|
DIROBJ =.\$(CFG)
|
||||||
LFLAGSSSL = /LIBPATH:$(OPENSSL_PATH)/out32dll
|
LFLAGSSSL = /LIBPATH:$(OPENSSL_PATH)/out32dll
|
||||||
LNK = $(LNKDLL) $(LFLAGSSSL) /DEBUG /out:$(TARGET) /IMPLIB:"$(LIB_NAME_DEBUG).lib" /PDB:"$(LIB_NAME_DEBUG).pdb"
|
LNK = $(LNKDLL) $(WINLIBS) $(LFLAGSSSL) /DEBUG /out:$(TARGET) /IMPLIB:"$(LIB_NAME_DEBUG).lib" /PDB:"$(LIB_NAME_DEBUG).pdb"
|
||||||
CC = $(CCDEBUG) $(CFLAGSSSL)
|
CC = $(CCDEBUG) $(CFLAGSSSL)
|
||||||
CFGSET = TRUE
|
CFGSET = TRUE
|
||||||
RESOURCE = $(DIROBJ)\libcurl.res
|
RESOURCE = $(DIROBJ)\libcurl.res
|
||||||
@@ -236,7 +236,7 @@ X_OBJS= \
|
|||||||
$(DIROBJ)\ldap.obj \
|
$(DIROBJ)\ldap.obj \
|
||||||
$(DIROBJ)\dict.obj \
|
$(DIROBJ)\dict.obj \
|
||||||
$(DIROBJ)\telnet.obj \
|
$(DIROBJ)\telnet.obj \
|
||||||
$(DIROBJ)\getdate.obj \
|
$(DIROBJ)\parsedate.obj \
|
||||||
$(DIROBJ)\getenv.obj \
|
$(DIROBJ)\getenv.obj \
|
||||||
$(DIROBJ)\inet_pton.obj \
|
$(DIROBJ)\inet_pton.obj \
|
||||||
$(DIROBJ)\hostip.obj \
|
$(DIROBJ)\hostip.obj \
|
||||||
|
@@ -1,5 +1,3 @@
|
|||||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
|
||||||
|
|
||||||
/* Define if on AIX 3.
|
/* Define if on AIX 3.
|
||||||
System headers sometimes define this.
|
System headers sometimes define this.
|
||||||
We just want to avoid a redefinition error message. */
|
We just want to avoid a redefinition error message. */
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
#define HAVE_ALARM 1
|
#define HAVE_ALARM 1
|
||||||
#define HAVE_ASSERT_T 1
|
#define HAVE_ASSERT_T 1
|
||||||
#define HAVE_ARPA_INET_H 1
|
#define HAVE_ARPA_INET_H 1
|
||||||
|
#define HAVE_BASENAME 1
|
||||||
#define HAVE_CLOSESOCKET 1
|
#define HAVE_CLOSESOCKET 1
|
||||||
#define HAVE_FCNTL_H 1
|
#define HAVE_FCNTL_H 1
|
||||||
#define HAVE_GETHOSTBYADDR 1
|
#define HAVE_GETHOSTBYADDR 1
|
||||||
|
@@ -355,7 +355,8 @@ static CURLcode bindlocal(struct connectdata *conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!bindworked) {
|
if(!bindworked) {
|
||||||
failf(data, "%s", Curl_strerror(conn, Curl_ourerrno()));
|
data->state.os_errno = Curl_ourerrno();
|
||||||
|
failf(data, "%s", Curl_strerror(conn, data->state.os_errno));
|
||||||
return CURLE_HTTP_PORT_FAILED;
|
return CURLE_HTTP_PORT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -508,12 +509,14 @@ CURLcode Curl_is_connected(struct connectdata *conn,
|
|||||||
rc = waitconnect(sockfd, 0);
|
rc = waitconnect(sockfd, 0);
|
||||||
|
|
||||||
if(WAITCONN_CONNECTED == rc) {
|
if(WAITCONN_CONNECTED == rc) {
|
||||||
if (verifyconnect(sockfd, NULL)) {
|
int error;
|
||||||
|
if (verifyconnect(sockfd, &error)) {
|
||||||
/* we are connected, awesome! */
|
/* we are connected, awesome! */
|
||||||
*connected = TRUE;
|
*connected = TRUE;
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
/* nope, not connected for real */
|
/* nope, not connected for real */
|
||||||
|
data->state.os_errno = error;
|
||||||
infof(data, "Connection failed\n");
|
infof(data, "Connection failed\n");
|
||||||
if(trynextip(conn, sockindex, connected)) {
|
if(trynextip(conn, sockindex, connected)) {
|
||||||
code = CURLE_COULDNT_CONNECT;
|
code = CURLE_COULDNT_CONNECT;
|
||||||
@@ -555,6 +558,23 @@ static void tcpnodelay(struct connectdata *conn,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef SO_NOSIGPIPE
|
||||||
|
/* The preferred method on Mac OS X (10.2 and later) to prevent SIGPIPEs when
|
||||||
|
sending data to a dead peer (instead of relying on the 4th argument to send
|
||||||
|
being MSG_NOSIGNAL). Possibly also existing and in use on other BSD
|
||||||
|
systems? */
|
||||||
|
static void nosigpipe(struct connectdata *conn,
|
||||||
|
curl_socket_t sockfd)
|
||||||
|
{
|
||||||
|
struct SessionHandle *data= conn->data;
|
||||||
|
int onoff = 1;
|
||||||
|
if(setsockopt(sockfd, SOL_SOCKET, SO_NOSIGPIPE, (void *)&onoff,
|
||||||
|
sizeof(onoff)) < 0)
|
||||||
|
infof(data, "Could not set SO_NOSIGPIPE: %s\n",
|
||||||
|
Curl_strerror(conn, Curl_ourerrno()));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* singleipconnect() connects to the given IP only, and it may return without
|
/* singleipconnect() connects to the given IP only, and it may return without
|
||||||
having connected if used from the multi interface. */
|
having connected if used from the multi interface. */
|
||||||
static curl_socket_t
|
static curl_socket_t
|
||||||
@@ -581,6 +601,9 @@ singleipconnect(struct connectdata *conn,
|
|||||||
if(data->set.tcp_nodelay)
|
if(data->set.tcp_nodelay)
|
||||||
tcpnodelay(conn, sockfd);
|
tcpnodelay(conn, sockfd);
|
||||||
|
|
||||||
|
#ifdef SO_NOSIGPIPE
|
||||||
|
nosigpipe(conn, sockfd);
|
||||||
|
#endif
|
||||||
if(conn->data->set.device) {
|
if(conn->data->set.device) {
|
||||||
/* user selected to bind the outgoing socket to a specified "device"
|
/* user selected to bind the outgoing socket to a specified "device"
|
||||||
before doing connect */
|
before doing connect */
|
||||||
@@ -635,8 +658,10 @@ singleipconnect(struct connectdata *conn,
|
|||||||
}
|
}
|
||||||
else if(WAITCONN_TIMEOUT == rc)
|
else if(WAITCONN_TIMEOUT == rc)
|
||||||
infof(data, "Timeout\n");
|
infof(data, "Timeout\n");
|
||||||
else
|
else {
|
||||||
|
data->state.os_errno = error;
|
||||||
infof(data, "%s\n", Curl_strerror(conn, error));
|
infof(data, "%s\n", Curl_strerror(conn, error));
|
||||||
|
}
|
||||||
|
|
||||||
/* connect failed or timed out */
|
/* connect failed or timed out */
|
||||||
sclose(sockfd);
|
sclose(sockfd);
|
||||||
@@ -745,6 +770,7 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
|||||||
if (sockfd == CURL_SOCKET_BAD) {
|
if (sockfd == CURL_SOCKET_BAD) {
|
||||||
/* no good connect was made */
|
/* no good connect was made */
|
||||||
*sockconn = CURL_SOCKET_BAD;
|
*sockconn = CURL_SOCKET_BAD;
|
||||||
|
failf(data, "couldn't connect to host");
|
||||||
return CURLE_COULDNT_CONNECT;
|
return CURLE_COULDNT_CONNECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
16
lib/cookie.c
16
lib/cookie.c
@@ -84,11 +84,9 @@ Example set of cookies:
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
|
||||||
|
|
||||||
#include "urldata.h"
|
#include "urldata.h"
|
||||||
#include "cookie.h"
|
#include "cookie.h"
|
||||||
#include "getdate.h"
|
|
||||||
#include "strequal.h"
|
#include "strequal.h"
|
||||||
#include "strtok.h"
|
#include "strtok.h"
|
||||||
#include "sendf.h"
|
#include "sendf.h"
|
||||||
@@ -99,6 +97,8 @@ Example set of cookies:
|
|||||||
#include "memdebug.h"
|
#include "memdebug.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define my_isspace(x) ((x == ' ') || (x == '\t'))
|
||||||
|
|
||||||
static void freecookie(struct Cookie *co)
|
static void freecookie(struct Cookie *co)
|
||||||
{
|
{
|
||||||
if(co->expirestr)
|
if(co->expirestr)
|
||||||
@@ -111,6 +111,8 @@ static void freecookie(struct Cookie *co)
|
|||||||
free(co->name);
|
free(co->name);
|
||||||
if(co->value)
|
if(co->value)
|
||||||
free(co->value);
|
free(co->value);
|
||||||
|
if(co->maxage)
|
||||||
|
free(co->maxage);
|
||||||
|
|
||||||
free(co);
|
free(co);
|
||||||
}
|
}
|
||||||
@@ -176,7 +178,7 @@ Curl_cookie_add(struct SessionHandle *data,
|
|||||||
|
|
||||||
semiptr=strchr(lineptr, ';'); /* first, find a semicolon */
|
semiptr=strchr(lineptr, ';'); /* first, find a semicolon */
|
||||||
|
|
||||||
while(*lineptr && isspace((int)*lineptr))
|
while(*lineptr && my_isspace(*lineptr))
|
||||||
lineptr++;
|
lineptr++;
|
||||||
|
|
||||||
ptr = lineptr;
|
ptr = lineptr;
|
||||||
@@ -199,14 +201,14 @@ Curl_cookie_add(struct SessionHandle *data,
|
|||||||
|
|
||||||
/* Strip off trailing whitespace from the 'what' */
|
/* Strip off trailing whitespace from the 'what' */
|
||||||
size_t len=strlen(what);
|
size_t len=strlen(what);
|
||||||
while(len && isspace((int)what[len-1])) {
|
while(len && my_isspace(what[len-1])) {
|
||||||
what[len-1]=0;
|
what[len-1]=0;
|
||||||
len--;
|
len--;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Skip leading whitespace from the 'what' */
|
/* Skip leading whitespace from the 'what' */
|
||||||
whatptr=what;
|
whatptr=what;
|
||||||
while(isspace((int)*whatptr)) {
|
while(my_isspace(*whatptr)) {
|
||||||
whatptr++;
|
whatptr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -348,7 +350,7 @@ Curl_cookie_add(struct SessionHandle *data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ptr=semiptr+1;
|
ptr=semiptr+1;
|
||||||
while(ptr && *ptr && isspace((int)*ptr))
|
while(ptr && *ptr && my_isspace(*ptr))
|
||||||
ptr++;
|
ptr++;
|
||||||
semiptr=strchr(ptr, ';'); /* now, find the next semicolon */
|
semiptr=strchr(ptr, ';'); /* now, find the next semicolon */
|
||||||
|
|
||||||
@@ -668,7 +670,7 @@ struct CookieInfo *Curl_cookie_init(struct SessionHandle *data,
|
|||||||
lineptr=line;
|
lineptr=line;
|
||||||
headerline=FALSE;
|
headerline=FALSE;
|
||||||
}
|
}
|
||||||
while(*lineptr && isspace((int)*lineptr))
|
while(*lineptr && my_isspace(*lineptr))
|
||||||
lineptr++;
|
lineptr++;
|
||||||
|
|
||||||
Curl_cookie_add(data, c, headerline, lineptr, NULL, NULL);
|
Curl_cookie_add(data, c, headerline, lineptr, NULL, NULL);
|
||||||
|
@@ -77,6 +77,7 @@
|
|||||||
#include "hostip.h"
|
#include "hostip.h"
|
||||||
#include "share.h"
|
#include "share.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "progress.h"
|
||||||
|
|
||||||
#define _MPRINTF_REPLACE /* use our functions only */
|
#define _MPRINTF_REPLACE /* use our functions only */
|
||||||
#include <curl/mprintf.h>
|
#include <curl/mprintf.h>
|
||||||
@@ -390,11 +391,6 @@ void curl_easy_cleanup(CURL *curl)
|
|||||||
if(!data)
|
if(!data)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( ! (data->share && data->share->hostcache) ) {
|
|
||||||
if ( !Curl_global_host_cache_use(data)) {
|
|
||||||
Curl_hash_destroy(data->hostcache);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Curl_close(data);
|
Curl_close(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -561,6 +557,7 @@ void curl_easy_reset(CURL *curl)
|
|||||||
|
|
||||||
/* make libcurl quiet by default: */
|
/* make libcurl quiet by default: */
|
||||||
data->set.hide_progress = TRUE; /* CURLOPT_NOPROGRESS changes these */
|
data->set.hide_progress = TRUE; /* CURLOPT_NOPROGRESS changes these */
|
||||||
|
data->progress.flags |= PGRS_HIDE;
|
||||||
|
|
||||||
/* Set the default size of the SSL session ID cache */
|
/* Set the default size of the SSL session ID cache */
|
||||||
data->set.ssl.numsessions = 5;
|
data->set.ssl.numsessions = 5;
|
||||||
|
@@ -177,6 +177,9 @@ CURLcode Curl_file_done(struct connectdata *conn,
|
|||||||
(void)status; /* not used */
|
(void)status; /* not used */
|
||||||
Curl_safefree(file->freepath);
|
Curl_safefree(file->freepath);
|
||||||
|
|
||||||
|
if(file->fd != -1)
|
||||||
|
close(file->fd);
|
||||||
|
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,7 +230,7 @@ static CURLcode file_upload(struct connectdata *conn)
|
|||||||
int readcount;
|
int readcount;
|
||||||
res = Curl_fillreadbuffer(conn, BUFSIZE, &readcount);
|
res = Curl_fillreadbuffer(conn, BUFSIZE, &readcount);
|
||||||
if(res)
|
if(res)
|
||||||
return res;
|
break;
|
||||||
|
|
||||||
nread = (size_t)readcount;
|
nread = (size_t)readcount;
|
||||||
|
|
||||||
@@ -383,8 +386,7 @@ CURLcode Curl_file(struct connectdata *conn)
|
|||||||
if(Curl_pgrsUpdate(conn))
|
if(Curl_pgrsUpdate(conn))
|
||||||
res = CURLE_ABORTED_BY_CALLBACK;
|
res = CURLE_ABORTED_BY_CALLBACK;
|
||||||
|
|
||||||
close(fd);
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -113,6 +113,9 @@ Content-Disposition: form-data; name="FILECONTENT"
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#if defined(HAVE_LIBGEN_H) && defined(HAVE_BASENAME)
|
||||||
|
#include <libgen.h>
|
||||||
|
#endif
|
||||||
#include "formdata.h"
|
#include "formdata.h"
|
||||||
#include "strequal.h"
|
#include "strequal.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
@@ -123,6 +126,11 @@ Content-Disposition: form-data; name="FILECONTENT"
|
|||||||
/* The last #include file should be: */
|
/* The last #include file should be: */
|
||||||
#include "memdebug.h"
|
#include "memdebug.h"
|
||||||
|
|
||||||
|
#if defined(HAVE_BASENAME) && defined(NEED_BASENAME_PROTO)
|
||||||
|
/* This system has a basename() but no prototype for it! */
|
||||||
|
char *basename(char *path);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* What kind of Content-Type to use on un-specified files with unrecognized
|
/* What kind of Content-Type to use on un-specified files with unrecognized
|
||||||
extensions. */
|
extensions. */
|
||||||
#define HTTPPOST_CONTENTTYPE_DEFAULT "application/octet-stream"
|
#define HTTPPOST_CONTENTTYPE_DEFAULT "application/octet-stream"
|
||||||
@@ -903,6 +911,68 @@ void curl_formfree(struct curl_httppost *form)
|
|||||||
} while((form=next)); /* continue */
|
} while((form=next)); /* continue */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef HAVE_BASENAME
|
||||||
|
/*
|
||||||
|
(Quote from The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004
|
||||||
|
Edition)
|
||||||
|
|
||||||
|
The basename() function shall take the pathname pointed to by path and
|
||||||
|
return a pointer to the final component of the pathname, deleting any
|
||||||
|
trailing '/' characters.
|
||||||
|
|
||||||
|
If the string pointed to by path consists entirely of the '/' character,
|
||||||
|
basename() shall return a pointer to the string "/". If the string pointed
|
||||||
|
to by path is exactly "//", it is implementation-defined whether '/' or "//"
|
||||||
|
is returned.
|
||||||
|
|
||||||
|
If path is a null pointer or points to an empty string, basename() shall
|
||||||
|
return a pointer to the string ".".
|
||||||
|
|
||||||
|
The basename() function may modify the string pointed to by path, and may
|
||||||
|
return a pointer to static storage that may then be overwritten by a
|
||||||
|
subsequent call to basename().
|
||||||
|
|
||||||
|
The basename() function need not be reentrant. A function that is not
|
||||||
|
required to be reentrant is not required to be thread-safe.
|
||||||
|
|
||||||
|
*/
|
||||||
|
static char *basename(char *path)
|
||||||
|
{
|
||||||
|
/* Ignore all the details above for now and make a quick and simple
|
||||||
|
implementaion here */
|
||||||
|
char *s1;
|
||||||
|
char *s2;
|
||||||
|
|
||||||
|
s1=strrchr(path, '/');
|
||||||
|
s2=strrchr(path, '\\');
|
||||||
|
|
||||||
|
if(s1 && s2) {
|
||||||
|
path = (s1 > s2? s1 : s2)+1;
|
||||||
|
}
|
||||||
|
else if(s1)
|
||||||
|
path = s1 + 1;
|
||||||
|
else if(s2)
|
||||||
|
path = s2 + 1;
|
||||||
|
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static char *strippath(char *fullfile)
|
||||||
|
{
|
||||||
|
char *filename;
|
||||||
|
char *base;
|
||||||
|
filename = strdup(fullfile); /* duplicate since basename() may ruin the
|
||||||
|
buffer it works on */
|
||||||
|
if(!filename)
|
||||||
|
return NULL;
|
||||||
|
base = strdup(basename(filename));
|
||||||
|
|
||||||
|
free(filename); /* free temporary buffer */
|
||||||
|
|
||||||
|
return base; /* returns an allocated string! */
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Curl_getFormData() converts a linked list of "meta data" into a complete
|
* Curl_getFormData() converts a linked list of "meta data" into a complete
|
||||||
* (possibly huge) multipart formdata. The input list is in 'post', while the
|
* (possibly huge) multipart formdata. The input list is in 'post', while the
|
||||||
@@ -998,22 +1068,33 @@ CURLcode Curl_getFormData(struct FormData **finalform,
|
|||||||
|
|
||||||
if(post->more) {
|
if(post->more) {
|
||||||
/* if multiple-file */
|
/* if multiple-file */
|
||||||
|
char *filebasename=
|
||||||
|
(!file->showfilename)?strippath(file->contents):NULL;
|
||||||
|
|
||||||
result = AddFormDataf(&form, &size,
|
result = AddFormDataf(&form, &size,
|
||||||
"\r\n--%s\r\nContent-Disposition: "
|
"\r\n--%s\r\nContent-Disposition: "
|
||||||
"attachment; filename=\"%s\"",
|
"attachment; filename=\"%s\"",
|
||||||
fileboundary,
|
fileboundary,
|
||||||
(file->showfilename?file->showfilename:
|
(file->showfilename?file->showfilename:
|
||||||
file->contents));
|
filebasename));
|
||||||
|
if (filebasename)
|
||||||
|
free(filebasename);
|
||||||
if (result)
|
if (result)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if((post->flags & HTTPPOST_FILENAME) ||
|
else if((post->flags & HTTPPOST_FILENAME) ||
|
||||||
(post->flags & HTTPPOST_BUFFER)) {
|
(post->flags & HTTPPOST_BUFFER)) {
|
||||||
|
|
||||||
|
char *filebasename=
|
||||||
|
(!post->showfilename)?strippath(post->contents):NULL;
|
||||||
|
|
||||||
result = AddFormDataf(&form, &size,
|
result = AddFormDataf(&form, &size,
|
||||||
"; filename=\"%s\"",
|
"; filename=\"%s\"",
|
||||||
(post->showfilename?post->showfilename:
|
(post->showfilename?post->showfilename:
|
||||||
post->contents));
|
filebasename));
|
||||||
|
if (filebasename)
|
||||||
|
free(filebasename);
|
||||||
|
|
||||||
if (result)
|
if (result)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
151
lib/ftp.c
151
lib/ftp.c
@@ -122,6 +122,8 @@ static CURLcode ftp_cwd_and_mkd(struct connectdata *conn, char *path);
|
|||||||
static CURLcode ftp_quit(struct connectdata *conn);
|
static CURLcode ftp_quit(struct connectdata *conn);
|
||||||
static CURLcode ftp_3rdparty_pretransfer(struct connectdata *conn);
|
static CURLcode ftp_3rdparty_pretransfer(struct connectdata *conn);
|
||||||
static CURLcode ftp_3rdparty_transfer(struct connectdata *conn);
|
static CURLcode ftp_3rdparty_transfer(struct connectdata *conn);
|
||||||
|
static CURLcode ftp_parse_url_path(struct connectdata *conn);
|
||||||
|
static CURLcode ftp_cwd_and_create_path(struct connectdata *conn);
|
||||||
static CURLcode ftp_regular_transfer(struct connectdata *conn);
|
static CURLcode ftp_regular_transfer(struct connectdata *conn);
|
||||||
static CURLcode ftp_3rdparty(struct connectdata *conn);
|
static CURLcode ftp_3rdparty(struct connectdata *conn);
|
||||||
|
|
||||||
@@ -540,8 +542,27 @@ CURLcode Curl_ftp_connect(struct connectdata *conn)
|
|||||||
|
|
||||||
if(data->set.ftp_ssl && !conn->ssl[FIRSTSOCKET].use) {
|
if(data->set.ftp_ssl && !conn->ssl[FIRSTSOCKET].use) {
|
||||||
/* we don't have a SSL/TLS connection, try a FTPS connection now */
|
/* we don't have a SSL/TLS connection, try a FTPS connection now */
|
||||||
|
int start;
|
||||||
|
int trynext;
|
||||||
|
int count=0;
|
||||||
|
|
||||||
for (try = 0; ftpauth[try]; try++) {
|
switch(data->set.ftpsslauth) {
|
||||||
|
case CURLFTPAUTH_DEFAULT:
|
||||||
|
case CURLFTPAUTH_SSL:
|
||||||
|
start = 0;
|
||||||
|
trynext = 1;
|
||||||
|
break;
|
||||||
|
case CURLFTPAUTH_TLS:
|
||||||
|
start = 1;
|
||||||
|
trynext = 0;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
failf(data, "unsupported parameter to CURLOPT_FTPSSLAUTH: %d\n",
|
||||||
|
data->set.ftpsslauth);
|
||||||
|
return CURLE_FAILED_INIT; /* we don't know what to do */
|
||||||
|
}
|
||||||
|
|
||||||
|
for (try = start; ftpauth[count]; try=trynext, count++) {
|
||||||
|
|
||||||
FTPSENDF(conn, "AUTH %s", ftpauth[try]);
|
FTPSENDF(conn, "AUTH %s", ftpauth[try]);
|
||||||
|
|
||||||
@@ -592,13 +613,18 @@ CURLcode Curl_ftp_connect(struct connectdata *conn)
|
|||||||
|
|
||||||
if(ftpcode == 530) {
|
if(ftpcode == 530) {
|
||||||
/* 530 Login incorrect.
|
/* 530 Login incorrect.
|
||||||
(the username and/or the password are incorrect) */
|
(the username and/or the password are incorrect)
|
||||||
failf(data, "the username and/or the password are incorrect");
|
or
|
||||||
|
530 Sorry, the maximum number of allowed users are already connected
|
||||||
|
*/
|
||||||
|
failf(data, "not logged in: %s", &buf[4]);
|
||||||
return CURLE_FTP_USER_PASSWORD_INCORRECT;
|
return CURLE_FTP_USER_PASSWORD_INCORRECT;
|
||||||
}
|
}
|
||||||
else if(ftpcode == 230) {
|
else if(ftpcode/100 == 2) {
|
||||||
/* 230 User ... logged in.
|
/* 230 User ... logged in.
|
||||||
(user successfully logged in) */
|
(user successfully logged in)
|
||||||
|
|
||||||
|
Apparently, proftpd with SSL returns 232 here at times. */
|
||||||
|
|
||||||
infof(data, "We have successfully logged in\n");
|
infof(data, "We have successfully logged in\n");
|
||||||
}
|
}
|
||||||
@@ -932,6 +958,7 @@ CURLcode ftp_getfiletime(struct connectdata *conn, char *file)
|
|||||||
&year, &month, &day, &hour, &minute, &second)) {
|
&year, &month, &day, &hour, &minute, &second)) {
|
||||||
/* we have a time, reformat it */
|
/* we have a time, reformat it */
|
||||||
time_t secs=time(NULL);
|
time_t secs=time(NULL);
|
||||||
|
/* using the good old yacc/bison yuck */
|
||||||
snprintf(buf, sizeof(conn->data->state.buffer),
|
snprintf(buf, sizeof(conn->data->state.buffer),
|
||||||
"%04d%02d%02d %02d:%02d:%02d GMT",
|
"%04d%02d%02d %02d:%02d:%02d GMT",
|
||||||
year, month, day, hour, minute, second);
|
year, month, day, hour, minute, second);
|
||||||
@@ -2084,23 +2111,9 @@ CURLcode ftp_perform(struct connectdata *conn,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is a re-used connection. Since we change directory to where the
|
result = ftp_cwd_and_create_path(conn);
|
||||||
transfer is taking place, we must now get back to the original dir
|
if (result)
|
||||||
where we ended up after login: */
|
|
||||||
if (conn->bits.reuse && ftp->entrypath) {
|
|
||||||
if ((result = ftp_cwd_and_mkd(conn, ftp->entrypath)) != CURLE_OK)
|
|
||||||
return result;
|
return result;
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
int i; /* counter for loop */
|
|
||||||
for (i=0; i < ftp->dirdepth; i++) {
|
|
||||||
/* RFC 1738 says empty components should be respected too, but
|
|
||||||
that is plain stupid since CWD can't be used with an empty argument */
|
|
||||||
if ((result = ftp_cwd_and_mkd(conn, ftp->dirs[i])) != CURLE_OK)
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Requested time of file or time-depended transfer? */
|
/* Requested time of file or time-depended transfer? */
|
||||||
if((data->set.get_filetime || data->set.timecondition) &&
|
if((data->set.get_filetime || data->set.timecondition) &&
|
||||||
@@ -2243,6 +2256,10 @@ CURLcode Curl_ftp(struct connectdata *conn)
|
|||||||
{
|
{
|
||||||
CURLcode retcode = CURLE_OK;
|
CURLcode retcode = CURLE_OK;
|
||||||
|
|
||||||
|
retcode = ftp_parse_url_path(conn);
|
||||||
|
if (retcode)
|
||||||
|
return retcode;
|
||||||
|
|
||||||
if (conn->sec_conn) /* 3rd party transfer */
|
if (conn->sec_conn) /* 3rd party transfer */
|
||||||
retcode = ftp_3rdparty(conn);
|
retcode = ftp_3rdparty(conn);
|
||||||
else
|
else
|
||||||
@@ -2449,7 +2466,7 @@ static CURLcode ftp_cwd_and_mkd(struct connectdata *conn, char *path)
|
|||||||
result = ftp_cwd(conn, path);
|
result = ftp_cwd(conn, path);
|
||||||
}
|
}
|
||||||
if(result)
|
if(result)
|
||||||
failf(conn->data, "Couldn't cd to %s", path);
|
failf(conn->data, "Couldn't CWD to %s", path);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -2521,6 +2538,10 @@ static CURLcode ftp_3rdparty_transfer(struct connectdata *conn)
|
|||||||
port_conn = conn;
|
port_conn = conn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
result = ftp_cwd_and_create_path(conn);
|
||||||
|
if (result)
|
||||||
|
return result;
|
||||||
|
|
||||||
/* sets the passive mode */
|
/* sets the passive mode */
|
||||||
FTPSENDF(pasv_conn, "%s", "PASV");
|
FTPSENDF(pasv_conn, "%s", "PASV");
|
||||||
result = Curl_GetFTPResponse(&nread, pasv_conn, &ftpcode);
|
result = Curl_GetFTPResponse(&nread, pasv_conn, &ftpcode);
|
||||||
@@ -2615,35 +2636,25 @@ static CURLcode ftp_3rdparty_transfer(struct connectdata *conn)
|
|||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* ftp_regular_transfer()
|
* ftp_parse_url_path()
|
||||||
*
|
*
|
||||||
* The input argument is already checked for validity.
|
* Parse the URL path into separate path components.
|
||||||
* Performs a regular transfer between local and remote hosts.
|
|
||||||
*
|
*
|
||||||
* ftp->ctl_valid starts out as FALSE, and gets set to TRUE if we reach the
|
|
||||||
* Curl_ftp_done() function without finding any major problem.
|
|
||||||
*/
|
*/
|
||||||
static
|
static
|
||||||
CURLcode ftp_regular_transfer(struct connectdata *conn)
|
CURLcode ftp_parse_url_path(struct connectdata *conn)
|
||||||
{
|
{
|
||||||
CURLcode retcode=CURLE_OK;
|
CURLcode retcode = CURLE_OK;
|
||||||
bool connected=0;
|
|
||||||
struct SessionHandle *data = conn->data;
|
struct SessionHandle *data = conn->data;
|
||||||
struct FTP *ftp;
|
struct FTP *ftp;
|
||||||
|
|
||||||
char *slash_pos; /* position of the first '/' char in curpos */
|
char *slash_pos; /* position of the first '/' char in curpos */
|
||||||
char *cur_pos=conn->path; /* current position in ppath. point at the begin
|
char *cur_pos = conn->path; /* current position in path. point at the begin
|
||||||
of next path component */
|
of next path component */
|
||||||
|
|
||||||
/* the ftp struct is already inited in ftp_connect() */
|
/* the ftp struct is already inited in ftp_connect() */
|
||||||
ftp = conn->proto.ftp;
|
ftp = conn->proto.ftp;
|
||||||
ftp->ctl_valid = FALSE;
|
ftp->ctl_valid = FALSE;
|
||||||
conn->size = -1; /* make sure this is unknown at this point */
|
|
||||||
|
|
||||||
Curl_pgrsSetUploadCounter(data, 0);
|
|
||||||
Curl_pgrsSetDownloadCounter(data, 0);
|
|
||||||
Curl_pgrsSetUploadSize(data, 0);
|
|
||||||
Curl_pgrsSetDownloadSize(data, 0);
|
|
||||||
|
|
||||||
ftp->dirdepth = 0;
|
ftp->dirdepth = 0;
|
||||||
ftp->diralloc = 5; /* default dir depth to allocate */
|
ftp->diralloc = 5; /* default dir depth to allocate */
|
||||||
@@ -2706,6 +2717,72 @@ CURLcode ftp_regular_transfer(struct connectdata *conn)
|
|||||||
ftp->file=NULL; /* instead of point to a zero byte, we make it a NULL
|
ftp->file=NULL; /* instead of point to a zero byte, we make it a NULL
|
||||||
pointer */
|
pointer */
|
||||||
|
|
||||||
|
return retcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
*
|
||||||
|
* ftp_cwd_and_create_path()
|
||||||
|
*
|
||||||
|
* Creates full path on remote target host.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
static
|
||||||
|
CURLcode ftp_cwd_and_create_path(struct connectdata *conn)
|
||||||
|
{
|
||||||
|
CURLcode result = CURLE_OK;
|
||||||
|
/* the ftp struct is already inited in Curl_ftp_connect() */
|
||||||
|
struct FTP *ftp = conn->proto.ftp;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
/* This is a re-used connection. Since we change directory to where the
|
||||||
|
transfer is taking place, we must now get back to the original dir
|
||||||
|
where we ended up after login: */
|
||||||
|
if (conn->bits.reuse && ftp->entrypath) {
|
||||||
|
if ((result = ftp_cwd_and_mkd(conn, ftp->entrypath)) != CURLE_OK)
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i=0; i < ftp->dirdepth; i++) {
|
||||||
|
/* RFC 1738 says empty components should be respected too, but
|
||||||
|
that is plain stupid since CWD can't be used with an empty argument */
|
||||||
|
if ((result = ftp_cwd_and_mkd(conn, ftp->dirs[i])) != CURLE_OK)
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
*
|
||||||
|
* ftp_regular_transfer()
|
||||||
|
*
|
||||||
|
* The input argument is already checked for validity.
|
||||||
|
* Performs a regular transfer between local and remote hosts.
|
||||||
|
*
|
||||||
|
* ftp->ctl_valid starts out as FALSE, and gets set to TRUE if we reach the
|
||||||
|
* Curl_ftp_done() function without finding any major problem.
|
||||||
|
*/
|
||||||
|
static
|
||||||
|
CURLcode ftp_regular_transfer(struct connectdata *conn)
|
||||||
|
{
|
||||||
|
CURLcode retcode=CURLE_OK;
|
||||||
|
bool connected=0;
|
||||||
|
struct SessionHandle *data = conn->data;
|
||||||
|
struct FTP *ftp;
|
||||||
|
|
||||||
|
/* the ftp struct is already inited in ftp_connect() */
|
||||||
|
ftp = conn->proto.ftp;
|
||||||
|
conn->size = -1; /* make sure this is unknown at this point */
|
||||||
|
|
||||||
|
Curl_pgrsSetUploadCounter(data, 0);
|
||||||
|
Curl_pgrsSetDownloadCounter(data, 0);
|
||||||
|
Curl_pgrsSetUploadSize(data, 0);
|
||||||
|
Curl_pgrsSetDownloadSize(data, 0);
|
||||||
|
|
||||||
retcode = ftp_perform(conn, &connected);
|
retcode = ftp_perform(conn, &connected);
|
||||||
|
|
||||||
if(CURLE_OK == retcode) {
|
if(CURLE_OK == retcode) {
|
||||||
|
2150
lib/getdate.c.cvs
2150
lib/getdate.c.cvs
File diff suppressed because it is too large
Load Diff
@@ -1,37 +0,0 @@
|
|||||||
/*
|
|
||||||
** Originally written by Steven M. Bellovin <smb@research.att.com> while
|
|
||||||
** at the University of North Carolina at Chapel Hill. Later tweaked by
|
|
||||||
** a couple of people on Usenet. Completely overhauled by Rich $alz
|
|
||||||
** <rsalz@bbn.com> and Jim Berets <jberets@bbn.com> in August, 1990.
|
|
||||||
**
|
|
||||||
** This code is in the public domain and has no copyright.
|
|
||||||
*/
|
|
||||||
|
|
||||||
# include "setup.h"
|
|
||||||
|
|
||||||
#ifndef PARAMS
|
|
||||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
|
||||||
# define PARAMS(Args) Args
|
|
||||||
# else
|
|
||||||
# define PARAMS(Args) ()
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef vms
|
|
||||||
# include <types.h>
|
|
||||||
# include <time.h>
|
|
||||||
#else
|
|
||||||
# include <sys/types.h>
|
|
||||||
# if TIME_WITH_SYS_TIME
|
|
||||||
# include <sys/time.h>
|
|
||||||
# include <time.h>
|
|
||||||
# else
|
|
||||||
# if HAVE_SYS_TIME_H
|
|
||||||
# include <sys/time.h>
|
|
||||||
# else
|
|
||||||
# include <time.h>
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif /* defined (vms) */
|
|
||||||
|
|
||||||
time_t curl_getdate PARAMS ((const char *p, const time_t *now));
|
|
1081
lib/getdate.y
1081
lib/getdate.y
File diff suppressed because it is too large
Load Diff
@@ -167,6 +167,9 @@ CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...)
|
|||||||
case CURLINFO_PROXYAUTH_AVAIL:
|
case CURLINFO_PROXYAUTH_AVAIL:
|
||||||
*param_longp = data->info.proxyauthavail;
|
*param_longp = data->info.proxyauthavail;
|
||||||
break;
|
break;
|
||||||
|
case CURLINFO_OS_ERRNO:
|
||||||
|
*param_longp = data->state.os_errno;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||||
}
|
}
|
||||||
|
@@ -115,7 +115,6 @@ static void addrinfo_callback(void *arg, /* "struct connectdata *" */
|
|||||||
struct connectdata *conn = (struct connectdata *)arg;
|
struct connectdata *conn = (struct connectdata *)arg;
|
||||||
struct Curl_dns_entry *dns = NULL;
|
struct Curl_dns_entry *dns = NULL;
|
||||||
|
|
||||||
conn->async.done = TRUE;
|
|
||||||
conn->async.status = status;
|
conn->async.status = status;
|
||||||
|
|
||||||
if(CURL_ASYNC_SUCCESS == status) {
|
if(CURL_ASYNC_SUCCESS == status) {
|
||||||
@@ -147,6 +146,11 @@ static void addrinfo_callback(void *arg, /* "struct connectdata *" */
|
|||||||
|
|
||||||
conn->async.dns = dns;
|
conn->async.dns = dns;
|
||||||
|
|
||||||
|
/* Set async.done TRUE last in this function since it may be used multi-
|
||||||
|
threaded and once this is TRUE the other thread may read fields from the
|
||||||
|
async struct */
|
||||||
|
conn->async.done = TRUE;
|
||||||
|
|
||||||
/* ipv4: The input hostent struct will be freed by ares when we return from
|
/* ipv4: The input hostent struct will be freed by ares when we return from
|
||||||
this function */
|
this function */
|
||||||
}
|
}
|
||||||
|
15
lib/hostip.c
15
lib/hostip.c
@@ -263,8 +263,9 @@ void Curl_hostcache_prune(struct SessionHandle *data)
|
|||||||
{
|
{
|
||||||
time_t now;
|
time_t now;
|
||||||
|
|
||||||
if(data->set.dns_cache_timeout == -1)
|
if((data->set.dns_cache_timeout == -1) || !data->hostcache)
|
||||||
/* cache forever means never prune! */
|
/* cache forever means never prune, and NULL hostcache means
|
||||||
|
we can't do it */
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(data->share)
|
if(data->share)
|
||||||
@@ -377,9 +378,7 @@ int Curl_resolv(struct connectdata *conn,
|
|||||||
int wait;
|
int wait;
|
||||||
struct SessionHandle *data = conn->data;
|
struct SessionHandle *data = conn->data;
|
||||||
CURLcode result;
|
CURLcode result;
|
||||||
|
int rc;
|
||||||
/* default to failure */
|
|
||||||
int rc = CURLRESOLV_ERROR;
|
|
||||||
*entry = NULL;
|
*entry = NULL;
|
||||||
|
|
||||||
#ifdef HAVE_SIGSETJMP
|
#ifdef HAVE_SIGSETJMP
|
||||||
@@ -412,6 +411,8 @@ int Curl_resolv(struct connectdata *conn,
|
|||||||
/* free the allocated entry_id again */
|
/* free the allocated entry_id again */
|
||||||
free(entry_id);
|
free(entry_id);
|
||||||
|
|
||||||
|
rc = CURLRESOLV_ERROR; /* default to failure */
|
||||||
|
|
||||||
if (!dns) {
|
if (!dns) {
|
||||||
/* The entry was not in the cache. Resolve it to IP address */
|
/* The entry was not in the cache. Resolve it to IP address */
|
||||||
|
|
||||||
@@ -459,7 +460,11 @@ int Curl_resolv(struct connectdata *conn,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if(data->share)
|
||||||
|
Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
|
||||||
dns->inuse++; /* we use it! */
|
dns->inuse++; /* we use it! */
|
||||||
|
if(data->share)
|
||||||
|
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
|
||||||
rc = CURLRESOLV_RESOLVED;
|
rc = CURLRESOLV_RESOLVED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -161,7 +161,7 @@ Curl_addrinfo *Curl_ip2addr(in_addr_t num, char *hostname, int port)
|
|||||||
h->h_aliases = NULL;
|
h->h_aliases = NULL;
|
||||||
|
|
||||||
/* Now store the dotted version of the address */
|
/* Now store the dotted version of the address */
|
||||||
snprintf(h->h_name, 16, "%s", hostname);
|
snprintf((char *)h->h_name, 16, "%s", hostname);
|
||||||
|
|
||||||
ai = Curl_he2ai(h, port);
|
ai = Curl_he2ai(h, port);
|
||||||
|
|
||||||
|
@@ -208,9 +208,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 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 */
|
||||||
|
|
||||||
@@ -245,10 +247,18 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if((1 == inet_pton(AF_INET, hostname, addrbuf)) ||
|
||||||
|
(1 == inet_pton(AF_INET6, hostname, addrbuf))) {
|
||||||
|
/* the given address is numerical only, prevent a reverse lookup */
|
||||||
|
ai_flags = AI_NUMERICHOST;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ai_flags = AI_CANONNAME;
|
||||||
|
|
||||||
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 = SOCK_STREAM;
|
||||||
hints.ai_flags = AI_CANONNAME;
|
hints.ai_flags = ai_flags;
|
||||||
snprintf(sbuf, sizeof(sbuf), "%d", port);
|
snprintf(sbuf, sizeof(sbuf), "%d", port);
|
||||||
error = getaddrinfo(hostname, sbuf, &hints, &res);
|
error = getaddrinfo(hostname, sbuf, &hints, &res);
|
||||||
if (error) {
|
if (error) {
|
||||||
|
125
lib/hostthre.c
125
lib/hostthre.c
@@ -64,6 +64,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
#include <stdlib.h>
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -156,6 +157,8 @@ struct thread_data {
|
|||||||
DWORD thread_status;
|
DWORD thread_status;
|
||||||
curl_socket_t dummy_sock; /* dummy for Curl_fdset() */
|
curl_socket_t dummy_sock; /* dummy for Curl_fdset() */
|
||||||
FILE *stderr_file;
|
FILE *stderr_file;
|
||||||
|
HANDLE mutex_waiting; /* marks that we are still waiting for a resolve */
|
||||||
|
HANDLE event_resolved; /* marks that the thread obtained the information */
|
||||||
#ifdef CURLRES_IPV6
|
#ifdef CURLRES_IPV6
|
||||||
struct addrinfo hints;
|
struct addrinfo hints;
|
||||||
#endif
|
#endif
|
||||||
@@ -174,7 +177,19 @@ static unsigned __stdcall gethostbyname_thread (void *arg)
|
|||||||
struct connectdata *conn = (struct connectdata*) arg;
|
struct connectdata *conn = (struct connectdata*) arg;
|
||||||
struct thread_data *td = (struct thread_data*) conn->async.os_specific;
|
struct thread_data *td = (struct thread_data*) conn->async.os_specific;
|
||||||
struct hostent *he;
|
struct hostent *he;
|
||||||
int rc;
|
int rc = 0;
|
||||||
|
|
||||||
|
/* Duplicate the passed mutex handle.
|
||||||
|
* This allows us to use it even after the container gets destroyed
|
||||||
|
* due to a resolver timeout.
|
||||||
|
*/
|
||||||
|
HANDLE mutex_waiting = NULL;
|
||||||
|
if (!DuplicateHandle(GetCurrentProcess(), td->mutex_waiting,
|
||||||
|
GetCurrentProcess(), &mutex_waiting, 0, FALSE,
|
||||||
|
DUPLICATE_SAME_ACCESS)) {
|
||||||
|
/* failed to duplicate the mutex, no point in continuing */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Sharing the same _iob[] element with our parent thread should
|
/* Sharing the same _iob[] element with our parent thread should
|
||||||
* hopefully make printouts synchronised. I'm not sure it works
|
* hopefully make printouts synchronised. I'm not sure it works
|
||||||
@@ -184,6 +199,16 @@ static unsigned __stdcall gethostbyname_thread (void *arg)
|
|||||||
|
|
||||||
WSASetLastError (conn->async.status = NO_DATA); /* pending status */
|
WSASetLastError (conn->async.status = NO_DATA); /* pending status */
|
||||||
he = gethostbyname (conn->async.hostname);
|
he = gethostbyname (conn->async.hostname);
|
||||||
|
|
||||||
|
/* is the thread initiator still waiting for us ? */
|
||||||
|
if (WaitForSingleObject(mutex_waiting, 0) == WAIT_TIMEOUT) {
|
||||||
|
/* yes, it is */
|
||||||
|
|
||||||
|
/* Mark that we have obtained the information, and that we are
|
||||||
|
* calling back with it.
|
||||||
|
*/
|
||||||
|
SetEvent(td->event_resolved);
|
||||||
|
|
||||||
if (he) {
|
if (he) {
|
||||||
Curl_addrinfo4_callback(conn, CURL_ASYNC_SUCCESS, he);
|
Curl_addrinfo4_callback(conn, CURL_ASYNC_SUCCESS, he);
|
||||||
rc = 1;
|
rc = 1;
|
||||||
@@ -194,6 +219,11 @@ static unsigned __stdcall gethostbyname_thread (void *arg)
|
|||||||
}
|
}
|
||||||
TRACE(("Winsock-error %d, addr %s\n", conn->async.status,
|
TRACE(("Winsock-error %d, addr %s\n", conn->async.status,
|
||||||
he ? inet_ntoa(*(struct in_addr*)he->h_addr) : "unknown"));
|
he ? inet_ntoa(*(struct in_addr*)he->h_addr) : "unknown"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* clean up */
|
||||||
|
CloseHandle(mutex_waiting);
|
||||||
|
|
||||||
return (rc);
|
return (rc);
|
||||||
/* An implicit _endthreadex() here */
|
/* An implicit _endthreadex() here */
|
||||||
}
|
}
|
||||||
@@ -215,6 +245,18 @@ static unsigned __stdcall getaddrinfo_thread (void *arg)
|
|||||||
char service [NI_MAXSERV];
|
char service [NI_MAXSERV];
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
/* Duplicate the passed mutex handle.
|
||||||
|
* This allows us to use it even after the container gets destroyed
|
||||||
|
* due to a resolver timeout.
|
||||||
|
*/
|
||||||
|
HANDLE mutex_waiting = NULL;
|
||||||
|
if (!DuplicateHandle(GetCurrentProcess(), td->mutex_waiting,
|
||||||
|
GetCurrentProcess(), &mutex_waiting, 0, FALSE,
|
||||||
|
DUPLICATE_SAME_ACCESS)) {
|
||||||
|
/* failed to duplicate the mutex, no point in continuing */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
*stderr = *td->stderr_file;
|
*stderr = *td->stderr_file;
|
||||||
|
|
||||||
itoa(conn->async.port, service, 10);
|
itoa(conn->async.port, service, 10);
|
||||||
@@ -223,6 +265,15 @@ static unsigned __stdcall getaddrinfo_thread (void *arg)
|
|||||||
|
|
||||||
rc = getaddrinfo(conn->async.hostname, service, &td->hints, &res);
|
rc = getaddrinfo(conn->async.hostname, service, &td->hints, &res);
|
||||||
|
|
||||||
|
/* is the thread initiator still waiting for us ? */
|
||||||
|
if (WaitForSingleObject(mutex_waiting, 0) == WAIT_TIMEOUT) {
|
||||||
|
/* yes, it is */
|
||||||
|
|
||||||
|
/* Mark that we have obtained the information, and that we are
|
||||||
|
* calling back with it.
|
||||||
|
*/
|
||||||
|
SetEvent(td->event_resolved);
|
||||||
|
|
||||||
if (rc == 0) {
|
if (rc == 0) {
|
||||||
#ifdef DEBUG_THREADING_GETADDRINFO
|
#ifdef DEBUG_THREADING_GETADDRINFO
|
||||||
dump_addrinfo (conn, res);
|
dump_addrinfo (conn, res);
|
||||||
@@ -233,6 +284,11 @@ static unsigned __stdcall getaddrinfo_thread (void *arg)
|
|||||||
Curl_addrinfo6_callback(conn, (int)WSAGetLastError(), NULL);
|
Curl_addrinfo6_callback(conn, (int)WSAGetLastError(), NULL);
|
||||||
TRACE(("Winsock-error %d, no address\n", conn->async.status));
|
TRACE(("Winsock-error %d, no address\n", conn->async.status));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* clean up */
|
||||||
|
CloseHandle(mutex_waiting);
|
||||||
|
|
||||||
return (rc);
|
return (rc);
|
||||||
/* An implicit _endthreadex() here */
|
/* An implicit _endthreadex() here */
|
||||||
}
|
}
|
||||||
@@ -248,10 +304,18 @@ static void destroy_thread_data (struct Curl_async *async)
|
|||||||
free(async->hostname);
|
free(async->hostname);
|
||||||
|
|
||||||
if (async->os_specific) {
|
if (async->os_specific) {
|
||||||
curl_socket_t sock = ((const struct thread_data*)async->os_specific)->dummy_sock;
|
struct thread_data *td = (struct thread_data*) async->os_specific;
|
||||||
|
curl_socket_t sock = td->dummy_sock;
|
||||||
|
|
||||||
if (sock != CURL_SOCKET_BAD)
|
if (sock != CURL_SOCKET_BAD)
|
||||||
sclose(sock);
|
sclose(sock);
|
||||||
|
|
||||||
|
/* destroy the synchronization objects */
|
||||||
|
if (td->mutex_waiting)
|
||||||
|
CloseHandle(td->mutex_waiting);
|
||||||
|
if (td->event_resolved)
|
||||||
|
CloseHandle(td->event_resolved);
|
||||||
|
|
||||||
free(async->os_specific);
|
free(async->os_specific);
|
||||||
}
|
}
|
||||||
async->hostname = NULL;
|
async->hostname = NULL;
|
||||||
@@ -288,8 +352,28 @@ static bool init_resolve_thread (struct connectdata *conn,
|
|||||||
conn->async.status = 0;
|
conn->async.status = 0;
|
||||||
conn->async.dns = NULL;
|
conn->async.dns = NULL;
|
||||||
conn->async.os_specific = (void*) td;
|
conn->async.os_specific = (void*) td;
|
||||||
|
|
||||||
td->dummy_sock = CURL_SOCKET_BAD;
|
td->dummy_sock = CURL_SOCKET_BAD;
|
||||||
|
|
||||||
|
/* Create the mutex used to inform the resolver thread that we're
|
||||||
|
* still waiting, and take initial ownership.
|
||||||
|
*/
|
||||||
|
td->mutex_waiting = CreateMutex(NULL, TRUE, NULL);
|
||||||
|
if (td->mutex_waiting == NULL) {
|
||||||
|
destroy_thread_data(&conn->async);
|
||||||
|
SetLastError(EAGAIN);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Create the event that the thread uses to inform us that it's
|
||||||
|
* done resolving. Do not signal it.
|
||||||
|
*/
|
||||||
|
td->event_resolved = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||||
|
if (td->event_resolved == NULL) {
|
||||||
|
destroy_thread_data(&conn->async);
|
||||||
|
SetLastError(EAGAIN);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
td->stderr_file = stderr;
|
td->stderr_file = stderr;
|
||||||
td->thread_hnd = (HANDLE) _beginthreadex(NULL, 0, THREAD_FUNC,
|
td->thread_hnd = (HANDLE) _beginthreadex(NULL, 0, THREAD_FUNC,
|
||||||
conn, 0, &td->thread_id);
|
conn, 0, &td->thread_id);
|
||||||
@@ -342,8 +426,30 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn,
|
|||||||
CURL_TIMEOUT_RESOLVE; /* default name resolve timeout */
|
CURL_TIMEOUT_RESOLVE; /* default name resolve timeout */
|
||||||
ticks = GetTickCount();
|
ticks = GetTickCount();
|
||||||
|
|
||||||
status = WaitForSingleObject(td->thread_hnd, 1000UL*timeout);
|
/* wait for the thread to resolve the name */
|
||||||
if (status == WAIT_OBJECT_0 || status == WAIT_ABANDONED) {
|
status = WaitForSingleObject(td->event_resolved, 1000UL*timeout);
|
||||||
|
|
||||||
|
/* mark that we are now done waiting */
|
||||||
|
ReleaseMutex(td->mutex_waiting);
|
||||||
|
|
||||||
|
/* close our handle to the mutex, no point in hanging on to it */
|
||||||
|
CloseHandle(td->mutex_waiting);
|
||||||
|
td->mutex_waiting = NULL;
|
||||||
|
|
||||||
|
/* close the event handle, it's useless now */
|
||||||
|
CloseHandle(td->event_resolved);
|
||||||
|
td->event_resolved = NULL;
|
||||||
|
|
||||||
|
/* has the resolver thread succeeded in resolving our query ? */
|
||||||
|
if (status == WAIT_OBJECT_0) {
|
||||||
|
/* wait for the thread to exit, it's in the callback sequence */
|
||||||
|
if (WaitForSingleObject(td->thread_hnd, 5000) == WAIT_TIMEOUT) {
|
||||||
|
TerminateThread(td->thread_hnd, 0);
|
||||||
|
conn->async.done = TRUE;
|
||||||
|
td->thread_status = (DWORD)-1;
|
||||||
|
TRACE(("%s() thread stuck?!, ", THREAD_NAME));
|
||||||
|
}
|
||||||
|
else {
|
||||||
/* Thread finished before timeout; propagate Winsock error to this thread.
|
/* Thread finished before timeout; propagate Winsock error to this thread.
|
||||||
* 'conn->async.done = TRUE' is set in Curl_addrinfo4/6_callback().
|
* 'conn->async.done = TRUE' is set in Curl_addrinfo4/6_callback().
|
||||||
*/
|
*/
|
||||||
@@ -352,6 +458,7 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn,
|
|||||||
TRACE(("%s() status %lu, thread retval %lu, ",
|
TRACE(("%s() status %lu, thread retval %lu, ",
|
||||||
THREAD_NAME, status, td->thread_status));
|
THREAD_NAME, status, td->thread_status));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
conn->async.done = TRUE;
|
conn->async.done = TRUE;
|
||||||
td->thread_status = (DWORD)-1;
|
td->thread_status = (DWORD)-1;
|
||||||
@@ -460,8 +567,8 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* fall-back to blocking version */
|
/* fall-back to blocking version */
|
||||||
infof(data, "init_resolve_thread() failed for %s; code %lu\n",
|
infof(data, "init_resolve_thread() failed for %s; %s\n",
|
||||||
hostname, GetLastError());
|
hostname, Curl_strerror(conn,GetLastError()));
|
||||||
|
|
||||||
h = gethostbyname(hostname);
|
h = gethostbyname(hostname);
|
||||||
if (!h) {
|
if (!h) {
|
||||||
@@ -535,8 +642,8 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* fall-back to blocking version */
|
/* fall-back to blocking version */
|
||||||
infof(data, "init_resolve_thread() failed for %s; code %lu\n",
|
infof(data, "init_resolve_thread() failed for %s; %s\n",
|
||||||
hostname, GetLastError());
|
hostname, Curl_strerror(conn,GetLastError()));
|
||||||
|
|
||||||
error = getaddrinfo(hostname, sbuf, &hints, &res);
|
error = getaddrinfo(hostname, sbuf, &hints, &res);
|
||||||
if (error) {
|
if (error) {
|
||||||
|
71
lib/http.c
71
lib/http.c
@@ -299,8 +299,8 @@ Curl_http_output_auth(struct connectdata *conn,
|
|||||||
/* To prevent the user+password to get sent to other than the original
|
/* To prevent the user+password to get sent to other than the original
|
||||||
host due to a location-follow, we do some weirdo checks here */
|
host due to a location-follow, we do some weirdo checks here */
|
||||||
if(!data->state.this_is_a_follow ||
|
if(!data->state.this_is_a_follow ||
|
||||||
!data->state.auth_host ||
|
!data->state.first_host ||
|
||||||
curl_strequal(data->state.auth_host, conn->host.name) ||
|
curl_strequal(data->state.first_host, conn->host.name) ||
|
||||||
data->set.http_disable_hostname_check_before_authentication) {
|
data->set.http_disable_hostname_check_before_authentication) {
|
||||||
|
|
||||||
/* Send proxy authentication header if needed */
|
/* Send proxy authentication header if needed */
|
||||||
@@ -1156,14 +1156,13 @@ CURLcode Curl_http_connect(struct connectdata *conn)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(conn->bits.user_passwd && !data->state.this_is_a_follow) {
|
if(!data->state.this_is_a_follow) {
|
||||||
/* Authorization: is requested, this is not a followed location, get the
|
/* this is not a followed location, get the original host name */
|
||||||
original host name */
|
if (data->state.first_host)
|
||||||
if (data->state.auth_host)
|
|
||||||
/* Free to avoid leaking memory on multiple requests*/
|
/* Free to avoid leaking memory on multiple requests*/
|
||||||
free(data->state.auth_host);
|
free(data->state.first_host);
|
||||||
|
|
||||||
data->state.auth_host = strdup(conn->host.name);
|
data->state.first_host = strdup(conn->host.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
@@ -1325,6 +1324,15 @@ CURLcode Curl_http(struct connectdata *conn)
|
|||||||
if(data->set.cookie && !checkheaders(data, "Cookie:"))
|
if(data->set.cookie && !checkheaders(data, "Cookie:"))
|
||||||
addcookies = data->set.cookie;
|
addcookies = data->set.cookie;
|
||||||
|
|
||||||
|
if(!checkheaders(data, "Accept-Encoding:") &&
|
||||||
|
data->set.encoding) {
|
||||||
|
Curl_safefree(conn->allocptr.accept_encoding);
|
||||||
|
conn->allocptr.accept_encoding =
|
||||||
|
aprintf("Accept-Encoding: %s\015\012", data->set.encoding);
|
||||||
|
if(!conn->allocptr.accept_encoding)
|
||||||
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
if(!conn->bits.upload_chunky && (httpreq != HTTPREQ_GET)) {
|
if(!conn->bits.upload_chunky && (httpreq != HTTPREQ_GET)) {
|
||||||
/* not a chunky transfer yet, but data is to be sent */
|
/* not a chunky transfer yet, but data is to be sent */
|
||||||
ptr = checkheaders(data, "Transfer-Encoding:");
|
ptr = checkheaders(data, "Transfer-Encoding:");
|
||||||
@@ -1354,11 +1362,13 @@ CURLcode Curl_http(struct connectdata *conn)
|
|||||||
Curl_safefree(conn->allocptr.host);
|
Curl_safefree(conn->allocptr.host);
|
||||||
|
|
||||||
ptr = checkheaders(data, "Host:");
|
ptr = checkheaders(data, "Host:");
|
||||||
if(ptr && !data->state.this_is_a_follow) {
|
if(ptr && (!data->state.this_is_a_follow ||
|
||||||
|
curl_strequal(data->state.first_host, conn->host.name))) {
|
||||||
/* If we have a given custom Host: header, we extract the host name in
|
/* If we have a given custom Host: header, we extract the host name in
|
||||||
order to possibly use it for cookie reasons later on. We only allow the
|
order to possibly use it for cookie reasons later on. We only allow the
|
||||||
custom Host: header if this is NOT a redirect, as setting Host: in the
|
custom Host: header if this is NOT a redirect, as setting Host: in the
|
||||||
redirected request is being out on thin ice. */
|
redirected request is being out on thin ice. Except if the host name
|
||||||
|
is the same as the first one! */
|
||||||
char *start = ptr+strlen("Host:");
|
char *start = ptr+strlen("Host:");
|
||||||
while(*start && isspace((int)*start ))
|
while(*start && isspace((int)*start ))
|
||||||
start++;
|
start++;
|
||||||
@@ -1370,6 +1380,7 @@ CURLcode Curl_http(struct connectdata *conn)
|
|||||||
|
|
||||||
if(ptr != start) {
|
if(ptr != start) {
|
||||||
size_t len=ptr-start;
|
size_t len=ptr-start;
|
||||||
|
Curl_safefree(conn->allocptr.cookiehost);
|
||||||
conn->allocptr.cookiehost = malloc(len+1);
|
conn->allocptr.cookiehost = malloc(len+1);
|
||||||
if(!conn->allocptr.cookiehost)
|
if(!conn->allocptr.cookiehost)
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
@@ -1620,7 +1631,7 @@ CURLcode Curl_http(struct connectdata *conn)
|
|||||||
Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
|
Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
|
||||||
co = Curl_cookie_getlist(data->cookies,
|
co = Curl_cookie_getlist(data->cookies,
|
||||||
conn->allocptr.cookiehost?
|
conn->allocptr.cookiehost?
|
||||||
conn->allocptr.cookiehost:host, ppath,
|
conn->allocptr.cookiehost:host, conn->path,
|
||||||
(bool)(conn->protocol&PROT_HTTPS?TRUE:FALSE));
|
(bool)(conn->protocol&PROT_HTTPS?TRUE:FALSE));
|
||||||
Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
|
Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
|
||||||
}
|
}
|
||||||
@@ -1718,11 +1729,19 @@ CURLcode Curl_http(struct connectdata *conn)
|
|||||||
if(*ptr) {
|
if(*ptr) {
|
||||||
/* only send this if the contents was non-blank */
|
/* only send this if the contents was non-blank */
|
||||||
|
|
||||||
|
if(conn->allocptr.host &&
|
||||||
|
/* a Host: header was sent already, don't pass on any custom Host:
|
||||||
|
header as that will produce *two* in the same request! */
|
||||||
|
curl_strnequal("Host:", headers->data, 5))
|
||||||
|
;
|
||||||
|
else {
|
||||||
|
|
||||||
result = add_bufferf(req_buffer, "%s\r\n", headers->data);
|
result = add_bufferf(req_buffer, "%s\r\n", headers->data);
|
||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
headers = headers->next;
|
headers = headers->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1756,10 +1775,12 @@ CURLcode Curl_http(struct connectdata *conn)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!checkheaders(data, "Expect:")) {
|
if((data->set.httpversion != CURL_HTTP_VERSION_1_0) &&
|
||||||
/* if not disabled explicitly we add a Expect: 100-continue
|
!checkheaders(data, "Expect:")) {
|
||||||
to the headers which actually speeds up post operations (as
|
/* if not doing HTTP 1.0 or disabled explicitly, we add a Expect:
|
||||||
there is one packet coming back from the web server) */
|
100-continue to the headers which actually speeds up post
|
||||||
|
operations (as there is one packet coming back from the web
|
||||||
|
server) */
|
||||||
result = add_bufferf(req_buffer,
|
result = add_bufferf(req_buffer,
|
||||||
"Expect: 100-continue\r\n");
|
"Expect: 100-continue\r\n");
|
||||||
if(result)
|
if(result)
|
||||||
@@ -1823,10 +1844,12 @@ CURLcode Curl_http(struct connectdata *conn)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!checkheaders(data, "Expect:")) {
|
if((data->set.httpversion != CURL_HTTP_VERSION_1_0) &&
|
||||||
/* if not disabled explicitly we add a Expect: 100-continue
|
!checkheaders(data, "Expect:")) {
|
||||||
to the headers which actually speeds up post operations (as
|
/* if not HTTP 1.0 or disabled explicitly, we add a Expect:
|
||||||
there is one packet coming back from the web server) */
|
100-continue to the headers which actually speeds up post
|
||||||
|
operations (as there is one packet coming back from the web
|
||||||
|
server) */
|
||||||
result = add_bufferf(req_buffer,
|
result = add_bufferf(req_buffer,
|
||||||
"Expect: 100-continue\r\n");
|
"Expect: 100-continue\r\n");
|
||||||
if(result)
|
if(result)
|
||||||
@@ -1936,10 +1959,12 @@ CURLcode Curl_http(struct connectdata *conn)
|
|||||||
/* set the upload size to the progress meter */
|
/* set the upload size to the progress meter */
|
||||||
Curl_pgrsSetUploadSize(data, http->postsize);
|
Curl_pgrsSetUploadSize(data, http->postsize);
|
||||||
|
|
||||||
if(!checkheaders(data, "Expect:")) {
|
if((data->set.httpversion != CURL_HTTP_VERSION_1_0) &&
|
||||||
/* if not disabled explicitly we add a Expect: 100-continue to the
|
!checkheaders(data, "Expect:")) {
|
||||||
headers which actually speeds up post operations (as there is
|
/* if not HTTP 1.0 or disabled explicitly, we add a Expect:
|
||||||
one packet coming back from the web server) */
|
100-continue to the headers which actually speeds up post
|
||||||
|
operations (as there is one packet coming back from the web
|
||||||
|
server) */
|
||||||
add_bufferf(req_buffer,
|
add_bufferf(req_buffer,
|
||||||
"Expect: 100-continue\r\n");
|
"Expect: 100-continue\r\n");
|
||||||
data->set.expect100header = TRUE;
|
data->set.expect100header = TRUE;
|
||||||
|
@@ -108,7 +108,8 @@ inet_pton4(const char *src, unsigned char *dst)
|
|||||||
|
|
||||||
saw_digit = 0;
|
saw_digit = 0;
|
||||||
octets = 0;
|
octets = 0;
|
||||||
*(tp = tmp) = 0;
|
tp = tmp;
|
||||||
|
*tp = 0;
|
||||||
while ((ch = *src++) != '\0') {
|
while ((ch = *src++) != '\0') {
|
||||||
const char *pch;
|
const char *pch;
|
||||||
|
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
# include <malloc.h>
|
# include <malloc.h>
|
||||||
# include <WinLdap.h>
|
# include <winldap.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
@@ -350,8 +350,8 @@ CURLcode Curl_ldap(struct connectdata *conn)
|
|||||||
Curl_client_write(data, CLIENTWRITE_BODY, (char *)"\n", 1);
|
Curl_client_write(data, CLIENTWRITE_BODY, (char *)"\n", 1);
|
||||||
|
|
||||||
(*ldap_memfree)(attribute);
|
(*ldap_memfree)(attribute);
|
||||||
(*ldap_memfree)(dn);
|
|
||||||
}
|
}
|
||||||
|
(*ldap_memfree)(dn);
|
||||||
if (ber)
|
if (ber)
|
||||||
(*ber_free)(ber, 0);
|
(*ber_free)(ber, 0);
|
||||||
}
|
}
|
||||||
|
@@ -49,3 +49,4 @@ EXPORTS
|
|||||||
curl_multi_strerror @ 41;
|
curl_multi_strerror @ 41;
|
||||||
curl_share_strerror @ 42;
|
curl_share_strerror @ 42;
|
||||||
curl_easy_reset @ 43;
|
curl_easy_reset @ 43;
|
||||||
|
|
||||||
|
@@ -42,4 +42,6 @@
|
|||||||
curl_global_init_mem,
|
curl_global_init_mem,
|
||||||
curl_easy_strerror,
|
curl_easy_strerror,
|
||||||
curl_multi_strerror,
|
curl_multi_strerror,
|
||||||
curl_share_strerror
|
curl_share_strerror,
|
||||||
|
curl_easy_reset
|
||||||
|
|
||||||
|
@@ -95,6 +95,7 @@ static bool countcheck(const char *func, int line, const char *source)
|
|||||||
if(source)
|
if(source)
|
||||||
fprintf(stderr, "LIMIT %s:%d %s reached memlimit\n",
|
fprintf(stderr, "LIMIT %s:%d %s reached memlimit\n",
|
||||||
source, line, func);
|
source, line, func);
|
||||||
|
errno = ENOMEM;
|
||||||
return TRUE; /* RETURN ERROR! */
|
return TRUE; /* RETURN ERROR! */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -177,7 +177,7 @@ CURLMcode curl_multi_add_handle(CURLM *multi_handle,
|
|||||||
/* increase the node-counter */
|
/* increase the node-counter */
|
||||||
multi->num_easy++;
|
multi->num_easy++;
|
||||||
|
|
||||||
return CURLM_CALL_MULTI_PERFORM;
|
return CURLM_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
|
CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
|
||||||
|
398
lib/parsedate.c
Normal file
398
lib/parsedate.c
Normal file
@@ -0,0 +1,398 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
* _ _ ____ _
|
||||||
|
* Project ___| | | | _ \| |
|
||||||
|
* / __| | | | |_) | |
|
||||||
|
* | (__| |_| | _ <| |___
|
||||||
|
* \___|\___/|_| \_\_____|
|
||||||
|
*
|
||||||
|
* Copyright (C) 1998 - 2004, 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$
|
||||||
|
***************************************************************************/
|
||||||
|
/*
|
||||||
|
A brief summary of the date string formats this parser groks:
|
||||||
|
|
||||||
|
RFC 2616 3.3.1
|
||||||
|
|
||||||
|
Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
|
||||||
|
Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
|
||||||
|
Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
|
||||||
|
|
||||||
|
we support dates without week day name:
|
||||||
|
|
||||||
|
06 Nov 1994 08:49:37 GMT
|
||||||
|
06-Nov-94 08:49:37 GMT
|
||||||
|
Nov 6 08:49:37 1994
|
||||||
|
|
||||||
|
without the time zone:
|
||||||
|
|
||||||
|
06 Nov 1994 08:49:37
|
||||||
|
06-Nov-94 08:49:37
|
||||||
|
|
||||||
|
weird order:
|
||||||
|
|
||||||
|
1994 Nov 6 08:49:37 (GNU date fails)
|
||||||
|
GMT 08:49:37 06-Nov-94 Sunday
|
||||||
|
94 6 Nov 08:49:37 (GNU date fails)
|
||||||
|
|
||||||
|
time left out:
|
||||||
|
|
||||||
|
1994 Nov 6
|
||||||
|
06-Nov-94
|
||||||
|
Sun Nov 6 94
|
||||||
|
|
||||||
|
unusual separators:
|
||||||
|
|
||||||
|
1994.Nov.6
|
||||||
|
Sun/Nov/6/94/GMT
|
||||||
|
|
||||||
|
commonly used time zone names:
|
||||||
|
|
||||||
|
Sun, 06 Nov 1994 08:49:37 CET
|
||||||
|
06 Nov 1994 08:49:37 EST
|
||||||
|
|
||||||
|
time zones specified using RFC822 style:
|
||||||
|
|
||||||
|
Sun, 12 Sep 2004 15:05:58 -0700
|
||||||
|
Sat, 11 Sep 2004 21:32:11 +0200
|
||||||
|
|
||||||
|
compact numerical date strings:
|
||||||
|
|
||||||
|
20040912 15:05:58 -0700
|
||||||
|
20040911 +0200
|
||||||
|
|
||||||
|
*/
|
||||||
|
#include "setup.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_STDLIB_H
|
||||||
|
#include <stdlib.h> /* for strtol() */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <curl/curl.h>
|
||||||
|
|
||||||
|
static time_t Curl_parsedate(const char *date);
|
||||||
|
|
||||||
|
static const char *wkday[] = {"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"};
|
||||||
|
static const char *weekday[] = { "Monday", "Tuesday", "Wednesday", "Thursday",
|
||||||
|
"Friday", "Saturday", "Sunday" };
|
||||||
|
static const char *month[]= { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
|
||||||
|
"Aug", "Sep", "Oct", "Nov", "Dec" };
|
||||||
|
|
||||||
|
struct tzinfo {
|
||||||
|
const char *name;
|
||||||
|
int offset; /* +/- in minutes */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Here's a bunch of frequently used time zone names. These were supported
|
||||||
|
by the old getdate parser. */
|
||||||
|
static const struct tzinfo tz[]= {
|
||||||
|
{"GMT", 0}, /* Greenwich Mean */
|
||||||
|
{"UTC", 0}, /* Universal (Coordinated) */
|
||||||
|
{"WET", 0}, /* Western European */
|
||||||
|
{"BST", 0}, /* British Summer */
|
||||||
|
{"WAT", 60}, /* West Africa */
|
||||||
|
{"AST", 240}, /* Atlantic Standard */
|
||||||
|
{"ADT", 240}, /* Atlantic Daylight */
|
||||||
|
{"EST", 300}, /* Eastern Standard */
|
||||||
|
{"EDT", 300}, /* Eastern Daylight */
|
||||||
|
{"CST", 360}, /* Central Standard */
|
||||||
|
{"CDT", 360}, /* Central Daylight */
|
||||||
|
{"MST", 420}, /* Mountain Standard */
|
||||||
|
{"MDT", 420}, /* Mountain Daylight */
|
||||||
|
{"PST", 480}, /* Pacific Standard */
|
||||||
|
{"PDT", 480}, /* Pacific Daylight */
|
||||||
|
{"YST", 540}, /* Yukon Standard */
|
||||||
|
{"YDT", 540}, /* Yukon Daylight */
|
||||||
|
{"HST", 600}, /* Hawaii Standard */
|
||||||
|
{"HDT", 600}, /* Hawaii Daylight */
|
||||||
|
{"CAT", 600}, /* Central Alaska */
|
||||||
|
{"AHST", 600}, /* Alaska-Hawaii Standard */
|
||||||
|
{"NT", 660}, /* Nome */
|
||||||
|
{"IDLW", 720}, /* International Date Line West */
|
||||||
|
{"CET", -60}, /* Central European */
|
||||||
|
{"MET", -60}, /* Middle European */
|
||||||
|
{"MEWT", -60}, /* Middle European Winter */
|
||||||
|
{"MEST", -120}, /* Middle European Summer */
|
||||||
|
{"CEST", -120}, /* Central European Summer */
|
||||||
|
{"MESZ", -60}, /* Middle European Summer */
|
||||||
|
{"FWT", -60}, /* French Winter */
|
||||||
|
{"FST", -60}, /* French Summer */
|
||||||
|
{"EET", -120}, /* Eastern Europe, USSR Zone 1 */
|
||||||
|
{"WAST", -420}, /* West Australian Standard */
|
||||||
|
{"WADT", -420}, /* West Australian Daylight */
|
||||||
|
{"CCT", -480}, /* China Coast, USSR Zone 7 */
|
||||||
|
{"JST", -540}, /* Japan Standard, USSR Zone 8 */
|
||||||
|
{"EAST", -600}, /* Eastern Australian Standard */
|
||||||
|
{"EADT", -600}, /* Eastern Australian Daylight */
|
||||||
|
{"GST", -600}, /* Guam Standard, USSR Zone 9 */
|
||||||
|
{"NZT", -720}, /* New Zealand */
|
||||||
|
{"NZST", -720}, /* New Zealand Standard */
|
||||||
|
{"NZDT", -720}, /* New Zealand Daylight */
|
||||||
|
{"IDLE", -720}, /* International Date Line East */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* returns:
|
||||||
|
-1 no day
|
||||||
|
0 monday - 6 sunday
|
||||||
|
*/
|
||||||
|
|
||||||
|
static int checkday(char *check, size_t len)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
const char **what;
|
||||||
|
bool found= FALSE;
|
||||||
|
if(len > 3)
|
||||||
|
what = &weekday[0];
|
||||||
|
else
|
||||||
|
what = &wkday[0];
|
||||||
|
for(i=0; i<7; i++) {
|
||||||
|
if(curl_strequal(check, what[0])) {
|
||||||
|
found=TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
what++;
|
||||||
|
}
|
||||||
|
return found?i:-1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int checkmonth(char *check)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
const char **what;
|
||||||
|
bool found= FALSE;
|
||||||
|
|
||||||
|
what = &month[0];
|
||||||
|
for(i=0; i<12; i++) {
|
||||||
|
if(curl_strequal(check, what[0])) {
|
||||||
|
found=TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
what++;
|
||||||
|
}
|
||||||
|
return found?i:-1; /* return the offset or -1, no real offset is -1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* return the time zone offset between GMT and the input one, in number
|
||||||
|
of seconds or -1 if the timezone wasn't found/legal */
|
||||||
|
|
||||||
|
static int checktz(char *check)
|
||||||
|
{
|
||||||
|
unsigned int i;
|
||||||
|
const struct tzinfo *what;
|
||||||
|
bool found= FALSE;
|
||||||
|
|
||||||
|
what = tz;
|
||||||
|
for(i=0; i< sizeof(tz)/sizeof(tz[0]); i++) {
|
||||||
|
if(curl_strequal(check, what->name)) {
|
||||||
|
found=TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
what++;
|
||||||
|
}
|
||||||
|
return found?what->offset*60:-1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void skip(const char **date)
|
||||||
|
{
|
||||||
|
/* skip everything that aren't letters or digits */
|
||||||
|
while(**date && !isalnum((int)**date))
|
||||||
|
(*date)++;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum assume {
|
||||||
|
DATE_MDAY,
|
||||||
|
DATE_YEAR,
|
||||||
|
DATE_TIME
|
||||||
|
};
|
||||||
|
|
||||||
|
static time_t Curl_parsedate(const char *date)
|
||||||
|
{
|
||||||
|
time_t t = 0;
|
||||||
|
int wdaynum=-1; /* day of the week number, 0-6 (mon-sun) */
|
||||||
|
int monnum=-1; /* month of the year number, 0-11 */
|
||||||
|
int mdaynum=-1; /* day of month, 1 - 31 */
|
||||||
|
int hournum=-1;
|
||||||
|
int minnum=-1;
|
||||||
|
int secnum=-1;
|
||||||
|
int yearnum=-1;
|
||||||
|
int tzoff=-1;
|
||||||
|
struct tm tm;
|
||||||
|
enum assume dignext = DATE_MDAY;
|
||||||
|
const char *indate = date; /* save the original pointer */
|
||||||
|
|
||||||
|
int part = 0; /* max 6 parts */
|
||||||
|
|
||||||
|
while(*date && (part < 6)) {
|
||||||
|
bool found=FALSE;
|
||||||
|
|
||||||
|
skip(&date);
|
||||||
|
|
||||||
|
if(isalpha((int)*date)) {
|
||||||
|
/* a name coming up */
|
||||||
|
char buf[32]="";
|
||||||
|
size_t len;
|
||||||
|
sscanf(date, "%31[A-Za-z]", buf);
|
||||||
|
len = strlen(buf);
|
||||||
|
|
||||||
|
if(wdaynum == -1) {
|
||||||
|
wdaynum = checkday(buf, len);
|
||||||
|
if(wdaynum != -1)
|
||||||
|
found = TRUE;
|
||||||
|
}
|
||||||
|
if(!found && (monnum == -1)) {
|
||||||
|
monnum = checkmonth(buf);
|
||||||
|
if(monnum != -1)
|
||||||
|
found = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!found && (tzoff == -1)) {
|
||||||
|
/* this just must be a time zone string */
|
||||||
|
tzoff = checktz(buf);
|
||||||
|
if(tzoff != -1)
|
||||||
|
found = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!found)
|
||||||
|
return -1; /* bad string */
|
||||||
|
|
||||||
|
date += len;
|
||||||
|
}
|
||||||
|
else if(isdigit((int)*date)) {
|
||||||
|
/* a digit */
|
||||||
|
int val;
|
||||||
|
char *end;
|
||||||
|
if((secnum == -1) &&
|
||||||
|
(3 == sscanf(date, "%02d:%02d:%02d", &hournum, &minnum, &secnum))) {
|
||||||
|
/* time stamp! */
|
||||||
|
date += 8;
|
||||||
|
found = TRUE;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
val = (int)strtol(date, &end, 10);
|
||||||
|
|
||||||
|
if((tzoff == -1) &&
|
||||||
|
((end - date) == 4) &&
|
||||||
|
(val < 1300) &&
|
||||||
|
(indate< date) &&
|
||||||
|
((date[-1] == '+' || date[-1] == '-'))) {
|
||||||
|
/* four digits and a value less than 1300 and it is preceeded with
|
||||||
|
a plus or minus. This is a time zone indication. */
|
||||||
|
found = TRUE;
|
||||||
|
tzoff = (val/100 * 60 + val%100)*60;
|
||||||
|
|
||||||
|
/* the + and - prefix indicates the local time compared to GMT,
|
||||||
|
this we need ther reversed math to get what we want */
|
||||||
|
tzoff = date[-1]=='+'?-tzoff:tzoff;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(((end - date) == 8) &&
|
||||||
|
(yearnum == -1) &&
|
||||||
|
(monnum == -1) &&
|
||||||
|
(mdaynum == -1)) {
|
||||||
|
/* 8 digits, no year, month or day yet. This is YYYYMMDD */
|
||||||
|
found = TRUE;
|
||||||
|
yearnum = val/10000;
|
||||||
|
monnum = (val%10000)/100-1; /* month is 0 - 11 */
|
||||||
|
mdaynum = val%100;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!found && (dignext == DATE_MDAY) && (mdaynum == -1)) {
|
||||||
|
if((val > 0) && (val<32)) {
|
||||||
|
mdaynum = val;
|
||||||
|
found = TRUE;
|
||||||
|
}
|
||||||
|
dignext = DATE_YEAR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!found && (dignext == DATE_YEAR) && (yearnum == -1)) {
|
||||||
|
yearnum = val;
|
||||||
|
found = TRUE;
|
||||||
|
if(yearnum < 1900) {
|
||||||
|
if (yearnum > 70)
|
||||||
|
yearnum += 1900;
|
||||||
|
else
|
||||||
|
yearnum += 2000;
|
||||||
|
}
|
||||||
|
if(mdaynum == -1)
|
||||||
|
dignext = DATE_MDAY;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!found)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
date = end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
part++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(-1 == secnum)
|
||||||
|
secnum = minnum = hournum = 0; /* no time, make it zero */
|
||||||
|
|
||||||
|
if((-1 == mdaynum) ||
|
||||||
|
(-1 == monnum) ||
|
||||||
|
(-1 == yearnum))
|
||||||
|
/* lacks vital info, fail */
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
tm.tm_sec = secnum;
|
||||||
|
tm.tm_min = minnum;
|
||||||
|
tm.tm_hour = hournum;
|
||||||
|
tm.tm_mday = mdaynum;
|
||||||
|
tm.tm_mon = monnum;
|
||||||
|
tm.tm_year = yearnum - 1900;
|
||||||
|
tm.tm_wday = 0;
|
||||||
|
tm.tm_yday = 0;
|
||||||
|
tm.tm_isdst = 0;
|
||||||
|
|
||||||
|
t = mktime(&tm);
|
||||||
|
|
||||||
|
/* time zone adjust */
|
||||||
|
{
|
||||||
|
struct tm *gmt;
|
||||||
|
long delta;
|
||||||
|
time_t t2;
|
||||||
|
|
||||||
|
#ifdef HAVE_GMTIME_R
|
||||||
|
/* thread-safe version */
|
||||||
|
struct tm keeptime2;
|
||||||
|
gmt = (struct tm *)gmtime_r(&t, &keeptime2);
|
||||||
|
#else
|
||||||
|
gmt = gmtime(&t); /* use gmtime_r() if available */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
t2 = mktime(gmt);
|
||||||
|
|
||||||
|
/* Add the time zone diff (between the given timezone and GMT) and the
|
||||||
|
diff between the local time zone and GMT. */
|
||||||
|
delta = (tzoff!=-1?tzoff:0) + (t - t2);
|
||||||
|
|
||||||
|
if((delta>0) && (t + delta < t))
|
||||||
|
return -1; /* time_t overflow */
|
||||||
|
|
||||||
|
t += delta;
|
||||||
|
}
|
||||||
|
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
time_t curl_getdate(const char *p, const time_t *now)
|
||||||
|
{
|
||||||
|
(void)now;
|
||||||
|
return Curl_parsedate(p);
|
||||||
|
}
|
@@ -328,7 +328,7 @@ int Curl_pgrsUpdate(struct connectdata *conn)
|
|||||||
curl_off_t amount = data->progress.speeder[nowindex]-
|
curl_off_t amount = data->progress.speeder[nowindex]-
|
||||||
data->progress.speeder[checkindex];
|
data->progress.speeder[checkindex];
|
||||||
|
|
||||||
if(amount > 0xffffffff/1000)
|
if(amount > 4294967 /* 0xffffffff/1000 */)
|
||||||
/* the 'amount' value is bigger than would fit in 32 bits if
|
/* the 'amount' value is bigger than would fit in 32 bits if
|
||||||
multiplied with 1000, so we use the double math for this */
|
multiplied with 1000, so we use the double math for this */
|
||||||
data->progress.current_speed = (curl_off_t)
|
data->progress.current_speed = (curl_off_t)
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user