Compare commits
206 Commits
curl-7_18_
...
curl-7_18_
Author | SHA1 | Date | |
---|---|---|---|
![]() |
323273382c | ||
![]() |
6f0a2608b4 | ||
![]() |
ea86edbd82 | ||
![]() |
e7b5a8e6cb | ||
![]() |
27eaf0cf02 | ||
![]() |
c84904d8c8 | ||
![]() |
01e1c85304 | ||
![]() |
4774582dfb | ||
![]() |
1ed09ff7a4 | ||
![]() |
d89cf27d65 | ||
![]() |
35d5ba2626 | ||
![]() |
e5f0c38fa9 | ||
![]() |
47925f3dd7 | ||
![]() |
82c5950c7e | ||
![]() |
1806879bb2 | ||
![]() |
998b046d70 | ||
![]() |
ec4f6e93c2 | ||
![]() |
b49dcfb52b | ||
![]() |
c62d55342d | ||
![]() |
f7815fa93c | ||
![]() |
6e305e11e3 | ||
![]() |
b97606f0b0 | ||
![]() |
f26154bfa9 | ||
![]() |
d220ac8582 | ||
![]() |
c57e748107 | ||
![]() |
d6f8f16068 | ||
![]() |
466429efb0 | ||
![]() |
89977c73d1 | ||
![]() |
a9a05a32bd | ||
![]() |
2045c79e37 | ||
![]() |
e60b5245d3 | ||
![]() |
90bbabce56 | ||
![]() |
ddfbe8b649 | ||
![]() |
d001f6a396 | ||
![]() |
d31da176eb | ||
![]() |
e664cd5826 | ||
![]() |
b8abeab6d3 | ||
![]() |
4aa176c127 | ||
![]() |
498e939f0e | ||
![]() |
9a22b893b6 | ||
![]() |
76d0d40946 | ||
![]() |
791ad1210e | ||
![]() |
100945694a | ||
![]() |
abe2e6ecf7 | ||
![]() |
d8efc99217 | ||
![]() |
0163b5b8be | ||
![]() |
baee3996ab | ||
![]() |
8ad1928d93 | ||
![]() |
24bf52bc69 | ||
![]() |
862049c490 | ||
![]() |
a8fc98aa30 | ||
![]() |
d70f33748c | ||
![]() |
b006c31b7b | ||
![]() |
ae45a462e0 | ||
![]() |
3cb0dd6685 | ||
![]() |
c2a84aa6f0 | ||
![]() |
9346e55d5a | ||
![]() |
8fc2f8ef62 | ||
![]() |
512b9ac194 | ||
![]() |
560a82aeaf | ||
![]() |
7358db5c27 | ||
![]() |
e059efda1b | ||
![]() |
164a985115 | ||
![]() |
ade57a781c | ||
![]() |
9f12ed83f2 | ||
![]() |
8aabd9839b | ||
![]() |
882fbb0433 | ||
![]() |
15eee5dbbb | ||
![]() |
cfc1d037ff | ||
![]() |
c24ed07596 | ||
![]() |
08aab6a620 | ||
![]() |
2748c64d60 | ||
![]() |
c4f1ab3cc5 | ||
![]() |
5e06ec8409 | ||
![]() |
04d0a84ae5 | ||
![]() |
c1dfe2c529 | ||
![]() |
7f88e8badb | ||
![]() |
2f66ff2e4f | ||
![]() |
76c251513e | ||
![]() |
80afddacc8 | ||
![]() |
7543c9df50 | ||
![]() |
83fb13329d | ||
![]() |
e06c923605 | ||
![]() |
ab1169895f | ||
![]() |
01e81c7e10 | ||
![]() |
7bf1142ae0 | ||
![]() |
af9f7a952b | ||
![]() |
514592b892 | ||
![]() |
d72efff878 | ||
![]() |
e4c60e2030 | ||
![]() |
ed80eb5b0f | ||
![]() |
60dd765b3d | ||
![]() |
b380dd030f | ||
![]() |
19479ea021 | ||
![]() |
d708ef6731 | ||
![]() |
d1238baecb | ||
![]() |
0510759bc4 | ||
![]() |
6d5cca5ed0 | ||
![]() |
e2b82b4325 | ||
![]() |
cf4570a06f | ||
![]() |
6df5dddd90 | ||
![]() |
d4e9b141db | ||
![]() |
ec0665a931 | ||
![]() |
836fa69e2e | ||
![]() |
9026dc2da4 | ||
![]() |
98c9af4c59 | ||
![]() |
e481d679b2 | ||
![]() |
eb68aa38e3 | ||
![]() |
082237e2b5 | ||
![]() |
dd08a7a4f6 | ||
![]() |
a60c9ef88e | ||
![]() |
4e3d235e04 | ||
![]() |
19da3606f9 | ||
![]() |
fc9e0d2249 | ||
![]() |
21a0f09081 | ||
![]() |
b84b71f524 | ||
![]() |
3d29bda9f8 | ||
![]() |
459c664043 | ||
![]() |
45edad84cb | ||
![]() |
fd31f7e7e5 | ||
![]() |
7b2531da24 | ||
![]() |
848a13654d | ||
![]() |
1cca8f5a30 | ||
![]() |
12ffcf0b45 | ||
![]() |
852989856d | ||
![]() |
7dfdbf8fbe | ||
![]() |
1eebb90030 | ||
![]() |
ab71654078 | ||
![]() |
7a6cff4b3a | ||
![]() |
c3ba2198b1 | ||
![]() |
ff748f1a41 | ||
![]() |
b8193b6321 | ||
![]() |
113d0937de | ||
![]() |
d0a506661f | ||
![]() |
4e71173928 | ||
![]() |
e0f0a2ccee | ||
![]() |
96edebf4d9 | ||
![]() |
3783b455c0 | ||
![]() |
7ee5238f5e | ||
![]() |
b398169567 | ||
![]() |
1960eebc2d | ||
![]() |
ad1dd08693 | ||
![]() |
95fd093c4a | ||
![]() |
ed1ad28e29 | ||
![]() |
7076505c24 | ||
![]() |
5825cf9457 | ||
![]() |
ff40415aee | ||
![]() |
f48eb36f75 | ||
![]() |
768e3e796e | ||
![]() |
3869d4a3a7 | ||
![]() |
a87c468c5c | ||
![]() |
7abf50a5c0 | ||
![]() |
d3f46eb61b | ||
![]() |
72c58b0d1d | ||
![]() |
6c89e1b311 | ||
![]() |
09777a4fc2 | ||
![]() |
0331071346 | ||
![]() |
614ae7b2bc | ||
![]() |
af41ada7aa | ||
![]() |
6a33a4456e | ||
![]() |
e0c2a39ad4 | ||
![]() |
cda1f2be58 | ||
![]() |
79e06c4147 | ||
![]() |
ead2618c31 | ||
![]() |
84eb9fee76 | ||
![]() |
79300cdcd9 | ||
![]() |
a9591ad1b7 | ||
![]() |
098106b54c | ||
![]() |
74bb59fa57 | ||
![]() |
c97d112b30 | ||
![]() |
2dc20b84c1 | ||
![]() |
39b689f966 | ||
![]() |
6fd3ff4032 | ||
![]() |
ab8d1464a7 | ||
![]() |
bf90d11a31 | ||
![]() |
a08b6ae813 | ||
![]() |
74c500b6ec | ||
![]() |
26aeadbc3e | ||
![]() |
d0a4b50e19 | ||
![]() |
ebaf06a741 | ||
![]() |
34d837c2dd | ||
![]() |
7607d5145b | ||
![]() |
12a90289ed | ||
![]() |
592697583d | ||
![]() |
b50a96982e | ||
![]() |
aa2a54c10a | ||
![]() |
532d4b5106 | ||
![]() |
5788719988 | ||
![]() |
ac0b911eda | ||
![]() |
10232bfe9e | ||
![]() |
a9c1ca9fc5 | ||
![]() |
d051dd8087 | ||
![]() |
bf52cef16f | ||
![]() |
16a9c5e02b | ||
![]() |
fef1a90938 | ||
![]() |
27870d48ff | ||
![]() |
2f66f3ce08 | ||
![]() |
369df58a0d | ||
![]() |
3d08b352a2 | ||
![]() |
d13be06aaa | ||
![]() |
f1c69192da | ||
![]() |
a2314225e0 | ||
![]() |
1e482fe6a8 | ||
![]() |
80e7f9b9de | ||
![]() |
d219269f1b | ||
![]() |
0ff0512aff |
242
CHANGES
242
CHANGES
@@ -6,6 +6,248 @@
|
|||||||
|
|
||||||
Changelog
|
Changelog
|
||||||
|
|
||||||
|
|
||||||
|
Version 7.18.2 (4 June 2008)
|
||||||
|
|
||||||
|
Daniel Fandrich (3 Jun 2008)
|
||||||
|
- Fixed a problem where telnet data would be lost if an EWOULDBLOCK
|
||||||
|
condition were encountered.
|
||||||
|
|
||||||
|
Marty Kuhrt (1 Jun 2008)
|
||||||
|
- Updated main.c to return CURLE_OK if PARAM_HELP_REQUESTED was returned
|
||||||
|
from getparameter instead of CURLE_FAILED_INIT. No point in returning
|
||||||
|
an error if --help or --version were requested.
|
||||||
|
|
||||||
|
Daniel Stenberg (28 May 2008)
|
||||||
|
- Emil Romanus found a problem and helped me repeat it. It occured when using
|
||||||
|
the curl_multi_socket() API with HTTP pipelining enabled and could lead to
|
||||||
|
the pipeline basically stalling for a very long period of time until it took
|
||||||
|
off again.
|
||||||
|
|
||||||
|
- Jeff Weber reported memory leaks with aborted SCP and SFTP transfers and
|
||||||
|
provided excellent repeat recipes. I fixed the cases I managed to reproduce
|
||||||
|
but Jeff still got some (SCP) problems even after these fixes:
|
||||||
|
http://curl.haxx.se/mail/lib-2008-05/0342.html
|
||||||
|
|
||||||
|
Daniel Stenberg (26 May 2008)
|
||||||
|
- Bug report #1973352 (http://curl.haxx.se/bug/view.cgi?id=1973352) identified
|
||||||
|
how the HTTP redirect following code didn't properly follow to a new URL if
|
||||||
|
the new url was but a query string such as "Location: ?moo=foo". Test case
|
||||||
|
1031 was added to verify this fix.
|
||||||
|
|
||||||
|
- Andreas Faerber and Scott McCreary made (lib)curl build for the Haiku OS.
|
||||||
|
|
||||||
|
Yang Tse (26 May 2008)
|
||||||
|
- David Rosenstrauch reported that header files spnegohelp.h and
|
||||||
|
openssl/objects.h were needed to compile SPNEGO support.
|
||||||
|
|
||||||
|
Daniel Fandrich (22 May 2008)
|
||||||
|
- Made sure to pass longs in to curl_easy_setopt where necessary in the
|
||||||
|
example programs and libtest code.
|
||||||
|
|
||||||
|
Daniel Stenberg (19 May 2008)
|
||||||
|
- When trying to repeat a multi interface problem I fell over a few multi
|
||||||
|
interface problems:
|
||||||
|
|
||||||
|
o with pipelining disabled, the state should never be set to WAITDO but
|
||||||
|
rather go straight to DO
|
||||||
|
|
||||||
|
o we had multiple states for which the internal function returned no socket
|
||||||
|
at all to wait for, with the effect that libcurl calls the socket callback
|
||||||
|
(when curl_multi_socket() is used) with REMOVE prematurely (as it would be
|
||||||
|
added again within very shortly)
|
||||||
|
|
||||||
|
o when in DO and DOING states, the HTTP and HTTPS protocol handler functions
|
||||||
|
didn't return that the socket should be waited for writing, but instead it
|
||||||
|
was treated as if no socket was needing monitoring so again REMOVE was
|
||||||
|
called prematurely.
|
||||||
|
|
||||||
|
Daniel Stenberg (13 May 2008)
|
||||||
|
- Added test case 556 that uses curl_easy_send() and curl_easy_recv()
|
||||||
|
|
||||||
|
Daniel Stenberg (9 May 2008)
|
||||||
|
- Introducing curl_easy_send() and curl_easy_recv(). They can be used to send
|
||||||
|
and receive data over a connection previously setup with curl_easy_perform()
|
||||||
|
and its CURLOPT_CONNECT_ONLY option. The sendrecv.c example was added to
|
||||||
|
show how they can be used.
|
||||||
|
|
||||||
|
Yang Tse (9 May 2008)
|
||||||
|
- Internal time differences now use monotonic time source if available.
|
||||||
|
This also implies the removal of the winmm.lib dependency for WIN32.
|
||||||
|
|
||||||
|
Daniel Stenberg (9 May 2008)
|
||||||
|
- Stefan Krause reported a busy-looping case when using the multi interface
|
||||||
|
and doing CONNECT to a proxy. The app would then busy-loop until the proxy
|
||||||
|
completed its response.
|
||||||
|
|
||||||
|
Michal Marek (9 May 2008)
|
||||||
|
- Make Curl_write and it's callees accept a const pointer, in preparation
|
||||||
|
of tetetest's patch for curl_easy_send()
|
||||||
|
|
||||||
|
Daniel Stenberg (7 May 2008)
|
||||||
|
- Liam Healy filed the debian bug report #480044
|
||||||
|
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=480044) identifying a
|
||||||
|
segfault when using krb5 ftp, but the krb4 code had the same problem.
|
||||||
|
|
||||||
|
Yang Tse (7 May 2008)
|
||||||
|
- Christopher Palow provided the patch (edited by me) that introduces the
|
||||||
|
use of microsecond resolution keys for internal splay trees.
|
||||||
|
|
||||||
|
Daniel Stenberg (4 May 2008)
|
||||||
|
- Yuriy Sosov pointed out a configure fix for detecting c-ares when that is
|
||||||
|
built debug-enabled.
|
||||||
|
|
||||||
|
Daniel Stenberg (3 May 2008)
|
||||||
|
- Ben Van Hof filed bug report #1945240: "libcurl sometimes sends body twice
|
||||||
|
when using CURL_AUTH_ANY" (http://curl.haxx.se/bug/view.cgi?id=1945240).
|
||||||
|
The problem was that when libcurl rewound a stream meant for upload when it
|
||||||
|
would prepare for a second request, it could accidentally continue the
|
||||||
|
sending of the rewound data on the first request instead of on the second.
|
||||||
|
Ben also provided test case 1030 that verifies this fix.
|
||||||
|
|
||||||
|
Daniel Stenberg (3 May 2008)
|
||||||
|
- Jean-Francois Bertrand reported a libcurl crash with CURLOPT_TCP_NODELAY
|
||||||
|
since libcurl used getprotobyname() and that isn't thread-safe. We now
|
||||||
|
switched to use IPPROTO_TCP unconditionally, but perhaps the proper fix is
|
||||||
|
to detect the thread-safe version of the function and use that.
|
||||||
|
http://curl.haxx.se/mail/lib-2008-05/0011.html
|
||||||
|
|
||||||
|
Daniel Stenberg (1 May 2008)
|
||||||
|
- Bart Whiteley provided a patch that made libcurl work properly when an app
|
||||||
|
uses the CURLOPT_OPENSOCKETFUNCTION callback to create a unix domain socket
|
||||||
|
to a http server.
|
||||||
|
|
||||||
|
Daniel Stenberg (29 Apr 2008)
|
||||||
|
- To make it easier for applications that want lots of magic stuff done on
|
||||||
|
redirections and thus cannot use CURLOPT_FOLLOWLOCATION easily, we now
|
||||||
|
introduce the new CURLINFO_REDIRECT_URL option that lets applications
|
||||||
|
extract the URL libcurl would've redirected to if it had been told to. This
|
||||||
|
then enables the application to continue to that URL as it thinks is
|
||||||
|
suitable, without having to re-implement the magic of creating the new URL
|
||||||
|
from the Location: header etc. Test 1029 verifies it.
|
||||||
|
|
||||||
|
Yang Tse (29 Apr 2008)
|
||||||
|
- Improved easy interface resolving timeout handling in c-ares enabled builds
|
||||||
|
|
||||||
|
Daniel Fandrich (28 Apr 2008)
|
||||||
|
- Added test 1028 to test an HTTP redirect to a FTP URL.
|
||||||
|
|
||||||
|
Daniel Stenberg (28 Apr 2008)
|
||||||
|
- Norbert Frese filed bug report #1951588: "Problem with curlftpfs and
|
||||||
|
libcurl" (http://curl.haxx.se/bug/view.cgi?id=1951588) which seems to be an
|
||||||
|
identical report to what Denis Golovan reported in
|
||||||
|
http://curl.haxx.se/mail/lib-2008-02/0108.html The FTP code didn't reset the
|
||||||
|
user/password pointers properly even though there might've been a new
|
||||||
|
struct/cconnection getting used.
|
||||||
|
|
||||||
|
Daniel Stenberg (26 Apr 2008)
|
||||||
|
- Reverted back to use automake 1.9.6 in the next release (from automake
|
||||||
|
1.10.1) since it *still* suffers from Solaris-related bugs. Our previous
|
||||||
|
automake 1.10 problem was reported in bug #1701360
|
||||||
|
(http://curl.haxx.se/bug/view.cgi?id=1701360) and this recent problem was
|
||||||
|
bug #1944825 (http://curl.haxx.se/bug/view.cgi?id=1944825). I have not
|
||||||
|
personally approached the automake team about either one of these but I
|
||||||
|
figure we need a Solaris 10 guy to do it!
|
||||||
|
|
||||||
|
Yang Tse (25 Apr 2008)
|
||||||
|
- Added 'timeout' and 'delay' attributes support for the test harness
|
||||||
|
<command> subsection.
|
||||||
|
|
||||||
|
Daniel Fandrich (24 Apr 2008)
|
||||||
|
- Made --stderr able to redirect all stderr messages.
|
||||||
|
|
||||||
|
Yang Tse (23 Apr 2008)
|
||||||
|
- Improve synchronization between test harness runtests.pl script
|
||||||
|
and test harness servers to minimize risk of false test failures.
|
||||||
|
|
||||||
|
Daniel Fandrich (22 Apr 2008)
|
||||||
|
- Added support for running on Symbian OS.
|
||||||
|
|
||||||
|
Daniel Fandrich (18 Apr 2008)
|
||||||
|
- Added test cases 1026 and 1027 to do some rudimentary tests on the --manual
|
||||||
|
and --help options.
|
||||||
|
|
||||||
|
Michal Marek (14 Apr 2008)
|
||||||
|
- allow disabling the typechecker by defining CURL_DISABLE_TYPECHECK, as
|
||||||
|
discussed in http://curl.haxx.se/mail/lib-2008-04/0291.html
|
||||||
|
|
||||||
|
Daniel Stenberg (14 Apr 2008)
|
||||||
|
- Stefan Krause reported a case where the OpenSSL handshake phase wasn't
|
||||||
|
properly acknowledging the timeout values, like if you pulled the network
|
||||||
|
plug in the midst of it.
|
||||||
|
|
||||||
|
- Andre Guibert de Bruet fixed a second case of not checking the malloc()
|
||||||
|
return code in the Negotiate code.
|
||||||
|
|
||||||
|
- Sandor Feldi reported bug #1942022
|
||||||
|
(http://curl.haxx.se/bug/view.cgi?id=1942022) pointing out a mistake in the
|
||||||
|
lib/Makefile.vc[68] makefiles' release-ssl-dll target.
|
||||||
|
|
||||||
|
- Brock Noland reported that curl behaved differently depending on which order
|
||||||
|
you used -i and -I.
|
||||||
|
|
||||||
|
Daniel Stenberg (12 Apr 2008)
|
||||||
|
- Andre Guibert de Bruet found and fixed a case where malloc() was called but
|
||||||
|
was not checked for a NULL return, in the Negotiate code.
|
||||||
|
|
||||||
|
Daniel Fandrich (9 Apr 2008)
|
||||||
|
- Added test cases 1024 & 1025 to test a scenario similar to the one reported
|
||||||
|
by Ben Combee where libcurl would send the wrong cookie to a redirected
|
||||||
|
server. libcurl was doing the right thing in these test cases.
|
||||||
|
|
||||||
|
Michal Marek (7 Apr 2008)
|
||||||
|
- Fix the MIT / Heimdal check for good:
|
||||||
|
Define HAVE_GSSMIT if <gssapi/{gssapi.h,gssapi_generic.h,gssapi_krb5.h}> are
|
||||||
|
available, otherwise define HAVE_GSSHEIMDAL if <gssapi.h> is available.
|
||||||
|
|
||||||
|
Only define GSS_C_NT_HOSTBASED_SERVICE to gss_nt_service_name if
|
||||||
|
GSS_C_NT_HOSTBASED_SERVICE isn't declared by the gssapi headers. This should
|
||||||
|
avoid breakage in case we wrongly recognize Heimdal as MIT again.
|
||||||
|
|
||||||
|
Daniel Stenberg (5 Apr 2008)
|
||||||
|
- Alexey Simak fixed curl_easy_reset() to reset the max redirect limit properly
|
||||||
|
|
||||||
|
- Based on the Debian bug report #474224 that complained about the FTP error
|
||||||
|
message when libcurl doesn't get a 220 back immediately on connect, I now
|
||||||
|
changed it to be more specific on what the problem is. Also worth noticing:
|
||||||
|
while the bug report contains an example where the response is:
|
||||||
|
|
||||||
|
421 There are too many connected users, please try again later
|
||||||
|
|
||||||
|
we cannot assume that the error message will always be this readable nor
|
||||||
|
that it fits within a particular boundary etc.
|
||||||
|
|
||||||
|
Daniel Fandrich (3 Apr 2008)
|
||||||
|
- Added test627 to test SFTP with CURLOPT_NOBODY
|
||||||
|
|
||||||
|
Daniel Stenberg (3 Apr 2008)
|
||||||
|
- Setting CURLOPT_NOBODY to FALSE will now switch the HTTP request method to
|
||||||
|
GET simply because previously when you set CURLOPT_NOBODY to TRUE first and
|
||||||
|
then FALSE you'd end up in a broken state where a HTTP request would do a
|
||||||
|
HEAD by still act a lot like for a GET and hang waiting for the content etc.
|
||||||
|
|
||||||
|
- Scott Barrett added support for CURLOPT_NOBODY over SFTP
|
||||||
|
|
||||||
|
Daniel Fandrich (3 Apr 2008)
|
||||||
|
- Made sure that curl_global_init is called in all the multithreaded
|
||||||
|
example programs.
|
||||||
|
|
||||||
|
Michal Marek (31 Mar 2008)
|
||||||
|
- Removed the generated ca-bundle.h file. The verbatim value of $ca and
|
||||||
|
$capath is known to configure, so it can be defined in config.h instead.
|
||||||
|
|
||||||
|
Daniel Stenberg (31 Mar 2008)
|
||||||
|
- Added CURLFORM_STREAM as a supported option to curl_formadd() to allow an
|
||||||
|
application to provide data for a multipart with the read callback. Note
|
||||||
|
that the size needs to be provided with CURLFORM_CONTENTSLENGTH when the
|
||||||
|
stream option is used. This feature is verified by the new test case
|
||||||
|
554. This feature was sponsored by Xponaut.
|
||||||
|
|
||||||
|
Daniel Fandrich (30 Mar 2008)
|
||||||
|
- Changed the makefile so the doc/examples/ programs are never built in a
|
||||||
|
normal build/install (only with the 'make check' target), so that a
|
||||||
|
build failure in the examples isn't fatal.
|
||||||
|
|
||||||
Version 7.18.1 (30 March 2008)
|
Version 7.18.1 (30 March 2008)
|
||||||
|
|
||||||
Daniel Stenberg (28 Mar 2008)
|
Daniel Stenberg (28 Mar 2008)
|
||||||
|
@@ -72,7 +72,7 @@ test-torture:
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
examples:
|
examples:
|
||||||
@(cd docs/examples; $(MAKE) all)
|
@(cd docs/examples; $(MAKE) check)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros
|
# Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros
|
||||||
|
@@ -1,59 +1,46 @@
|
|||||||
Curl and libcurl 7.18.1
|
Curl and libcurl 7.18.2
|
||||||
|
|
||||||
Public curl releases: 104
|
Public curl releases: 105
|
||||||
Command line options: 126
|
Command line options: 126
|
||||||
curl_easy_setopt() options: 150
|
curl_easy_setopt() options: 150
|
||||||
Public functions in libcurl: 56
|
Public functions in libcurl: 58
|
||||||
Public web site mirrors: 39
|
Public web site mirrors: 37
|
||||||
Known libcurl bindings: 36
|
Known libcurl bindings: 36
|
||||||
Contributors: 621
|
Contributors: 636
|
||||||
|
|
||||||
This release includes the following changes:
|
This release includes the following changes:
|
||||||
|
|
||||||
o added support for HttpOnly cookies
|
o CURLFORM_STREAM was added
|
||||||
o 'make ca-bundle' downloads and generates an updated ca bundle file
|
o CURLOPT_NOBODY is now supported over SFTP
|
||||||
o we no longer distribute or install a ca cert bundle
|
o curl can now run on Symbian OS
|
||||||
o SSLv2 is now disabled by default for SSL operations
|
o curl -w redirect_url and CURLINFO_REDIRECT_URL
|
||||||
o the test509-style setting URL in callback is officially no longer supported
|
o added curl_easy_send() and curl_easy_recv()
|
||||||
o support a full chain of certificates in a given PKCS12 certificate
|
|
||||||
o resumed transfers work with SFTP
|
|
||||||
o added type checking macros for curl_easy_setopt() and curl_easy_getinfo(),
|
|
||||||
watch out for new warnings in code using libcurl (needs gcc-4.3 and
|
|
||||||
currently only works in C mode)
|
|
||||||
o curl_easy_setopt(), curl_easy_getinfo(), curl_share_setopt() and
|
|
||||||
curl_multi_setopt() uses are now checked to use exactly three arguments
|
|
||||||
o --with-ca-path=DIR configure option allows to set an openSSL CApath instead
|
|
||||||
of a default ca bundle.
|
|
||||||
|
|
||||||
This release includes the following bugfixes:
|
This release includes the following bugfixes:
|
||||||
|
|
||||||
o improved pipelining
|
o CURLOPT_NOBODY first set to TRUE and then FALSE for HTTP no longer causes
|
||||||
o improved strdup replacement
|
the confusion that could lead to a hung transfer
|
||||||
o GnuTLS-built libcurl failed when doing global cleanup and reinit
|
o curl_easy_reset() resets the max redirect limit properly
|
||||||
o error message problem when unable to resolve a host on Windows
|
o configure now correctly recognizes Heimdal and MIT gssapi libraries
|
||||||
o Accept: header replacing
|
o malloc() failure check in Negotiate
|
||||||
o not verifying server certs with GnuTLS still failed if gnutls had
|
o -i and -I together now work the same no matter what order they're used
|
||||||
problems with the cert
|
o the typechecker can be bypassed by defining CURL_DISABLE_TYPECHECK
|
||||||
o when using the multi interface and a handle is removed while still having
|
o a pointer mixup could make the FTP code send bad user+password under rare
|
||||||
a transfer going on, the connection is now closed by force
|
circumstances (found when using curlftpfs)
|
||||||
o bad re-use of SSL connections in non-complete state
|
o CURLOPT_OPENSOCKETFUNCTION can now be used to create a unix domain socket
|
||||||
o test case 405 failures with GnuTLS builds
|
o CURLOPT_TCP_NODELAY crash due to getprotobyname() use
|
||||||
o crash when connection cache size is 1 and Curl_do() failed
|
o libcurl sometimes sent body twice when using CURLAUTH_ANY
|
||||||
o GnuTLS-built libcurl can now be forced to prefer SSLv3
|
o configure detecting debug-enabled c-ares
|
||||||
o crash when doing Negotiate again on a re-used connection
|
o microsecond resolution keys for internal splay trees
|
||||||
o select/poll regression
|
o krb4 and krb5 ftp segfault
|
||||||
o better MIT kerberos configure check
|
o multi interface busy loop for CONNECT requests
|
||||||
o curl_easy_reset() + SFTP re-used connection download crash
|
o internal time differences now use monotonic time source if available
|
||||||
o SFTP non-existing file + SFTP existing file error
|
o several curl_multi_socket() fixes
|
||||||
o sharing DNS cache between easy handles running in multiple threads could
|
o builds fine for Haiku OS
|
||||||
lead to crash
|
o follow redirect with only a new query string
|
||||||
o SFTP upload with CURLOPT_FTP_CREATE_MISSING_DIRS on re-used connection
|
o SCP and SFTP memory leaks on aborted transfers
|
||||||
o SFTP infinite loop when given an invalid quote command
|
o curl_multi_socket() and HTTP pipelining transfer stalls
|
||||||
o curl-config erroneously reported LDAPS support with missing LDAP libraries
|
o lost telnet data on an EWOULDBLOCK condition
|
||||||
o SCP infinite loop when downloading a zero byte file
|
|
||||||
o setting the CURLOPT_SSL_CTX_FUNCTION with libcurl built without OpenSSL
|
|
||||||
now makes curl_easy_setopt() properly return failure
|
|
||||||
o configure --with-libssh2 (with no given path)
|
|
||||||
|
|
||||||
This release includes the following known bugs:
|
This release includes the following known bugs:
|
||||||
|
|
||||||
@@ -61,19 +48,21 @@ This release includes the following known bugs:
|
|||||||
|
|
||||||
Other curl-related news:
|
Other curl-related news:
|
||||||
|
|
||||||
o
|
o pycurl 7.18.1 was released: http://pycurl.sf.net/
|
||||||
|
o brand new curl Haskell binding:
|
||||||
|
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/curl
|
||||||
|
|
||||||
New curl mirrors:
|
New curl mirrors:
|
||||||
|
|
||||||
o http://curl.cuendet.com/ is a new mirror in Atlanta, USA
|
o
|
||||||
|
|
||||||
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:
|
||||||
|
|
||||||
Michal Marek, Dmitry Kurochkin, Niklas Angebrand, G<>nter Knauf, Yang Tse,
|
Michal Marek, Daniel Fandrich, Scott Barrett, Alexey Simak, Daniel Black,
|
||||||
Dan Fandrich, Mike Hommey, Pooyan McSporran, Jerome Muffat-Meridol,
|
Rafa Muyo, Andre Guibert de Bruet, Brock Noland, Sandor Feldi, Stefan Krause,
|
||||||
Kaspar Brand, Gautam Kachroo, Zmey Petroff, Georg Lippitsch, Sam Listopad,
|
David Shaw, Norbert Frese, Bart Whiteley, Jean-Francois Bertrand, Ben Van Hof,
|
||||||
Anatoli Tubman, Mike Protts, Michael Calmer, Brian Ulm, Dmitry Popov,
|
Yuriy Sosov, Christopher Palow, Yang Tse, Liam Healy, Nikolai Kondrashov,
|
||||||
Jes Badwal, Dan Petitt, Stephen Collyer
|
David Rosenstrauch, Andreas Faerber, Scott McCreary, Jeff Weber, Emil Romanus
|
||||||
|
|
||||||
Thanks! (and sorry if I forgot to mention someone)
|
Thanks! (and sorry if I forgot to mention someone)
|
||||||
|
16
TODO-RELEASE
16
TODO-RELEASE
@@ -1,17 +1,17 @@
|
|||||||
To be addressed before 7.18.2 (planned release: June 2008)
|
To be addressed before 7.18.2 (planned release: June 2008)
|
||||||
=============================
|
=============================
|
||||||
|
|
||||||
128 - Phil Blundell's ares and ipv6 fix (feedback lacking)
|
To be addressed before 7.18.3 (planned release: August 2008)
|
||||||
|
=============================
|
||||||
|
|
||||||
129 - Pierre Reiss' libcurl + https + multi = lost information (awaiting
|
139 - Christopher Palow's CURLM_EASY_HANDLE_EXISTS patch
|
||||||
better example/clarification on how to figure out when the claimed
|
|
||||||
problem occurs)
|
|
||||||
|
|
||||||
130 - Vincent Le Normand's SFTP patch for touch
|
140 - Arnaud Ebalard and Axel Tillequin's CRL support and issuer check patches
|
||||||
|
|
||||||
131 - Scott Barrett's Support for CURLOPT_NOBODY with SFTP
|
141 - The sponsored feature CURLINFO_PRIMARY_IP that returns the IP address
|
||||||
|
as a string for the most recently used connection.
|
||||||
|
|
||||||
132 - Xponaut's CURLFORM_STREAM option to curl_formadd()
|
144 - Help apps use 64bit/LFS libcurl!
|
||||||
|
|
||||||
133 -
|
145 -
|
||||||
|
|
||||||
|
1319
acinclude.m4
1319
acinclude.m4
File diff suppressed because it is too large
Load Diff
@@ -21,3 +21,4 @@ depcomp
|
|||||||
libcares.la
|
libcares.la
|
||||||
missing
|
missing
|
||||||
ares_version.h.dist
|
ares_version.h.dist
|
||||||
|
libcares.pc
|
||||||
|
@@ -25,4 +25,10 @@ Vlad Dinulescu
|
|||||||
Brad House
|
Brad House
|
||||||
Shmulik Regev
|
Shmulik Regev
|
||||||
Ashish Sharma
|
Ashish Sharma
|
||||||
Brad Spencer
|
Steinar H. Gunderson
|
||||||
|
Robin Cornelius
|
||||||
|
Erik Kline
|
||||||
|
Alexey Simak
|
||||||
|
Eino Tuominen
|
||||||
|
Doug Goldstein
|
||||||
|
Sebastian at basti79.de
|
||||||
|
39
ares/CHANGES
39
ares/CHANGES
@@ -1,5 +1,44 @@
|
|||||||
Changelog for the c-ares project
|
Changelog for the c-ares project
|
||||||
|
|
||||||
|
* May 30 2008 (Yang Tse)
|
||||||
|
|
||||||
|
- Brad House fixed a missing header file inclusion in adig sample program.
|
||||||
|
|
||||||
|
Version 1.5.2 (May 29, 2008)
|
||||||
|
|
||||||
|
* May 13 2008 (Daniel Stenberg)
|
||||||
|
|
||||||
|
- Introducing millisecond resolution support for the timeout option. See
|
||||||
|
ares_init_options()'s ARES_OPT_TIMEOUTMS.
|
||||||
|
|
||||||
|
* May 9 2008 (Yang Tse)
|
||||||
|
|
||||||
|
- Use monotonic time source if available, for private function ares__tvnow()
|
||||||
|
|
||||||
|
* May 7 2008 (Daniel Stenberg)
|
||||||
|
|
||||||
|
- Sebastian made c-ares able to return all PTR-records when doing reverse
|
||||||
|
lookups. It is not common practice to have multiple PTR-Records for a single
|
||||||
|
IP, but its perfectly legal and some sites have those.
|
||||||
|
|
||||||
|
- Doug Goldstein provided a configure patch: updates autoconf 2.13 usage to
|
||||||
|
autoconf 2.57 usage (which is the version you have specified as the minimum
|
||||||
|
version). It's a minor change but it does clean up some warnings with newer
|
||||||
|
autoconf (specifically 2.62).
|
||||||
|
|
||||||
|
* May 5 2008 (Yang Tse)
|
||||||
|
|
||||||
|
- Improved parsing of resolver configuration files.
|
||||||
|
|
||||||
|
* April 4 2008 (Daniel Stenberg)
|
||||||
|
|
||||||
|
- Eino Tuominen improved the code when a file is used to seed the randomizer.
|
||||||
|
|
||||||
|
- Alexey Simak made adig support NAPTR records
|
||||||
|
|
||||||
|
- Alexey Simak fixed the VC dsp file by adding the missing source file
|
||||||
|
ares_expand_string.c
|
||||||
|
|
||||||
* December 11 2007 (Gisle Vanem)
|
* December 11 2007 (Gisle Vanem)
|
||||||
|
|
||||||
- Added another sample application; acountry.c which converts an
|
- Added another sample application; acountry.c which converts an
|
||||||
|
35
ares/FILES
35
ares/FILES
@@ -1,35 +0,0 @@
|
|||||||
*.c
|
|
||||||
*.h
|
|
||||||
*.3
|
|
||||||
NEWS
|
|
||||||
README
|
|
||||||
README.cares
|
|
||||||
CHANGES
|
|
||||||
FILES
|
|
||||||
maketgz
|
|
||||||
aclocal.m4
|
|
||||||
acinclude.m4
|
|
||||||
Makefile.in
|
|
||||||
Makefile.dj
|
|
||||||
Makefile.m32
|
|
||||||
Makefile.netware
|
|
||||||
Makefile.vc6
|
|
||||||
install-sh
|
|
||||||
mkinstalldirs
|
|
||||||
configure
|
|
||||||
configure.ac
|
|
||||||
config.guess
|
|
||||||
config.sub
|
|
||||||
vc/adig/adig.dep
|
|
||||||
vc/adig/adig.dsp
|
|
||||||
vc/adig/adig.mak
|
|
||||||
vc/adig/adig.plg
|
|
||||||
vc/vc.dsw
|
|
||||||
vc/ahost/ahost.dep
|
|
||||||
vc/ahost/ahost.dsp
|
|
||||||
vc/ahost/ahost.mak
|
|
||||||
vc/ahost/ahost.plg
|
|
||||||
vc/areslib/areslib.dep
|
|
||||||
vc/areslib/areslib.dsp
|
|
||||||
vc/areslib/areslib.mak
|
|
||||||
vc/areslib/areslib.plg
|
|
@@ -4,9 +4,8 @@ lib_LTLIBRARIES = libcares.la
|
|||||||
|
|
||||||
man_MANS = $(MANPAGES)
|
man_MANS = $(MANPAGES)
|
||||||
|
|
||||||
MSVCFILES = vc/adig/adig.dep vc/adig/adig.dsp vc/vc.dsw vc/ahost/ahost.dep \
|
MSVCFILES = vc/vc.dsw vc/acountry/acountry.dsp vc/adig/adig.dsp \
|
||||||
vc/ahost/ahost.dsp vc/areslib/areslib.dep vc/areslib/areslib.dsp \
|
vc/ahost/ahost.dsp vc/areslib/areslib.dsp vc/areslib/areslib.dsw
|
||||||
vc/areslib/areslib.dsw
|
|
||||||
|
|
||||||
if DEBUGBUILD
|
if DEBUGBUILD
|
||||||
PROGS =
|
PROGS =
|
||||||
@@ -18,9 +17,9 @@ noinst_PROGRAMS =$(PROGS)
|
|||||||
|
|
||||||
# adig and ahost are just sample programs and thus not mentioned with the
|
# adig and ahost are just sample programs and thus not mentioned with the
|
||||||
# regular sources and headers
|
# regular sources and headers
|
||||||
EXTRA_DIST = AUTHORS CHANGES README.cares Makefile.inc Makefile.dj \
|
EXTRA_DIST = AUTHORS CHANGES README.cares Makefile.inc Makefile.dj \
|
||||||
Makefile.m32 Makefile.netware Makefile.vc6 adig.c ahost.c $(man_MANS) \
|
Makefile.m32 Makefile.netware Makefile.vc6 $(man_MANS) $(MSVCFILES) \
|
||||||
$(MSVCFILES) config-win32.h RELEASE-NOTES libcares.pc.in
|
config-win32.h RELEASE-NOTES libcares.pc.in buildconf get_ver.awk maketgz
|
||||||
|
|
||||||
pkgconfigdir = $(libdir)/pkgconfig
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
pkgconfig_DATA = libcares.pc
|
pkgconfig_DATA = libcares.pc
|
||||||
@@ -72,13 +71,13 @@ libcares_ladir = $(includedir)
|
|||||||
# what headers to install on 'make install':
|
# what headers to install on 'make install':
|
||||||
libcares_la_HEADERS = ares.h ares_version.h ares_dns.h
|
libcares_la_HEADERS = ares.h ares_version.h ares_dns.h
|
||||||
|
|
||||||
ahost_SOURCES = ahost.c ares_getopt.c
|
ahost_SOURCES = ahost.c ares_getopt.c ares_getopt.h
|
||||||
ahost_LDADD = $(top_builddir)/$(lib_LTLIBRARIES)
|
ahost_LDADD = $(top_builddir)/$(lib_LTLIBRARIES)
|
||||||
|
|
||||||
adig_SOURCES = adig.c ares_getopt.c
|
adig_SOURCES = adig.c ares_getopt.c ares_getopt.h
|
||||||
adig_LDADD = $(top_builddir)/$(lib_LTLIBRARIES)
|
adig_LDADD = $(top_builddir)/$(lib_LTLIBRARIES)
|
||||||
|
|
||||||
acountry_SOURCES = acountry.c ares_getopt.c
|
acountry_SOURCES = acountry.c ares_getopt.c ares_getopt.h
|
||||||
acountry_LDADD = $(top_builddir)/$(lib_LTLIBRARIES)
|
acountry_LDADD = $(top_builddir)/$(lib_LTLIBRARIES)
|
||||||
|
|
||||||
# Make files named *.dist replace the file without .dist extension
|
# Make files named *.dist replace the file without .dist extension
|
||||||
|
@@ -10,12 +10,13 @@ include ../packages/DOS/common.dj
|
|||||||
|
|
||||||
include Makefile.inc
|
include Makefile.inc
|
||||||
|
|
||||||
CFLAGS += -DWATT32 -DHAVE_AF_INET6 -DHAVE_PF_INET6 -DHAVE_FIONBIO \
|
CFLAGS += -DWATT32 -DHAVE_AF_INET6 -DHAVE_PF_INET6 -DHAVE_IOCTLSOCKET \
|
||||||
-DHAVE_STRUCT_IN6_ADDR -DHAVE_SOCKADDR_IN6_SIN6_SCOPE_ID \
|
-DHAVE_STRUCT_IN6_ADDR -DHAVE_SOCKADDR_IN6_SIN6_SCOPE_ID \
|
||||||
-DHAVE_SYS_TIME_H -DHAVE_STRUCT_SOCKADDR_IN6 -DHAVE_STRUCT_ADDRINFO \
|
-DHAVE_SYS_TIME_H -DHAVE_STRUCT_SOCKADDR_IN6 -DHAVE_STRUCT_ADDRINFO \
|
||||||
-DHAVE_SIGNAL_H -DHAVE_SIG_ATOMIC_T -DRETSIGTYPE='void' -DHAVE_PROCESS_H \
|
-DHAVE_SIGNAL_H -DHAVE_SIG_ATOMIC_T -DRETSIGTYPE='void' \
|
||||||
-DHAVE_ARPA_NAMESER_H -DHAVE_SYS_SOCKET_H -DHAVE_SYS_UIO_H -DHAVE_NETINET_IN_H \
|
-DHAVE_PROCESS_H -DHAVE_ARPA_NAMESER_H -DHAVE_SYS_SOCKET_H \
|
||||||
-DHAVE_NETINET_TCP_H -DNS_INADDRSZ=4 -DHAVE_RECV -DHAVE_SEND \
|
-DHAVE_SYS_UIO_H -DHAVE_NETINET_IN_H -DHAVE_NETINET_TCP_H \
|
||||||
|
-DNS_INADDRSZ=4 -DHAVE_RECV -DHAVE_SEND -DHAVE_GETTIMEOFDAY \
|
||||||
-DSEND_TYPE_ARG1='int' -DSEND_QUAL_ARG2='const' \
|
-DSEND_TYPE_ARG1='int' -DSEND_QUAL_ARG2='const' \
|
||||||
-DSEND_TYPE_ARG2='void*' -DSEND_TYPE_ARG3='int' \
|
-DSEND_TYPE_ARG2='void*' -DSEND_TYPE_ARG3='int' \
|
||||||
-DSEND_TYPE_ARG4='int' -DSEND_TYPE_RETV='int' \
|
-DSEND_TYPE_ARG4='int' -DSEND_TYPE_RETV='int' \
|
||||||
|
@@ -6,7 +6,7 @@ ares_timeout.c ares_destroy.c ares_mkquery.c ares_version.c \
|
|||||||
ares_expand_name.c ares_parse_a_reply.c windows_port.c \
|
ares_expand_name.c ares_parse_a_reply.c windows_port.c \
|
||||||
ares_expand_string.c ares_parse_ptr_reply.c ares_parse_aaaa_reply.c \
|
ares_expand_string.c ares_parse_ptr_reply.c ares_parse_aaaa_reply.c \
|
||||||
ares_getnameinfo.c inet_net_pton.c bitncmp.c inet_ntop.c \
|
ares_getnameinfo.c inet_net_pton.c bitncmp.c inet_ntop.c \
|
||||||
ares_parse_ns_reply.c ares_llist.c
|
ares_parse_ns_reply.c ares_llist.c ares__timeval.c
|
||||||
|
|
||||||
HHEADERS = ares.h ares_private.h setup.h ares_dns.h ares_version.h \
|
HHEADERS = ares.h ares_private.h setup.h ares_dns.h ares_version.h \
|
||||||
nameser.h inet_net_pton.h inet_ntop.h ares_ipv6.h bitncmp.h \
|
nameser.h inet_net_pton.h inet_ntop.h ares_ipv6.h bitncmp.h \
|
||||||
|
@@ -62,6 +62,7 @@ OBJECTS = $(OBJ_DIR)\ares_fds.obj \
|
|||||||
$(OBJ_DIR)\ares_init.obj \
|
$(OBJ_DIR)\ares_init.obj \
|
||||||
$(OBJ_DIR)\ares_llist.obj \
|
$(OBJ_DIR)\ares_llist.obj \
|
||||||
$(OBJ_DIR)\ares_timeout.obj \
|
$(OBJ_DIR)\ares_timeout.obj \
|
||||||
|
$(OBJ_DIR)\ares__timeval.obj \
|
||||||
$(OBJ_DIR)\ares_destroy.obj \
|
$(OBJ_DIR)\ares_destroy.obj \
|
||||||
$(OBJ_DIR)\ares_mkquery.obj \
|
$(OBJ_DIR)\ares_mkquery.obj \
|
||||||
$(OBJ_DIR)\ares_version.obj \
|
$(OBJ_DIR)\ares_version.obj \
|
||||||
@@ -122,7 +123,6 @@ $(DEF_FILE): $(OBJECTS) Makefile.VC6
|
|||||||
@echo ares_inet_pton >> $@
|
@echo ares_inet_pton >> $@
|
||||||
@echo ares_writev >> $@
|
@echo ares_writev >> $@
|
||||||
@echo ares_getnameinfo >> $@
|
@echo ares_getnameinfo >> $@
|
||||||
@echo ares_gettimeofday >> $@
|
|
||||||
@echo ares_parse_aaaa_reply >> $@
|
@echo ares_parse_aaaa_reply >> $@
|
||||||
|
|
||||||
ahost.exe: $(OBJ_DIR) $(OBJ_DIR)\ahost.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib
|
ahost.exe: $(OBJ_DIR) $(OBJ_DIR)\ahost.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib
|
||||||
@@ -138,7 +138,8 @@ clean:
|
|||||||
- del $(OBJ_DIR)\*.obj *.ilk *.pdb *.pbt *.pbi *.pbo *._xe *.map
|
- del $(OBJ_DIR)\*.obj *.ilk *.pdb *.pbt *.pbi *.pbo *._xe *.map
|
||||||
|
|
||||||
vclean realclean: clean
|
vclean realclean: clean
|
||||||
- del $(DEF_FILE) cares.lib cares_imp.* cares.dll ahost.exe adig.exe
|
- del $(DEF_FILE) cares.lib cares_imp.* cares.dll
|
||||||
|
- del ahost.exe adig.exe acountry.exe
|
||||||
- rd $(OBJ_DIR)
|
- rd $(OBJ_DIR)
|
||||||
|
|
||||||
.c{$(OBJ_DIR)}.obj:
|
.c{$(OBJ_DIR)}.obj:
|
||||||
@@ -193,6 +194,9 @@ $(OBJ_DIR)\ares_init.obj: ares_init.c setup.h setup_once.h nameser.h ares.h \
|
|||||||
$(OBJ_DIR)\ares_timeout.obj: ares_timeout.c setup.h setup_once.h ares.h \
|
$(OBJ_DIR)\ares_timeout.obj: ares_timeout.c setup.h setup_once.h ares.h \
|
||||||
ares_private.h ares_ipv6.h
|
ares_private.h ares_ipv6.h
|
||||||
|
|
||||||
|
$(OBJ_DIR)\ares__timeval.obj: ares__timeval.c setup.h setup_once.h ares.h \
|
||||||
|
ares_private.h ares_ipv6.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_destroy.obj: ares_destroy.c setup.h setup_once.h ares.h \
|
$(OBJ_DIR)\ares_destroy.obj: ares_destroy.c setup.h setup_once.h ares.h \
|
||||||
ares_private.h ares_ipv6.h
|
ares_private.h ares_ipv6.h
|
||||||
|
|
||||||
|
@@ -1,9 +1,10 @@
|
|||||||
This is what's new and changed in the c-ares 1.5.2 release:
|
This is what's new and changed in the c-ares 1.5.3 release:
|
||||||
|
|
||||||
o
|
o adig sample application compilation failure on some systems
|
||||||
|
|
||||||
Thanks go to these friendly people for their efforts and contributions:
|
Thanks go to these friendly people for their efforts and contributions:
|
||||||
|
|
||||||
|
Brad House
|
||||||
|
and obviously Daniel Stenberg
|
||||||
|
|
||||||
Have fun!
|
Have fun!
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -43,6 +43,9 @@
|
|||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
#include <strings.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
|
44
ares/adig.c
44
ares/adig.c
@@ -27,11 +27,17 @@
|
|||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <arpa/nameser.h>
|
#include <arpa/nameser.h>
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||||
|
#include <arpa/nameser_compat.h>
|
||||||
|
#endif
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
#include <strings.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -110,6 +116,7 @@ static const struct nv types[] = {
|
|||||||
{ "AXFR", T_AXFR },
|
{ "AXFR", T_AXFR },
|
||||||
{ "MAILB", T_MAILB },
|
{ "MAILB", T_MAILB },
|
||||||
{ "MAILA", T_MAILA },
|
{ "MAILA", T_MAILA },
|
||||||
|
{ "NAPTR", T_NAPTR },
|
||||||
{ "ANY", T_ANY }
|
{ "ANY", T_ANY }
|
||||||
};
|
};
|
||||||
static const int ntypes = sizeof(types) / sizeof(types[0]);
|
static const int ntypes = sizeof(types) / sizeof(types[0]);
|
||||||
@@ -303,6 +310,8 @@ static void callback(void *arg, int status, int timeouts,
|
|||||||
unsigned int qdcount, ancount, nscount, arcount, i;
|
unsigned int qdcount, ancount, nscount, arcount, i;
|
||||||
const unsigned char *aptr;
|
const unsigned char *aptr;
|
||||||
|
|
||||||
|
(void) timeouts;
|
||||||
|
|
||||||
/* Display the query name if given. */
|
/* Display the query name if given. */
|
||||||
if (name)
|
if (name)
|
||||||
printf("Answer for query %s:\n", name);
|
printf("Answer for query %s:\n", name);
|
||||||
@@ -603,6 +612,41 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
|||||||
ares_free_string(name);
|
ares_free_string(name);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case T_NAPTR:
|
||||||
|
|
||||||
|
printf("\t%d", DNS__16BIT(aptr)); /* order */
|
||||||
|
printf(" %d\n", DNS__16BIT(aptr + 2)); /* preference */
|
||||||
|
|
||||||
|
p = aptr + 4;
|
||||||
|
status = ares_expand_string(p, abuf, alen, (unsigned char **)&name, &len);
|
||||||
|
if (status != ARES_SUCCESS)
|
||||||
|
return NULL;
|
||||||
|
printf("\t\t\t\t\t\t%s\n", name);
|
||||||
|
ares_free_string(name);
|
||||||
|
p += len;
|
||||||
|
|
||||||
|
status = ares_expand_string(p, abuf, alen, (unsigned char **)&name, &len);
|
||||||
|
if (status != ARES_SUCCESS)
|
||||||
|
return NULL;
|
||||||
|
printf("\t\t\t\t\t\t%s\n", name);
|
||||||
|
ares_free_string(name);
|
||||||
|
p += len;
|
||||||
|
|
||||||
|
status = ares_expand_string(p, abuf, alen, (unsigned char **)&name, &len);
|
||||||
|
if (status != ARES_SUCCESS)
|
||||||
|
return NULL;
|
||||||
|
printf("\t\t\t\t\t\t%s\n", name);
|
||||||
|
ares_free_string(name);
|
||||||
|
p += len;
|
||||||
|
|
||||||
|
status = ares_expand_string(p, abuf, alen, (unsigned char **)&name, &len);
|
||||||
|
if (status != ARES_SUCCESS)
|
||||||
|
return NULL;
|
||||||
|
printf("\t\t\t\t\t\t%s", name);
|
||||||
|
ares_free_string(name);
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
printf("\t[Unknown RR; cannot parse]");
|
printf("\t[Unknown RR; cannot parse]");
|
||||||
break;
|
break;
|
||||||
|
@@ -29,6 +29,9 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
#include <strings.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -139,6 +142,8 @@ static void callback(void *arg, int status, int timeouts, struct hostent *host)
|
|||||||
{
|
{
|
||||||
char **p;
|
char **p;
|
||||||
|
|
||||||
|
(void)timeouts;
|
||||||
|
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s: %s\n", (char *) arg, ares_strerror(status));
|
fprintf(stderr, "%s: %s\n", (char *) arg, ares_strerror(status));
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
* Copyright (C) 2007 by Daniel Stenberg
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this
|
* Permission to use, copy, modify, and distribute this
|
||||||
* software and its documentation for any purpose and without
|
* software and its documentation for any purpose and without
|
||||||
@@ -112,6 +113,7 @@ extern "C" {
|
|||||||
#define ARES_OPT_SORTLIST (1 << 10)
|
#define ARES_OPT_SORTLIST (1 << 10)
|
||||||
#define ARES_OPT_SOCK_SNDBUF (1 << 11)
|
#define ARES_OPT_SOCK_SNDBUF (1 << 11)
|
||||||
#define ARES_OPT_SOCK_RCVBUF (1 << 12)
|
#define ARES_OPT_SOCK_RCVBUF (1 << 12)
|
||||||
|
#define ARES_OPT_TIMEOUTMS (1 << 13)
|
||||||
|
|
||||||
/* Nameinfo flag values */
|
/* Nameinfo flag values */
|
||||||
#define ARES_NI_NOFQDN (1 << 0)
|
#define ARES_NI_NOFQDN (1 << 0)
|
||||||
@@ -179,7 +181,7 @@ struct apattern;
|
|||||||
|
|
||||||
struct ares_options {
|
struct ares_options {
|
||||||
int flags;
|
int flags;
|
||||||
int timeout;
|
int timeout; /* in seconds or milliseconds, depending on options */
|
||||||
int tries;
|
int tries;
|
||||||
int ndots;
|
int ndots;
|
||||||
unsigned short udp_port;
|
unsigned short udp_port;
|
||||||
|
97
ares/ares__timeval.c
Normal file
97
ares/ares__timeval.c
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* Copyright (C) 2008 by Daniel Stenberg et al
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this software and its
|
||||||
|
* documentation for any purpose and without fee is hereby granted, provided
|
||||||
|
* that the above copyright notice appear in all copies and that both that
|
||||||
|
* copyright notice and this permission notice appear in supporting
|
||||||
|
* documentation, and that the name of M.I.T. not be used in advertising or
|
||||||
|
* publicity pertaining to distribution of the software without specific,
|
||||||
|
* written prior permission. M.I.T. makes no representations about the
|
||||||
|
* suitability of this software for any purpose. It is provided "as is"
|
||||||
|
* without express or implied warranty.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "setup.h"
|
||||||
|
#include "ares.h"
|
||||||
|
#include "ares_private.h"
|
||||||
|
|
||||||
|
#if defined(WIN32) && !defined(MSDOS)
|
||||||
|
|
||||||
|
struct timeval ares__tvnow(void)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
** GetTickCount() is available on _all_ Windows versions from W95 up
|
||||||
|
** to nowadays. Returns milliseconds elapsed since last system boot,
|
||||||
|
** increases monotonically and wraps once 49.7 days have elapsed.
|
||||||
|
*/
|
||||||
|
struct timeval now;
|
||||||
|
DWORD milliseconds = GetTickCount();
|
||||||
|
now.tv_sec = milliseconds / 1000;
|
||||||
|
now.tv_usec = (milliseconds % 1000) * 1000;
|
||||||
|
return now;
|
||||||
|
}
|
||||||
|
|
||||||
|
#elif defined(HAVE_CLOCK_GETTIME_MONOTONIC)
|
||||||
|
|
||||||
|
struct timeval ares__tvnow(void)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
** clock_gettime() is granted to be increased monotonically when the
|
||||||
|
** monotonic clock is queried. Time starting point is unspecified, it
|
||||||
|
** could be the system start-up time, the Epoch, or something else,
|
||||||
|
** in any case the time starting point does not change once that the
|
||||||
|
** system has started up.
|
||||||
|
*/
|
||||||
|
struct timeval now;
|
||||||
|
struct timespec tsnow;
|
||||||
|
(void)clock_gettime(CLOCK_MONOTONIC, &tsnow);
|
||||||
|
now.tv_sec = tsnow.tv_sec;
|
||||||
|
now.tv_usec = tsnow.tv_nsec / 1000;
|
||||||
|
return now;
|
||||||
|
}
|
||||||
|
|
||||||
|
#elif defined(HAVE_GETTIMEOFDAY)
|
||||||
|
|
||||||
|
struct timeval ares__tvnow(void)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
** gettimeofday() is not granted to be increased monotonically, due to
|
||||||
|
** clock drifting and external source time synchronization it can jump
|
||||||
|
** forward or backward in time.
|
||||||
|
*/
|
||||||
|
struct timeval now;
|
||||||
|
(void)gettimeofday(&now, NULL);
|
||||||
|
return now;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
struct timeval ares__tvnow(void)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
** time() returns the value of time in seconds since the Epoch.
|
||||||
|
*/
|
||||||
|
struct timeval now;
|
||||||
|
now.tv_sec = (long)time(NULL);
|
||||||
|
now.tv_usec = 0;
|
||||||
|
return now;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if 0 /* Not used */
|
||||||
|
/*
|
||||||
|
* Make sure that the first argument is the more recent time, as otherwise
|
||||||
|
* we'll get a weird negative time-diff back...
|
||||||
|
*
|
||||||
|
* Returns: the time difference in number of milliseconds.
|
||||||
|
*/
|
||||||
|
long ares__tvdiff(struct timeval newer, struct timeval older)
|
||||||
|
{
|
||||||
|
return (newer.tv_sec-older.tv_sec)*1000+
|
||||||
|
(newer.tv_usec-older.tv_usec)/1000;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
@@ -36,6 +36,9 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
#include <strings.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "ares_private.h"
|
#include "ares_private.h"
|
||||||
@@ -159,7 +162,7 @@ static void host_callback(void *arg, int status, int timeouts,
|
|||||||
{
|
{
|
||||||
struct host_query *hquery = (struct host_query *) arg;
|
struct host_query *hquery = (struct host_query *) arg;
|
||||||
ares_channel channel = hquery->channel;
|
ares_channel channel = hquery->channel;
|
||||||
struct hostent *host;
|
struct hostent *host = NULL;
|
||||||
|
|
||||||
hquery->timeouts += timeouts;
|
hquery->timeouts += timeouts;
|
||||||
if (status == ARES_SUCCESS)
|
if (status == ARES_SUCCESS)
|
||||||
|
@@ -82,7 +82,7 @@ ares_getopt(int nargc, char * const nargv[], const char *ostr)
|
|||||||
}
|
}
|
||||||
} /* option letter okay? */
|
} /* option letter okay? */
|
||||||
if ((optopt = (int)*place++) == (int)':' ||
|
if ((optopt = (int)*place++) == (int)':' ||
|
||||||
!(oli = strchr(ostr, optopt))) {
|
(oli = strchr(ostr, optopt)) == NULL) {
|
||||||
/*
|
/*
|
||||||
* if the user didn't specify '-' as an option,
|
* if the user didn't specify '-' as an option,
|
||||||
* assume it means EOF.
|
* assume it means EOF.
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
.\" $Id$
|
.\" $Id$
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright 1998 by the Massachusetts Institute of Technology.
|
.\" Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
.\" Copyright (C) 2007-2008 by Daniel Stenberg
|
||||||
.\"
|
.\"
|
||||||
.\" Permission to use, copy, modify, and distribute this
|
.\" Permission to use, copy, modify, and distribute this
|
||||||
.\" software and its documentation for any purpose and without
|
.\" software and its documentation for any purpose and without
|
||||||
@@ -14,7 +15,7 @@
|
|||||||
.\" this software for any purpose. It is provided "as is"
|
.\" this software for any purpose. It is provided "as is"
|
||||||
.\" without express or implied warranty.
|
.\" without express or implied warranty.
|
||||||
.\"
|
.\"
|
||||||
.TH ARES_INIT 3 "7 December 2004"
|
.TH ARES_INIT 3 "13 May 2008"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
ares_init, ares_init_options \- Initialize a resolver channel
|
ares_init, ares_init_options \- Initialize a resolver channel
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@@ -49,10 +50,22 @@ description of possible flag values.
|
|||||||
.B ARES_OPT_TIMEOUT
|
.B ARES_OPT_TIMEOUT
|
||||||
.B int \fItimeout\fP;
|
.B int \fItimeout\fP;
|
||||||
.br
|
.br
|
||||||
The number of seconds each name server is given to respond to a query
|
The number of seconds each name server is given to respond to a query on the
|
||||||
on the first try. (After the first try, the timeout algorithm becomes
|
first try. (After the first try, the timeout algorithm becomes more
|
||||||
more complicated, but scales linearly with the value of
|
complicated, but scales linearly with the value of \fItimeout\fP.) The
|
||||||
\fItimeout\fP.) The default is five seconds.
|
default is five seconds. This option is being deprecated by
|
||||||
|
\fIARES_OPT_TIMEOUTMS\fP starting in c-ares 1.5.2.
|
||||||
|
.TP 18
|
||||||
|
.B ARES_OPT_TIMEOUTMS
|
||||||
|
.B int \fItimeout\fP;
|
||||||
|
.br
|
||||||
|
The number of milliseconds each name server is given to respond to a query on
|
||||||
|
the first try. (After the first try, the timeout algorithm becomes more
|
||||||
|
complicated, but scales linearly with the value of \fItimeout\fP.) The
|
||||||
|
default is five seconds. Note that this option is specified with the same
|
||||||
|
struct field as the former \fIARES_OPT_TIMEOUT\fP, it is but the option bits
|
||||||
|
that tell c-ares how to interpret the number. This option was added in c-ares
|
||||||
|
1.5.2.
|
||||||
.TP 18
|
.TP 18
|
||||||
.B ARES_OPT_TRIES
|
.B ARES_OPT_TRIES
|
||||||
.B int \fItries\fP;
|
.B int \fItries\fP;
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
* Copyright (C) 2007-2008 by Daniel Stenberg
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this
|
* Permission to use, copy, modify, and distribute this
|
||||||
* software and its documentation for any purpose and without
|
* software and its documentation for any purpose and without
|
||||||
@@ -107,6 +108,7 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
|||||||
int i;
|
int i;
|
||||||
int status = ARES_SUCCESS;
|
int status = ARES_SUCCESS;
|
||||||
struct server_state *server;
|
struct server_state *server;
|
||||||
|
struct timeval now;
|
||||||
|
|
||||||
#ifdef CURLDEBUG
|
#ifdef CURLDEBUG
|
||||||
const char *env = getenv("CARES_MEMDEBUG");
|
const char *env = getenv("CARES_MEMDEBUG");
|
||||||
@@ -124,6 +126,8 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
|||||||
return ARES_ENOMEM;
|
return ARES_ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
now = ares__tvnow();
|
||||||
|
|
||||||
/* Set everything to distinguished values so we know they haven't
|
/* Set everything to distinguished values so we know they haven't
|
||||||
* been set yet.
|
* been set yet.
|
||||||
*/
|
*/
|
||||||
@@ -146,7 +150,7 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
|||||||
channel->sock_state_cb = NULL;
|
channel->sock_state_cb = NULL;
|
||||||
channel->sock_state_cb_data = NULL;
|
channel->sock_state_cb_data = NULL;
|
||||||
|
|
||||||
channel->last_timeout_processed = (long)time(NULL);
|
channel->last_timeout_processed = (time_t)now.tv_sec;
|
||||||
|
|
||||||
/* Initialize our lists of queries */
|
/* Initialize our lists of queries */
|
||||||
ares__init_list_head(&(channel->all_queries));
|
ares__init_list_head(&(channel->all_queries));
|
||||||
@@ -254,13 +258,16 @@ int ares_save_options(ares_channel channel, struct ares_options *options,
|
|||||||
if (!ARES_CONFIG_CHECK(channel))
|
if (!ARES_CONFIG_CHECK(channel))
|
||||||
return ARES_ENODATA;
|
return ARES_ENODATA;
|
||||||
|
|
||||||
(*optmask) = (ARES_OPT_FLAGS|ARES_OPT_TIMEOUT|ARES_OPT_TRIES|ARES_OPT_NDOTS|
|
(*optmask) = (ARES_OPT_FLAGS|ARES_OPT_TRIES|ARES_OPT_NDOTS|
|
||||||
ARES_OPT_UDP_PORT|ARES_OPT_TCP_PORT|ARES_OPT_SOCK_STATE_CB|
|
ARES_OPT_UDP_PORT|ARES_OPT_TCP_PORT|ARES_OPT_SOCK_STATE_CB|
|
||||||
ARES_OPT_SERVERS|ARES_OPT_DOMAINS|ARES_OPT_LOOKUPS|
|
ARES_OPT_SERVERS|ARES_OPT_DOMAINS|ARES_OPT_LOOKUPS|
|
||||||
ARES_OPT_SORTLIST);
|
ARES_OPT_SORTLIST|ARES_OPT_TIMEOUTMS);
|
||||||
|
|
||||||
/* Copy easy stuff */
|
/* Copy easy stuff */
|
||||||
options->flags = channel->flags;
|
options->flags = channel->flags;
|
||||||
|
|
||||||
|
/* We return full millisecond resolution but that's only because we don't
|
||||||
|
set the ARES_OPT_TIMEOUT anymore, only the new ARES_OPT_TIMEOUTMS */
|
||||||
options->timeout = channel->timeout;
|
options->timeout = channel->timeout;
|
||||||
options->tries = channel->tries;
|
options->tries = channel->tries;
|
||||||
options->ndots = channel->ndots;
|
options->ndots = channel->ndots;
|
||||||
@@ -328,8 +335,10 @@ static int init_by_options(ares_channel channel,
|
|||||||
/* Easy stuff. */
|
/* Easy stuff. */
|
||||||
if ((optmask & ARES_OPT_FLAGS) && channel->flags == -1)
|
if ((optmask & ARES_OPT_FLAGS) && channel->flags == -1)
|
||||||
channel->flags = options->flags;
|
channel->flags = options->flags;
|
||||||
if ((optmask & ARES_OPT_TIMEOUT) && channel->timeout == -1)
|
if ((optmask & ARES_OPT_TIMEOUTMS) && channel->timeout == -1)
|
||||||
channel->timeout = options->timeout;
|
channel->timeout = options->timeout;
|
||||||
|
else if ((optmask & ARES_OPT_TIMEOUT) && channel->timeout == -1)
|
||||||
|
channel->timeout = options->timeout * 1000;
|
||||||
if ((optmask & ARES_OPT_TRIES) && channel->tries == -1)
|
if ((optmask & ARES_OPT_TRIES) && channel->tries == -1)
|
||||||
channel->tries = options->tries;
|
channel->tries = options->tries;
|
||||||
if ((optmask & ARES_OPT_NDOTS) && channel->ndots == -1)
|
if ((optmask & ARES_OPT_NDOTS) && channel->ndots == -1)
|
||||||
@@ -1245,16 +1254,61 @@ static int set_options(ares_channel channel, const char *str)
|
|||||||
static char *try_config(char *s, const char *opt)
|
static char *try_config(char *s, const char *opt)
|
||||||
{
|
{
|
||||||
size_t len;
|
size_t len;
|
||||||
|
ssize_t i;
|
||||||
|
ssize_t j;
|
||||||
|
char *p;
|
||||||
|
|
||||||
len = strlen(opt);
|
if (!s || !opt)
|
||||||
if (strncmp(s, opt, len) != 0 || !ISSPACE(s[len]))
|
/* no line or no option */
|
||||||
return NULL;
|
return NULL;
|
||||||
s += len;
|
|
||||||
while (ISSPACE(*s))
|
|
||||||
s++;
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/* trim line comment */
|
||||||
|
for (i = 0; s[i] && s[i] != '#'; ++i);
|
||||||
|
s[i] = '\0';
|
||||||
|
|
||||||
|
/* trim trailing whitespace */
|
||||||
|
for (j = i-1; j >= 0 && ISSPACE(s[j]); --j);
|
||||||
|
s[++j] = '\0';
|
||||||
|
|
||||||
|
/* skip leading whitespace */
|
||||||
|
for (i = 0; s[i] && ISSPACE(s[i]); ++i);
|
||||||
|
p = &s[i];
|
||||||
|
|
||||||
|
if (!*p)
|
||||||
|
/* empty line */
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if ((len = strlen(opt)) == 0)
|
||||||
|
/* empty option */
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (strncmp(p, opt, len) != 0)
|
||||||
|
/* line and option do not match */
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
/* skip over given option name */
|
||||||
|
p += len;
|
||||||
|
|
||||||
|
if (!*p)
|
||||||
|
/* no option value */
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if ((opt[len-1] != ':') && (opt[len-1] != '=') && !ISSPACE(*p))
|
||||||
|
/* whitespace between option name and value is mandatory
|
||||||
|
for given option names which do not end with ':' or '=' */
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
/* skip over whitespace */
|
||||||
|
while (*p && ISSPACE(*p))
|
||||||
|
p++;
|
||||||
|
|
||||||
|
if (!*p)
|
||||||
|
/* no option value */
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
/* return pointer to option value */
|
||||||
|
return p;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const char *try_option(const char *p, const char *q, const char *opt)
|
static const char *try_option(const char *p, const char *q, const char *opt)
|
||||||
@@ -1333,13 +1387,9 @@ static void randomize_key(unsigned char* key,int key_data_len)
|
|||||||
}
|
}
|
||||||
#else /* !WIN32 */
|
#else /* !WIN32 */
|
||||||
#ifdef RANDOM_FILE
|
#ifdef RANDOM_FILE
|
||||||
char buffer[256];
|
|
||||||
FILE *f = fopen(RANDOM_FILE, "rb");
|
FILE *f = fopen(RANDOM_FILE, "rb");
|
||||||
if(f) {
|
if(f) {
|
||||||
size_t i;
|
counter = fread(key, 1, key_data_len, f);
|
||||||
size_t rc = fread(buffer, key_data_len, 1, f);
|
|
||||||
for(i=0; i<rc && counter < key_data_len; i++)
|
|
||||||
key[counter++]=buffer[i];
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -29,6 +29,9 @@
|
|||||||
#include <arpa/nameser_compat.h>
|
#include <arpa/nameser_compat.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
#include <strings.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@@ -31,6 +31,9 @@
|
|||||||
#include <arpa/nameser_compat.h>
|
#include <arpa/nameser_compat.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
#include <strings.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@@ -28,6 +28,9 @@
|
|||||||
#include <arpa/nameser_compat.h>
|
#include <arpa/nameser_compat.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
#include <strings.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -44,6 +47,8 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
|||||||
const unsigned char *aptr;
|
const unsigned char *aptr;
|
||||||
char *ptrname, *hostname, *rr_name, *rr_data;
|
char *ptrname, *hostname, *rr_name, *rr_data;
|
||||||
struct hostent *hostent;
|
struct hostent *hostent;
|
||||||
|
int aliascnt = 0;
|
||||||
|
char ** aliases;
|
||||||
|
|
||||||
/* Set *host to NULL for all failure cases. */
|
/* Set *host to NULL for all failure cases. */
|
||||||
*host = NULL;
|
*host = NULL;
|
||||||
@@ -72,6 +77,12 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
|||||||
|
|
||||||
/* Examine each answer resource record (RR) in turn. */
|
/* Examine each answer resource record (RR) in turn. */
|
||||||
hostname = NULL;
|
hostname = NULL;
|
||||||
|
aliases = (char **) malloc(8 * sizeof(char *));
|
||||||
|
if (!aliases)
|
||||||
|
{
|
||||||
|
free(ptrname);
|
||||||
|
return ARES_ENOMEM;
|
||||||
|
}
|
||||||
for (i = 0; i < (int)ancount; i++)
|
for (i = 0; i < (int)ancount; i++)
|
||||||
{
|
{
|
||||||
/* Decode the RR up to the data field. */
|
/* Decode the RR up to the data field. */
|
||||||
@@ -99,6 +110,16 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
|||||||
if (hostname)
|
if (hostname)
|
||||||
free(hostname);
|
free(hostname);
|
||||||
hostname = rr_data;
|
hostname = rr_data;
|
||||||
|
aliases[aliascnt] = malloc((strlen(rr_data)+1) * sizeof(char *));
|
||||||
|
if (!aliases[aliascnt])
|
||||||
|
{
|
||||||
|
status = ARES_ENOMEM;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
strncpy(aliases[aliascnt], rr_data, strlen(rr_data)+1);
|
||||||
|
aliascnt++;
|
||||||
|
if ((aliascnt%8)==0)
|
||||||
|
aliases = (char **) realloc(aliases, (aliascnt/16+1) * sizeof(char *));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rr_class == C_IN && rr_type == T_CNAME)
|
if (rr_class == C_IN && rr_type == T_CNAME)
|
||||||
@@ -134,17 +155,20 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
|||||||
hostent->h_addr_list[0] = malloc(addrlen);
|
hostent->h_addr_list[0] = malloc(addrlen);
|
||||||
if (hostent->h_addr_list[0])
|
if (hostent->h_addr_list[0])
|
||||||
{
|
{
|
||||||
hostent->h_aliases = malloc(sizeof (char *));
|
hostent->h_aliases = malloc((aliascnt+1) * sizeof (char *));
|
||||||
if (hostent->h_aliases)
|
if (hostent->h_aliases)
|
||||||
{
|
{
|
||||||
/* Fill in the hostent and return successfully. */
|
/* Fill in the hostent and return successfully. */
|
||||||
hostent->h_name = hostname;
|
hostent->h_name = hostname;
|
||||||
hostent->h_aliases[0] = NULL;
|
for (i=0 ; i<aliascnt ; i++)
|
||||||
|
hostent->h_aliases[i] = aliases[i];
|
||||||
|
hostent->h_aliases[aliascnt] = NULL;
|
||||||
hostent->h_addrtype = family;
|
hostent->h_addrtype = family;
|
||||||
hostent->h_length = addrlen;
|
hostent->h_length = addrlen;
|
||||||
memcpy(hostent->h_addr_list[0], addr, addrlen);
|
memcpy(hostent->h_addr_list[0], addr, addrlen);
|
||||||
hostent->h_addr_list[1] = NULL;
|
hostent->h_addr_list[1] = NULL;
|
||||||
*host = hostent;
|
*host = hostent;
|
||||||
|
free(aliases);
|
||||||
free(ptrname);
|
free(ptrname);
|
||||||
return ARES_SUCCESS;
|
return ARES_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -156,6 +180,10 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
|||||||
}
|
}
|
||||||
status = ARES_ENOMEM;
|
status = ARES_ENOMEM;
|
||||||
}
|
}
|
||||||
|
for (i=0 ; i<aliascnt ; i++)
|
||||||
|
if (aliases[i])
|
||||||
|
free(aliases[i]);
|
||||||
|
free(aliases);
|
||||||
if (hostname)
|
if (hostname)
|
||||||
free(hostname);
|
free(hostname);
|
||||||
free(ptrname);
|
free(ptrname);
|
||||||
|
@@ -4,6 +4,7 @@
|
|||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
* Copyright (C) 2004-2008 by Daniel Stenberg
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this
|
* Permission to use, copy, modify, and distribute this
|
||||||
* software and its documentation for any purpose and without
|
* software and its documentation for any purpose and without
|
||||||
@@ -48,7 +49,7 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DEFAULT_TIMEOUT 5
|
#define DEFAULT_TIMEOUT 5000 /* milliseconds */
|
||||||
#define DEFAULT_TRIES 4
|
#define DEFAULT_TRIES 4
|
||||||
#ifndef INADDR_NONE
|
#ifndef INADDR_NONE
|
||||||
#define INADDR_NONE 0xffffffff
|
#define INADDR_NONE 0xffffffff
|
||||||
@@ -149,7 +150,7 @@ struct server_state {
|
|||||||
struct query {
|
struct query {
|
||||||
/* Query ID from qbuf, for faster lookup, and current timeout */
|
/* Query ID from qbuf, for faster lookup, and current timeout */
|
||||||
unsigned short qid;
|
unsigned short qid;
|
||||||
time_t timeout;
|
struct timeval timeout;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Links for the doubly-linked lists in which we insert a query.
|
* Links for the doubly-linked lists in which we insert a query.
|
||||||
@@ -217,7 +218,7 @@ typedef struct rc4_key
|
|||||||
struct ares_channeldata {
|
struct ares_channeldata {
|
||||||
/* Configuration data */
|
/* Configuration data */
|
||||||
int flags;
|
int flags;
|
||||||
int timeout;
|
int timeout; /* in milliseconds */
|
||||||
int tries;
|
int tries;
|
||||||
int ndots;
|
int ndots;
|
||||||
int udp_port;
|
int udp_port;
|
||||||
@@ -242,7 +243,8 @@ struct ares_channeldata {
|
|||||||
/* Generation number to use for the next TCP socket open/close */
|
/* Generation number to use for the next TCP socket open/close */
|
||||||
int tcp_connection_generation;
|
int tcp_connection_generation;
|
||||||
|
|
||||||
/* The time at which we last called process_timeouts() */
|
/* The time at which we last called process_timeouts(). Uses integer seconds
|
||||||
|
just to draw the line somewhere. */
|
||||||
time_t last_timeout_processed;
|
time_t last_timeout_processed;
|
||||||
|
|
||||||
/* Circular, doubly-linked list of queries, bucketed various ways.... */
|
/* Circular, doubly-linked list of queries, bucketed various ways.... */
|
||||||
@@ -259,13 +261,27 @@ struct ares_channeldata {
|
|||||||
void *sock_state_cb_data;
|
void *sock_state_cb_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* return true if now is exactly check time or later */
|
||||||
|
int ares__timedout(struct timeval *now,
|
||||||
|
struct timeval *check);
|
||||||
|
/* add the specific number of milliseconds to the time in the first argument */
|
||||||
|
int ares__timeadd(struct timeval *now,
|
||||||
|
int millisecs);
|
||||||
|
/* return time offset between now and (future) check, in milliseconds */
|
||||||
|
int ares__timeoffset(struct timeval *now,
|
||||||
|
struct timeval *check);
|
||||||
void ares__rc4(rc4_key* key,unsigned char *buffer_ptr, int buffer_len);
|
void ares__rc4(rc4_key* key,unsigned char *buffer_ptr, int buffer_len);
|
||||||
void ares__send_query(ares_channel channel, struct query *query, time_t now);
|
void ares__send_query(ares_channel channel, struct query *query,
|
||||||
|
struct timeval *now);
|
||||||
void ares__close_sockets(ares_channel channel, struct server_state *server);
|
void ares__close_sockets(ares_channel channel, struct server_state *server);
|
||||||
int ares__get_hostent(FILE *fp, int family, struct hostent **host);
|
int ares__get_hostent(FILE *fp, int family, struct hostent **host);
|
||||||
int ares__read_line(FILE *fp, char **buf, int *bufsize);
|
int ares__read_line(FILE *fp, char **buf, int *bufsize);
|
||||||
void ares__free_query(struct query *query);
|
void ares__free_query(struct query *query);
|
||||||
short ares__generate_new_id(rc4_key* key);
|
short ares__generate_new_id(rc4_key* key);
|
||||||
|
struct timeval ares__tvnow(void);
|
||||||
|
#if 0 /* Not used */
|
||||||
|
long ares__tvdiff(struct timeval t1, struct timeval t2);
|
||||||
|
#endif
|
||||||
|
|
||||||
#define ARES_SWAP_BYTE(a,b) \
|
#define ARES_SWAP_BYTE(a,b) \
|
||||||
{ unsigned char swapByte = *(a); *(a) = *(b); *(b) = swapByte; }
|
{ unsigned char swapByte = *(a); *(a) = *(b); *(b) = swapByte; }
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
* Copyright (C) 2004-2008 by Daniel Stenberg
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this
|
* Permission to use, copy, modify, and distribute this
|
||||||
* software and its documentation for any purpose and without
|
* software and its documentation for any purpose and without
|
||||||
@@ -42,8 +43,14 @@
|
|||||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||||
#include <arpa/nameser_compat.h>
|
#include <arpa/nameser_compat.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_SYS_TIME_H
|
||||||
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
#endif /* WIN32 && !WATT32 */
|
#endif /* WIN32 && !WATT32 */
|
||||||
|
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
#include <strings.h>
|
||||||
|
#endif
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -68,21 +75,25 @@
|
|||||||
|
|
||||||
static int try_again(int errnum);
|
static int try_again(int errnum);
|
||||||
static void write_tcp_data(ares_channel channel, fd_set *write_fds,
|
static void write_tcp_data(ares_channel channel, fd_set *write_fds,
|
||||||
ares_socket_t write_fd, time_t now);
|
ares_socket_t write_fd, struct timeval *now);
|
||||||
static void read_tcp_data(ares_channel channel, fd_set *read_fds,
|
static void read_tcp_data(ares_channel channel, fd_set *read_fds,
|
||||||
ares_socket_t read_fd, time_t now);
|
ares_socket_t read_fd, struct timeval *now);
|
||||||
static void read_udp_packets(ares_channel channel, fd_set *read_fds,
|
static void read_udp_packets(ares_channel channel, fd_set *read_fds,
|
||||||
ares_socket_t read_fd, time_t now);
|
ares_socket_t read_fd, struct timeval *now);
|
||||||
static void advance_tcp_send_queue(ares_channel channel, int whichserver,
|
static void advance_tcp_send_queue(ares_channel channel, int whichserver,
|
||||||
ssize_t num_bytes);
|
ssize_t num_bytes);
|
||||||
static void process_timeouts(ares_channel channel, time_t now);
|
static void process_timeouts(ares_channel channel, struct timeval *now);
|
||||||
static void process_broken_connections(ares_channel channel, time_t now);
|
static void process_broken_connections(ares_channel channel,
|
||||||
|
struct timeval *now);
|
||||||
static void process_answer(ares_channel channel, unsigned char *abuf,
|
static void process_answer(ares_channel channel, unsigned char *abuf,
|
||||||
int alen, int whichserver, int tcp, time_t now);
|
int alen, int whichserver, int tcp,
|
||||||
static void handle_error(ares_channel channel, int whichserver, time_t now);
|
struct timeval *now);
|
||||||
|
static void handle_error(ares_channel channel, int whichserver,
|
||||||
|
struct timeval *now);
|
||||||
static void skip_server(ares_channel channel, struct query *query,
|
static void skip_server(ares_channel channel, struct query *query,
|
||||||
int whichserver);
|
int whichserver);
|
||||||
static void next_server(ares_channel channel, struct query *query, time_t now);
|
static void next_server(ares_channel channel, struct query *query,
|
||||||
|
struct timeval *now);
|
||||||
static int configure_socket(int s, ares_channel channel);
|
static int configure_socket(int s, ares_channel channel);
|
||||||
static int open_tcp_socket(ares_channel channel, struct server_state *server);
|
static int open_tcp_socket(ares_channel channel, struct server_state *server);
|
||||||
static int open_udp_socket(ares_channel channel, struct server_state *server);
|
static int open_udp_socket(ares_channel channel, struct server_state *server);
|
||||||
@@ -91,19 +102,59 @@ static int same_questions(const unsigned char *qbuf, int qlen,
|
|||||||
static void end_query(ares_channel channel, struct query *query, int status,
|
static void end_query(ares_channel channel, struct query *query, int status,
|
||||||
unsigned char *abuf, int alen);
|
unsigned char *abuf, int alen);
|
||||||
|
|
||||||
|
/* return true if now is exactly check time or later */
|
||||||
|
int ares__timedout(struct timeval *now,
|
||||||
|
struct timeval *check)
|
||||||
|
{
|
||||||
|
int secs = (now->tv_sec - check->tv_sec);
|
||||||
|
|
||||||
|
if(secs > 0)
|
||||||
|
return 1; /* yes, timed out */
|
||||||
|
if(secs < 0)
|
||||||
|
return 0; /* nope, not timed out */
|
||||||
|
|
||||||
|
/* if the full seconds were identical, check the sub second parts */
|
||||||
|
return (now->tv_usec - check->tv_usec >= 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* add the specific number of milliseconds to the time in the first argument */
|
||||||
|
int ares__timeadd(struct timeval *now,
|
||||||
|
int millisecs)
|
||||||
|
{
|
||||||
|
now->tv_sec += millisecs/1000;
|
||||||
|
now->tv_usec += (millisecs%1000)*1000;
|
||||||
|
|
||||||
|
if(now->tv_usec >= 1000000) {
|
||||||
|
++(now->tv_sec);
|
||||||
|
now->tv_usec -= 1000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* return time offset between now and (future) check, in milliseconds */
|
||||||
|
int ares__timeoffset(struct timeval *now,
|
||||||
|
struct timeval *check)
|
||||||
|
{
|
||||||
|
int secs = (check->tv_sec - now->tv_sec); /* this many seconds */
|
||||||
|
int us = (check->tv_usec - now->tv_usec); /* this many microseconds */
|
||||||
|
|
||||||
|
return secs*1000 + us/1000; /* return them combined as milliseconds */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Something interesting happened on the wire, or there was a timeout.
|
/* Something interesting happened on the wire, or there was a timeout.
|
||||||
* See what's up and respond accordingly.
|
* See what's up and respond accordingly.
|
||||||
*/
|
*/
|
||||||
void ares_process(ares_channel channel, fd_set *read_fds, fd_set *write_fds)
|
void ares_process(ares_channel channel, fd_set *read_fds, fd_set *write_fds)
|
||||||
{
|
{
|
||||||
time_t now;
|
struct timeval now = ares__tvnow();
|
||||||
|
|
||||||
time(&now);
|
write_tcp_data(channel, write_fds, ARES_SOCKET_BAD, &now);
|
||||||
write_tcp_data(channel, write_fds, ARES_SOCKET_BAD, now);
|
read_tcp_data(channel, read_fds, ARES_SOCKET_BAD, &now);
|
||||||
read_tcp_data(channel, read_fds, ARES_SOCKET_BAD, now);
|
read_udp_packets(channel, read_fds, ARES_SOCKET_BAD, &now);
|
||||||
read_udp_packets(channel, read_fds, ARES_SOCKET_BAD, now);
|
process_timeouts(channel, &now);
|
||||||
process_timeouts(channel, now);
|
process_broken_connections(channel, &now);
|
||||||
process_broken_connections(channel, now);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Something interesting happened on the wire, or there was a timeout.
|
/* Something interesting happened on the wire, or there was a timeout.
|
||||||
@@ -114,13 +165,12 @@ void ares_process_fd(ares_channel channel,
|
|||||||
file descriptors */
|
file descriptors */
|
||||||
ares_socket_t write_fd)
|
ares_socket_t write_fd)
|
||||||
{
|
{
|
||||||
time_t now;
|
struct timeval now = ares__tvnow();
|
||||||
|
|
||||||
time(&now);
|
write_tcp_data(channel, NULL, write_fd, &now);
|
||||||
write_tcp_data(channel, NULL, write_fd, now);
|
read_tcp_data(channel, NULL, read_fd, &now);
|
||||||
read_tcp_data(channel, NULL, read_fd, now);
|
read_udp_packets(channel, NULL, read_fd, &now);
|
||||||
read_udp_packets(channel, NULL, read_fd, now);
|
process_timeouts(channel, &now);
|
||||||
process_timeouts(channel, now);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -155,7 +205,7 @@ static int try_again(int errnum)
|
|||||||
static void write_tcp_data(ares_channel channel,
|
static void write_tcp_data(ares_channel channel,
|
||||||
fd_set *write_fds,
|
fd_set *write_fds,
|
||||||
ares_socket_t write_fd,
|
ares_socket_t write_fd,
|
||||||
time_t now)
|
struct timeval *now)
|
||||||
{
|
{
|
||||||
struct server_state *server;
|
struct server_state *server;
|
||||||
struct send_request *sendreq;
|
struct send_request *sendreq;
|
||||||
@@ -174,7 +224,8 @@ static void write_tcp_data(ares_channel channel,
|
|||||||
/* Make sure server has data to send and is selected in write_fds or
|
/* Make sure server has data to send and is selected in write_fds or
|
||||||
write_fd. */
|
write_fd. */
|
||||||
server = &channel->servers[i];
|
server = &channel->servers[i];
|
||||||
if (!server->qhead || server->tcp_socket == ARES_SOCKET_BAD || server->is_broken)
|
if (!server->qhead || server->tcp_socket == ARES_SOCKET_BAD ||
|
||||||
|
server->is_broken)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(write_fds) {
|
if(write_fds) {
|
||||||
@@ -278,7 +329,7 @@ static void advance_tcp_send_queue(ares_channel channel, int whichserver,
|
|||||||
* a packet if we finish reading one.
|
* a packet if we finish reading one.
|
||||||
*/
|
*/
|
||||||
static void read_tcp_data(ares_channel channel, fd_set *read_fds,
|
static void read_tcp_data(ares_channel channel, fd_set *read_fds,
|
||||||
ares_socket_t read_fd, time_t now)
|
ares_socket_t read_fd, struct timeval *now)
|
||||||
{
|
{
|
||||||
struct server_state *server;
|
struct server_state *server;
|
||||||
int i;
|
int i;
|
||||||
@@ -374,7 +425,7 @@ static void read_tcp_data(ares_channel channel, fd_set *read_fds,
|
|||||||
|
|
||||||
/* If any UDP sockets select true for reading, process them. */
|
/* If any UDP sockets select true for reading, process them. */
|
||||||
static void read_udp_packets(ares_channel channel, fd_set *read_fds,
|
static void read_udp_packets(ares_channel channel, fd_set *read_fds,
|
||||||
ares_socket_t read_fd, time_t now)
|
ares_socket_t read_fd, struct timeval *now)
|
||||||
{
|
{
|
||||||
struct server_state *server;
|
struct server_state *server;
|
||||||
int i;
|
int i;
|
||||||
@@ -425,7 +476,7 @@ static void read_udp_packets(ares_channel channel, fd_set *read_fds,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If any queries have timed out, note the timeout and move them on. */
|
/* If any queries have timed out, note the timeout and move them on. */
|
||||||
static void process_timeouts(ares_channel channel, time_t now)
|
static void process_timeouts(ares_channel channel, struct timeval *now)
|
||||||
{
|
{
|
||||||
time_t t; /* the time of the timeouts we're processing */
|
time_t t; /* the time of the timeouts we're processing */
|
||||||
struct query *query;
|
struct query *query;
|
||||||
@@ -438,14 +489,14 @@ static void process_timeouts(ares_channel channel, time_t now)
|
|||||||
* only a handful of requests that fall into the "now" bucket, so
|
* only a handful of requests that fall into the "now" bucket, so
|
||||||
* this should be quite quick.
|
* this should be quite quick.
|
||||||
*/
|
*/
|
||||||
for (t = channel->last_timeout_processed; t <= now; t++)
|
for (t = channel->last_timeout_processed; t <= now->tv_sec; t++)
|
||||||
{
|
{
|
||||||
list_head = &(channel->queries_by_timeout[t % ARES_TIMEOUT_TABLE_SIZE]);
|
list_head = &(channel->queries_by_timeout[t % ARES_TIMEOUT_TABLE_SIZE]);
|
||||||
for (list_node = list_head->next; list_node != list_head; )
|
for (list_node = list_head->next; list_node != list_head; )
|
||||||
{
|
{
|
||||||
query = list_node->data;
|
query = list_node->data;
|
||||||
list_node = list_node->next; /* in case the query gets deleted */
|
list_node = list_node->next; /* in case the query gets deleted */
|
||||||
if (query->timeout != 0 && now >= query->timeout)
|
if (query->timeout.tv_sec && ares__timedout(now, &query->timeout))
|
||||||
{
|
{
|
||||||
query->error_status = ARES_ETIMEOUT;
|
query->error_status = ARES_ETIMEOUT;
|
||||||
++query->timeouts;
|
++query->timeouts;
|
||||||
@@ -453,12 +504,13 @@ static void process_timeouts(ares_channel channel, time_t now)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
channel->last_timeout_processed = now;
|
channel->last_timeout_processed = now->tv_sec;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle an answer from a server. */
|
/* Handle an answer from a server. */
|
||||||
static void process_answer(ares_channel channel, unsigned char *abuf,
|
static void process_answer(ares_channel channel, unsigned char *abuf,
|
||||||
int alen, int whichserver, int tcp, time_t now)
|
int alen, int whichserver, int tcp,
|
||||||
|
struct timeval *now)
|
||||||
{
|
{
|
||||||
int tc, rcode;
|
int tc, rcode;
|
||||||
unsigned short id;
|
unsigned short id;
|
||||||
@@ -536,7 +588,8 @@ static void process_answer(ares_channel channel, unsigned char *abuf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Close all the connections that are no longer usable. */
|
/* Close all the connections that are no longer usable. */
|
||||||
static void process_broken_connections(ares_channel channel, time_t now)
|
static void process_broken_connections(ares_channel channel,
|
||||||
|
struct timeval *now)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < channel->nservers; i++)
|
for (i = 0; i < channel->nservers; i++)
|
||||||
@@ -549,7 +602,8 @@ static void process_broken_connections(ares_channel channel, time_t now)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_error(ares_channel channel, int whichserver, time_t now)
|
static void handle_error(ares_channel channel, int whichserver,
|
||||||
|
struct timeval *now)
|
||||||
{
|
{
|
||||||
struct server_state *server;
|
struct server_state *server;
|
||||||
struct query *query;
|
struct query *query;
|
||||||
@@ -600,7 +654,8 @@ static void skip_server(ares_channel channel, struct query *query,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void next_server(ares_channel channel, struct query *query, time_t now)
|
static void next_server(ares_channel channel, struct query *query,
|
||||||
|
struct timeval *now)
|
||||||
{
|
{
|
||||||
/* Advance to the next server or try. */
|
/* Advance to the next server or try. */
|
||||||
query->server++;
|
query->server++;
|
||||||
@@ -637,7 +692,8 @@ static void next_server(ares_channel channel, struct query *query, time_t now)
|
|||||||
end_query(channel, query, query->error_status, NULL, 0);
|
end_query(channel, query, query->error_status, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ares__send_query(ares_channel channel, struct query *query, time_t now)
|
void ares__send_query(ares_channel channel, struct query *query,
|
||||||
|
struct timeval *now)
|
||||||
{
|
{
|
||||||
struct send_request *sendreq;
|
struct send_request *sendreq;
|
||||||
struct server_state *server;
|
struct server_state *server;
|
||||||
@@ -704,16 +760,17 @@ void ares__send_query(ares_channel channel, struct query *query, time_t now)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
query->timeout = now
|
query->timeout = *now;
|
||||||
+ ((query->try == 0) ? channel->timeout
|
ares__timeadd(&query->timeout,
|
||||||
: channel->timeout << query->try / channel->nservers);
|
(query->try == 0) ? channel->timeout
|
||||||
|
: channel->timeout << query->try / channel->nservers);
|
||||||
/* Keep track of queries bucketed by timeout, so we can process
|
/* Keep track of queries bucketed by timeout, so we can process
|
||||||
* timeout events quickly.
|
* timeout events quickly.
|
||||||
*/
|
*/
|
||||||
ares__remove_from_list(&(query->queries_by_timeout));
|
ares__remove_from_list(&(query->queries_by_timeout));
|
||||||
ares__insert_in_list(
|
ares__insert_in_list(
|
||||||
&(query->queries_by_timeout),
|
&(query->queries_by_timeout),
|
||||||
&(channel->queries_by_timeout[query->timeout %
|
&(channel->queries_by_timeout[query->timeout.tv_sec %
|
||||||
ARES_TIMEOUT_TABLE_SIZE]));
|
ARES_TIMEOUT_TABLE_SIZE]));
|
||||||
|
|
||||||
/* Keep track of queries bucketed by server, so we can process server
|
/* Keep track of queries bucketed by server, so we can process server
|
||||||
|
@@ -39,7 +39,7 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
|
|||||||
{
|
{
|
||||||
struct query *query;
|
struct query *query;
|
||||||
int i;
|
int i;
|
||||||
time_t now;
|
struct timeval now;
|
||||||
|
|
||||||
/* Verify that the query is at least long enough to hold the header. */
|
/* Verify that the query is at least long enough to hold the header. */
|
||||||
if (qlen < HFIXEDSZ || qlen >= (1 << 16))
|
if (qlen < HFIXEDSZ || qlen >= (1 << 16))
|
||||||
@@ -74,7 +74,7 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
|
|||||||
|
|
||||||
/* Compute the query ID. Start with no timeout. */
|
/* Compute the query ID. Start with no timeout. */
|
||||||
query->qid = (unsigned short)DNS_HEADER_QID(qbuf);
|
query->qid = (unsigned short)DNS_HEADER_QID(qbuf);
|
||||||
query->timeout = 0;
|
query->timeout.tv_sec = query->timeout.tv_usec = 0;
|
||||||
|
|
||||||
/* Form the TCP query buffer by prepending qlen (as two
|
/* Form the TCP query buffer by prepending qlen (as two
|
||||||
* network-order bytes) to qbuf.
|
* network-order bytes) to qbuf.
|
||||||
@@ -107,17 +107,17 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
|
|||||||
ares__init_list_node(&(query->queries_by_timeout), query);
|
ares__init_list_node(&(query->queries_by_timeout), query);
|
||||||
ares__init_list_node(&(query->queries_to_server), query);
|
ares__init_list_node(&(query->queries_to_server), query);
|
||||||
ares__init_list_node(&(query->all_queries), query);
|
ares__init_list_node(&(query->all_queries), query);
|
||||||
|
|
||||||
/* Chain the query into the list of all queries. */
|
/* Chain the query into the list of all queries. */
|
||||||
ares__insert_in_list(&(query->all_queries), &(channel->all_queries));
|
ares__insert_in_list(&(query->all_queries), &(channel->all_queries));
|
||||||
/* Keep track of queries bucketed by qid, so we can process DNS
|
/* Keep track of queries bucketed by qid, so we can process DNS
|
||||||
* responses quickly.
|
* responses quickly.
|
||||||
*/
|
*/
|
||||||
ares__insert_in_list(
|
ares__insert_in_list(
|
||||||
&(query->queries_by_qid),
|
&(query->queries_by_qid),
|
||||||
&(channel->queries_by_qid[query->qid % ARES_QID_TABLE_SIZE]));
|
&(channel->queries_by_qid[query->qid % ARES_QID_TABLE_SIZE]));
|
||||||
|
|
||||||
/* Perform the first query action. */
|
/* Perform the first query action. */
|
||||||
time(&now);
|
now = ares__tvnow();
|
||||||
ares__send_query(channel, query, now);
|
ares__send_query(channel, query, &now);
|
||||||
}
|
}
|
||||||
|
@@ -37,16 +37,16 @@ struct timeval *ares_timeout(ares_channel channel, struct timeval *maxtv,
|
|||||||
struct query *query;
|
struct query *query;
|
||||||
struct list_node* list_head;
|
struct list_node* list_head;
|
||||||
struct list_node* list_node;
|
struct list_node* list_node;
|
||||||
time_t now;
|
struct timeval now;
|
||||||
time_t offset, min_offset; /* these use time_t since some 32 bit systems
|
struct timeval nextstop;
|
||||||
still use 64 bit time_t! (like VS2005) */
|
long offset, min_offset;
|
||||||
|
|
||||||
/* No queries, no timeout (and no fetch of the current time). */
|
/* No queries, no timeout (and no fetch of the current time). */
|
||||||
if (ares__is_list_empty(&(channel->all_queries)))
|
if (ares__is_list_empty(&(channel->all_queries)))
|
||||||
return maxtv;
|
return maxtv;
|
||||||
|
|
||||||
/* Find the minimum timeout for the current set of queries. */
|
/* Find the minimum timeout for the current set of queries. */
|
||||||
time(&now);
|
now = ares__tvnow();
|
||||||
min_offset = -1;
|
min_offset = -1;
|
||||||
|
|
||||||
list_head = &(channel->all_queries);
|
list_head = &(channel->all_queries);
|
||||||
@@ -54,23 +54,26 @@ struct timeval *ares_timeout(ares_channel channel, struct timeval *maxtv,
|
|||||||
list_node = list_node->next)
|
list_node = list_node->next)
|
||||||
{
|
{
|
||||||
query = list_node->data;
|
query = list_node->data;
|
||||||
if (query->timeout == 0)
|
if (query->timeout.tv_sec == 0)
|
||||||
continue;
|
continue;
|
||||||
offset = query->timeout - now;
|
offset = ares__timeoffset(&now, &query->timeout);
|
||||||
if (offset < 0)
|
if (offset < 0)
|
||||||
offset = 0;
|
offset = 0;
|
||||||
if (min_offset == -1 || offset < min_offset)
|
if (min_offset == -1 || offset < min_offset)
|
||||||
min_offset = offset;
|
min_offset = offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we found a minimum timeout and it's sooner than the one
|
if(min_offset != -1) {
|
||||||
* specified in maxtv (if any), return it. Otherwise go with
|
nextstop.tv_sec = min_offset/1000;
|
||||||
* maxtv.
|
nextstop.tv_usec = (min_offset%1000)*1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If we found a minimum timeout and it's sooner than the one specified in
|
||||||
|
* maxtv (if any), return it. Otherwise go with maxtv.
|
||||||
*/
|
*/
|
||||||
if (min_offset != -1 && (!maxtv || min_offset <= maxtv->tv_sec))
|
if (min_offset != -1 && (!maxtv || ares__timedout(maxtv, &nextstop)))
|
||||||
{
|
{
|
||||||
tvbuf->tv_sec = (long)min_offset;
|
*tvbuf = nextstop;
|
||||||
tvbuf->tv_usec = 0;
|
|
||||||
return tvbuf;
|
return tvbuf;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -5,11 +5,11 @@
|
|||||||
|
|
||||||
#define ARES_VERSION_MAJOR 1
|
#define ARES_VERSION_MAJOR 1
|
||||||
#define ARES_VERSION_MINOR 5
|
#define ARES_VERSION_MINOR 5
|
||||||
#define ARES_VERSION_PATCH 2
|
#define ARES_VERSION_PATCH 3
|
||||||
#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
|
#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
|
||||||
(ARES_VERSION_MINOR<<8)|\
|
(ARES_VERSION_MINOR<<8)|\
|
||||||
(ARES_VERSION_PATCH))
|
(ARES_VERSION_PATCH))
|
||||||
#define ARES_VERSION_STR "1.5.2-CVS"
|
#define ARES_VERSION_STR "1.5.3-CVS"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@@ -1,11 +1,9 @@
|
|||||||
|
AC_INIT([c-ares],[1.5.1],[daniel@haxx.se])
|
||||||
dnl Process this file with autoconf to produce a configure script.
|
|
||||||
AC_PREREQ(2.57)
|
AC_PREREQ(2.57)
|
||||||
AC_INIT(ares_init.c)
|
|
||||||
AC_CONFIG_SRCDIR([ares_ipv6.h])
|
AC_CONFIG_SRCDIR([ares_ipv6.h])
|
||||||
AM_CONFIG_HEADER(config.h)
|
AM_CONFIG_HEADER([config.h])
|
||||||
AM_MAINTAINER_MODE
|
AM_MAINTAINER_MODE
|
||||||
AM_INIT_AUTOMAKE(c-ares, CVS)
|
AM_INIT_AUTOMAKE
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
dnl Detect the canonical host and target build environment
|
dnl Detect the canonical host and target build environment
|
||||||
@@ -17,12 +15,13 @@ AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
|
|||||||
|
|
||||||
AC_AIX
|
AC_AIX
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
|
AM_PROG_CC_C_O
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
|
|
||||||
case $host_os in
|
case $host_os in
|
||||||
solaris*)
|
solaris*)
|
||||||
AC_DEFINE(ETC_INET, 1, [if a /etc/inet dir is being used])
|
AC_DEFINE(ETC_INET, 1, [if a /etc/inet dir is being used])
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
dnl support building of Windows DLLs
|
dnl support building of Windows DLLs
|
||||||
@@ -77,12 +76,16 @@ AM_CONDITIONAL(DEBUGBUILD, test x$debugbuild = xyes)
|
|||||||
dnl skip libtool C++ and Fortran compiler checks
|
dnl skip libtool C++ and Fortran compiler checks
|
||||||
m4_ifdef([AC_PROG_CXX], [m4_undefine([AC_PROG_CXX])])
|
m4_ifdef([AC_PROG_CXX], [m4_undefine([AC_PROG_CXX])])
|
||||||
m4_defun([AC_PROG_CXX],[])
|
m4_defun([AC_PROG_CXX],[])
|
||||||
|
m4_ifdef([AC_PROG_CXXCPP], [m4_undefine([AC_PROG_CXXCPP])])
|
||||||
|
m4_defun([AC_PROG_CXXCPP],[true])
|
||||||
m4_ifdef([AC_PROG_F77], [m4_undefine([AC_PROG_F77])])
|
m4_ifdef([AC_PROG_F77], [m4_undefine([AC_PROG_F77])])
|
||||||
m4_defun([AC_PROG_F77],[])
|
m4_defun([AC_PROG_F77],[])
|
||||||
|
|
||||||
dnl skip libtool C++ and Fortran linker checks
|
dnl skip libtool C++ and Fortran linker checks
|
||||||
m4_ifdef([AC_LIBTOOL_CXX], [m4_undefine([AC_LIBTOOL_CXX])])
|
m4_ifdef([AC_LIBTOOL_CXX], [m4_undefine([AC_LIBTOOL_CXX])])
|
||||||
m4_defun([AC_LIBTOOL_CXX],[])
|
m4_defun([AC_LIBTOOL_CXX],[])
|
||||||
|
m4_ifdef([AC_LIBTOOL_CXXCPP], [m4_undefine([AC_LIBTOOL_CXXCPP])])
|
||||||
|
m4_defun([AC_LIBTOOL_CXXCPP],[true])
|
||||||
m4_ifdef([AC_LIBTOOL_F77], [m4_undefine([AC_LIBTOOL_F77])])
|
m4_ifdef([AC_LIBTOOL_F77], [m4_undefine([AC_LIBTOOL_F77])])
|
||||||
m4_defun([AC_LIBTOOL_F77],[])
|
m4_defun([AC_LIBTOOL_F77],[])
|
||||||
|
|
||||||
@@ -103,7 +106,7 @@ AC_PROG_LIBTOOL
|
|||||||
|
|
||||||
AC_MSG_CHECKING([if we need -no-undefined])
|
AC_MSG_CHECKING([if we need -no-undefined])
|
||||||
case $host in
|
case $host in
|
||||||
*-*-cygwin | *-*-mingw* | *-*-pw32*)
|
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
|
||||||
need_no_undefined=yes
|
need_no_undefined=yes
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@@ -120,6 +123,28 @@ dnl gethostbyname_r() version
|
|||||||
dnl **********************************************************************
|
dnl **********************************************************************
|
||||||
CURL_DETECT_ICC([CFLAGS="$CFLAGS -we 147"])
|
CURL_DETECT_ICC([CFLAGS="$CFLAGS -we 147"])
|
||||||
|
|
||||||
|
dnl **********************************************************************
|
||||||
|
dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
|
||||||
|
dnl and ws2tcpip.h take precedence over any other further checks which
|
||||||
|
dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
|
||||||
|
dnl this specific header files. And do them before its results are used.
|
||||||
|
dnl **********************************************************************
|
||||||
|
|
||||||
|
CURL_CHECK_HEADER_WINDOWS
|
||||||
|
CURL_CHECK_NATIVE_WINDOWS
|
||||||
|
case X-"$ac_cv_native_windows" in
|
||||||
|
X-yes)
|
||||||
|
CURL_CHECK_HEADER_WINSOCK
|
||||||
|
CURL_CHECK_HEADER_WINSOCK2
|
||||||
|
CURL_CHECK_HEADER_WS2TCPIP
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
ac_cv_header_winsock_h="no"
|
||||||
|
ac_cv_header_winsock2_h="no"
|
||||||
|
ac_cv_header_ws2tcpip_h="no"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
dnl **********************************************************************
|
dnl **********************************************************************
|
||||||
dnl platform/compiler/architecture specific checks/flags
|
dnl platform/compiler/architecture specific checks/flags
|
||||||
dnl **********************************************************************
|
dnl **********************************************************************
|
||||||
@@ -187,49 +212,107 @@ then
|
|||||||
AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
|
AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
|
||||||
my_ac_save_LIBS=$LIBS
|
my_ac_save_LIBS=$LIBS
|
||||||
LIBS="-lnsl -lsocket $LIBS"
|
LIBS="-lnsl -lsocket $LIBS"
|
||||||
AC_TRY_LINK( ,
|
AC_LINK_IFELSE([
|
||||||
[gethostbyname();],
|
AC_LANG_PROGRAM([[
|
||||||
[ dnl found it!
|
]],[[
|
||||||
HAVE_GETHOSTBYNAME="1"
|
gethostbyname();
|
||||||
AC_MSG_RESULT([yes])],
|
]])
|
||||||
[ dnl failed!
|
],[
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([yes])
|
||||||
dnl restore LIBS
|
HAVE_GETHOSTBYNAME="1"
|
||||||
LIBS=$my_ac_save_LIBS]
|
],[
|
||||||
)
|
AC_MSG_RESULT([no])
|
||||||
|
LIBS=$my_ac_save_LIBS
|
||||||
|
])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||||
then
|
then
|
||||||
dnl This is for Msys/Mingw
|
dnl This is for winsock systems
|
||||||
AC_MSG_CHECKING([for gethostbyname in ws2_32])
|
if test "$ac_cv_header_windows_h" = "yes"; then
|
||||||
my_ac_save_LIBS=$LIBS
|
if test "$ac_cv_header_winsock_h" = "yes"; then
|
||||||
LIBS="-lws2_32 $LIBS"
|
case $host in
|
||||||
AC_TRY_LINK([#include <winsock2.h>],
|
*-*-mingw32ce*)
|
||||||
[gethostbyname("www.dummysite.com");],
|
winsock_LIB="-lwinsock"
|
||||||
[ dnl worked!
|
;;
|
||||||
ws2="yes"
|
*)
|
||||||
AC_MSG_RESULT([yes])
|
winsock_LIB="-lwsock32"
|
||||||
HAVE_GETHOSTBYNAME="1"],
|
;;
|
||||||
[ dnl failed, restore LIBS
|
esac
|
||||||
LIBS=$my_ac_save_LIBS
|
fi
|
||||||
AC_MSG_RESULT(no)]
|
if test "$ac_cv_header_winsock2_h" = "yes"; then
|
||||||
)
|
winsock_LIB="-lws2_32"
|
||||||
|
fi
|
||||||
|
if test ! -z "$winsock_LIB"; then
|
||||||
|
my_ac_save_LIBS=$LIBS
|
||||||
|
LIBS="$winsock_LIB $LIBS"
|
||||||
|
AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
|
||||||
|
AC_LINK_IFELSE([
|
||||||
|
AC_LANG_PROGRAM([[
|
||||||
|
#ifdef HAVE_WINDOWS_H
|
||||||
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#endif
|
||||||
|
#include <windows.h>
|
||||||
|
#ifdef HAVE_WINSOCK2_H
|
||||||
|
#include <winsock2.h>
|
||||||
|
#else
|
||||||
|
#ifdef HAVE_WINSOCK_H
|
||||||
|
#include <winsock.h>
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
]],[[
|
||||||
|
gethostbyname("www.dummysite.com");
|
||||||
|
]])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
HAVE_GETHOSTBYNAME="1"
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
winsock_LIB=""
|
||||||
|
LIBS=$my_ac_save_LIBS
|
||||||
|
])
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||||
|
then
|
||||||
|
dnl This is for Minix 3.1
|
||||||
|
AC_MSG_CHECKING([for gethostbyname for Minix 3])
|
||||||
|
AC_LINK_IFELSE([
|
||||||
|
AC_LANG_PROGRAM([[
|
||||||
|
/* Older Minix versions may need <net/gen/netdb.h> here instead */
|
||||||
|
#include <netdb.h>
|
||||||
|
]],[[
|
||||||
|
gethostbyname("www.dummysite.com");
|
||||||
|
]])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
HAVE_GETHOSTBYNAME="1"
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||||
then
|
then
|
||||||
dnl This is for eCos with a stubbed DNS implementation
|
dnl This is for eCos with a stubbed DNS implementation
|
||||||
AC_MSG_CHECKING([for gethostbyname for eCos])
|
AC_MSG_CHECKING([for gethostbyname for eCos])
|
||||||
AC_TRY_LINK([
|
AC_LINK_IFELSE([
|
||||||
|
AC_LANG_PROGRAM([[
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <netdb.h>],
|
#include <netdb.h>
|
||||||
[gethostbyname("www.dummysite.com");],
|
]],[[
|
||||||
[ dnl worked!
|
gethostbyname("www.dummysite.com");
|
||||||
AC_MSG_RESULT([yes])
|
]])
|
||||||
HAVE_GETHOSTBYNAME="1"],
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT([yes])
|
||||||
)
|
HAVE_GETHOSTBYNAME="1"
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||||
@@ -261,6 +344,12 @@ fi
|
|||||||
dnl socket lib?
|
dnl socket lib?
|
||||||
AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
|
AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
|
||||||
|
|
||||||
|
dnl **********************************************************************
|
||||||
|
dnl In case that function clock_gettime with monotonic timer is available,
|
||||||
|
dnl check for additional required libraries.
|
||||||
|
dnl **********************************************************************
|
||||||
|
CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether to use libgcc])
|
AC_MSG_CHECKING([whether to use libgcc])
|
||||||
AC_ARG_ENABLE(libgcc,
|
AC_ARG_ENABLE(libgcc,
|
||||||
AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
|
AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
|
||||||
@@ -356,18 +445,6 @@ dnl **********************************************************************
|
|||||||
dnl Checks for header files.
|
dnl Checks for header files.
|
||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
|
|
||||||
dnl **********************************************************************
|
|
||||||
dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
|
|
||||||
dnl and ws2tcpip.h take precedence over any other further checks which
|
|
||||||
dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
|
|
||||||
dnl this specific header files. And do them before its results are used.
|
|
||||||
dnl **********************************************************************
|
|
||||||
|
|
||||||
CURL_CHECK_HEADER_WINDOWS
|
|
||||||
CURL_CHECK_HEADER_WINSOCK
|
|
||||||
CURL_CHECK_HEADER_WINSOCK2
|
|
||||||
CURL_CHECK_HEADER_WS2TCPIP
|
|
||||||
|
|
||||||
CURL_CHECK_HEADER_MALLOC
|
CURL_CHECK_HEADER_MALLOC
|
||||||
|
|
||||||
dnl check for a few basic system headers we need
|
dnl check for a few basic system headers we need
|
||||||
@@ -383,7 +460,9 @@ AC_CHECK_HEADERS(
|
|||||||
netinet/tcp.h \
|
netinet/tcp.h \
|
||||||
net/if.h \
|
net/if.h \
|
||||||
errno.h \
|
errno.h \
|
||||||
|
strings.h \
|
||||||
stdbool.h \
|
stdbool.h \
|
||||||
|
time.h \
|
||||||
arpa/nameser.h \
|
arpa/nameser.h \
|
||||||
arpa/nameser_compat.h \
|
arpa/nameser_compat.h \
|
||||||
arpa/inet.h,
|
arpa/inet.h,
|
||||||
@@ -851,4 +930,5 @@ if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
|
|||||||
[a suitable file/device to read random data from])
|
[a suitable file/device to read random data from])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_OUTPUT(Makefile libcares.pc)
|
AC_CONFIG_FILES([Makefile libcares.pc])
|
||||||
|
AC_OUTPUT
|
||||||
|
@@ -38,11 +38,11 @@ if(!-f "configure") {
|
|||||||
`./buildconf`;
|
`./buildconf`;
|
||||||
}
|
}
|
||||||
print "adding $version in the configure.ac file\n";
|
print "adding $version in the configure.ac file\n";
|
||||||
`sed -e 's/AM_INIT_AUTOMAKE(c-ares, CVS)/AM_INIT_AUTOMAKE(c-ares, $version)/' < configure.ac > configure.ac-rel`;
|
`sed -e 's/AC_INIT.*/AC_INIT([c-ares], [$version])/' < configure.ac > configure.ac.dist`;
|
||||||
|
|
||||||
# now make a new configure script with this
|
# now make a new configure script with this
|
||||||
print "makes a new configure script\n";
|
print "makes a new configure script\n";
|
||||||
`autoconf configure.ac-rel >configure`;
|
`autoconf configure.ac.dist >configure`;
|
||||||
|
|
||||||
# now run this new configure to get a fine makefile
|
# now run this new configure to get a fine makefile
|
||||||
print "running configure\n";
|
print "running configure\n";
|
||||||
@@ -53,6 +53,6 @@ print "running make dist\n";
|
|||||||
`make dist`;
|
`make dist`;
|
||||||
|
|
||||||
print "removing temporary configure.ac file\n";
|
print "removing temporary configure.ac file\n";
|
||||||
`rm configure.ac-rel`;
|
`rm configure.ac.dist`;
|
||||||
|
|
||||||
print "NOTE: now cvs tag this release!\n";
|
print "NOTE: now cvs tag this release!\n";
|
||||||
|
@@ -29,13 +29,6 @@ struct iovec
|
|||||||
int ares_writev (SOCKET s, const struct iovec *vector, size_t count);
|
int ares_writev (SOCKET s, const struct iovec *vector, size_t count);
|
||||||
#define writev(s,vect,count) ares_writev(s,vect,count)
|
#define writev(s,vect,count) ares_writev(s,vect,count)
|
||||||
|
|
||||||
#ifndef HAVE_GETTIMEOFDAY
|
|
||||||
struct timezone { int dummy; };
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int ares_gettimeofday(struct timeval *tv, struct timezone *tz);
|
|
||||||
#define gettimeofday(tv,tz) ares_gettimeofday(tv,tz)
|
|
||||||
|
|
||||||
#endif /* !NETWARE */
|
#endif /* !NETWARE */
|
||||||
|
|
||||||
#define NS_CMPRSFLGS 0xc0
|
#define NS_CMPRSFLGS 0xc0
|
||||||
|
@@ -100,11 +100,10 @@ struct timeval {
|
|||||||
* definition is present the other one also is available.
|
* definition is present the other one also is available.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(HAVE_SOCKLEN_T)
|
#if defined(WIN32) && !defined(HAVE_CONFIG_H)
|
||||||
# if ( defined(_MSC_VER) && !defined(INET_ADDRSTRLEN) ) || \
|
# if ( defined(_MSC_VER) && !defined(INET_ADDRSTRLEN) ) || \
|
||||||
(!defined(_MSC_VER) && !defined(HAVE_WS2TCPIP_H) )
|
(!defined(_MSC_VER) && !defined(HAVE_WS2TCPIP_H) )
|
||||||
# define socklen_t int
|
# define socklen_t int
|
||||||
# define HAVE_SOCKLEN_T
|
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
2
ares/vc/.cvsignore
Normal file
2
ares/vc/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
vc.ncb
|
||||||
|
vc.opt
|
3
ares/vc/acountry/.cvsignore
Normal file
3
ares/vc/acountry/.cvsignore
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
acountry.dep
|
||||||
|
acountry.mak
|
||||||
|
acountry.plg
|
110
ares/vc/acountry/acountry.dsp
Normal file
110
ares/vc/acountry/acountry.dsp
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
# Microsoft Developer Studio Project File - Name="acountry" - Package Owner=<4>
|
||||||
|
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||||
|
# ** DO NOT EDIT **
|
||||||
|
|
||||||
|
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||||
|
|
||||||
|
CFG=acountry - Win32 Debug
|
||||||
|
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||||
|
!MESSAGE use the Export Makefile command and run
|
||||||
|
!MESSAGE
|
||||||
|
!MESSAGE NMAKE /f "acountry.mak".
|
||||||
|
!MESSAGE
|
||||||
|
!MESSAGE You can specify a configuration when running NMAKE
|
||||||
|
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||||
|
!MESSAGE
|
||||||
|
!MESSAGE NMAKE /f "acountry.mak" CFG="acountry - Win32 Debug"
|
||||||
|
!MESSAGE
|
||||||
|
!MESSAGE Possible choices for configuration are:
|
||||||
|
!MESSAGE
|
||||||
|
!MESSAGE "acountry - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||||
|
!MESSAGE "acountry - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||||
|
!MESSAGE
|
||||||
|
|
||||||
|
# Begin Project
|
||||||
|
# PROP AllowPerConfigDependencies 0
|
||||||
|
# PROP Scc_ProjName ""
|
||||||
|
# PROP Scc_LocalPath ""
|
||||||
|
CPP=cl.exe
|
||||||
|
RSC=rc.exe
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "acountry - Win32 Release"
|
||||||
|
|
||||||
|
# PROP BASE Use_MFC 0
|
||||||
|
# PROP BASE Use_Debug_Libraries 0
|
||||||
|
# PROP BASE Output_Dir "Release"
|
||||||
|
# PROP BASE Intermediate_Dir "Release"
|
||||||
|
# PROP BASE Target_Dir ""
|
||||||
|
# PROP Use_MFC 0
|
||||||
|
# PROP Use_Debug_Libraries 0
|
||||||
|
# PROP Output_Dir "Release"
|
||||||
|
# PROP Intermediate_Dir "Release"
|
||||||
|
# PROP Ignore_Export_Lib 0
|
||||||
|
# PROP Target_Dir ""
|
||||||
|
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||||
|
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||||
|
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||||
|
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||||
|
BSC32=bscmake.exe
|
||||||
|
# ADD BASE BSC32 /nologo
|
||||||
|
# ADD BSC32 /nologo
|
||||||
|
LINK32=link.exe
|
||||||
|
# ADD BASE LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /machine:I386 /libpath:"..\areslib\Release"
|
||||||
|
# ADD LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /machine:I386 /libpath:"..\areslib\Release"
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "acountry - Win32 Debug"
|
||||||
|
|
||||||
|
# PROP BASE Use_MFC 0
|
||||||
|
# PROP BASE Use_Debug_Libraries 1
|
||||||
|
# PROP BASE Output_Dir "Debug"
|
||||||
|
# PROP BASE Intermediate_Dir "Debug"
|
||||||
|
# PROP BASE Target_Dir ""
|
||||||
|
# PROP Use_MFC 0
|
||||||
|
# PROP Use_Debug_Libraries 1
|
||||||
|
# PROP Output_Dir "Debug"
|
||||||
|
# PROP Intermediate_Dir "Debug"
|
||||||
|
# PROP Ignore_Export_Lib 0
|
||||||
|
# PROP Target_Dir ""
|
||||||
|
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||||
|
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||||
|
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||||
|
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||||
|
BSC32=bscmake.exe
|
||||||
|
# ADD BASE BSC32 /nologo
|
||||||
|
# ADD BSC32 /nologo
|
||||||
|
LINK32=link.exe
|
||||||
|
# ADD BASE LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\areslib\Debug"
|
||||||
|
# ADD LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\areslib\Debug"
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
# Begin Target
|
||||||
|
|
||||||
|
# Name "acountry - Win32 Release"
|
||||||
|
# Name "acountry - Win32 Debug"
|
||||||
|
# Begin Group "Source Files"
|
||||||
|
|
||||||
|
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\acountry.c
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\ares_getopt.c
|
||||||
|
# End Source File
|
||||||
|
# End Group
|
||||||
|
# Begin Group "Header Files"
|
||||||
|
|
||||||
|
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\ares_getopt.h
|
||||||
|
# End Source File
|
||||||
|
# End Group
|
||||||
|
# Begin Group "Resource Files"
|
||||||
|
|
||||||
|
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||||
|
# End Group
|
||||||
|
# End Target
|
||||||
|
# End Project
|
3
ares/vc/adig/.cvsignore
Normal file
3
ares/vc/adig/.cvsignore
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
adig.dep
|
||||||
|
adig.mak
|
||||||
|
adig.plg
|
@@ -1,2 +0,0 @@
|
|||||||
# Microsoft Developer Studio Generated Dependency File, included by adig.mak
|
|
||||||
|
|
@@ -41,15 +41,15 @@ RSC=rc.exe
|
|||||||
# PROP Intermediate_Dir "Release"
|
# PROP Intermediate_Dir "Release"
|
||||||
# PROP Ignore_Export_Lib 0
|
# PROP Ignore_Export_Lib 0
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||||
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 ws2_32.lib advapi32.lib /nologo /subsystem:console /machine:I386
|
# ADD BASE LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /machine:I386 /libpath:"..\areslib\Release"
|
||||||
# ADD LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /machine:I386 /libpath:"..\areslib\Release"
|
# ADD LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /machine:I386 /libpath:"..\areslib\Release"
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "adig - Win32 Debug"
|
!ELSEIF "$(CFG)" == "adig - Win32 Debug"
|
||||||
@@ -65,15 +65,15 @@ LINK32=link.exe
|
|||||||
# PROP Intermediate_Dir "Debug"
|
# PROP Intermediate_Dir "Debug"
|
||||||
# PROP Ignore_Export_Lib 0
|
# PROP Ignore_Export_Lib 0
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 ws2_32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
# ADD BASE LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\areslib\Debug"
|
||||||
# ADD LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\areslib\Debug"
|
# ADD LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\areslib\Debug"
|
||||||
|
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
3
ares/vc/ahost/.cvsignore
Normal file
3
ares/vc/ahost/.cvsignore
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
ahost.dep
|
||||||
|
ahost.mak
|
||||||
|
ahost.plg
|
@@ -1,2 +0,0 @@
|
|||||||
# Microsoft Developer Studio Generated Dependency File, included by ahost.mak
|
|
||||||
|
|
@@ -41,15 +41,15 @@ RSC=rc.exe
|
|||||||
# PROP Intermediate_Dir "Release"
|
# PROP Intermediate_Dir "Release"
|
||||||
# PROP Ignore_Export_Lib 0
|
# PROP Ignore_Export_Lib 0
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||||
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
|
||||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 ws2_32.lib advapi32.lib /nologo /subsystem:console /machine:I386
|
# ADD BASE LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /machine:I386 /libpath:"..\areslib\Release"
|
||||||
# ADD LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /machine:I386 /libpath:"..\areslib\Release"
|
# ADD LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /machine:I386 /libpath:"..\areslib\Release"
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "ahost - Win32 Debug"
|
!ELSEIF "$(CFG)" == "ahost - Win32 Debug"
|
||||||
@@ -65,15 +65,15 @@ LINK32=link.exe
|
|||||||
# PROP Intermediate_Dir "Debug"
|
# PROP Intermediate_Dir "Debug"
|
||||||
# PROP Ignore_Export_Lib 0
|
# PROP Ignore_Export_Lib 0
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
|
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
|
||||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 ws2_32.lib advapi32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
# ADD BASE LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\areslib\Debug"
|
||||||
# ADD LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\areslib\Debug"
|
# ADD LINK32 ws2_32.lib advapi32.lib areslib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\areslib\Debug"
|
||||||
|
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
3
ares/vc/areslib/.cvsignore
Normal file
3
ares/vc/areslib/.cvsignore
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
areslib.dep
|
||||||
|
areslib.mak
|
||||||
|
areslib.plg
|
@@ -1,2 +0,0 @@
|
|||||||
# Microsoft Developer Studio Generated Dependency File, included by areslib.mak
|
|
||||||
|
|
@@ -40,8 +40,8 @@ RSC=rc.exe
|
|||||||
# PROP Output_Dir "Release"
|
# PROP Output_Dir "Release"
|
||||||
# PROP Intermediate_Dir "Release"
|
# PROP Intermediate_Dir "Release"
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c
|
||||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /FD /c
|
||||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
@@ -63,8 +63,8 @@ LIB32=link.exe -lib
|
|||||||
# PROP Output_Dir "Debug"
|
# PROP Output_Dir "Debug"
|
||||||
# PROP Intermediate_Dir "Debug"
|
# PROP Intermediate_Dir "Debug"
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c
|
||||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FD /GZ /c
|
||||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
@@ -97,6 +97,10 @@ SOURCE=..\..\ares__read_line.c
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\ares__timeval.c
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\ares_cancel.c
|
SOURCE=..\..\ares_cancel.c
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -109,6 +113,10 @@ SOURCE=..\..\ares_expand_name.c
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\ares_expand_string.c
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\ares_fds.c
|
SOURCE=..\..\ares_fds.c
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
@@ -3,6 +3,21 @@ Microsoft Developer Studio Workspace File, Format Version 6.00
|
|||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
Project: "acountry"=".\acountry\acountry.dsp" - Package Owner=<4>
|
||||||
|
|
||||||
|
Package=<5>
|
||||||
|
{{{
|
||||||
|
}}}
|
||||||
|
|
||||||
|
Package=<4>
|
||||||
|
{{{
|
||||||
|
Begin Project Dependency
|
||||||
|
Project_Dep_Name areslib
|
||||||
|
End Project Dependency
|
||||||
|
}}}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
Project: "adig"=".\adig\adig.dsp" - Package Owner=<4>
|
Project: "adig"=".\adig\adig.dsp" - Package Owner=<4>
|
||||||
|
|
||||||
Package=<5>
|
Package=<5>
|
||||||
|
@@ -55,37 +55,6 @@ ares_strcasecmp(const char *a, const char *b)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* Number of micro-seconds between the beginning of the Windows epoch
|
|
||||||
* (Jan. 1, 1601) and the Unix epoch (Jan. 1, 1970).
|
|
||||||
*/
|
|
||||||
#if defined(_MSC_VER) || defined(__WATCOMC__)
|
|
||||||
#define EPOCH_FILETIME 11644473600000000Ui64
|
|
||||||
#else
|
|
||||||
#define EPOCH_FILETIME 11644473600000000ULL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int
|
|
||||||
ares_gettimeofday(struct timeval *tv, struct timezone *tz)
|
|
||||||
{
|
|
||||||
FILETIME ft;
|
|
||||||
LARGE_INTEGER li;
|
|
||||||
__int64 t;
|
|
||||||
|
|
||||||
if (tv)
|
|
||||||
{
|
|
||||||
GetSystemTimeAsFileTime(&ft);
|
|
||||||
li.LowPart = ft.dwLowDateTime;
|
|
||||||
li.HighPart = ft.dwHighDateTime;
|
|
||||||
t = li.QuadPart / 10; /* In micro-second intervals */
|
|
||||||
t -= EPOCH_FILETIME; /* Offset to the Epoch time */
|
|
||||||
tv->tv_sec = (long)(t / 1000000);
|
|
||||||
tv->tv_usec = (long)(t % 1000000);
|
|
||||||
}
|
|
||||||
(void) tz;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ares_writev (ares_socket_t s, const struct iovec *vector, size_t count)
|
ares_writev (ares_socket_t s, const struct iovec *vector, size_t count)
|
||||||
{
|
{
|
||||||
|
@@ -3,11 +3,8 @@ REM set up a CVS tree to build when there's no autotools
|
|||||||
REM $Revision$
|
REM $Revision$
|
||||||
REM $Date$
|
REM $Date$
|
||||||
|
|
||||||
REM create ca-bundle.h
|
|
||||||
echo /* This file is generated automatically */ >lib\ca-bundle.h
|
|
||||||
|
|
||||||
REM create hugehelp.c
|
REM create hugehelp.c
|
||||||
copy src\hugehelp.c.cvs src\hugehelp.c
|
copy src\hugehelp.c.cvs src\hugehelp.c
|
||||||
|
|
||||||
REM create Makefile
|
REM create Makefile
|
||||||
copy Makefile.dist Makefile
|
copy Makefile.dist Makefile
|
||||||
|
364
configure.ac
364
configure.ac
@@ -25,7 +25,7 @@ dnl Process this file with autoconf to produce a configure script.
|
|||||||
AC_PREREQ(2.57)
|
AC_PREREQ(2.57)
|
||||||
|
|
||||||
dnl We don't know the version number "statically" so we use a dash here
|
dnl We don't know the version number "statically" so we use a dash here
|
||||||
AC_INIT(curl, [-], [a suitable curl mailing list => http://curl.haxx.se/mail/])
|
AC_INIT([curl], [-], [a suitable curl mailing list => http://curl.haxx.se/mail/])
|
||||||
|
|
||||||
dnl configure script copyright
|
dnl configure script copyright
|
||||||
AC_COPYRIGHT([Copyright (c) 1998 - 2008 Daniel Stenberg, <daniel@haxx.se>
|
AC_COPYRIGHT([Copyright (c) 1998 - 2008 Daniel Stenberg, <daniel@haxx.se>
|
||||||
@@ -151,7 +151,7 @@ AC_PROG_LIBTOOL
|
|||||||
|
|
||||||
AC_MSG_CHECKING([if we need -no-undefined])
|
AC_MSG_CHECKING([if we need -no-undefined])
|
||||||
case $host in
|
case $host in
|
||||||
*-*-cygwin | *-*-mingw* | *-*-pw32*)
|
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
|
||||||
need_no_undefined=yes
|
need_no_undefined=yes
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@@ -220,12 +220,23 @@ dnl this specific header files. And do them before its results are used.
|
|||||||
dnl **********************************************************************
|
dnl **********************************************************************
|
||||||
|
|
||||||
CURL_CHECK_HEADER_WINDOWS
|
CURL_CHECK_HEADER_WINDOWS
|
||||||
CURL_CHECK_HEADER_WINSOCK
|
CURL_CHECK_NATIVE_WINDOWS
|
||||||
CURL_CHECK_HEADER_WINSOCK2
|
case X-"$ac_cv_native_windows" in
|
||||||
CURL_CHECK_HEADER_WS2TCPIP
|
X-yes)
|
||||||
|
CURL_CHECK_HEADER_WINSOCK
|
||||||
CURL_CHECK_HEADER_WINLDAP
|
CURL_CHECK_HEADER_WINSOCK2
|
||||||
CURL_CHECK_HEADER_WINBER
|
CURL_CHECK_HEADER_WS2TCPIP
|
||||||
|
CURL_CHECK_HEADER_WINLDAP
|
||||||
|
CURL_CHECK_HEADER_WINBER
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
ac_cv_header_winsock_h="no"
|
||||||
|
ac_cv_header_winsock2_h="no"
|
||||||
|
ac_cv_header_ws2tcpip_h="no"
|
||||||
|
ac_cv_header_winldap_h="no"
|
||||||
|
ac_cv_header_winber_h="no"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
dnl **********************************************************************
|
dnl **********************************************************************
|
||||||
dnl platform/compiler/architecture specific checks/flags
|
dnl platform/compiler/architecture specific checks/flags
|
||||||
@@ -478,64 +489,116 @@ then
|
|||||||
AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
|
AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
|
||||||
my_ac_save_LIBS=$LIBS
|
my_ac_save_LIBS=$LIBS
|
||||||
LIBS="-lnsl -lsocket $LIBS"
|
LIBS="-lnsl -lsocket $LIBS"
|
||||||
AC_TRY_LINK( ,
|
AC_LINK_IFELSE([
|
||||||
[gethostbyname();],
|
AC_LANG_PROGRAM([[
|
||||||
[ dnl found it!
|
]],[[
|
||||||
HAVE_GETHOSTBYNAME="1"
|
gethostbyname();
|
||||||
AC_MSG_RESULT([yes])],
|
]])
|
||||||
[ dnl failed!
|
],[
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([yes])
|
||||||
dnl restore LIBS
|
HAVE_GETHOSTBYNAME="1"
|
||||||
LIBS=$my_ac_save_LIBS]
|
],[
|
||||||
)
|
AC_MSG_RESULT([no])
|
||||||
|
LIBS=$my_ac_save_LIBS
|
||||||
|
])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||||
then
|
then
|
||||||
dnl This is for Msys/Mingw
|
dnl This is for winsock systems
|
||||||
AC_MSG_CHECKING([for gethostbyname in ws2_32])
|
if test "$ac_cv_header_windows_h" = "yes"; then
|
||||||
my_ac_save_LIBS=$LIBS
|
if test "$ac_cv_header_winsock_h" = "yes"; then
|
||||||
LIBS="-lws2_32 $LIBS"
|
case $host in
|
||||||
AC_TRY_LINK([#include <winsock2.h>],
|
*-*-mingw32ce*)
|
||||||
[gethostbyname("www.dummysite.com");],
|
winsock_LIB="-lwinsock"
|
||||||
[ dnl worked!
|
;;
|
||||||
ws2="yes"
|
*)
|
||||||
AC_MSG_RESULT([yes])
|
winsock_LIB="-lwsock32"
|
||||||
HAVE_GETHOSTBYNAME="1"],
|
;;
|
||||||
[ dnl failed, restore LIBS
|
esac
|
||||||
LIBS=$my_ac_save_LIBS
|
fi
|
||||||
AC_MSG_RESULT(no)]
|
if test "$ac_cv_header_winsock2_h" = "yes"; then
|
||||||
)
|
winsock_LIB="-lws2_32"
|
||||||
|
fi
|
||||||
|
if test ! -z "$winsock_LIB"; then
|
||||||
|
my_ac_save_LIBS=$LIBS
|
||||||
|
LIBS="$winsock_LIB $LIBS"
|
||||||
|
AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
|
||||||
|
AC_LINK_IFELSE([
|
||||||
|
AC_LANG_PROGRAM([[
|
||||||
|
#ifdef HAVE_WINDOWS_H
|
||||||
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#endif
|
||||||
|
#include <windows.h>
|
||||||
|
#ifdef HAVE_WINSOCK2_H
|
||||||
|
#include <winsock2.h>
|
||||||
|
#else
|
||||||
|
#ifdef HAVE_WINSOCK_H
|
||||||
|
#include <winsock.h>
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
]],[[
|
||||||
|
gethostbyname("www.dummysite.com");
|
||||||
|
]])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
HAVE_GETHOSTBYNAME="1"
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
winsock_LIB=""
|
||||||
|
LIBS=$my_ac_save_LIBS
|
||||||
|
])
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||||
then
|
then
|
||||||
dnl This is for Minix 3.1
|
dnl This is for Minix 3.1
|
||||||
AC_MSG_CHECKING([for gethostbyname for Minix 3])
|
AC_MSG_CHECKING([for gethostbyname for Minix 3])
|
||||||
AC_TRY_LINK([
|
AC_LINK_IFELSE([
|
||||||
|
AC_LANG_PROGRAM([[
|
||||||
/* Older Minix versions may need <net/gen/netdb.h> here instead */
|
/* Older Minix versions may need <net/gen/netdb.h> here instead */
|
||||||
#include <netdb.h>],
|
#include <netdb.h>
|
||||||
[gethostbyname("www.dummysite.com");],
|
]],[[
|
||||||
[ dnl worked!
|
gethostbyname("www.dummysite.com");
|
||||||
AC_MSG_RESULT([yes])
|
]])
|
||||||
HAVE_GETHOSTBYNAME="1"],
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT([yes])
|
||||||
)
|
HAVE_GETHOSTBYNAME="1"
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||||
then
|
then
|
||||||
dnl This is for eCos with a stubbed DNS implementation
|
dnl This is for eCos with a stubbed DNS implementation
|
||||||
AC_MSG_CHECKING([for gethostbyname for eCos])
|
AC_MSG_CHECKING([for gethostbyname for eCos])
|
||||||
AC_TRY_LINK([
|
AC_LINK_IFELSE([
|
||||||
|
AC_LANG_PROGRAM([[
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <netdb.h>],
|
#include <netdb.h>
|
||||||
[gethostbyname("www.dummysite.com");],
|
]],[[
|
||||||
[ dnl worked!
|
gethostbyname("www.dummysite.com");
|
||||||
AC_MSG_RESULT([yes])
|
]])
|
||||||
HAVE_GETHOSTBYNAME="1"],
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT([yes])
|
||||||
)
|
HAVE_GETHOSTBYNAME="1"
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
])
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||||
|
then
|
||||||
|
dnl gethostbyname in the network lib - for Haiku OS
|
||||||
|
AC_CHECK_LIB(network, gethostbyname,
|
||||||
|
[HAVE_GETHOSTBYNAME="1"
|
||||||
|
LIBS="$LIBS -lnetwork"
|
||||||
|
])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$HAVE_GETHOSTBYNAME" != "1"
|
if test "$HAVE_GETHOSTBYNAME" != "1"
|
||||||
@@ -567,6 +630,12 @@ fi
|
|||||||
dnl socket lib?
|
dnl socket lib?
|
||||||
AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
|
AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ])
|
||||||
|
|
||||||
|
dnl **********************************************************************
|
||||||
|
dnl In case that function clock_gettime with monotonic timer is available,
|
||||||
|
dnl check for additional required libraries.
|
||||||
|
dnl **********************************************************************
|
||||||
|
CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
|
||||||
|
|
||||||
dnl **********************************************************************
|
dnl **********************************************************************
|
||||||
dnl The preceding library checks are all potentially useful for test
|
dnl The preceding library checks are all potentially useful for test
|
||||||
dnl servers (for providing networking support). Save the list of required
|
dnl servers (for providing networking support). Save the list of required
|
||||||
@@ -674,36 +743,6 @@ if test x$CURL_DISABLE_LDAP != x1 ; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl **********************************************************************
|
|
||||||
dnl Check for the presence of the winmm library.
|
|
||||||
dnl **********************************************************************
|
|
||||||
|
|
||||||
case $host in
|
|
||||||
*-*-cygwin*)
|
|
||||||
dnl Under Cygwin, winmm exists but is not needed as WIN32 is not #defined
|
|
||||||
dnl and gettimeofday() will be used regardless of the outcome of this test.
|
|
||||||
dnl Skip this test, otherwise -lwinmm will be needlessly added to LIBS
|
|
||||||
dnl (and recorded as such in the .la file, potentially affecting downstream
|
|
||||||
dnl clients of the library.)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
AC_MSG_CHECKING([for timeGetTime in winmm])
|
|
||||||
my_ac_save_LIBS=$LIBS
|
|
||||||
LIBS="-lwinmm $LIBS"
|
|
||||||
AC_TRY_LINK([#include <windef.h>
|
|
||||||
#include <mmsystem.h>
|
|
||||||
],
|
|
||||||
[timeGetTime();],
|
|
||||||
[ dnl worked!
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
],
|
|
||||||
[ dnl failed, restore LIBS
|
|
||||||
LIBS=$my_ac_save_LIBS
|
|
||||||
AC_MSG_RESULT(no)]
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
dnl **********************************************************************
|
dnl **********************************************************************
|
||||||
dnl Checks for IPv6
|
dnl Checks for IPv6
|
||||||
dnl **********************************************************************
|
dnl **********************************************************************
|
||||||
@@ -983,15 +1022,14 @@ if test x"$want_gss" = xyes; then
|
|||||||
gnu_gss=yes
|
gnu_gss=yes
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
dnl not found, check MIT
|
dnl not found, check Heimdal or MIT
|
||||||
AC_CHECK_HEADER(gssapi/gssapi.h,
|
AC_CHECK_HEADERS(
|
||||||
[
|
[gssapi/gssapi.h gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
|
||||||
dnl found in the given dirs
|
[],
|
||||||
AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
|
[not_mit=1])
|
||||||
],
|
if test "x$not_mit" = "x1"; then
|
||||||
[
|
dnl MIT not found, check for Heimdal
|
||||||
dnl not found, check for Heimdal
|
AC_CHECK_HEADER(gssapi.h,
|
||||||
AC_CHECK_HEADER(gssapi.h,
|
|
||||||
[
|
[
|
||||||
dnl found
|
dnl found
|
||||||
AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries])
|
AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries])
|
||||||
@@ -1002,8 +1040,30 @@ if test x"$want_gss" = xyes; then
|
|||||||
AC_MSG_WARN(disabling GSSAPI since no header files was found)
|
AC_MSG_WARN(disabling GSSAPI since no header files was found)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
else
|
||||||
)
|
dnl MIT found
|
||||||
|
AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
|
||||||
|
dnl check if we have a really old MIT kerberos (<= 1.2)
|
||||||
|
AC_MSG_CHECKING([if gssapi headers declare GSS_C_NT_HOSTBASED_SERVICE])
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
#include <gssapi/gssapi.h>
|
||||||
|
#include <gssapi/gssapi_generic.h>
|
||||||
|
#include <gssapi/gssapi_krb5.h>
|
||||||
|
],[
|
||||||
|
gss_import_name(
|
||||||
|
(OM_uint32 *)0,
|
||||||
|
(gss_buffer_t)0,
|
||||||
|
GSS_C_NT_HOSTBASED_SERVICE,
|
||||||
|
(gss_name_t *)0);
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
AC_DEFINE(HAVE_OLD_GSSMIT, 1, [if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE])
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
fi
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
@@ -1241,21 +1301,23 @@ if test X"$OPT_SSL" != Xno; then
|
|||||||
dnl and acting like OpenSSL.
|
dnl and acting like OpenSSL.
|
||||||
|
|
||||||
AC_MSG_CHECKING([for yaSSL using OpenSSL compatibility mode])
|
AC_MSG_CHECKING([for yaSSL using OpenSSL compatibility mode])
|
||||||
AC_TRY_COMPILE([
|
AC_COMPILE_IFELSE([
|
||||||
|
AC_LANG_PROGRAM([[
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
],[
|
]],[[
|
||||||
#if defined(YASSL_VERSION) && defined(OPENSSL_VERSION_NUMBER)
|
#if defined(YASSL_VERSION) && defined(OPENSSL_VERSION_NUMBER)
|
||||||
int dummy = SSL_ERROR_NONE;
|
int dummy = SSL_ERROR_NONE;
|
||||||
#else
|
#else
|
||||||
Not the yaSSL OpenSSL compatibility header.
|
Not the yaSSL OpenSSL compatibility header.
|
||||||
#endif
|
#endif
|
||||||
],[
|
]])
|
||||||
AC_MSG_RESULT([yes])
|
],[
|
||||||
AC_DEFINE_UNQUOTED(USE_YASSLEMUL, 1,
|
AC_MSG_RESULT([yes])
|
||||||
[Define to 1 if using yaSSL in OpenSSL compatibility mode.])
|
AC_DEFINE_UNQUOTED(USE_YASSLEMUL, 1,
|
||||||
curl_ssl_msg="enabled (OpenSSL emulation by yaSSL)"
|
[Define to 1 if using yaSSL in OpenSSL compatibility mode.])
|
||||||
],[
|
curl_ssl_msg="enabled (OpenSSL emulation by yaSSL)"
|
||||||
AC_MSG_RESULT([no])
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
])
|
])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -1623,9 +1685,6 @@ dnl **********************************************************************
|
|||||||
|
|
||||||
CURL_CHECK_CA_BUNDLE
|
CURL_CHECK_CA_BUNDLE
|
||||||
|
|
||||||
AM_CONDITIONAL(CABUNDLE, test x$ca != xno)
|
|
||||||
AM_CONDITIONAL(CAPATH, test x$capath != xno)
|
|
||||||
|
|
||||||
dnl **********************************************************************
|
dnl **********************************************************************
|
||||||
dnl Check for the presence of IDN libraries and headers
|
dnl Check for the presence of IDN libraries and headers
|
||||||
dnl **********************************************************************
|
dnl **********************************************************************
|
||||||
@@ -1843,6 +1902,7 @@ AC_CHECK_HEADERS(
|
|||||||
arpa/inet.h \
|
arpa/inet.h \
|
||||||
net/if.h \
|
net/if.h \
|
||||||
netinet/in.h \
|
netinet/in.h \
|
||||||
|
sys/un.h \
|
||||||
netinet/tcp.h \
|
netinet/tcp.h \
|
||||||
netdb.h \
|
netdb.h \
|
||||||
sys/sockio.h \
|
sys/sockio.h \
|
||||||
@@ -1889,6 +1949,9 @@ dnl default includes
|
|||||||
#ifdef HAVE_NETINET_IN_H
|
#ifdef HAVE_NETINET_IN_H
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_SYS_UN_H
|
||||||
|
#include <sys/un.h>
|
||||||
|
#endif
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1952,7 +2015,7 @@ TYPE_SIG_ATOMIC_T
|
|||||||
|
|
||||||
AC_TYPE_SIGNAL
|
AC_TYPE_SIGNAL
|
||||||
|
|
||||||
AC_FUNC_SELECT_ARGTYPES
|
CURL_CHECK_FUNC_SELECT
|
||||||
|
|
||||||
CURL_CHECK_FUNC_RECV
|
CURL_CHECK_FUNC_RECV
|
||||||
|
|
||||||
@@ -1973,7 +2036,6 @@ case $host in
|
|||||||
esac
|
esac
|
||||||
AC_CHECK_FUNCS( strtoll \
|
AC_CHECK_FUNCS( strtoll \
|
||||||
socket \
|
socket \
|
||||||
select \
|
|
||||||
strdup \
|
strdup \
|
||||||
strstr \
|
strstr \
|
||||||
strcasestr \
|
strcasestr \
|
||||||
@@ -2027,48 +2089,23 @@ if test "x$skipcheck" != "xyes"; then
|
|||||||
fi
|
fi
|
||||||
)
|
)
|
||||||
|
|
||||||
dnl For some reason, the check above doesn't properly detect select() with
|
|
||||||
dnl Msys/Mingw
|
|
||||||
if test "$ac_cv_func_select" = "no"; then
|
|
||||||
AC_MSG_CHECKING([for select in ws2_32])
|
|
||||||
AC_TRY_LINK([
|
|
||||||
#undef inline
|
|
||||||
#ifdef HAVE_WINDOWS_H
|
|
||||||
#ifndef WIN32_LEAN_AND_MEAN
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#endif
|
|
||||||
#include <windows.h>
|
|
||||||
#ifdef HAVE_WINSOCK2_H
|
|
||||||
#include <winsock2.h>
|
|
||||||
#else
|
|
||||||
#ifdef HAVE_WINSOCK_H
|
|
||||||
#include <winsock.h>
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
],[
|
|
||||||
select(0,(fd_set *)NULL,(fd_set *)NULL,(fd_set *)NULL,(struct timeval *)NULL);
|
|
||||||
],[
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
HAVE_SELECT="1"
|
|
||||||
AC_DEFINE_UNQUOTED(HAVE_SELECT, 1,
|
|
||||||
[Define to 1 if you have the select function.])
|
|
||||||
],[
|
|
||||||
AC_MSG_ERROR([You can't compile without a select])
|
|
||||||
])
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl sigsetjmp() might be a macro and no function so if it isn't found already
|
dnl sigsetjmp() might be a macro and no function so if it isn't found already
|
||||||
dnl we make an extra check here!
|
dnl we make an extra check here!
|
||||||
if test "$ac_cv_func_sigsetjmp" != "yes"; then
|
if test "$ac_cv_func_sigsetjmp" != "yes"; then
|
||||||
AC_MSG_CHECKING([for sigsetjmp defined as macro])
|
AC_MSG_CHECKING([for sigsetjmp defined as macro])
|
||||||
AC_TRY_LINK( [#include <setjmp.h>],
|
AC_LINK_IFELSE([
|
||||||
[sigjmp_buf jmpenv;
|
AC_LANG_PROGRAM([[
|
||||||
sigsetjmp(jmpenv, 1);],
|
#include <setjmp.h>
|
||||||
AC_MSG_RESULT(yes)
|
]],[[
|
||||||
AC_DEFINE(HAVE_SIGSETJMP, 1, [If you have sigsetjmp]),
|
sigjmp_buf jmpenv;
|
||||||
AC_MSG_RESULT(no)
|
sigsetjmp(jmpenv, 1);
|
||||||
)
|
]])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
AC_DEFINE(HAVE_SIGSETJMP, 1, [If you have sigsetjmp])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_CHECK_DECL(basename, ,
|
AC_CHECK_DECL(basename, ,
|
||||||
@@ -2242,25 +2279,26 @@ AC_HELP_STRING([--disable-ares],[Disable c-ares for name lookups]),
|
|||||||
dnl out and don't use the "embedded" ares dir (in which case we don't
|
dnl out and don't use the "embedded" ares dir (in which case we don't
|
||||||
dnl check it because it might not have been built yet)
|
dnl check it because it might not have been built yet)
|
||||||
AC_MSG_CHECKING([that c-ares is good and recent enough])
|
AC_MSG_CHECKING([that c-ares is good and recent enough])
|
||||||
AC_LINK_IFELSE( [
|
AC_LINK_IFELSE([
|
||||||
|
AC_LANG_PROGRAM([[
|
||||||
#include <ares.h>
|
#include <ares.h>
|
||||||
/* provide a set of dummy functions in case c-ares was built with debug */
|
/* set of dummy functions in case c-ares was built with debug */
|
||||||
void curl_dofree() { }
|
void curl_dofree() { }
|
||||||
void curl_sclose() { }
|
void curl_sclose() { }
|
||||||
void curl_domalloc() { }
|
void curl_domalloc() { }
|
||||||
|
void curl_docalloc() { }
|
||||||
int main(void)
|
void curl_socket() { }
|
||||||
{
|
]],[[
|
||||||
ares_channel channel;
|
ares_channel channel;
|
||||||
ares_cancel(channel); /* added in 1.2.0 */
|
ares_cancel(channel); /* added in 1.2.0 */
|
||||||
ares_process_fd(channel, 0, 0); /* added in 1.4.0 */
|
ares_process_fd(channel, 0, 0); /* added in 1.4.0 */
|
||||||
return 0;
|
]])
|
||||||
}
|
],[
|
||||||
],
|
AC_MSG_RESULT([yes])
|
||||||
AC_MSG_RESULT(yes),
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT([no])
|
||||||
AC_MSG_ERROR([c-ares library defective or too old])
|
AC_MSG_ERROR([c-ares library defective or too old])
|
||||||
)
|
])
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac ],
|
esac ],
|
||||||
@@ -2286,8 +2324,6 @@ AC_HELP_STRING([--disable-verbose],[Disable verbose strings]),
|
|||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
)
|
)
|
||||||
|
|
||||||
CURL_CHECK_NATIVE_WINDOWS
|
|
||||||
|
|
||||||
dnl ************************************************************
|
dnl ************************************************************
|
||||||
dnl enable SSPI support
|
dnl enable SSPI support
|
||||||
dnl
|
dnl
|
||||||
@@ -2417,15 +2453,15 @@ AC_HELP_STRING([--disable-hidden-symbols],[Leave all symbols with default visibi
|
|||||||
)
|
)
|
||||||
|
|
||||||
dnl ************************************************************
|
dnl ************************************************************
|
||||||
if test "x$ws2" = "xyes"; then
|
if test ! -z "$winsock_LIB"; then
|
||||||
|
|
||||||
dnl If ws2_32 is wanted, make sure it is the _last_ lib in LIBS (makes
|
dnl If ws2_32 is wanted, make sure it is the _last_ lib in LIBS (makes
|
||||||
dnl things work when built with c-ares). But we can't just move it last
|
dnl things work when built with c-ares). But we can't just move it last
|
||||||
dnl since then other stuff (SSL) won't build. So we simply append it to the
|
dnl since then other stuff (SSL) won't build. So we simply append it to the
|
||||||
dnl end.
|
dnl end.
|
||||||
|
|
||||||
LIBS="$LIBS -lws2_32"
|
LIBS="$LIBS $winsock_LIB"
|
||||||
TEST_SERVER_LIBS="$TEST_SERVER_LIBS -lws2_32"
|
TEST_SERVER_LIBS="$TEST_SERVER_LIBS $winsock_LIB"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -60,16 +60,24 @@ Euphoria
|
|||||||
http://rays-web.com/eulibcurl.htm
|
http://rays-web.com/eulibcurl.htm
|
||||||
|
|
||||||
Ferite
|
Ferite
|
||||||
|
|
||||||
Written by Paul Querna
|
Written by Paul Querna
|
||||||
http://www.ferite.org/
|
http://www.ferite.org/
|
||||||
|
|
||||||
Gambas
|
Gambas
|
||||||
|
|
||||||
http://gambas.sourceforge.net
|
http://gambas.sourceforge.net
|
||||||
|
|
||||||
glib/GTK+
|
glib/GTK+
|
||||||
|
|
||||||
Written by Richard Atterer
|
Written by Richard Atterer
|
||||||
http://atterer.net/glibcurl/
|
http://atterer.net/glibcurl/
|
||||||
|
|
||||||
|
Haskell
|
||||||
|
|
||||||
|
Written by Galois, Inc
|
||||||
|
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/curl
|
||||||
|
|
||||||
Java
|
Java
|
||||||
|
|
||||||
Maintained by [blank]
|
Maintained by [blank]
|
||||||
|
24
docs/INSTALL
24
docs/INSTALL
@@ -655,6 +655,19 @@ Minix
|
|||||||
make
|
make
|
||||||
|
|
||||||
|
|
||||||
|
Symbian OS
|
||||||
|
==========
|
||||||
|
The Symbian OS port uses the Symbian build system to compile. From the
|
||||||
|
packages/Symbian/group/ directory, run:
|
||||||
|
|
||||||
|
bldmake bldfiles
|
||||||
|
abld build
|
||||||
|
|
||||||
|
to compile and install curl and libcurl. If your Symbian SDK doesn't
|
||||||
|
include support for P.I.P.S., you will need to contact your SDK vendor
|
||||||
|
to obtain that first.
|
||||||
|
|
||||||
|
|
||||||
CROSS COMPILE
|
CROSS COMPILE
|
||||||
=============
|
=============
|
||||||
(This section was graciously brought to us by Jim Duey, with additions by
|
(This section was graciously brought to us by Jim Duey, with additions by
|
||||||
@@ -709,8 +722,8 @@ REDUCING SIZE
|
|||||||
size of libcurl for embedded applications where binary size is an
|
size of libcurl for embedded applications where binary size is an
|
||||||
important factor. First, be sure to set the CFLAGS variable when
|
important factor. First, be sure to set the CFLAGS variable when
|
||||||
configuring with any relevant compiler optimization flags to reduce the
|
configuring with any relevant compiler optimization flags to reduce the
|
||||||
size of the binary. For gcc, this would mean at minimum the -Os option
|
size of the binary. For gcc, this would mean at minimum the -Os option,
|
||||||
and probably the -march=X option as well, e.g.:
|
potentially the -march=X and -mdynamic-no-pic options as well, e.g.:
|
||||||
|
|
||||||
./configure CFLAGS='-Os' ...
|
./configure CFLAGS='-Os' ...
|
||||||
|
|
||||||
@@ -777,7 +790,8 @@ PORTS
|
|||||||
- PowerPC Linux
|
- PowerPC Linux
|
||||||
- PowerPC Mac OS 9
|
- PowerPC Mac OS 9
|
||||||
- PowerPC Mac OS X
|
- PowerPC Mac OS X
|
||||||
- SuperH4 Linux 2.6.X
|
- SH4 Linux 2.6.X
|
||||||
|
- SH4 OS21
|
||||||
- SINIX-Z v5
|
- SINIX-Z v5
|
||||||
- Sparc Linux
|
- Sparc Linux
|
||||||
- Sparc Solaris 2.4, 2.5, 2.5.1, 2.6, 7, 8, 9, 10
|
- Sparc Solaris 2.4, 2.5, 2.5.1, 2.6, 7, 8, 9, 10
|
||||||
@@ -785,6 +799,7 @@ PORTS
|
|||||||
- StrongARM (and other ARM) RISC OS 3.1, 4.02
|
- StrongARM (and other ARM) RISC OS 3.1, 4.02
|
||||||
- StrongARM/ARM7/ARM9 Linux 2.4, 2.6
|
- StrongARM/ARM7/ARM9 Linux 2.4, 2.6
|
||||||
- StrongARM NetBSD 1.4.1
|
- StrongARM NetBSD 1.4.1
|
||||||
|
- Symbian OS (P.I.P.S.)
|
||||||
- TPF
|
- TPF
|
||||||
- Ultrix 4.3a
|
- Ultrix 4.3a
|
||||||
- UNICOS 9.0
|
- UNICOS 9.0
|
||||||
@@ -794,16 +809,17 @@ PORTS
|
|||||||
- i386 Esix 4.1
|
- i386 Esix 4.1
|
||||||
- i386 FreeBSD
|
- i386 FreeBSD
|
||||||
- i386 HURD
|
- i386 HURD
|
||||||
|
- i386 Haiku OS
|
||||||
- i386 Linux 1.3, 2.0, 2.2, 2.3, 2.4, 2.6
|
- i386 Linux 1.3, 2.0, 2.2, 2.3, 2.4, 2.6
|
||||||
- i386 MINIX 3.1
|
- i386 MINIX 3.1
|
||||||
- i386 NetBSD
|
- i386 NetBSD
|
||||||
- i386 Novell NetWare
|
- i386 Novell NetWare
|
||||||
- i386 OS/2
|
- i386 OS/2
|
||||||
- i386 OpenBSD
|
- i386 OpenBSD
|
||||||
|
- i386 QNX 6
|
||||||
- i386 SCO unix
|
- i386 SCO unix
|
||||||
- i386 Solaris 2.7
|
- i386 Solaris 2.7
|
||||||
- i386 Windows 95, 98, ME, NT, 2000, XP, 2003
|
- i386 Windows 95, 98, ME, NT, 2000, XP, 2003
|
||||||
- i386 QNX 6
|
|
||||||
- i486 ncr-sysv4.3.03 (NCR MP-RAS)
|
- i486 ncr-sysv4.3.03 (NCR MP-RAS)
|
||||||
- ia64 Linux 2.3.99
|
- ia64 Linux 2.3.99
|
||||||
- m68k AmigaOS 3
|
- m68k AmigaOS 3
|
||||||
|
@@ -239,7 +239,7 @@ Linker Links
|
|||||||
checked.
|
checked.
|
||||||
|
|
||||||
3- Include in the white space immediately below the box referred in 2 -lcurl
|
3- Include in the white space immediately below the box referred in 2 -lcurl
|
||||||
-lws2_32 -lwinmm.
|
-lws2_32.
|
||||||
|
|
||||||
SSL Files
|
SSL Files
|
||||||
---------
|
---------
|
||||||
|
@@ -3,6 +3,19 @@ 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!
|
||||||
|
|
||||||
|
55. libcurl fails to build with MIT Kerberos for Windows (KfW) due to KfW's
|
||||||
|
library header files exporting symbols/macros that should be kept private
|
||||||
|
to the KfW library. See ticket #5601 at http://krbdev.mit.edu/rt/
|
||||||
|
|
||||||
|
54. User names embedded in URLs without a password are parsed incorrectly--the
|
||||||
|
host name is treated as part of the user name and the port number becomes the
|
||||||
|
password. This can be observed test 279.
|
||||||
|
|
||||||
|
53. SFTP busy-loop problem. When doing SFTP uploads, we can see that libcurl
|
||||||
|
occasionally will busy-loop while waiting for certain network conditions.
|
||||||
|
Reported by Pavel Shalagin, explained somewhat by Daniel Stenberg here:
|
||||||
|
http://curl.haxx.se/mail/lib-2008-04/0439.html
|
||||||
|
|
||||||
52. Gautam Kachroo's issue that identifies a problem with the multi interface
|
52. Gautam Kachroo's issue that identifies a problem with the multi interface
|
||||||
where a connection can be re-used without actually being properly
|
where a connection can be re-used without actually being properly
|
||||||
SSL-negoatiated:
|
SSL-negoatiated:
|
||||||
@@ -12,7 +25,8 @@ may have been fixed since this was written!
|
|||||||
-y/-Y) the next attempt doesn't resume the transfer properly from what was
|
-y/-Y) the next attempt doesn't resume the transfer properly from what was
|
||||||
downloaded in the previous attempt but will truncate and restart at the
|
downloaded in the previous attempt but will truncate and restart at the
|
||||||
original position where it was at before the previous failed attempt. See
|
original position where it was at before the previous failed attempt. See
|
||||||
http://curl.haxx.se/mail/lib-2008-01/0080.html
|
http://curl.haxx.se/mail/lib-2008-01/0080.html and Mandriva bug report
|
||||||
|
https://qa.mandriva.com/show_bug.cgi?id=22565
|
||||||
|
|
||||||
48. If a CONNECT response-headers are larger than BUFSIZE (16KB) when the
|
48. If a CONNECT response-headers are larger than BUFSIZE (16KB) when the
|
||||||
connection is meant to be kept alive (like for NTLM proxy auth), the
|
connection is meant to be kept alive (like for NTLM proxy auth), the
|
||||||
|
16
docs/THANKS
16
docs/THANKS
@@ -26,6 +26,7 @@ Alexey Simak
|
|||||||
Alexis Carvalho
|
Alexis Carvalho
|
||||||
Allen Pulsifer
|
Allen Pulsifer
|
||||||
Amol Pattekar
|
Amol Pattekar
|
||||||
|
Anatoli Tubman
|
||||||
Anders Gustafsson
|
Anders Gustafsson
|
||||||
Andi Jahja
|
Andi Jahja
|
||||||
Andre Guibert de Bruet
|
Andre Guibert de Bruet
|
||||||
@@ -69,6 +70,7 @@ Brent Beardsley
|
|||||||
Brian Akins
|
Brian Akins
|
||||||
Brian Dessent
|
Brian Dessent
|
||||||
Brian R Duffy
|
Brian R Duffy
|
||||||
|
Brian Ulm
|
||||||
Bruce Mitchener
|
Bruce Mitchener
|
||||||
Bryan Henderson
|
Bryan Henderson
|
||||||
Bryan Kemp
|
Bryan Kemp
|
||||||
@@ -103,6 +105,7 @@ Dan Becker
|
|||||||
Dan C
|
Dan C
|
||||||
Dan Fandrich
|
Dan Fandrich
|
||||||
Dan Nelson
|
Dan Nelson
|
||||||
|
Dan Petitt
|
||||||
Dan Torop
|
Dan Torop
|
||||||
Dan Zitter
|
Dan Zitter
|
||||||
Daniel Black
|
Daniel Black
|
||||||
@@ -145,6 +148,7 @@ Dirk Manske
|
|||||||
Dmitriy Sergeyev
|
Dmitriy Sergeyev
|
||||||
Dmitry Bartsevich
|
Dmitry Bartsevich
|
||||||
Dmitry Kurochkin
|
Dmitry Kurochkin
|
||||||
|
Dmitry Popov
|
||||||
Dmitry Rechkin
|
Dmitry Rechkin
|
||||||
Dolbneff A.V
|
Dolbneff A.V
|
||||||
Domenico Andreoli
|
Domenico Andreoli
|
||||||
@@ -161,6 +165,7 @@ Dylan Ellicott
|
|||||||
Dylan Salisbury
|
Dylan Salisbury
|
||||||
Early Ehlinger
|
Early Ehlinger
|
||||||
Edin Kadribasic
|
Edin Kadribasic
|
||||||
|
Eetu Ojanen
|
||||||
Ellis Pritchard
|
Ellis Pritchard
|
||||||
Emil Romanus
|
Emil Romanus
|
||||||
Emiliano Ida
|
Emiliano Ida
|
||||||
@@ -193,6 +198,7 @@ Fred New
|
|||||||
Fred Noz
|
Fred Noz
|
||||||
Frederic Lepied
|
Frederic Lepied
|
||||||
Gary Maxwell
|
Gary Maxwell
|
||||||
|
Gautam Kachroo
|
||||||
Gautam Mani
|
Gautam Mani
|
||||||
Gavrie Philipson
|
Gavrie Philipson
|
||||||
Gaz Iqbal
|
Gaz Iqbal
|
||||||
@@ -276,6 +282,8 @@ Jeff Phillips
|
|||||||
Jeff Pohlmeyer
|
Jeff Pohlmeyer
|
||||||
Jeffrey Pohlmeyer
|
Jeffrey Pohlmeyer
|
||||||
Jeremy Friesner
|
Jeremy Friesner
|
||||||
|
Jerome Muffat-Meridol
|
||||||
|
Jes Badwal
|
||||||
Jesper Jensen
|
Jesper Jensen
|
||||||
Jesse Noller
|
Jesse Noller
|
||||||
Jim Drash
|
Jim Drash
|
||||||
@@ -316,6 +324,7 @@ Kai-Uwe Rommel
|
|||||||
Kang-Jin Lee
|
Kang-Jin Lee
|
||||||
Karl Moerder
|
Karl Moerder
|
||||||
Karol Pietrzak
|
Karol Pietrzak
|
||||||
|
Kaspar Brand
|
||||||
Katie Wang
|
Katie Wang
|
||||||
Kees Cook
|
Kees Cook
|
||||||
Keith MacDonald
|
Keith MacDonald
|
||||||
@@ -396,6 +405,7 @@ Maxim Perenesenko
|
|||||||
Mekonikum
|
Mekonikum
|
||||||
Mettgut Jamalla
|
Mettgut Jamalla
|
||||||
Michael Benedict
|
Michael Benedict
|
||||||
|
Michael Calmer
|
||||||
Michael Curtis
|
Michael Curtis
|
||||||
Michael Jahn
|
Michael Jahn
|
||||||
Michael Jerris
|
Michael Jerris
|
||||||
@@ -408,6 +418,7 @@ Mihai Ionescu
|
|||||||
Mikael Sennerholm
|
Mikael Sennerholm
|
||||||
Mike Bytnar
|
Mike Bytnar
|
||||||
Mike Dobbs
|
Mike Dobbs
|
||||||
|
Mike Hommey
|
||||||
Mike Protts
|
Mike Protts
|
||||||
Miklos Nemeth
|
Miklos Nemeth
|
||||||
Mitz Wark
|
Mitz Wark
|
||||||
@@ -431,6 +442,7 @@ Nicolas Fran
|
|||||||
Niels van Tongeren
|
Niels van Tongeren
|
||||||
Nikita Schmidt
|
Nikita Schmidt
|
||||||
Nikitinskit Dmitriy
|
Nikitinskit Dmitriy
|
||||||
|
Niklas Angebrand
|
||||||
Nir Soffer
|
Nir Soffer
|
||||||
Nis Jorgensen
|
Nis Jorgensen
|
||||||
Nodak Sodak
|
Nodak Sodak
|
||||||
@@ -472,6 +484,7 @@ Philippe Hameau
|
|||||||
Philippe Raoult
|
Philippe Raoult
|
||||||
Philippe Vaucher
|
Philippe Vaucher
|
||||||
Pierre
|
Pierre
|
||||||
|
Pooyan McSporran
|
||||||
Puneet Pawaia
|
Puneet Pawaia
|
||||||
Quagmire
|
Quagmire
|
||||||
Rafael Sagula
|
Rafael Sagula
|
||||||
@@ -524,6 +537,7 @@ Ryan Nelson
|
|||||||
S. Moonesamy
|
S. Moonesamy
|
||||||
Salvador D<>vila
|
Salvador D<>vila
|
||||||
Salvatore Sorrentino
|
Salvatore Sorrentino
|
||||||
|
Sam Listopad
|
||||||
Sampo Kellomaki
|
Sampo Kellomaki
|
||||||
Samuel D<>az Garc<72>a
|
Samuel D<>az Garc<72>a
|
||||||
Samuel Listopad
|
Samuel Listopad
|
||||||
@@ -551,6 +565,7 @@ Stefan Esser
|
|||||||
Stefan Krause
|
Stefan Krause
|
||||||
Stefan Ulrich
|
Stefan Ulrich
|
||||||
Stephan Bergmann
|
Stephan Bergmann
|
||||||
|
Stephen Collyer
|
||||||
Stephen Kick
|
Stephen Kick
|
||||||
Stephen More
|
Stephen More
|
||||||
Sterling Hughes
|
Sterling Hughes
|
||||||
@@ -621,6 +636,7 @@ Xavier Bouchoux
|
|||||||
Yang Tse
|
Yang Tse
|
||||||
Yarram Sunil
|
Yarram Sunil
|
||||||
Yves Lejeune
|
Yves Lejeune
|
||||||
|
Zmey Petroff
|
||||||
Zvi Har'El
|
Zvi Har'El
|
||||||
nk
|
nk
|
||||||
swalkaus at yahoo.com
|
swalkaus at yahoo.com
|
||||||
|
47
docs/TODO
47
docs/TODO
@@ -39,12 +39,14 @@
|
|||||||
|
|
||||||
5. HTTP
|
5. HTTP
|
||||||
5.1 Other HTTP versions with CONNECT
|
5.1 Other HTTP versions with CONNECT
|
||||||
5.2 Better persistancy for HTTP 1.0
|
5.2 Better persistency for HTTP 1.0
|
||||||
5.3 support FF3 sqlite cookie files
|
5.3 support FF3 sqlite cookie files
|
||||||
|
|
||||||
6. TELNET
|
6. TELNET
|
||||||
6.1 ditch stdin
|
6.1 ditch stdin
|
||||||
6.2 ditch telnet-specific select
|
6.2 ditch telnet-specific select
|
||||||
|
6.3 feature negotiation debug data
|
||||||
|
6.4 send data in chunks
|
||||||
|
|
||||||
7. SSL
|
7. SSL
|
||||||
7.1 Disable specific versions
|
7.1 Disable specific versions
|
||||||
@@ -53,19 +55,19 @@
|
|||||||
7.4 Evaluate SSL patches
|
7.4 Evaluate SSL patches
|
||||||
7.5 Cache OpenSSL contexts
|
7.5 Cache OpenSSL contexts
|
||||||
7.6 Export session ids
|
7.6 Export session ids
|
||||||
7.7 Provide callback for cert verfication
|
7.7 Provide callback for cert verification
|
||||||
7.8 Support other SSL libraries
|
7.8 Support other SSL libraries
|
||||||
7.9 Support SRP on the TLS layer
|
7.9 Support SRP on the TLS layer
|
||||||
7.10 improve configure --with-ssl
|
7.10 improve configure --with-ssl
|
||||||
|
|
||||||
8. GnuTLS
|
8. GnuTLS
|
||||||
8.1 Make NTLM work without OpenSSL functions
|
8.1 Make NTLM work without OpenSSL functions
|
||||||
8.2 SSl engine stuff
|
8.2 SSL engine stuff
|
||||||
8.3 SRP
|
8.3 SRP
|
||||||
8.4 non-blocking
|
8.4 non-blocking
|
||||||
8.5 check connection
|
8.5 check connection
|
||||||
|
|
||||||
9. LDAP
|
9. Other protocols
|
||||||
9.1 ditch ldap-specific select
|
9.1 ditch ldap-specific select
|
||||||
|
|
||||||
10. New protocols
|
10. New protocols
|
||||||
@@ -82,6 +84,8 @@
|
|||||||
11.6 simultaneous parallel transfers
|
11.6 simultaneous parallel transfers
|
||||||
11.7 provide formpost headers
|
11.7 provide formpost headers
|
||||||
11.8 url-specific options
|
11.8 url-specific options
|
||||||
|
11.9 metalink support
|
||||||
|
11.10 warning when setting an option
|
||||||
|
|
||||||
12. Build
|
12. Build
|
||||||
12.1 roffit
|
12.1 roffit
|
||||||
@@ -111,7 +115,7 @@
|
|||||||
|
|
||||||
1.1 Zero-copy interface
|
1.1 Zero-copy interface
|
||||||
|
|
||||||
Introdue another callback interface for upload/download that makes one less
|
Introduce another callback interface for upload/download that makes one less
|
||||||
copy of data and thus a faster operation.
|
copy of data and thus a faster operation.
|
||||||
[http://curl.haxx.se/dev/no_copy_callbacks.txt]
|
[http://curl.haxx.se/dev/no_copy_callbacks.txt]
|
||||||
|
|
||||||
@@ -258,7 +262,7 @@
|
|||||||
never been reported as causing trouble to anyone, but should be considered to
|
never been reported as causing trouble to anyone, but should be considered to
|
||||||
use the HTTP version the user has chosen.
|
use the HTTP version the user has chosen.
|
||||||
|
|
||||||
5.2 Better persistancy for HTTP 1.0
|
5.2 Better persistency for HTTP 1.0
|
||||||
|
|
||||||
"Better" support for persistent connections over HTTP 1.0
|
"Better" support for persistent connections over HTTP 1.0
|
||||||
http://curl.haxx.se/bug/feature.cgi?id=1089001
|
http://curl.haxx.se/bug/feature.cgi?id=1089001
|
||||||
@@ -283,6 +287,16 @@ to provide the data to send.
|
|||||||
into the main transfer loop. Until this is done, the multi interface won't
|
into the main transfer loop. Until this is done, the multi interface won't
|
||||||
work for telnet.
|
work for telnet.
|
||||||
|
|
||||||
|
6.3 feature negotiation debug data
|
||||||
|
|
||||||
|
Add telnet feature negotiation data to the debug callback as header data.
|
||||||
|
|
||||||
|
6.4 send data in chunks
|
||||||
|
|
||||||
|
Currently, telnet sends data one byte at a time. This is fine for interactive
|
||||||
|
use, but inefficient for any other. Sent data should be sent in larger
|
||||||
|
chunks.
|
||||||
|
|
||||||
7. SSL
|
7. SSL
|
||||||
|
|
||||||
7.1 Disable specific versions
|
7.1 Disable specific versions
|
||||||
@@ -324,7 +338,7 @@ to provide the data to send.
|
|||||||
the state from such a buffer at a later date - this is used by mod_ssl for
|
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".
|
apache to implement and SSL session ID cache".
|
||||||
|
|
||||||
7.7 Provide callback for cert verfication
|
7.7 Provide callback for cert verification
|
||||||
|
|
||||||
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
|
||||||
@@ -355,7 +369,7 @@ to provide the data to send.
|
|||||||
hey... Another option is to get available DES and MD4 source code from the
|
hey... Another option is to get available DES and MD4 source code from the
|
||||||
cryptopp library. They are fine license-wise, but are C++.
|
cryptopp library. They are fine license-wise, but are C++.
|
||||||
|
|
||||||
8.2 SSl engine stuff
|
8.2 SSL engine stuff
|
||||||
|
|
||||||
Is this even possible?
|
Is this even possible?
|
||||||
|
|
||||||
@@ -373,7 +387,7 @@ to provide the data to send.
|
|||||||
Add a way to check if the connection seems to be alive, to correspond to the
|
Add a way to check if the connection seems to be alive, to correspond to the
|
||||||
SSL_peak() way we use with OpenSSL.
|
SSL_peak() way we use with OpenSSL.
|
||||||
|
|
||||||
9. LDAP
|
9. Other protocols
|
||||||
|
|
||||||
9.1 ditch ldap-specific select
|
9.1 ditch ldap-specific select
|
||||||
|
|
||||||
@@ -381,6 +395,10 @@ to provide the data to send.
|
|||||||
lib/ldap.c source file and get moved to the main network code so that the
|
lib/ldap.c source file and get moved to the main network code so that the
|
||||||
multi interface and friends will work for LDAP as well.
|
multi interface and friends will work for LDAP as well.
|
||||||
|
|
||||||
|
9.2 stop TFTP blocking
|
||||||
|
|
||||||
|
Stop TFTP from being blocking and doing its own read loop in tftp_do.
|
||||||
|
|
||||||
10. New protocols
|
10. New protocols
|
||||||
|
|
||||||
10.1 RTSP
|
10.1 RTSP
|
||||||
@@ -468,6 +486,17 @@ to provide the data to send.
|
|||||||
|
|
||||||
The example would do a POST-GET-POST combination on a single command line.
|
The example would do a POST-GET-POST combination on a single command line.
|
||||||
|
|
||||||
|
11.9 metalink support
|
||||||
|
|
||||||
|
Add metalink support to curl (http://www.metalinker.org/). This is most useful
|
||||||
|
with simultaneous parallel transfers (11.6) but not necessary.
|
||||||
|
|
||||||
|
11.10 warning when setting an option
|
||||||
|
|
||||||
|
Display a warning when libcurl returns an error when setting an option.
|
||||||
|
This can be useful to tell when support for a particular feature hasn't been
|
||||||
|
compiled into the library.
|
||||||
|
|
||||||
12. Build
|
12. Build
|
||||||
|
|
||||||
12.1 roffit
|
12.1 roffit
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
Online: http://curl.haxx.se/docs/httpscripting.html
|
Online: http://curl.haxx.se/docs/httpscripting.html
|
||||||
Date: December 9, 2004
|
Date: May 28, 2008
|
||||||
|
|
||||||
The Art Of Scripting HTTP Requests Using Curl
|
The Art Of Scripting HTTP Requests Using Curl
|
||||||
=============================================
|
=============================================
|
||||||
@@ -137,6 +137,10 @@ Date: December 9, 2004
|
|||||||
you need to replace that space with %20 etc. Failing to comply with this
|
you need to replace that space with %20 etc. Failing to comply with this
|
||||||
will most likely cause your data to be received wrongly and messed up.
|
will most likely cause your data to be received wrongly and messed up.
|
||||||
|
|
||||||
|
Recent curl versions can in fact url-encode POST data for you, like this:
|
||||||
|
|
||||||
|
curl --data-urlencode "name=I am Daniel" www.example.com
|
||||||
|
|
||||||
4.3 File Upload POST
|
4.3 File Upload POST
|
||||||
|
|
||||||
Back in late 1995 they defined an additional way to post data over HTTP. It
|
Back in late 1995 they defined an additional way to post data over HTTP. It
|
||||||
@@ -202,14 +206,14 @@ Date: December 9, 2004
|
|||||||
|
|
||||||
curl -T uploadfile www.uploadhttp.com/receive.cgi
|
curl -T uploadfile www.uploadhttp.com/receive.cgi
|
||||||
|
|
||||||
6. Authentication
|
6. HTTP Authentication
|
||||||
|
|
||||||
Authentication is the ability to tell the server your username and password
|
HTTP Authentication is the ability to tell the server your username and
|
||||||
so that it can verify that you're allowed to do the request you're doing. The
|
password so that it can verify that you're allowed to do the request you're
|
||||||
Basic authentication used in HTTP (which is the type curl uses by default) is
|
doing. The Basic authentication used in HTTP (which is the type curl uses by
|
||||||
*plain* *text* based, which means it sends username and password only
|
default) is *plain* *text* based, which means it sends username and password
|
||||||
slightly obfuscated, but still fully readable by anyone that sniffs on the
|
only slightly obfuscated, but still fully readable by anyone that sniffs on
|
||||||
network between you and the remote server.
|
the network between you and the remote server.
|
||||||
|
|
||||||
To tell curl to use a user and password for authentication:
|
To tell curl to use a user and password for authentication:
|
||||||
|
|
||||||
@@ -237,6 +241,10 @@ Date: December 9, 2004
|
|||||||
able to watch your passwords if you pass them as plain command line
|
able to watch your passwords if you pass them as plain command line
|
||||||
options. There are ways to circumvent this.
|
options. There are ways to circumvent this.
|
||||||
|
|
||||||
|
It is worth noting that while this is how HTTP Authentication works, very
|
||||||
|
many web sites will not use this concept when they provide logins etc. See
|
||||||
|
the Web Login chapter further below for more details on that.
|
||||||
|
|
||||||
7. Referer
|
7. Referer
|
||||||
|
|
||||||
A HTTP request may include a 'referer' field (yes it is misspelled), which
|
A HTTP request may include a 'referer' field (yes it is misspelled), which
|
||||||
@@ -407,7 +415,37 @@ Date: December 9, 2004
|
|||||||
|
|
||||||
curl -H "Destination: http://moo.com/nowhere" http://url.com
|
curl -H "Destination: http://moo.com/nowhere" http://url.com
|
||||||
|
|
||||||
13. Debug
|
13. Web Login
|
||||||
|
|
||||||
|
While not strictly just HTTP related, it still cause a lot of people problems
|
||||||
|
so here's the executive run-down of how the vast majority of all login forms
|
||||||
|
work and how to login to them using curl.
|
||||||
|
|
||||||
|
It can also be noted that to do this properly in an automated fashion, you
|
||||||
|
will most certainly need to script things and do multiple curl invokes etc.
|
||||||
|
|
||||||
|
First, servers mostly use cookies to track the logged-in status of the
|
||||||
|
client, so you will need to capture the cookies you receive in the
|
||||||
|
responses. Then, many sites also set a special cookie on the login page (to
|
||||||
|
make sure you got there through their login page) so you should make a habit
|
||||||
|
of first getting the login-form page to capture the cookies set there.
|
||||||
|
|
||||||
|
Some web-based login systems features various amounts of javascript, and
|
||||||
|
sometimes they use such code to set or modify cookie contents. Possibly they
|
||||||
|
do that to prevent programmed logins, like this manual describes how to...
|
||||||
|
Anyway, if reading the code isn't enough to let you repeat the behavior
|
||||||
|
manually, capturing the HTTP requests done by your browers and analyzing the
|
||||||
|
sent cookies is usually a working method to work out how to shortcut the
|
||||||
|
javascript need.
|
||||||
|
|
||||||
|
In the actual <form> tag for the login, lots of sites fill-in random/session
|
||||||
|
or otherwise secretly generated hidden tags and you may need to first capture
|
||||||
|
the HTML code for the login form and extract all the hidden fields to be able
|
||||||
|
to do a proper login POST. Remember that the contents need to be URL encoded
|
||||||
|
when sent in a normal POST.
|
||||||
|
|
||||||
|
|
||||||
|
14. Debug
|
||||||
|
|
||||||
Many times when you run curl on a site, you'll notice that the site doesn't
|
Many times when you run curl on a site, you'll notice that the site doesn't
|
||||||
seem to respond the same way to your curl requests as it does to your
|
seem to respond the same way to your curl requests as it does to your
|
||||||
@@ -437,7 +475,7 @@ Date: December 9, 2004
|
|||||||
such as ethereal or tcpdump and check what headers that were sent and
|
such as ethereal or tcpdump and check what headers that were sent and
|
||||||
received by the browser. (HTTPS makes this technique inefficient.)
|
received by the browser. (HTTPS makes this technique inefficient.)
|
||||||
|
|
||||||
14. References
|
15. References
|
||||||
|
|
||||||
RFC 2616 is a must to read if you want in-depth understanding of the HTTP
|
RFC 2616 is a must to read if you want in-depth understanding of the HTTP
|
||||||
protocol.
|
protocol.
|
||||||
|
@@ -1288,7 +1288,9 @@ The URL that was fetched last. This is mostly meaningful if you've told curl
|
|||||||
to follow location: headers.
|
to follow location: headers.
|
||||||
.TP
|
.TP
|
||||||
.B http_code
|
.B http_code
|
||||||
The numerical code that was found in the last retrieved HTTP(S) page.
|
The numerical response code that was found in the last retrieved HTTP(S) or
|
||||||
|
FTP(s) transfer. In 7.18.2 the alias \fBresponse_code\fP was added to show the
|
||||||
|
same info.
|
||||||
.TP
|
.TP
|
||||||
.B http_connect
|
.B http_connect
|
||||||
The numerical code that was found in the last response (from a proxy) to a
|
The numerical code that was found in the last response (from a proxy) to a
|
||||||
@@ -1349,6 +1351,10 @@ Number of new connects made in the recent transfer. (Added in 7.12.3)
|
|||||||
.B num_redirects
|
.B num_redirects
|
||||||
Number of redirects that were followed in the request. (Added in 7.12.3)
|
Number of redirects that were followed in the request. (Added in 7.12.3)
|
||||||
.TP
|
.TP
|
||||||
|
.B redirect_url
|
||||||
|
When a HTTP request was made without -L to follow redirects, this variable
|
||||||
|
will show the actual URL a redirect \fIwould\fP take you to. (Added in 7.18.2)
|
||||||
|
.TP
|
||||||
.B ftp_entry_path
|
.B ftp_entry_path
|
||||||
The initial path libcurl ended up in when logging on to the remote FTP
|
The initial path libcurl ended up in when logging on to the remote FTP
|
||||||
server. (Added in 7.15.4)
|
server. (Added in 7.15.4)
|
||||||
|
@@ -90,10 +90,10 @@ static void init(CURLM *cm, int i)
|
|||||||
CURL *eh = curl_easy_init();
|
CURL *eh = curl_easy_init();
|
||||||
|
|
||||||
curl_easy_setopt(eh, CURLOPT_WRITEFUNCTION, cb);
|
curl_easy_setopt(eh, CURLOPT_WRITEFUNCTION, cb);
|
||||||
curl_easy_setopt(eh, CURLOPT_HEADER, 0);
|
curl_easy_setopt(eh, CURLOPT_HEADER, 0L);
|
||||||
curl_easy_setopt(eh, CURLOPT_URL, urls[i]);
|
curl_easy_setopt(eh, CURLOPT_URL, urls[i]);
|
||||||
curl_easy_setopt(eh, CURLOPT_PRIVATE, urls[i]);
|
curl_easy_setopt(eh, CURLOPT_PRIVATE, urls[i]);
|
||||||
curl_easy_setopt(eh, CURLOPT_VERBOSE, 0);
|
curl_easy_setopt(eh, CURLOPT_VERBOSE, 0L);
|
||||||
|
|
||||||
curl_multi_add_handle(cm, eh);
|
curl_multi_add_handle(cm, eh);
|
||||||
}
|
}
|
||||||
|
@@ -21,7 +21,7 @@ CPPFLAGS = -DCURL_NO_OLDIES $(STATICCPPFLAGS)
|
|||||||
# Dependencies
|
# Dependencies
|
||||||
LDADD = $(LIBDIR)/libcurl.la
|
LDADD = $(LIBDIR)/libcurl.la
|
||||||
|
|
||||||
# Makefile.inc provides the noinst_PROGRAMS and COMPLICATED_EXAMPLES defines
|
# Makefile.inc provides the check_PROGRAMS and COMPLICATED_EXAMPLES defines
|
||||||
include Makefile.inc
|
include Makefile.inc
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,10 +1,11 @@
|
|||||||
# These are all libcurl example programs to be test compiled
|
# These are all libcurl example programs to be test compiled
|
||||||
noinst_PROGRAMS = 10-at-a-time anyauthput cookie_interface \
|
check_PROGRAMS = 10-at-a-time anyauthput cookie_interface \
|
||||||
debug fileupload fopen ftpget ftpgetresp ftpupload \
|
debug fileupload fopen ftpget ftpgetresp ftpupload \
|
||||||
getinfo getinmemory http-post httpput \
|
getinfo getinmemory http-post httpput \
|
||||||
https multi-app multi-debugcallback multi-double \
|
https multi-app multi-debugcallback multi-double \
|
||||||
multi-post multi-single persistant post-callback \
|
multi-post multi-single persistant post-callback \
|
||||||
postit2 sepheaders simple simplepost simplessl
|
postit2 sepheaders simple simplepost simplessl \
|
||||||
|
sendrecv
|
||||||
|
|
||||||
# These examples require external dependencies that may not be commonly
|
# These examples require external dependencies that may not be commonly
|
||||||
# available on POSIX systems, so don't bother attempting to compile them here.
|
# available on POSIX systems, so don't bother attempting to compile them here.
|
||||||
|
@@ -51,7 +51,6 @@ CP = copy
|
|||||||
INCLUDES = -I. -I$(PROOT) -I$(PROOT)/include -I$(PROOT)/lib
|
INCLUDES = -I. -I$(PROOT) -I$(PROOT)/include -I$(PROOT)/lib
|
||||||
LINK = $(CC) $(LDFLAGS) -o $@
|
LINK = $(CC) $(LDFLAGS) -o $@
|
||||||
|
|
||||||
curl_PROGRAMS = curl.exe
|
|
||||||
ifdef DYN
|
ifdef DYN
|
||||||
curl_DEPENDENCIES = $(PROOT)/lib/libcurldll.a $(PROOT)/lib/libcurl.dll
|
curl_DEPENDENCIES = $(PROOT)/lib/libcurldll.a $(PROOT)/lib/libcurl.dll
|
||||||
curl_LDADD = -L$(PROOT)/lib -lcurldll
|
curl_LDADD = -L$(PROOT)/lib -lcurldll
|
||||||
@@ -107,13 +106,13 @@ ifndef USE_LDAP_OPENLDAP
|
|||||||
curl_LDADD += -lwldap32
|
curl_LDADD += -lwldap32
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
curl_LDADD += -lws2_32 -lwinmm
|
curl_LDADD += -lws2_32
|
||||||
COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
|
COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
|
||||||
|
|
||||||
# Makefile.inc provides the noinst_PROGRAMS and COMPLICATED_EXAMPLES defines
|
# Makefile.inc provides the check_PROGRAMS and COMPLICATED_EXAMPLES defines
|
||||||
include Makefile.inc
|
include Makefile.inc
|
||||||
|
|
||||||
example_PROGRAMS := $(patsubst %,%.exe,$(strip $(noinst_PROGRAMS)))
|
example_PROGRAMS := $(patsubst %,%.exe,$(strip $(check_PROGRAMS)))
|
||||||
|
|
||||||
.SUFFIXES: .rc .res .o .exe
|
.SUFFIXES: .rc .res .o .exe
|
||||||
|
|
||||||
|
@@ -9,6 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -109,7 +110,7 @@ int main(int argc, char **argv)
|
|||||||
curl_easy_setopt(curl, CURLOPT_IOCTLDATA, (void*)hd);
|
curl_easy_setopt(curl, CURLOPT_IOCTLDATA, (void*)hd);
|
||||||
|
|
||||||
/* enable "uploading" (which means PUT when doing HTTP) */
|
/* enable "uploading" (which means PUT when doing HTTP) */
|
||||||
curl_easy_setopt(curl, CURLOPT_UPLOAD, TRUE) ;
|
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L) ;
|
||||||
|
|
||||||
/* specify target URL, and note that this URL should also include a file
|
/* specify target URL, and note that this URL should also include a file
|
||||||
name, not only a directory (as you can do with GTP uploads) */
|
name, not only a directory (as you can do with GTP uploads) */
|
||||||
@@ -117,12 +118,13 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
/* and give the size of the upload, this supports large file sizes
|
/* and give the size of the upload, this supports large file sizes
|
||||||
on systems that have general support for it */
|
on systems that have general support for it */
|
||||||
curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, file_info.st_size);
|
curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE,
|
||||||
|
(curl_off_t)file_info.st_size);
|
||||||
|
|
||||||
/* tell libcurl we can use "any" auth, which lets the lib pick one, but it
|
/* tell libcurl we can use "any" auth, which lets the lib pick one, but it
|
||||||
also costs one extra round-trip and possibly sending of all the PUT
|
also costs one extra round-trip and possibly sending of all the PUT
|
||||||
data twice!!! */
|
data twice!!! */
|
||||||
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
|
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_ANY);
|
||||||
|
|
||||||
/* set user name and password for the authentication */
|
/* set user name and password for the authentication */
|
||||||
curl_easy_setopt(curl, CURLOPT_USERPWD, "user:password");
|
curl_easy_setopt(curl, CURLOPT_USERPWD, "user:password");
|
||||||
|
@@ -102,16 +102,16 @@ int main(void)
|
|||||||
|
|
||||||
rv=curl_global_init(CURL_GLOBAL_ALL);
|
rv=curl_global_init(CURL_GLOBAL_ALL);
|
||||||
ch=curl_easy_init();
|
ch=curl_easy_init();
|
||||||
rv=curl_easy_setopt(ch,CURLOPT_VERBOSE, 0);
|
rv=curl_easy_setopt(ch,CURLOPT_VERBOSE, 0L);
|
||||||
rv=curl_easy_setopt(ch,CURLOPT_HEADER, 0);
|
rv=curl_easy_setopt(ch,CURLOPT_HEADER, 0L);
|
||||||
rv=curl_easy_setopt(ch,CURLOPT_NOPROGRESS, 1);
|
rv=curl_easy_setopt(ch,CURLOPT_NOPROGRESS, 1L);
|
||||||
rv=curl_easy_setopt(ch,CURLOPT_NOSIGNAL, 1);
|
rv=curl_easy_setopt(ch,CURLOPT_NOSIGNAL, 1L);
|
||||||
rv=curl_easy_setopt(ch,CURLOPT_WRITEFUNCTION, *writefunction);
|
rv=curl_easy_setopt(ch,CURLOPT_WRITEFUNCTION, *writefunction);
|
||||||
rv=curl_easy_setopt(ch,CURLOPT_WRITEDATA, stdout);
|
rv=curl_easy_setopt(ch,CURLOPT_WRITEDATA, stdout);
|
||||||
rv=curl_easy_setopt(ch,CURLOPT_HEADERFUNCTION, *writefunction);
|
rv=curl_easy_setopt(ch,CURLOPT_HEADERFUNCTION, *writefunction);
|
||||||
rv=curl_easy_setopt(ch,CURLOPT_WRITEHEADER, stderr);
|
rv=curl_easy_setopt(ch,CURLOPT_WRITEHEADER, stderr);
|
||||||
rv=curl_easy_setopt(ch,CURLOPT_SSLCERTTYPE,"PEM");
|
rv=curl_easy_setopt(ch,CURLOPT_SSLCERTTYPE,"PEM");
|
||||||
rv=curl_easy_setopt(ch,CURLOPT_SSL_VERIFYPEER,1);
|
rv=curl_easy_setopt(ch,CURLOPT_SSL_VERIFYPEER,1L);
|
||||||
rv=curl_easy_setopt(ch, CURLOPT_URL, "https://www.cacert.org/");
|
rv=curl_easy_setopt(ch, CURLOPT_URL, "https://www.cacert.org/");
|
||||||
|
|
||||||
/* first try: retrieve page without cacerts' certificate -> will fail
|
/* first try: retrieve page without cacerts' certificate -> will fail
|
||||||
|
@@ -54,7 +54,7 @@ main(void)
|
|||||||
char nline[256];
|
char nline[256];
|
||||||
|
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, "http://www.google.com/"); /* google.com sets "PREF" cookie */
|
curl_easy_setopt(curl, CURLOPT_URL, "http://www.google.com/"); /* google.com sets "PREF" cookie */
|
||||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||||
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); /* just to start the cookie engine */
|
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); /* just to start the cookie engine */
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
if (res != CURLE_OK) {
|
if (res != CURLE_OK) {
|
||||||
|
@@ -29,7 +29,7 @@ size_t my_read_func(void *ptr, size_t size, size_t nmemb, FILE *stream)
|
|||||||
return fread(ptr, size, nmemb, stream);
|
return fread(ptr, size, nmemb, stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
int my_progress_func(GtkWidget *Bar,
|
int my_progress_func(GtkWidget *bar,
|
||||||
double t, /* dltotal */
|
double t, /* dltotal */
|
||||||
double d, /* dlnow */
|
double d, /* dlnow */
|
||||||
double ultotal,
|
double ultotal,
|
||||||
@@ -37,7 +37,7 @@ int my_progress_func(GtkWidget *Bar,
|
|||||||
{
|
{
|
||||||
/* printf("%d / %d (%g %%)\n", d, t, d*100.0/t);*/
|
/* printf("%d / %d (%g %%)\n", d, t, d*100.0/t);*/
|
||||||
gdk_threads_enter();
|
gdk_threads_enter();
|
||||||
gtk_progress_set_value(GTK_PROGRESS(Bar), d*100.0/t);
|
gtk_progress_set_value(GTK_PROGRESS(bar), d*100.0/t);
|
||||||
gdk_threads_leave();
|
gdk_threads_leave();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,7 @@ void *my_thread(void *ptr)
|
|||||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile);
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile);
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_write_func);
|
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_write_func);
|
||||||
curl_easy_setopt(curl, CURLOPT_READFUNCTION, my_read_func);
|
curl_easy_setopt(curl, CURLOPT_READFUNCTION, my_read_func);
|
||||||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, FALSE);
|
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
|
||||||
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, my_progress_func);
|
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, my_progress_func);
|
||||||
curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, Bar);
|
curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, Bar);
|
||||||
|
|
||||||
@@ -77,6 +77,9 @@ int main(int argc, char **argv)
|
|||||||
GtkWidget *Window, *Frame, *Frame2;
|
GtkWidget *Window, *Frame, *Frame2;
|
||||||
GtkAdjustment *adj;
|
GtkAdjustment *adj;
|
||||||
|
|
||||||
|
/* Must initialize libcurl before any threads are started */
|
||||||
|
curl_global_init(CURL_GLOBAL_ALL);
|
||||||
|
|
||||||
/* Init thread */
|
/* Init thread */
|
||||||
g_thread_init(NULL);
|
g_thread_init(NULL);
|
||||||
|
|
||||||
|
@@ -438,7 +438,7 @@ int main(int argc, char **argv) {
|
|||||||
/* Now specify the POST binary data */
|
/* Now specify the POST binary data */
|
||||||
|
|
||||||
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDS, binaryptr);
|
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDS, binaryptr);
|
||||||
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDSIZE,tabLength);
|
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDSIZE,(long)tabLength);
|
||||||
|
|
||||||
/* pass our list of custom made headers */
|
/* pass our list of custom made headers */
|
||||||
|
|
||||||
@@ -477,7 +477,7 @@ int main(int argc, char **argv) {
|
|||||||
/* Now specify the POST binary data */
|
/* Now specify the POST binary data */
|
||||||
|
|
||||||
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDS, binaryptr);
|
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDS, binaryptr);
|
||||||
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDSIZE,tabLength);
|
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDSIZE,(long)tabLength);
|
||||||
|
|
||||||
|
|
||||||
/* Perform the request, res will get the return code */
|
/* Perform the request, res will get the return code */
|
||||||
|
@@ -116,7 +116,7 @@ int main(void)
|
|||||||
curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &config);
|
curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &config);
|
||||||
|
|
||||||
/* the DEBUGFUNCTION has no effect until we enable VERBOSE */
|
/* the DEBUGFUNCTION has no effect until we enable VERBOSE */
|
||||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||||
|
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
|
curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
|
@@ -36,7 +36,7 @@ int main(void)
|
|||||||
"file:///home/dast/src/curl/debug/new");
|
"file:///home/dast/src/curl/debug/new");
|
||||||
|
|
||||||
/* tell it to "upload" to the URL */
|
/* tell it to "upload" to the URL */
|
||||||
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1);
|
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
|
||||||
|
|
||||||
/* set where to read from (on Windows you need to use READFUNCTION too) */
|
/* set where to read from (on Windows you need to use READFUNCTION too) */
|
||||||
curl_easy_setopt(curl, CURLOPT_READDATA, fd);
|
curl_easy_setopt(curl, CURLOPT_READDATA, fd);
|
||||||
@@ -46,7 +46,7 @@ int main(void)
|
|||||||
(curl_off_t)file_info.st_size);
|
(curl_off_t)file_info.st_size);
|
||||||
|
|
||||||
/* enable verbose for easier tracing */
|
/* enable verbose for easier tracing */
|
||||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||||
|
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
|
|
||||||
|
@@ -236,7 +236,7 @@ url_fopen(const char *url,const char *operation)
|
|||||||
|
|
||||||
curl_easy_setopt(file->handle.curl, CURLOPT_URL, url);
|
curl_easy_setopt(file->handle.curl, CURLOPT_URL, url);
|
||||||
curl_easy_setopt(file->handle.curl, CURLOPT_WRITEDATA, file);
|
curl_easy_setopt(file->handle.curl, CURLOPT_WRITEDATA, file);
|
||||||
curl_easy_setopt(file->handle.curl, CURLOPT_VERBOSE, 0);
|
curl_easy_setopt(file->handle.curl, CURLOPT_VERBOSE, 0L);
|
||||||
curl_easy_setopt(file->handle.curl, CURLOPT_WRITEFUNCTION, write_callback);
|
curl_easy_setopt(file->handle.curl, CURLOPT_WRITEFUNCTION, write_callback);
|
||||||
|
|
||||||
if(!multi_handle)
|
if(!multi_handle)
|
||||||
@@ -488,7 +488,7 @@ main(int argc, char *argv[])
|
|||||||
handle = url_fopen(url, "r");
|
handle = url_fopen(url, "r");
|
||||||
if(!handle)
|
if(!handle)
|
||||||
{
|
{
|
||||||
printf("couldn't url_fopen()\n");
|
printf("couldn't url_fopen() %s\n", url);
|
||||||
fclose(outf);
|
fclose(outf);
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
@@ -514,7 +514,7 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
handle = url_fopen("testfile", "r");
|
handle = url_fopen("testfile", "r");
|
||||||
if(!handle) {
|
if(!handle) {
|
||||||
printf("couldn't url_fopen()\n");
|
printf("couldn't url_fopen() testfile\n");
|
||||||
fclose(outf);
|
fclose(outf);
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
@@ -539,7 +539,7 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
handle = url_fopen("testfile", "r");
|
handle = url_fopen("testfile", "r");
|
||||||
if(!handle) {
|
if(!handle) {
|
||||||
printf("couldn't url_fopen()\n");
|
printf("couldn't url_fopen() testfile\n");
|
||||||
fclose(outf);
|
fclose(outf);
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
@@ -65,7 +65,7 @@ int main(void)
|
|||||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ftpfile);
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ftpfile);
|
||||||
|
|
||||||
/* Switch on full protocol/debug output */
|
/* Switch on full protocol/debug output */
|
||||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||||
|
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
|
|
||||||
|
@@ -9,6 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -83,7 +84,7 @@ int main(int argc, char **argv)
|
|||||||
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
|
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
|
||||||
|
|
||||||
/* enable uploading */
|
/* enable uploading */
|
||||||
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1) ;
|
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
|
||||||
|
|
||||||
/* specify target */
|
/* specify target */
|
||||||
curl_easy_setopt(curl,CURLOPT_URL, REMOTE_URL);
|
curl_easy_setopt(curl,CURLOPT_URL, REMOTE_URL);
|
||||||
|
@@ -77,7 +77,7 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
curl_easy_setopt(curlhandle, CURLOPT_UPLOAD, 1);
|
curl_easy_setopt(curlhandle, CURLOPT_UPLOAD, 1L);
|
||||||
|
|
||||||
curl_easy_setopt(curlhandle, CURLOPT_URL, remotepath);
|
curl_easy_setopt(curlhandle, CURLOPT_URL, remotepath);
|
||||||
|
|
||||||
@@ -93,9 +93,9 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
|
|||||||
curl_easy_setopt(curlhandle, CURLOPT_READDATA, f);
|
curl_easy_setopt(curlhandle, CURLOPT_READDATA, f);
|
||||||
|
|
||||||
curl_easy_setopt(curlhandle, CURLOPT_FTPPORT, "-"); /* disable passive mode */
|
curl_easy_setopt(curlhandle, CURLOPT_FTPPORT, "-"); /* disable passive mode */
|
||||||
curl_easy_setopt(curlhandle, CURLOPT_FTP_CREATE_MISSING_DIRS, 1);
|
curl_easy_setopt(curlhandle, CURLOPT_FTP_CREATE_MISSING_DIRS, 1L);
|
||||||
|
|
||||||
curl_easy_setopt(curlhandle, CURLOPT_VERBOSE, 1);
|
curl_easy_setopt(curlhandle, CURLOPT_VERBOSE, 1L);
|
||||||
|
|
||||||
for (c = 0; (r != CURLE_OK) && (c < tries); c++) {
|
for (c = 0; (r != CURLE_OK) && (c < tries); c++) {
|
||||||
/* are we resuming? */
|
/* are we resuming? */
|
||||||
@@ -110,22 +110,22 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
|
|||||||
* because HEADER will dump the headers to stdout
|
* because HEADER will dump the headers to stdout
|
||||||
* without it.
|
* without it.
|
||||||
*/
|
*/
|
||||||
curl_easy_setopt(curlhandle, CURLOPT_NOBODY, 1);
|
curl_easy_setopt(curlhandle, CURLOPT_NOBODY, 1L);
|
||||||
curl_easy_setopt(curlhandle, CURLOPT_HEADER, 1);
|
curl_easy_setopt(curlhandle, CURLOPT_HEADER, 1L);
|
||||||
|
|
||||||
r = curl_easy_perform(curlhandle);
|
r = curl_easy_perform(curlhandle);
|
||||||
if (r != CURLE_OK)
|
if (r != CURLE_OK)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
curl_easy_setopt(curlhandle, CURLOPT_NOBODY, 0);
|
curl_easy_setopt(curlhandle, CURLOPT_NOBODY, 0L);
|
||||||
curl_easy_setopt(curlhandle, CURLOPT_HEADER, 0);
|
curl_easy_setopt(curlhandle, CURLOPT_HEADER, 0L);
|
||||||
|
|
||||||
fseek(f, uploaded_len, SEEK_SET);
|
fseek(f, uploaded_len, SEEK_SET);
|
||||||
|
|
||||||
curl_easy_setopt(curlhandle, CURLOPT_APPEND, 1);
|
curl_easy_setopt(curlhandle, CURLOPT_APPEND, 1L);
|
||||||
}
|
}
|
||||||
else { /* no */
|
else { /* no */
|
||||||
curl_easy_setopt(curlhandle, CURLOPT_APPEND, 0);
|
curl_easy_setopt(curlhandle, CURLOPT_APPEND, 0L);
|
||||||
}
|
}
|
||||||
|
|
||||||
r = curl_easy_perform(curlhandle);
|
r = curl_easy_perform(curlhandle);
|
||||||
|
@@ -325,16 +325,16 @@ static void new_conn(char *url, GlobalInfo *g )
|
|||||||
curl_easy_setopt(conn->easy, CURLOPT_URL, conn->url);
|
curl_easy_setopt(conn->easy, CURLOPT_URL, conn->url);
|
||||||
curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb);
|
curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb);
|
||||||
curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, &conn);
|
curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, &conn);
|
||||||
curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, SHOW_VERBOSE);
|
curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, (long)SHOW_VERBOSE);
|
||||||
curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error);
|
curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error);
|
||||||
curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn);
|
curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn);
|
||||||
curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, SHOW_PROGRESS?0:1);
|
curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, SHOW_PROGRESS?0L:1L);
|
||||||
curl_easy_setopt(conn->easy, CURLOPT_PROGRESSFUNCTION, prog_cb);
|
curl_easy_setopt(conn->easy, CURLOPT_PROGRESSFUNCTION, prog_cb);
|
||||||
curl_easy_setopt(conn->easy, CURLOPT_PROGRESSDATA, conn);
|
curl_easy_setopt(conn->easy, CURLOPT_PROGRESSDATA, conn);
|
||||||
curl_easy_setopt(conn->easy, CURLOPT_FOLLOWLOCATION, 1);
|
curl_easy_setopt(conn->easy, CURLOPT_FOLLOWLOCATION, 1L);
|
||||||
curl_easy_setopt(conn->easy, CURLOPT_CONNECTTIMEOUT, 30);
|
curl_easy_setopt(conn->easy, CURLOPT_CONNECTTIMEOUT, 30L);
|
||||||
curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_LIMIT, 1);
|
curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_LIMIT, 1L);
|
||||||
curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_TIME, 30);
|
curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_TIME, 30L);
|
||||||
|
|
||||||
MSG_OUT("Adding easy %p to multi %p (%s)\n", conn->easy, g->multi, url);
|
MSG_OUT("Adding easy %p to multi %p (%s)\n", conn->easy, g->multi, url);
|
||||||
rc =curl_multi_add_handle(g->multi, conn->easy);
|
rc =curl_multi_add_handle(g->multi, conn->easy);
|
||||||
|
@@ -95,6 +95,7 @@ typedef struct _SockInfo {
|
|||||||
static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
|
static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
|
||||||
{
|
{
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
|
(void)multi; /* unused */
|
||||||
|
|
||||||
timeout.tv_sec = timeout_ms/1000;
|
timeout.tv_sec = timeout_ms/1000;
|
||||||
timeout.tv_usec = (timeout_ms%1000)*1000;
|
timeout.tv_usec = (timeout_ms%1000)*1000;
|
||||||
@@ -103,12 +104,11 @@ static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Die if we get a bad CURLMcode somewhere */
|
/* Die if we get a bad CURLMcode somewhere */
|
||||||
void mcode_or_die(char *where, CURLMcode code) {
|
static void mcode_or_die(const char *where, CURLMcode code)
|
||||||
|
{
|
||||||
if ( CURLM_OK != code ) {
|
if ( CURLM_OK != code ) {
|
||||||
char *s;
|
const char *s;
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case CURLM_CALL_MULTI_PERFORM: s="CURLM_CALL_MULTI_PERFORM"; break;
|
case CURLM_CALL_MULTI_PERFORM: s="CURLM_CALL_MULTI_PERFORM"; break;
|
||||||
case CURLM_OK: s="CURLM_OK"; break;
|
case CURLM_OK: s="CURLM_OK"; break;
|
||||||
@@ -116,10 +116,14 @@ void mcode_or_die(char *where, CURLMcode code) {
|
|||||||
case CURLM_BAD_EASY_HANDLE: s="CURLM_BAD_EASY_HANDLE"; break;
|
case CURLM_BAD_EASY_HANDLE: s="CURLM_BAD_EASY_HANDLE"; break;
|
||||||
case CURLM_OUT_OF_MEMORY: s="CURLM_OUT_OF_MEMORY"; break;
|
case CURLM_OUT_OF_MEMORY: s="CURLM_OUT_OF_MEMORY"; break;
|
||||||
case CURLM_INTERNAL_ERROR: s="CURLM_INTERNAL_ERROR"; break;
|
case CURLM_INTERNAL_ERROR: s="CURLM_INTERNAL_ERROR"; break;
|
||||||
case CURLM_BAD_SOCKET: s="CURLM_BAD_SOCKET"; break;
|
|
||||||
case CURLM_UNKNOWN_OPTION: s="CURLM_UNKNOWN_OPTION"; break;
|
case CURLM_UNKNOWN_OPTION: s="CURLM_UNKNOWN_OPTION"; break;
|
||||||
case CURLM_LAST: s="CURLM_LAST"; break;
|
case CURLM_LAST: s="CURLM_LAST"; break;
|
||||||
default: s="CURLM_unknown";
|
default: s="CURLM_unknown";
|
||||||
|
break;
|
||||||
|
case CURLM_BAD_SOCKET: s="CURLM_BAD_SOCKET";
|
||||||
|
fprintf(MSG_OUT, "ERROR: %s returns %s\n", where, s);
|
||||||
|
/* ignore this error */
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
fprintf(MSG_OUT, "ERROR: %s returns %s\n", where, s);
|
fprintf(MSG_OUT, "ERROR: %s returns %s\n", where, s);
|
||||||
exit(code);
|
exit(code);
|
||||||
@@ -176,6 +180,7 @@ static void event_cb(int fd, short kind, void *userp)
|
|||||||
{
|
{
|
||||||
GlobalInfo *g = (GlobalInfo*) userp;
|
GlobalInfo *g = (GlobalInfo*) userp;
|
||||||
CURLMcode rc;
|
CURLMcode rc;
|
||||||
|
(void)kind; /* unused */
|
||||||
|
|
||||||
do {
|
do {
|
||||||
rc = curl_multi_socket(g->multi, fd, &g->still_running);
|
rc = curl_multi_socket(g->multi, fd, &g->still_running);
|
||||||
@@ -195,10 +200,10 @@ static void event_cb(int fd, short kind, void *userp)
|
|||||||
/* Called by libevent when our timeout expires */
|
/* Called by libevent when our timeout expires */
|
||||||
static void timer_cb(int fd, short kind, void *userp)
|
static void timer_cb(int fd, short kind, void *userp)
|
||||||
{
|
{
|
||||||
(void)fd;
|
|
||||||
(void)kind;
|
|
||||||
GlobalInfo *g = (GlobalInfo *)userp;
|
GlobalInfo *g = (GlobalInfo *)userp;
|
||||||
CURLMcode rc;
|
CURLMcode rc;
|
||||||
|
(void)fd;
|
||||||
|
(void)kind;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
rc = curl_multi_socket(g->multi, CURL_SOCKET_TIMEOUT, &g->still_running);
|
rc = curl_multi_socket(g->multi, CURL_SOCKET_TIMEOUT, &g->still_running);
|
||||||
@@ -212,9 +217,11 @@ static void timer_cb(int fd, short kind, void *userp)
|
|||||||
/* Clean up the SockInfo structure */
|
/* Clean up the SockInfo structure */
|
||||||
static void remsock(SockInfo *f)
|
static void remsock(SockInfo *f)
|
||||||
{
|
{
|
||||||
if (!f) { return; }
|
if (f) {
|
||||||
if (f->evset) { event_del(&f->ev); }
|
if (f->evset)
|
||||||
free(f);
|
event_del(&f->ev);
|
||||||
|
free(f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -228,8 +235,9 @@ static void setsock(SockInfo*f, curl_socket_t s, CURL*e, int act, GlobalInfo*g)
|
|||||||
f->sockfd = s;
|
f->sockfd = s;
|
||||||
f->action = act;
|
f->action = act;
|
||||||
f->easy = e;
|
f->easy = e;
|
||||||
if (f->evset) { event_del(&f->ev); }
|
if (f->evset)
|
||||||
event_set( &f->ev, f->sockfd, kind, event_cb, g);
|
event_del(&f->ev);
|
||||||
|
event_set(&f->ev, f->sockfd, kind, event_cb, g);
|
||||||
f->evset=1;
|
f->evset=1;
|
||||||
event_add(&f->ev, NULL);
|
event_add(&f->ev, NULL);
|
||||||
}
|
}
|
||||||
@@ -245,8 +253,6 @@ static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g) {
|
|||||||
curl_multi_assign(g->multi, s, fdp);
|
curl_multi_assign(g->multi, s, fdp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* CURLMOPT_SOCKETFUNCTION */
|
/* CURLMOPT_SOCKETFUNCTION */
|
||||||
static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
|
static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
|
||||||
{
|
{
|
||||||
@@ -259,16 +265,16 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
|
|||||||
if (what == CURL_POLL_REMOVE) {
|
if (what == CURL_POLL_REMOVE) {
|
||||||
fprintf(MSG_OUT, "\n");
|
fprintf(MSG_OUT, "\n");
|
||||||
remsock(fdp);
|
remsock(fdp);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
if (!fdp) {
|
if (!fdp) {
|
||||||
fprintf(MSG_OUT, "Adding data: %s%s\n",
|
fprintf(MSG_OUT, "Adding data: %s\n", whatstr[what]);
|
||||||
what&CURL_POLL_IN?"READ":"",
|
|
||||||
what&CURL_POLL_OUT?"WRITE":"" );
|
|
||||||
addsock(s, e, what, g);
|
addsock(s, e, what, g);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fprintf(MSG_OUT,
|
fprintf(MSG_OUT,
|
||||||
"Changing action from %d to %d\n", fdp->action, what);
|
"Changing action from %s to %s\n",
|
||||||
|
whatstr[fdp->action], whatstr[what]);
|
||||||
setsock(fdp, s, e, what, g);
|
setsock(fdp, s, e, what, g);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -289,16 +295,21 @@ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data)
|
|||||||
|
|
||||||
|
|
||||||
/* CURLOPT_PROGRESSFUNCTION */
|
/* CURLOPT_PROGRESSFUNCTION */
|
||||||
int prog_cb (void *p, double dltotal, double dlnow, double ult, double uln)
|
static int prog_cb (void *p, double dltotal, double dlnow, double ult,
|
||||||
|
double uln)
|
||||||
{
|
{
|
||||||
ConnInfo *conn = (ConnInfo *)p;
|
ConnInfo *conn = (ConnInfo *)p;
|
||||||
|
(void)ult;
|
||||||
|
(void)uln;
|
||||||
|
|
||||||
fprintf(MSG_OUT, "Progress: %s (%g/%g)\n", conn->url, dlnow, dltotal);
|
fprintf(MSG_OUT, "Progress: %s (%g/%g)\n", conn->url, dlnow, dltotal);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Create a new easy handle, and add it to the global curl_multi */
|
/* Create a new easy handle, and add it to the global curl_multi */
|
||||||
void new_conn(char *url, GlobalInfo *g ) {
|
static void new_conn(char *url, GlobalInfo *g )
|
||||||
|
{
|
||||||
ConnInfo *conn;
|
ConnInfo *conn;
|
||||||
CURLMcode rc;
|
CURLMcode rc;
|
||||||
|
|
||||||
@@ -316,10 +327,10 @@ void new_conn(char *url, GlobalInfo *g ) {
|
|||||||
curl_easy_setopt(conn->easy, CURLOPT_URL, conn->url);
|
curl_easy_setopt(conn->easy, CURLOPT_URL, conn->url);
|
||||||
curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb);
|
curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb);
|
||||||
curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, &conn);
|
curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, &conn);
|
||||||
curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, 0);
|
curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, 1L);
|
||||||
curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error);
|
curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error);
|
||||||
curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn);
|
curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn);
|
||||||
curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, 0);
|
curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, 0L);
|
||||||
curl_easy_setopt(conn->easy, CURLOPT_PROGRESSFUNCTION, prog_cb);
|
curl_easy_setopt(conn->easy, CURLOPT_PROGRESSFUNCTION, prog_cb);
|
||||||
curl_easy_setopt(conn->easy, CURLOPT_PROGRESSDATA, conn);
|
curl_easy_setopt(conn->easy, CURLOPT_PROGRESSDATA, conn);
|
||||||
fprintf(MSG_OUT,
|
fprintf(MSG_OUT,
|
||||||
@@ -333,14 +344,15 @@ void new_conn(char *url, GlobalInfo *g ) {
|
|||||||
check_run_count(g);
|
check_run_count(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* This gets called whenever data is received from the fifo */
|
/* This gets called whenever data is received from the fifo */
|
||||||
void fifo_cb(int fd, short event, void *arg) {
|
static void fifo_cb(int fd, short event, void *arg)
|
||||||
|
{
|
||||||
char s[1024];
|
char s[1024];
|
||||||
long int rv=0;
|
long int rv=0;
|
||||||
int n=0;
|
int n=0;
|
||||||
GlobalInfo *g = (GlobalInfo *)arg;
|
GlobalInfo *g = (GlobalInfo *)arg;
|
||||||
|
(void)fd; /* unused */
|
||||||
|
(void)event; /* unused */
|
||||||
|
|
||||||
do {
|
do {
|
||||||
s[0]='\0';
|
s[0]='\0';
|
||||||
@@ -352,13 +364,12 @@ void fifo_cb(int fd, short event, void *arg) {
|
|||||||
} while ( rv != EOF);
|
} while ( rv != EOF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Create a named pipe and tell libevent to monitor it */
|
/* Create a named pipe and tell libevent to monitor it */
|
||||||
int init_fifo (GlobalInfo *g) {
|
static int init_fifo (GlobalInfo *g)
|
||||||
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
static const char *fifo = "hiper.fifo";
|
static const char *fifo = "hiper.fifo";
|
||||||
int socket;
|
int sockfd;
|
||||||
|
|
||||||
fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo);
|
fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo);
|
||||||
if (lstat (fifo, &st) == 0) {
|
if (lstat (fifo, &st) == 0) {
|
||||||
@@ -373,25 +384,25 @@ int init_fifo (GlobalInfo *g) {
|
|||||||
perror("mkfifo");
|
perror("mkfifo");
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
socket = open(fifo, O_RDWR | O_NONBLOCK, 0);
|
sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0);
|
||||||
if (socket == -1) {
|
if (sockfd == -1) {
|
||||||
perror("open");
|
perror("open");
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
g->input = fdopen(socket, "r");
|
g->input = fdopen(sockfd, "r");
|
||||||
|
|
||||||
fprintf(MSG_OUT, "Now, pipe some URL's into > %s\n", fifo);
|
fprintf(MSG_OUT, "Now, pipe some URL's into > %s\n", fifo);
|
||||||
event_set(&g->fifo_event, socket, EV_READ | EV_PERSIST, fifo_cb, g);
|
event_set(&g->fifo_event, sockfd, EV_READ | EV_PERSIST, fifo_cb, g);
|
||||||
event_add(&g->fifo_event, NULL);
|
event_add(&g->fifo_event, NULL);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
GlobalInfo g;
|
GlobalInfo g;
|
||||||
CURLMcode rc;
|
CURLMcode rc;
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
|
|
||||||
memset(&g, 0, sizeof(GlobalInfo));
|
memset(&g, 0, sizeof(GlobalInfo));
|
||||||
event_init();
|
event_init();
|
||||||
|
@@ -75,8 +75,8 @@ int main(int argc, char **argv )
|
|||||||
curl = curl_easy_init();
|
curl = curl_easy_init();
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
|
curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
|
||||||
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_errbuf);
|
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_errbuf);
|
||||||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, no);
|
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
|
||||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, yes);
|
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
|
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
|
||||||
|
|
||||||
tdoc = tidyCreate();
|
tdoc = tidyCreate();
|
||||||
|
@@ -100,7 +100,7 @@ static bool init(CURL *&conn, char *url)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
code = curl_easy_setopt(conn, CURLOPT_FOLLOWLOCATION, 1);
|
code = curl_easy_setopt(conn, CURLOPT_FOLLOWLOCATION, 1L);
|
||||||
if (code != CURLE_OK)
|
if (code != CURLE_OK)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Failed to set redirect option [%s]\n", errorBuffer);
|
fprintf(stderr, "Failed to set redirect option [%s]\n", errorBuffer);
|
||||||
|
@@ -76,14 +76,14 @@ int main(int argc, char **argv)
|
|||||||
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
|
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
|
||||||
|
|
||||||
/* enable uploading */
|
/* enable uploading */
|
||||||
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1) ;
|
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
|
||||||
|
|
||||||
/* HTTP PUT please */
|
/* HTTP PUT please */
|
||||||
curl_easy_setopt(curl, CURLOPT_PUT, 1);
|
curl_easy_setopt(curl, CURLOPT_PUT, 1L);
|
||||||
|
|
||||||
/* specify target URL, and note that this URL should include a file
|
/* specify target URL, and note that this URL should include a file
|
||||||
name, not only a directory */
|
name, not only a directory */
|
||||||
curl_easy_setopt(curl,CURLOPT_URL, url);
|
curl_easy_setopt(curl, CURLOPT_URL, url);
|
||||||
|
|
||||||
/* now specify which file to upload */
|
/* now specify which file to upload */
|
||||||
curl_easy_setopt(curl, CURLOPT_READDATA, hd_src);
|
curl_easy_setopt(curl, CURLOPT_READDATA, hd_src);
|
||||||
|
@@ -31,7 +31,7 @@ int main(void)
|
|||||||
* default bundle, then the CURLOPT_CAPATH option might come handy for
|
* default bundle, then the CURLOPT_CAPATH option might come handy for
|
||||||
* you.
|
* you.
|
||||||
*/
|
*/
|
||||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
|
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SKIP_HOSTNAME_VERFICATION
|
#ifdef SKIP_HOSTNAME_VERFICATION
|
||||||
@@ -41,7 +41,7 @@ int main(void)
|
|||||||
* subjectAltName) fields, libcurl will refuse to connect. You can skip
|
* subjectAltName) fields, libcurl will refuse to connect. You can skip
|
||||||
* this check, but this will make the connection less secure.
|
* this check, but this will make the connection less secure.
|
||||||
*/
|
*/
|
||||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
|
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
|
@@ -47,7 +47,7 @@ int main(int argc, char **argv)
|
|||||||
curl_easy_setopt(handles[HTTP_HANDLE], CURLOPT_URL, "http://website.com");
|
curl_easy_setopt(handles[HTTP_HANDLE], CURLOPT_URL, "http://website.com");
|
||||||
|
|
||||||
curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_URL, "ftp://ftpsite.com");
|
curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_URL, "ftp://ftpsite.com");
|
||||||
curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_UPLOAD, 1);
|
curl_easy_setopt(handles[FTP_HANDLE], CURLOPT_UPLOAD, 1L);
|
||||||
|
|
||||||
/* init a multi stack */
|
/* init a multi stack */
|
||||||
multi_handle = curl_multi_init();
|
multi_handle = curl_multi_init();
|
||||||
|
@@ -121,7 +121,7 @@ int main(int argc, char **argv)
|
|||||||
curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.haxx.se/");
|
curl_easy_setopt(http_handle, CURLOPT_URL, "http://www.haxx.se/");
|
||||||
|
|
||||||
curl_easy_setopt(http_handle, CURLOPT_DEBUGFUNCTION, my_trace);
|
curl_easy_setopt(http_handle, CURLOPT_DEBUGFUNCTION, my_trace);
|
||||||
curl_easy_setopt(http_handle, CURLOPT_VERBOSE, TRUE);
|
curl_easy_setopt(http_handle, CURLOPT_VERBOSE, 1L);
|
||||||
|
|
||||||
/* init a multi stack */
|
/* init a multi stack */
|
||||||
multi_handle = curl_multi_init();
|
multi_handle = curl_multi_init();
|
||||||
|
@@ -61,7 +61,7 @@ int main(int argc, char *argv[])
|
|||||||
/* what URL that receives this POST */
|
/* what URL that receives this POST */
|
||||||
curl_easy_setopt(curl, CURLOPT_URL,
|
curl_easy_setopt(curl, CURLOPT_URL,
|
||||||
"http://www.fillinyoururl.com/upload.cgi");
|
"http://www.fillinyoururl.com/upload.cgi");
|
||||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||||
|
|
||||||
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
|
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
|
||||||
curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
|
curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
|
||||||
|
@@ -15,6 +15,8 @@
|
|||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
|
|
||||||
|
#define NUMT 4
|
||||||
|
|
||||||
/*
|
/*
|
||||||
List of URLs to fetch.
|
List of URLs to fetch.
|
||||||
|
|
||||||
@@ -24,14 +26,14 @@
|
|||||||
http://www.openssl.org/docs/crypto/threads.html#DESCRIPTION
|
http://www.openssl.org/docs/crypto/threads.html#DESCRIPTION
|
||||||
|
|
||||||
*/
|
*/
|
||||||
const char *urls[]= {
|
const char * const urls[NUMT]= {
|
||||||
"http://curl.haxx.se/",
|
"http://curl.haxx.se/",
|
||||||
"ftp://cool.haxx.se/",
|
"ftp://cool.haxx.se/",
|
||||||
"http://www.contactor.se/",
|
"http://www.contactor.se/",
|
||||||
"www.haxx.se"
|
"www.haxx.se"
|
||||||
};
|
};
|
||||||
|
|
||||||
void *pull_one_url(void *url)
|
static void *pull_one_url(void *url)
|
||||||
{
|
{
|
||||||
CURL *curl;
|
CURL *curl;
|
||||||
|
|
||||||
@@ -52,10 +54,14 @@ void *pull_one_url(void *url)
|
|||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
pthread_t tid[4];
|
pthread_t tid[NUMT];
|
||||||
int i;
|
int i;
|
||||||
int error;
|
int error;
|
||||||
for(i=0; i< 4; i++) {
|
|
||||||
|
/* Must initialize libcurl before any threads are started */
|
||||||
|
curl_global_init(CURL_GLOBAL_ALL);
|
||||||
|
|
||||||
|
for(i=0; i< NUMT; i++) {
|
||||||
error = pthread_create(&tid[i],
|
error = pthread_create(&tid[i],
|
||||||
NULL, /* default attributes please */
|
NULL, /* default attributes please */
|
||||||
pull_one_url,
|
pull_one_url,
|
||||||
@@ -67,7 +73,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* now wait for all threads to terminate */
|
/* now wait for all threads to terminate */
|
||||||
for(i=0; i< 4; i++) {
|
for(i=0; i< NUMT; i++) {
|
||||||
error = pthread_join(tid[i], NULL);
|
error = pthread_join(tid[i], NULL);
|
||||||
fprintf(stderr, "Thread %d terminated\n", i);
|
fprintf(stderr, "Thread %d terminated\n", i);
|
||||||
}
|
}
|
||||||
|
@@ -21,8 +21,8 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
curl = curl_easy_init();
|
curl = curl_easy_init();
|
||||||
if(curl) {
|
if(curl) {
|
||||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||||
curl_easy_setopt(curl, CURLOPT_HEADER, 1);
|
curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
|
||||||
|
|
||||||
/* get the first document */
|
/* get the first document */
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, "http://curl.haxx.se/");
|
curl_easy_setopt(curl, CURLOPT_URL, "http://curl.haxx.se/");
|
||||||
|
@@ -36,7 +36,7 @@ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp)
|
|||||||
return 1; /* we return 1 byte at a time! */
|
return 1; /* we return 1 byte at a time! */
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1; /* no more data left to deliver */
|
return 0; /* no more data left to deliver */
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
@@ -55,7 +55,7 @@ int main(void)
|
|||||||
curl_easy_setopt(curl, CURLOPT_URL,
|
curl_easy_setopt(curl, CURLOPT_URL,
|
||||||
"http://receivingsite.com.pooh/index.cgi");
|
"http://receivingsite.com.pooh/index.cgi");
|
||||||
/* Now specify we want to POST data */
|
/* Now specify we want to POST data */
|
||||||
curl_easy_setopt(curl, CURLOPT_POST, 1);
|
curl_easy_setopt(curl, CURLOPT_POST, 1L);
|
||||||
|
|
||||||
/* 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);
|
||||||
@@ -64,7 +64,7 @@ int main(void)
|
|||||||
curl_easy_setopt(curl, CURLOPT_READDATA, &pooh);
|
curl_easy_setopt(curl, CURLOPT_READDATA, &pooh);
|
||||||
|
|
||||||
/* get verbose debug output please */
|
/* get verbose debug output please */
|
||||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
If you use POST to a HTTP 1.1 server, you can send data without knowing
|
If you use POST to a HTTP 1.1 server, you can send data without knowing
|
||||||
@@ -85,7 +85,7 @@ int main(void)
|
|||||||
#else
|
#else
|
||||||
/* Set the expected POST size. If you want to POST large amounts of data,
|
/* Set the expected POST size. If you want to POST large amounts of data,
|
||||||
consider CURLOPT_POSTFIELDSIZE_LARGE */
|
consider CURLOPT_POSTFIELDSIZE_LARGE */
|
||||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, pooh.sizeleft);
|
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (curl_off_t)pooh.sizeleft);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DISABLE_EXPECT
|
#ifdef DISABLE_EXPECT
|
||||||
|
117
docs/examples/sendrecv.c
Normal file
117
docs/examples/sendrecv.c
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* _ _ ____ _
|
||||||
|
* Project ___| | | | _ \| |
|
||||||
|
* / __| | | | |_) | |
|
||||||
|
* | (__| |_| | _ <| |___
|
||||||
|
* \___|\___/|_| \_\_____|
|
||||||
|
*
|
||||||
|
* An example of curl_easy_send() and curl_easy_recv() usage.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <curl/curl.h>
|
||||||
|
|
||||||
|
/* Auxiliary function that waits on the socket. */
|
||||||
|
static int wait_on_socket(int sockfd, int for_recv, long timeout_ms)
|
||||||
|
{
|
||||||
|
struct timeval tv;
|
||||||
|
long seconds, usecs;
|
||||||
|
fd_set infd, outfd, errfd;
|
||||||
|
int res;
|
||||||
|
|
||||||
|
tv.tv_sec = timeout_ms / 1000;
|
||||||
|
tv.tv_usec= (timeout_ms % 1000) * 1000;
|
||||||
|
|
||||||
|
FD_ZERO(&infd);
|
||||||
|
FD_ZERO(&outfd);
|
||||||
|
FD_ZERO(&errfd);
|
||||||
|
|
||||||
|
FD_SET(sockfd, &errfd); /* always check for error */
|
||||||
|
|
||||||
|
if(for_recv)
|
||||||
|
{
|
||||||
|
FD_SET(sockfd, &infd);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FD_SET(sockfd, &outfd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* select() returns the number of signalled sockets or -1 */
|
||||||
|
res = select(sockfd + 1, &infd, &outfd, &errfd, &tv);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
CURL *curl;
|
||||||
|
CURLcode res;
|
||||||
|
/* Minimalistic http request */
|
||||||
|
const char *request = "GET / HTTP/1.0\r\nHost: curl.haxx.se\r\n\r\n";
|
||||||
|
int sockfd; /* socket */
|
||||||
|
size_t iolen;
|
||||||
|
|
||||||
|
curl = curl_easy_init();
|
||||||
|
if(curl) {
|
||||||
|
curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
|
||||||
|
/* Do not do the transfer - only connect to host */
|
||||||
|
curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L);
|
||||||
|
res = curl_easy_perform(curl);
|
||||||
|
|
||||||
|
if(CURLE_OK != res)
|
||||||
|
{
|
||||||
|
printf("Error: %s\n", strerror(res));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Extract the socket from the curl handle - we'll need it
|
||||||
|
* for waiting */
|
||||||
|
res = curl_easy_getinfo(curl, CURLINFO_LASTSOCKET, &sockfd);
|
||||||
|
|
||||||
|
if(CURLE_OK != res)
|
||||||
|
{
|
||||||
|
printf("Error: %s\n", strerror(res));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* wait for the socket to become ready for sending */
|
||||||
|
if(!wait_on_socket(sockfd, 0, 60000L))
|
||||||
|
{
|
||||||
|
printf("Error: timeout.\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
puts("Sending request.");
|
||||||
|
/* Send the request. Real applications should check the iolen
|
||||||
|
* to see if all the request has been sent */
|
||||||
|
res = curl_easy_send(curl, request, strlen(request), &iolen);
|
||||||
|
|
||||||
|
if(CURLE_OK != res)
|
||||||
|
{
|
||||||
|
printf("Error: %s\n", strerror(res));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
puts("Reading response.");
|
||||||
|
|
||||||
|
/* read the response */
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
char buf[1024];
|
||||||
|
|
||||||
|
wait_on_socket(sockfd, 1, 60000L);
|
||||||
|
res = curl_easy_recv(curl, buf, 1024, &iolen);
|
||||||
|
|
||||||
|
if(CURLE_OK != res)
|
||||||
|
break;
|
||||||
|
|
||||||
|
printf("Received %u bytes.\n", iolen);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* always cleanup */
|
||||||
|
curl_easy_cleanup(curl);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
@@ -39,7 +39,7 @@ int main(int argc, char **argv)
|
|||||||
curl_easy_setopt(curl_handle, CURLOPT_URL, "http://curl.haxx.se");
|
curl_easy_setopt(curl_handle, CURLOPT_URL, "http://curl.haxx.se");
|
||||||
|
|
||||||
/* no progress meter please */
|
/* no progress meter please */
|
||||||
curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1);
|
curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1L);
|
||||||
|
|
||||||
/* send all data to this function */
|
/* send all data to this function */
|
||||||
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_data);
|
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_data);
|
||||||
@@ -57,7 +57,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* we want the headers to this file handle */
|
/* we want the headers to this file handle */
|
||||||
curl_easy_setopt(curl_handle, CURLOPT_WRITEHEADER ,headerfile);
|
curl_easy_setopt(curl_handle, CURLOPT_WRITEHEADER, headerfile);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Notice here that if you want the actual data sent anywhere else but
|
* Notice here that if you want the actual data sent anywhere else but
|
||||||
|
@@ -26,7 +26,7 @@ int main(void)
|
|||||||
|
|
||||||
/* if we don't provide POSTFIELDSIZE, libcurl will strlen() by
|
/* if we don't provide POSTFIELDSIZE, libcurl will strlen() by
|
||||||
itself */
|
itself */
|
||||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, strlen(postthis));
|
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(postthis));
|
||||||
|
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
|
|
||||||
|
@@ -77,7 +77,7 @@ int main(int argc, char **argv)
|
|||||||
fprintf(stderr,"can't set crypto engine\n");
|
fprintf(stderr,"can't set crypto engine\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (curl_easy_setopt(curl, CURLOPT_SSLENGINE_DEFAULT,1) != CURLE_OK)
|
if (curl_easy_setopt(curl, CURLOPT_SSLENGINE_DEFAULT,1L) != CURLE_OK)
|
||||||
{ /* set the crypto engine as default */
|
{ /* set the crypto engine as default */
|
||||||
/* only needed for the first time you load
|
/* only needed for the first time you load
|
||||||
a engine in a curl object... */
|
a engine in a curl object... */
|
||||||
@@ -108,7 +108,7 @@ int main(int argc, char **argv)
|
|||||||
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,1L);
|
||||||
|
|
||||||
res = curl_easy_perform(curl);
|
res = curl_easy_perform(curl);
|
||||||
break; /* we are done... */
|
break; /* we are done... */
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
|
pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
|
||||||
int j = 0;
|
int j = 0;
|
||||||
gint num_urls = 9; /* Just make sure this is less than urls[]*/
|
gint num_urls = 9; /* Just make sure this is less than urls[]*/
|
||||||
char *urls[]= {
|
const char * const urls[]= {
|
||||||
"90022",
|
"90022",
|
||||||
"90023",
|
"90023",
|
||||||
"90024",
|
"90024",
|
||||||
@@ -58,7 +58,6 @@ void *pull_one_url(void *NaN)
|
|||||||
CURLcode res;
|
CURLcode res;
|
||||||
gchar *http;
|
gchar *http;
|
||||||
FILE *outfile;
|
FILE *outfile;
|
||||||
gint i;
|
|
||||||
|
|
||||||
/* Stop threads from entering unless j is incremented */
|
/* Stop threads from entering unless j is incremented */
|
||||||
pthread_mutex_lock(&lock);
|
pthread_mutex_lock(&lock);
|
||||||
@@ -167,7 +166,9 @@ static gboolean cb_delete(GtkWidget *window, gpointer data)
|
|||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
GtkWidget *top_window, *outside_frame, *inside_frame, *progress_bar;
|
GtkWidget *top_window, *outside_frame, *inside_frame, *progress_bar;
|
||||||
GtkAdjustment *adj;
|
|
||||||
|
/* Must initialize libcurl before any threads are started */
|
||||||
|
curl_global_init(CURL_GLOBAL_ALL);
|
||||||
|
|
||||||
/* Init thread */
|
/* Init thread */
|
||||||
g_thread_init(NULL);
|
g_thread_init(NULL);
|
||||||
|
@@ -189,7 +189,7 @@ int SyncTime_CURL_Fetch(CURL *curl, char *URL_Str, char *OutFileName,
|
|||||||
|
|
||||||
outfile = NULL;
|
outfile = NULL;
|
||||||
if (HttpGetBody == HTTP_COMMAND_HEAD)
|
if (HttpGetBody == HTTP_COMMAND_HEAD)
|
||||||
curl_easy_setopt(curl, CURLOPT_NOBODY, 1);
|
curl_easy_setopt(curl, CURLOPT_NOBODY, 1L);
|
||||||
else {
|
else {
|
||||||
outfile = fopen(OutFileName, "wb");
|
outfile = fopen(OutFileName, "wb");
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile);
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile);
|
||||||
|
@@ -23,6 +23,8 @@
|
|||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
|
|
||||||
|
#define NUMT 4
|
||||||
|
|
||||||
/* we have this global to let the callback get easy access to it */
|
/* we have this global to let the callback get easy access to it */
|
||||||
static pthread_mutex_t *lockarray;
|
static pthread_mutex_t *lockarray;
|
||||||
|
|
||||||
@@ -89,7 +91,7 @@ void init_locks(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* List of URLs to fetch.*/
|
/* List of URLs to fetch.*/
|
||||||
const char *urls[]= {
|
const char * const urls[]= {
|
||||||
"https://www.sf.net/",
|
"https://www.sf.net/",
|
||||||
"https://www.openssl.org/",
|
"https://www.openssl.org/",
|
||||||
"https://www.sf.net/",
|
"https://www.sf.net/",
|
||||||
@@ -104,8 +106,8 @@ static void *pull_one_url(void *url)
|
|||||||
curl_easy_setopt(curl, CURLOPT_URL, url);
|
curl_easy_setopt(curl, CURLOPT_URL, url);
|
||||||
/* this example doesn't verify the server's certificate, which means we
|
/* this example doesn't verify the server's certificate, which means we
|
||||||
might be downloading stuff from an impostor */
|
might be downloading stuff from an impostor */
|
||||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
|
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
|
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
|
||||||
curl_easy_perform(curl); /* ignores error */
|
curl_easy_perform(curl); /* ignores error */
|
||||||
curl_easy_cleanup(curl);
|
curl_easy_cleanup(curl);
|
||||||
|
|
||||||
@@ -114,15 +116,18 @@ static void *pull_one_url(void *url)
|
|||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
pthread_t tid[4];
|
pthread_t tid[NUMT];
|
||||||
int i;
|
int i;
|
||||||
int error;
|
int error;
|
||||||
(void)argc; /* we don't use any arguments in this example */
|
(void)argc; /* we don't use any arguments in this example */
|
||||||
(void)argv;
|
(void)argv;
|
||||||
|
|
||||||
|
/* Must initialize libcurl before any threads are started */
|
||||||
|
curl_global_init(CURL_GLOBAL_ALL);
|
||||||
|
|
||||||
init_locks();
|
init_locks();
|
||||||
|
|
||||||
for(i=0; i< 4; i++) {
|
for(i=0; i< NUMT; i++) {
|
||||||
error = pthread_create(&tid[i],
|
error = pthread_create(&tid[i],
|
||||||
NULL, /* default attributes please */
|
NULL, /* default attributes please */
|
||||||
pull_one_url,
|
pull_one_url,
|
||||||
@@ -134,7 +139,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* now wait for all threads to terminate */
|
/* now wait for all threads to terminate */
|
||||||
for(i=0; i< 4; i++) {
|
for(i=0; i< NUMT; i++) {
|
||||||
error = pthread_join(tid[i], NULL);
|
error = pthread_join(tid[i], NULL);
|
||||||
fprintf(stderr, "Thread %d terminated\n", i);
|
fprintf(stderr, "Thread %d terminated\n", i);
|
||||||
}
|
}
|
||||||
|
@@ -19,7 +19,7 @@ man_MANS = curl_easy_cleanup.3 curl_easy_getinfo.3 curl_easy_init.3 \
|
|||||||
libcurl-tutorial.3 curl_easy_reset.3 curl_easy_escape.3 \
|
libcurl-tutorial.3 curl_easy_reset.3 curl_easy_escape.3 \
|
||||||
curl_easy_unescape.3 curl_multi_setopt.3 curl_multi_socket.3 \
|
curl_easy_unescape.3 curl_multi_setopt.3 curl_multi_socket.3 \
|
||||||
curl_multi_timeout.3 curl_formget.3 curl_multi_assign.3 \
|
curl_multi_timeout.3 curl_formget.3 curl_multi_assign.3 \
|
||||||
curl_easy_pause.3
|
curl_easy_pause.3 curl_easy_recv.3 curl_easy_send.3
|
||||||
|
|
||||||
HTMLPAGES = curl_easy_cleanup.html curl_easy_getinfo.html \
|
HTMLPAGES = curl_easy_cleanup.html curl_easy_getinfo.html \
|
||||||
curl_easy_init.html curl_easy_perform.html curl_easy_setopt.html \
|
curl_easy_init.html curl_easy_perform.html curl_easy_setopt.html \
|
||||||
@@ -37,7 +37,8 @@ HTMLPAGES = curl_easy_cleanup.html curl_easy_getinfo.html \
|
|||||||
curl_share_strerror.html curl_global_init_mem.html libcurl-tutorial.html \
|
curl_share_strerror.html curl_global_init_mem.html libcurl-tutorial.html \
|
||||||
curl_easy_reset.html curl_easy_escape.html curl_easy_unescape.html \
|
curl_easy_reset.html curl_easy_escape.html curl_easy_unescape.html \
|
||||||
curl_multi_setopt.html curl_multi_socket.html curl_multi_timeout.html \
|
curl_multi_setopt.html curl_multi_socket.html curl_multi_timeout.html \
|
||||||
curl_formget.html curl_multi_assign.html curl_easy_pause.html
|
curl_formget.html curl_multi_assign.html curl_easy_pause.html \
|
||||||
|
curl_easy_recv.html curl_easy_send.html
|
||||||
|
|
||||||
PDFPAGES = curl_easy_cleanup.pdf curl_easy_getinfo.pdf curl_easy_init.pdf \
|
PDFPAGES = curl_easy_cleanup.pdf curl_easy_getinfo.pdf curl_easy_init.pdf \
|
||||||
curl_easy_perform.pdf curl_easy_setopt.pdf curl_easy_duphandle.pdf \
|
curl_easy_perform.pdf curl_easy_setopt.pdf curl_easy_duphandle.pdf \
|
||||||
@@ -54,7 +55,8 @@ PDFPAGES = curl_easy_cleanup.pdf curl_easy_getinfo.pdf curl_easy_init.pdf \
|
|||||||
curl_share_strerror.pdf curl_global_init_mem.pdf libcurl-tutorial.pdf \
|
curl_share_strerror.pdf curl_global_init_mem.pdf libcurl-tutorial.pdf \
|
||||||
curl_easy_reset.pdf curl_easy_escape.pdf curl_easy_unescape.pdf \
|
curl_easy_reset.pdf curl_easy_escape.pdf curl_easy_unescape.pdf \
|
||||||
curl_multi_setopt.pdf curl_multi_socket.pdf curl_multi_timeout.pdf \
|
curl_multi_setopt.pdf curl_multi_socket.pdf curl_multi_timeout.pdf \
|
||||||
curl_formget.pdf curl_multi_assign.pdf curl_easy_pause.pdf
|
curl_formget.pdf curl_multi_assign.pdf curl_easy_pause.pdf \
|
||||||
|
curl_easy_recv.pdf curl_easy_send.pdf
|
||||||
|
|
||||||
CLEANFILES = $(HTMLPAGES) $(PDFPAGES)
|
CLEANFILES = $(HTMLPAGES) $(PDFPAGES)
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
.\" * | (__| |_| | _ <| |___
|
.\" * | (__| |_| | _ <| |___
|
||||||
.\" * \___|\___/|_| \_\_____|
|
.\" * \___|\___/|_| \_\_____|
|
||||||
.\" *
|
.\" *
|
||||||
.\" * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
|
.\" * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
.\" *
|
.\" *
|
||||||
.\" * This software is licensed as described in the file COPYING, which
|
.\" * This software is licensed as described in the file COPYING, which
|
||||||
.\" * you should have received as part of this distribution. The terms
|
.\" * you should have received as part of this distribution. The terms
|
||||||
@@ -35,12 +35,12 @@ returns that as a new allocated string. All input characters that are not a-z,
|
|||||||
A-Z or 0-9 are converted to their "URL escaped" version (%NN where NN is a
|
A-Z or 0-9 are converted to their "URL escaped" version (%NN where NN is a
|
||||||
two-digit hexadecimal number).
|
two-digit hexadecimal number).
|
||||||
|
|
||||||
If the \fBlength\fP argument is set to 0 (zero), curl_easy_escape() uses
|
If the \fBlength\fP argument is set to 0 (zero), \fIcurl_easy_escape(3)\fP
|
||||||
strlen() on the input \fBurl\fP to find out the size.
|
uses strlen() on the input \fBurl\fP to find out the size.
|
||||||
|
|
||||||
You must \fIcurl_free(3)\fP the returned string when you're done with it.
|
You must \fIcurl_free(3)\fP the returned string when you're done with it.
|
||||||
.SH AVAILABILITY
|
.SH AVAILABILITY
|
||||||
Added in 7.15.4 and replaces the old curl_escape() function.
|
Added in 7.15.4 and replaces the old \fIcurl_escape(3)\fP function.
|
||||||
.SH RETURN VALUE
|
.SH RETURN VALUE
|
||||||
A pointer to a zero terminated string or NULL if it failed.
|
A pointer to a zero terminated string or NULL if it failed.
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
.\" * | (__| |_| | _ <| |___
|
.\" * | (__| |_| | _ <| |___
|
||||||
.\" * \___|\___/|_| \_\_____|
|
.\" * \___|\___/|_| \_\_____|
|
||||||
.\" *
|
.\" *
|
||||||
.\" * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
|
.\" * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
.\" *
|
.\" *
|
||||||
.\" * This software is licensed as described in the file COPYING, which
|
.\" * This software is licensed as described in the file COPYING, which
|
||||||
.\" * you should have received as part of this distribution. The terms
|
.\" * you should have received as part of this distribution. The terms
|
||||||
@@ -89,6 +89,12 @@ complete execution time for multiple redirections. (Added in 7.9.7)
|
|||||||
.IP CURLINFO_REDIRECT_COUNT
|
.IP CURLINFO_REDIRECT_COUNT
|
||||||
Pass a pointer to a long to receive the total number of redirections that were
|
Pass a pointer to a long to receive the total number of redirections that were
|
||||||
actually followed. (Added in 7.9.7)
|
actually followed. (Added in 7.9.7)
|
||||||
|
.IP CURLINFO_REDIRECT_URL
|
||||||
|
Pass a pointer to a char pointer to receive the URL a redirect \fIwould\fP
|
||||||
|
take you to if you would enable CURLOPT_FOLLOWLOCATION. This can come very
|
||||||
|
handy if you think using the built-in libcurl redirect logic isn't good enough
|
||||||
|
for you but you would still prefer to avoid implementing all the magic of
|
||||||
|
figuring out the new URL. (Added in 7.18.2)
|
||||||
.IP CURLINFO_SIZE_UPLOAD
|
.IP CURLINFO_SIZE_UPLOAD
|
||||||
Pass a pointer to a double to receive the total amount of bytes that were
|
Pass a pointer to a double to receive the total amount of bytes that were
|
||||||
uploaded.
|
uploaded.
|
||||||
|
@@ -14,7 +14,10 @@ paused, and you can unpause a connection that was previously paused.
|
|||||||
|
|
||||||
A connection can made to pause by using this function or by letting the read
|
A connection can made to pause by using this function or by letting the read
|
||||||
or the write callbacks return the proper magic return code
|
or the write callbacks return the proper magic return code
|
||||||
(\fICURL_READFUNC_PAUSE\fP and \fICURL_WRITEFUNC_PAUSE\fP).
|
(\fICURL_READFUNC_PAUSE\fP and \fICURL_WRITEFUNC_PAUSE\fP). A write callback
|
||||||
|
that returns pause signals to the library that it couldn't take care of any
|
||||||
|
data at all, and that data will then be delivered again to the callback when
|
||||||
|
the writing is later unpaused.
|
||||||
|
|
||||||
NOTE: while it may feel tempting, take care and notice that you cannot call
|
NOTE: while it may feel tempting, take care and notice that you cannot call
|
||||||
this function from another thread.
|
this function from another thread.
|
||||||
|
70
docs/libcurl/curl_easy_recv.3
Normal file
70
docs/libcurl/curl_easy_recv.3
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
.\" **************************************************************************
|
||||||
|
.\" * _ _ ____ _
|
||||||
|
.\" * Project ___| | | | _ \| |
|
||||||
|
.\" * / __| | | | |_) | |
|
||||||
|
.\" * | (__| |_| | _ <| |___
|
||||||
|
.\" * \___|\___/|_| \_\_____|
|
||||||
|
.\" *
|
||||||
|
.\" * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
.\" *
|
||||||
|
.\" * This software is licensed as described in the file COPYING, which
|
||||||
|
.\" * you should have received as part of this distribution. The terms
|
||||||
|
.\" * are also available at http://curl.haxx.se/docs/copyright.html.
|
||||||
|
.\" *
|
||||||
|
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
.\" * copies of the Software, and permit persons to whom the Software is
|
||||||
|
.\" * furnished to do so, under the terms of the COPYING file.
|
||||||
|
.\" *
|
||||||
|
.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
.\" * KIND, either express or implied.
|
||||||
|
.\" *
|
||||||
|
.\" * $Id$
|
||||||
|
.\" **************************************************************************
|
||||||
|
.\"
|
||||||
|
.TH curl_easy_recv 3 "29 April 2008" "libcurl 7.18.2" "libcurl Manual"
|
||||||
|
.SH NAME
|
||||||
|
curl_easy_recv - receives raw data on an "easy" connection
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B #include <curl/easy.h>
|
||||||
|
.sp
|
||||||
|
.BI "CURLcode curl_easy_recv( CURL *" curl ", void *" buffer ","
|
||||||
|
.BI "size_t " buflen ", size_t *" n ");"
|
||||||
|
.ad
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This function receives raw data from the established connection. You may use
|
||||||
|
it together with \fIcurl_easy_send(3)\fP to implement custom protocols using
|
||||||
|
libcurl. This functionality can be particularly useful if you use proxies
|
||||||
|
and/or SSL encryption: libcurl will take care of proxy negotiation and
|
||||||
|
connection set-up.
|
||||||
|
|
||||||
|
\fBbuffer\fP is a pointer to your buffer that will get the received
|
||||||
|
data. \fBbuflen\fP is the maximum amount of data you can get in that
|
||||||
|
buffer. The variable \fBn\fP points to will receive the number of received
|
||||||
|
bytes.
|
||||||
|
|
||||||
|
To establish the connection, set \fBCURLOPT_CONNECT_ONLY\fP option before
|
||||||
|
calling \fIcurl_easy_perform(3)\fP. Note that \fIcurl_easy_recv(3)\fP does not
|
||||||
|
work on connections that were created without this option.
|
||||||
|
|
||||||
|
You must ensure that the socket has data to read before calling
|
||||||
|
\fIcurl_easy_recv(3)\fP, otherwise the call will return \fBCURLE_AGAIN\fP -
|
||||||
|
the socket is used in non-blocking mode internally. Use
|
||||||
|
\fIcurl_easy_getinfo(3)\fP with \fBCURLINFO_LASTSOCKET\fP to obtain the
|
||||||
|
socket; use your operating system facilities like \fIselect(2)\fP to check if
|
||||||
|
it has any data you can read.
|
||||||
|
.SH AVAILABILITY
|
||||||
|
Added in 7.18.2.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
On success, returns \fBCURLE_OK\fP, stores the received data into
|
||||||
|
\fBbuffer\fP, and the number of bytes it actually read into \fB*n\fP.
|
||||||
|
|
||||||
|
On failure, returns the appropriate error code.
|
||||||
|
|
||||||
|
If there is no data to read, the function returns \fBCURLE_AGAIN\fP. Use
|
||||||
|
your operating system facilities to wait until the data is ready, and retry.
|
||||||
|
.SH EXAMPLE
|
||||||
|
See \fBsendrecv.c\fP in \fBdocs/examples\fP directory for usage example.
|
||||||
|
.SH "SEE ALSO"
|
||||||
|
.BR curl_easy_setopt "(3), " curl_easy_perform "(3), "
|
||||||
|
.BR curl_easy_getinfo "(3), "
|
||||||
|
.BR curl_easy_send "(3) "
|
65
docs/libcurl/curl_easy_send.3
Normal file
65
docs/libcurl/curl_easy_send.3
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
.\" **************************************************************************
|
||||||
|
.\" * _ _ ____ _
|
||||||
|
.\" * Project ___| | | | _ \| |
|
||||||
|
.\" * / __| | | | |_) | |
|
||||||
|
.\" * | (__| |_| | _ <| |___
|
||||||
|
.\" * \___|\___/|_| \_\_____|
|
||||||
|
.\" *
|
||||||
|
.\" * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
|
.\" *
|
||||||
|
.\" * This software is licensed as described in the file COPYING, which
|
||||||
|
.\" * you should have received as part of this distribution. The terms
|
||||||
|
.\" * are also available at http://curl.haxx.se/docs/copyright.html.
|
||||||
|
.\" *
|
||||||
|
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||||||
|
.\" * copies of the Software, and permit persons to whom the Software is
|
||||||
|
.\" * furnished to do so, under the terms of the COPYING file.
|
||||||
|
.\" *
|
||||||
|
.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
.\" * KIND, either express or implied.
|
||||||
|
.\" *
|
||||||
|
.\" * $Id$
|
||||||
|
.\" **************************************************************************
|
||||||
|
.\"
|
||||||
|
.TH curl_easy_send 3 "29 April 2008" "libcurl 7.18.2" "libcurl Manual"
|
||||||
|
.SH NAME
|
||||||
|
curl_easy_send - sends raw data over an "easy" connection
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B #include <curl/easy.h>
|
||||||
|
.sp
|
||||||
|
.BI "CURLcode curl_easy_send( CURL *" curl ", const void *" buffer ","
|
||||||
|
.BI " size_t " buflen ", size_t *" n ");"
|
||||||
|
.ad
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This function sends arbitrary data over the established connection. You may
|
||||||
|
use it together with \fIcurl_easy_recv(3)\fP to implement custom protocols
|
||||||
|
using libcurl. This functionality can be particularly useful if you use
|
||||||
|
proxies and/or SSL encryption: libcurl will take care of proxy negotiation and
|
||||||
|
connection set-up.
|
||||||
|
|
||||||
|
\fBbuffer\fP is a pointer to the data of length \fBbuflen\fP that you want sent.
|
||||||
|
The variable \fBn\fP points to will receive the number of sent bytes.
|
||||||
|
|
||||||
|
To establish the connection, set \fBCURLOPT_CONNECT_ONLY\fP option before
|
||||||
|
calling \fIcurl_easy_perform(3)\fP. Note that \fIcurl_easy_send(3)\fP will not
|
||||||
|
work on connections that were created without this option.
|
||||||
|
|
||||||
|
You must ensure that the socket is writable before calling
|
||||||
|
\fIcurl_easy_send(3)\fP, otherwise the call will return \fBCURLE_AGAIN\fP -
|
||||||
|
the socket is used in non-blocking mode internally. Use
|
||||||
|
\fIcurl_easy_getinfo(3)\fP with \fBCURLINFO_LASTSOCKET\fP to obtain the
|
||||||
|
socket; use your operating system facilities like \fIselect(2)\fP to check if
|
||||||
|
it can be written to.
|
||||||
|
.SH AVAILABILITY
|
||||||
|
Added in 7.18.2.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
On success, returns \fBCURLE_OK\fP and stores the number of bytes actually
|
||||||
|
sent into \fB*n\fP. Note that this may very well be less than the amount you
|
||||||
|
wanted to send.
|
||||||
|
|
||||||
|
On failure, returns the appropriate error code.
|
||||||
|
.SH EXAMPLE
|
||||||
|
See \fBsendrecv.c\fP in \fBdocs/examples\fP directory for usage example.
|
||||||
|
.SH "SEE ALSO"
|
||||||
|
.BR curl_easy_setopt "(3), " curl_easy_perform "(3), " curl_easy_getinfo "(3), "
|
||||||
|
.BR curl_easy_recv "(3) "
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user