Compare commits
92 Commits
cares-1_6_
...
curl-7_19_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1dc54324f4 | ||
|
|
89ecf4ac01 | ||
|
|
d42eac4287 | ||
|
|
3fa6c51bb1 | ||
|
|
37c5250e03 | ||
|
|
0d3bb93ce8 | ||
|
|
5e74c58b73 | ||
|
|
7ac16811cc | ||
|
|
29b6a732f3 | ||
|
|
3dcd6bc597 | ||
|
|
1342f5d592 | ||
|
|
8fbfd5916d | ||
|
|
1225d36188 | ||
|
|
a19e02be5e | ||
|
|
0761e60a4a | ||
|
|
af96c8304f | ||
|
|
0de0e95020 | ||
|
|
35d8fb0501 | ||
|
|
87c71953be | ||
|
|
79a91b8168 | ||
|
|
2f9038bf62 | ||
|
|
4d50ca4e21 | ||
|
|
a1077d0970 | ||
|
|
b9fdc0c251 | ||
|
|
f471b4836f | ||
|
|
32b75d1b69 | ||
|
|
f7e3bd28b4 | ||
|
|
452e52f958 | ||
|
|
0090099565 | ||
|
|
2ed23cb50d | ||
|
|
a97ab4f933 | ||
|
|
bc93011554 | ||
|
|
14b6cc4e22 | ||
|
|
80ffd3581f | ||
|
|
dd058b8de6 | ||
|
|
3c2ad4022c | ||
|
|
1f4b8da60a | ||
|
|
9af4cf219e | ||
|
|
cf4b88fcc4 | ||
|
|
2215a9a181 | ||
|
|
aa32f61ce7 | ||
|
|
8266727062 | ||
|
|
d839230402 | ||
|
|
1cc50d31f9 | ||
|
|
104377d718 | ||
|
|
83640b2ee5 | ||
|
|
9aea3e265d | ||
|
|
59227bf075 | ||
|
|
f61cfc5931 | ||
|
|
27b8a5fd84 | ||
|
|
60ff74140e | ||
|
|
4f0a7170af | ||
|
|
6d2ff9d2a7 | ||
|
|
122b0bfe82 | ||
|
|
3eae7695fc | ||
|
|
6efde61227 | ||
|
|
1c48124db4 | ||
|
|
e9895ea2e7 | ||
|
|
eab8c0d754 | ||
|
|
7ffe62d901 | ||
|
|
d5bfec70af | ||
|
|
2a86817349 | ||
|
|
5be7d88b34 | ||
|
|
8a335ee7fd | ||
|
|
216ad2680b | ||
|
|
e16509d5cf | ||
|
|
19c9b7c803 | ||
|
|
ffd08df863 | ||
|
|
460459e8db | ||
|
|
07416b61e3 | ||
|
|
000a13e21a | ||
|
|
03ca98b0df | ||
|
|
abb74a1203 | ||
|
|
77c1d556bb | ||
|
|
bd55ab05bd | ||
|
|
2025193b7a | ||
|
|
418683f537 | ||
|
|
008b848dcc | ||
|
|
79b7575fd8 | ||
|
|
792279581b | ||
|
|
3ca360391a | ||
|
|
5f0a3797c9 | ||
|
|
2d2c53d20e | ||
|
|
02ca14fd0e | ||
|
|
0f5895faee | ||
|
|
c0dfe6e51d | ||
|
|
1b4af1f8d8 | ||
|
|
8e255534a1 | ||
|
|
4607dfe257 | ||
|
|
6e376532b0 | ||
|
|
4ed64fd5ee | ||
|
|
21700ae515 |
216
CHANGES
216
CHANGES
@@ -6,6 +6,222 @@
|
||||
|
||||
Changelog
|
||||
|
||||
Version 7.19.3 (19 January 2009)
|
||||
|
||||
Daniel Stenberg (16 Jan 2009)
|
||||
- Andrew de los Reyes fixed curlbuild.h for "generic" gcc builds on PPC, both
|
||||
32 bit and 64 bit.
|
||||
|
||||
Daniel Stenberg (15 Jan 2009)
|
||||
- Tim Ansell fixed a compiler warning in lib/cookie.c
|
||||
|
||||
Daniel Stenberg (14 Jan 2009)
|
||||
- Grant Erickson fixed timeouts for TFTP such that specifying a
|
||||
connect-timeout, a max-time or both options work correctly and as expected
|
||||
by passing the correct boolean value to Curl_timeleft via the
|
||||
'duringconnect' parameter.
|
||||
|
||||
With this small change, curl TFTP now behaves as expected (and likely as
|
||||
originally-designed):
|
||||
|
||||
1) For non-existent or unreachable dotted IP addresses:
|
||||
|
||||
a) With no options, follows the default curl 300s timeout...
|
||||
b) With --connect-timeout only, follows that value...
|
||||
c) With --max-time only, follows that value...
|
||||
d) With both --connect-timeout and --max-time, follows the smaller value...
|
||||
|
||||
and times out with a "curl: (7) Couldn't connect to server" error.
|
||||
|
||||
2) For transfers to/from a valid host:
|
||||
|
||||
a) With no options, follows default curl 300s timeout for the
|
||||
first XRQ/DATA/ACK transaction and the default TFTP 3600s
|
||||
timeout for the remainder of the transfer...
|
||||
|
||||
b) With --connect-time only, follows that value for the
|
||||
first XRQ/DATA/ACK transaction and the default TFTP 3600s
|
||||
timeout for the remainder of the transfer...
|
||||
|
||||
c) With --max-time only, follows that value for the first
|
||||
XRQ/DATA/ACK transaction and for the remainder of the
|
||||
transfer...
|
||||
|
||||
d) With both --connect-timeout and --max-time, follows the former
|
||||
for the first XRQ/DATA/ACK transaction and the latter for the
|
||||
remainder of the transfer...
|
||||
|
||||
and times out with a "curl: (28) Timeout was reached" error as
|
||||
appropriate.
|
||||
|
||||
Daniel Stenberg (13 Jan 2009)
|
||||
- Michael Wallner fixed a NULL pointer deref when calling
|
||||
curl_easy_setup(curl, CURLOPT_COOKIELIST, "SESS") on a CURL handle with no
|
||||
cookies data.
|
||||
|
||||
- Stefan Teleman brought a patch to fix the default curlbuild.h file for the
|
||||
SunPro compilers.
|
||||
|
||||
Daniel Stenberg (12 Jan 2009)
|
||||
- Based on bug report #2498665 (http://curl.haxx.se/bug/view.cgi?id=2498665)
|
||||
by Daniel Black, I've now added magic to the configure script that makes it
|
||||
use pkg-config to detect gnutls details as well if the existing method
|
||||
(using libgnutls-config) fails. While doing this, I cleaned up and unified
|
||||
the pkg-config usage when detecting openssl and nss as well.
|
||||
|
||||
Daniel Stenberg (11 Jan 2009)
|
||||
- Karl Moerder brought the patch that creates vc9 Makefiles, and I made
|
||||
'maketgz' now use the actual makefile targets to do the VC8 and VC9
|
||||
makefiles.
|
||||
|
||||
Daniel Stenberg (10 Jan 2009)
|
||||
- Emil Romanus fixed:
|
||||
|
||||
When using the multi interface over HTTP and the server returns a Location
|
||||
header, the running easy handle will get stuck in the CURLM_STATE_PERFORM
|
||||
state, leaving the external event loop stuck waiting for data from the
|
||||
ingoing socket (when using the curl_multi_socket_action stuff). While this
|
||||
bug was pretty hard to find, it seems to require only a one-line fix. The
|
||||
break statement on line 1374 in multi.c caused the function to skip the call
|
||||
to multistate().
|
||||
|
||||
How to reproduce this bug? Well, that's another question. evhiperfifo.c in
|
||||
the examples directory chokes on this bug only _sometimes_, probably
|
||||
depending on how fast the URLs are added. One way of testing the bug out is
|
||||
writing to hiper.fifo from more than one source at the same time.
|
||||
|
||||
Daniel Fandrich (7 Jan 2009)
|
||||
- Unified much of the SessionHandle initialization done in Curl_open() and
|
||||
curl_easy_reset() by creating Curl_init_userdefined(). This had the side
|
||||
effect of fixing curl_easy_reset() so it now also resets
|
||||
CURLOPT_FTP_FILEMETHOD and CURLOPT_SSL_SESSIONID_CACHE
|
||||
|
||||
Daniel Stenberg (7 Jan 2009)
|
||||
- Rob Crittenden did once again provide an NSS update:
|
||||
|
||||
I have to jump through a few hoops now with the NSS library initialization
|
||||
since another part of an application may have already initialized NSS by the
|
||||
time Curl gets invoked. This patch is more careful to only shutdown the NSS
|
||||
library if Curl did the initialization.
|
||||
|
||||
It also adds in a bit of code to set the default ciphers if the app that
|
||||
call NSS_Init* did not call NSS_SetDomesticPolicy() or set specific
|
||||
ciphers. One might argue that this lets other application developers get
|
||||
lazy and/or they aren't using the NSS API correctly, and you'd be right.
|
||||
But still, this will avoid terribly difficult-to-trace crashes and is
|
||||
generally helpful.
|
||||
|
||||
Daniel Stenberg (1 Jan 2009)
|
||||
- 'reconf' is removed since we rather have users use 'buildconf'
|
||||
|
||||
Daniel Stenberg (31 Dec 2008)
|
||||
- Bas Mevissen reported http://curl.haxx.se/bug/view.cgi?id=2479030 pointing
|
||||
out that 'reconf' didn't properly point out the m4 subdirectory when running
|
||||
aclocal.
|
||||
|
||||
Daniel Stenberg (29 Dec 2008)
|
||||
- Phil Lisiecki filed bug report #2413067
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2413067) that identified a problem that
|
||||
would cause libcurl to mark a DNS cache entry "in use" eternally if the
|
||||
subsequence TCP connect failed. It would thus never get pruned and refreshed
|
||||
as it should've been.
|
||||
|
||||
Phil provided his own patch to this problem that while it seemed to work
|
||||
wasn't complete and thus I wrote my own fix to the problem.
|
||||
|
||||
Daniel Stenberg (28 Dec 2008)
|
||||
- Peter Korsgaard fixed building libcurl with "configure --with-ssl
|
||||
--disable-verbose".
|
||||
|
||||
- Anthony Bryan fixed more language and spelling flaws in man pages.
|
||||
|
||||
Daniel Stenberg (22 Dec 2008)
|
||||
- Given a recent enough libssh2, libcurl can now seek/resume with SFTP even
|
||||
on file indexes beyond 2 or 4GB.
|
||||
|
||||
- Anthony Bryan provided a set of patches that cleaned up manual language,
|
||||
corrected spellings and more.
|
||||
|
||||
Daniel Stenberg (20 Dec 2008)
|
||||
- Igor Novoseltsev fixed a bad situation for the multi_socket() API when doing
|
||||
pipelining, as libcurl could then easily get confused and A) work on the
|
||||
handle that was not "first in queue" on a pipeline, or even B) tell the app
|
||||
to REMOVE a socket while it was in use by a second handle in a pipeline. Both
|
||||
errors caused hanging or stalling applications.
|
||||
|
||||
Daniel Stenberg (19 Dec 2008)
|
||||
- curl_multi_timeout() could return a timeout value of 0 even though nothing
|
||||
was actually ready to get done, as the internal time resolution is higher
|
||||
than the returned millisecond timer. Therefore it could cause applications
|
||||
running on fast processors to do short bursts of busy-loops.
|
||||
curl_multi_timeout() will now only return 0 if the timeout is actually
|
||||
alreay triggered.
|
||||
|
||||
- Using the libssh2 0.19 function libssh2_session_block_directions(), libcurl
|
||||
now has an improved ability to do right when the multi interface (both
|
||||
"regular" and multi_socket) is used for SCP and SFTP transfers. This should
|
||||
result in (much) less busy-loop situations and thus less CPU usage with no
|
||||
speed loss.
|
||||
|
||||
Daniel Stenberg (17 Dec 2008)
|
||||
- SCP and SFTP with the multi interface had the same flaw: the 'DONE'
|
||||
operation didn't complete properly if the EAGAIN equivalent was returned but
|
||||
libcurl would simply continue with a half-completed close operation
|
||||
performed. This ruined persistent connection re-use and cause some
|
||||
SSH-protocol errors in general. The correction is unfortunately adding a
|
||||
blocking function - doing it entirely non-blocking should be considered for
|
||||
a better fix.
|
||||
|
||||
Gisle Vanem (16 Dec 2008)
|
||||
- Added the possibility to use the Watt-32 tcp/ip stack under Windows.
|
||||
The change simply involved adding a USE_WATT32 section in the
|
||||
config-win32.h files (under ./lib and ./src). This section disables
|
||||
the use of any Winsock headers.
|
||||
|
||||
Daniel Stenberg (16 Dec 2008)
|
||||
- libssh2_sftp_last_error() was wrongly used at some places in libcurl which
|
||||
made libcurl sometimes not properly abort problematic SFTP transfers.
|
||||
|
||||
Daniel Stenberg (12 Dec 2008)
|
||||
- More work with Igor Novoseltsev to first fix the remaining stuff for
|
||||
removing easy handles from multi handles when the easy handle is/was within
|
||||
a HTTP pipeline. His bug report #2351653
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2351653) was also related and was
|
||||
eventually fixed by a patch by Igor himself.
|
||||
|
||||
Yang Tse (12 Dec 2008)
|
||||
- Patrick Monnerat fixed a build regression, introduced in 7.19.2, affecting
|
||||
OS/400 compilations with IPv6 enabled.
|
||||
|
||||
Daniel Stenberg (12 Dec 2008)
|
||||
- Mark Karpeles filed bug report #2416182 titled "crash in ConnectionExists
|
||||
when using duphandle+curl_mutli"
|
||||
(http://curl.haxx.se/bug/view.cgi?id=2416182) which showed that
|
||||
curl_easy_duphandle() wrongly also copied the pointer to the connection
|
||||
cache, which was plain wrong and caused a segfault if the handle would be
|
||||
used in a different multi handle than the handle it was duplicated from.
|
||||
|
||||
Daniel Stenberg (11 Dec 2008)
|
||||
- Keshav Krity found out that libcurl failed to deal with dotted IPv6
|
||||
addresses if they were very long (>39 letters) due to a too strict address
|
||||
validity parser. It now accepts addresses up to 45 bytes long.
|
||||
|
||||
Daniel Stenberg (11 Dec 2008)
|
||||
- Internet Explorer had a broken HTTP digest authentication before v7 and
|
||||
there are servers "out there" that relies on the client doing this broken
|
||||
Digest authentication. Apache even comes with an option to work with such
|
||||
broken clients.
|
||||
|
||||
The difference is only for URLs that contain a query-part (a '?'-letter and
|
||||
text to the right of it).
|
||||
|
||||
libcurl now supports this quirk, and you enable it by setting the
|
||||
CURLAUTH_DIGEST_IE bit in the bitmask you pass to the CURLOPT_HTTPAUTH or
|
||||
CURLOPT_PROXYAUTH options. They are thus individually controlled to server
|
||||
and proxy.
|
||||
|
||||
(note that there's no way to activate this with the curl tool yet)
|
||||
|
||||
Daniel Fandrich (9 Dec 2008)
|
||||
- Added test cases 1089 and 1090 to test --write-out after a redirect to
|
||||
test a report that the size didn't work, but these test cases pass.
|
||||
|
||||
2
COPYING
2
COPYING
@@ -1,6 +1,6 @@
|
||||
COPYRIGHT AND PERMISSION NOTICE
|
||||
|
||||
Copyright (c) 1996 - 2008, Daniel Stenberg, <daniel@haxx.se>.
|
||||
Copyright (c) 1996 - 2009, Daniel Stenberg, <daniel@haxx.se>.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2009, 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
|
||||
@@ -25,7 +25,7 @@ AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
EXTRA_DIST = CHANGES COPYING maketgz reconf Makefile.dist curl-config.in \
|
||||
EXTRA_DIST = CHANGES COPYING maketgz Makefile.dist curl-config.in \
|
||||
curl-style.el sample.emacs RELEASE-NOTES buildconf buildconf.bat \
|
||||
libcurl.pc.in vc6curl.dsw
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2009, 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
|
||||
@@ -256,11 +256,18 @@ linux: all
|
||||
|
||||
linux-ssl: ssl
|
||||
|
||||
|
||||
vc8:
|
||||
@echo "generate VC8 makefiles"
|
||||
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/wsock32.lib bufferoverflowu.lib/g" -e "s/VC6/VC8/g" lib/Makefile.vc6 > lib/Makefile.vc8
|
||||
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/wsock32.lib bufferoverflowu.lib/g" -e "s/VC6/VC8/g" src/Makefile.vc6 > src/Makefile.vc8
|
||||
|
||||
# VC9 makefiles are for use with VS2008
|
||||
vc9:
|
||||
@echo "generate VC9 makefiles"
|
||||
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/ws2_32.lib/g" -e "s/vc6/vc9/g" -e "s/VC6/VC9/g" lib/Makefile.vc6 > lib/Makefile.vc9
|
||||
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/ws2_32.lib/g" -e "s/vc6/vc9/g" -e "s/VC6/VC9/g" src/Makefile.vc6 > src/Makefile.vc9
|
||||
|
||||
ca-bundle: lib/mk-ca-bundle.pl
|
||||
@echo "generate a fresh ca-bundle.crt"
|
||||
@perl $< -b -l -u lib/ca-bundle.crt
|
||||
|
||||
@@ -9,7 +9,8 @@ Curl and libcurl 7.19.3
|
||||
|
||||
This release includes the following changes:
|
||||
|
||||
o
|
||||
o CURLAUTH_DIGEST_IE bit added for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH
|
||||
o VC9 Makefiles were added to the release package
|
||||
|
||||
This release includes the following bugfixes:
|
||||
|
||||
@@ -21,12 +22,33 @@ This release includes the following bugfixes:
|
||||
the same server
|
||||
o memory leak with HTTP GSS/kerberos authentication
|
||||
o removed the default use of "Pragma: no-cache"
|
||||
o fix SCP/SFTP busyloop by using a new libssh2 0.19 function
|
||||
o fix SCP/SFTP busyloop by using a new libssh2 1.0 function
|
||||
o bad fclose() after a fatal error in cookie code
|
||||
o curl_multi_remove_handle() when the handle was in use in a HTTP pipeline
|
||||
o GSS authentication infinite loop problem
|
||||
o 550 response from SIZE no longer treated as missing file
|
||||
o ftps:// control connections now use explicit protection level
|
||||
o dotted IPv6 addresses longer than 39 bytes failed
|
||||
o curl_easy_duphandle() doesn't try to duplicate the connection cache pointer
|
||||
o build failure on OS/400 when enabling IPv6
|
||||
o better detection of SFTP failures
|
||||
o improved connection re-use for subsequent SCP and SFTP transfers
|
||||
o multi interface does less busy-loops for SCP and SFTP transfers with libssh2
|
||||
1.0 or later
|
||||
o curl_multi_timeout() no longer returns timeout 0 when there's still more
|
||||
than 0 but less than 999 microseconds left
|
||||
o the multi_socket API and HTTP pipelining now work a lot better when combined
|
||||
o SFTP seek/resume beyond 32bit file sizes
|
||||
o fixed breakage with --with-ssl --disable-verbose
|
||||
o TTL "leak" in the DNS cache
|
||||
o improved NSS initing
|
||||
o curl_easy_reset now resets more options
|
||||
o rare Location: follow bug with the multi interface
|
||||
o the configure script can now detect gnutls with pkg-config
|
||||
o curlbuild.h was adjusted for SunPro compilers
|
||||
o CURLOPT_COOKIELIST set to "SESS" on an easy handle with no cookies data
|
||||
o fixed timeouts for TFTP
|
||||
o fixed PPC builds
|
||||
|
||||
This release includes the following known bugs:
|
||||
|
||||
@@ -37,6 +59,9 @@ advice from friends like these:
|
||||
|
||||
Yang Tse, Daniel Fandrich, Jim Meyering, Christian Krause, Andreas Wurf,
|
||||
Markus Koetter, Josef Wolf, Vlad Grachov, Pawel Kierski, Igor Novoseltsev,
|
||||
Fred Machado, Ken Hirsch
|
||||
Fred Machado, Ken Hirsch, Keshav Krity, Patrick Monnerat, Mark Karpeles,
|
||||
Anthony Bryan, Peter Korsgaard, Phil Lisiecki, Bas Mevissen, Rob Crittenden,
|
||||
Emil Romanus, Karl Moerder, Daniel Black, Stefan Teleman, Michael Wallner,
|
||||
Grant Erickson, Tim Ansell, Andrew de los Reyes
|
||||
|
||||
Thanks! (and sorry if I forgot to mention someone)
|
||||
|
||||
23
TODO-RELEASE
23
TODO-RELEASE
@@ -1,24 +1,19 @@
|
||||
To be addressed in 7.19.3 (planned release: January 2009)
|
||||
=========================
|
||||
|
||||
193 - Fix zero-byte file transfers
|
||||
- Nobody has actually started for real on this
|
||||
|
||||
196 - #2351653 "crash in ConnectionExists"
|
||||
- Being worked on in the bug tracker
|
||||
To be addressed in 7.19.4 (planned release: March 2009)
|
||||
=========================
|
||||
|
||||
197 - IIS-bug in Digest
|
||||
205 - A. Craig West's CURLOPT_NOPROXY option
|
||||
|
||||
199 - "Bug 2351645" adjustment of the patch Daniel S applied
|
||||
- Suggested fix posted to list
|
||||
206 - A. Craig West's CURLOPT_HTTP_VERSION change for CONNECT
|
||||
|
||||
200 - "afert redirect, the content length is not reset" by Shunlong Bai
|
||||
208 - Patch to allow GSSAPI authentication to a socks5 server
|
||||
|
||||
201 - "bug: header data output to the body callback function after set header"
|
||||
by Shunlong Bai
|
||||
214 - progress bar prefix, second try (for the curl tool)
|
||||
|
||||
202 - "hangs up of application above libcurl" - problems with the multi_socket
|
||||
implementation when using HTTP pipelining. Patch pending by
|
||||
Igor Novoseltsev
|
||||
215 - Patch for Metalink Support (for the curl tool)
|
||||
|
||||
216 -
|
||||
|
||||
203 -
|
||||
35
acinclude.m4
35
acinclude.m4
@@ -5,7 +5,7 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2009, 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
|
||||
@@ -3057,3 +3057,36 @@ AC_DEFUN([CURL_CHECK_WIN32_LARGEFILE], [
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
dnl CURL_CHECK_PKGCONFIG ($module)
|
||||
dnl ------------------------
|
||||
dnl search for the pkg-config tool (if not cross-compiling). Set the PKGCONFIG
|
||||
dnl variable to hold the path to it, or 'no' if not found/present.
|
||||
dnl
|
||||
dnl If pkg-config is present, check that it has info about the $module or return
|
||||
dnl "no" anyway!
|
||||
dnl
|
||||
|
||||
AC_DEFUN([CURL_CHECK_PKGCONFIG], [
|
||||
if test x$cross_compiling != xyes; then
|
||||
dnl only do pkg-config magic when not cross-compiling
|
||||
AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
|
||||
|
||||
if test x$PKGCONFIG != xno; then
|
||||
AC_MSG_CHECKING([for $1 options with pkg-config])
|
||||
dnl ask pkg-config about $1
|
||||
$PKGCONFIG --exists $1
|
||||
if test "$?" -ne "0"; then
|
||||
dnl pkg-config does not have info about the given module! set the
|
||||
dnl variable to 'no'
|
||||
PKGCONFIG="no"
|
||||
AC_MSG_RESULT([no])
|
||||
else
|
||||
AC_MSG_RESULT([found])
|
||||
fi
|
||||
fi
|
||||
|
||||
else
|
||||
PKGCONFIG="no"
|
||||
fi
|
||||
])
|
||||
|
||||
17
ares/CHANGES
17
ares/CHANGES
@@ -1,5 +1,22 @@
|
||||
Changelog for the c-ares project
|
||||
|
||||
* January 14 2009 (Daniel Stenberg)
|
||||
- ares.h no longer uses the HAVE_STRUCT_IN6_ADDR define check, but instead it
|
||||
now declares the private struct ares_in6_addr for all systems instead of
|
||||
relying on one possibly not present in the system.
|
||||
|
||||
* January 13 2009 (Phil Blundell)
|
||||
- ares__send_query() now varies the retry timeout pseudo-randomly to avoid
|
||||
packet storms when several queries were started at the same time.
|
||||
|
||||
* January 11 2009 (Daniel Stenberg)
|
||||
- Phil Blundell added the internal function ares__expand_name_for_response()
|
||||
that is now used by the ares_parse_*_reply() functions instead of the
|
||||
ares_expand_name() simply to easier return ARES_EBADRESP for the cases where
|
||||
the name expansion fails as in responses that really isn't expected.
|
||||
|
||||
Version 1.6.0 (Dec 9, 2008)
|
||||
|
||||
* December 9 2008 (Gisle Vanem)
|
||||
|
||||
Fixes for Win32 targets using the Watt-32 tcp/ip stack.
|
||||
|
||||
@@ -323,6 +323,9 @@ else
|
||||
@echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_AF_INET6 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_PF_INET6 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_FREEADDRINFO 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_GETADDRINFO 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRUCT_IN6_ADDR 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRUCT_SOCKADDR_IN6 1$(DL) >> $@
|
||||
@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
|
||||
|
||||
@@ -22,4 +22,4 @@ original ares.
|
||||
|
||||
You'll find all c-ares details and news here:
|
||||
|
||||
http://daniel.haxx.se/projects/c-ares
|
||||
http://c-ares.haxx.se/
|
||||
|
||||
@@ -1,25 +1,17 @@
|
||||
This is what's new and changed in the c-ares 1.6.0 release:
|
||||
This is what's new and changed in the c-ares 1.6.1 release:
|
||||
|
||||
Changed:
|
||||
|
||||
o Added support for the glibc "rotate" resolv.conf option (or ARES_OPT_ROTATE)
|
||||
o Added ares_gethostbyname_file()
|
||||
o Added ares_dup()
|
||||
o Added ares_set_socket_callback()
|
||||
o in6_addr is not used in ares.h anymore, but a private ares_in6_addr is instead
|
||||
declared and used
|
||||
|
||||
Fixed:
|
||||
|
||||
o improved configure detection of several functions
|
||||
o improved source code portability
|
||||
o adig supports a regular numerical dotted IP address for the -s option
|
||||
o handling of EINPROGRESS for UDP connects
|
||||
o ares_parse_ptr_reply() would cause a buffer to shrink instead of expand if a
|
||||
reply contained 8 or more records
|
||||
o buildconf works on OS X
|
||||
o ares_parse_*_reply() functions now return ARES_EBADRESP instead of
|
||||
ARES_EBADNAME if the name in the response failed to decode
|
||||
|
||||
Thanks go to these friendly people for their efforts and contributions:
|
||||
|
||||
Yang Tse, Charles Hardin, Carlo Contavalli, Brad Spencer, Gerald Combs,
|
||||
Gregor Jasny
|
||||
Phil Blundell
|
||||
|
||||
Have fun!
|
||||
|
||||
26
ares/ares.h
26
ares/ares.h
@@ -1,7 +1,7 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||
* Copyright (C) 2007-2008 by Daniel Stenberg
|
||||
* Copyright (C) 2007-2009 by Daniel Stenberg
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose and without
|
||||
@@ -275,21 +275,29 @@ int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
|
||||
int ares_expand_string(const unsigned char *encoded, const unsigned char *abuf,
|
||||
int alen, unsigned char **s, long *enclen);
|
||||
|
||||
#if !defined(HAVE_STRUCT_IN6_ADDR) && !defined(s6_addr)
|
||||
struct in6_addr {
|
||||
/*
|
||||
* NOTE: before c-ares 1.6.1 we would most often use the system in6_addr
|
||||
* struct below when ares itself was built, but many apps would use this
|
||||
* private version since the header checked a HAVE_* define for it. Starting
|
||||
* with 1.6.1 we always declare and use our own to stop relying on the
|
||||
* system's one.
|
||||
*/
|
||||
struct ares_in6_addr {
|
||||
union {
|
||||
unsigned char _S6_u8[16];
|
||||
} _S6_un;
|
||||
};
|
||||
#define s6_addr _S6_un._S6_u8
|
||||
#endif
|
||||
|
||||
/*
|
||||
* TODO: the structs 'addrttl' and 'addr6ttl' really should get their names
|
||||
* prefixed with ares_ to keep them in our own "name space".
|
||||
*/
|
||||
struct addrttl {
|
||||
struct in_addr ipaddr;
|
||||
int ttl;
|
||||
};
|
||||
struct addr6ttl {
|
||||
struct in6_addr ip6addr;
|
||||
struct ares_in6_addr ip6addr;
|
||||
int ttl;
|
||||
};
|
||||
|
||||
@@ -304,12 +312,12 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
||||
struct hostent **host,
|
||||
struct addrttl *addrttls, int *naddrttls);
|
||||
int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
struct hostent **host,
|
||||
struct addr6ttl *addrttls, int *naddrttls);
|
||||
struct hostent **host,
|
||||
struct addr6ttl *addrttls, int *naddrttls);
|
||||
int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
||||
int addrlen, int family, struct hostent **host);
|
||||
int ares_parse_ns_reply(const unsigned char *abuf, int alen,
|
||||
struct hostent **host);
|
||||
struct hostent **host);
|
||||
void ares_free_string(void *str);
|
||||
void ares_free_hostent(struct hostent *host);
|
||||
const char *ares_strerror(int code);
|
||||
|
||||
@@ -177,3 +177,14 @@ static int name_length(const unsigned char *encoded, const unsigned char *abuf,
|
||||
*/
|
||||
return (n) ? n - 1 : n;
|
||||
}
|
||||
|
||||
/* Like ares_expand_name but returns EBADRESP in case of invalid input. */
|
||||
int ares__expand_name_for_response(const unsigned char *encoded,
|
||||
const unsigned char *abuf, int alen,
|
||||
char **s, long *enclen)
|
||||
{
|
||||
int status = ares_expand_name(encoded, abuf, alen, s, enclen);
|
||||
if (status == ARES_EBADNAME)
|
||||
status = ARES_EBADRESP;
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ static void addr_callback(void *arg, int status, int timeouts,
|
||||
static void end_aquery(struct addr_query *aquery, int status,
|
||||
struct hostent *host);
|
||||
static int file_lookup(struct ares_addr *addr, struct hostent **host);
|
||||
static void ptr_rr_name(char *name, struct ares_addr *addr);
|
||||
static void ptr_rr_name(char *name, const struct ares_addr *addr);
|
||||
|
||||
void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen,
|
||||
int family, ares_host_callback callback, void *arg)
|
||||
@@ -252,7 +252,7 @@ static int file_lookup(struct ares_addr *addr, struct hostent **host)
|
||||
return status;
|
||||
}
|
||||
|
||||
static void ptr_rr_name(char *name, struct ares_addr *addr)
|
||||
static void ptr_rr_name(char *name, const struct ares_addr *addr)
|
||||
{
|
||||
if (addr->family == AF_INET)
|
||||
{
|
||||
@@ -267,7 +267,7 @@ static void ptr_rr_name(char *name, struct ares_addr *addr)
|
||||
{
|
||||
unsigned char *bytes = (unsigned char *)&addr->addrV6.s6_addr;
|
||||
/* There are too many arguments to do this in one line using
|
||||
* minimally C89-compliant compilers */
|
||||
* minimally C89-compliant compilers */
|
||||
sprintf(name,
|
||||
"%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.",
|
||||
bytes[15]&0xf, bytes[15] >> 4, bytes[14]&0xf, bytes[14] >> 4,
|
||||
|
||||
@@ -74,13 +74,13 @@ static void end_hquery(struct host_query *hquery, int status,
|
||||
static int fake_hostent(const char *name, int family, ares_host_callback callback,
|
||||
void *arg);
|
||||
static int file_lookup(const char *name, int family, struct hostent **host);
|
||||
static void sort_addresses(struct hostent *host, struct apattern *sortlist,
|
||||
static void sort_addresses(struct hostent *host, const struct apattern *sortlist,
|
||||
int nsort);
|
||||
static void sort6_addresses(struct hostent *host, struct apattern *sortlist,
|
||||
static void sort6_addresses(struct hostent *host, const struct apattern *sortlist,
|
||||
int nsort);
|
||||
static int get_address_index(struct in_addr *addr, struct apattern *sortlist,
|
||||
static int get_address_index(const struct in_addr *addr, const struct apattern *sortlist,
|
||||
int nsort);
|
||||
static int get6_address_index(struct in6_addr *addr, struct apattern *sortlist,
|
||||
static int get6_address_index(const struct in6_addr *addr, const struct apattern *sortlist,
|
||||
int nsort);
|
||||
|
||||
void ares_gethostbyname(ares_channel channel, const char *name, int family,
|
||||
@@ -391,7 +391,7 @@ static int file_lookup(const char *name, int family, struct hostent **host)
|
||||
return status;
|
||||
}
|
||||
|
||||
static void sort_addresses(struct hostent *host, struct apattern *sortlist,
|
||||
static void sort_addresses(struct hostent *host, const struct apattern *sortlist,
|
||||
int nsort)
|
||||
{
|
||||
struct in_addr a1, a2;
|
||||
@@ -421,7 +421,8 @@ static void sort_addresses(struct hostent *host, struct apattern *sortlist,
|
||||
/* Find the first entry in sortlist which matches addr. Return nsort
|
||||
* if none of them match.
|
||||
*/
|
||||
static int get_address_index(struct in_addr *addr, struct apattern *sortlist,
|
||||
static int get_address_index(const struct in_addr *addr,
|
||||
const struct apattern *sortlist,
|
||||
int nsort)
|
||||
{
|
||||
int i;
|
||||
@@ -446,7 +447,7 @@ static int get_address_index(struct in_addr *addr, struct apattern *sortlist,
|
||||
return i;
|
||||
}
|
||||
|
||||
static void sort6_addresses(struct hostent *host, struct apattern *sortlist,
|
||||
static void sort6_addresses(struct hostent *host, const struct apattern *sortlist,
|
||||
int nsort)
|
||||
{
|
||||
struct in6_addr a1, a2;
|
||||
@@ -476,8 +477,9 @@ static void sort6_addresses(struct hostent *host, struct apattern *sortlist,
|
||||
/* Find the first entry in sortlist which matches addr. Return nsort
|
||||
* if none of them match.
|
||||
*/
|
||||
static int get6_address_index(struct in6_addr *addr, struct apattern *sortlist,
|
||||
int nsort)
|
||||
static int get6_address_index(const struct in6_addr *addr,
|
||||
const struct apattern *sortlist,
|
||||
int nsort)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
||||
|
||||
/* Expand the name from the question, and skip past the question. */
|
||||
aptr = abuf + HFIXEDSZ;
|
||||
status = ares_expand_name(aptr, abuf, alen, &hostname, &len);
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &hostname, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return status;
|
||||
if (aptr + len + QFIXEDSZ > abuf + alen)
|
||||
@@ -95,7 +95,8 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
||||
|
||||
if (host)
|
||||
{
|
||||
/* Allocate addresses and aliases; ancount gives an upper bound for both. */
|
||||
/* Allocate addresses and aliases; ancount gives an upper bound for
|
||||
both. */
|
||||
addrs = malloc(ancount * sizeof(struct in_addr));
|
||||
if (!addrs)
|
||||
{
|
||||
@@ -123,7 +124,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
||||
for (i = 0; i < (int)ancount; i++)
|
||||
{
|
||||
/* Decode the RR up to the data field. */
|
||||
status = ares_expand_name(aptr, abuf, alen, &rr_name, &len);
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
aptr += len;
|
||||
@@ -176,7 +177,8 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
||||
naliases++;
|
||||
|
||||
/* Decode the RR data and replace the hostname with it. */
|
||||
status = ares_expand_name(aptr, abuf, alen, &rr_data, &len);
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
|
||||
&len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
free(hostname);
|
||||
|
||||
@@ -84,7 +84,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
|
||||
/* Expand the name from the question, and skip past the question. */
|
||||
aptr = abuf + HFIXEDSZ;
|
||||
status = ares_expand_name(aptr, abuf, alen, &hostname, &len);
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &hostname, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return status;
|
||||
if (aptr + len + QFIXEDSZ > abuf + alen)
|
||||
@@ -123,7 +123,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
for (i = 0; i < (int)ancount; i++)
|
||||
{
|
||||
/* Decode the RR up to the data field. */
|
||||
status = ares_expand_name(aptr, abuf, alen, &rr_name, &len);
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
aptr += len;
|
||||
@@ -176,7 +176,8 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
naliases++;
|
||||
|
||||
/* Decode the RR data and replace the hostname with it. */
|
||||
status = ares_expand_name(aptr, abuf, alen, &rr_data, &len);
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
|
||||
&len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
free(hostname);
|
||||
|
||||
@@ -73,7 +73,7 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen,
|
||||
|
||||
/* Expand the name from the question, and skip past the question. */
|
||||
aptr = abuf + HFIXEDSZ;
|
||||
status = ares_expand_name( aptr, abuf, alen, &hostname, &len );
|
||||
status = ares__expand_name_for_response( aptr, abuf, alen, &hostname, &len);
|
||||
if ( status != ARES_SUCCESS )
|
||||
return status;
|
||||
if ( aptr + len + QFIXEDSZ > abuf + alen )
|
||||
@@ -96,7 +96,7 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen,
|
||||
for ( i = 0; i < ( int ) ancount; i++ )
|
||||
{
|
||||
/* Decode the RR up to the data field. */
|
||||
status = ares_expand_name( aptr, abuf, alen, &rr_name, &len );
|
||||
status = ares__expand_name_for_response( aptr, abuf, alen, &rr_name, &len );
|
||||
if ( status != ARES_SUCCESS )
|
||||
break;
|
||||
aptr += len;
|
||||
@@ -113,7 +113,8 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen,
|
||||
if ( rr_class == C_IN && rr_type == T_NS )
|
||||
{
|
||||
/* Decode the RR data and add it to the nameservers list */
|
||||
status = ares_expand_name( aptr, abuf, alen, &rr_data, &len );
|
||||
status = ares__expand_name_for_response( aptr, abuf, alen, &rr_data,
|
||||
&len);
|
||||
if ( status != ARES_SUCCESS )
|
||||
{
|
||||
break;
|
||||
|
||||
@@ -73,7 +73,7 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
||||
|
||||
/* Expand the name from the question, and skip past the question. */
|
||||
aptr = abuf + HFIXEDSZ;
|
||||
status = ares_expand_name(aptr, abuf, alen, &ptrname, &len);
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &ptrname, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
return status;
|
||||
if (aptr + len + QFIXEDSZ > abuf + alen)
|
||||
@@ -94,7 +94,7 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
||||
for (i = 0; i < (int)ancount; i++)
|
||||
{
|
||||
/* Decode the RR up to the data field. */
|
||||
status = ares_expand_name(aptr, abuf, alen, &rr_name, &len);
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
aptr += len;
|
||||
@@ -112,7 +112,8 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
||||
&& strcasecmp(rr_name, ptrname) == 0)
|
||||
{
|
||||
/* Decode the RR data and set hostname to it. */
|
||||
status = ares_expand_name(aptr, abuf, alen, &rr_data, &len);
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
|
||||
&len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
if (hostname)
|
||||
@@ -141,7 +142,8 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
||||
if (rr_class == C_IN && rr_type == T_CNAME)
|
||||
{
|
||||
/* Decode the RR data and replace ptrname with it. */
|
||||
status = ares_expand_name(aptr, abuf, alen, &rr_data, &len);
|
||||
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
|
||||
&len);
|
||||
if (status != ARES_SUCCESS)
|
||||
break;
|
||||
free(ptrname);
|
||||
|
||||
@@ -319,6 +319,9 @@ int ares__read_line(FILE *fp, char **buf, int *bufsize);
|
||||
void ares__free_query(struct query *query);
|
||||
unsigned short ares__generate_new_id(rc4_key* key);
|
||||
struct timeval ares__tvnow(void);
|
||||
int ares__expand_name_for_response(const unsigned char *encoded,
|
||||
const unsigned char *abuf, int alen,
|
||||
char **s, long *enclen);
|
||||
#if 0 /* Not used */
|
||||
long ares__tvdiff(struct timeval t1, struct timeval t2);
|
||||
#endif
|
||||
|
||||
@@ -715,6 +715,7 @@ void ares__send_query(ares_channel channel, struct query *query,
|
||||
{
|
||||
struct send_request *sendreq;
|
||||
struct server_state *server;
|
||||
int timeplus;
|
||||
|
||||
server = &channel->servers[query->server];
|
||||
if (query->using_tcp)
|
||||
@@ -778,9 +779,11 @@ void ares__send_query(ares_channel channel, struct query *query,
|
||||
return;
|
||||
}
|
||||
}
|
||||
timeplus = channel->timeout << (query->try / channel->nservers);
|
||||
timeplus = (timeplus * (9 + (rand () & 7))) / 16;
|
||||
query->timeout = *now;
|
||||
ares__timeadd(&query->timeout,
|
||||
channel->timeout << (query->try / channel->nservers));
|
||||
timeplus);
|
||||
/* Keep track of queries bucketed by timeout, so we can process
|
||||
* timeout events quickly.
|
||||
*/
|
||||
|
||||
@@ -292,7 +292,7 @@ static int single_domain(ares_channel channel, const char *name, char **s)
|
||||
}
|
||||
else
|
||||
{
|
||||
error = ERRNO;
|
||||
error = errno;
|
||||
switch(error)
|
||||
{
|
||||
case ENOENT:
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
#define ARES__VERSION_H
|
||||
|
||||
#define ARES_VERSION_MAJOR 1
|
||||
#define ARES_VERSION_MINOR 5
|
||||
#define ARES_VERSION_PATCH 4
|
||||
#define ARES_VERSION_MINOR 6
|
||||
#define ARES_VERSION_PATCH 1
|
||||
#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
|
||||
(ARES_VERSION_MINOR<<8)|\
|
||||
(ARES_VERSION_PATCH))
|
||||
#define ARES_VERSION_STR "1.5.4-CVS"
|
||||
#define ARES_VERSION_STR "1.6.1-CVS"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2009, 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
|
||||
@@ -191,7 +191,7 @@ else
|
||||
libtoolize=`findtool $LIBTOOLIZE`
|
||||
fi
|
||||
|
||||
lt_pversion=`$libtool --version 2>/dev/null|head -n 2|sed -e 's/^[^0-9]*//g' -e 's/[- ].*//'`
|
||||
lt_pversion=`$libtool --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//g' -e 's/[- ].*//'`
|
||||
if test -z "$lt_pversion"; then
|
||||
echo "buildconf: libtool not found."
|
||||
echo " You need libtool version $LIBTOOL_WANTED_VERSION or newer installed"
|
||||
|
||||
126
configure.ac
126
configure.ac
@@ -5,7 +5,7 @@
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
# Copyright (C) 1998 - 2009, 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
|
||||
@@ -818,6 +818,21 @@ if test "$ipv6" = "yes"; then
|
||||
curl_ipv6_msg="enabled"
|
||||
fi
|
||||
|
||||
# Check if struct sockaddr_in6 have sin6_scope_id member
|
||||
if test "$ipv6" = yes; then
|
||||
AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
|
||||
AC_TRY_COMPILE([
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h>] ,
|
||||
struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes)
|
||||
if test "$have_sin6_scope_id" = yes; then
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl **********************************************************************
|
||||
dnl Check if the operating system allows programs to write to their own argv[]
|
||||
dnl **********************************************************************
|
||||
@@ -1163,32 +1178,19 @@ if test X"$OPT_SSL" != Xno; then
|
||||
|
||||
if test "$PKGTEST" = "yes"; then
|
||||
|
||||
dnl Detect the pkg-config tool, as it may have extra info about the
|
||||
dnl openssl installation we can use. I *believe* this is what we are
|
||||
dnl expected to do on really recent Redhat Linux hosts.
|
||||
CURL_CHECK_PKGCONFIG(openssl)
|
||||
|
||||
AC_PATH_PROG( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
|
||||
if test "$PKGCONFIG" != "no" ; then
|
||||
AC_MSG_CHECKING([OpenSSL options with pkg-config])
|
||||
SSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null`
|
||||
SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null`
|
||||
SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
|
||||
|
||||
$PKGCONFIG --exists openssl
|
||||
SSL_EXISTS=$?
|
||||
LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'`
|
||||
|
||||
if test "$SSL_EXISTS" -eq "0"; then
|
||||
SSL_LIBS=`$PKGCONFIG --libs-only-l openssl 2>/dev/null`
|
||||
SSL_LDFLAGS=`$PKGCONFIG --libs-only-L openssl 2>/dev/null`
|
||||
SSL_CPPFLAGS=`$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
|
||||
|
||||
LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'`
|
||||
|
||||
dnl use the values pkg-config reported
|
||||
LIBS="$LIBS $SSL_LIBS"
|
||||
CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
|
||||
LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
|
||||
AC_MSG_RESULT([found])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
dnl use the values pkg-config reported
|
||||
LIBS="$LIBS $SSL_LIBS"
|
||||
CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
|
||||
LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1529,7 +1531,7 @@ if test X"$OPENSSL_ENABLED" = X"1"; then
|
||||
fi
|
||||
|
||||
dnl ----------------------------------------------------
|
||||
dnl FIX: only check for GnuTLS if OpenSSL is not enabled
|
||||
dnl check for GnuTLS
|
||||
dnl ----------------------------------------------------
|
||||
|
||||
dnl Default to compiler & linker defaults for GnuTLS files & libraries.
|
||||
@@ -1543,29 +1545,51 @@ AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]),
|
||||
if test "$OPENSSL_ENABLED" != "1"; then
|
||||
|
||||
if test X"$OPT_GNUTLS" != Xno; then
|
||||
|
||||
AC_MSG_NOTICE([OPT_GNUTLS is $OPT_GNUTLS])
|
||||
|
||||
addld=""
|
||||
if test "x$OPT_GNUTLS" = "xyes"; then
|
||||
check=`libgnutls-config --version 2>/dev/null`
|
||||
if test -n "$check"; then
|
||||
addlib=`libgnutls-config --libs`
|
||||
addcflags=`libgnutls-config --cflags`
|
||||
version=`libgnutls-config --version`
|
||||
gtlsprefix=`libgnutls-config --prefix`
|
||||
fi
|
||||
check=`libgnutls-config --version 2>/dev/null`
|
||||
if test -n "$check"; then
|
||||
addlib=`libgnutls-config --libs`
|
||||
addcflags=`libgnutls-config --cflags`
|
||||
version=`libgnutls-config --version`
|
||||
gtlslib=`libgnutls-config --prefix`/lib$libsuff
|
||||
fi
|
||||
else
|
||||
addlib=`$OPT_GNUTLS/bin/libgnutls-config --libs`
|
||||
addcflags=`$OPT_GNUTLS/bin/libgnutls-config --cflags`
|
||||
version=`$OPT_GNUTLS/bin/libgnutls-config --version 2>/dev/null`
|
||||
gtlsprefix=$OPT_GNUTLS
|
||||
if test -z "$version"; then
|
||||
version="unknown"
|
||||
fi
|
||||
gtlslib=$OPT_GNUTLS/lib$libsuff
|
||||
fi
|
||||
|
||||
if test -z "$version"; then
|
||||
CURL_CHECK_PKGCONFIG(gnutls)
|
||||
|
||||
if test "$PKGCONFIG" != "no" ; then
|
||||
addlib=`$PKGCONFIG --libs-only-l gnutls`
|
||||
addld=`$PKGCONFIG --libs-only-L gnutls`
|
||||
addcflags=`$PKGCONFIG --cflags-only-I gnutls`
|
||||
version=`$PKGCONFIG --modversion gnutls`
|
||||
gtlslib=`echo $addld | $SED -e 's/-L//'`
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if test -z "$version"; then
|
||||
dnl lots of efforts, still no go
|
||||
version="unknown"
|
||||
fi
|
||||
|
||||
if test -n "$addlib"; then
|
||||
|
||||
CLEANLIBS="$LIBS"
|
||||
CLEANCPPFLAGS="$CPPFLAGS"
|
||||
CLEADLDFLAGS="$LDFLAGS"
|
||||
|
||||
LIBS="$LIBS $addlib"
|
||||
LDFLAGS="$LDFLAGS $addld"
|
||||
if test "$addcflags" != "-I/usr/include"; then
|
||||
CPPFLAGS="$CPPFLAGS $addcflags"
|
||||
fi
|
||||
@@ -1586,14 +1610,16 @@ if test "$OPENSSL_ENABLED" != "1"; then
|
||||
if test "x$USE_GNUTLS" = "xyes"; then
|
||||
AC_MSG_NOTICE([detected GnuTLS version $version])
|
||||
|
||||
dnl when shared libs were found in a path that the run-time
|
||||
dnl linker doesn't search through, we need to add it to
|
||||
dnl LD_LIBRARY_PATH to prevent further configure tests to fail
|
||||
dnl due to this
|
||||
if test -n "$gtlslib"; then
|
||||
dnl when shared libs were found in a path that the run-time
|
||||
dnl linker doesn't search through, we need to add it to
|
||||
dnl LD_LIBRARY_PATH to prevent further configure tests to fail
|
||||
dnl due to this
|
||||
|
||||
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlsprefix/lib$libsuff"
|
||||
export LD_LIBRARY_PATH
|
||||
AC_MSG_NOTICE([Added $gtlsprefix/lib$libsuff to LD_LIBRARY_PATH])
|
||||
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlslib"
|
||||
export LD_LIBRARY_PATH
|
||||
AC_MSG_NOTICE([Added $gtlslib to LD_LIBRARY_PATH])
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
@@ -1618,13 +1644,15 @@ if test "$OPENSSL_ENABLED" != "1" -a "$GNUTLS_ENABLED" != "1"; then
|
||||
|
||||
if test X"$OPT_NSS" != Xno; then
|
||||
if test "x$OPT_NSS" = "xyes"; then
|
||||
check=`pkg-config --version 2>/dev/null`
|
||||
if test -n "$check"; then
|
||||
addlib=`pkg-config --libs nss`
|
||||
addcflags=`pkg-config --cflags nss`
|
||||
version=`pkg-config --modversion nss`
|
||||
nssprefix=`pkg-config --variable=prefix nss`
|
||||
fi
|
||||
|
||||
CURL_CHECK_PKGCONFIG(nss)
|
||||
|
||||
if test "$PKGCONFIG" != "no" ; then
|
||||
addlib=`$PKGCONFIG --libs nss`
|
||||
addcflags=`$PKGCONFIG --cflags nss`
|
||||
version=`$PKGCONFIG --modversion nss`
|
||||
nssprefix=`$PKGCONFIG --variable=prefix nss`
|
||||
fi
|
||||
else
|
||||
# Without pkg-config, we'll kludge in some defaults
|
||||
addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl"
|
||||
|
||||
26
docs/FAQ
26
docs/FAQ
@@ -1,4 +1,4 @@
|
||||
Updated: Sep 24, 2008 (http://curl.haxx.se/docs/faq.html)
|
||||
Updated: Jan 14, 2009 (http://curl.haxx.se/docs/faq.html)
|
||||
_ _ ____ _
|
||||
___| | | | _ \| |
|
||||
/ __| | | | |_) | |
|
||||
@@ -119,10 +119,10 @@ FAQ
|
||||
libcurl
|
||||
|
||||
A free and easy-to-use client-side URL transfer library, supporting FTP,
|
||||
FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE and LDAP. libcurl
|
||||
supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, kerberos,
|
||||
HTTP form based upload, proxies, cookies, user+password authentication,
|
||||
file transfer resume, http proxy tunneling and more!
|
||||
FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE, LDAP and LDAPS.
|
||||
libcurl supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading,
|
||||
kerberos, HTTP form based upload, proxies, cookies, user+password
|
||||
authentication, file transfer resume, http proxy tunneling and more!
|
||||
|
||||
libcurl is highly portable, it builds and works identically on numerous
|
||||
platforms, including Solaris, NetBSD, FreeBSD, OpenBSD, Darwin, HPUX,
|
||||
@@ -137,8 +137,8 @@ FAQ
|
||||
A command line tool for getting or sending files using URL syntax.
|
||||
|
||||
Since curl uses libcurl, it supports a range of common Internet protocols,
|
||||
currently including HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, LDAP, DICT,
|
||||
TELNET and FILE.
|
||||
currently including HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, LDAP, LDAPS,
|
||||
DICT, TELNET and FILE.
|
||||
|
||||
We pronounce curl and cURL with an initial k sound: [kurl].
|
||||
|
||||
@@ -227,11 +227,11 @@ FAQ
|
||||
Project cURL is entirely free and open. No person gets paid for developing
|
||||
(lib)curl. We do this voluntarily on our spare time.
|
||||
|
||||
We get some help from companies. Contactor Data hosts the curl web site,
|
||||
Haxx owns the curl web site's domain and sourceforge.net hosts project
|
||||
services we take advantage from, like the bug tracker. Also, some companies
|
||||
have sponsored certain parts of the development in the past and I hope some
|
||||
will continue to do so in the future.
|
||||
We get some help from companies. CAG Contactor hosts the curl web site, Haxx
|
||||
owns the curl web site's domain and sourceforge.net hosts project services
|
||||
we take advantage from, like the bug tracker. Also, some companies have
|
||||
sponsored certain parts of the development in the past and I hope some will
|
||||
continue to do so in the future.
|
||||
|
||||
If you want to support our project, consider a donation or a banner-program
|
||||
or even better: by helping us coding, documenting, testing etc.
|
||||
@@ -299,7 +299,7 @@ FAQ
|
||||
as used by numerous applications that include libcurl binaries in their
|
||||
distribution packages (like Adobe Acrobat Reader and Google Earth).
|
||||
|
||||
More than 80 known named companies use curl in commercial environments and
|
||||
More than 90 known named companies use curl in commercial environments and
|
||||
products. More than 100 known named open source projects depend on
|
||||
(lib)curl.
|
||||
|
||||
|
||||
@@ -673,8 +673,9 @@ Minix
|
||||
Configure and compile with:
|
||||
|
||||
./configure CONFIG_SHELL=/bin/bigsh CC=cc LD=cc AR=/usr/bin/aal \
|
||||
GREP=grep CPPFLAGS=-D_POSIX_SOURCE=1
|
||||
GREP=grep CPPFLAGS='-D_POSIX_SOURCE=1 -I/usr/local/include'
|
||||
make
|
||||
chmem =256000 src/curl
|
||||
|
||||
GCC
|
||||
---
|
||||
@@ -686,6 +687,7 @@ Minix
|
||||
|
||||
./configure CONFIG_SHELL=/bin/bigsh CC=gcc AR=/usr/gnu/bin/gar GREP=grep
|
||||
make
|
||||
chmem =256000 src/curl
|
||||
|
||||
|
||||
Symbian OS
|
||||
|
||||
@@ -3,7 +3,24 @@ join in and help us correct one or more of these! Also be sure to check the
|
||||
changelog of the current development status, as one or more of these problems
|
||||
may have been fixed since this was written!
|
||||
|
||||
58. It seems sensible to be able to use CURLOPT_NOBODY and
|
||||
62. CURLOPT_TIMEOUT does not work properly with the regular multi and
|
||||
multi_socket interfaces. The work-around for apps is to simply remove the
|
||||
easy handle once the time is up. See also:
|
||||
http://curl.haxx.se/bug/view.cgi?id=2501457
|
||||
|
||||
61. If an upload using Expect: 100-continue receives an HTTP 417 response,
|
||||
it ought to be automatically resent without the Expect:. A workaround is
|
||||
for the client application to redo the transfer after disabling Expect:.
|
||||
http://curl.haxx.se/mail/archive-2008-02/0043.html
|
||||
|
||||
60. libcurl closes the connection if an HTTP 401 reply is received while it
|
||||
is waiting for the the 100-continue response.
|
||||
http://curl.haxx.se/mail/lib-2008-08/0462.html
|
||||
|
||||
59. If the CURLOPT_PORT option is used on an FTP URL like
|
||||
"ftp://example.com/file;type=A" the ";type=A" is stripped off.
|
||||
|
||||
58. It seems sensible to be able to use CURLOPT_NOBODY and
|
||||
CURLOPT_FAILONERROR with FTP to detect if a file exists or not, but it is
|
||||
not working: http://curl.haxx.se/mail/lib-2008-07/0295.html
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ curl-config \- Get information about a libcurl installation
|
||||
.B curl-config [options]
|
||||
.SH DESCRIPTION
|
||||
.B curl-config
|
||||
displays information about a previous curl and libcurl installation.
|
||||
displays information about the curl and libcurl installation.
|
||||
.SH OPTIONS
|
||||
.IP "--ca"
|
||||
Displays the built-in path to the CA cert bundle this libcurl uses.
|
||||
@@ -36,7 +36,7 @@ Displays the built-in path to the CA cert bundle this libcurl uses.
|
||||
Displays the compiler used to build libcurl.
|
||||
.IP "--cflags"
|
||||
Set of compiler options (CFLAGS) to use when compiling files that use
|
||||
libcurl. Currently that is only thw include path to the curl include files.
|
||||
libcurl. Currently that is only the include path to the curl include files.
|
||||
.IP "--checkfor [version]"
|
||||
Specify the oldest possible libcurl version string you want, and this
|
||||
script will return 0 if the current installation is new enough or it
|
||||
@@ -46,7 +46,7 @@ enough. (Added in 7.15.4)
|
||||
Lists what particular main features the installed libcurl was built with. At
|
||||
the time of writing, this list may include SSL, KRB4 or IPv6. Do not assume
|
||||
any particular order. The keywords will be separated by newlines. There may be
|
||||
none, one or several keywords in the list.
|
||||
none, one, or several keywords in the list.
|
||||
.IP "--help"
|
||||
Displays the available options.
|
||||
.IP "--libs"
|
||||
@@ -61,7 +61,7 @@ Lists what particular protocols the installed libcurl was built to support. At
|
||||
the time of writing, this list may include HTTP, HTTPS, FTP, FTPS, FILE,
|
||||
TELNET, LDAP, DICT. Do not assume any particular order. The protocols will
|
||||
be listed using uppercase and are separated by newlines. There may be none,
|
||||
one or several protocols in the list. (Added in 7.13.0)
|
||||
one, or several protocols in the list. (Added in 7.13.0)
|
||||
.IP "--static-libs"
|
||||
Shows the complete set of libs and other linker options you will need in order
|
||||
to link your application with libcurl statically. (Added in 7.17.1)
|
||||
|
||||
92
docs/curl.1
92
docs/curl.1
@@ -135,7 +135,7 @@ Pass the data to the HTTP server as a cookie. It is supposedly the
|
||||
data previously received from the server in a "Set-Cookie:" line.
|
||||
The data should be in the format "NAME1=VALUE1; NAME2=VALUE2".
|
||||
|
||||
If no '=' letter is used in the line, it is treated as a filename to use to
|
||||
If no '=' symbol is used in the line, it is treated as a filename to use to
|
||||
read previously stored cookie lines from, which should be used in this session
|
||||
if they match. Using this method also activates the "cookie parser" which will
|
||||
make curl record incoming cookies too, which may be handy if you're using this
|
||||
@@ -197,7 +197,7 @@ If this option is used several times, the last specified file name will be
|
||||
used.
|
||||
.IP "-C/--continue-at <offset>"
|
||||
Continue/Resume a previous file transfer at the given offset. The given offset
|
||||
is the exact number of bytes that will be skipped counted from the beginning
|
||||
is the exact number of bytes that will be skipped, counting from the beginning
|
||||
of the source file before it is transferred to the destination. If used with
|
||||
uploads, the FTP server command SIZE will not be used by curl.
|
||||
|
||||
@@ -228,7 +228,7 @@ of a form field you may use \fI--data-urlencode\fP.
|
||||
|
||||
If any of these options is used more than once on the same command line, the
|
||||
data pieces specified will be merged together with a separating
|
||||
&-letter. Thus, using '-d name=daniel -d skill=lousy' would generate a post
|
||||
&-symbol. Thus, using '-d name=daniel -d skill=lousy' would generate a post
|
||||
chunk that looks like \&'name=daniel&skill=lousy'.
|
||||
|
||||
If you start the data with the letter @, the rest should be a file name to
|
||||
@@ -256,11 +256,11 @@ curl using one of the following syntaxes:
|
||||
.RS
|
||||
.IP "content"
|
||||
This will make curl URL-encode the content and pass that on. Just be careful
|
||||
so that the content doesn't contain any = or @ letters, as that will then make
|
||||
so that the content doesn't contain any = or @ symbols, as that will then make
|
||||
the syntax match one of the other cases below!
|
||||
.IP "=content"
|
||||
This will make curl URL-encode the content and pass that on. The preceding =
|
||||
letter is not included in the data.
|
||||
symbol is not included in the data.
|
||||
.IP "name=content"
|
||||
This will make curl URL-encode the content part and pass that on. Note that
|
||||
the name part is expected to be URL-encoded already.
|
||||
@@ -286,8 +286,8 @@ difference.
|
||||
(FTP) Tell curl to disable the use of the EPRT and LPRT commands when doing
|
||||
active FTP transfers. Curl will normally always first attempt to use EPRT,
|
||||
then LPRT before using PORT, but with this option, it will use PORT right
|
||||
away. EPRT and LPRT are extensions to the original FTP protocol, may not work
|
||||
on all servers but enable more functionality in a better way than the
|
||||
away. EPRT and LPRT are extensions to the original FTP protocol, and may not work
|
||||
on all servers, but they enable more functionality in a better way than the
|
||||
traditional PORT command.
|
||||
|
||||
Since curl 7.19.0, \fB--eprt\fP can be used to explicitly enable EPRT again
|
||||
@@ -326,7 +326,7 @@ engines. Note that not all (or none) of the engines may be available at
|
||||
run-time.
|
||||
.IP "--environment"
|
||||
(RISC OS ONLY) Sets a range of environment variables, using the names the -w
|
||||
option supports, to easier allow extraction of useful information after having
|
||||
option supports, to allow easier extraction of useful information after having
|
||||
run curl.
|
||||
.IP "--egd-file <file>"
|
||||
(SSL) Specify the path name to the Entropy Gathering Daemon socket. The socket
|
||||
@@ -473,7 +473,7 @@ submit button. This causes curl to POST data using the Content-Type
|
||||
multipart/form-data according to RFC1867. This enables uploading of binary
|
||||
files etc. To force the 'content' part to be a file, prefix the file name
|
||||
with an @ sign. To just get the content part from a file, prefix the file name
|
||||
with the letter <. The difference between @ and < is then that @ makes a file
|
||||
with the symbol <. The difference between @ and < is then that @ makes a file
|
||||
get attached in the post as a file upload, while the < makes a text field and
|
||||
just get the contents for that text field from a file.
|
||||
|
||||
@@ -732,7 +732,7 @@ re-send the following request using the same unmodified method.
|
||||
.IP "--location-trusted"
|
||||
(HTTP/HTTPS) Like \fI-L/--location\fP, but will allow sending the name +
|
||||
password to all hosts that the site may redirect to. This may or may not
|
||||
introduce a security breach if the site redirects you do a site to which
|
||||
introduce a security breach if the site redirects you to a site to which
|
||||
you'll send your authentication info (which is plaintext in the case of HTTP
|
||||
Basic authentication).
|
||||
|
||||
@@ -776,7 +776,7 @@ Very similar to \fI--netrc\fP, but this option makes the .netrc usage
|
||||
(HTTP) Enables GSS-Negotiate authentication. The GSS-Negotiate method was
|
||||
designed by Microsoft and is used in their web applications. It is primarily
|
||||
meant as a support for Kerberos5 authentication but may be also used along
|
||||
with another authentication methods. For more information see IETF draft
|
||||
with another authentication method. For more information see IETF draft
|
||||
draft-brezak-spnego-http-04.txt.
|
||||
|
||||
If you want to enable Negotiate for your proxy authentication, then use
|
||||
@@ -1201,7 +1201,7 @@ received by curl that is hidden in normal cases, and a line starting with '*'
|
||||
means additional info provided by curl.
|
||||
|
||||
Note that if you only want HTTP headers in the output, \fI-i/--include\fP
|
||||
might be option you're looking for.
|
||||
might be the option you're looking for.
|
||||
|
||||
If you think this option still doesn't give you enough details, consider using
|
||||
\fI--trace\fP or \fI--trace-ascii\fP instead.
|
||||
@@ -1255,12 +1255,12 @@ format from stdin you write "@-".
|
||||
|
||||
The variables present in the output format will be substituted by the value or
|
||||
text that curl thinks fit, as described below. All variables are specified
|
||||
as %{variable_name} and to output a normal % you just it them as
|
||||
as %{variable_name} and to output a normal % you just write them as
|
||||
%%. You can output a newline by using \\n, a carriage return with \\r and a tab
|
||||
space with \\t.
|
||||
|
||||
.B NOTE:
|
||||
The %-letter is a special letter in the win32-environment, where all
|
||||
The %-symbol is a special symbol in the win32-environment, where all
|
||||
occurrences of % must be doubled when using this option.
|
||||
|
||||
The variables available at this point are:
|
||||
@@ -1456,7 +1456,7 @@ Sets the proxy server to use if no protocol-specific proxy is set.
|
||||
list of host names that shouldn't go through any proxy. If set to a asterisk
|
||||
\&'*' only, it matches all hosts.
|
||||
.SH EXIT CODES
|
||||
There exists a bunch of different error codes and their corresponding error
|
||||
There are a bunch of different error codes and their corresponding error
|
||||
messages that may appear during bad conditions. At the time of this writing,
|
||||
the exit codes are:
|
||||
.IP 1
|
||||
@@ -1464,7 +1464,7 @@ Unsupported protocol. This build of curl has no support for this protocol.
|
||||
.IP 2
|
||||
Failed to initialize.
|
||||
.IP 3
|
||||
URL malformat. The syntax was not correct.
|
||||
URL malformed. The syntax was not correct.
|
||||
.IP 5
|
||||
Couldn't resolve proxy. The given proxy host could not be resolved.
|
||||
.IP 6
|
||||
@@ -1545,67 +1545,67 @@ Unknown TELNET option specified.
|
||||
.IP 49
|
||||
Malformed telnet option.
|
||||
.IP 51
|
||||
The peer's SSL certificate or SSH MD5 fingerprint was not ok
|
||||
The peer's SSL certificate or SSH MD5 fingerprint was not ok.
|
||||
.IP 52
|
||||
The server didn't reply anything, which here is considered an error.
|
||||
.IP 53
|
||||
SSL crypto engine not found
|
||||
SSL crypto engine not found.
|
||||
.IP 54
|
||||
Cannot set SSL crypto engine as default
|
||||
Cannot set SSL crypto engine as default.
|
||||
.IP 55
|
||||
Failed sending network data
|
||||
Failed sending network data.
|
||||
.IP 56
|
||||
Failure in receiving network data
|
||||
Failure in receiving network data.
|
||||
.IP 58
|
||||
Problem with the local certificate
|
||||
Problem with the local certificate.
|
||||
.IP 59
|
||||
Couldn't use specified SSL cipher
|
||||
Couldn't use specified SSL cipher.
|
||||
.IP 60
|
||||
Peer certificate cannot be authenticated with known CA certificates
|
||||
Peer certificate cannot be authenticated with known CA certificates.
|
||||
.IP 61
|
||||
Unrecognized transfer encoding
|
||||
Unrecognized transfer encoding.
|
||||
.IP 62
|
||||
Invalid LDAP URL
|
||||
Invalid LDAP URL.
|
||||
.IP 63
|
||||
Maximum file size exceeded
|
||||
Maximum file size exceeded.
|
||||
.IP 64
|
||||
Requested FTP SSL level failed
|
||||
Requested FTP SSL level failed.
|
||||
.IP 65
|
||||
Sending the data requires a rewind that failed
|
||||
Sending the data requires a rewind that failed.
|
||||
.IP 66
|
||||
Failed to initialise SSL Engine
|
||||
Failed to initialise SSL Engine.
|
||||
.IP 67
|
||||
The user name, password, or similar was not accepted and curl failed to log in
|
||||
The user name, password, or similar was not accepted and curl failed to log in.
|
||||
.IP 68
|
||||
File not found on TFTP server
|
||||
File not found on TFTP server.
|
||||
.IP 69
|
||||
Permission problem on TFTP server
|
||||
Permission problem on TFTP server.
|
||||
.IP 70
|
||||
Out of disk space on TFTP server
|
||||
Out of disk space on TFTP server.
|
||||
.IP 71
|
||||
Illegal TFTP operation
|
||||
Illegal TFTP operation.
|
||||
.IP 72
|
||||
Unknown TFTP transfer ID
|
||||
Unknown TFTP transfer ID.
|
||||
.IP 73
|
||||
File already exists (TFTP)
|
||||
File already exists (TFTP).
|
||||
.IP 74
|
||||
No such user (TFTP)
|
||||
No such user (TFTP).
|
||||
.IP 75
|
||||
Character conversion failed
|
||||
Character conversion failed.
|
||||
.IP 76
|
||||
Character conversion functions required
|
||||
Character conversion functions required.
|
||||
.IP 77
|
||||
Problem with reading the SSL CA cert (path? access rights?)
|
||||
Problem with reading the SSL CA cert (path? access rights?).
|
||||
.IP 78
|
||||
The resource referenced in the URL does not exist
|
||||
The resource referenced in the URL does not exist.
|
||||
.IP 79
|
||||
An unspecified error occurred during the SSH session
|
||||
An unspecified error occurred during the SSH session.
|
||||
.IP 80
|
||||
Failed to shut down the SSL connection
|
||||
Failed to shut down the SSL connection.
|
||||
.IP 82
|
||||
Could not load CRL file, missing or wrong format (added in 7.19.0)
|
||||
Could not load CRL file, missing or wrong format (added in 7.19.0).
|
||||
.IP 83
|
||||
Issuer check failed (added in 7.19.0)
|
||||
Issuer check failed (added in 7.19.0).
|
||||
.IP XX
|
||||
More error codes will appear here in future releases. The existing ones
|
||||
are meant to never change.
|
||||
|
||||
@@ -21,6 +21,7 @@ int main(void)
|
||||
struct curl_slist *chunk = NULL;
|
||||
|
||||
chunk = curl_slist_append(chunk, "Accept: moo");
|
||||
chunk = curl_slist_append(chunk, "Another: yes");
|
||||
|
||||
/* request with the built-in Accept: */
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "localhost");
|
||||
|
||||
@@ -31,7 +31,7 @@ the connection you want to pause or unpause.
|
||||
The \fBbitmask\fP argument is a set of bits that sets the new state of the
|
||||
connection. The following bits can be used:
|
||||
.IP CURLPAUSE_RECV
|
||||
Pause receiving data. There will be no data received on this conneciton until
|
||||
Pause receiving data. There will be no data received on this connection until
|
||||
this function is called again without this bit set. Thus, the write callback
|
||||
(\fICURLOPT_WRITEFUNCTION\fP) won't be called.
|
||||
.IP CURLPAUSE_SEND
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
.\" * $Id$
|
||||
.\" **************************************************************************
|
||||
.\"
|
||||
.TH curl_easy_setopt 3 "28 Oct 2008" "libcurl 7.19.1" "libcurl Manual"
|
||||
.TH curl_easy_setopt 3 "11 Dec 2008" "libcurl 7.19.3" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_easy_setopt \- set options for a curl easy handle
|
||||
.SH SYNOPSIS
|
||||
@@ -72,7 +72,7 @@ preceding the data (like HTTP).
|
||||
A parameter set to 1 tells the library to shut off the built-in progress meter
|
||||
completely.
|
||||
|
||||
Future versions of libcurl is likely to not have any built-in progress meter
|
||||
Future versions of libcurl are likely to not have any built-in progress meter
|
||||
at all.
|
||||
.IP CURLOPT_NOSIGNAL
|
||||
Pass a long. If it is 1, libcurl will not use any functions that
|
||||
@@ -83,7 +83,7 @@ to still set/use all timeout options etc, without risking getting signals.
|
||||
|
||||
If this option is set and libcurl has been built with the standard name
|
||||
resolver, timeouts will not occur while the name resolve takes place.
|
||||
Consider building libcurl with ares support to enable asynchronous DNS
|
||||
Consider building libcurl with c-ares support to enable asynchronous DNS
|
||||
lookups, which enables nice timeouts for name resolves without signals.
|
||||
.PP
|
||||
.SH CALLBACK OPTIONS
|
||||
@@ -101,7 +101,7 @@ From 7.18.0, the function can return CURL_WRITEFUNC_PAUSE which then will
|
||||
cause writing to this connection to become paused. See
|
||||
\fIcurl_easy_pause(3)\fP for further details.
|
||||
|
||||
This function may be called with zero bytes data if the transfered file is
|
||||
This function may be called with zero bytes data if the transferred file is
|
||||
empty.
|
||||
|
||||
Set this option to NULL to get the internal default function. The internal
|
||||
@@ -140,7 +140,7 @@ that memory area. Returning 0 will signal end-of-file to the library and cause
|
||||
it to stop the current transfer.
|
||||
|
||||
If you stop the current transfer by returning 0 "pre-maturely" (i.e before the
|
||||
server expected it, like when you've told you will upload N bytes and you
|
||||
server expected it, like when you've said you will upload N bytes and you
|
||||
upload less than N bytes), you may experience that the server "hangs" waiting
|
||||
for the rest of the data that won't come.
|
||||
|
||||
@@ -152,7 +152,7 @@ From 7.18.0, the function can return CURL_READFUNC_PAUSE which then will cause
|
||||
reading from this connection to become paused. See \fIcurl_easy_pause(3)\fP
|
||||
for further details.
|
||||
|
||||
If you set the callback pointer to NULL, or doesn't set it at all, the default
|
||||
If you set the callback pointer to NULL, or don't set it at all, the default
|
||||
internal read function will be used. It is simply doing an fread() on the FILE
|
||||
* stream set with \fICURLOPT_READDATA\fP.
|
||||
.IP CURLOPT_READDATA
|
||||
@@ -164,7 +164,7 @@ read function, this data must be a valid readable FILE *.
|
||||
If you're using libcurl as a win32 DLL, you MUST use a
|
||||
\fICURLOPT_READFUNCTION\fP if you set this option.
|
||||
|
||||
This option is also known with the older name \fICURLOPT_INFILE\fP, the name
|
||||
This option was also known by the older name \fICURLOPT_INFILE\fP, the name
|
||||
\fICURLOPT_READDATA\fP was introduced in 7.9.7.
|
||||
.IP CURLOPT_IOCTLFUNCTION
|
||||
Function pointer that should match the \fIcurl_ioctl_callback\fP prototype
|
||||
@@ -336,7 +336,7 @@ This function will get called on all new connections made to a server, during
|
||||
the SSL negotiation. The SSL_CTX pointer will be a new one every time.
|
||||
|
||||
To use this properly, a non-trivial amount of knowledge of the openssl
|
||||
libraries is necessary. Using this function allows for example to use openssl
|
||||
libraries is necessary. For example, using this function allows you to use openssl
|
||||
callbacks to add additional validation code for certificates, and even to
|
||||
change the actual URI of an HTTPS request (example used in the lib509 test
|
||||
case). See also the example section for a replacement of the key, certificate
|
||||
@@ -421,7 +421,7 @@ response codes will slip through, especially when authentication is involved
|
||||
(response codes 401 and 407).
|
||||
|
||||
You might get some amounts of headers transferred before this situation is
|
||||
detected, like for when a "100-continue" is received as a response to a
|
||||
detected, like when a "100-continue" is received as a response to a
|
||||
POST/PUT and a 401 or 407 is received immediately afterwards.
|
||||
.SH NETWORK OPTIONS
|
||||
.IP CURLOPT_URL
|
||||
@@ -433,9 +433,9 @@ attempt to guess which protocol to use based on the given host name. If the
|
||||
given protocol of the set URL is not supported, libcurl will return on error
|
||||
(\fICURLE_UNSUPPORTED_PROTOCOL\fP) when you call \fIcurl_easy_perform(3)\fP or
|
||||
\fIcurl_multi_perform(3)\fP. Use \fIcurl_version_info(3)\fP for detailed info
|
||||
on which protocols that are supported.
|
||||
on which protocols are supported.
|
||||
|
||||
The string given to CURLOPT_URL must be url-encoded and following the RFC 2396
|
||||
The string given to CURLOPT_URL must be url-encoded and follow RFC 2396
|
||||
(http://curl.haxx.se/rfc/rfc2396.txt).
|
||||
|
||||
\fICURLOPT_URL\fP is the only option that \fBmust\fP be set before
|
||||
@@ -456,7 +456,7 @@ tunnel through the HTTP proxy. Such tunneling is activated with
|
||||
\fICURLOPT_HTTPPROXYTUNNEL\fP.
|
||||
|
||||
libcurl respects the environment variables \fBhttp_proxy\fP, \fBftp_proxy\fP,
|
||||
\fBall_proxy\fP etc, if any of those is set. The \fICURLOPT_PROXY\fP option
|
||||
\fBall_proxy\fP etc, if any of those are set. The \fICURLOPT_PROXY\fP option
|
||||
does however override any possibly set environment variables.
|
||||
|
||||
Setting the proxy string to "" (an empty string) will explicitly disable the
|
||||
@@ -480,16 +480,16 @@ given HTTP proxy. There is a big difference between using a proxy and to
|
||||
tunnel through it. If you don't know what this means, you probably don't want
|
||||
this tunneling option.
|
||||
.IP CURLOPT_INTERFACE
|
||||
Pass a char * as parameter. This set the interface name to use as outgoing
|
||||
network interface. The name can be an interface name, an IP address or a host
|
||||
Pass a char * as parameter. This sets the interface name to use as outgoing
|
||||
network interface. The name can be an interface name, an IP address, or a host
|
||||
name.
|
||||
.IP CURLOPT_LOCALPORT
|
||||
Pass a long. This sets the local port number of the socket used for
|
||||
connection. This can be used in combination with \fICURLOPT_INTERFACE\fP and
|
||||
you are recommended to use \fICURLOPT_LOCALPORTRANGE\fP as well when this is
|
||||
set. Note that port numbers are only valid 1 - 65535. (Added in 7.15.2)
|
||||
set. Note that the only valid port numbers are 1 - 65535. (Added in 7.15.2)
|
||||
.IP CURLOPT_LOCALPORTRANGE
|
||||
Pass a long. This is the number of attempts libcurl should do to find a
|
||||
Pass a long. This is the number of attempts libcurl should make to find a
|
||||
working local port number. It starts with the given \fICURLOPT_LOCALPORT\fP
|
||||
and adds one to the number for each retry. Setting this to 1 or below will
|
||||
make libcurl do only one try for the exact port number. Note that port numbers
|
||||
@@ -503,8 +503,8 @@ caching, or set to -1 to make the cached entries remain forever. By default,
|
||||
libcurl caches this info for 60 seconds.
|
||||
|
||||
NOTE: the name resolve functions of various libc implementations don't re-read
|
||||
name server information unless explicitly told so (by for example calling
|
||||
\fIres_init(3)\fP. This may cause libcurl to keep using the older server even
|
||||
name server information unless explicitly told so (for example, by calling
|
||||
\fIres_init(3)\fP). This may cause libcurl to keep using the older server even
|
||||
if DHCP has updated the server info, and this may look like a DNS cache issue
|
||||
to the casual libcurl-app user.
|
||||
.IP CURLOPT_DNS_USE_GLOBAL_CACHE
|
||||
@@ -560,8 +560,8 @@ Pass a long, set to one of the values described below.
|
||||
.RS
|
||||
.IP CURL_NETRC_OPTIONAL
|
||||
The use of your \fI~/.netrc\fP file is optional, and information in the URL is
|
||||
to be preferred. The file will be scanned with the host and user name (to
|
||||
find the password only) or with the host only, to find the first user name and
|
||||
to be preferred. The file will be scanned for the host and user name (to
|
||||
find the password only) or for the host only, to find the first user name and
|
||||
password after that \fImachine\fP, which ever information is not specified in
|
||||
the URL.
|
||||
|
||||
@@ -572,7 +572,7 @@ The library will ignore the file and use only the information in the URL.
|
||||
This is the default.
|
||||
.IP CURL_NETRC_REQUIRED
|
||||
This value tells the library that use of the file is required, to ignore the
|
||||
information in the URL, and to search the file with the host only.
|
||||
information in the URL, and to search the file for the host only.
|
||||
.RE
|
||||
Only machine name, user name and password are taken into account
|
||||
(init macros and similar things aren't supported).
|
||||
@@ -586,9 +586,9 @@ option is omitted, and \fICURLOPT_NETRC\fP is set, libcurl will attempt to
|
||||
find a .netrc file in the current user's home directory. (Added in 7.10.9)
|
||||
.IP CURLOPT_USERPWD
|
||||
Pass a char * as parameter, which should be [user name]:[password] to use for
|
||||
the connection. Use \fICURLOPT_HTTPAUTH\fP to decide authentication method.
|
||||
the connection. Use \fICURLOPT_HTTPAUTH\fP to decide the authentication method.
|
||||
|
||||
When using NTLM, you can set domain by prepending it to the user name and
|
||||
When using NTLM, you can set the domain by prepending it to the user name and
|
||||
separating the domain and name with a forward (/) or backward slash (\\). Like
|
||||
this: "domain/user:password" or "domain\\user:password". Some HTTP servers (on
|
||||
Windows) support this style even for Basic authentication.
|
||||
@@ -602,17 +602,14 @@ to prevent accidental information leakage.
|
||||
.IP CURLOPT_PROXYUSERPWD
|
||||
Pass a char * as parameter, which should be [user name]:[password] to use for
|
||||
the connection to the HTTP proxy. Use \fICURLOPT_PROXYAUTH\fP to decide
|
||||
authentication method.
|
||||
the authentication method.
|
||||
.IP CURLOPT_USERNAME
|
||||
Pass a char * as parameter, which should be pointing to the zero terminated
|
||||
user name to use for the transfer.
|
||||
|
||||
The CURLOPT_USERNAME option should be used in same way as the
|
||||
\fICURLOPT_USERPWD\fP is used. In comparison to \fICURLOPT_USERPWD\fP the
|
||||
CURLOPT_USERNAME allows the username to contain colon, like in following
|
||||
example: "sip:user@example.com". Note the CURLOPT_USERNAME option is an
|
||||
alternative way to set the user name. There is no meaning to use it together
|
||||
with the \fICURLOPT_USERPWD\fP option.
|
||||
\fBCURLOPT_USERNAME\fP sets the user name to be used in protocol
|
||||
authentication. You should not use this option together with the (older)
|
||||
CURLOPT_USERPWD option.
|
||||
|
||||
In order to specify the password to be used in conjunction with the user name
|
||||
use the \fICURLOPT_PASSWORD\fP option. (Added in 7.19.1)
|
||||
@@ -621,15 +618,15 @@ Pass a char * as parameter, which should be pointing to the zero terminated
|
||||
password to use for the transfer.
|
||||
|
||||
The CURLOPT_PASSWORD option should be used in conjunction with
|
||||
as the \fICURLOPT_USERNAME\fP option. (Added in 7.19.1)
|
||||
the \fICURLOPT_USERNAME\fP option. (Added in 7.19.1)
|
||||
.IP CURLOPT_PROXYUSERNAME
|
||||
Pass a char * as parameter, which should be pointing to the zero terminated
|
||||
user name to use for the transfer while connecting to Proxy.
|
||||
|
||||
The CURLOPT_PROXYUSERNAME option should be used in same way as the
|
||||
\fICURLOPT_PROXYUSERPWD\fP is used. In comparison to \fICURLOPT_PROXYUSERPWD\fP
|
||||
the CURLOPT_PROXYUSERNAME allows the username to contain colon,
|
||||
like in following example: "sip:user@example.com".
|
||||
the CURLOPT_PROXYUSERNAME allows the username to contain a colon,
|
||||
like in the following example: "sip:user@example.com".
|
||||
Note the CURLOPT_PROXYUSERNAME option is an alternative way to set the user name
|
||||
while connecting to Proxy. There is no meaning to use it together
|
||||
with the \fICURLOPT_PROXYUSERPWD\fP option.
|
||||
@@ -641,12 +638,12 @@ Pass a char * as parameter, which should be pointing to the zero terminated
|
||||
password to use for the transfer while connecting to Proxy.
|
||||
|
||||
The CURLOPT_PROXYPASSWORD option should be used in conjunction with
|
||||
as the \fICURLOPT_PROXYUSERNAME\fP option. (Added in 7.19.1)
|
||||
the \fICURLOPT_PROXYUSERNAME\fP option. (Added in 7.19.1)
|
||||
.IP CURLOPT_HTTPAUTH
|
||||
Pass a long as parameter, which is set to a bitmask, to tell libcurl what
|
||||
Pass a long as parameter, which is set to a bitmask, to tell libcurl which
|
||||
authentication method(s) you want it to use. The available bits are listed
|
||||
below. If more than one bit is set, libcurl will first query the site to see
|
||||
what authentication methods it supports and then pick the best one you allow
|
||||
which authentication methods it supports and then pick the best one you allow
|
||||
it to use. For some methods, this will induce an extra network round-trip. Set
|
||||
the actual name and password with the \fICURLOPT_USERPWD\fP option or
|
||||
with the \fICURLOPT_USERNAME\fP and the \fICURLOPT_USERPASSWORD\fP options.
|
||||
@@ -654,18 +651,25 @@ with the \fICURLOPT_USERNAME\fP and the \fICURLOPT_USERPASSWORD\fP options.
|
||||
.RS
|
||||
.IP CURLAUTH_BASIC
|
||||
HTTP Basic authentication. This is the default choice, and the only method
|
||||
that is in wide-spread use and supported virtually everywhere. This is sending
|
||||
that is in wide-spread use and supported virtually everywhere. This sends
|
||||
the user name and password over the network in plain text, easily captured by
|
||||
others.
|
||||
.IP CURLAUTH_DIGEST
|
||||
HTTP Digest authentication. Digest authentication is defined in RFC2617 and
|
||||
is a more secure way to do authentication over public networks than the
|
||||
regular old-fashioned Basic method.
|
||||
.IP CURLAUTH_DIGEST_IE
|
||||
HTTP Digest authentication with an IE flavor. Digest authentication is
|
||||
defined in RFC2617 and is a more secure way to do authentication over public
|
||||
networks than the regular old-fashioned Basic method. The IE flavor is simply
|
||||
that libcurl will use a special "quirk" that IE is known to have used before
|
||||
version 7 and that some servers require the client to use. (This define was
|
||||
added in 7.19.3)
|
||||
.IP CURLAUTH_GSSNEGOTIATE
|
||||
HTTP GSS-Negotiate authentication. The GSS-Negotiate (also known as plain
|
||||
\&"Negotiate") method was designed by Microsoft and is used in their web
|
||||
applications. It is primarily meant as a support for Kerberos5 authentication
|
||||
but may be also used along with another authentication methods. For more
|
||||
but may also be used along with other authentication methods. For more
|
||||
information see IETF draft draft-brezak-spnego-http-04.txt.
|
||||
|
||||
You need to build libcurl with a suitable GSS-API library for this to work.
|
||||
@@ -686,7 +690,7 @@ libcurl pick any it finds suitable. libcurl will automatically select the one it
|
||||
finds most secure.
|
||||
.RE
|
||||
.IP CURLOPT_PROXYAUTH
|
||||
Pass a long as parameter, which is set to a bitmask, to tell libcurl what
|
||||
Pass a long as parameter, which is set to a bitmask, to tell libcurl which
|
||||
authentication method(s) you want it to use for your proxy authentication. If
|
||||
more than one bit is set, libcurl will first query the site to see what
|
||||
authentication methods it supports and then pick the best one you allow it to
|
||||
@@ -732,13 +736,20 @@ redirections have been followed, the next redirect will cause an error
|
||||
Setting the limit to 0 will make libcurl refuse any redirect. Set it to -1 for
|
||||
an infinite number of redirects (which is the default)
|
||||
.IP CURLOPT_POSTREDIR
|
||||
A parameter set to 1 tells the library to respect RFC 2616/10.3.2 and not
|
||||
convert POST requests into GET requests when following a 301 redirection. The
|
||||
non-RFC behaviour is ubiquitous in web browsers, so the library does the
|
||||
conversion by default to maintain consistency. However, a server may requires
|
||||
a POST to remain a POST after such a redirection. This option is meaningful
|
||||
only when setting \fICURLOPT_FOLLOWLOCATION\fP. (Added in 7.17.1)
|
||||
(This option was known as CURLOPT_POST301 up to 7.19.0)
|
||||
Pass a bitmask to control how libcurl acts on redirects after POSTs that get a
|
||||
301 or 302 response back. A parameter with bit 0 set (value
|
||||
\fBCURL_REDIR_POST_301\fP) tells the library to respect RFC 2616/10.3.2 and
|
||||
not convert POST requests into GET requests when following a 301
|
||||
redirection. Setting bit 1 (value CURL_REDIR_POST_302) makes libcurl maintain
|
||||
the request method after a 302 redirect. CURL_REDIR_POST_ALL is a convenience
|
||||
define that sets both bits.
|
||||
|
||||
The non-RFC behaviour is ubiquitous in web browsers, so the library does the
|
||||
conversion by default to maintain consistency. However, a server may require a
|
||||
POST to remain a POST after such a redirection. This option is meaningful only
|
||||
when setting \fICURLOPT_FOLLOWLOCATION\fP. (Added in 7.17.1) (This option was
|
||||
known as CURLOPT_POST301 up to 7.19.0 as it only supported the 301 way before
|
||||
then)
|
||||
.IP CURLOPT_PUT
|
||||
A parameter set to 1 tells the library to use HTTP PUT to transfer data. The
|
||||
data should be set with \fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE\fP.
|
||||
@@ -836,7 +847,7 @@ copy. In any case, the size must not be changed after
|
||||
.IP CURLOPT_HTTPPOST
|
||||
Tells libcurl you want a multipart/formdata HTTP POST to be made and you
|
||||
instruct what data to pass on to the server. Pass a pointer to a linked list
|
||||
of curl_httppost structs as parameter. . The easiest way to create such a
|
||||
of curl_httppost structs as parameter. The easiest way to create such a
|
||||
list, is to use \fIcurl_formadd(3)\fP as documented. The data in this list
|
||||
must remain intact until you close this curl handle again with
|
||||
\fIcurl_easy_cleanup(3)\fP.
|
||||
@@ -863,10 +874,10 @@ curl_slist\fP structs properly filled in. Use \fIcurl_slist_append(3)\fP to
|
||||
create the list and \fIcurl_slist_free_all(3)\fP to clean up an entire
|
||||
list. If you add a header that is otherwise generated and used by libcurl
|
||||
internally, your added one will be used instead. If you add a header with no
|
||||
contents as in 'Accept:' (no data on the right side of the colon), the
|
||||
content as in 'Accept:' (no data on the right side of the colon), the
|
||||
internally used header will get disabled. Thus, using this option you can add
|
||||
new headers, replace internal headers and remove internal headers. To add a
|
||||
header with no contents, make the contents be two quotes: \&"". The headers
|
||||
header with no content, make the content be two quotes: \&"". The headers
|
||||
included in the linked list must not be CRLF-terminated, because curl adds
|
||||
CRLF after each header item. Failure to comply with this will result in
|
||||
strange bugs because the server will most likely ignore part of the headers
|
||||
@@ -920,7 +931,7 @@ dumped to a file.
|
||||
|
||||
Given an empty or non-existing file or by passing the empty string (""), this
|
||||
option will enable cookies for this curl handle, making it understand and
|
||||
parse received cookies and then use matching cookies in future request.
|
||||
parse received cookies and then use matching cookies in future requests.
|
||||
|
||||
If you use this option multiple times, you just add more files to read.
|
||||
Subsequent files will add more cookies.
|
||||
@@ -941,7 +952,7 @@ about this possibly lethal situation.
|
||||
Pass a long set to 1 to mark this as a new cookie "session". It will force
|
||||
libcurl to ignore all cookies it is about to load that are "session cookies"
|
||||
from the previous session. By default, libcurl always stores and loads all
|
||||
cookies, independent if they are session cookies are not. Session cookies are
|
||||
cookies, independent if they are session cookies or not. Session cookies are
|
||||
cookies without expiry date and they are meant to be alive and existing for
|
||||
this "session" only.
|
||||
.IP CURLOPT_COOKIELIST
|
||||
@@ -955,7 +966,7 @@ all cookies known by cURL to the file specified by \fICURLOPT_COOKIEJAR\fP.
|
||||
(Added in 7.17.1)
|
||||
.IP CURLOPT_HTTPGET
|
||||
Pass a long. If the long is 1, this forces the HTTP request to get back
|
||||
to GET. usable if a POST, HEAD, PUT or a custom request have been used
|
||||
to GET. Usable if a POST, HEAD, PUT, or a custom request has been used
|
||||
previously using the same curl handle.
|
||||
|
||||
When setting \fICURLOPT_HTTPGET\fP to 1, it will automatically set
|
||||
@@ -992,17 +1003,17 @@ option is set to zero. (added in 7.16.2)
|
||||
.SH FTP OPTIONS
|
||||
.IP CURLOPT_FTPPORT
|
||||
Pass a pointer to a zero terminated string as parameter. It will be used to
|
||||
get the IP address to use for the ftp PORT instruction. The PORT instruction
|
||||
get the IP address to use for the FTP PORT instruction. The PORT instruction
|
||||
tells the remote server to connect to our specified IP address. The string may
|
||||
be a plain IP address, a host name, an network interface name (under Unix) or
|
||||
just a '-' letter to let the library use your systems default IP
|
||||
be a plain IP address, a host name, a network interface name (under Unix) or
|
||||
just a '-' symbol to let the library use your system's default IP
|
||||
address. Default FTP operations are passive, and thus won't use PORT.
|
||||
|
||||
You disable PORT again and go back to using the passive version by setting
|
||||
this option to NULL.
|
||||
.IP CURLOPT_QUOTE
|
||||
Pass a pointer to a linked list of FTP or SFTP commands to pass to
|
||||
the server prior to your ftp request. This will be done before any
|
||||
the server prior to your FTP request. This will be done before any
|
||||
other commands are issued (even before the CWD command for FTP). The
|
||||
linked list should be a fully valid list of 'struct curl_slist' structs
|
||||
properly filled in with text strings. Use \fIcurl_slist_append(3)\fP
|
||||
@@ -1017,7 +1028,7 @@ rename, rm, rmdir, symlink (see
|
||||
(SFTP support added in 7.16.3)
|
||||
.IP CURLOPT_POSTQUOTE
|
||||
Pass a pointer to a linked list of FTP or SFTP commands to pass to the
|
||||
server after your ftp transfer request. The linked list should be a
|
||||
server after your FTP transfer request. The linked list should be a
|
||||
fully valid list of struct curl_slist structs properly filled in as
|
||||
described for \fICURLOPT_QUOTE\fP. Disable this operation again by
|
||||
setting a NULL to this option.
|
||||
@@ -1040,7 +1051,7 @@ might not include subdirectories and symbolic links.
|
||||
(This option was known as CURLOPT_FTPLISTONLY up to 7.16.4)
|
||||
.IP CURLOPT_APPEND
|
||||
A parameter set to 1 tells the library to append to the remote file instead of
|
||||
overwrite it. This is only useful when uploading to an ftp site.
|
||||
overwrite it. This is only useful when uploading to an FTP site.
|
||||
|
||||
(This option was known as CURLOPT_FTPAPPEND up to 7.16.4)
|
||||
.IP CURLOPT_FTP_USE_EPRT
|
||||
@@ -1091,7 +1102,7 @@ from the 227-response. (Added in 7.14.2)
|
||||
This option has no effect if PORT, EPRT or EPSV is used instead of PASV.
|
||||
.IP CURLOPT_USE_SSL
|
||||
Pass a long using one of the values from below, to make libcurl use your
|
||||
desired level of SSL for the ftp transfer. (Added in 7.11.0)
|
||||
desired level of SSL for the FTP transfer. (Added in 7.11.0)
|
||||
|
||||
(This option was known as CURLOPT_FTP_SSL up to 7.16.4, and the constants
|
||||
were known as CURLFTPSSL_*)
|
||||
@@ -1111,11 +1122,11 @@ Pass a long using one of the values from below, to alter how libcurl issues
|
||||
\fICURLOPT_USE_SSL\fP). (Added in 7.12.2)
|
||||
.RS
|
||||
.IP CURLFTPAUTH_DEFAULT
|
||||
Allow libcurl to decide
|
||||
Allow libcurl to decide.
|
||||
.IP CURLFTPAUTH_SSL
|
||||
Try "AUTH SSL" first, and only if that fails try "AUTH TLS"
|
||||
Try "AUTH SSL" first, and only if that fails try "AUTH TLS".
|
||||
.IP CURLFTPAUTH_TLS
|
||||
Try "AUTH TLS" first, and only if that fails try "AUTH SSL"
|
||||
Try "AUTH TLS" first, and only if that fails try "AUTH SSL".
|
||||
.RE
|
||||
.IP CURLOPT_FTP_SSL_CCC
|
||||
If enabled, this option makes libcurl use CCC (Clear Command Channel). It
|
||||
@@ -1143,7 +1154,7 @@ argument should be one of the following alternatives:
|
||||
.RS
|
||||
.IP CURLFTPMETHOD_MULTICWD
|
||||
libcurl does a single CWD operation for each path part in the given URL. For
|
||||
deep hierarchies this means very many commands. This is how RFC1738 says it
|
||||
deep hierarchies this means many commands. This is how RFC1738 says it
|
||||
should be done. This is the default but the slowest behavior.
|
||||
.IP CURLFTPMETHOD_NOCWD
|
||||
libcurl does no CWD at all. libcurl will do SIZE, RETR, STOR etc and give a
|
||||
@@ -1155,7 +1166,7 @@ compliant than 'nocwd' but without the full penalty of 'multicwd'.
|
||||
.RE
|
||||
.SH PROTOCOL OPTIONS
|
||||
.IP CURLOPT_TRANSFERTEXT
|
||||
A parameter set to 1 tells the library to use ASCII mode for ftp transfers,
|
||||
A parameter set to 1 tells the library to use ASCII mode for FTP transfers,
|
||||
instead of the default binary transfer. For win32 systems it does not set the
|
||||
stdout to binary mode. This option can be usable when transferring text data
|
||||
between systems with different views on certain characters, such as newlines
|
||||
@@ -1163,7 +1174,7 @@ or similar.
|
||||
|
||||
libcurl does not do a complete ASCII conversion when doing ASCII transfers
|
||||
over FTP. This is a known limitation/flaw that nobody has rectified. libcurl
|
||||
simply sets the mode to ascii and performs a standard transfer.
|
||||
simply sets the mode to ASCII and performs a standard transfer.
|
||||
.IP CURLOPT_PROXY_TRANSFER_MODE
|
||||
Pass a long. If the value is set to 1 (one), it tells libcurl to set the
|
||||
transfer mode (binary or ASCII) for FTP transfers done via an HTTP proxy, by
|
||||
@@ -1194,16 +1205,21 @@ you want the transfer to start from. (Added in 7.11.0)
|
||||
.IP CURLOPT_CUSTOMREQUEST
|
||||
Pass a pointer to a zero terminated string as parameter. It will be used
|
||||
instead of GET or HEAD when doing an HTTP request, or instead of LIST or NLST
|
||||
when doing an ftp directory listing. This is useful for doing DELETE or other
|
||||
when doing a FTP directory listing. This is useful for doing DELETE or other
|
||||
more or less obscure HTTP requests. Don't do this at will, make sure your
|
||||
server supports the command first.
|
||||
|
||||
Note that libcurl will still act and assume the keyword it would use if you
|
||||
didn't set your custom one is the one in use and it will act according to
|
||||
that. Thus, changing this to a HEAD when libcurl otherwise would do a GET
|
||||
might cause libcurl to act funny, and similar. To switch to a proper HEAD, use
|
||||
\fICURLOPT_NOBODY\fP, to switch to a proper POST, use \fICURLOPT_POST\fP or
|
||||
\fICURLOPT_POSTFIELDS\fP and so on.
|
||||
When you change the request method by setting \fBCURLOPT_CUSTOMREQUEST\fP to
|
||||
something, you don't actually change how libcurl behaves or acts in regards to
|
||||
the particular request method, it will only change the actual string sent in
|
||||
the request.
|
||||
|
||||
For example: if you tell libcurl to do a HEAD request, but then change the
|
||||
request to a "GET" with \fBCURLOPT_CUSTOMREQUEST\fP you'll still see libcurl
|
||||
act as if it sent a HEAD even when it does send a GET.
|
||||
|
||||
To switch to a proper HEAD, use \fICURLOPT_NOBODY\fP, to switch to a proper
|
||||
POST, use \fICURLOPT_POST\fP or \fICURLOPT_POSTFIELDS\fP and so on.
|
||||
|
||||
Restore to the internal default by setting this to NULL.
|
||||
|
||||
@@ -1284,10 +1300,10 @@ value is treated. You can set this parameter to \fICURL_TIMECOND_IFMODSINCE\fP
|
||||
or \fICURL_TIMECOND_IFUNMODSINCE\fP. This feature applies to HTTP and FTP.
|
||||
|
||||
The last modification time of a file is not always known and in such instances
|
||||
this feature will have no effect even if the given time condition would have
|
||||
not been met.
|
||||
this feature will have no effect even if the given time condition would not have
|
||||
been met.
|
||||
.IP CURLOPT_TIMEVALUE
|
||||
Pass a long as parameter. This should be the time in seconds since 1 jan 1970,
|
||||
Pass a long as parameter. This should be the time in seconds since 1 Jan 1970,
|
||||
and the time will be used in a condition as specified with
|
||||
\fICURLOPT_TIMECONDITION\fP.
|
||||
.SH CONNECTION OPTIONS
|
||||
@@ -1328,19 +1344,19 @@ value. Defaults to unlimited speed. (Added in 7.15.5)
|
||||
Pass a long. The set number will be the persistent connection cache size. The
|
||||
set amount will be the maximum amount of simultaneously open connections that
|
||||
libcurl may cache in this easy handle. Default is 5, and there isn't much
|
||||
point in changing this value unless you are perfectly aware of how this work
|
||||
and changes libcurl's behaviour. This concerns connection using any of the
|
||||
point in changing this value unless you are perfectly aware of how this works
|
||||
and changes libcurl's behaviour. This concerns connections using any of the
|
||||
protocols that support persistent connections.
|
||||
|
||||
When reaching the maximum limit, curl closes the oldest one in the cache to
|
||||
prevent the number of open connections to increase.
|
||||
prevent increasing the number of open connections.
|
||||
|
||||
If you already have performed transfers with this curl handle, setting a
|
||||
smaller MAXCONNECTS than before may cause open connections to get closed
|
||||
unnecessarily.
|
||||
|
||||
Note that if you add this easy handle to a multi handle, this setting is not
|
||||
being acknowledged, but you must instead use \fIcurl_multi_setopt(3)\fP and
|
||||
acknowledged, and you must instead use \fIcurl_multi_setopt(3)\fP and
|
||||
the \fICURLMOPT_MAXCONNECTS\fP option.
|
||||
.IP CURLOPT_CLOSEPOLICY
|
||||
(Obsolete) This option does nothing.
|
||||
@@ -1353,10 +1369,10 @@ what it does. Set this to 0 to have libcurl attempt re-using an existing
|
||||
connection (default behavior).
|
||||
.IP CURLOPT_FORBID_REUSE
|
||||
Pass a long. Set to 1 to make the next transfer explicitly close the
|
||||
connection when done. Normally, libcurl keep all connections alive when done
|
||||
with one transfer in case there comes a succeeding one that can re-use them.
|
||||
connection when done. Normally, libcurl keeps all connections alive when done
|
||||
with one transfer in case a succeeding one follows that can re-use them.
|
||||
This option should be used with caution and only if you understand what it
|
||||
does. Set to 0 to have libcurl keep the connection open for possibly later
|
||||
does. Set to 0 to have libcurl keep the connection open for possible later
|
||||
re-use (default behavior).
|
||||
.IP CURLOPT_CONNECTTIMEOUT
|
||||
Pass a long. It should contain the maximum time in seconds that you allow the
|
||||
@@ -1381,9 +1397,9 @@ resolve addresses using more than one version of IP. The allowed values are:
|
||||
.IP CURL_IPRESOLVE_WHATEVER
|
||||
Default, resolves addresses to all IP versions that your system allows.
|
||||
.IP CURL_IPRESOLVE_V4
|
||||
Resolve to ipv4 addresses.
|
||||
Resolve to IPv4 addresses.
|
||||
.IP CURL_IPRESOLVE_V6
|
||||
Resolve to ipv6 addresses.
|
||||
Resolve to IPv6 addresses.
|
||||
.RE
|
||||
.IP CURLOPT_CONNECT_ONLY
|
||||
Pass a long. If the parameter equals 1, it tells the library to perform all
|
||||
@@ -1493,14 +1509,14 @@ even indicate an accessible file.
|
||||
Note that option is by default set to the system path where libcurl's cacert
|
||||
bundle is assumed to be stored, as established at build time.
|
||||
|
||||
When built against NSS this is the directory that the NSS certificate
|
||||
When built against NSS, this is the directory that the NSS certificate
|
||||
database resides in.
|
||||
.IP CURLOPT_ISSUERCERT
|
||||
Pass a char * to a zero terminated string naming a file holding a CA
|
||||
certificate in PEM format. If the option is set, an additional check against
|
||||
the peer certificate is performed to verify the issuer is indeed the one
|
||||
associated with the certificate provided by the option. This additional check
|
||||
is useful in multi-level PKI where one need to enforce the peer certificate is
|
||||
is useful in multi-level PKI where one needs to enforce that the peer certificate is
|
||||
from a specific branch of the tree.
|
||||
|
||||
This option makes sense only when used in combination with the
|
||||
@@ -1541,7 +1557,7 @@ found in the CRL does not trigger this specific error. (Added in 7.19.0)
|
||||
.IP CURLOPT_CERTINFO
|
||||
Pass a long set to 1 to enable libcurl's certificate chain info gatherer. With
|
||||
this enabled, libcurl (if built with OpenSSL) will extract lots of information
|
||||
and data about the certificate's in the certificate chain used in the SSL
|
||||
and data about the certificates in the certificate chain used in the SSL
|
||||
connection. This data is then possible to extract after a transfer using
|
||||
\fIcurl_easy_getinfo(3)\fP and its option \fICURLINFO_CERTINFO\fP. (Added in
|
||||
7.19.1)
|
||||
@@ -1558,7 +1574,7 @@ Pass a long as parameter.
|
||||
This option determines whether libcurl verifies that the server cert is for
|
||||
the server it is known as.
|
||||
|
||||
When negotiating an SSL connection, the server sends a certificate indicating
|
||||
When negotiating a SSL connection, the server sends a certificate indicating
|
||||
its identity.
|
||||
|
||||
When \fICURLOPT_SSL_VERIFYHOST\fP is 2, that certificate must indicate that
|
||||
@@ -1577,15 +1593,14 @@ certificate.
|
||||
|
||||
The default, since 7.10, is 2.
|
||||
|
||||
The checking this option controls is of the identity that the server
|
||||
\fIclaims\fP. The server could be lying. To control lying, see
|
||||
\fICURLOPT_SSL_VERIFYPEER\fP.
|
||||
This option controls checking the server's claimed identity. The server could
|
||||
be lying. To control lying, see \fICURLOPT_SSL_VERIFYPEER\fP.
|
||||
.IP CURLOPT_SSL_CIPHER_LIST
|
||||
Pass a char *, pointing to a zero terminated string holding the list of
|
||||
ciphers to use for the SSL connection. The list must be syntactically correct,
|
||||
it consists of one or more cipher strings separated by colons. Commas or spaces
|
||||
are also acceptable separators but colons are normally used, \!, \- and \+ can
|
||||
be used as operators.
|
||||
it consists of one or more cipher strings separated by colons. Commas or
|
||||
spaces are also acceptable separators but colons are normally used, \&!, \&-
|
||||
and \&+ can be used as operators.
|
||||
|
||||
For OpenSSL and GnuTLS valid examples of cipher lists include 'RC4-SHA',
|
||||
\'SHA1+DES\', 'TLSv1' and 'DEFAULT'. The default list is normally set when you
|
||||
@@ -1594,7 +1609,7 @@ compile OpenSSL.
|
||||
You'll find more details about cipher lists on this URL:
|
||||
\fIhttp://www.openssl.org/docs/apps/ciphers.html\fP
|
||||
|
||||
For NSS valid examples of cipher lists include 'rsa_rc4_128_md5',
|
||||
For NSS, valid examples of cipher lists include 'rsa_rc4_128_md5',
|
||||
\'rsa_aes_128_sha\', etc. With NSS you don't add/remove ciphers. If one uses
|
||||
this option then all known ciphers are disabled and only those passed in
|
||||
are enabled.
|
||||
@@ -1609,9 +1624,9 @@ cache. Note that while nothing ever should get hurt by attempting to reuse SSL
|
||||
session-IDs, there seem to be broken SSL implementations in the wild that may
|
||||
require you to disable this in order for you to succeed. (Added in 7.16.0)
|
||||
.IP CURLOPT_KRBLEVEL
|
||||
Pass a char * as parameter. Set the kerberos security level for FTP; this
|
||||
also enables kerberos awareness. This is a string, 'clear', 'safe',
|
||||
'confidential' or \&'private'. If the string is set but doesn't match one
|
||||
Pass a char * as parameter. Set the kerberos security level for FTP; this also
|
||||
enables kerberos awareness. This is a string, \&'clear', \&'safe',
|
||||
\&'confidential' or \&'private'. If the string is set but doesn't match one
|
||||
of these, 'private' will be used. Set the string to NULL to disable kerberos
|
||||
support for FTP.
|
||||
|
||||
@@ -1652,7 +1667,7 @@ share handle. See \fIcurl_share_setopt(3)\fP for details.
|
||||
|
||||
If you add a share that is set to share cookies, your easy handle will use
|
||||
that cookie cache and get the cookie engine enabled. If you unshare an object
|
||||
that were using cookies (or change to another object that doesn't share
|
||||
that was using cookies (or change to another object that doesn't share
|
||||
cookies), the easy handle will get its cookie engine disabled.
|
||||
|
||||
Data that the share object is not set to share will be dealt with the usual
|
||||
@@ -1661,12 +1676,12 @@ way, as if no share was used.
|
||||
Pass a long as a parameter, containing the value of the permissions that will
|
||||
be assigned to newly created files on the remote server. The default value is
|
||||
\fI0644\fP, but any valid value can be used. The only protocols that can use
|
||||
this are \fIsftp://\fP, \fIscp://\fP and \fIfile://\fP. (Added in 7.16.4)
|
||||
this are \fIsftp://\fP, \fIscp://\fP, and \fIfile://\fP. (Added in 7.16.4)
|
||||
.IP CURLOPT_NEW_DIRECTORY_PERMS
|
||||
Pass a long as a parameter, containing the value of the permissions that will
|
||||
be assigned to newly created directories on the remote server. The default
|
||||
value is \fI0755\fP, but any valid value can be used. The only protocols that
|
||||
can use this are \fIsftp://\fP, \fIscp://\fP and \fIfile://\fP.
|
||||
can use this are \fIsftp://\fP, \fIscp://\fP, and \fIfile://\fP.
|
||||
(Added in 7.16.4)
|
||||
.SH TELNET OPTIONS
|
||||
.IP CURLOPT_TELNETOPTIONS
|
||||
|
||||
@@ -106,8 +106,9 @@ long which gives the length of the buffer.
|
||||
Tells libcurl to use the \fICURLOPT_READFUNCTION\fP callback to get data. The
|
||||
parameter you pass to \fICURLFORM_STREAM\fP is the pointer passed on to the
|
||||
read callback's fourth argument. If you want the part to look like a file
|
||||
upload one, set the \fICURLFORM_FILENAME\fP parameter as well. (Option added
|
||||
in libcurl 7.18.2)
|
||||
upload one, set the \fICURLFORM_FILENAME\fP parameter as well. Note that when
|
||||
using \fICURLFORM_STREAM\fP, \fICURLFORM_CONTENTSLENGTH\fP must also be set
|
||||
with the total expected length of the part. (Option added in libcurl 7.18.2)
|
||||
.IP CURLFORM_ARRAY
|
||||
Another possibility to send options to curl_formadd() is the
|
||||
\fBCURLFORM_ARRAY\fP option, that passes a struct curl_forms array pointer as
|
||||
|
||||
@@ -13,7 +13,7 @@ curl_formfree - free a previously build multipart/formdata HTTP POST chain
|
||||
.SH DESCRIPTION
|
||||
curl_formfree() is used to clean up data previously built/appended with
|
||||
\fIcurl_formadd(3)\fP. This must be called when the data has been used, which
|
||||
typically means after the \fIcurl_easy_perform(3)\fP has been called.
|
||||
typically means after \fIcurl_easy_perform(3)\fP has been called.
|
||||
.SH RETURN VALUE
|
||||
None
|
||||
.SH "SEE ALSO"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
.\"
|
||||
.TH curl_formget 3 "20 June 2006" "libcurl 7.15.5" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_formget - serialize a previously build multipart/formdata HTTP POST chain
|
||||
curl_formget - serialize a previously built multipart/formdata HTTP POST chain
|
||||
.SH SYNOPSIS
|
||||
.B #include <curl/curl.h>
|
||||
.sp
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
.\"
|
||||
.TH curl_getdate 3 "12 Aug 2005" "libcurl 7.0" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_getdate - Convert an date string to number of seconds since January 1,
|
||||
curl_getdate - Convert a date string to number of seconds since January 1,
|
||||
1970
|
||||
.SH SYNOPSIS
|
||||
.B #include <curl/curl.h>
|
||||
@@ -27,7 +27,7 @@ items:
|
||||
.TP 0.8i
|
||||
.B calendar date items
|
||||
Can be specified several ways. Month names can only be three-letter english
|
||||
abbrivations, numbers can be zero-prefixed and the year may use 2 or 4 digits.
|
||||
abbreviations, numbers can be zero-prefixed and the year may use 2 or 4 digits.
|
||||
Examples: 06 Nov 1994, 06-Nov-94 and Nov-94 6.
|
||||
.TP
|
||||
.B time of the day items
|
||||
@@ -96,5 +96,5 @@ The former version of this function was built with yacc and was not only very
|
||||
large, it was also never quite understood and it wasn't possible to build with
|
||||
non-GNU tools since only GNU Bison could make it thread-safe!
|
||||
|
||||
The rewrite was done for 7.12.2. The new one is much smaller and use simpler
|
||||
The rewrite was done for 7.12.2. The new one is much smaller and uses simpler
|
||||
code.
|
||||
|
||||
@@ -24,7 +24,7 @@ to find the specified name, it returns a null pointer.
|
||||
.SH NOTE
|
||||
Under unix operating systems, there isn't any point in returning an allocated
|
||||
memory, although other systems won't work properly if this isn't done. The
|
||||
unix implementation thus have to suffer slightly from the drawbacks of other
|
||||
unix implementation thus has to suffer slightly from the drawbacks of other
|
||||
systems.
|
||||
.SH "SEE ALSO"
|
||||
.BR getenv "(3C), "
|
||||
|
||||
@@ -23,7 +23,7 @@ effect as one call.
|
||||
The flags option is a bit pattern that tells libcurl exactly what features to
|
||||
init, as described below. Set the desired bits by ORing the values together.
|
||||
In normal operation, you must specify CURL_GLOBAL_ALL. Don't use any other
|
||||
value unless you are familiar with and mean to control internal operations of
|
||||
value unless you are familiar with it and mean to control internal operations of
|
||||
libcurl.
|
||||
|
||||
\fBThis function is not thread safe.\fP You must not call it when any other
|
||||
|
||||
@@ -28,7 +28,7 @@ curl_mvsprintf - formatted output conversion
|
||||
.br
|
||||
.BI "char *curl_mvaprintf(const char *" format ", va_list " args ");"
|
||||
.SH DESCRIPTION
|
||||
These are all functions that produces output according to a format string and
|
||||
These are all functions that produce output according to a format string and
|
||||
given arguments. These are mostly clones of the well-known C-style functions
|
||||
and there will be no detailed explanation of all available formatting rules
|
||||
and usage here.
|
||||
@@ -83,8 +83,8 @@ future. They will instead be made "available" by source code access only, and
|
||||
then as curlx_-prefixed functions. See lib/README.curlx for further details.
|
||||
.SH RETURN VALUE
|
||||
The \fBcurl_maprintf\fP and \fBcurl_mvaprintf\fP functions return a pointer to
|
||||
a newly allocated string, or NULL it it failed.
|
||||
a newly allocated string, or NULL if it failed.
|
||||
|
||||
All other functions return the number of character they actually outputed.
|
||||
All other functions return the number of characters they actually outputted.
|
||||
.SH "SEE ALSO"
|
||||
.BR printf "(3), " sprintf "(3), " fprintf "(3), " vprintf "(3) "
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
.\"
|
||||
.TH curl_multi_assign 3 "9 Jul 2006" "libcurl 7.16.0" "libcurl Manual"
|
||||
.SH NAME
|
||||
curl_multi_assign \- set data to associated with an internal socket
|
||||
curl_multi_assign \- set data to association with an internal socket
|
||||
.SH SYNOPSIS
|
||||
#include <curl/curl.h>
|
||||
|
||||
@@ -34,7 +34,7 @@ In a typical application you allocate a struct or at least use some kind of
|
||||
semi-dynamic data for each socket that we must wait for action on when using
|
||||
the \fIcurl_multi_socket(3)\fP approach.
|
||||
|
||||
When our socket-callback get called by libcurl and we get to know about yet
|
||||
When our socket-callback gets called by libcurl and we get to know about yet
|
||||
another socket to wait for, we can use \fIcurl_multi_assign(3)\fP to point out
|
||||
the particular data so that when we get updates about this same socket again,
|
||||
we don't have to find the struct associated with this socket by ourselves.
|
||||
|
||||
@@ -17,9 +17,9 @@ CURLMcode curl_multi_fdset(CURLM *multi_handle,
|
||||
This function extracts file descriptor information from a given multi_handle.
|
||||
libcurl returns its fd_set sets. The application can use these to select() on,
|
||||
but be sure to FD_ZERO them before calling this function as
|
||||
\fIcurl_multi_fdset(3)\fP only adds its own descriptors it doesn't zero or
|
||||
otherwise remove any other. The \fIcurl_multi_perform(3)\fP function should be
|
||||
called as soon as one of them are ready to be read from or written to.
|
||||
\fIcurl_multi_fdset(3)\fP only adds its own descriptors, it doesn't zero or
|
||||
otherwise remove any others. The \fIcurl_multi_perform(3)\fP function should be
|
||||
called as soon as one of them is ready to be read from or written to.
|
||||
|
||||
If no file descriptors are set by libcurl, \fImax_fd\fP will contain -1 when
|
||||
this function returns. Otherwise it will contain the higher descriptor number
|
||||
|
||||
@@ -29,7 +29,7 @@ is emptied.
|
||||
calling \fIcurl_multi_cleanup(3)\fP, \fIcurl_multi_remove_handle(3)\fP or
|
||||
\fIcurl_easy_cleanup(3)\fP.
|
||||
|
||||
The 'CURLMsg' struct is very simple and only contain very basic information.
|
||||
The 'CURLMsg' struct is very simple and only contains very basic information.
|
||||
If more involved information is wanted, the particular "easy handle" in
|
||||
present in that struct and can thus be used in subsequent regular
|
||||
\fIcurl_easy_getinfo(3)\fP calls (or similar):
|
||||
@@ -48,7 +48,7 @@ When \fBmsg\fP is \fICURLMSG_DONE\fP, the message identifies a transfer that
|
||||
is done, and then \fBresult\fP contains the return code for the easy handle
|
||||
that just completed.
|
||||
|
||||
At this point, there is no other \fBmsg\fP types defined.
|
||||
At this point, there are no other \fBmsg\fP types defined.
|
||||
.SH "RETURN VALUE"
|
||||
A pointer to a filled-in struct, or NULL if it failed or ran out of
|
||||
structs. It also writes the number of messages left in the queue (after this
|
||||
|
||||
@@ -10,7 +10,7 @@ curl_multi_init - create a multi handle
|
||||
.ad
|
||||
.SH DESCRIPTION
|
||||
This function returns a CURLM handle to be used as input to all the other
|
||||
multi-functions, sometimes referred to as a multi handle on some places in the
|
||||
multi-functions, sometimes referred to as a multi handle in some places in the
|
||||
documentation. This init call MUST have a corresponding call to
|
||||
\fIcurl_multi_cleanup(3)\fP when the operation is complete.
|
||||
.SH RETURN VALUE
|
||||
|
||||
@@ -32,12 +32,12 @@ actions. You don't have to do it immediately, but the return code means that
|
||||
libcurl may have more data available to return or that there may be more data
|
||||
to send off before it is "satisfied". Do note that \fIcurl_multi_perform(3)\fP
|
||||
will return \fICURLM_CALL_MULTI_PERFORM\fP only when it wants to be called
|
||||
again \fBimmediately\fP. When things are fine and there are nothing immediate
|
||||
again \fBimmediately\fP. When things are fine and there is nothing immediate
|
||||
it wants done, it'll return \fICURLM_OK\fP and you need to wait for \&"action"
|
||||
and then call this function again.
|
||||
|
||||
NOTE that this only returns errors etc regarding the whole multi stack. There
|
||||
might still have occurred problems on individual transfers even when this
|
||||
NOTE that this only returns errors etc regarding the whole multi stack. Problems
|
||||
still might have occurred on individual transfers even when this
|
||||
function returns \fICURLM_OK\fP.
|
||||
.SH "TYPICAL USAGE"
|
||||
Most applications will use \fIcurl_multi_fdset(3)\fP to get the multi_handle's
|
||||
|
||||
@@ -21,7 +21,7 @@ You can only set one option in each function call.
|
||||
.IP CURLMOPT_SOCKETFUNCTION
|
||||
Pass a pointer to a function matching the \fBcurl_socket_callback\fP
|
||||
prototype. The \fIcurl_multi_socket(3)\fP functions inform the application
|
||||
about updates in the socket (file descriptor) status by doing none, one or
|
||||
about updates in the socket (file descriptor) status by doing none, one, or
|
||||
multiple calls to the curl_socket_callback given in the \fBparam\fP
|
||||
argument. They update the status with changes since the previous time a
|
||||
\fIcurl_multi_socket(3)\fP function was called. If the given callback pointer
|
||||
@@ -38,7 +38,7 @@ Pass a long set to 1 to enable or 0 to disable. Enabling pipelining on a multi
|
||||
handle will make it attempt to perform HTTP Pipelining as far as possible for
|
||||
transfers using this handle. This means that if you add a second request that
|
||||
can use an already existing connection, the second request will be \&"piped"
|
||||
on the same connection rather than being executed in parallell. (Added in
|
||||
on the same connection rather than being executed in parallel. (Added in
|
||||
7.16.0)
|
||||
.IP CURLMOPT_TIMERFUNCTION
|
||||
Pass a pointer to a function matching the \fBcurl_multi_timer_callback\fP
|
||||
@@ -63,11 +63,11 @@ simultaneously open connections that libcurl may cache. Default is 10, and
|
||||
libcurl will enlarge the size for each added easy handle to make it fit 4
|
||||
times the number of added easy handles.
|
||||
|
||||
By setting this option, you can prevent the cache size to grow beyond the
|
||||
By setting this option, you can prevent the cache size from growing beyond the
|
||||
limit set by you.
|
||||
|
||||
When the cache is full, curl closes the oldest one in the cache to prevent the
|
||||
number of open connections to increase.
|
||||
number of open connections from increasing.
|
||||
|
||||
This option is for the multi handle's use only, when using the easy interface
|
||||
you should instead use the \fICURLOPT_MAXCONNECTS\fP option.
|
||||
|
||||
@@ -44,7 +44,7 @@ is the one that completed. Use \fIcurl_multi_info_read(3)\fP to figure out
|
||||
which easy handle that completed.
|
||||
|
||||
The \fBcurl_multi_socket_action(3)\fP functions inform the application about
|
||||
updates in the socket (file descriptor) status by doing none, one or multiple
|
||||
updates in the socket (file descriptor) status by doing none, one, or multiple
|
||||
calls to the socket callback function set with the CURLMOPT_SOCKETFUNCTION
|
||||
option to \fIcurl_multi_setopt(3)\fP. They update the status with changes
|
||||
since the previous time the callback was called.
|
||||
@@ -64,7 +64,7 @@ equivalent to \fIcurl_multi_socket_action(3)\fP with \fBev_bitmask\fP set to
|
||||
|
||||
Force libcurl to (re-)check all its internal sockets and transfers instead of
|
||||
just a single one by calling \fBcurl_multi_socket_all(3)\fP. Note that there
|
||||
should not exist any reasons to use this function!
|
||||
should not be any reason to use this function!
|
||||
.SH "CALLBACK DETAILS"
|
||||
|
||||
The socket \fBcallback\fP function uses a prototype like this
|
||||
@@ -121,8 +121,8 @@ In modern libcurls, \fICURLM_CALL_MULTI_PERFORM\fP or
|
||||
\fICURLM_CALL_MULTI_SOKCET\fP should not be returned and no application needs
|
||||
to care about them.
|
||||
|
||||
NOTE that the return code is for the whole multi stack. There might still have
|
||||
occurred problems on individual transfers even when one of these functions
|
||||
NOTE that the return code is for the whole multi stack. Problems still might have
|
||||
occurred on individual transfers even when one of these functions
|
||||
return OK.
|
||||
.SH "TYPICAL USAGE"
|
||||
1. Create a multi handle
|
||||
@@ -147,7 +147,7 @@ call \fIcurl_multi_socket_action(3)\fP with \fICURL_SOCKET_TIMEOUT\fP
|
||||
|
||||
8. Go back to step 6.
|
||||
.SH AVAILABILITY
|
||||
This function was added in libcurl 7.15.4, although deemed stable since
|
||||
This function was added in libcurl 7.15.4, and is deemed stable since
|
||||
7.16.0.
|
||||
|
||||
\fIcurl_multi_socket(3)\fP is deprecated, use
|
||||
|
||||
@@ -10,7 +10,7 @@ curl_share_init - Create a shared object
|
||||
.ad
|
||||
.SH DESCRIPTION
|
||||
This function returns a CURLSH handle to be used as input to all the other
|
||||
share-functions, sometimes referred to as a share handle on some places in the
|
||||
share-functions, sometimes referred to as a share handle in some places in the
|
||||
documentation. This init call MUST have a corresponding call to
|
||||
\fIcurl_share_cleanup\fP when all operations using the share are complete.
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ prototype:
|
||||
void unlock_function(CURL *handle, curl_lock_data data, void *userptr);
|
||||
|
||||
\fIdata\fP defines what data libcurl wants to unlock, and you must make sure
|
||||
that only one lick is given at any time for each kind of data.
|
||||
that only one lock is given at any time for each kind of data.
|
||||
|
||||
\fIuserptr\fP is the pointer you set with \fICURLSHOPT_USERDATA\fP.
|
||||
.IP CURLSHOPT_SHARE
|
||||
@@ -51,7 +51,7 @@ This option does the opposite of \fICURLSHOPT_SHARE\fP. It specifies that
|
||||
the specified \fIparameter\fP will no longer be shared. Valid values are
|
||||
the same as those for \fICURLSHOPT_SHARE\fP.
|
||||
.IP CURLSHOPT_USERDATA
|
||||
The \fIparameter\fP allows you to specify a pointer to data that will passed
|
||||
The \fIparameter\fP allows you to specify a pointer to data that will be passed
|
||||
to the lock_function and unlock_function each time it is called.
|
||||
.SH RETURN VALUE
|
||||
CURLSHE_OK (zero) means that the option was set properly, non-zero means an
|
||||
|
||||
@@ -21,7 +21,7 @@ first \fIlen\fP characters of \fIstr1\fP.
|
||||
.sp
|
||||
These functions are provided by libcurl to enable applications to compare
|
||||
strings in a truly portable manner. There are no standard portable case
|
||||
insensitive string comparison functions. These two works on all platforms.
|
||||
insensitive string comparison functions. These two work on all platforms.
|
||||
.SH AVAILABILITY
|
||||
These functions will be removed from the public libcurl API in a near
|
||||
future. They will instead be made "available" by source code access only, and
|
||||
|
||||
@@ -34,7 +34,7 @@ Returns a pointer to a filled in struct with information about various
|
||||
run-time features in libcurl. \fItype\fP should be set to the version of this
|
||||
functionality by the time you write your program. This way, libcurl will
|
||||
always return a proper struct that your program understands, while programs in
|
||||
the future might get an different struct. CURLVERSION_NOW will be the most
|
||||
the future might get a different struct. CURLVERSION_NOW will be the most
|
||||
recent one for the library you have installed:
|
||||
|
||||
data = curl_version_info(CURLVERSION_NOW);
|
||||
@@ -74,8 +74,8 @@ typedef struct {
|
||||
} curl_version_info_data;
|
||||
.fi
|
||||
|
||||
\fIage\fP describes what age of this struct this is. The number depends on how
|
||||
new libcurl you're using. You are however guaranteed to get a struct that you
|
||||
\fIage\fP describes what the age of this struct is. The number depends on how
|
||||
new the libcurl you're using is. You are however guaranteed to get a struct that you
|
||||
have a matching struct for in the header, as you tell libcurl your "age" with
|
||||
the input argument.
|
||||
|
||||
@@ -126,15 +126,15 @@ allows libcurl to use the current user and the current user's password without
|
||||
the app having to pass them on. (Added in 7.13.2)
|
||||
.IP CURL_VERSION_CONV
|
||||
libcurl was built with support for character conversions, as provided by the
|
||||
CUURLOPT_CONV_* callbacks. (Added in 7.15.4)
|
||||
CURLOPT_CONV_* callbacks. (Added in 7.15.4)
|
||||
.RE
|
||||
\fIssl_version\fP is an ascii string for the OpenSSL version used. If libcurl
|
||||
\fIssl_version\fP is an ASCII string for the OpenSSL version used. If libcurl
|
||||
has no SSL support, this is NULL.
|
||||
|
||||
\fIssl_version_num\fP is the numerical OpenSSL version value as defined by the
|
||||
OpenSSL project. If libcurl has no SSL support, this is 0.
|
||||
|
||||
\fIlibz_version\fP is an ascii string (there is no numerical version). If
|
||||
\fIlibz_version\fP is an ASCII string (there is no numerical version). If
|
||||
libcurl has no libz support, this is NULL.
|
||||
|
||||
\fIprotocols\fP is a pointer to an array of char * pointers, containing the
|
||||
|
||||
@@ -26,13 +26,13 @@
|
||||
libcurl-errors \- error codes in libcurl
|
||||
.SH DESCRIPTION
|
||||
This man page includes most, if not all, available error codes in libcurl.
|
||||
Why they occur and possibly what you can do to fix the problem.
|
||||
Why they occur and possibly what you can do to fix the problem are also included.
|
||||
.SH "CURLcode"
|
||||
Almost all "easy" interface functions return a CURLcode error code. No matter
|
||||
what, using the \fIcurl_easy_setopt(3)\fP option \fICURLOPT_ERRORBUFFER\fP is
|
||||
a good idea as it will give you a human readable error string that may offer
|
||||
more details about the error cause than just the error code
|
||||
does. \fIcurl_easy_strerror(3)\fP can be called to get an error string from a
|
||||
more details about the cause of the error than just the error code.
|
||||
\fIcurl_easy_strerror(3)\fP can be called to get an error string from a
|
||||
given CURLcode number.
|
||||
|
||||
CURLcode is one of the following:
|
||||
@@ -55,7 +55,7 @@ Couldn't resolve host. The given remote host was not resolved.
|
||||
.IP "CURLE_COULDNT_CONNECT (7)"
|
||||
Failed to connect() to host or proxy.
|
||||
.IP "CURLE_FTP_WEIRD_SERVER_REPLY (8)"
|
||||
After connecting to an FTP server, libcurl expects to get a certain reply
|
||||
After connecting to a FTP server, libcurl expects to get a certain reply
|
||||
back. This error code implies that it got a strange or bad reply. The given
|
||||
remote server is probably not an OK FTP server.
|
||||
.IP "CURLE_REMOTE_ACCESS_DENIED (9)"
|
||||
@@ -73,7 +73,7 @@ fails to parse that line, this return code is passed back.
|
||||
.IP "CURLE_FTP_CANT_GET_HOST (15)"
|
||||
An internal failure to lookup the host used for the new connection.
|
||||
.IP "CURLE_FTP_COULDNT_SET_TYPE (17)"
|
||||
Received an error when trying to set the transfer mode to binary or ascii.
|
||||
Received an error when trying to set the transfer mode to binary or ASCII.
|
||||
.IP "CURLE_PARTIAL_FILE (18)"
|
||||
A file transfer was shorter or larger than expected. This happens when the
|
||||
server first reports an expected transfer size, and then delivers data that
|
||||
@@ -94,19 +94,19 @@ An error occurred when writing received data to a local file, or an error was
|
||||
returned to libcurl from a write callback.
|
||||
.IP "CURLE_UPLOAD_FAILED (25)"
|
||||
Failed starting the upload. For FTP, the server typically denied the STOR
|
||||
command. The error buffer usually contains the server's explanation to this.
|
||||
command. The error buffer usually contains the server's explanation for this.
|
||||
(This error code was formerly known as CURLE_FTP_COULDNT_STOR_FILE.)
|
||||
.IP "CURLE_READ_ERROR (26)"
|
||||
There was a problem reading a local file or an error returned by the read
|
||||
callback.
|
||||
.IP "CURLE_OUT_OF_MEMORY (27)"
|
||||
A memory allocation request failed. This is serious badness and
|
||||
things are severely screwed up if this ever occur.
|
||||
things are severely screwed up if this ever occurs.
|
||||
.IP "CURLE_OPERATION_TIMEDOUT (28)"
|
||||
Operation timeout. The specified time-out period was reached according to the
|
||||
conditions.
|
||||
.IP "CURLE_FTP_PORT_FAILED (30)"
|
||||
The FTP PORT command returned error. This mostly happen when you haven't
|
||||
The FTP PORT command returned error. This mostly happens when you haven't
|
||||
specified a good enough address for libcurl to use. See \fICURLOPT_FTPPORT\fP.
|
||||
.IP "CURLE_FTP_COULDNT_USE_REST (31)"
|
||||
The FTP REST command returned error. This should never happen if the server is
|
||||
@@ -162,52 +162,52 @@ Failed sending network data.
|
||||
.IP "CURLE_RECV_ERROR (56)"
|
||||
Failure with receiving network data.
|
||||
.IP "CURLE_SSL_CERTPROBLEM (58)"
|
||||
problem with the local client certificate
|
||||
problem with the local client certificate.
|
||||
.IP "CURLE_SSL_CIPHER (59)"
|
||||
Couldn't use specified cipher
|
||||
Couldn't use specified cipher.
|
||||
.IP "CURLE_SSL_CACERT (60)"
|
||||
Peer certificate cannot be authenticated with known CA certificates
|
||||
Peer certificate cannot be authenticated with known CA certificates.
|
||||
.IP "CURLE_BAD_CONTENT_ENCODING (61)"
|
||||
Unrecognized transfer encoding
|
||||
Unrecognized transfer encoding.
|
||||
.IP "CURLE_LDAP_INVALID_URL (62)"
|
||||
Invalid LDAP URL
|
||||
Invalid LDAP URL.
|
||||
.IP "CURLE_FILESIZE_EXCEEDED (63)"
|
||||
Maximum file size exceeded
|
||||
Maximum file size exceeded.
|
||||
.IP "CURLE_USE_SSL_FAILED (64)"
|
||||
Requested FTP SSL level failed
|
||||
Requested FTP SSL level failed.
|
||||
.IP "CURLE_SEND_FAIL_REWIND (65)"
|
||||
When doing a send operation curl had to rewind the data to retransmit, but the
|
||||
rewinding operation failed
|
||||
rewinding operation failed.
|
||||
.IP "CURLE_SSL_ENGINE_INITFAILED (66)"
|
||||
Initiating the SSL Engine failed
|
||||
Initiating the SSL Engine failed.
|
||||
.IP "CURLE_LOGIN_DENIED (67)"
|
||||
The remote server denied curl to login (Added in 7.13.1)
|
||||
.IP "CURLE_TFTP_NOTFOUND (68)"
|
||||
File not found on TFTP server
|
||||
File not found on TFTP server.
|
||||
.IP "CURLE_TFTP_PERM (69)"
|
||||
Permission problem on TFTP server
|
||||
Permission problem on TFTP server.
|
||||
.IP "CURLE_REMOTE_DISK_FULL (70)"
|
||||
Out of disk space on the server
|
||||
Out of disk space on the server.
|
||||
.IP "CURLE_TFTP_ILLEGAL (71)"
|
||||
Illegal TFTP operation
|
||||
Illegal TFTP operation.
|
||||
.IP "CURLE_TFTP_UNKNOWNID (72)"
|
||||
Unknown TFTP transfer ID
|
||||
Unknown TFTP transfer ID.
|
||||
.IP "CURLE_REMOTE_FILE_EXISTS (73)"
|
||||
File already exists and will not be overwritten
|
||||
File already exists and will not be overwritten.
|
||||
.IP "CURLE_TFTP_NOSUCHUSER (74)"
|
||||
This error should never be returned by a properly functioning TFTP server
|
||||
This error should never be returned by a properly functioning TFTP server.
|
||||
.IP "CURLE_CONV_FAILED (75)"
|
||||
Character conversion failed
|
||||
Character conversion failed.
|
||||
.IP "CURLE_CONV_REQD (76)"
|
||||
Caller must register conversion callbacks
|
||||
Caller must register conversion callbacks.
|
||||
.IP "CURLE_SSL_CACERT_BADFILE (77)"
|
||||
Problem with reading the SSL CA cert (path? access rights?)
|
||||
.IP "CURLE_REMOTE_FILE_NOT_FOUND (78)"
|
||||
The resource referenced in the URL does not exist
|
||||
The resource referenced in the URL does not exist.
|
||||
.IP "CURLE_SSH (79)"
|
||||
An unspecified error occurred during the SSH session
|
||||
An unspecified error occurred during the SSH session.
|
||||
.IP "CURLE_SSL_SHUTDOWN_FAILED (80)"
|
||||
Failed to shut down the SSL connection
|
||||
Failed to shut down the SSL connection.
|
||||
.IP "CURLE_AGAIN (81)"
|
||||
Socket is not ready for send/recv wait till it's ready and try again. This
|
||||
return code is only returned from \fIcurl_easy_recv(3)\fP and
|
||||
@@ -217,7 +217,7 @@ Failed to load CRL file (Added in 7.19.0)
|
||||
.IP "CURLE_SSL_ISSUER_ERROR (83)"
|
||||
Issuer check failed (Added in 7.19.0)
|
||||
.IP "CURLE_OBSOLETE*"
|
||||
These error codes will never be returned. They used to be used in an old libcurl
|
||||
These error codes will never be returned. They were used in an old libcurl
|
||||
version and are currently unused.
|
||||
.SH "CURLMcode"
|
||||
This is the generic return code used by functions in the libcurl multi
|
||||
|
||||
@@ -121,7 +121,7 @@ again (possibly after having altered some options at your own choice).
|
||||
.SH "MULTI_SOCKET"
|
||||
Since 7.16.0, the \fIcurl_multi_socket(3)\fP function offers a way for
|
||||
applications to not only avoid being forced to use select(), but it also
|
||||
offers a much more high-performing API that will make a significant difference
|
||||
offers a much more high-performance API that will make a significant difference
|
||||
for applications using large numbers of simultaneous connections.
|
||||
|
||||
\fIcurl_multi_socket(3)\fP (and \fIcurl_multi_socket_all(3)\fP) is then used
|
||||
|
||||
@@ -36,7 +36,7 @@ What will be generally referred to as 'the program' will be the collected
|
||||
source code that you write that is using libcurl for transfers. The program
|
||||
is outside libcurl and libcurl is outside of the program.
|
||||
|
||||
To get the more details on all options and functions described herein, please
|
||||
To get more details on all options and functions described herein, please
|
||||
refer to their respective man pages.
|
||||
|
||||
.SH "Building"
|
||||
@@ -72,8 +72,8 @@ if an installed libcurl has been built with SSL support enabled, use
|
||||
$ curl-config --feature
|
||||
|
||||
And if SSL is supported, the keyword 'SSL' will be written to stdout,
|
||||
possibly together with a few other features that can be on and off on
|
||||
different libcurls.
|
||||
possibly together with a few other features that could be either on or off on
|
||||
for different libcurls.
|
||||
|
||||
See also the "Features libcurl Provides" further down.
|
||||
.IP "autoconf macro"
|
||||
@@ -87,7 +87,7 @@ The people behind libcurl have put a considerable effort to make libcurl work
|
||||
on a large amount of different operating systems and environments.
|
||||
|
||||
You program libcurl the same way on all platforms that libcurl runs on. There
|
||||
are only very few minor considerations that differs. If you just make sure to
|
||||
are only very few minor considerations that differ. If you just make sure to
|
||||
write your code portable enough, you may very well create yourself a very
|
||||
portable program. libcurl shouldn't stop you from that.
|
||||
|
||||
@@ -113,7 +113,7 @@ should not tell libcurl to do this as well.
|
||||
.IP CURL_GLOBAL_SSL
|
||||
which only does anything on libcurls compiled and built SSL-enabled. On these
|
||||
systems, this will make libcurl initialize the SSL library properly for this
|
||||
application. This is only needed to do once for each application so if your
|
||||
application. This only needs to be done once for each application so if your
|
||||
program or another library already does this, this bit should not be needed.
|
||||
.RE
|
||||
|
||||
@@ -191,8 +191,8 @@ similar to this:
|
||||
|
||||
curl_easy_setopt(easyhandle, CURLOPT_WRITEFUNCTION, write_data);
|
||||
|
||||
You can control what data your function get in the forth argument by setting
|
||||
another property:
|
||||
You can control what data your callback function gets in the fourth argument
|
||||
by setting another property:
|
||||
|
||||
curl_easy_setopt(easyhandle, CURLOPT_WRITEDATA, &internal_struct);
|
||||
|
||||
@@ -256,7 +256,7 @@ one thread at a time.
|
||||
|
||||
libcurl is completely thread safe, except for two issues: signals and SSL/TLS
|
||||
handlers. Signals are used for timing out name resolves (during DNS lookup) -
|
||||
when built without c-ares support and not on Windows..
|
||||
when built without c-ares support and not on Windows.
|
||||
|
||||
If you are accessing HTTPS or FTPS URLs in a multi-threaded manner, you are
|
||||
then of course using the underlying SSL library multi-threaded and those libs
|
||||
@@ -274,19 +274,18 @@ GnuTLS
|
||||
|
||||
NSS
|
||||
|
||||
is claimed to be thread-safe already without anything required
|
||||
is claimed to be thread-safe already without anything required.
|
||||
|
||||
yassl
|
||||
|
||||
Required actions unknown
|
||||
Required actions unknown.
|
||||
|
||||
When using multiple threads you should set the CURLOPT_NOSIGNAL option to 1
|
||||
for all handles. Everything will or might work fine except that timeouts are
|
||||
not honored during the DNS lookup - which you can work around by building
|
||||
libcurl with c-ares support. c-ares is a library that provides asynchronous
|
||||
name resolves. Unfortunately, c-ares does not yet fully support IPv6. On some
|
||||
platforms, libcurl simply will not function properly multi-threaded unless
|
||||
this option is set.
|
||||
name resolves. On some platforms, libcurl simply will not function properly
|
||||
multi-threaded unless this option is set.
|
||||
|
||||
Also, note that CURLOPT_DNS_USE_GLOBAL_CACHE is not thread-safe.
|
||||
|
||||
@@ -304,9 +303,9 @@ received output to study is also a clever way to get a better understanding
|
||||
why the server behaves the way it does. Include headers in the normal body
|
||||
output with CURLOPT_HEADER set 1.
|
||||
|
||||
Of course there are bugs left. We need to get to know about them to be able
|
||||
Of course, there are bugs left. We need to know about them to be able
|
||||
to fix them, so we're quite dependent on your bug reports! When you do report
|
||||
suspected bugs in libcurl, please include as much details you possibly can: a
|
||||
suspected bugs in libcurl, please include as many details as you possibly can: a
|
||||
protocol dump that CURLOPT_VERBOSE produces, library version, as much as
|
||||
possible of your code that uses libcurl, operating system name and version,
|
||||
compiler name and version etc.
|
||||
@@ -425,11 +424,11 @@ To pass the known private key password to libcurl:
|
||||
The previous chapter showed how to set user name and password for getting
|
||||
URLs that require authentication. When using the HTTP protocol, there are
|
||||
many different ways a client can provide those credentials to the server and
|
||||
you can control what way libcurl will (attempt to) use. The default HTTP
|
||||
you can control which way libcurl will (attempt to) use them. The default HTTP
|
||||
authentication method is called 'Basic', which is sending the name and
|
||||
password in clear-text in the HTTP request, base64-encoded. This is insecure.
|
||||
|
||||
At the time of this writing libcurl can be built to use: Basic, Digest, NTLM,
|
||||
At the time of this writing, libcurl can be built to use: Basic, Digest, NTLM,
|
||||
Negotiate, GSS-Negotiate and SPNEGO. You can tell libcurl which one to use
|
||||
with CURLOPT_HTTPAUTH as in:
|
||||
|
||||
@@ -476,7 +475,7 @@ CURLOPT_POSTFIELDS, this automatically switches the handle to use POST in the
|
||||
upcoming request.
|
||||
|
||||
Ok, so what if you want to post binary data that also requires you to set the
|
||||
Content-Type: header of the post? Well, binary posts prevents libcurl from
|
||||
Content-Type: header of the post? Well, binary posts prevent libcurl from
|
||||
being able to do strlen() on the data to figure out the size, so therefore we
|
||||
must tell libcurl the size of the post data. Setting headers in libcurl
|
||||
requests are done in a generic way, by building a list of our own headers and
|
||||
@@ -503,7 +502,7 @@ then passing that list to libcurl.
|
||||
While the simple examples above cover the majority of all cases where HTTP
|
||||
POST operations are required, they don't do multi-part formposts. Multi-part
|
||||
formposts were introduced as a better way to post (possibly large) binary data
|
||||
and was first documented in the RFC1867. They're called multi-part because
|
||||
and were first documented in the RFC1867. They're called multi-part because
|
||||
they're built by a chain of parts, each being a single unit. Each part has its
|
||||
own name and contents. You can in fact create and post a multi-part formpost
|
||||
with the regular libcurl POST support described above, but that would require
|
||||
@@ -512,7 +511,7 @@ easier, libcurl provides \fIcurl_formadd(3)\fP. Using this function, you add
|
||||
parts to the form. When you're done adding parts, you post the whole form.
|
||||
|
||||
The following example sets two simple text parts with plain textual contents,
|
||||
and then a file with binary contents and upload the whole thing.
|
||||
and then a file with binary contents and uploads the whole thing.
|
||||
|
||||
.nf
|
||||
struct curl_httppost *post=NULL;
|
||||
@@ -541,7 +540,7 @@ headers. It means that each one of these separate parts get a few headers set
|
||||
that describe the individual content-type, size etc. To enable your
|
||||
application to handicraft this formpost even more, libcurl allows you to
|
||||
supply your own set of custom headers to such an individual form part. You can
|
||||
of course supply headers to as many parts you like, but this little example
|
||||
of course supply headers to as many parts as you like, but this little example
|
||||
will show how you set headers to one specific part when you add that to the
|
||||
post handle:
|
||||
|
||||
@@ -563,8 +562,8 @@ post handle:
|
||||
|
||||
Since all options on an easyhandle are "sticky", they remain the same until
|
||||
changed even if you do call \fIcurl_easy_perform(3)\fP, you may need to tell
|
||||
curl to go back to a plain GET request if you intend to do such a one as your
|
||||
next request. You force an easyhandle to back to GET by using the
|
||||
curl to go back to a plain GET request if you intend to do one as your
|
||||
next request. You force an easyhandle to go back to GET by using the
|
||||
CURLOPT_HTTPGET option:
|
||||
|
||||
curl_easy_setopt(easyhandle, CURLOPT_HTTPGET, 1L);
|
||||
@@ -575,10 +574,10 @@ doing a POST. It will just make it POST without any data to send!
|
||||
.SH "Showing Progress"
|
||||
|
||||
For historical and traditional reasons, libcurl has a built-in progress meter
|
||||
that can be switched on and then makes it presents a progress meter in your
|
||||
that can be switched on and then makes it present a progress meter in your
|
||||
terminal.
|
||||
|
||||
Switch on the progress meter by, oddly enough, set CURLOPT_NOPROGRESS to
|
||||
Switch on the progress meter by, oddly enough, setting CURLOPT_NOPROGRESS to
|
||||
zero. This option is set to 1 by default.
|
||||
|
||||
For most applications however, the built-in progress meter is useless and
|
||||
@@ -643,7 +642,7 @@ restrictions on what can actually happen. A requested URL that might not be a
|
||||
HTTP URL will be still be passed to the HTTP proxy to deliver back to
|
||||
libcurl. This happens transparently, and an application may not need to
|
||||
know. I say "may", because at times it is very important to understand that
|
||||
all operations over a HTTP proxy is using the HTTP protocol. For example, you
|
||||
all operations over a HTTP proxy use the HTTP protocol. For example, you
|
||||
can't invoke your own custom FTP commands or even proper FTP directory
|
||||
listings.
|
||||
|
||||
@@ -774,7 +773,7 @@ Even if the connection is dropped, all connections involving SSL to the same
|
||||
host again, will benefit from libcurl's session ID cache that drastically
|
||||
reduces re-connection time.
|
||||
|
||||
FTP connections that are kept alive saves a lot of time, as the command-
|
||||
FTP connections that are kept alive save a lot of time, as the command-
|
||||
response round-trips are skipped, and also you don't risk getting blocked
|
||||
without permission to login again like on many FTP servers only allowing N
|
||||
persons to be logged in at the same time.
|
||||
@@ -787,7 +786,7 @@ may also be added in the future.
|
||||
|
||||
Each easy handle will attempt to keep the last few connections alive for a
|
||||
while in case they are to be used again. You can set the size of this "cache"
|
||||
with the CURLOPT_MAXCONNECTS option. Default is 5. It is very seldom any
|
||||
with the CURLOPT_MAXCONNECTS option. Default is 5. There is very seldom any
|
||||
point in changing this value, and if you think of changing this it is often
|
||||
just a matter of thinking again.
|
||||
|
||||
@@ -800,7 +799,7 @@ CURLOPT_FORBID_REUSE to 1.
|
||||
|
||||
.SH "HTTP Headers Used by libcurl"
|
||||
When you use libcurl to do HTTP requests, it'll pass along a series of headers
|
||||
automatically. It might be good for you to know and understand these ones. You
|
||||
automatically. It might be good for you to know and understand these. You
|
||||
can replace or remove them by using the CURLOPT_HTTPHEADER option.
|
||||
|
||||
.IP "Host"
|
||||
@@ -824,7 +823,7 @@ this header.
|
||||
.SH "Customizing Operations"
|
||||
There is an ongoing development today where more and more protocols are built
|
||||
upon HTTP for transport. This has obvious benefits as HTTP is a tested and
|
||||
reliable protocol that is widely deployed and have excellent proxy-support.
|
||||
reliable protocol that is widely deployed and has excellent proxy-support.
|
||||
|
||||
When you use one of these protocols, and even when doing other kinds of
|
||||
programming you may need to change the traditional HTTP (or FTP or...)
|
||||
@@ -840,14 +839,14 @@ for you. It is very simple to use:
|
||||
curl_easy_setopt(easyhandle, CURLOPT_CUSTOMREQUEST, "MYOWNRUQUEST");
|
||||
|
||||
When using the custom request, you change the request keyword of the actual
|
||||
request you are performing. Thus, by default you make GET request but you can
|
||||
request you are performing. Thus, by default you make a GET request but you can
|
||||
also make a POST operation (as described before) and then replace the POST
|
||||
keyword if you want to. You're the boss.
|
||||
|
||||
.IP "Modify Headers"
|
||||
HTTP-like protocols pass a series of headers to the server when doing the
|
||||
request, and you're free to pass any amount of extra headers that you
|
||||
think fit. Adding headers are this easy:
|
||||
think fit. Adding headers is this easy:
|
||||
|
||||
.nf
|
||||
struct curl_slist *headers=NULL; /* init to NULL is important */
|
||||
@@ -874,8 +873,8 @@ replace them by simply setting them too:
|
||||
|
||||
.IP "Delete Headers"
|
||||
If you replace an existing header with one with no contents, you will prevent
|
||||
the header from being sent. Like if you want to completely prevent the
|
||||
\&"Accept:" header to be sent, you can disable it with code similar to this:
|
||||
the header from being sent. For instance, if you want to completely prevent the
|
||||
\&"Accept:" header from being sent, you can disable it with code similar to this:
|
||||
|
||||
headers = curl_slist_append(headers, "Accept:");
|
||||
|
||||
@@ -894,7 +893,7 @@ data size is unknown.
|
||||
.IP "HTTP Version"
|
||||
|
||||
All HTTP requests includes the version number to tell the server which version
|
||||
we support. libcurl speak HTTP 1.1 by default. Some very old servers don't
|
||||
we support. libcurl speaks HTTP 1.1 by default. Some very old servers don't
|
||||
like getting 1.1-requests and when dealing with stubborn old things like that,
|
||||
you can tell libcurl to use 1.0 instead by doing something like this:
|
||||
|
||||
@@ -903,12 +902,12 @@ you can tell libcurl to use 1.0 instead by doing something like this:
|
||||
.IP "FTP Custom Commands"
|
||||
|
||||
Not all protocols are HTTP-like, and thus the above may not help you when
|
||||
you want to make for example your FTP transfers to behave differently.
|
||||
you want to make, for example, your FTP transfers to behave differently.
|
||||
|
||||
Sending custom commands to a FTP server means that you need to send the
|
||||
commands exactly as the FTP server expects them (RFC959 is a good guide
|
||||
here), and you can only use commands that work on the control-connection
|
||||
alone. All kinds of commands that requires data interchange and thus needs
|
||||
alone. All kinds of commands that require data interchange and thus need
|
||||
a data-connection must be left to libcurl's own judgment. Also be aware
|
||||
that libcurl will do its very best to change directory to the target
|
||||
directory before doing any transfer, so if you change directory (with CWD
|
||||
@@ -948,7 +947,7 @@ combine with CURLOPT_NOBODY. If this option is set, no actual file content
|
||||
transfer will be performed.
|
||||
|
||||
.IP "FTP Custom CUSTOMREQUEST"
|
||||
If you do what list the contents of a FTP directory using your own defined FTP
|
||||
If you do want to list the contents of a FTP directory using your own defined FTP
|
||||
command, CURLOPT_CUSTOMREQUEST will do just that. "NLST" is the default one
|
||||
for listing directories but you're free to pass in your idea of a good
|
||||
alternative.
|
||||
@@ -960,7 +959,7 @@ subsequent request to the server that matches the particular conditions
|
||||
set. The conditions include that the domain name and path match and that the
|
||||
cookie hasn't become too old.
|
||||
|
||||
In real-world cases, servers send new cookies to replace existing one to
|
||||
In real-world cases, servers send new cookies to replace existing ones to
|
||||
update them. Server use cookies to "track" users and to keep "sessions".
|
||||
|
||||
Cookies are sent from server to clients with the header Set-Cookie: and
|
||||
@@ -973,11 +972,11 @@ to set a cookie string like this:
|
||||
|
||||
In many cases, that is not enough. You might want to dynamically save
|
||||
whatever cookies the remote server passes to you, and make sure those cookies
|
||||
are then use accordingly on later requests.
|
||||
are then used accordingly on later requests.
|
||||
|
||||
One way to do this, is to save all headers you receive in a plain file and
|
||||
when you make a request, you tell libcurl to read the previous headers to
|
||||
figure out which cookies to use. Set header file to read cookies from with
|
||||
figure out which cookies to use. Set the header file to read cookies from with
|
||||
CURLOPT_COOKIEFILE.
|
||||
|
||||
The CURLOPT_COOKIEFILE option also automatically enables the cookie parser in
|
||||
@@ -986,20 +985,20 @@ understand incoming cookies and they will just be ignored. However, when the
|
||||
parser is enabled the cookies will be understood and the cookies will be kept
|
||||
in memory and used properly in subsequent requests when the same handle is
|
||||
used. Many times this is enough, and you may not have to save the cookies to
|
||||
disk at all. Note that the file you specify to CURLOPT_COOKIEFILE doesn't
|
||||
have to exist to enable the parser, so a common way to just enable the parser
|
||||
and not read able might be to use a file name you know doesn't exist.
|
||||
disk at all. Note that the file you specify to CURLOPT_COOKIEFILE doesn't have
|
||||
to exist to enable the parser, so a common way to just enable the parser and
|
||||
not read any cookies is to use the name of a file you know doesn't exist.
|
||||
|
||||
If you rather use existing cookies that you've previously received with your
|
||||
Netscape or Mozilla browsers, you can make libcurl use that cookie file as
|
||||
input. The CURLOPT_COOKIEFILE is used for that too, as libcurl will
|
||||
If you would rather use existing cookies that you've previously received with
|
||||
your Netscape or Mozilla browsers, you can make libcurl use that cookie file
|
||||
as input. The CURLOPT_COOKIEFILE is used for that too, as libcurl will
|
||||
automatically find out what kind of file it is and act accordingly.
|
||||
|
||||
The perhaps most advanced cookie operation libcurl offers, is saving the
|
||||
Perhaps the most advanced cookie operation libcurl offers, is saving the
|
||||
entire internal cookie state back into a Netscape/Mozilla formatted cookie
|
||||
file. We call that the cookie-jar. When you set a file name with
|
||||
CURLOPT_COOKIEJAR, that file name will be created and all received cookies
|
||||
will be stored in it when \fIcurl_easy_cleanup(3)\fP is called. This enabled
|
||||
will be stored in it when \fIcurl_easy_cleanup(3)\fP is called. This enables
|
||||
cookies to get passed on properly between multiple handles without any
|
||||
information getting lost.
|
||||
|
||||
@@ -1007,7 +1006,7 @@ information getting lost.
|
||||
|
||||
FTP transfers use a second TCP/IP connection for the data transfer. This is
|
||||
usually a fact you can forget and ignore but at times this fact will come
|
||||
back to haunt you. libcurl offers several different ways to custom how the
|
||||
back to haunt you. libcurl offers several different ways to customize how the
|
||||
second connection is being made.
|
||||
|
||||
libcurl can either connect to the server a second time or tell the server to
|
||||
@@ -1094,19 +1093,17 @@ Many of the protocols libcurl supports send name and password unencrypted as
|
||||
clear text (HTTP Basic authentication, FTP, TELNET etc). It is very easy for
|
||||
anyone on your network or a network nearby yours, to just fire up a network
|
||||
analyzer tool and eavesdrop on your passwords. Don't let the fact that HTTP
|
||||
uses base64 encoded passwords fool you. They may not look readable at a first
|
||||
glance, but they very easily "deciphered" by anyone within seconds.
|
||||
|
||||
To avoid this problem, use protocols that don't let snoopers see your
|
||||
password: HTTPS, FTPS and FTP-kerberos are a few examples. HTTP Digest
|
||||
authentication allows this too, but isn't supported by libcurl as of this
|
||||
writing.
|
||||
Basic uses base64 encoded passwords fool you. They may not look readable at a
|
||||
first glance, but they very easily "deciphered" by anyone within seconds.
|
||||
|
||||
To avoid this problem, use HTTP athentication methods or other protocols that
|
||||
don't let snoopers see your password: HTTP with Digest, NTLM or GSS
|
||||
authentication, HTTPS, FTPS, SCP, SFTP and FTP-kerberos are a few examples.
|
||||
.IP "Showing What You Do"
|
||||
On a related issue, be aware that even in situations like when you have
|
||||
problems with libcurl and ask someone for help, everything you reveal in order
|
||||
to get best possible help might also impose certain security related
|
||||
risks. Host names, user names, paths, operating system specifics etc (not to
|
||||
risks. Host names, user names, paths, operating system specifics, etc (not to
|
||||
mention passwords of course) may in fact be used by intruders to gain
|
||||
additional information of a potential target.
|
||||
|
||||
@@ -1117,10 +1114,10 @@ information with faked data.
|
||||
.SH "Multiple Transfers Using the multi Interface"
|
||||
|
||||
The easy interface as described in detail in this document is a synchronous
|
||||
interface that transfers one file at a time and doesn't return until its
|
||||
interface that transfers one file at a time and doesn't return until it is
|
||||
done.
|
||||
|
||||
The multi interface on the other hand, allows your program to transfer
|
||||
The multi interface, on the other hand, allows your program to transfer
|
||||
multiple files in both directions at the same time, without forcing you
|
||||
to use multiple threads. The name might make it seem that the multi
|
||||
interface is for multi-threaded programs, but the truth is almost the
|
||||
@@ -1132,7 +1129,7 @@ synchronizing many threads.
|
||||
|
||||
To use this interface, you are better off if you first understand the basics
|
||||
of how to use the easy interface. The multi interface is simply a way to make
|
||||
multiple transfers at the same time by adding up multiple easy handles in to
|
||||
multiple transfers at the same time by adding up multiple easy handles into
|
||||
a "multi stack".
|
||||
|
||||
You create the easy handles you want and you set all the options just like you
|
||||
@@ -1141,7 +1138,7 @@ have been told above, and then you create a multi handle with
|
||||
with \fIcurl_multi_add_handle(3)\fP.
|
||||
|
||||
When you've added the handles you have for the moment (you can still add new
|
||||
ones at any time), you start the transfers by call
|
||||
ones at any time), you start the transfers by calling
|
||||
\fIcurl_multi_perform(3)\fP.
|
||||
|
||||
\fIcurl_multi_perform(3)\fP is asynchronous. It will only execute as little as
|
||||
@@ -1160,7 +1157,7 @@ with the particular file descriptors libcurl uses for the moment.
|
||||
When you then call select(), it'll return when one of the file handles signal
|
||||
action and you then call \fIcurl_multi_perform(3)\fP to allow libcurl to do
|
||||
what it wants to do. Take note that libcurl does also feature some time-out
|
||||
code so we advice you to never use very long timeouts on select() before you
|
||||
code so we advise you to never use very long timeouts on select() before you
|
||||
call \fIcurl_multi_perform(3)\fP, which thus should be called unconditionally
|
||||
every now and then even if none of its file descriptors have signaled
|
||||
ready. Another precaution you should use: always call
|
||||
@@ -1191,7 +1188,7 @@ to figure out success on each individual transfer.
|
||||
|
||||
.IP "[1]"
|
||||
libcurl 7.10.3 and later have the ability to switch over to chunked
|
||||
Transfer-Encoding in cases were HTTP uploads are done with data of an unknown
|
||||
Transfer-Encoding in cases where HTTP uploads are done with data of an unknown
|
||||
size.
|
||||
.IP "[2]"
|
||||
This happens on Windows machines when libcurl is built and used as a
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
.SH NAME
|
||||
libcurl \- client-side URL transfers
|
||||
.SH DESCRIPTION
|
||||
This is an short overview on how to use libcurl in your C programs. There are
|
||||
This is a short overview on how to use libcurl in your C programs. There are
|
||||
specific man pages for each function mentioned in here. There are also the
|
||||
\fIlibcurl-easy(3)\fP man page, the \fIlibcurl-multi(3)\fP man page, the
|
||||
\fIlibcurl-share(3)\fP man page and the \fIlibcurl-tutorial(3)\fP man page for
|
||||
@@ -25,14 +25,14 @@ the option of using the "easy" interface, or the "multi" interface.
|
||||
|
||||
The easy interface is a synchronous interface with which you call
|
||||
\fIcurl_easy_perform(3)\fP and let it perform the transfer. When it is
|
||||
completed, the function return and you can continue. More details are found in
|
||||
completed, the function returns and you can continue. More details are found in
|
||||
the \fIlibcurl-easy(3)\fP man page.
|
||||
|
||||
The multi interface on the other hand is an asynchronous interface, that you
|
||||
call and that performs only a little piece of the transfer on each invoke. It
|
||||
is perfect if you want to do things while the transfer is in progress, or
|
||||
similar. The multi interface allows you to select() on libcurl action, and
|
||||
even to easily download multiple files simultaneously using a single thread. See further deails in the \fIlibcurl-multi(3)\fP man page.
|
||||
even to easily download multiple files simultaneously using a single thread. See further details in the \fIlibcurl-multi(3)\fP man page.
|
||||
|
||||
You can have multiple easy handles share certain data, even if they are used
|
||||
in different threads. This magic is setup using the share interface, as
|
||||
@@ -106,7 +106,7 @@ do as many of your file transfers as possible using the same curl handle. When
|
||||
you call \fIcurl_easy_cleanup(3)\fP, all the possibly open connections held by
|
||||
libcurl will be closed and forgotten.
|
||||
|
||||
Note that the options set with \fIcurl_easy_setopt(3)\fP will be used in on
|
||||
Note that the options set with \fIcurl_easy_setopt(3)\fP will be used on
|
||||
every repeated \fIcurl_easy_perform(3)\fP call.
|
||||
|
||||
.SH "GLOBAL CONSTANTS"
|
||||
@@ -161,7 +161,7 @@ and has a place to call the libcurl functions. Note that if multiple
|
||||
modules in the program use libcurl, they all will separately call the
|
||||
libcurl functions, and that's OK because only the first
|
||||
\fIcurl_global_init()\fP and the last \fIcurl_global_cleanup()\fP in a
|
||||
program changes anything. (libcurl uses a reference count in static
|
||||
program change anything. (libcurl uses a reference count in static
|
||||
memory).
|
||||
|
||||
In a C++ module, it is common to deal with the global constant
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
#
|
||||
# Build test apps for the Hiper project
|
||||
# During dev at least, we use a static libcurl.
|
||||
#
|
||||
|
||||
LDFLAGS = -lcrypt -lidn -lssl -lcrypto -lz -lresolv -L../ares/.libs \
|
||||
-lcares
|
||||
LIBCURL = -L../lib/.libs/ -lcurl
|
||||
CFLAGS = -I../include -g
|
||||
|
||||
all: shiper hiper hipev ulimiter
|
||||
|
||||
hiper: hiper.o $(LIBCURL)
|
||||
$(CC) -o $@ $< $(LIBCURL) $(LDFLAGS)
|
||||
|
||||
hiper.o: hiper.c
|
||||
$(CC) $(CFLAGS) -c $<
|
||||
|
||||
hipev: hipev.o $(LIBCURL)
|
||||
$(CC) -o $@ $< $(LIBCURL) $(LDFLAGS) -levent
|
||||
|
||||
hipev.o: hipev.c
|
||||
$(CC) $(CFLAGS) -c $<
|
||||
|
||||
shiper: shiper.o $(LIBCURL)
|
||||
$(CC) -o $@ $< $(LIBCURL) $(LDFLAGS)
|
||||
|
||||
shiper.o: shiper.c
|
||||
$(CC) $(CFLAGS) -c $<
|
||||
|
||||
ulimiter: ulimiter.c
|
||||
$(CC) -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -f hiper.o hiper shiper shiper.o *~ ulimiter
|
||||
|
||||
$(LIBCURL):
|
||||
(cd ../lib && make)
|
||||
300
hiper/STATUS
300
hiper/STATUS
@@ -1,300 +0,0 @@
|
||||
Date: January 5, 2006
|
||||
Author: Daniel Stenberg
|
||||
|
||||
Status of project Hiper - high performance libcurl modifications
|
||||
================================================================
|
||||
|
||||
What is Hiper
|
||||
|
||||
You won't find such a description in this document. See
|
||||
http://curl.haxx.se/libcurl/hiper/ for further details.
|
||||
|
||||
Live Progress Info
|
||||
|
||||
During my work, I've posted occational updates on the curl-library mailing
|
||||
list but more importantly done frequent updates of
|
||||
http://curl.haxx.se/libcurl/hiper/schedule.html
|
||||
|
||||
Schedule
|
||||
|
||||
I took time off my regular job during Decemember 2005 and the first week of
|
||||
January 2006 to work on hiper full-time.
|
||||
|
||||
Step 1 - Measure the Existing Solution
|
||||
|
||||
I started full-time work on project Hiper on December 1st 2005. I began by
|
||||
putting together a test application that used the existing API to allow me
|
||||
to properly and with accuracy measure execution and transfer speeds when
|
||||
doing a large amount of transfers.
|
||||
|
||||
I soon discovered that it was impossible to do any sensible measurements by
|
||||
using live and actual URLs since the transfers were too unrelialble and
|
||||
uncontrolled. I then enhanced the current HTTP server in the curl test suite
|
||||
and made that support a large amount of transfers and some extra magic
|
||||
"commands" that would make the server either just sit "idle" or "stream"
|
||||
(continuously sending data in a never-ending stream). I then wrote up two
|
||||
files using the curl test suite file format and by acessing the properly
|
||||
formatted URLs on my localhost the HTTP server would either run "idle" or
|
||||
run "stream".
|
||||
|
||||
Having this working, I patched libcurl to always only recv() a single byte
|
||||
off the network each time, just to make sure that the time spent on reading
|
||||
data is constant and never very long.
|
||||
|
||||
I adjusted the test application (actually called 'hiper') to create Y idle
|
||||
transfers and Z stream transfers, had it run for N seconds and then quit and
|
||||
produce a summary on stdout. Now I got very solid and repeatable results. I
|
||||
started to run repeated tests and save the results when I ran into the
|
||||
dreaded 1024 socket maximum limit.
|
||||
|
||||
One side of the problem is that the fd_set type only allows 1024 file
|
||||
descriptors (on my Linux), which I had to solve by simply making my own type
|
||||
with room for more connections and do ugly typecasts in the code. The other
|
||||
side of the problem is that user applications have a limit imposed by the
|
||||
system on the maximum amount of file descriptors it can have open and I had
|
||||
to work around that by writing a special tool that runs setuid root that
|
||||
increases the limit, downgrades to a normal user again and then run the
|
||||
command line of your choice. This second approach has to be used for both
|
||||
'hiper' and the test HTTP server. (You need to build the HTTP server with
|
||||
CURL_SWS_FORK_ENABLED defined to have it do forks since it isn't desirable
|
||||
to do so when running the normal curl tests.)
|
||||
|
||||
Now I could run my test program without problems. I decided to run the tests
|
||||
with 1 stream connection and a varying amount of idle ones. I did 1001,
|
||||
2001, 3001, 5001 and 9001 connections and measured how long select() and
|
||||
curl_multi_perform() (including the curl_multi_fdset() call) would take in
|
||||
average, over a period of 20 seconds. I ran each test 5-6 times and I used
|
||||
the average time of all the runs.
|
||||
|
||||
The times in number of microseconds:
|
||||
|
||||
Connections multi_perform select
|
||||
1001 3504 951
|
||||
2001 7606 1988
|
||||
3001 11045 2715
|
||||
5001 16406 4024
|
||||
9001 32147 8030
|
||||
|
||||
Test system
|
||||
CPU: Athlon XP 2800
|
||||
RAM: 1 GB
|
||||
Linux: 2.6
|
||||
glibc: 2.3.5
|
||||
libcurl: 7.15.1
|
||||
|
||||
The only reason I stopped at 9001 connections is that my test machine ran
|
||||
out of avaiable memory by then as I ran the test server on the same machine,
|
||||
and I didn't want to risk the test result accuracy by having it start using
|
||||
the swap during the tests.
|
||||
|
||||
It means that at 9000 connections we spend 40ms for each socket action, even
|
||||
when only one socket ever have action.
|
||||
|
||||
With these 32000 microseconds curl_multi_perform() takes for 9000
|
||||
connections, it loops 18000 laps which makes less than 2 microseconds per
|
||||
lap. (Of course counting time/laps is an oversimplification, but anyway.)
|
||||
Hopefully we should achieve less than 10 microseconds for each call to
|
||||
curl_multi_socket() for an active connection.
|
||||
|
||||
The timing graph displayed on the libevent site (duplicated on the hiper
|
||||
project page) suggests that libevent is pretty much fixed at 50 microseconds
|
||||
(although I don't know what test box was used in their testing, we can
|
||||
compare the select()-times from my tests and see that they are at least
|
||||
resonably close).
|
||||
|
||||
Summing up, the current ~40 ms spent at 9000 connections could then possibly
|
||||
be lowered to something around 60 us!
|
||||
|
||||
Step 2 - Implement curl_multi_socket API
|
||||
|
||||
Most of the design decisions and debates about this new API have already
|
||||
been held on the curl-library mailing list a long time ago so I had a basic
|
||||
idea on what approach to use. The main ideas of the new API are simply:
|
||||
|
||||
1 - The application can use whatever event system it likes as it gets info
|
||||
from libcurl about what file descriptors libcurl waits for what action
|
||||
on. (The previous API returns fd_sets which is very select()-centric).
|
||||
|
||||
2 - When the application discovers action on a single socket, it calls
|
||||
libcurl and informs that there was action on this particular socket and
|
||||
libcurl can then act on that socket/transfer only and not care about
|
||||
any other transfers. (The previous API always had to scan through all
|
||||
the existing transfers.)
|
||||
|
||||
The idea is that curl_multi_socket() calls a given callback with information
|
||||
about what socket to wait for what action on, and the callback only gets
|
||||
called if the status of that socket has changed.
|
||||
|
||||
In the API draft from before, we have a timeout argument on a per socket
|
||||
basis and we also allowed curl_multi_socket() to pass in an 'easy handle'
|
||||
instead of socket to allow libcurl to shortcut a lookup and work on the
|
||||
affected easy handle right away. Both these turned out to be bad ideas.
|
||||
|
||||
The timeout argument was removed from the socket callback since after much
|
||||
thinking I came to the conclusion that we really don't want to handle
|
||||
timeouts on a per socket basis. We need it on a per transfer (easy handle)
|
||||
basis and thus we can't provide it in the callbacks in a nice way. Instead,
|
||||
we have to offer a curl_multi_timeout() that returns the largest amount of
|
||||
time we should wait before we call the "timeout action" of libcurl, to
|
||||
trigger the proper internal timeout action on the affected transfer. To get
|
||||
this to work, I added a struct to each easy handle in which we store an
|
||||
"expire time" (if any). The structs are then "splay sorted" so that we can
|
||||
add and remove times from the linked list and yet somewhat swiftly figure
|
||||
out 1 - how long time there is until the next timer expires and 2 - which
|
||||
timer (handle) should we take care of now. Of course, the upside of all this
|
||||
is that we get a curl_multi_timeout() that should also work with old-style
|
||||
applications that use curl_multi_perform().
|
||||
|
||||
The easy handle argument was removed fom the curl_multi_socket() function
|
||||
because having it there would require the application to do a socket to easy
|
||||
handle conversion on its own. I find it very unlikely that applications
|
||||
would want to do that and since libcurl would need such a lookup on its own
|
||||
anyway since we didn't want to force applications to do that translation
|
||||
code (it would be optional), it seemed like an unnecessary option. I also
|
||||
realized that when we use underlying libraries such as c-ares (for DNS
|
||||
asynch resolving) there might in fact be more than one transfer waiting for
|
||||
action on the same socket and thus it makes the lookup even tricker and even
|
||||
less likely to ever get done by applications. Instead I created an internal
|
||||
"socket to easy handles" hash table that given a socket (file descriptor)
|
||||
returns a list of easy handles that waits for some action on that socket.
|
||||
|
||||
To make libcurl be able to report plain sockets in the socket callback, I
|
||||
had to re-organize the internals of the curl_multi_fdset() etc so that the
|
||||
conversion from sockets to fd_sets for that function is only done in the
|
||||
last step before the data is returned. I also had to extend c-ares to get a
|
||||
function that can return plain sockets, as that library too returned only
|
||||
fd_sets and that is no longer good enough. The changes done to c-ares have
|
||||
been committed and are available in the c-ares CVS repository destined to be
|
||||
included in the upcoming c-ares 1.3.1 release.
|
||||
|
||||
The 'shiper' tool is the test application I wrote that uses the new
|
||||
curl_multi_socket() in its current state. It seems to be working and it uses
|
||||
the API as it is documented and supposed to work. It is still using
|
||||
select(), because I needed that during development (like until I had the
|
||||
socket hash implemented etc) and because I haven't yet learned how to use
|
||||
libevent or similar.
|
||||
|
||||
The hiper/shiper tools are very simple and initiates lots of connections and
|
||||
have them running for the test period and then kills them all.
|
||||
|
||||
Since I wasn't done with the implementation until early January I haven't
|
||||
had time to run very many measurements and checks, but I have done a few
|
||||
runs with up to a few hundred connections (with a single active one). The
|
||||
curl_multi_socket() invoke then takes 3-6 microseconds in average (using the
|
||||
read-only-1-byte-at-a-time hack). If this number does increase a lot when we
|
||||
add connections, it certainly matches my in my opinion very ambitious goal.
|
||||
We are now below the 60 microseconds "per socket action" goal. It is
|
||||
destined to be somewhat higher the more connections we have since the hash
|
||||
table gets more populated and the splay tree will grow etc.
|
||||
|
||||
Some tests at 7000 and 9000 connections showed that the socket hash lookup
|
||||
is somewhat of a bottle neck. Its current implementation may be a bit too
|
||||
limiting. It simply has a fixed-size array, and on each entry in the array
|
||||
it has a linked list with entries. So the hash only checks which list to
|
||||
scan through. The code I had used so for used a list with merely 7 slots (as
|
||||
that is what the DNS hash uses) but with 7000 connections that would make an
|
||||
average of 1000 nodes in each list to run through. I upped that to 97 slots
|
||||
(I believe a prime is suitable) and noticed a significant speed increase. I
|
||||
need to reconsider the hash implementation or use a rather large default
|
||||
value like this. At 9000 connections I was still below 10us per call.
|
||||
|
||||
Status Right Now
|
||||
|
||||
The curl_multi_socket() API is implemented according to how it is
|
||||
documented. The man pages for curl_multi_socket and curl_multi_timeout are
|
||||
both committed to CVS and are available online for easy browsing:
|
||||
|
||||
http://curl.haxx.se/libcurl/c/curl_multi_socket.html
|
||||
http://curl.haxx.se/libcurl/c/curl_multi_timeout.html
|
||||
|
||||
The hiper-5.patch I made available early morning January 5th, 2006 should
|
||||
apply fine on a recent CVS checkout (at the time of this writing curl 7.15.1
|
||||
is the latest public curl release but the hiper patch does not apply fine on
|
||||
that).
|
||||
|
||||
What is Left for the curl_multi_socket API
|
||||
|
||||
1 - More measuring with more extreme number of connections
|
||||
|
||||
2 - More testing with actual URLs and complete from start to end transfers.
|
||||
|
||||
I'm quite sure we don't set expire times all over in the code properly, so
|
||||
there is bound to be some timeout bugs left.
|
||||
|
||||
What it really takes is for me to commit the code and to make an official
|
||||
release with it so that we get people "out there" to help out testing it.
|
||||
|
||||
What is Left for project Hiper
|
||||
|
||||
1 - Add HTTP pipelining support
|
||||
|
||||
2 - Add a zero (or at least close to zero) copy interface
|
||||
|
||||
Neither of these points have been planned or detailed exactly how they will
|
||||
be implemented.
|
||||
|
||||
Roadmap Ahead
|
||||
|
||||
I plan and hope to return to full-time hiper work later on this spring or
|
||||
possibly summer to continue where I pause now. Of course some spare time
|
||||
might also be spent until then to get us moving forward.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
April 11, 2006
|
||||
|
||||
While sitting staring on my screen trying to write up a *nice* sample script
|
||||
using libevent, it strikes me that since libevent is pretty much based around
|
||||
its structs that you setup for each event/file descriptor, my application
|
||||
wants to figure out the correct struct that is associted with the file
|
||||
descriptor that libcurl provides in the socket callback.
|
||||
|
||||
This feels like an operation most applications will need when using the
|
||||
multi_socket API, so it feels like I should better try to figure out a decent
|
||||
way to offer this basic functionality already in libcurl - and the fact that
|
||||
we already have the file descriptors in a hash we can probably just as well
|
||||
extend it somewhat and store some custom pointers as well.
|
||||
|
||||
We need to offer the app a way to set a private pointer to be associated with
|
||||
the particular file descriptor, and then be able to provide that pointer on
|
||||
subsequent callback calls.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
April 20, 2006
|
||||
|
||||
I was wrong when I previously claimed we could have more than one easy handle
|
||||
using the same socket. I've cleaned up and simplified code now to adjust to
|
||||
this.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
July 9, 2006
|
||||
|
||||
TODO: We need to alter how we use c-ares for getting info about its sockets,
|
||||
as c-ares now provides a callback approach very similar to how libcurl is
|
||||
about to work.
|
||||
|
||||
I'm adding a function called curl_multi_assign() that will set a private
|
||||
pointer added to the internal libcurl hash table for the particular socket
|
||||
passed in to this function:
|
||||
|
||||
CURLMcode curl_multi_assign(CURLM *multi_handle,
|
||||
curl_socket_t sockfd,
|
||||
void *sockp);
|
||||
|
||||
'sockp' being a custom pointer set by the application to be associated with
|
||||
this socket. The socket has to be already existing and in-use by libcurl,
|
||||
like having already called the callback telling about its existance.
|
||||
|
||||
The set hashp pointer will then be passed on to the callback in upcoming
|
||||
calls when this same socket is used (in the brand new 'socketp' argument).
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
July 30, 2006
|
||||
|
||||
Shockingly stupid (of me not having realized this before), but we really need
|
||||
to add a 'running_handles' argument to the curl_multi_socket() and
|
||||
curl_multi_socket_all() prototypes so that the caller can get to know when
|
||||
all the transfers are actually done!
|
||||
@@ -1,34 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
# 1) http://randomurl.com/body.php
|
||||
# 2) http://random.yahoo.com/fast/ryl
|
||||
# 3) http://www.uroulette.com/visit
|
||||
|
||||
# 1) very slow, responds with URL in body meta style:
|
||||
# <meta http-equiv="refresh" content="0; url=http://www.webmasterworld.com/forum85/735.htm">
|
||||
|
||||
# 2) Responds with non-HTTP headers like:
|
||||
# Status: 301
|
||||
# Location: http://www.adaptive.net/
|
||||
|
||||
# 3) ordinary 30X code and Location:
|
||||
|
||||
my $url;
|
||||
map { $url .= " http://www.uroulette.com/visit"; } (1 .. 12);
|
||||
|
||||
print $url."\n";
|
||||
|
||||
my $count=0;
|
||||
|
||||
open(DUMP, ">>dump");
|
||||
|
||||
while(1) {
|
||||
my @getit = `curl -si $url`;
|
||||
for my $l (@getit) {
|
||||
if($l =~ /^Location: (.*)/) {
|
||||
print DUMP "$1\n";
|
||||
print STDERR "$count\r";
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
416
hiper/hiper.c
416
hiper/hiper.c
@@ -1,416 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Connect N connections. Z are idle, and X are active. Transfer as fast as
|
||||
* possible.
|
||||
*
|
||||
* Run for a specific amount of time (10 secs for now). Output detailed timing
|
||||
* information.
|
||||
*
|
||||
*/
|
||||
|
||||
/* The maximum number of simultanoues connections/transfers we support */
|
||||
#define NCONNECTIONS 50000
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/poll.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#define MICROSEC 1000000 /* number of microseconds in one second */
|
||||
|
||||
/* The maximum time (in microseconds) we run the test */
|
||||
#define RUN_FOR_THIS_LONG (20*MICROSEC)
|
||||
|
||||
/* Number of loops (seconds) we allow the total download amount and alive
|
||||
connections to remain the same until we bail out. Set this slightly higher
|
||||
when using asynch supported libcurl. */
|
||||
#define IDLE_TIME 10
|
||||
|
||||
struct globalinfo {
|
||||
size_t dlcounter;
|
||||
};
|
||||
|
||||
struct connection {
|
||||
CURL *e;
|
||||
int id; /* just a counter for easy browsing */
|
||||
char *url;
|
||||
size_t dlcounter;
|
||||
struct globalinfo *global;
|
||||
char error[CURL_ERROR_SIZE];
|
||||
};
|
||||
|
||||
/* on port 8999 we run a modified (fork-) sws that supports pure idle and full
|
||||
stream mode */
|
||||
#define PORT "8999"
|
||||
|
||||
#define HOST "192.168.1.13"
|
||||
|
||||
#define URL_IDLE "http://" HOST ":" PORT "/1000"
|
||||
#define URL_ACTIVE "http://" HOST ":" PORT "/1001"
|
||||
|
||||
static size_t
|
||||
writecallback(void *ptr, size_t size, size_t nmemb, void *data)
|
||||
{
|
||||
size_t realsize = size * nmemb;
|
||||
struct connection *c = (struct connection *)data;
|
||||
|
||||
c->dlcounter += realsize;
|
||||
c->global->dlcounter += realsize;
|
||||
|
||||
#if 0
|
||||
printf("%02d: %d, total %d\n",
|
||||
c->id, c->dlcounter, c->global->dlcounter);
|
||||
#endif
|
||||
return realsize;
|
||||
}
|
||||
|
||||
/* return the diff between two timevals, in us */
|
||||
static long tvdiff(struct timeval *newer, struct timeval *older)
|
||||
{
|
||||
return (newer->tv_sec-older->tv_sec)*1000000+
|
||||
(newer->tv_usec-older->tv_usec);
|
||||
}
|
||||
|
||||
|
||||
/* store the start time of the program in this variable */
|
||||
static struct timeval timer;
|
||||
|
||||
static void timer_start(void)
|
||||
{
|
||||
/* capture the time of the start moment */
|
||||
gettimeofday(&timer, NULL);
|
||||
}
|
||||
|
||||
static struct timeval cont; /* at this moment we continued */
|
||||
|
||||
int still_running; /* keep number of running handles */
|
||||
|
||||
struct conncount {
|
||||
long time_us;
|
||||
long laps;
|
||||
long maxtime;
|
||||
};
|
||||
|
||||
static struct timeval timerpause;
|
||||
static void timer_pause(void)
|
||||
{
|
||||
/* capture the time of the pause moment */
|
||||
gettimeofday(&timerpause, NULL);
|
||||
|
||||
/* If we have a previous continue (all times except the first), we can now
|
||||
store the time for a whole "lap" */
|
||||
if(cont.tv_sec) {
|
||||
long lap;
|
||||
|
||||
lap = tvdiff(&timerpause, &cont);
|
||||
}
|
||||
}
|
||||
|
||||
static long paused; /* amount of us we have been pausing */
|
||||
|
||||
static void timer_continue(void)
|
||||
{
|
||||
/* Capture the time of the restored operation moment, now calculate how long
|
||||
time we were paused and added that to the 'paused' variable.
|
||||
*/
|
||||
gettimeofday(&cont, NULL);
|
||||
|
||||
paused += tvdiff(&cont, &timerpause);
|
||||
}
|
||||
|
||||
static long total; /* amount of us from start to stop */
|
||||
static void timer_total(void)
|
||||
{
|
||||
struct timeval stop;
|
||||
/* Capture the time of the operation stopped moment, now calculate how long
|
||||
time we were running and how much of that pausing.
|
||||
*/
|
||||
gettimeofday(&stop, NULL);
|
||||
|
||||
total = tvdiff(&stop, &timer);
|
||||
}
|
||||
|
||||
struct globalinfo info;
|
||||
struct connection *conns;
|
||||
|
||||
long selects;
|
||||
long selectsalive;
|
||||
long timeouts;
|
||||
|
||||
long perform;
|
||||
long performalive;
|
||||
long performselect;
|
||||
long topselect;
|
||||
|
||||
int num_total;
|
||||
int num_idle;
|
||||
int num_active;
|
||||
|
||||
static void report(void)
|
||||
{
|
||||
int i;
|
||||
long active = total - paused;
|
||||
long numdl = 0;
|
||||
|
||||
for(i=0; i < num_total; i++) {
|
||||
if(conns[i].dlcounter)
|
||||
numdl++;
|
||||
}
|
||||
|
||||
printf("Summary from %d simultanoues transfers (%d active)\n",
|
||||
num_total, num_active);
|
||||
printf("%d out of %d connections provided data\n", numdl, num_total);
|
||||
|
||||
printf("Total time: %ldus select(): %ldus curl_multi_perform(): %ldus\n",
|
||||
total, paused, active);
|
||||
|
||||
printf("%d calls to curl_multi_perform() average %d alive "
|
||||
"Average time: %dus\n",
|
||||
perform, performalive/perform, active/perform);
|
||||
|
||||
printf("%d calls to select(), average %d alive "
|
||||
"Average time: %dus\n",
|
||||
selects, selectsalive/selects,
|
||||
paused/selects);
|
||||
printf(" Average number of readable connections per select() return: %d\n",
|
||||
performselect/selects);
|
||||
printf(" Max number of readable connections for a single select() "
|
||||
"return: %d\n",
|
||||
topselect);
|
||||
|
||||
printf("%ld select() timeouts\n", timeouts);
|
||||
|
||||
printf("Downloaded %ld bytes in %ld bytes/sec, %ld usec/byte\n",
|
||||
info.dlcounter,
|
||||
info.dlcounter/(total/1000000),
|
||||
total/info.dlcounter);
|
||||
|
||||
#if 0
|
||||
for(i=1; i< num_total; i++) {
|
||||
if(timecount[i].laps) {
|
||||
printf("Time %d connections, average %ld max %ld (%ld laps) "
|
||||
"average/conn: %ld\n",
|
||||
i,
|
||||
timecount[i].time_us/timecount[i].laps,
|
||||
timecount[i].maxtime,
|
||||
timecount[i].laps,
|
||||
(timecount[i].time_us/timecount[i].laps)/i );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
struct ourfdset {
|
||||
char fdbuffer[NCONNECTIONS/8];
|
||||
};
|
||||
#define FD2_ZERO(x) FD_ZERO((fd_set *)x)
|
||||
|
||||
typedef struct ourfdset fd2_set;
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
CURLM *multi_handle;
|
||||
CURLMsg *msg;
|
||||
CURLcode code = CURLE_OK;
|
||||
CURLMcode mcode = CURLM_OK;
|
||||
int rc;
|
||||
int i;
|
||||
|
||||
int prevalive=-1;
|
||||
int prevsamecounter=0;
|
||||
int prevtotal = -1;
|
||||
fd2_set fdsizecheck;
|
||||
int selectmaxamount;
|
||||
|
||||
memset(&info, 0, sizeof(struct globalinfo));
|
||||
|
||||
selectmaxamount = sizeof(fdsizecheck) * 8;
|
||||
printf("select() supports max %d connections\n", selectmaxamount);
|
||||
|
||||
if(argc < 3) {
|
||||
printf("Usage: hiper [num idle] [num active]\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
num_idle = atoi(argv[1]);
|
||||
num_active = atoi(argv[2]);
|
||||
|
||||
num_total = num_idle + num_active;
|
||||
|
||||
if(num_total > selectmaxamount) {
|
||||
printf("Requested more connections than supported!\n");
|
||||
return 4;
|
||||
}
|
||||
|
||||
conns = calloc(num_total, sizeof(struct connection));
|
||||
if(!conns) {
|
||||
printf("Out of memory\n");
|
||||
return 3;
|
||||
}
|
||||
|
||||
if(num_total >= NCONNECTIONS) {
|
||||
printf("Increase NCONNECTIONS!\n");
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* init the multi stack */
|
||||
multi_handle = curl_multi_init();
|
||||
|
||||
for(i=0; i< num_total; i++) {
|
||||
CURL *e;
|
||||
char *nl;
|
||||
|
||||
memset(&conns[i], 0, sizeof(struct connection));
|
||||
|
||||
if(i < num_idle)
|
||||
conns[i].url = URL_IDLE;
|
||||
else
|
||||
conns[i].url = URL_ACTIVE;
|
||||
|
||||
#if 0
|
||||
printf("%d: Add URL %s\n", i, conns[i].url);
|
||||
#endif
|
||||
e = curl_easy_init();
|
||||
|
||||
if(!e) {
|
||||
printf("curl_easy_init() for handle %d failed, exiting!\n", i);
|
||||
return 2;
|
||||
}
|
||||
|
||||
conns[i].e = e;
|
||||
conns[i].id = i;
|
||||
conns[i].global = &info;
|
||||
|
||||
curl_easy_setopt(e, CURLOPT_URL, conns[i].url);
|
||||
curl_easy_setopt(e, CURLOPT_WRITEFUNCTION, writecallback);
|
||||
curl_easy_setopt(e, CURLOPT_WRITEDATA, &conns[i]);
|
||||
#if 1
|
||||
curl_easy_setopt(e, CURLOPT_VERBOSE, 1);
|
||||
#endif
|
||||
curl_easy_setopt(e, CURLOPT_ERRORBUFFER, conns[i].error);
|
||||
curl_easy_setopt(e, CURLOPT_PRIVATE, &conns[i]);
|
||||
|
||||
/* add the easy to the multi */
|
||||
if(CURLM_OK != curl_multi_add_handle(multi_handle, e)) {
|
||||
printf("curl_multi_add_handle() returned error for %d\n", i);
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
/* we start some action by calling perform right away */
|
||||
while(CURLM_CALL_MULTI_PERFORM ==
|
||||
curl_multi_perform(multi_handle, &still_running));
|
||||
|
||||
printf("Starting timer, expects to run for %ldus\n", RUN_FOR_THIS_LONG);
|
||||
timer_start();
|
||||
|
||||
while(still_running == num_total) {
|
||||
struct timeval timeout;
|
||||
int rc; /* select() return code */
|
||||
long timeout_ms;
|
||||
|
||||
fd2_set fdread;
|
||||
fd2_set fdwrite;
|
||||
fd2_set fdexcep;
|
||||
int maxfd;
|
||||
|
||||
FD2_ZERO(&fdread);
|
||||
FD2_ZERO(&fdwrite);
|
||||
FD2_ZERO(&fdexcep);
|
||||
|
||||
curl_multi_timeout(multi_handle, &timeout_ms);
|
||||
|
||||
/* set timeout to wait */
|
||||
timeout.tv_sec = timeout_ms/1000;
|
||||
timeout.tv_usec = (timeout_ms%1000)*1000;
|
||||
|
||||
/* get file descriptors from the transfers */
|
||||
curl_multi_fdset(multi_handle,
|
||||
(fd_set *)&fdread,
|
||||
(fd_set *)&fdwrite,
|
||||
(fd_set *)&fdexcep, &maxfd);
|
||||
|
||||
timer_pause();
|
||||
selects++;
|
||||
selectsalive += still_running;
|
||||
rc = select(maxfd+1,
|
||||
(fd_set *)&fdread,
|
||||
(fd_set *)&fdwrite,
|
||||
(fd_set *)&fdexcep, &timeout);
|
||||
|
||||
#if 0
|
||||
/* Output this here to make it outside the timer */
|
||||
printf("Running: %d (%d bytes)\n", still_running, info.dlcounter);
|
||||
#endif
|
||||
timer_continue();
|
||||
|
||||
switch(rc) {
|
||||
case -1:
|
||||
/* select error */
|
||||
break;
|
||||
case 0:
|
||||
timeouts++;
|
||||
default:
|
||||
/* timeout or readable/writable sockets */
|
||||
do {
|
||||
perform++;
|
||||
performalive += still_running;
|
||||
}
|
||||
while(CURLM_CALL_MULTI_PERFORM ==
|
||||
curl_multi_perform(multi_handle, &still_running));
|
||||
|
||||
performselect += rc;
|
||||
if(rc > topselect)
|
||||
topselect = rc;
|
||||
break;
|
||||
}
|
||||
|
||||
if(total > RUN_FOR_THIS_LONG) {
|
||||
printf("Stopped after %ldus\n", total);
|
||||
break;
|
||||
}
|
||||
|
||||
if(prevalive != still_running) {
|
||||
printf("%d connections alive\n", still_running);
|
||||
}
|
||||
prevalive = still_running;
|
||||
|
||||
timer_total(); /* calculate the total time spent so far */
|
||||
}
|
||||
|
||||
if(still_running != num_total) {
|
||||
/* something made connections fail, extract the reason and tell */
|
||||
int msgs_left;
|
||||
struct connection *cptr;
|
||||
while ((msg = curl_multi_info_read(multi_handle, &msgs_left))) {
|
||||
if (msg->msg == CURLMSG_DONE) {
|
||||
curl_easy_getinfo(msg->easy_handle, CURLINFO_PRIVATE, &cptr);
|
||||
|
||||
printf("%d => (%d) %s", cptr->id, msg->data.result, cptr->error);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
curl_multi_cleanup(multi_handle);
|
||||
|
||||
/* cleanup all the easy handles */
|
||||
for(i=0; i< num_total; i++)
|
||||
curl_easy_cleanup(conns[i].e);
|
||||
|
||||
report();
|
||||
|
||||
return code;
|
||||
}
|
||||
410
hiper/hipev.c
410
hiper/hipev.c
@@ -1,410 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Connect N connections. Z are idle, and X are active. Transfer as fast as
|
||||
* possible.
|
||||
*
|
||||
* Output detailed timing information.
|
||||
*
|
||||
* Uses libevent.
|
||||
*
|
||||
*/
|
||||
|
||||
/* The maximum number of simultanoues connections/transfers we support */
|
||||
#define NCONNECTIONS 50000
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/poll.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#include <event.h> /* for libevent */
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#define MICROSEC 1000000 /* number of microseconds in one second */
|
||||
|
||||
/* The maximum time (in microseconds) we run the test */
|
||||
#define RUN_FOR_THIS_LONG (5*MICROSEC)
|
||||
|
||||
/* Number of loops (seconds) we allow the total download amount and alive
|
||||
connections to remain the same until we bail out. Set this slightly higher
|
||||
when using asynch supported libcurl. */
|
||||
#define IDLE_TIME 10
|
||||
|
||||
struct globalinfo {
|
||||
size_t dlcounter;
|
||||
};
|
||||
|
||||
struct connection {
|
||||
CURL *e;
|
||||
int id; /* just a counter for easy browsing */
|
||||
char *url;
|
||||
size_t dlcounter;
|
||||
struct globalinfo *global;
|
||||
char error[CURL_ERROR_SIZE];
|
||||
};
|
||||
|
||||
/* this is the struct associated with each file descriptor libcurl tells us
|
||||
it is dealing with */
|
||||
struct fdinfo {
|
||||
/* create a link list of fdinfo structs */
|
||||
struct fdinfo *next;
|
||||
struct fdinfo *prev;
|
||||
curl_socket_t sockfd;
|
||||
CURL *easy;
|
||||
int action; /* as set by libcurl */
|
||||
long timeout; /* as set by libcurl */
|
||||
struct event ev; /* */
|
||||
int evset; /* true if the 'ev' struct has been used in a event_set() call */
|
||||
CURLM *multi; /* pointer to the multi handle */
|
||||
int *running_handles; /* pointer to the running_handles counter */
|
||||
};
|
||||
|
||||
static struct fdinfo *allsocks;
|
||||
|
||||
static int running_handles;
|
||||
|
||||
/* we have the timerevent global so that when the final socket-based event is
|
||||
done, we can remove the timerevent as well */
|
||||
static struct event timerevent;
|
||||
|
||||
static void update_timeout(CURLM *multi_handle);
|
||||
|
||||
/* called from libevent on action on a particular socket ("event") */
|
||||
static void eventcallback(int fd, short type, void *userp)
|
||||
{
|
||||
struct fdinfo *fdp = (struct fdinfo *)userp;
|
||||
CURLMcode rc;
|
||||
|
||||
fprintf(stderr, "EVENT callback type %d\n", type);
|
||||
|
||||
/* tell libcurl to deal with the transfer associated with this socket */
|
||||
do {
|
||||
rc = curl_multi_socket(fdp->multi, fd, fdp->running_handles);
|
||||
} while (rc == CURLM_CALL_MULTI_PERFORM);
|
||||
|
||||
if(rc) {
|
||||
fprintf(stderr, "curl_multi_socket() returned %d\n", (int)rc);
|
||||
}
|
||||
|
||||
fprintf(stderr, "running_handles: %d\n", *fdp->running_handles);
|
||||
if(!*fdp->running_handles) {
|
||||
/* last transfer is complete, kill pending timeout */
|
||||
fprintf(stderr, "last transfer done, kill timeout\n");
|
||||
if(evtimer_pending(&timerevent, NULL))
|
||||
evtimer_del(&timerevent);
|
||||
}
|
||||
else
|
||||
update_timeout(fdp->multi);
|
||||
}
|
||||
|
||||
/* called from libevent when our timer event expires */
|
||||
static void timercallback(int fd, short type, void *userp)
|
||||
{
|
||||
(void)fd; /* not used for this */
|
||||
(void)type; /* ignored in here */
|
||||
CURLM *multi_handle = (CURLM *)userp;
|
||||
int running_handles;
|
||||
CURLMcode rc;
|
||||
|
||||
fprintf(stderr, "EVENT timeout\n");
|
||||
|
||||
/* tell libcurl to deal with the transfer associated with this socket */
|
||||
do {
|
||||
rc = curl_multi_socket(multi_handle, CURL_SOCKET_TIMEOUT,
|
||||
&running_handles);
|
||||
} while (rc == CURLM_CALL_MULTI_PERFORM);
|
||||
|
||||
if(running_handles)
|
||||
/* Get the current timeout value from libcurl and set a new timeout */
|
||||
update_timeout(multi_handle);
|
||||
}
|
||||
|
||||
static void remsock(struct fdinfo *f)
|
||||
{
|
||||
if(!f)
|
||||
/* did not find socket to remove! */
|
||||
return;
|
||||
|
||||
if(f->evset)
|
||||
event_del(&f->ev);
|
||||
|
||||
if(f->prev)
|
||||
f->prev->next = f->next;
|
||||
if(f->next)
|
||||
f->next->prev = f->prev;
|
||||
else
|
||||
/* this was the last entry */
|
||||
allsocks = NULL;
|
||||
}
|
||||
|
||||
static void setsock(struct fdinfo *fdp, curl_socket_t s, CURL *easy,
|
||||
int action)
|
||||
{
|
||||
fdp->sockfd = s;
|
||||
fdp->action = action;
|
||||
fdp->easy = easy;
|
||||
|
||||
if(fdp->evset)
|
||||
/* first remove the existing event if the old setup was used */
|
||||
event_del(&fdp->ev);
|
||||
|
||||
/* now use and add the current socket setup to libevent. The EV_PERSIST is
|
||||
the key here as otherwise libevent will automatically remove the event
|
||||
when it occurs the first time */
|
||||
event_set(&fdp->ev, fdp->sockfd,
|
||||
(action&CURL_POLL_IN?EV_READ:0)|
|
||||
(action&CURL_POLL_OUT?EV_WRITE:0)| EV_PERSIST,
|
||||
eventcallback, fdp);
|
||||
|
||||
fdp->evset=1;
|
||||
|
||||
fprintf(stderr, "event_add() for fd %d\n", s);
|
||||
|
||||
/* We don't use any socket-specific timeout but intead we use a single
|
||||
global one. This is (mostly) because libcurl doesn't expose any
|
||||
particular socket- based timeout value. */
|
||||
event_add(&fdp->ev, NULL);
|
||||
}
|
||||
|
||||
static void addsock(curl_socket_t s, CURL *easy, int action, CURLM *multi)
|
||||
{
|
||||
struct fdinfo *fdp = calloc(sizeof(struct fdinfo), 1);
|
||||
|
||||
fdp->multi = multi;
|
||||
fdp->running_handles = &running_handles;
|
||||
setsock(fdp, s, easy, action);
|
||||
|
||||
if(allsocks) {
|
||||
fdp->next = allsocks;
|
||||
allsocks->prev = fdp;
|
||||
|
||||
/* now set allsocks to point to the new struct */
|
||||
allsocks = fdp;
|
||||
}
|
||||
else
|
||||
allsocks = fdp;
|
||||
|
||||
/* Set this association in libcurl */
|
||||
curl_multi_assign(multi, s, fdp);
|
||||
}
|
||||
|
||||
/* on port 8999 we run a fork enabled sws that supports 'idle' and 'stream' */
|
||||
#define PORT "8999"
|
||||
|
||||
#define HOST "127.0.0.1"
|
||||
|
||||
#define URL_IDLE "http://" HOST ":" PORT "/1000"
|
||||
#if 1
|
||||
#define URL_ACTIVE "http://" HOST ":" PORT "/1001"
|
||||
#else
|
||||
#define URL_ACTIVE "http://localhost/"
|
||||
#endif
|
||||
|
||||
static int socket_callback(CURL *easy, /* easy handle */
|
||||
curl_socket_t s, /* socket */
|
||||
int what, /* see above */
|
||||
void *cbp, /* callback pointer */
|
||||
void *socketp) /* socket pointer */
|
||||
{
|
||||
struct fdinfo *fdp = (struct fdinfo *)socketp;
|
||||
char *whatstr[]={
|
||||
"none",
|
||||
"IN",
|
||||
"OUT",
|
||||
"INOUT",
|
||||
"REMOVE"};
|
||||
|
||||
fprintf(stderr, "socket %d easy %p what %s\n", s, easy,
|
||||
whatstr[what]);
|
||||
|
||||
if(what == CURL_POLL_REMOVE)
|
||||
remsock(fdp);
|
||||
else {
|
||||
if(!fdp) {
|
||||
/* not previously known, add it and set association */
|
||||
printf("Add info for socket %d %s%s\n", s,
|
||||
what&CURL_POLL_IN?"READ":"",
|
||||
what&CURL_POLL_OUT?"WRITE":"" );
|
||||
addsock(s, easy, what, cbp);
|
||||
}
|
||||
else {
|
||||
/* we already know about it, just change action/timeout */
|
||||
printf("Changing info for socket %d from %d to %d\n",
|
||||
s, fdp->action, what);
|
||||
setsock(fdp, s, easy, what);
|
||||
}
|
||||
}
|
||||
return 0; /* return code meaning? */
|
||||
}
|
||||
|
||||
|
||||
static size_t
|
||||
writecallback(void *ptr, size_t size, size_t nmemb, void *data)
|
||||
{
|
||||
size_t realsize = size * nmemb;
|
||||
struct connection *c = (struct connection *)data;
|
||||
(void)ptr;
|
||||
|
||||
c->dlcounter += realsize;
|
||||
c->global->dlcounter += realsize;
|
||||
|
||||
printf("%02d: %d, total %d\n",
|
||||
c->id, c->dlcounter, c->global->dlcounter);
|
||||
|
||||
return realsize;
|
||||
}
|
||||
|
||||
struct globalinfo info;
|
||||
struct connection *conns;
|
||||
|
||||
int num_total;
|
||||
int num_idle;
|
||||
int num_active;
|
||||
|
||||
static void update_timeout(CURLM *multi_handle)
|
||||
{
|
||||
long timeout_ms;
|
||||
struct timeval timeout;
|
||||
|
||||
/* Since we need a global timeout to occur after a given time of inactivity,
|
||||
we use a single timeout-event. Get the timeout value from libcurl, and
|
||||
update it after every call to libcurl. */
|
||||
curl_multi_timeout(multi_handle, &timeout_ms);
|
||||
|
||||
/* convert ms to timeval */
|
||||
timeout.tv_sec = timeout_ms/1000;
|
||||
timeout.tv_usec = (timeout_ms%1000)*1000;
|
||||
evtimer_add(&timerevent, &timeout);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
CURLM *multi_handle;
|
||||
CURLMsg *msg;
|
||||
CURLcode code = CURLE_OK;
|
||||
int i;
|
||||
|
||||
memset(&info, 0, sizeof(struct globalinfo));
|
||||
|
||||
if(argc < 3) {
|
||||
printf("Usage: hiper-event [num idle] [num active]\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
num_idle = atoi(argv[1]);
|
||||
num_active = atoi(argv[2]);
|
||||
|
||||
num_total = num_idle + num_active;
|
||||
|
||||
conns = calloc(num_total, sizeof(struct connection));
|
||||
if(!conns) {
|
||||
printf("Out of memory\n");
|
||||
return 3;
|
||||
}
|
||||
|
||||
if(num_total >= NCONNECTIONS) {
|
||||
printf("Too many connections requested, increase NCONNECTIONS!\n");
|
||||
return 2;
|
||||
}
|
||||
|
||||
event_init(); /* Initalize the event library */
|
||||
|
||||
printf("About to do %d connections\n", num_total);
|
||||
|
||||
/* init the multi stack */
|
||||
multi_handle = curl_multi_init();
|
||||
|
||||
/* initialize the timeout event */
|
||||
evtimer_set(&timerevent, timercallback, multi_handle);
|
||||
|
||||
for(i=0; i< num_total; i++) {
|
||||
CURL *e;
|
||||
|
||||
memset(&conns[i], 0, sizeof(struct connection));
|
||||
|
||||
if(i < num_idle)
|
||||
conns[i].url = URL_IDLE;
|
||||
else
|
||||
conns[i].url = URL_ACTIVE;
|
||||
|
||||
e = curl_easy_init();
|
||||
|
||||
if(!e) {
|
||||
printf("curl_easy_init() for handle %d failed, exiting!\n", i);
|
||||
return 2;
|
||||
}
|
||||
|
||||
conns[i].e = e;
|
||||
conns[i].id = i;
|
||||
conns[i].global = &info;
|
||||
|
||||
curl_easy_setopt(e, CURLOPT_URL, conns[i].url);
|
||||
curl_easy_setopt(e, CURLOPT_WRITEFUNCTION, writecallback);
|
||||
curl_easy_setopt(e, CURLOPT_WRITEDATA, &conns[i]);
|
||||
curl_easy_setopt(e, CURLOPT_VERBOSE, 0);
|
||||
curl_easy_setopt(e, CURLOPT_ERRORBUFFER, conns[i].error);
|
||||
curl_easy_setopt(e, CURLOPT_PRIVATE, &conns[i]);
|
||||
|
||||
/* add the easy to the multi */
|
||||
if(CURLM_OK != curl_multi_add_handle(multi_handle, e)) {
|
||||
printf("curl_multi_add_handle() returned error for %d\n", i);
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
curl_multi_setopt(multi_handle, CURLMOPT_SOCKETFUNCTION, socket_callback);
|
||||
curl_multi_setopt(multi_handle, CURLMOPT_SOCKETDATA, multi_handle);
|
||||
|
||||
/* we start the action by calling *socket_all() */
|
||||
while(CURLM_CALL_MULTI_PERFORM == curl_multi_socket_all(multi_handle,
|
||||
&running_handles));
|
||||
|
||||
/* update timeout */
|
||||
update_timeout(multi_handle);
|
||||
|
||||
/* event_dispatch() runs the event main loop. It ends when no events are
|
||||
left to wait for. */
|
||||
|
||||
event_dispatch();
|
||||
|
||||
{
|
||||
/* something made connections fail, extract the reason and tell */
|
||||
int msgs_left;
|
||||
struct connection *cptr;
|
||||
while ((msg = curl_multi_info_read(multi_handle, &msgs_left))) {
|
||||
if (msg->msg == CURLMSG_DONE) {
|
||||
curl_easy_getinfo(msg->easy_handle, CURLINFO_PRIVATE, &cptr);
|
||||
|
||||
printf("%d => (%d) %s\n",
|
||||
cptr->id, msg->data.result, cptr->error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
curl_multi_cleanup(multi_handle);
|
||||
|
||||
/* cleanup all the easy handles */
|
||||
for(i=0; i< num_total; i++)
|
||||
curl_easy_cleanup(conns[i].e);
|
||||
|
||||
return code;
|
||||
}
|
||||
557
hiper/shiper.c
557
hiper/shiper.c
@@ -1,557 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Connect N connections. Z are idle, and X are active. Transfer as fast as
|
||||
* possible.
|
||||
*
|
||||
* Run for a specific amount of time (10 secs for now). Output detailed timing
|
||||
* information.
|
||||
*
|
||||
* The same is hiper.c but instead using the new *socket() API instead of the
|
||||
* "old" *perform() call.
|
||||
*
|
||||
* Uses a select() approach but only for keeping the code simple and
|
||||
* stand-alone. See hipev.c for a libevent-based example.
|
||||
*
|
||||
*/
|
||||
|
||||
/* The maximum number of simultanoues connections/transfers we support */
|
||||
#define NCONNECTIONS 50000
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/poll.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#define MICROSEC 1000000 /* number of microseconds in one second */
|
||||
|
||||
/* The maximum time (in microseconds) we run the test */
|
||||
#define RUN_FOR_THIS_LONG (5*MICROSEC)
|
||||
|
||||
/* Number of loops (seconds) we allow the total download amount and alive
|
||||
connections to remain the same until we bail out. Set this slightly higher
|
||||
when using asynch supported libcurl. */
|
||||
#define IDLE_TIME 10
|
||||
|
||||
struct ourfdset {
|
||||
/* __fds_bits is what the Linux glibc headers use when they declare the
|
||||
fd_set struct so by using this we can actually avoid the typecase for the
|
||||
FD_SET() macro usage but it would hardly be portable */
|
||||
char __fds_bits[NCONNECTIONS/8];
|
||||
};
|
||||
#define FD2_ZERO(x) memset(x, 0, sizeof(struct ourfdset))
|
||||
|
||||
typedef struct ourfdset fd2_set;
|
||||
|
||||
struct globalinfo {
|
||||
size_t dlcounter;
|
||||
};
|
||||
|
||||
struct connection {
|
||||
CURL *e;
|
||||
int id; /* just a counter for easy browsing */
|
||||
char *url;
|
||||
size_t dlcounter;
|
||||
struct globalinfo *global;
|
||||
char error[CURL_ERROR_SIZE];
|
||||
};
|
||||
|
||||
struct fdinfo {
|
||||
/* create a link list of fdinfo structs */
|
||||
struct fdinfo *next;
|
||||
struct fdinfo *prev;
|
||||
curl_socket_t sockfd;
|
||||
CURL *easy;
|
||||
int action; /* as set by libcurl */
|
||||
long timeout; /* as set by libcurl */
|
||||
};
|
||||
|
||||
static struct fdinfo *allsocks;
|
||||
|
||||
static struct fdinfo *findsock(curl_socket_t s)
|
||||
{
|
||||
/* return the struct for the given socket */
|
||||
struct fdinfo *fdp = allsocks;
|
||||
|
||||
while(fdp) {
|
||||
if(fdp->sockfd == s)
|
||||
break;
|
||||
fdp = fdp->next;
|
||||
}
|
||||
return fdp; /* a struct pointer or NULL */
|
||||
}
|
||||
|
||||
static void remsock(curl_socket_t s)
|
||||
{
|
||||
struct fdinfo *fdp = allsocks;
|
||||
|
||||
while(fdp) {
|
||||
if(fdp->sockfd == s)
|
||||
break;
|
||||
fdp = fdp->next;
|
||||
}
|
||||
if(!fdp)
|
||||
/* did not find socket to remove! */
|
||||
return;
|
||||
|
||||
if(fdp->prev)
|
||||
fdp->prev->next = fdp->next;
|
||||
if(fdp->next)
|
||||
fdp->next->prev = fdp->prev;
|
||||
else
|
||||
/* this was the last entry */
|
||||
allsocks = NULL;
|
||||
}
|
||||
|
||||
static void setsock(struct fdinfo *fdp, curl_socket_t s, CURL *easy,
|
||||
int action)
|
||||
{
|
||||
fdp->sockfd = s;
|
||||
fdp->action = action;
|
||||
fdp->easy = easy;
|
||||
}
|
||||
|
||||
static void addsock(curl_socket_t s, CURL *easy, int action)
|
||||
{
|
||||
struct fdinfo *fdp = calloc(sizeof(struct fdinfo), 1);
|
||||
|
||||
setsock(fdp, s, easy, action);
|
||||
|
||||
if(allsocks) {
|
||||
fdp->next = allsocks;
|
||||
allsocks->prev = fdp;
|
||||
|
||||
/* now set allsocks to point to the new struct */
|
||||
allsocks = fdp;
|
||||
}
|
||||
else
|
||||
allsocks = fdp;
|
||||
}
|
||||
|
||||
static void fdinfo2fdset(fd2_set *fdread, fd2_set *fdwrite, int *maxfd)
|
||||
{
|
||||
struct fdinfo *fdp = allsocks;
|
||||
int writable=0;
|
||||
|
||||
FD2_ZERO(fdread);
|
||||
FD2_ZERO(fdwrite);
|
||||
|
||||
*maxfd = 0;
|
||||
|
||||
#if 0
|
||||
printf("Wait for: ");
|
||||
#endif
|
||||
|
||||
while(fdp) {
|
||||
if(fdp->action & CURL_POLL_IN) {
|
||||
FD_SET(fdp->sockfd, (fd_set *)fdread);
|
||||
}
|
||||
if(fdp->action & CURL_POLL_OUT) {
|
||||
FD_SET(fdp->sockfd, (fd_set *)fdwrite);
|
||||
writable++;
|
||||
}
|
||||
|
||||
#if 0
|
||||
printf("%d (%s%s) ",
|
||||
fdp->sockfd,
|
||||
(fdp->action & CURL_POLL_IN)?"r":"",
|
||||
(fdp->action & CURL_POLL_OUT)?"w":"");
|
||||
#endif
|
||||
|
||||
if(fdp->sockfd > *maxfd)
|
||||
*maxfd = fdp->sockfd;
|
||||
|
||||
fdp = fdp->next;
|
||||
}
|
||||
#if 0
|
||||
if(writable)
|
||||
printf("Check for %d writable sockets\n", writable);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* on port 8999 we run a fork enabled sws that supports 'idle' and 'stream' */
|
||||
#define PORT "8999"
|
||||
|
||||
#define HOST "192.168.1.13"
|
||||
|
||||
#define URL_IDLE "http://" HOST ":" PORT "/1000"
|
||||
#define URL_ACTIVE "http://" HOST ":" PORT "/1001"
|
||||
|
||||
|
||||
static int socket_callback(CURL *easy, /* easy handle */
|
||||
curl_socket_t s, /* socket */
|
||||
int what, /* see above */
|
||||
void *userp) /* "private" pointer */
|
||||
{
|
||||
struct fdinfo *fdp;
|
||||
printf("socket %d easy %p what %d\n", s, easy, what);
|
||||
|
||||
if(what == CURL_POLL_REMOVE)
|
||||
remsock(s);
|
||||
else {
|
||||
fdp = findsock(s);
|
||||
|
||||
if(!fdp) {
|
||||
addsock(s, easy, what);
|
||||
}
|
||||
else {
|
||||
/* we already know about it, just change action/timeout */
|
||||
printf("Changing info for socket %d from %d to %d\n",
|
||||
s, fdp->action, what);
|
||||
setsock(fdp, s, easy, what);
|
||||
}
|
||||
}
|
||||
return 0; /* return code meaning? */
|
||||
}
|
||||
|
||||
|
||||
static size_t
|
||||
writecallback(void *ptr, size_t size, size_t nmemb, void *data)
|
||||
{
|
||||
size_t realsize = size * nmemb;
|
||||
struct connection *c = (struct connection *)data;
|
||||
|
||||
c->dlcounter += realsize;
|
||||
c->global->dlcounter += realsize;
|
||||
|
||||
#if 0
|
||||
printf("%02d: %d, total %d\n",
|
||||
c->id, c->dlcounter, c->global->dlcounter);
|
||||
#endif
|
||||
return realsize;
|
||||
}
|
||||
|
||||
/* return the diff between two timevals, in us */
|
||||
static long tvdiff(struct timeval *newer, struct timeval *older)
|
||||
{
|
||||
return (newer->tv_sec-older->tv_sec)*1000000+
|
||||
(newer->tv_usec-older->tv_usec);
|
||||
}
|
||||
|
||||
|
||||
/* store the start time of the program in this variable */
|
||||
static struct timeval timer;
|
||||
|
||||
static void timer_start(void)
|
||||
{
|
||||
/* capture the time of the start moment */
|
||||
gettimeofday(&timer, NULL);
|
||||
}
|
||||
|
||||
static struct timeval cont; /* at this moment we continued */
|
||||
|
||||
int still_running; /* keep number of running handles */
|
||||
|
||||
struct conncount {
|
||||
long time_us;
|
||||
long laps;
|
||||
long maxtime;
|
||||
};
|
||||
|
||||
static struct timeval timerpause;
|
||||
static void timer_pause(void)
|
||||
{
|
||||
/* capture the time of the pause moment */
|
||||
gettimeofday(&timerpause, NULL);
|
||||
|
||||
/* If we have a previous continue (all times except the first), we can now
|
||||
store the time for a whole "lap" */
|
||||
if(cont.tv_sec) {
|
||||
long lap;
|
||||
|
||||
lap = tvdiff(&timerpause, &cont);
|
||||
}
|
||||
}
|
||||
|
||||
static long paused; /* amount of us we have been pausing */
|
||||
|
||||
static void timer_continue(void)
|
||||
{
|
||||
/* Capture the time of the restored operation moment, now calculate how long
|
||||
time we were paused and added that to the 'paused' variable.
|
||||
*/
|
||||
gettimeofday(&cont, NULL);
|
||||
|
||||
paused += tvdiff(&cont, &timerpause);
|
||||
}
|
||||
|
||||
static long total; /* amount of us from start to stop */
|
||||
static void timer_total(void)
|
||||
{
|
||||
struct timeval stop;
|
||||
/* Capture the time of the operation stopped moment, now calculate how long
|
||||
time we were running and how much of that pausing.
|
||||
*/
|
||||
gettimeofday(&stop, NULL);
|
||||
|
||||
total = tvdiff(&stop, &timer);
|
||||
}
|
||||
|
||||
struct globalinfo info;
|
||||
struct connection *conns;
|
||||
|
||||
long selects;
|
||||
long timeouts;
|
||||
|
||||
long multi_socket;
|
||||
long performalive;
|
||||
long performselect;
|
||||
long topselect;
|
||||
|
||||
int num_total;
|
||||
int num_idle;
|
||||
int num_active;
|
||||
|
||||
static void report(void)
|
||||
{
|
||||
int i;
|
||||
long active = total - paused;
|
||||
long numdl = 0;
|
||||
|
||||
for(i=0; i < num_total; i++) {
|
||||
if(conns[i].dlcounter)
|
||||
numdl++;
|
||||
}
|
||||
|
||||
printf("Summary from %d simultanoues transfers (%d active)\n",
|
||||
num_total, num_active);
|
||||
printf("%d out of %d connections provided data\n", numdl, num_total);
|
||||
|
||||
printf("Total time: %ldus paused: %ldus curl_multi_socket(): %ldus\n",
|
||||
total, paused, active);
|
||||
|
||||
printf("%d calls to select() "
|
||||
"Average time: %dus\n",
|
||||
selects, paused/selects);
|
||||
printf(" Average number of readable connections per select() return: %d\n",
|
||||
performselect/selects);
|
||||
|
||||
printf(" Max number of readable connections for a single select() "
|
||||
"return: %d\n",
|
||||
topselect);
|
||||
|
||||
printf("%ld calls to multi_socket(), "
|
||||
"Average time: %ldus\n",
|
||||
multi_socket, active/multi_socket);
|
||||
|
||||
printf("%ld select() timeouts\n", timeouts);
|
||||
|
||||
printf("Downloaded %ld bytes in %ld bytes/sec, %ld usec/byte\n",
|
||||
info.dlcounter,
|
||||
info.dlcounter/(total/1000000),
|
||||
total/info.dlcounter);
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
CURLM *multi_handle;
|
||||
CURLMsg *msg;
|
||||
CURLcode code = CURLE_OK;
|
||||
CURLMcode mcode = CURLM_OK;
|
||||
int rc;
|
||||
int i;
|
||||
fd2_set fdsizecheck;
|
||||
int selectmaxamount;
|
||||
struct fdinfo *fdp;
|
||||
char act;
|
||||
int running_handles;
|
||||
|
||||
memset(&info, 0, sizeof(struct globalinfo));
|
||||
|
||||
selectmaxamount = sizeof(fdsizecheck) * 8;
|
||||
printf("select() supports max %d connections\n", selectmaxamount);
|
||||
|
||||
if(argc < 3) {
|
||||
printf("Usage: hiper [num idle] [num active]\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
num_idle = atoi(argv[1]);
|
||||
num_active = atoi(argv[2]);
|
||||
|
||||
num_total = num_idle + num_active;
|
||||
|
||||
if(num_total > selectmaxamount) {
|
||||
printf("Requested more connections than supported!\n");
|
||||
return 4;
|
||||
}
|
||||
|
||||
conns = calloc(num_total, sizeof(struct connection));
|
||||
if(!conns) {
|
||||
printf("Out of memory\n");
|
||||
return 3;
|
||||
}
|
||||
|
||||
if(num_total >= NCONNECTIONS) {
|
||||
printf("Too many connections requested, increase NCONNECTIONS!\n");
|
||||
return 2;
|
||||
}
|
||||
|
||||
printf("About to do %d connections\n", num_total);
|
||||
|
||||
/* init the multi stack */
|
||||
multi_handle = curl_multi_init();
|
||||
|
||||
for(i=0; i< num_total; i++) {
|
||||
CURL *e;
|
||||
char *nl;
|
||||
|
||||
memset(&conns[i], 0, sizeof(struct connection));
|
||||
|
||||
if(i < num_idle)
|
||||
conns[i].url = URL_IDLE;
|
||||
else
|
||||
conns[i].url = URL_ACTIVE;
|
||||
|
||||
e = curl_easy_init();
|
||||
|
||||
if(!e) {
|
||||
printf("curl_easy_init() for handle %d failed, exiting!\n", i);
|
||||
return 2;
|
||||
}
|
||||
|
||||
conns[i].e = e;
|
||||
conns[i].id = i;
|
||||
conns[i].global = &info;
|
||||
|
||||
curl_easy_setopt(e, CURLOPT_URL, conns[i].url);
|
||||
curl_easy_setopt(e, CURLOPT_WRITEFUNCTION, writecallback);
|
||||
curl_easy_setopt(e, CURLOPT_WRITEDATA, &conns[i]);
|
||||
curl_easy_setopt(e, CURLOPT_VERBOSE, 0);
|
||||
curl_easy_setopt(e, CURLOPT_ERRORBUFFER, conns[i].error);
|
||||
curl_easy_setopt(e, CURLOPT_PRIVATE, &conns[i]);
|
||||
|
||||
/* add the easy to the multi */
|
||||
if(CURLM_OK != curl_multi_add_handle(multi_handle, e)) {
|
||||
printf("curl_multi_add_handle() returned error for %d\n", i);
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
curl_multi_setopt(multi_handle, CURLMOPT_SOCKETFUNCTION, socket_callback);
|
||||
curl_multi_setopt(multi_handle, CURLMOPT_SOCKETDATA, NULL);
|
||||
|
||||
/* we start the action by calling *socket() right away */
|
||||
while(CURLM_CALL_MULTI_PERFORM == curl_multi_socket_all(multi_handle,
|
||||
&running_handles));
|
||||
|
||||
printf("Starting timer, expects to run for %ldus\n", RUN_FOR_THIS_LONG);
|
||||
timer_start();
|
||||
timer_pause();
|
||||
|
||||
while(1) {
|
||||
struct timeval timeout;
|
||||
int rc; /* select() return code */
|
||||
long timeout_ms;
|
||||
|
||||
fd2_set fdread;
|
||||
fd2_set fdwrite;
|
||||
int maxfd;
|
||||
|
||||
curl_multi_timeout(multi_handle, &timeout_ms);
|
||||
|
||||
/* set timeout to wait */
|
||||
timeout.tv_sec = timeout_ms/1000;
|
||||
timeout.tv_usec = (timeout_ms%1000)*1000;
|
||||
|
||||
/* convert file descriptors from the transfers to fd_sets */
|
||||
fdinfo2fdset(&fdread, &fdwrite, &maxfd);
|
||||
|
||||
selects++;
|
||||
rc = select(maxfd+1,
|
||||
(fd_set *)&fdread,
|
||||
(fd_set *)&fdwrite,
|
||||
NULL, &timeout);
|
||||
switch(rc) {
|
||||
case -1:
|
||||
/* select error */
|
||||
break;
|
||||
case 0:
|
||||
timeouts++;
|
||||
curl_multi_socket(multi_handle, CURL_SOCKET_TIMEOUT, &running_handles);
|
||||
break;
|
||||
|
||||
default:
|
||||
/* timeout or readable/writable sockets */
|
||||
|
||||
for(i=0, fdp = allsocks; fdp; fdp = fdp->next) {
|
||||
act = 0;
|
||||
if((fdp->action & CURL_POLL_IN) &&
|
||||
FD_ISSET(fdp->sockfd, &fdread)) {
|
||||
act |= CURL_POLL_IN;
|
||||
i++;
|
||||
}
|
||||
if((fdp->action & CURL_POLL_OUT) &&
|
||||
FD_ISSET(fdp->sockfd, &fdwrite)) {
|
||||
act |= CURL_POLL_OUT;
|
||||
i++;
|
||||
}
|
||||
|
||||
if(act) {
|
||||
multi_socket++;
|
||||
timer_continue();
|
||||
if(act & CURL_POLL_OUT)
|
||||
act--;
|
||||
curl_multi_socket(multi_handle, fdp->sockfd, &running_handles);
|
||||
timer_pause();
|
||||
}
|
||||
}
|
||||
|
||||
performselect += rc;
|
||||
if(rc > topselect)
|
||||
topselect = rc;
|
||||
break;
|
||||
}
|
||||
|
||||
timer_total(); /* calculate the total time spent so far */
|
||||
|
||||
if(total > RUN_FOR_THIS_LONG) {
|
||||
printf("Stopped after %ldus\n", total);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(still_running != num_total) {
|
||||
/* something made connections fail, extract the reason and tell */
|
||||
int msgs_left;
|
||||
struct connection *cptr;
|
||||
while ((msg = curl_multi_info_read(multi_handle, &msgs_left))) {
|
||||
if (msg->msg == CURLMSG_DONE) {
|
||||
curl_easy_getinfo(msg->easy_handle, CURLINFO_PRIVATE, &cptr);
|
||||
|
||||
printf("%d => (%d) %s", cptr->id, msg->data.result, cptr->error);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
curl_multi_cleanup(multi_handle);
|
||||
|
||||
/* cleanup all the easy handles */
|
||||
for(i=0; i< num_total; i++)
|
||||
curl_easy_cleanup(conns[i].e);
|
||||
|
||||
report();
|
||||
|
||||
return code;
|
||||
}
|
||||
101
hiper/ulimiter.c
101
hiper/ulimiter.c
@@ -1,101 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Little tool to raise the amount of maximum file descriptor and then run the
|
||||
* given command line (using the hard-coded uid/gid).
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <string.h> /* for errno translation */
|
||||
|
||||
/* ulimiter
|
||||
*
|
||||
* Source code inspiration from:
|
||||
* http://www.cs.wisc.edu/condor/condorg/linux_scalability.html
|
||||
*/
|
||||
|
||||
#define UID 1000 /* the user who must run this */
|
||||
|
||||
#define GID 1000 /* group id to run the program as */
|
||||
|
||||
/* Number of open files to increase to */
|
||||
#define NEW_MAX 10000
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int ret;
|
||||
struct rlimit rl;
|
||||
char *brgv[20];
|
||||
int brgc=argc-1;
|
||||
int i;
|
||||
|
||||
for(i=1; i< argc; i++)
|
||||
brgv[i-1]=argv[i];
|
||||
brgv[i-1]=NULL; /* terminate the list */
|
||||
|
||||
if(getuid() != UID) {
|
||||
fprintf(stderr, "Only uid %d is allowed to run this\n", UID);
|
||||
return 1;
|
||||
}
|
||||
|
||||
ret = getrlimit(RLIMIT_NOFILE, &rl);
|
||||
if(ret != 0) {
|
||||
fprintf(stderr, "Unable to read open file limit.\n"
|
||||
"(getrlimit(RLIMIT_NOFILE, &rl) failed)\n"
|
||||
"(%d, %s)", errno, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Limit was %d (max %d), setting to %d\n",
|
||||
rl.rlim_cur, rl.rlim_max, NEW_MAX);
|
||||
|
||||
rl.rlim_cur = rl.rlim_max = NEW_MAX;
|
||||
ret = setrlimit(RLIMIT_NOFILE, &rl);
|
||||
if(ret != 0) {
|
||||
fprintf(stderr, "Unable to set open file limit.\n"
|
||||
"(setrlimit(RLIMIT_NOFILE, &rl) failed)\n"
|
||||
"(%d, %s)", errno, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
||||
ret = getrlimit(RLIMIT_NOFILE, &rl);
|
||||
if(ret != 0) {
|
||||
fprintf(stderr, "Unable to read new open file limit.\n"
|
||||
"(getrlimit(RLIMIT_NOFILE, &rl) failed)\n"
|
||||
"(%d, %s)", errno, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
if(rl.rlim_cur < NEW_MAX) {
|
||||
fprintf(stderr, "Failed to set new open file limit.\n"
|
||||
"Limit is %d, expected %d\n",
|
||||
rl.rlim_cur, NEW_MAX);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(setgid(GID) != 0) {
|
||||
fprintf(stderr, "setgid failed (%d, %s)\n", errno, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
if(setuid(UID) != 0) {
|
||||
fprintf(stderr, "setuid failed (%d, %s)\n", errno, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
||||
ret = execv(brgv[0], brgv);
|
||||
|
||||
fprintf(stderr, "execl returned, failure\n"
|
||||
"returned %d, errno is %d (%s)\n",
|
||||
ret, errno, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
@@ -474,8 +474,9 @@ typedef enum {
|
||||
#define CURLAUTH_DIGEST (1<<1) /* Digest */
|
||||
#define CURLAUTH_GSSNEGOTIATE (1<<2) /* GSS-Negotiate */
|
||||
#define CURLAUTH_NTLM (1<<3) /* NTLM */
|
||||
#define CURLAUTH_ANY ~0 /* all types set */
|
||||
#define CURLAUTH_ANYSAFE (~CURLAUTH_BASIC)
|
||||
#define CURLAUTH_DIGEST_IE (1<<4) /* Digest with IE flavour */
|
||||
#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE) /* all fine types set */
|
||||
#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
|
||||
|
||||
#define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */
|
||||
#define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2009, 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
|
||||
@@ -438,6 +438,32 @@
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* ===================================== */
|
||||
/* SunPro Compilers */
|
||||
/* ===================================== */
|
||||
|
||||
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
# define CURL_TYPEOF_CURL_OFF_T off_t
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# if defined(__amd64) || defined(__sparcv9)
|
||||
# define CURL_SIZEOF_LONG 8
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "lu"
|
||||
# define CURL_FORMAT_OFF_T "%ld"
|
||||
# define CURL_SUFFIX_CURL_OFF_T L
|
||||
# define CURL_SUFFIX_CURL_OFF_TU UL
|
||||
# else
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||
# define CURL_FORMAT_OFF_T "%lld"
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# endif
|
||||
|
||||
/* ===================================== */
|
||||
/* KEEP MSVC THE PENULTIMATE ENTRY */
|
||||
/* ===================================== */
|
||||
@@ -468,7 +494,7 @@
|
||||
/* ===================================== */
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
# if defined(__i386__)
|
||||
# if defined(__i386__) || defined(__ppc__)
|
||||
# define CURL_SIZEOF_LONG 4
|
||||
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||
@@ -477,7 +503,7 @@
|
||||
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||
# elif defined(__x86_64__)
|
||||
# elif defined(__x86_64__) || defined(__ppc64__)
|
||||
# define CURL_SIZEOF_LONG 8
|
||||
# define CURL_TYPEOF_CURL_OFF_T long
|
||||
# define CURL_FORMAT_CURL_OFF_T "ld"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2009, 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
|
||||
@@ -27,7 +27,7 @@
|
||||
a script at release-time. This was made its own header file in 7.11.2 */
|
||||
|
||||
/* This is the global package copyright */
|
||||
#define LIBCURL_COPYRIGHT "1996 - 2008 Daniel Stenberg, <daniel@haxx.se>."
|
||||
#define LIBCURL_COPYRIGHT "1996 - 2009 Daniel Stenberg, <daniel@haxx.se>."
|
||||
|
||||
/* This is the version number of the libcurl package from which this header
|
||||
file origins: */
|
||||
|
||||
@@ -8,7 +8,7 @@ TARGETS = libcurl_wc.dll libcurl_wc_imp.lib libcurl_wc.lib
|
||||
|
||||
CC = wcc386
|
||||
|
||||
CFLAGS = -3r -mf -d3 -hc -zff -zgf -zq -zm -zc -s -fr=con -w2 -fpi -oilrtfm -bt=nt &
|
||||
CFLAGS = -3s -mf -d3 -hc -zff -zgf -zq -zm -zc -s -fr=con -w2 -fpi -oilrtfm -bt=nt &
|
||||
-bd -d+ -dWIN32 -dCURL_CA_BUNDLE=getenv("CURL_CA_BUNDLE") &
|
||||
-dBUILDING_LIBCURL -dHAVE_SPNEGO=1 -dENABLE_IPV6 &
|
||||
-dDEBUG=1 -dCURLDEBUG -d_WIN32_WINNT=0x0501 -dWINBERAPI=__declspec(cdecl) &
|
||||
@@ -17,9 +17,10 @@ CFLAGS = -3r -mf -d3 -hc -zff -zgf -zq -zm -zc -s -fr=con -w2 -fpi -oilrtfm -bt=
|
||||
#
|
||||
# Change to suite.
|
||||
#
|
||||
ZLIB_ROOT = ..\..\..\zlib-1.2.3
|
||||
USE_ZLIB = 0
|
||||
USE_ARES = 0
|
||||
ZLIB_ROOT = ..\..\..\zlib-1.2.3
|
||||
USE_ZLIB = 0
|
||||
USE_ARES = 0
|
||||
USE_WATT32 = 0
|
||||
|
||||
!ifeq USE_ZLIB 1
|
||||
CFLAGS += -dHAVE_ZLIB_H -dHAVE_LIBZ -I$(ZLIB_ROOT)
|
||||
@@ -29,6 +30,10 @@ CFLAGS += -dHAVE_ZLIB_H -dHAVE_LIBZ -I$(ZLIB_ROOT)
|
||||
CFLAGS += -dUSE_ARES -I..\ares
|
||||
!endif
|
||||
|
||||
!ifeq USE_WATT32 1
|
||||
CFLAGS += -dUSE_WATT32 -I$(%watt_root)\inc
|
||||
!endif
|
||||
|
||||
OBJ_BASE = WC_Win32.obj
|
||||
C_ARG = $(OBJ_BASE)\wcc386.arg
|
||||
LINK_ARG = $(OBJ_BASE)\dyn\wlink.arg
|
||||
@@ -121,7 +126,12 @@ $(LINK_ARG): $(__MAKEFILES__)
|
||||
@%append $^@ file { $(OBJS_DYN) }
|
||||
@%append $^@ option quiet, map, caseexact, eliminate, implib=libcurl_wc_imp.lib,
|
||||
@%append $^@ res=$(RESOURCE) libpath $(%watcom)\lib386;$(%watcom)\lib386\nt
|
||||
@%append $^@ library clib3r.lib, wldap32.lib, ws2_32.lib
|
||||
@%append $^@ library clib3s.lib, wldap32.lib
|
||||
!ifeq USE_WATT32 1
|
||||
@%append $^@ library $(%watt_root)\lib\wattcpw_imp.lib
|
||||
!else
|
||||
@%append $^@ library ws2_32.lib
|
||||
!endif
|
||||
!ifeq USE_ZLIB 1
|
||||
@%append $^@ library $(ZLIB_ROOT)\zlib.lib
|
||||
!endif
|
||||
@@ -141,9 +151,9 @@ $(OBJ_DIR)\file.obj: file.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h progress.h sendf.h &
|
||||
escape.h file.h speedcheck.h getinfo.h transfer.h url.h memory.h &
|
||||
parsedate.h ..\include\curl\mprintf.h memdebug.h
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h &
|
||||
progress.h sendf.h escape.h file.h speedcheck.h getinfo.h transfer.h &
|
||||
url.h memory.h parsedate.h ..\include\curl\mprintf.h memdebug.h
|
||||
$(OBJ_DIR)\timeval.obj: timeval.c timeval.h setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h
|
||||
$(OBJ_DIR)\base64.obj: base64.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
@@ -151,111 +161,114 @@ $(OBJ_DIR)\base64.obj: base64.c setup.h config-win32.h ..\include\curl\curlbuild
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h urldata.h cookie.h ..\include\curl\curl.h &
|
||||
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h &
|
||||
easyif.h curl_base64.h memory.h memdebug.h
|
||||
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h &
|
||||
curl_addrinfo.h splay.h easyif.h curl_base64.h memory.h memdebug.h
|
||||
$(OBJ_DIR)\hostip.obj: hostip.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h sendf.h share.h &
|
||||
strerror.h url.h inet_ntop.h ..\include\curl\mprintf.h memory.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
share.h strerror.h url.h inet_ntop.h ..\include\curl\mprintf.h memory.h &
|
||||
memdebug.h
|
||||
$(OBJ_DIR)\progress.obj: progress.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h sendf.h progress.h &
|
||||
..\include\curl\mprintf.h
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
progress.h ..\include\curl\mprintf.h
|
||||
$(OBJ_DIR)\formdata.obj: formdata.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
|
||||
llist.h splay.h easyif.h strequal.h memory.h ..\include\curl\mprintf.h &
|
||||
memdebug.h
|
||||
llist.h curl_addrinfo.h splay.h easyif.h strequal.h memory.h &
|
||||
..\include\curl\mprintf.h memdebug.h
|
||||
$(OBJ_DIR)\cookie.obj: cookie.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\mprintf.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h urldata.h cookie.h ..\include\curl\curl.h &
|
||||
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h &
|
||||
strequal.h strtok.h sendf.h memory.h share.h strtoofft.h memdebug.h
|
||||
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h &
|
||||
curl_addrinfo.h splay.h strequal.h strtok.h sendf.h memory.h share.h &
|
||||
strtoofft.h rawstr.h memdebug.h
|
||||
$(OBJ_DIR)\http.obj: http.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h transfer.h sendf.h &
|
||||
easyif.h progress.h curl_base64.h strequal.h sslgen.h http_digest.h &
|
||||
http_ntlm.h http_negotiate.h url.h share.h http.h memory.h select.h &
|
||||
parsedate.h strtoofft.h multiif.h ..\include\curl\mprintf.h memdebug.h
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h &
|
||||
transfer.h sendf.h easyif.h progress.h curl_base64.h strequal.h &
|
||||
sslgen.h http_digest.h http_ntlm.h http_negotiate.h url.h share.h &
|
||||
http.h memory.h select.h parsedate.h strtoofft.h multiif.h rawstr.h &
|
||||
..\include\curl\mprintf.h memdebug.h
|
||||
$(OBJ_DIR)\sendf.obj: sendf.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
|
||||
llist.h splay.h sendf.h connect.h sslgen.h ssh.h multiif.h &
|
||||
..\include\curl\mprintf.h memory.h strerror.h easyif.h memdebug.h
|
||||
llist.h curl_addrinfo.h splay.h sendf.h connect.h sslgen.h ssh.h &
|
||||
multiif.h ..\include\curl\mprintf.h memory.h strerror.h easyif.h &
|
||||
memdebug.h
|
||||
$(OBJ_DIR)\ftp.obj: ftp.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
|
||||
llist.h splay.h sendf.h easyif.h if2ip.h progress.h transfer.h escape.h &
|
||||
http.h socks.h ftp.h strtoofft.h strequal.h sslgen.h connect.h &
|
||||
strerror.h memory.h inet_ntop.h select.h parsedate.h sockaddr.h &
|
||||
multiif.h url.h ..\include\curl\mprintf.h memdebug.h
|
||||
llist.h curl_addrinfo.h splay.h sendf.h easyif.h if2ip.h progress.h &
|
||||
transfer.h escape.h http.h socks.h ftp.h strtoofft.h strequal.h &
|
||||
sslgen.h connect.h strerror.h inet_ntop.h inet_pton.h select.h &
|
||||
parsedate.h sockaddr.h multiif.h url.h ..\include\curl\mprintf.h &
|
||||
memory.h memdebug.h
|
||||
$(OBJ_DIR)\url.obj: url.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h netrc.h sslgen.h &
|
||||
transfer.h sendf.h progress.h strequal.h strerror.h escape.h strtok.h &
|
||||
share.h content_encoding.h http_digest.h http_negotiate.h select.h &
|
||||
multiif.h easyif.h speedcheck.h ftp.h dict.h telnet.h tftp.h http.h &
|
||||
file.h curl_ldap.h ssh.h url.h connect.h inet_ntop.h http_ntlm.h &
|
||||
socks.h ..\include\curl\mprintf.h memory.h memdebug.h
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h netrc.h &
|
||||
sslgen.h transfer.h sendf.h progress.h strequal.h strerror.h escape.h &
|
||||
strtok.h share.h content_encoding.h http_digest.h http_negotiate.h &
|
||||
select.h multiif.h easyif.h speedcheck.h rawstr.h ftp.h dict.h telnet.h &
|
||||
tftp.h http.h file.h curl_ldap.h ssh.h url.h connect.h inet_ntop.h &
|
||||
http_ntlm.h socks.h ..\include\curl\mprintf.h memory.h memdebug.h
|
||||
$(OBJ_DIR)\dict.obj: dict.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h transfer.h sendf.h &
|
||||
progress.h strequal.h dict.h ..\include\curl\mprintf.h memdebug.h
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h &
|
||||
transfer.h sendf.h progress.h strequal.h dict.h rawstr.h &
|
||||
..\include\curl\mprintf.h memdebug.h
|
||||
$(OBJ_DIR)\if2ip.obj: if2ip.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h if2ip.h
|
||||
..\include\curl\curlrules.h setup_once.h inet_ntop.h strequal.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h if2ip.h &
|
||||
..\include\curl\mprintf.h memory.h memdebug.h
|
||||
$(OBJ_DIR)\speedcheck.obj: speedcheck.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h urldata.h cookie.h &
|
||||
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h &
|
||||
sendf.h multiif.h speedcheck.h
|
||||
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h &
|
||||
curl_addrinfo.h splay.h sendf.h multiif.h speedcheck.h
|
||||
$(OBJ_DIR)\ldap.obj: ldap.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h sendf.h escape.h &
|
||||
transfer.h strequal.h strtok.h curl_ldap.h memory.h curl_base64.h &
|
||||
..\include\curl\mprintf.h memdebug.h
|
||||
..\include\curl\curlrules.h setup_once.h
|
||||
$(OBJ_DIR)\ssluse.obj: ssluse.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h sendf.h url.h inet_pton.h &
|
||||
ssluse.h connect.h strequal.h select.h sslgen.h &
|
||||
..\include\curl\mprintf.h
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
url.h inet_pton.h ssluse.h connect.h strequal.h select.h sslgen.h &
|
||||
rawstr.h ..\include\curl\mprintf.h
|
||||
$(OBJ_DIR)\version.obj: version.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
|
||||
llist.h splay.h sslgen.h ..\include\curl\mprintf.h
|
||||
llist.h curl_addrinfo.h splay.h sslgen.h ..\include\curl\mprintf.h
|
||||
$(OBJ_DIR)\getenv.obj: getenv.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
@@ -266,7 +279,8 @@ $(OBJ_DIR)\escape.obj: escape.c setup.h config-win32.h ..\include\curl\curlbuild
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
memory.h urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h &
|
||||
hash.h llist.h splay.h easyif.h ..\include\curl\mprintf.h memdebug.h
|
||||
hash.h llist.h curl_addrinfo.h splay.h easyif.h &
|
||||
..\include\curl\mprintf.h memdebug.h
|
||||
$(OBJ_DIR)\mprintf.obj: mprintf.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\mprintf.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
@@ -277,31 +291,32 @@ $(OBJ_DIR)\telnet.obj: telnet.c setup.h config-win32.h ..\include\curl\curlbuild
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h transfer.h sendf.h &
|
||||
telnet.h connect.h ..\include\curl\mprintf.h arpa_telnet.h memory.h &
|
||||
select.h memdebug.h
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h &
|
||||
transfer.h sendf.h telnet.h connect.h ..\include\curl\mprintf.h &
|
||||
arpa_telnet.h memory.h select.h strequal.h rawstr.h memdebug.h
|
||||
$(OBJ_DIR)\netrc.obj: netrc.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
netrc.h strequal.h strtok.h memory.h ..\include\curl\mprintf.h &
|
||||
netrc.h strequal.h strtok.h memory.h rawstr.h ..\include\curl\mprintf.h &
|
||||
memdebug.h
|
||||
$(OBJ_DIR)\getinfo.obj: getinfo.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
|
||||
llist.h splay.h getinfo.h memory.h sslgen.h connect.h memdebug.h
|
||||
llist.h curl_addrinfo.h splay.h getinfo.h memory.h sslgen.h connect.h &
|
||||
memdebug.h
|
||||
$(OBJ_DIR)\transfer.obj: transfer.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h strtoofft.h strequal.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h urldata.h cookie.h &
|
||||
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h &
|
||||
netrc.h content_encoding.h transfer.h sendf.h speedcheck.h progress.h &
|
||||
http.h url.h getinfo.h sslgen.h http_digest.h http_ntlm.h &
|
||||
http_negotiate.h share.h memory.h select.h multiif.h easyif.h &
|
||||
..\include\curl\mprintf.h memdebug.h
|
||||
..\include\curl\multi.h ..\include\curl\curl.h rawstr.h urldata.h &
|
||||
cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h &
|
||||
curl_addrinfo.h splay.h netrc.h content_encoding.h transfer.h sendf.h &
|
||||
speedcheck.h progress.h http.h url.h getinfo.h sslgen.h http_digest.h &
|
||||
http_ntlm.h http_negotiate.h share.h memory.h select.h multiif.h &
|
||||
easyif.h ..\include\curl\mprintf.h memdebug.h
|
||||
$(OBJ_DIR)\strequal.obj: strequal.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h strequal.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
@@ -312,10 +327,10 @@ $(OBJ_DIR)\easy.obj: easy.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h urldata.h cookie.h &
|
||||
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h &
|
||||
transfer.h sslgen.h url.h getinfo.h share.h strdup.h memory.h &
|
||||
progress.h easyif.h select.h sendf.h http_ntlm.h connect.h &
|
||||
..\include\curl\mprintf.h memdebug.h
|
||||
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h &
|
||||
curl_addrinfo.h splay.h transfer.h sslgen.h url.h getinfo.h share.h &
|
||||
strdup.h memory.h progress.h easyif.h select.h sendf.h http_ntlm.h &
|
||||
connect.h ..\include\curl\mprintf.h memdebug.h
|
||||
$(OBJ_DIR)\security.obj: security.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h
|
||||
$(OBJ_DIR)\krb4.obj: krb4.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
@@ -327,13 +342,14 @@ $(OBJ_DIR)\memdebug.obj: memdebug.c setup.h config-win32.h ..\include\curl\curlb
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
..\include\curl\mprintf.h urldata.h cookie.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h memory.h memdebug.h
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h memory.h &
|
||||
memdebug.h
|
||||
$(OBJ_DIR)\http_chunks.obj: http_chunks.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
urldata.h cookie.h ..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h sendf.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
content_encoding.h http.h memory.h easyif.h ..\include\curl\mprintf.h &
|
||||
memdebug.h
|
||||
$(OBJ_DIR)\strtok.obj: strtok.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
@@ -343,26 +359,28 @@ $(OBJ_DIR)\connect.obj: connect.c setup.h config-win32.h ..\include\curl\curlbui
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h urldata.h cookie.h ..\include\curl\curl.h &
|
||||
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h splay.h &
|
||||
sendf.h if2ip.h strerror.h connect.h memory.h select.h url.h multiif.h &
|
||||
sockaddr.h inet_ntop.h inet_pton.h sslgen.h memdebug.h
|
||||
formdata.h timeval.h http_chunks.h hostip.h hash.h llist.h &
|
||||
curl_addrinfo.h splay.h sendf.h if2ip.h strerror.h connect.h memory.h &
|
||||
select.h url.h multiif.h sockaddr.h inet_ntop.h sslgen.h memdebug.h
|
||||
$(OBJ_DIR)\llist.obj: llist.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h llist.h memory.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h memdebug.h
|
||||
$(OBJ_DIR)\hash.obj: hash.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h hash.h llist.h memory.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h memdebug.h
|
||||
..\include\curl\curlrules.h setup_once.h hash.h llist.h &
|
||||
..\include\curl\mprintf.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h memory.h &
|
||||
..\include\curl\curl.h memdebug.h
|
||||
$(OBJ_DIR)\multi.obj: multi.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
|
||||
llist.h splay.h transfer.h url.h connect.h progress.h memory.h easyif.h &
|
||||
multiif.h sendf.h http.h memdebug.h
|
||||
llist.h curl_addrinfo.h splay.h transfer.h url.h connect.h progress.h &
|
||||
easyif.h multiif.h sendf.h http.h ..\include\curl\mprintf.h memory.h &
|
||||
memdebug.h
|
||||
$(OBJ_DIR)\content_encoding.obj: content_encoding.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h
|
||||
$(OBJ_DIR)\share.obj: share.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
@@ -370,15 +388,15 @@ $(OBJ_DIR)\share.obj: share.c setup.h config-win32.h ..\include\curl\curlbuild.h
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
|
||||
llist.h splay.h share.h memory.h memdebug.h
|
||||
llist.h curl_addrinfo.h splay.h share.h memory.h memdebug.h
|
||||
$(OBJ_DIR)\http_digest.obj: http_digest.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
urldata.h cookie.h ..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h sendf.h strequal.h &
|
||||
curl_base64.h curl_md5.h http_digest.h strtok.h url.h memory.h easyif.h &
|
||||
..\include\curl\mprintf.h memdebug.h
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
rawstr.h curl_base64.h curl_md5.h http_digest.h strtok.h url.h memory.h &
|
||||
easyif.h ..\include\curl\mprintf.h memdebug.h
|
||||
$(OBJ_DIR)\md5.obj: md5.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h curl_md5.h
|
||||
$(OBJ_DIR)\http_negotiate.obj: http_negotiate.c setup.h config-win32.h &
|
||||
@@ -388,8 +406,8 @@ $(OBJ_DIR)\http_ntlm.obj: http_ntlm.c setup.h config-win32.h &
|
||||
urldata.h cookie.h ..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h easyif.h sendf.h &
|
||||
strequal.h curl_base64.h http_ntlm.h url.h memory.h ssluse.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h easyif.h &
|
||||
sendf.h rawstr.h curl_base64.h http_ntlm.h url.h memory.h ssluse.h &
|
||||
..\include\curl\mprintf.h memdebug.h
|
||||
$(OBJ_DIR)\inet_pton.obj: inet_pton.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
@@ -402,53 +420,54 @@ $(OBJ_DIR)\strerror.obj: strerror.c setup.h config-win32.h ..\include\curl\curlb
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
strerror.h urldata.h cookie.h formdata.h timeval.h http_chunks.h &
|
||||
hostip.h hash.h llist.h splay.h ..\include\curl\mprintf.h
|
||||
hostip.h hash.h llist.h curl_addrinfo.h splay.h &
|
||||
..\include\curl\mprintf.h
|
||||
$(OBJ_DIR)\hostares.obj: hostares.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h sendf.h share.h &
|
||||
strerror.h url.h multiif.h connect.h select.h ..\include\curl\mprintf.h &
|
||||
memory.h memdebug.h
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
share.h strerror.h url.h multiif.h inet_pton.h connect.h select.h &
|
||||
..\include\curl\mprintf.h memory.h memdebug.h
|
||||
$(OBJ_DIR)\hostasyn.obj: hostasyn.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h sendf.h share.h &
|
||||
strerror.h url.h ..\include\curl\mprintf.h memory.h memdebug.h
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
share.h strerror.h url.h ..\include\curl\mprintf.h memory.h memdebug.h
|
||||
$(OBJ_DIR)\hostip4.obj: hostip4.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h sendf.h share.h &
|
||||
strerror.h url.h inet_pton.h ..\include\curl\mprintf.h memory.h &
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
share.h strerror.h url.h inet_pton.h ..\include\curl\mprintf.h memory.h &
|
||||
memdebug.h
|
||||
$(OBJ_DIR)\hostip6.obj: hostip6.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h sendf.h share.h &
|
||||
strerror.h url.h inet_pton.h connect.h ..\include\curl\mprintf.h &
|
||||
memory.h memdebug.h
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
share.h strerror.h url.h inet_pton.h connect.h &
|
||||
..\include\curl\mprintf.h memory.h memdebug.h
|
||||
$(OBJ_DIR)\hostsyn.obj: hostsyn.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h sendf.h share.h &
|
||||
strerror.h url.h ..\include\curl\mprintf.h memory.h memdebug.h
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
share.h strerror.h url.h ..\include\curl\mprintf.h memory.h memdebug.h
|
||||
$(OBJ_DIR)\hostthre.obj: hostthre.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h sendf.h share.h &
|
||||
strerror.h url.h multiif.h ..\include\curl\mprintf.h inet_ntop.h &
|
||||
memory.h memdebug.h
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
share.h strerror.h url.h multiif.h inet_pton.h &
|
||||
..\include\curl\mprintf.h inet_ntop.h memory.h memdebug.h
|
||||
$(OBJ_DIR)\inet_ntop.obj: inet_ntop.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
..\include\curl\mprintf.h ..\include\curl\curl.h &
|
||||
@@ -458,13 +477,13 @@ $(OBJ_DIR)\parsedate.obj: parsedate.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h
|
||||
..\include\curl\multi.h ..\include\curl\curl.h rawstr.h parsedate.h
|
||||
$(OBJ_DIR)\select.obj: select.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
urldata.h cookie.h formdata.h timeval.h http_chunks.h hostip.h hash.h &
|
||||
llist.h splay.h connect.h select.h
|
||||
llist.h curl_addrinfo.h splay.h connect.h select.h
|
||||
$(OBJ_DIR)\gtls.obj: gtls.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h
|
||||
$(OBJ_DIR)\sslgen.obj: sslgen.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
@@ -472,16 +491,17 @@ $(OBJ_DIR)\sslgen.obj: sslgen.c setup.h config-win32.h ..\include\curl\curlbuild
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h sslgen.h ssluse.h gtls.h &
|
||||
nssg.h qssl.h sendf.h strequal.h url.h memory.h progress.h memdebug.h
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sslgen.h &
|
||||
ssluse.h gtls.h nssg.h qssl.h sendf.h rawstr.h url.h memory.h &
|
||||
progress.h memdebug.h
|
||||
$(OBJ_DIR)\tftp.obj: tftp.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h urldata.h cookie.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h transfer.h sendf.h tftp.h &
|
||||
progress.h connect.h strerror.h sockaddr.h url.h &
|
||||
..\include\curl\mprintf.h memory.h select.h memdebug.h
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h &
|
||||
transfer.h sendf.h tftp.h progress.h connect.h strerror.h sockaddr.h &
|
||||
url.h ..\include\curl\mprintf.h memory.h select.h memdebug.h
|
||||
$(OBJ_DIR)\splay.obj: splay.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h splay.h
|
||||
$(OBJ_DIR)\strdup.obj: strdup.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
@@ -491,8 +511,8 @@ $(OBJ_DIR)\socks.obj: socks.c setup.h config-win32.h ..\include\curl\curlbuild.h
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h sendf.h strequal.h &
|
||||
select.h connect.h socks.h memdebug.h
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
strequal.h select.h connect.h socks.h memdebug.h
|
||||
$(OBJ_DIR)\ssh.obj: ssh.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h
|
||||
$(OBJ_DIR)\nss.obj: nss.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
@@ -500,17 +520,16 @@ $(OBJ_DIR)\nss.obj: nss.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h formdata.h timeval.h &
|
||||
http_chunks.h hostip.h hash.h llist.h splay.h sendf.h url.h connect.h &
|
||||
strequal.h select.h sslgen.h ..\include\curl\mprintf.h
|
||||
http_chunks.h hostip.h hash.h llist.h curl_addrinfo.h splay.h sendf.h &
|
||||
url.h connect.h strequal.h select.h sslgen.h ..\include\curl\mprintf.h
|
||||
$(OBJ_DIR)\qssl.obj: qssl.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h
|
||||
$(OBJ_DIR)\rawstr.obj: rawstr.c setup.h config-win32.h ..\include\curl\curlbuild.h &
|
||||
..\include\curl\curlrules.h setup_once.h ..\include\curl\curl.h &
|
||||
..\include\curl\curlver.h ..\include\curl\curlrules.h &
|
||||
..\include\curl\easy.h ..\include\curl\multi.h ..\include\curl\curl.h &
|
||||
strerror.h urldata.h cookie.h formdata.h timeval.h http_chunks.h &
|
||||
hostip.h hash.h llist.h splay.h ..\include\curl\mprintf.h
|
||||
$(OBJ_DIR)\curl_addrinfo.o: curl_addrinfo.c setup.h config-win32.h &
|
||||
..\include\curl\curlrules.h setup_once.h rawstr.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
..\include\curl\multi.h ..\include\curl\curl.h
|
||||
$(OBJ_DIR)\curl_addrinfo.obj: curl_addrinfo.c setup.h config-win32.h &
|
||||
..\include\curl\curlbuild.h ..\include\curl\curlrules.h setup_once.h &
|
||||
..\include\curl\curl.h ..\include\curl\curlver.h &
|
||||
..\include\curl\curlrules.h ..\include\curl\easy.h &
|
||||
|
||||
@@ -426,6 +426,9 @@ else
|
||||
@echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_AF_INET6 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_PF_INET6 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_FREEADDRINFO 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_GETADDRINFO 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRUCT_IN6_ADDR 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_STRUCT_SOCKADDR_IN6 1$(DL) >> $@
|
||||
@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
|
||||
@@ -452,8 +455,6 @@ else
|
||||
@echo $(DL)#define _LARGEFILE 1$(DL) >> $@
|
||||
ifdef ENABLE_IPV6
|
||||
@echo $(DL)#define ENABLE_IPV6 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_FREEADDRINFO 1$(DL) >> $@
|
||||
@echo $(DL)#define HAVE_GETADDRINFO 1$(DL) >> $@
|
||||
endif
|
||||
endif
|
||||
@echo $(DL)#define USE_MANUAL 1$(DL) >> $@
|
||||
|
||||
@@ -42,6 +42,9 @@
|
||||
/* Define if you want to enable IPv6 support */
|
||||
#define ENABLE_IPV6
|
||||
|
||||
/* Define if struct sockaddr_in6 has the sin6_scope_id member */
|
||||
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
|
||||
|
||||
/* Define this to 'int' if ssize_t is not an available typedefed type */
|
||||
#undef ssize_t
|
||||
|
||||
@@ -82,8 +85,8 @@
|
||||
#define HAVE_FCNTL_H
|
||||
|
||||
/* Define if getaddrinfo exists and works */
|
||||
/* OS400 has no ASCII version of this procedure. */
|
||||
#undef HAVE_GETADDRINFO
|
||||
/* OS400 has no ASCII version of this procedure: wrapped in setup-os400.h. */
|
||||
#define HAVE_GETADDRINFO
|
||||
|
||||
/* Define if you have the `geteuid' function. */
|
||||
#define HAVE_GETEUID
|
||||
@@ -284,7 +287,7 @@
|
||||
#undef HAVE_STRLCPY
|
||||
|
||||
/* Define if you have the <stropts.h> header file. */
|
||||
#define HAVE_STROPTS_H
|
||||
#undef HAVE_STROPTS_H
|
||||
|
||||
/* Define if you have the `strstr' function. */
|
||||
#define HAVE_STRSTR
|
||||
@@ -404,15 +407,21 @@
|
||||
/* Define if you have a working ioctl SIOCGIFADDR function. */
|
||||
#define HAVE_IOCTL_SIOCGIFADDR
|
||||
|
||||
/* to disable LDAP */
|
||||
/* To disable LDAP */
|
||||
#undef CURL_DISABLE_LDAP
|
||||
|
||||
/* To avoid external use of library hidden symbols */
|
||||
#define CURL_HIDDEN_SYMBOLS
|
||||
|
||||
/* External symbols need no special keyword. */
|
||||
#define CURL_EXTERN_SYMBOL
|
||||
|
||||
/* Define if you have the ldap_url_parse procedure. */
|
||||
/* #define HAVE_LDAP_URL_PARSE */ /* Disabled because of an IBM bug. */
|
||||
|
||||
/* Define if you have the getnameinfo function. */
|
||||
/* OS400 has no ASCII version of this procedure. */
|
||||
#undef HAVE_GETNAMEINFO
|
||||
/* OS400 has no ASCII version of this procedure: wrapped in setup-os400.h. */
|
||||
#define HAVE_GETNAMEINFO
|
||||
|
||||
/* Define to the type qualifier of arg 1 for getnameinfo. */
|
||||
#define GETNAMEINFO_QUAL_ARG1 const
|
||||
|
||||
@@ -38,6 +38,9 @@
|
||||
/* Define if you want to enable IPv6 support */
|
||||
#undef ENABLE_IPV6
|
||||
|
||||
/* Define if struct sockaddr_in6 has the sin6_scope_id member */
|
||||
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
|
||||
|
||||
/* Define this to 'int' if ssize_t is not an available typedefed type */
|
||||
#undef ssize_t
|
||||
|
||||
|
||||
@@ -66,6 +66,9 @@
|
||||
/* Define if you want to enable IPv6 support */
|
||||
#define ENABLE_IPV6 1
|
||||
|
||||
/* Define if struct sockaddr_in6 has the sin6_scope_id member */
|
||||
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
|
||||
|
||||
/* Define to the type qualifier of arg 1 for getnameinfo. */
|
||||
#define GETNAMEINFO_QUAL_ARG1 const
|
||||
|
||||
|
||||
@@ -62,6 +62,9 @@
|
||||
/* Define if you want to enable IPv6 support */
|
||||
/* #undef ENABLE_IPV6 */
|
||||
|
||||
/* Define if struct sockaddr_in6 has the sin6_scope_id member */
|
||||
/* #undef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID */
|
||||
|
||||
/* Define to the type of arg 1 for getnameinfo. */
|
||||
/* #undef GETNAMEINFO_TYPE_ARG1 */
|
||||
|
||||
|
||||
@@ -343,6 +343,30 @@
|
||||
/* Define this if you have struct timeval */
|
||||
#define HAVE_STRUCT_TIMEVAL 1
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* Watt-32 tcp/ip SPECIFIC */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
#ifdef USE_WATT32
|
||||
#include <tcp.h>
|
||||
#undef byte
|
||||
#undef word
|
||||
#undef USE_WINSOCK
|
||||
#undef HAVE_WINSOCK_H
|
||||
#undef HAVE_WINSOCK2_H
|
||||
#undef HAVE_WS2TCPIP_H
|
||||
#define HAVE_GETADDRINFO
|
||||
#define HAVE_GETNAMEINFO
|
||||
#define HAVE_SYS_IOCTL_H
|
||||
#define HAVE_SYS_SOCKET_H
|
||||
#define HAVE_NETINET_IN_H
|
||||
#define HAVE_NETDB_H
|
||||
#define HAVE_ARPA_INET_H
|
||||
#define HAVE_FREEADDRINFO
|
||||
#define SOCKET int
|
||||
#endif
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* COMPILER SPECIFIC */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
@@ -323,6 +323,9 @@
|
||||
/* Define this if you have struct timeval */
|
||||
#define HAVE_STRUCT_TIMEVAL 1
|
||||
|
||||
/* Define this if struct sockaddr_in6 has the sin6_scope_id member */
|
||||
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* COMPILER SPECIFIC */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
|
||||
#include "setup.h"
|
||||
|
||||
#ifndef WIN32
|
||||
/* headers for non-win32 */
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
@@ -71,8 +69,6 @@
|
||||
#include <inet.h>
|
||||
#endif
|
||||
|
||||
#endif /* !WIN32 */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
@@ -773,7 +769,7 @@ singleipconnect(struct connectdata *conn,
|
||||
/* no socket, no connection */
|
||||
return CURL_SOCKET_BAD;
|
||||
|
||||
#ifdef ENABLE_IPV6
|
||||
#if defined(ENABLE_IPV6) && defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID)
|
||||
if (conn->scope && (addr.family == AF_INET6))
|
||||
sa6->sin6_scope_id = conn->scope;
|
||||
#endif
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2009, 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
|
||||
@@ -439,7 +439,7 @@ Curl_cookie_add(struct SessionHandle *data,
|
||||
reading the odd netscape cookies-file format here */
|
||||
char *ptr;
|
||||
char *firstptr;
|
||||
char *tok_buf;
|
||||
char *tok_buf=NULL;
|
||||
int fields;
|
||||
|
||||
/* IE introduced HTTP-only cookies to prevent XSS attacks. Cookies
|
||||
@@ -454,7 +454,6 @@ Curl_cookie_add(struct SessionHandle *data,
|
||||
co->httponly = TRUE;
|
||||
}
|
||||
|
||||
|
||||
if(lineptr[0]=='#') {
|
||||
/* don't even try the comments */
|
||||
free(co);
|
||||
@@ -878,7 +877,7 @@ void Curl_cookie_clearsess(struct CookieInfo *cookies)
|
||||
{
|
||||
struct Cookie *first, *curr, *next, *prev = NULL;
|
||||
|
||||
if(!cookies->cookies)
|
||||
if(!cookies->cookies || !cookies->cookies)
|
||||
return;
|
||||
|
||||
first = curr = prev = cookies->cookies;
|
||||
|
||||
@@ -106,6 +106,7 @@ const struct Curl_handler Curl_handler_dict = {
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
ZERO_NULL, /* disconnect */
|
||||
PORT_DICT, /* defport */
|
||||
PROT_DICT /* protocol */
|
||||
|
||||
62
lib/easy.c
62
lib/easy.c
@@ -624,13 +624,8 @@ CURL *curl_easy_duphandle(CURL *incurl)
|
||||
if(Curl_dupset(outcurl, data) != CURLE_OK)
|
||||
break;
|
||||
|
||||
if(data->state.used_interface == Curl_if_multi)
|
||||
outcurl->state.connc = data->state.connc;
|
||||
else
|
||||
outcurl->state.connc = Curl_mk_connc(CONNCACHE_PRIVATE, -1);
|
||||
|
||||
if(!outcurl->state.connc)
|
||||
break;
|
||||
/* the connection cache is setup on demand */
|
||||
outcurl->state.connc = NULL;
|
||||
|
||||
outcurl->state.lastconnect = -1;
|
||||
|
||||
@@ -727,6 +722,7 @@ void curl_easy_reset(CURL *curl)
|
||||
/* zero out UserDefined data: */
|
||||
Curl_freeset(data);
|
||||
memset(&data->set, 0, sizeof(struct UserDefined));
|
||||
(void)Curl_init_userdefined(&data->set);
|
||||
|
||||
/* zero out Progress data: */
|
||||
memset(&data->progress, 0, sizeof(struct Progress));
|
||||
@@ -734,58 +730,8 @@ void curl_easy_reset(CURL *curl)
|
||||
/* init Handle data */
|
||||
Curl_easy_initHandleData(data);
|
||||
|
||||
/* The remainder of these calls have been taken from Curl_open() */
|
||||
|
||||
data->set.out = stdout; /* default output to stdout */
|
||||
data->set.in = stdin; /* default input from stdin */
|
||||
data->set.err = stderr; /* default stderr to stderr */
|
||||
|
||||
/* use fwrite as default function to store output */
|
||||
data->set.fwrite_func = (curl_write_callback)fwrite;
|
||||
|
||||
/* use fread as default function to read input */
|
||||
data->set.fread_func = (curl_read_callback)fread;
|
||||
|
||||
data->set.infilesize = -1; /* we don't know any size */
|
||||
data->set.postfieldsize = -1; /* unknown size */
|
||||
data->set.maxredirs = -1; /* allow any amount by default */
|
||||
data->state.current_speed = -1; /* init to negative == impossible */
|
||||
|
||||
data->set.httpreq = HTTPREQ_GET; /* Default HTTP request */
|
||||
data->set.ftp_use_epsv = TRUE; /* FTP defaults to EPSV operations */
|
||||
data->set.ftp_use_eprt = TRUE; /* FTP defaults to EPRT operations */
|
||||
|
||||
data->set.dns_cache_timeout = 60; /* Timeout every 60 seconds by default */
|
||||
|
||||
/* make libcurl quiet by default: */
|
||||
data->set.hide_progress = TRUE; /* CURLOPT_NOPROGRESS changes these */
|
||||
data->progress.flags |= PGRS_HIDE;
|
||||
|
||||
/* Set the default size of the SSL session ID cache */
|
||||
data->set.ssl.numsessions = 5;
|
||||
|
||||
data->set.proxyport = CURL_DEFAULT_PROXY_PORT; /* from url.h */
|
||||
data->set.proxytype = CURLPROXY_HTTP; /* defaults to HTTP proxy */
|
||||
data->set.httpauth = CURLAUTH_BASIC; /* defaults to basic */
|
||||
data->set.proxyauth = CURLAUTH_BASIC; /* defaults to basic */
|
||||
|
||||
/*
|
||||
* libcurl 7.10 introduced SSL verification *by default*! This needs to be
|
||||
* switched off unless wanted.
|
||||
*/
|
||||
data->set.ssl.verifypeer = TRUE;
|
||||
data->set.ssl.verifyhost = 2;
|
||||
/* This is our prefered CA cert bundle/path since install time */
|
||||
#if defined(CURL_CA_BUNDLE)
|
||||
(void) curl_easy_setopt(curl, CURLOPT_CAINFO, (char *) CURL_CA_BUNDLE);
|
||||
#elif defined(CURL_CA_PATH)
|
||||
(void) curl_easy_setopt(curl, CURLOPT_CAPATH, (char *) CURL_CA_PATH);
|
||||
#endif
|
||||
|
||||
data->set.ssh_auth_types = CURLSSH_AUTH_DEFAULT; /* defaults to any auth
|
||||
type */
|
||||
data->set.new_file_perms = 0644; /* Default permissions */
|
||||
data->set.new_directory_perms = 0755; /* Default permissions */
|
||||
data->state.current_speed = -1; /* init to negative == impossible */
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -119,6 +119,7 @@ const struct Curl_handler Curl_handler_file = {
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
ZERO_NULL, /* disconnect */
|
||||
0, /* defport */
|
||||
PROT_FILE /* protocol */
|
||||
|
||||
@@ -222,9 +222,8 @@ static FormInfo * AddFormInfo(char *value,
|
||||
FormInfo *parent_form_info)
|
||||
{
|
||||
FormInfo *form_info;
|
||||
form_info = malloc(sizeof(FormInfo));
|
||||
form_info = calloc(sizeof(FormInfo), 1);
|
||||
if(form_info) {
|
||||
memset(form_info, 0, sizeof(FormInfo));
|
||||
if(value)
|
||||
form_info->value = value;
|
||||
if(contenttype)
|
||||
|
||||
14
lib/ftp.c
14
lib/ftp.c
@@ -34,7 +34,6 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifndef WIN32
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
@@ -54,7 +53,6 @@
|
||||
#include <in.h>
|
||||
#include <inet.h>
|
||||
#endif
|
||||
#endif /* !WIN32 */
|
||||
|
||||
#if (defined(NETWARE) && defined(__NOVELL_LIBC__))
|
||||
#undef in_addr_t
|
||||
@@ -173,9 +171,10 @@ const struct Curl_handler Curl_handler_ftp = {
|
||||
ftp_doing, /* doing */
|
||||
ftp_getsock, /* proto_getsock */
|
||||
ftp_getsock, /* doing_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
ftp_disconnect, /* disconnect */
|
||||
PORT_FTP, /* defport */
|
||||
PROT_FTP /* protocol */
|
||||
PORT_FTP, /* defport */
|
||||
PROT_FTP /* protocol */
|
||||
};
|
||||
|
||||
|
||||
@@ -195,9 +194,10 @@ const struct Curl_handler Curl_handler_ftps = {
|
||||
ftp_doing, /* doing */
|
||||
ftp_getsock, /* proto_getsock */
|
||||
ftp_getsock, /* doing_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
ftp_disconnect, /* disconnect */
|
||||
PORT_FTPS, /* defport */
|
||||
PROT_FTP | PROT_FTPS | PROT_SSL /* protocol */
|
||||
PORT_FTPS, /* defport */
|
||||
PROT_FTP | PROT_FTPS | PROT_SSL /* protocol */
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -217,6 +217,7 @@ const struct Curl_handler Curl_handler_ftp_proxy = {
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
ZERO_NULL, /* disconnect */
|
||||
PORT_FTP, /* defport */
|
||||
PROT_HTTP /* protocol */
|
||||
@@ -239,6 +240,7 @@ const struct Curl_handler Curl_handler_ftps_proxy = {
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
ZERO_NULL, /* disconnect */
|
||||
PORT_FTPS, /* defport */
|
||||
PROT_HTTP /* protocol */
|
||||
|
||||
10
lib/http.c
10
lib/http.c
@@ -137,6 +137,7 @@ const struct Curl_handler Curl_handler_http = {
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
http_getsock_do, /* doing_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
ZERO_NULL, /* disconnect */
|
||||
PORT_HTTP, /* defport */
|
||||
PROT_HTTP, /* protocol */
|
||||
@@ -157,6 +158,7 @@ const struct Curl_handler Curl_handler_https = {
|
||||
ZERO_NULL, /* doing */
|
||||
https_getsock, /* proto_getsock */
|
||||
http_getsock_do, /* doing_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
ZERO_NULL, /* disconnect */
|
||||
PORT_HTTPS, /* defport */
|
||||
PROT_HTTP | PROT_HTTPS | PROT_SSL /* protocol */
|
||||
@@ -973,13 +975,7 @@ static CURLcode
|
||||
static
|
||||
send_buffer *add_buffer_init(void)
|
||||
{
|
||||
send_buffer *blonk;
|
||||
blonk = malloc(sizeof(send_buffer));
|
||||
if(blonk) {
|
||||
memset(blonk, 0, sizeof(send_buffer));
|
||||
return blonk;
|
||||
}
|
||||
return NULL; /* failed, go home */
|
||||
return calloc(sizeof(send_buffer), 1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -356,7 +356,25 @@ CURLcode Curl_output_digest(struct connectdata *conn,
|
||||
5.1.1 of RFC 2616)
|
||||
*/
|
||||
|
||||
md5this = (unsigned char *)aprintf("%s:%s", request, uripath);
|
||||
/* So IE browsers < v7 cut off the URI part at the query part when they
|
||||
evaluate the MD5 and some (IIS?) servers work with them so we may need to
|
||||
do the Digest IE-style. Note that the different ways cause different MD5
|
||||
sums to get sent.
|
||||
|
||||
Apache servers can be set to do the Digest IE-style automatically using
|
||||
the BrowserMatch feature:
|
||||
http://httpd.apache.org/docs/2.2/mod/mod_auth_digest.html#msie
|
||||
|
||||
Further details on Digest implementation differences:
|
||||
http://www.fngtps.com/2006/09/http-authentication
|
||||
*/
|
||||
if(authp->iestyle && (tmp = strchr((char *)uripath, '?'))) {
|
||||
md5this = (unsigned char *)aprintf("%s:%.*s", request,
|
||||
(int)(tmp - (char *)uripath), uripath);
|
||||
}
|
||||
else
|
||||
md5this = (unsigned char *)aprintf("%s:%s", request, uripath);
|
||||
|
||||
if(!md5this) {
|
||||
free(ha1);
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
@@ -86,10 +86,12 @@ char *Curl_if2ip(int af, const char *interface, char *buf, int buf_size)
|
||||
char scope[12]="";
|
||||
#ifdef ENABLE_IPV6
|
||||
if (af == AF_INET6) {
|
||||
unsigned int scopeid;
|
||||
unsigned int scopeid = 0;
|
||||
addr = &((struct sockaddr_in6 *)iface->ifa_addr)->sin6_addr;
|
||||
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
|
||||
/* Include the scope of this interface as part of the address */
|
||||
scopeid = ((struct sockaddr_in6 *)iface->ifa_addr)->sin6_scope_id;
|
||||
#endif
|
||||
if (scopeid)
|
||||
snprintf(scope, sizeof(scope), "%%%u", scopeid);
|
||||
}
|
||||
|
||||
@@ -136,6 +136,7 @@ const struct Curl_handler Curl_handler_ldap = {
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
ZERO_NULL, /* disconnect */
|
||||
PORT_LDAP, /* defport */
|
||||
PROT_LDAP /* protocol */
|
||||
@@ -157,6 +158,7 @@ const struct Curl_handler Curl_handler_ldaps = {
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
ZERO_NULL, /* disconnect */
|
||||
PORT_LDAPS, /* defport */
|
||||
PROT_LDAP | PROT_SSL /* protocol */
|
||||
|
||||
111
lib/multi.c
111
lib/multi.c
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2009, 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
|
||||
@@ -587,6 +587,8 @@ CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
|
||||
|
||||
if(easy) {
|
||||
bool premature = (bool)(easy->state != CURLM_STATE_COMPLETED);
|
||||
bool easy_owns_conn = (bool)(easy->easy_conn &&
|
||||
(easy->easy_conn->data == easy->easy_handle));
|
||||
|
||||
/* If the 'state' is not INIT or COMPLETED, we might need to do something
|
||||
nice to put the easy_handle in a good known state when this returns. */
|
||||
@@ -624,7 +626,7 @@ CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
|
||||
|
||||
/* we must call Curl_done() here (if we still "own it") so that we don't
|
||||
leave a half-baked one around */
|
||||
if (easy->easy_conn->data == easy->easy_handle) {
|
||||
if (easy_owns_conn) {
|
||||
|
||||
/* Curl_done() clears the conn->data field to lose the association
|
||||
between the easy handle and the connection
|
||||
@@ -676,9 +678,15 @@ CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
|
||||
to that since we're not part of that handle anymore */
|
||||
easy->easy_handle->state.connc = NULL;
|
||||
|
||||
/* and modify the connectindex since this handle can't point to the
|
||||
connection cache anymore */
|
||||
if(easy->easy_conn &&
|
||||
/* Modify the connectindex since this handle can't point to the
|
||||
connection cache anymore.
|
||||
|
||||
TODO: consider if this is really what we want. The connection cache
|
||||
is within the multi handle and that owns the connections so we should
|
||||
not need to touch connections like this when we just remove an easy
|
||||
handle...
|
||||
*/
|
||||
if(easy->easy_conn && easy_owns_conn &&
|
||||
(easy->easy_conn->send_pipe->size +
|
||||
easy->easy_conn->recv_pipe->size == 0))
|
||||
easy->easy_conn->connectindex = -1;
|
||||
@@ -778,11 +786,8 @@ static int multi_getsock(struct Curl_one_easy *easy,
|
||||
happen when this is called from curl_multi_remove_handle() =>
|
||||
singlesocket() => multi_getsock().
|
||||
*/
|
||||
|
||||
if(easy->easy_handle->state.pipe_broke ||
|
||||
!easy->easy_conn) {
|
||||
if(easy->easy_handle->state.pipe_broke || !easy->easy_conn)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(easy->state > CURLM_STATE_CONNECT &&
|
||||
easy->state < CURLM_STATE_COMPLETED) {
|
||||
@@ -1366,7 +1371,6 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
|
||||
easy->result = Curl_follow(easy->easy_handle, newurl, FOLLOW_FAKE);
|
||||
if (easy->result)
|
||||
free(newurl);
|
||||
break;
|
||||
}
|
||||
|
||||
multistate(easy, CURLM_STATE_DONE);
|
||||
@@ -1536,6 +1540,7 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
|
||||
|
||||
if( CURLM_OK >= returncode )
|
||||
update_timer(multi);
|
||||
|
||||
return returncode;
|
||||
}
|
||||
|
||||
@@ -1662,6 +1667,8 @@ static void singlesocket(struct Curl_multi *multi,
|
||||
curl_socket_t s;
|
||||
int num;
|
||||
unsigned int curraction;
|
||||
struct Curl_one_easy *easy_by_hash;
|
||||
bool remove_sock_from_hash;
|
||||
|
||||
memset(&socks, 0, sizeof(socks));
|
||||
for(i=0; i< MAX_SOCKSPEREASYHANDLE; i++)
|
||||
@@ -1729,21 +1736,69 @@ static void singlesocket(struct Curl_multi *multi,
|
||||
}
|
||||
}
|
||||
if(s != CURL_SOCKET_BAD) {
|
||||
/* this socket has been removed. Remove it */
|
||||
|
||||
/* this socket has been removed. Tell the app to remove it */
|
||||
remove_sock_from_hash = TRUE;
|
||||
|
||||
entry = Curl_hash_pick(multi->sockhash, (char *)&s, sizeof(s));
|
||||
if(entry) {
|
||||
/* check if the socket to be removed serves a connection which has
|
||||
other easy-s in a pipeline. In this case the socket should not be
|
||||
removed. */
|
||||
struct connectdata *easy_conn;
|
||||
|
||||
easy_by_hash = entry->easy->multi_pos;
|
||||
easy_conn = easy_by_hash->easy_conn;
|
||||
if(easy_conn) {
|
||||
if (easy_conn->recv_pipe && easy_conn->recv_pipe->size > 1) {
|
||||
/* the handle should not be removed from the pipe yet */
|
||||
remove_sock_from_hash = FALSE;
|
||||
|
||||
/* Update the sockhash entry to instead point to the next in line
|
||||
for the recv_pipe, or the first (in case this particular easy
|
||||
isn't already) */
|
||||
if (entry->easy == easy->easy_handle) {
|
||||
if (isHandleAtHead(easy->easy_handle, easy_conn->recv_pipe))
|
||||
entry->easy = easy_conn->recv_pipe->head->next->ptr;
|
||||
else
|
||||
entry->easy = easy_conn->recv_pipe->head->ptr;
|
||||
}
|
||||
}
|
||||
if (easy_conn->send_pipe && easy_conn->send_pipe->size > 1) {
|
||||
/* the handle should not be removed from the pipe yet */
|
||||
remove_sock_from_hash = FALSE;
|
||||
|
||||
/* Update the sockhash entry to instead point to the next in line
|
||||
for the send_pipe, or the first (in case this particular easy
|
||||
isn't already) */
|
||||
if (entry->easy == easy->easy_handle) {
|
||||
if (isHandleAtHead(easy->easy_handle, easy_conn->send_pipe))
|
||||
entry->easy = easy_conn->send_pipe->head->next->ptr;
|
||||
else
|
||||
entry->easy = easy_conn->send_pipe->head->ptr;
|
||||
}
|
||||
}
|
||||
/* Don't worry about overwriting recv_pipe head with send_pipe_head,
|
||||
when action will be asked on the socket (see multi_socket()), the
|
||||
head of the correct pipe will be taken according to the
|
||||
action. */
|
||||
}
|
||||
}
|
||||
else
|
||||
/* just a precaution, this socket really SHOULD be in the hash already
|
||||
but in case it isn't, we don't have to tell the app to remove it
|
||||
either since it never got to know about it */
|
||||
remove_sock_from_hash = FALSE;
|
||||
|
||||
if (remove_sock_from_hash) {
|
||||
multi->socket_cb(easy->easy_handle,
|
||||
s,
|
||||
CURL_POLL_REMOVE,
|
||||
multi->socket_userp,
|
||||
entry ? entry->socketp : NULL);
|
||||
|
||||
sh_delentry(multi->sockhash, s);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1796,6 +1851,21 @@ static CURLMcode multi_socket(struct Curl_multi *multi,
|
||||
/* bad bad bad bad bad bad bad */
|
||||
return CURLM_INTERNAL_ERROR;
|
||||
|
||||
/* If the pipeline is enabled, take the handle which is in the head of
|
||||
the pipeline. If we should write into the socket, take the send_pipe
|
||||
head. If we should read from the socket, take the recv_pipe head. */
|
||||
if(data->set.one_easy->easy_conn) {
|
||||
if ((ev_bitmask & CURL_POLL_OUT) &&
|
||||
data->set.one_easy->easy_conn->send_pipe &&
|
||||
data->set.one_easy->easy_conn->send_pipe->head)
|
||||
data = data->set.one_easy->easy_conn->send_pipe->head->ptr;
|
||||
else
|
||||
if ((ev_bitmask & CURL_POLL_IN) &&
|
||||
data->set.one_easy->easy_conn->recv_pipe &&
|
||||
data->set.one_easy->easy_conn->recv_pipe->head)
|
||||
data = data->set.one_easy->easy_conn->recv_pipe->head->ptr;
|
||||
}
|
||||
|
||||
if(data->set.one_easy->easy_conn) /* set socket event bitmask */
|
||||
data->set.one_easy->easy_conn->cselect_bits = ev_bitmask;
|
||||
|
||||
@@ -1946,9 +2016,19 @@ static CURLMcode multi_timeout(struct Curl_multi *multi,
|
||||
/* splay the lowest to the bottom */
|
||||
multi->timetree = Curl_splay(tv_zero, multi->timetree);
|
||||
|
||||
if(Curl_splaycomparekeys(multi->timetree->key, now) > 0)
|
||||
if(Curl_splaycomparekeys(multi->timetree->key, now) > 0) {
|
||||
/* some time left before expiration */
|
||||
*timeout_ms = curlx_tvdiff(multi->timetree->key, now);
|
||||
if(!*timeout_ms)
|
||||
/*
|
||||
* Since we only provide millisecond resolution on the returned value
|
||||
* and the diff might be less than one millisecond here, we don't
|
||||
* return zero as that may cause short bursts of busyloops on fast
|
||||
* processors while the diff is still present but less than one
|
||||
* millisecond! instead we return 1 until the time is ripe.
|
||||
*/
|
||||
*timeout_ms=1;
|
||||
}
|
||||
else
|
||||
/* 0 means immediately */
|
||||
*timeout_ms = 0;
|
||||
@@ -2100,7 +2180,10 @@ static bool isHandleAtHead(struct SessionHandle *handle,
|
||||
}
|
||||
|
||||
/* given a number of milliseconds from now to use to set the 'act before
|
||||
this'-time for the transfer, to be extracted by curl_multi_timeout() */
|
||||
this'-time for the transfer, to be extracted by curl_multi_timeout()
|
||||
|
||||
Pass zero to clear the timeout value for this handle.
|
||||
*/
|
||||
void Curl_expire(struct SessionHandle *data, long milli)
|
||||
{
|
||||
struct Curl_multi *multi = data->multi;
|
||||
|
||||
59
lib/nss.c
59
lib/nss.c
@@ -5,7 +5,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2009, 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
|
||||
@@ -231,6 +231,24 @@ static SECStatus set_ciphers(struct SessionHandle *data, PRFileDesc * model,
|
||||
return SECSuccess;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the number of ciphers that are enabled. We use this to determine
|
||||
* if we need to call NSS_SetDomesticPolicy() to enable the default ciphers.
|
||||
*/
|
||||
static int num_enabled_ciphers(void)
|
||||
{
|
||||
PRInt32 policy = 0;
|
||||
int count = 0;
|
||||
unsigned int i;
|
||||
|
||||
for(i=0; i<NUM_OF_CIPHERS; i++) {
|
||||
SSL_CipherPolicyGet(cipherlist[i].num, &policy);
|
||||
if(policy)
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
/*
|
||||
* Determine whether the nickname passed in is a filename that needs to
|
||||
* be loaded as a PEM or a regular NSS nickname.
|
||||
@@ -944,8 +962,7 @@ CURLcode Curl_nss_connect(struct connectdata *conn, int sockindex)
|
||||
|
||||
/* FIXME. NSS doesn't support multiple databases open at the same time. */
|
||||
PR_Lock(nss_initlock);
|
||||
if(!initialized && !NSS_IsInitialized()) {
|
||||
initialized = 1;
|
||||
if(!initialized) {
|
||||
|
||||
certDir = getenv("SSL_DIR"); /* Look in $SSL_DIR */
|
||||
|
||||
@@ -958,27 +975,33 @@ CURLcode Curl_nss_connect(struct connectdata *conn, int sockindex)
|
||||
}
|
||||
}
|
||||
|
||||
if(!certDir) {
|
||||
rv = NSS_NoDB_Init(NULL);
|
||||
}
|
||||
else {
|
||||
rv = NSS_Initialize(certDir, NULL, NULL, "secmod.db",
|
||||
NSS_INIT_READONLY);
|
||||
}
|
||||
if(rv != SECSuccess) {
|
||||
infof(conn->data, "Unable to initialize NSS database\n");
|
||||
curlerr = CURLE_SSL_CACERT_BADFILE;
|
||||
initialized = 0;
|
||||
PR_Unlock(nss_initlock);
|
||||
goto error;
|
||||
if (!NSS_IsInitialized()) {
|
||||
initialized = 1;
|
||||
if(!certDir) {
|
||||
rv = NSS_NoDB_Init(NULL);
|
||||
}
|
||||
else {
|
||||
rv = NSS_Initialize(certDir, NULL, NULL, "secmod.db",
|
||||
NSS_INIT_READONLY);
|
||||
}
|
||||
if(rv != SECSuccess) {
|
||||
infof(conn->data, "Unable to initialize NSS database\n");
|
||||
curlerr = CURLE_SSL_CACERT_BADFILE;
|
||||
initialized = 0;
|
||||
PR_Unlock(nss_initlock);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
NSS_SetDomesticPolicy();
|
||||
if(num_enabled_ciphers() == 0)
|
||||
NSS_SetDomesticPolicy();
|
||||
|
||||
#ifdef HAVE_PK11_CREATEGENERICOBJECT
|
||||
configstring = aprintf("library=%s name=PEM", pem_library);
|
||||
if(!configstring)
|
||||
if(!configstring) {
|
||||
PR_Unlock(nss_initlock);
|
||||
goto error;
|
||||
}
|
||||
mod = SECMOD_LoadUserModule(configstring, NULL, PR_FALSE);
|
||||
free(configstring);
|
||||
|
||||
|
||||
10
lib/sendf.c
10
lib/sendf.c
@@ -559,10 +559,6 @@ int Curl_read_plain(curl_socket_t sockfd,
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Internal read-from-socket function. This is meant to deal with plain
|
||||
* sockets, SSL sockets and kerberos sockets.
|
||||
@@ -591,7 +587,7 @@ int Curl_read(struct connectdata *conn, /* connection data */
|
||||
|
||||
/* If session can pipeline, check connection buffer */
|
||||
if(pipelining) {
|
||||
size_t bytestocopy = MIN(conn->buf_len - conn->read_pos, sizerequested);
|
||||
size_t bytestocopy = CURLMIN(conn->buf_len - conn->read_pos, sizerequested);
|
||||
|
||||
/* Copy from our master buffer first if we have some unread data there*/
|
||||
if(bytestocopy > 0) {
|
||||
@@ -604,11 +600,11 @@ int Curl_read(struct connectdata *conn, /* connection data */
|
||||
}
|
||||
/* If we come here, it means that there is no data to read from the buffer,
|
||||
* so we read from the socket */
|
||||
bytesfromsocket = MIN(sizerequested, BUFSIZE * sizeof (char));
|
||||
bytesfromsocket = CURLMIN(sizerequested, BUFSIZE * sizeof (char));
|
||||
buffertofill = conn->master_buffer;
|
||||
}
|
||||
else {
|
||||
bytesfromsocket = MIN((long)sizerequested, conn->data->set.buffer_size ?
|
||||
bytesfromsocket = CURLMIN((long)sizerequested, conn->data->set.buffer_size ?
|
||||
conn->data->set.buffer_size : BUFSIZE);
|
||||
buffertofill = buf;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
* you should have received as part of this distribution. The terms
|
||||
@@ -36,11 +36,9 @@
|
||||
CURLSH *
|
||||
curl_share_init(void)
|
||||
{
|
||||
struct Curl_share *share = malloc(sizeof(struct Curl_share));
|
||||
if(share) {
|
||||
memset (share, 0, sizeof(struct Curl_share));
|
||||
struct Curl_share *share = calloc(sizeof(struct Curl_share), 1);
|
||||
if(share)
|
||||
share->specifier |= (1<<CURL_LOCK_DATA_SHARE);
|
||||
}
|
||||
|
||||
return share;
|
||||
}
|
||||
|
||||
10
lib/splay.c
10
lib/splay.c
@@ -345,13 +345,13 @@ void Curl_splayprint(struct Curl_tree * t, int d, char output)
|
||||
Curl_splayprint(t->larger, d+1, output);
|
||||
for (i=0; i<d; i++)
|
||||
if(output)
|
||||
printf(" ");
|
||||
fprintf(stderr, " ");
|
||||
|
||||
if(output) {
|
||||
#ifdef TEST_SPLAY
|
||||
printf("%ld[%d]", (long)t->key.tv_usec, i);
|
||||
fprintf(stderr, "%ld[%d]", (long)t->key.tv_usec, i);
|
||||
#else
|
||||
printf("%ld.%ld[%d]", (long)t->key.tv_sec, (long)t->key.tv_usec, i);
|
||||
fprintf(stderr, "%ld.%ld[%d]", (long)t->key.tv_sec, (long)t->key.tv_usec, i);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -360,9 +360,9 @@ void Curl_splayprint(struct Curl_tree * t, int d, char output)
|
||||
|
||||
if(output) {
|
||||
if(count)
|
||||
printf(" [%d more]\n", count);
|
||||
fprintf(stderr, " [%d more]\n", count);
|
||||
else
|
||||
printf("\n");
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
Curl_splayprint(t->smaller, d+1, output);
|
||||
|
||||
217
lib/ssh.c
217
lib/ssh.c
@@ -144,6 +144,17 @@ static
|
||||
CURLcode sftp_perform(struct connectdata *conn,
|
||||
bool *connected,
|
||||
bool *dophase_done);
|
||||
|
||||
static int ssh_getsock(struct connectdata *conn,
|
||||
curl_socket_t *sock, /* points to numsocks number
|
||||
of sockets */
|
||||
int numsocks);
|
||||
|
||||
static int ssh_perform_getsock(const struct connectdata *conn,
|
||||
curl_socket_t *sock, /* points to numsocks
|
||||
number of sockets */
|
||||
int numsocks);
|
||||
|
||||
/*
|
||||
* SCP protocol handler.
|
||||
*/
|
||||
@@ -157,8 +168,9 @@ const struct Curl_handler Curl_handler_scp = {
|
||||
ssh_connect, /* connect_it */
|
||||
ssh_multi_statemach, /* connecting */
|
||||
scp_doing, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ssh_getsock, /* proto_getsock */
|
||||
ssh_getsock, /* doing_getsock */
|
||||
ssh_perform_getsock, /* perform_getsock */
|
||||
scp_disconnect, /* disconnect */
|
||||
PORT_SSH, /* defport */
|
||||
PROT_SCP /* protocol */
|
||||
@@ -178,8 +190,9 @@ const struct Curl_handler Curl_handler_sftp = {
|
||||
ssh_connect, /* connect_it */
|
||||
ssh_multi_statemach, /* connecting */
|
||||
sftp_doing, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ssh_getsock, /* proto_getsock */
|
||||
ssh_getsock, /* doing_getsock */
|
||||
ssh_perform_getsock, /* perform_getsock */
|
||||
sftp_disconnect, /* disconnect */
|
||||
PORT_SSH, /* defport */
|
||||
PROT_SFTP /* protocol */
|
||||
@@ -418,6 +431,16 @@ static CURLcode ssh_getworkingpath(struct connectdata *conn,
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Earlier libssh2 versions didn't have the ability to seek to 64bit positions
|
||||
* with 32bit size_t.
|
||||
*/
|
||||
#ifdef HAVE_LIBSSH2_SFTP_SEEK64
|
||||
#define SFTP_SEEK(x,y) libssh2_sftp_seek64(x, (libssh2_uint64_t)y)
|
||||
#else
|
||||
#define SFTP_SEEK(x,y) libssh2_sftp_seek(x, y)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ssh_statemach_act() runs the SSH statemachine "one round" and returns. The
|
||||
* data the pointer 'block' points to will be set to TRUE if the libssh2
|
||||
@@ -778,6 +801,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
|
||||
/* Return the error type */
|
||||
err = libssh2_sftp_last_error(sshc->sftp_session);
|
||||
result = sftp_libssh2_error_to_CURLE(err);
|
||||
sshc->actualcode = result?result:CURLE_SSH;
|
||||
DEBUGF(infof(data, "error = %d makes libcurl = %d\n", err, result));
|
||||
state(conn, SSH_STOP);
|
||||
break;
|
||||
@@ -1238,16 +1262,22 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
|
||||
flags, data->set.new_file_perms);
|
||||
|
||||
if(!sshc->sftp_handle) {
|
||||
if(libssh2_session_last_errno(sshc->ssh_session) ==
|
||||
LIBSSH2_ERROR_EAGAIN) {
|
||||
rc = LIBSSH2_ERROR_EAGAIN;
|
||||
rc = libssh2_session_last_errno(sshc->ssh_session);
|
||||
|
||||
if(LIBSSH2_ERROR_EAGAIN == rc)
|
||||
break;
|
||||
}
|
||||
else {
|
||||
err = libssh2_sftp_last_error(sshc->sftp_session);
|
||||
if(LIBSSH2_ERROR_SFTP_PROTOCOL == rc)
|
||||
/* only when there was an SFTP protocol error can we extract
|
||||
the sftp error! */
|
||||
err = libssh2_sftp_last_error(sshc->sftp_session);
|
||||
else
|
||||
err = -1; /* not an sftp error at all */
|
||||
|
||||
if(sshc->secondCreateDirs) {
|
||||
state(conn, SSH_SFTP_CLOSE);
|
||||
sshc->actualcode = sftp_libssh2_error_to_CURLE(err);
|
||||
sshc->actualcode = err>= LIBSSH2_FX_OK?
|
||||
sftp_libssh2_error_to_CURLE(err):CURLE_SSH;
|
||||
failf(data, "Creating the dir/file failed: %s",
|
||||
sftp_libssh2_strerror(err));
|
||||
break;
|
||||
@@ -1263,8 +1293,18 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
|
||||
break;
|
||||
}
|
||||
state(conn, SSH_SFTP_CLOSE);
|
||||
sshc->actualcode = sftp_libssh2_error_to_CURLE(err);
|
||||
failf(data, "Upload failed: %s", sftp_libssh2_strerror(err));
|
||||
sshc->actualcode = err>= LIBSSH2_FX_OK?
|
||||
sftp_libssh2_error_to_CURLE(err):CURLE_SSH;
|
||||
if(!sshc->actualcode) {
|
||||
/* Sometimes, for some reason libssh2_sftp_last_error() returns zero
|
||||
even though libssh2_sftp_open() failed previously! We need to
|
||||
work around that! */
|
||||
sshc->actualcode = CURLE_SSH;
|
||||
err=-1;
|
||||
}
|
||||
failf(data, "Upload failed: %s (%d/%d)",
|
||||
err>= LIBSSH2_FX_OK?sftp_libssh2_strerror(err):"ssh error",
|
||||
err, rc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1313,7 +1353,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
|
||||
Curl_pgrsSetUploadSize(data, data->set.infilesize);
|
||||
}
|
||||
|
||||
libssh2_sftp_seek(sshc->sftp_handle, data->state.resume_from);
|
||||
SFTP_SEEK(sshc->sftp_handle, data->state.resume_from);
|
||||
}
|
||||
if(data->set.infilesize>0) {
|
||||
data->req.size = data->set.infilesize;
|
||||
@@ -1328,6 +1368,10 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
|
||||
sshc->actualcode = result;
|
||||
}
|
||||
else {
|
||||
/* store this original bitmask setup to use later on if we can't figure
|
||||
out a "real" bitmask */
|
||||
sshc->orig_waitfor = data->req.keepon;
|
||||
|
||||
state(conn, SSH_STOP);
|
||||
}
|
||||
break;
|
||||
@@ -1378,7 +1422,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
|
||||
(sftp_err != LIBSSH2_FX_PERMISSION_DENIED)) {
|
||||
result = sftp_libssh2_error_to_CURLE(sftp_err);
|
||||
state(conn, SSH_SFTP_CLOSE);
|
||||
sshc->actualcode = result;
|
||||
sshc->actualcode = result?result:CURLE_SSH;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1403,7 +1447,8 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
|
||||
failf(data, "Could not open directory for reading: %s",
|
||||
sftp_libssh2_strerror(err));
|
||||
state(conn, SSH_SFTP_CLOSE);
|
||||
sshc->actualcode = sftp_libssh2_error_to_CURLE(err);
|
||||
result = sftp_libssh2_error_to_CURLE(err);
|
||||
sshc->actualcode = result?result:CURLE_SSH;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1512,7 +1557,8 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
|
||||
}
|
||||
else if(sshc->readdir_len <= 0) {
|
||||
err = libssh2_sftp_last_error(sshc->sftp_session);
|
||||
sshc->actualcode = sftp_libssh2_error_to_CURLE(err);
|
||||
result = sftp_libssh2_error_to_CURLE(err);
|
||||
sshc->actualcode = result?result:CURLE_SSH;
|
||||
failf(data, "Could not open remote file for reading: %s :: %d",
|
||||
sftp_libssh2_strerror(err),
|
||||
libssh2_session_last_errno(sshc->ssh_session));
|
||||
@@ -1621,7 +1667,8 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
|
||||
failf(data, "Could not open remote file for reading: %s",
|
||||
sftp_libssh2_strerror(err));
|
||||
state(conn, SSH_SFTP_CLOSE);
|
||||
sshc->actualcode = sftp_libssh2_error_to_CURLE(err);
|
||||
result = sftp_libssh2_error_to_CURLE(err);
|
||||
sshc->actualcode = result?result:CURLE_SSH;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1679,7 +1726,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
|
||||
size = to - from + 1;
|
||||
}
|
||||
|
||||
libssh2_sftp_seek(conn->proto.sshc.sftp_handle, from);
|
||||
SFTP_SEEK(conn->proto.sshc.sftp_handle, from);
|
||||
}
|
||||
data->req.size = size;
|
||||
data->req.maxdownload = size;
|
||||
@@ -1713,7 +1760,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
|
||||
data->req.maxdownload = attrs.filesize - data->state.resume_from;
|
||||
Curl_pgrsSetDownloadSize(data,
|
||||
attrs.filesize - data->state.resume_from);
|
||||
libssh2_sftp_seek(sshc->sftp_handle, data->state.resume_from);
|
||||
SFTP_SEEK(sshc->sftp_handle, data->state.resume_from);
|
||||
}
|
||||
}
|
||||
/* Setup the actual download */
|
||||
@@ -2035,17 +2082,92 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
|
||||
return result;
|
||||
}
|
||||
|
||||
/* called by the multi interface to figure out what socket(s) to wait for and
|
||||
for what actions in the DO_DONE, PERFORM and WAITPERFORM states */
|
||||
static int ssh_perform_getsock(const struct connectdata *conn,
|
||||
curl_socket_t *sock, /* points to numsocks
|
||||
number of sockets */
|
||||
int numsocks)
|
||||
{
|
||||
#ifdef HAVE_LIBSSH2_SESSION_BLOCK_DIRECTIONS
|
||||
int bitmap = GETSOCK_BLANK;
|
||||
(void)numsocks;
|
||||
|
||||
sock[0] = conn->sock[FIRSTSOCKET];
|
||||
|
||||
if(conn->proto.sshc.waitfor & KEEP_READ)
|
||||
bitmap |= GETSOCK_READSOCK(FIRSTSOCKET);
|
||||
|
||||
if(conn->proto.sshc.waitfor & KEEP_WRITE)
|
||||
bitmap |= GETSOCK_WRITESOCK(FIRSTSOCKET);
|
||||
|
||||
return bitmap;
|
||||
#else
|
||||
/* if we don't know the direction we can use the generic *_getsock()
|
||||
function even for the protocol_connect and doing states */
|
||||
return Curl_single_getsock(conn, sock, numsocks);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Generic function called by the multi interface to figure out what socket(s)
|
||||
to wait for and for what actions during the DOING and PROTOCONNECT states*/
|
||||
static int ssh_getsock(struct connectdata *conn,
|
||||
curl_socket_t *sock, /* points to numsocks number
|
||||
of sockets */
|
||||
int numsocks)
|
||||
{
|
||||
#ifndef HAVE_LIBSSH2_SESSION_BLOCK_DIRECTIONS
|
||||
(void)conn;
|
||||
(void)sock;
|
||||
(void)numsocks;
|
||||
/* if we don't know any direction we can just play along as we used to and
|
||||
not provide any sensible info */
|
||||
return GETSOCK_BLANK;
|
||||
#else
|
||||
/* if we know the direction we can use the generic *_getsock() function even
|
||||
for the protocol_connect and doing states */
|
||||
return ssh_perform_getsock(conn, sock, numsocks);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBSSH2_SESSION_BLOCK_DIRECTIONS
|
||||
/*
|
||||
* When one of the libssh2 functions has returned LIBSSH2_ERROR_EAGAIN this
|
||||
* function is used to figure out in what direction and stores this info so
|
||||
* that the multi interface can take advantage of it. Make sure to call this
|
||||
* function in all cases so that when it _doesn't_ return EAGAIN we can
|
||||
* restore the default wait bits.
|
||||
*/
|
||||
static void ssh_block2waitfor(struct connectdata *conn, bool block)
|
||||
{
|
||||
struct ssh_conn *sshc = &conn->proto.sshc;
|
||||
int dir;
|
||||
if(block && (dir = libssh2_session_block_directions(sshc->ssh_session))) {
|
||||
/* translate the libssh2 define bits into our own bit defines */
|
||||
sshc->waitfor = ((dir&LIBSSH2_SESSION_BLOCK_INBOUND)?KEEP_READ:0) |
|
||||
((dir&LIBSSH2_SESSION_BLOCK_OUTBOUND)?KEEP_WRITE:0);
|
||||
}
|
||||
else
|
||||
/* It didn't block or libssh2 didn't reveal in which direction, put back
|
||||
the original set */
|
||||
sshc->waitfor = sshc->orig_waitfor;
|
||||
}
|
||||
#else
|
||||
/* no libssh2 directional support so we simply don't know */
|
||||
#define ssh_block2waitfor(x,y)
|
||||
#endif
|
||||
|
||||
/* called repeatedly until done from multi.c */
|
||||
static CURLcode ssh_multi_statemach(struct connectdata *conn, bool *done)
|
||||
{
|
||||
struct ssh_conn *sshc = &conn->proto.sshc;
|
||||
CURLcode result = CURLE_OK;
|
||||
bool block_we_ignore; /* we don't care about EAGAIN at this point, but TODO:
|
||||
we _should_ store the status and use that to
|
||||
provide a ssh_getsock() implementation */
|
||||
bool block; /* we store the status and use that to provide a ssh_getsock()
|
||||
implementation */
|
||||
|
||||
result = ssh_statemach_act(conn, &block_we_ignore);
|
||||
result = ssh_statemach_act(conn, &block);
|
||||
*done = (bool)(sshc->state == SSH_STOP);
|
||||
ssh_block2waitfor(conn, block);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -2150,10 +2272,7 @@ static CURLcode ssh_connect(struct connectdata *conn, bool *done)
|
||||
}
|
||||
|
||||
#ifdef CURL_LIBSSH2_DEBUG
|
||||
libssh2_trace(ssh->ssh_session, LIBSSH2_TRACE_CONN|LIBSSH2_TRACE_TRANS|
|
||||
LIBSSH2_TRACE_KEX|LIBSSH2_TRACE_AUTH|LIBSSH2_TRACE_SCP|
|
||||
LIBSSH2_TRACE_SFTP|LIBSSH2_TRACE_ERROR|
|
||||
LIBSSH2_TRACE_PUBLICKEY);
|
||||
libssh2_trace(ssh->ssh_session, ~0);
|
||||
infof(data, "SSH socket: %d\n", sock);
|
||||
#endif /* CURL_LIBSSH2_DEBUG */
|
||||
|
||||
@@ -2289,31 +2408,26 @@ static CURLcode scp_disconnect(struct connectdata *conn)
|
||||
static CURLcode ssh_done(struct connectdata *conn, CURLcode status)
|
||||
{
|
||||
CURLcode result = CURLE_OK;
|
||||
bool done = FALSE;
|
||||
struct SSHPROTO *sftp_scp = conn->data->state.proto.ssh;
|
||||
|
||||
if(status == CURLE_OK) {
|
||||
/* run the state-machine */
|
||||
if(conn->data->state.used_interface == Curl_if_multi) {
|
||||
result = ssh_multi_statemach(conn, &done);
|
||||
}
|
||||
else {
|
||||
result = ssh_easy_statemach(conn);
|
||||
done = TRUE;
|
||||
}
|
||||
/* run the state-machine
|
||||
|
||||
TODO: when the multi interface this _really_ should be using the
|
||||
ssh_multi_statemach function but we have no general support for
|
||||
non-blocking DONE operations, not in the multi state machine and with
|
||||
Curl_done() invokes on several places in the code!
|
||||
*/
|
||||
result = ssh_easy_statemach(conn);
|
||||
}
|
||||
else {
|
||||
else
|
||||
result = status;
|
||||
done = TRUE;
|
||||
}
|
||||
|
||||
if(done) {
|
||||
struct SSHPROTO *sftp_scp = conn->data->state.proto.ssh;
|
||||
|
||||
Curl_safefree(sftp_scp->path);
|
||||
sftp_scp->path = NULL;
|
||||
Curl_pgrsDone(conn);
|
||||
}
|
||||
Curl_safefree(sftp_scp->path);
|
||||
sftp_scp->path = NULL;
|
||||
Curl_pgrsDone(conn);
|
||||
|
||||
conn->data->req.keepon = 0; /* clear all bits */
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -2340,6 +2454,9 @@ ssize_t Curl_scp_send(struct connectdata *conn, int sockindex,
|
||||
/* libssh2_channel_write() returns int! */
|
||||
nwrite = (ssize_t)
|
||||
libssh2_channel_write(conn->proto.sshc.ssh_channel, mem, len);
|
||||
|
||||
ssh_block2waitfor(conn, (nwrite == LIBSSH2_ERROR_EAGAIN)?TRUE:FALSE);
|
||||
|
||||
if(nwrite == LIBSSH2_ERROR_EAGAIN)
|
||||
return 0;
|
||||
|
||||
@@ -2359,6 +2476,9 @@ ssize_t Curl_scp_recv(struct connectdata *conn, int sockindex,
|
||||
/* libssh2_channel_read() returns int */
|
||||
nread = (ssize_t)
|
||||
libssh2_channel_read(conn->proto.sshc.ssh_channel, mem, len);
|
||||
|
||||
ssh_block2waitfor(conn, (nread == LIBSSH2_ERROR_EAGAIN)?TRUE:FALSE);
|
||||
|
||||
return nread;
|
||||
}
|
||||
|
||||
@@ -2470,6 +2590,9 @@ ssize_t Curl_sftp_send(struct connectdata *conn, int sockindex,
|
||||
(void)sockindex;
|
||||
|
||||
nwrite = libssh2_sftp_write(conn->proto.sshc.sftp_handle, mem, len);
|
||||
|
||||
ssh_block2waitfor(conn, (nwrite == LIBSSH2_ERROR_EAGAIN)?TRUE:FALSE);
|
||||
|
||||
if(nwrite == LIBSSH2_ERROR_EAGAIN)
|
||||
return 0;
|
||||
|
||||
@@ -2487,6 +2610,8 @@ ssize_t Curl_sftp_recv(struct connectdata *conn, int sockindex,
|
||||
|
||||
nread = libssh2_sftp_read(conn->proto.sshc.sftp_handle, mem, len);
|
||||
|
||||
ssh_block2waitfor(conn, (nread == LIBSSH2_ERROR_EAGAIN)?TRUE:FALSE);
|
||||
|
||||
return nread;
|
||||
}
|
||||
|
||||
|
||||
13
lib/ssh.h
13
lib/ssh.h
@@ -30,11 +30,24 @@
|
||||
#endif
|
||||
|
||||
#if (LIBSSH2_VERSION_NUM >= 0x001300)
|
||||
/* libssh2 0.19 was the planned release version for a while before it was
|
||||
decided to instead become 1.0. Thus >= 0x001300 should still work fine
|
||||
for snapshots done during the 0.19 days as well as things released once
|
||||
it was bumped to 1.0 */
|
||||
# define HAVE_LIBSSH2_SESSION_BLOCK_DIRECTIONS 1
|
||||
#else
|
||||
# undef HAVE_LIBSSH2_SESSION_BLOCK_DIRECTIONS
|
||||
#endif
|
||||
|
||||
#if (LIBSSH2_VERSION_NUM >= 0x010000)
|
||||
/* libssh2_sftp_seek64() has only ever been provided by libssh2 1.0 or
|
||||
later */
|
||||
# define HAVE_LIBSSH2_SFTP_SEEK64 1
|
||||
#else
|
||||
# undef HAVE_LIBSSH2_SFTP_SEEK64
|
||||
#endif
|
||||
|
||||
|
||||
extern const struct Curl_handler Curl_handler_scp;
|
||||
extern const struct Curl_handler Curl_handler_sftp;
|
||||
|
||||
|
||||
@@ -923,10 +923,6 @@ static int asn1_output(const ASN1_UTCTIME *tm,
|
||||
int i;
|
||||
int year=0,month=0,day=0,hour=0,minute=0,second=0;
|
||||
|
||||
#ifdef CURL_DISABLE_VERBOSE_STRINGS
|
||||
(void)prefix;
|
||||
#endif
|
||||
|
||||
i=tm->length;
|
||||
asn1_string=(const char *)tm->data;
|
||||
|
||||
|
||||
@@ -193,6 +193,7 @@ const struct Curl_handler Curl_handler_telnet = {
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
ZERO_NULL, /* disconnect */
|
||||
PORT_TELNET, /* defport */
|
||||
PROT_TELNET /* protocol */
|
||||
|
||||
@@ -174,6 +174,7 @@ const struct Curl_handler Curl_handler_tftp = {
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
ZERO_NULL, /* disconnect */
|
||||
PORT_TFTP, /* defport */
|
||||
PROT_TFTP /* protocol */
|
||||
@@ -194,11 +195,12 @@ static CURLcode tftp_set_timeouts(tftp_state_data_t *state)
|
||||
{
|
||||
time_t maxtime, timeout;
|
||||
long timeout_ms;
|
||||
const bool start = (state->state == TFTP_STATE_START);
|
||||
|
||||
time(&state->start_time);
|
||||
|
||||
/* Compute drop-dead time */
|
||||
timeout_ms = Curl_timeleft(state->conn, NULL, TRUE);
|
||||
timeout_ms = Curl_timeleft(state->conn, NULL, start);
|
||||
|
||||
if(timeout_ms < 0) {
|
||||
/* time-out, bail out, go home */
|
||||
@@ -206,7 +208,7 @@ static CURLcode tftp_set_timeouts(tftp_state_data_t *state)
|
||||
return CURLE_OPERATION_TIMEDOUT;
|
||||
}
|
||||
|
||||
if(state->state == TFTP_STATE_START) {
|
||||
if(start) {
|
||||
|
||||
maxtime = (time_t)(timeout_ms + 500) / 1000;
|
||||
state->max_time = state->start_time+maxtime;
|
||||
|
||||
@@ -323,10 +323,6 @@ static int data_pending(const struct connectdata *conn)
|
||||
Curl_ssl_data_pending(conn, FIRSTSOCKET);
|
||||
}
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) (a < b ? a : b)
|
||||
#endif
|
||||
|
||||
static void read_rewind(struct connectdata *conn,
|
||||
size_t thismuch)
|
||||
{
|
||||
@@ -338,7 +334,7 @@ static void read_rewind(struct connectdata *conn,
|
||||
char buf[512 + 1];
|
||||
size_t show;
|
||||
|
||||
show = MIN(conn->buf_len - conn->read_pos, sizeof(buf)-1);
|
||||
show = CURLMIN(conn->buf_len - conn->read_pos, sizeof(buf)-1);
|
||||
if(conn->master_buffer) {
|
||||
memcpy(buf, conn->master_buffer + conn->read_pos, show);
|
||||
buf[show] = '\0';
|
||||
@@ -1524,6 +1520,7 @@ static CURLcode readwrite_upload(struct SessionHandle *data,
|
||||
data->req.upload_fromhere, /* buffer pointer */
|
||||
data->req.upload_present, /* buffer size */
|
||||
&bytes_written); /* actually send away */
|
||||
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
@@ -1744,6 +1741,9 @@ int Curl_single_getsock(const struct connectdata *conn,
|
||||
int bitmap = GETSOCK_BLANK;
|
||||
unsigned sockindex = 0;
|
||||
|
||||
if(conn->handler->perform_getsock)
|
||||
return conn->handler->perform_getsock(conn, sock, numsocks);
|
||||
|
||||
if(numsocks < 2)
|
||||
/* simple check but we might need two slots */
|
||||
return GETSOCK_BLANK;
|
||||
|
||||
215
lib/url.c
215
lib/url.c
@@ -218,6 +218,7 @@ static const struct Curl_handler Curl_handler_dummy = {
|
||||
ZERO_NULL, /* doing */
|
||||
ZERO_NULL, /* proto_getsock */
|
||||
ZERO_NULL, /* doing_getsock */
|
||||
ZERO_NULL, /* perform_getsock */
|
||||
ZERO_NULL, /* disconnect */
|
||||
0, /* defport */
|
||||
0 /* protocol */
|
||||
@@ -621,6 +622,77 @@ void Curl_rm_connc(struct conncache *c)
|
||||
free(c);
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize the UserDefined fields within a SessionHandle.
|
||||
* This may be safely called on a new or existing SessionHandle.
|
||||
*/
|
||||
CURLcode Curl_init_userdefined(struct UserDefined *set)
|
||||
{
|
||||
CURLcode res = CURLE_OK;
|
||||
|
||||
set->out = stdout; /* default output to stdout */
|
||||
set->in = stdin; /* default input from stdin */
|
||||
set->err = stderr; /* default stderr to stderr */
|
||||
|
||||
/* use fwrite as default function to store output */
|
||||
set->fwrite_func = (curl_write_callback)fwrite;
|
||||
|
||||
/* use fread as default function to read input */
|
||||
set->fread_func = (curl_read_callback)fread;
|
||||
|
||||
set->seek_func = ZERO_NULL;
|
||||
set->seek_client = ZERO_NULL;
|
||||
|
||||
/* conversion callbacks for non-ASCII hosts */
|
||||
set->convfromnetwork = ZERO_NULL;
|
||||
set->convtonetwork = ZERO_NULL;
|
||||
set->convfromutf8 = ZERO_NULL;
|
||||
|
||||
set->infilesize = -1; /* we don't know any size */
|
||||
set->postfieldsize = -1; /* unknown size */
|
||||
set->maxredirs = -1; /* allow any amount by default */
|
||||
|
||||
set->httpreq = HTTPREQ_GET; /* Default HTTP request */
|
||||
set->ftp_use_epsv = TRUE; /* FTP defaults to EPSV operations */
|
||||
set->ftp_use_eprt = TRUE; /* FTP defaults to EPRT operations */
|
||||
set->ftp_filemethod = FTPFILE_MULTICWD;
|
||||
|
||||
set->dns_cache_timeout = 60; /* Timeout every 60 seconds by default */
|
||||
|
||||
/* Set the default size of the SSL session ID cache */
|
||||
set->ssl.numsessions = 5;
|
||||
|
||||
set->proxyport = CURL_DEFAULT_PROXY_PORT; /* from url.h */
|
||||
set->proxytype = CURLPROXY_HTTP; /* defaults to HTTP proxy */
|
||||
set->httpauth = CURLAUTH_BASIC; /* defaults to basic */
|
||||
set->proxyauth = CURLAUTH_BASIC; /* defaults to basic */
|
||||
|
||||
/* make libcurl quiet by default: */
|
||||
set->hide_progress = TRUE; /* CURLOPT_NOPROGRESS changes these */
|
||||
|
||||
/*
|
||||
* libcurl 7.10 introduced SSL verification *by default*! This needs to be
|
||||
* switched off unless wanted.
|
||||
*/
|
||||
set->ssl.verifypeer = TRUE;
|
||||
set->ssl.verifyhost = 2;
|
||||
set->ssh_auth_types = CURLSSH_AUTH_DEFAULT; /* defaults to any auth
|
||||
type */
|
||||
set->ssl.sessionid = TRUE; /* session ID caching enabled by default */
|
||||
|
||||
set->new_file_perms = 0644; /* Default permissions */
|
||||
set->new_directory_perms = 0755; /* Default permissions */
|
||||
|
||||
/* This is our preferred CA cert bundle/path since install time */
|
||||
#if defined(CURL_CA_BUNDLE)
|
||||
res = setstropt(&set->str[STRING_SSL_CAFILE], (char *) CURL_CA_BUNDLE);
|
||||
#elif defined(CURL_CA_PATH)
|
||||
res = setstropt(&set->str[STRING_SSL_CAPATH], (char *) CURL_CA_PATH);
|
||||
#endif
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Curl_open()
|
||||
*
|
||||
@@ -668,27 +740,11 @@ CURLcode Curl_open(struct SessionHandle **curl)
|
||||
res = CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
else {
|
||||
Curl_easy_initHandleData(data);
|
||||
res = Curl_init_userdefined(&data->set);
|
||||
|
||||
data->state.headersize=HEADERSIZE;
|
||||
|
||||
data->set.out = stdout; /* default output to stdout */
|
||||
data->set.in = stdin; /* default input from stdin */
|
||||
data->set.err = stderr; /* default stderr to stderr */
|
||||
|
||||
/* use fwrite as default function to store output */
|
||||
data->set.fwrite_func = (curl_write_callback)fwrite;
|
||||
|
||||
/* use fread as default function to read input */
|
||||
data->set.fread_func = (curl_read_callback)fread;
|
||||
|
||||
/* don't use a seek function by default */
|
||||
data->set.seek_func = ZERO_NULL;
|
||||
data->set.seek_client = ZERO_NULL;
|
||||
|
||||
/* conversion callbacks for non-ASCII hosts */
|
||||
data->set.convfromnetwork = ZERO_NULL;
|
||||
data->set.convtonetwork = ZERO_NULL;
|
||||
data->set.convfromutf8 = ZERO_NULL;
|
||||
|
||||
#if defined(CURL_DOES_CONVERSIONS) && defined(HAVE_ICONV)
|
||||
/* conversion descriptors for iconv calls */
|
||||
data->outbound_cd = (iconv_t)-1;
|
||||
@@ -696,57 +752,15 @@ CURLcode Curl_open(struct SessionHandle **curl)
|
||||
data->utf8_cd = (iconv_t)-1;
|
||||
#endif /* CURL_DOES_CONVERSIONS && HAVE_ICONV */
|
||||
|
||||
data->set.infilesize = -1; /* we don't know any size */
|
||||
data->set.postfieldsize = -1;
|
||||
data->set.maxredirs = -1; /* allow any amount by default */
|
||||
data->state.current_speed = -1; /* init to negative == impossible */
|
||||
/* most recent connection is not yet defined */
|
||||
data->state.lastconnect = -1;
|
||||
|
||||
data->set.httpreq = HTTPREQ_GET; /* Default HTTP request */
|
||||
data->set.ftp_use_epsv = TRUE; /* FTP defaults to EPSV operations */
|
||||
data->set.ftp_use_eprt = TRUE; /* FTP defaults to EPRT operations */
|
||||
data->set.ftp_filemethod = FTPFILE_MULTICWD;
|
||||
data->set.dns_cache_timeout = 60; /* Timeout every 60 seconds by default */
|
||||
|
||||
/* make libcurl quiet by default: */
|
||||
data->set.hide_progress = TRUE; /* CURLOPT_NOPROGRESS changes these */
|
||||
data->progress.flags |= PGRS_HIDE;
|
||||
|
||||
/* Set the default size of the SSL session ID cache */
|
||||
data->set.ssl.numsessions = 5;
|
||||
|
||||
data->set.proxyport = CURL_DEFAULT_PROXY_PORT; /* from url.h */
|
||||
data->set.proxytype = CURLPROXY_HTTP; /* defaults to HTTP proxy */
|
||||
data->set.httpauth = CURLAUTH_BASIC; /* defaults to basic */
|
||||
data->set.proxyauth = CURLAUTH_BASIC; /* defaults to basic */
|
||||
data->state.current_speed = -1; /* init to negative == impossible */
|
||||
|
||||
/* This no longer creates a connection cache here. It is instead made on
|
||||
the first call to curl_easy_perform() or when the handle is added to a
|
||||
multi stack. */
|
||||
|
||||
data->set.ssh_auth_types = CURLSSH_AUTH_DEFAULT; /* defaults to any auth
|
||||
type */
|
||||
data->set.new_file_perms = 0644; /* Default permissions */
|
||||
data->set.new_directory_perms = 0755; /* Default permissions */
|
||||
|
||||
/* most recent connection is not yet defined */
|
||||
data->state.lastconnect = -1;
|
||||
|
||||
Curl_easy_initHandleData(data);
|
||||
|
||||
/*
|
||||
* libcurl 7.10 introduced SSL verification *by default*! This needs to be
|
||||
* switched off unless wanted.
|
||||
*/
|
||||
data->set.ssl.verifypeer = TRUE;
|
||||
data->set.ssl.verifyhost = 2;
|
||||
data->set.ssl.sessionid = TRUE; /* session ID caching enabled by default */
|
||||
/* This is our preferred CA cert bundle/path since install time */
|
||||
#if defined(CURL_CA_BUNDLE)
|
||||
res = setstropt(&data->set.str[STRING_SSL_CAFILE],
|
||||
(char *) CURL_CA_BUNDLE);
|
||||
#elif defined(CURL_CA_PATH)
|
||||
res = setstropt(&data->set.str[STRING_SSL_CAPATH], (char *) CURL_CA_PATH);
|
||||
#endif
|
||||
}
|
||||
|
||||
if(res) {
|
||||
@@ -1319,6 +1333,16 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
||||
*/
|
||||
{
|
||||
long auth = va_arg(param, long);
|
||||
|
||||
/* the DIGEST_IE bit is only used to set a special marker, for all the
|
||||
rest we need to handle it as normal DIGEST */
|
||||
data->state.authhost.iestyle = (auth & CURLAUTH_DIGEST_IE)?TRUE:FALSE;
|
||||
|
||||
if(auth & CURLAUTH_DIGEST_IE) {
|
||||
auth |= CURLAUTH_DIGEST; /* set standard digest bit */
|
||||
auth &= ~CURLAUTH_DIGEST_IE; /* unset ie digest bit */
|
||||
}
|
||||
|
||||
/* switch off bits we can't support */
|
||||
#ifndef USE_NTLM
|
||||
auth &= ~CURLAUTH_NTLM; /* no NTLM without SSL */
|
||||
@@ -1354,6 +1378,15 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
||||
*/
|
||||
{
|
||||
long auth = va_arg(param, long);
|
||||
|
||||
/* the DIGEST_IE bit is only used to set a special marker, for all the
|
||||
rest we need to handle it as normal DIGEST */
|
||||
data->state.authproxy.iestyle = (auth & CURLAUTH_DIGEST_IE)?TRUE:FALSE;
|
||||
|
||||
if(auth & CURLAUTH_DIGEST_IE) {
|
||||
auth |= CURLAUTH_DIGEST; /* set standard digest bit */
|
||||
auth &= ~CURLAUTH_DIGEST_IE; /* unset ie digest bit */
|
||||
}
|
||||
/* switch off bits we can't support */
|
||||
#ifndef USE_NTLM
|
||||
auth &= ~CURLAUTH_NTLM; /* no NTLM without SSL */
|
||||
@@ -2359,20 +2392,6 @@ int Curl_removeHandleFromPipeline(struct SessionHandle *handle,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* remove the specified connection from all (possible) pipelines and related
|
||||
queues */
|
||||
void Curl_getoff_all_pipelines(struct SessionHandle *data,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
if(Curl_removeHandleFromPipeline(data, conn->recv_pipe) &&
|
||||
conn->readchannel_inuse)
|
||||
conn->readchannel_inuse = FALSE;
|
||||
if(Curl_removeHandleFromPipeline(data, conn->send_pipe) &&
|
||||
conn->writechannel_inuse)
|
||||
conn->writechannel_inuse = FALSE;
|
||||
Curl_removeHandleFromPipeline(data, conn->pend_pipe);
|
||||
}
|
||||
|
||||
#if 0 /* this code is saved here as it is useful for debugging purposes */
|
||||
static void Curl_printPipeline(struct curl_llist *pipeline)
|
||||
{
|
||||
@@ -2397,6 +2416,24 @@ static struct SessionHandle* gethandleathead(struct curl_llist *pipeline)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* remove the specified connection from all (possible) pipelines and related
|
||||
queues */
|
||||
void Curl_getoff_all_pipelines(struct SessionHandle *data,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
bool recv_head = conn->readchannel_inuse &&
|
||||
(gethandleathead(conn->recv_pipe) == data);
|
||||
|
||||
bool send_head = conn->writechannel_inuse &&
|
||||
(gethandleathead(conn->send_pipe) == data);
|
||||
|
||||
if(Curl_removeHandleFromPipeline(data, conn->recv_pipe) && recv_head)
|
||||
conn->readchannel_inuse = FALSE;
|
||||
if(Curl_removeHandleFromPipeline(data, conn->send_pipe) && send_head)
|
||||
conn->writechannel_inuse = FALSE;
|
||||
Curl_removeHandleFromPipeline(data, conn->pend_pipe);
|
||||
}
|
||||
|
||||
static void signalPipeClose(struct curl_llist *pipeline)
|
||||
{
|
||||
struct curl_llist_element *curr;
|
||||
@@ -3705,7 +3742,11 @@ static CURLcode parse_remote_port(struct SessionHandle *data,
|
||||
char *portptr;
|
||||
char endbracket;
|
||||
|
||||
if((1 == sscanf(conn->host.name, "[%*39[0123456789abcdefABCDEF:.%]%c", &endbracket)) &&
|
||||
/* Note that at this point, the IPv6 address cannot contain any scope
|
||||
suffix as that has already been removed in the ParseURLAndFillConnection()
|
||||
function */
|
||||
if((1 == sscanf(conn->host.name, "[%*45[0123456789abcdefABCDEF:.]%c",
|
||||
&endbracket)) &&
|
||||
(']' == endbracket)) {
|
||||
/* this is a RFC2732-style specified IP-address */
|
||||
conn->bits.ipv6_ip = TRUE;
|
||||
@@ -4495,22 +4536,28 @@ CURLcode Curl_connect(struct SessionHandle *data,
|
||||
|
||||
if(CURLE_OK == code) {
|
||||
/* no error */
|
||||
if((*in_connect)->send_pipe->size +
|
||||
(*in_connect)->recv_pipe->size != 0)
|
||||
if((*in_connect)->send_pipe->size || (*in_connect)->recv_pipe->size)
|
||||
/* pipelining */
|
||||
*protocol_done = TRUE;
|
||||
else {
|
||||
|
||||
if(dns || !*asyncp)
|
||||
/* If an address is available it means that we already have the name
|
||||
resolved, OR it isn't async. if this is a re-used connection 'dns'
|
||||
will be NULL here. Continue connecting from here */
|
||||
code = setup_conn(*in_connect, dns, protocol_done);
|
||||
/* else
|
||||
response will be received and treated async wise */
|
||||
|
||||
if(dns && code) {
|
||||
/* We have the dns entry info already but failed to connect to the
|
||||
* host and thus we must make sure to unlock the dns entry again
|
||||
* before returning failure from here.
|
||||
*/
|
||||
Curl_resolv_unlock(data, dns);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(CURLE_OK != code && *in_connect) {
|
||||
if(code && *in_connect) {
|
||||
/* We're not allowed to return failure with memory left allocated
|
||||
in the connectdata struct, free those here */
|
||||
Curl_disconnect(*in_connect); /* close the connection */
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
*/
|
||||
|
||||
CURLcode Curl_open(struct SessionHandle **curl);
|
||||
CURLcode Curl_init_userdefined(struct UserDefined *set);
|
||||
CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
||||
va_list arg);
|
||||
CURLcode Curl_dupset(struct SessionHandle * dst, struct SessionHandle * src);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2009, 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
|
||||
@@ -150,9 +150,11 @@
|
||||
|
||||
#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
|
||||
|
||||
/* Just a convenience macro to get the larger value out of two given.
|
||||
/* Some convenience macros to get the larger/smaller value out of two given.
|
||||
We prefix with CURL to prevent name collisions. */
|
||||
#define CURLMAX(x,y) ((x)>(y)?(x):(y))
|
||||
#define CURLMIN(x,y) ((x)<(y)?(x):(y))
|
||||
|
||||
|
||||
#if defined(HAVE_KRB4) || defined(HAVE_GSSAPI)
|
||||
/* Types needed for krb4/5-ftp connections */
|
||||
@@ -222,9 +224,9 @@ struct ssl_config_data {
|
||||
1: check that CN exists
|
||||
2: CN must match hostname */
|
||||
char *CApath; /* certificate dir (doesn't work on windows) */
|
||||
char *CAfile; /* cerficate to verify peer against */
|
||||
const char *CRLfile; /* CRL to check cerficate revocation */
|
||||
const char *issuercert;/* optional issuer cerficate filename */
|
||||
char *CAfile; /* certificate to verify peer against */
|
||||
const char *CRLfile; /* CRL to check certificate revocation */
|
||||
const char *issuercert;/* optional issuer certificate filename */
|
||||
char *random_file; /* path to file containing "random" data */
|
||||
char *egdsocket; /* path to file containing the EGD daemon socket */
|
||||
char *cipher_list; /* list of ciphers to use */
|
||||
@@ -232,7 +234,7 @@ struct ssl_config_data {
|
||||
curl_ssl_ctx_callback fsslctx; /* function to initialize ssl ctx */
|
||||
void *fsslctxp; /* parameter for call back */
|
||||
bool sessionid; /* cache session IDs or not */
|
||||
bool certinfo; /* gather lots of cert info */
|
||||
bool certinfo; /* gather lots of certificate info */
|
||||
};
|
||||
|
||||
/* information stored about one single SSL session */
|
||||
@@ -413,7 +415,7 @@ struct FTP {
|
||||
curl_off_t downloadsize;
|
||||
};
|
||||
|
||||
/* ftp_conn is used for striuct connection-oriented data in the connectdata
|
||||
/* ftp_conn is used for struct connection-oriented data in the connectdata
|
||||
struct */
|
||||
struct ftp_conn {
|
||||
char *entrypath; /* the PWD reply when we logged on */
|
||||
@@ -528,7 +530,7 @@ struct SSHPROTO {
|
||||
struct ssh_conn {
|
||||
const char *authlist; /* List of auth. methods, managed by libssh2 */
|
||||
#ifdef USE_LIBSSH2
|
||||
const char *passphrase; /* passphrase to use */
|
||||
const char *passphrase; /* pass-phrase to use */
|
||||
char *rsa_pub; /* path name */
|
||||
char *rsa; /* path name */
|
||||
bool authed; /* the connection has been authenticated fine */
|
||||
@@ -559,6 +561,8 @@ struct ssh_conn {
|
||||
LIBSSH2_CHANNEL *ssh_channel; /* Secure Shell channel handle */
|
||||
LIBSSH2_SFTP *sftp_session; /* SFTP handle */
|
||||
LIBSSH2_SFTP_HANDLE *sftp_handle;
|
||||
int waitfor; /* current READ/WRITE bits to wait for */
|
||||
int orig_waitfor; /* default READ/WRITE bits wait for */
|
||||
#endif /* USE_LIBSSH2 */
|
||||
};
|
||||
|
||||
@@ -590,7 +594,7 @@ struct ConnectBits {
|
||||
bool do_more; /* this is set TRUE if the ->curl_do_more() function is
|
||||
supposed to be called, after ->curl_do() */
|
||||
|
||||
bool tcpconnect; /* the TCP layer (or simimlar) is connected, this is set
|
||||
bool tcpconnect; /* the TCP layer (or similar) is connected, this is set
|
||||
the first time on the first connect function call */
|
||||
bool protoconnstart;/* the protocol layer has STARTED its operation after
|
||||
the TCP layer connect */
|
||||
@@ -752,7 +756,7 @@ struct SingleRequest {
|
||||
int content_encoding; /* What content encoding. sec 3.5, RFC2616. */
|
||||
|
||||
#define IDENTITY 0 /* No encoding */
|
||||
#define DEFLATE 1 /* zlib delfate [RFC 1950 & 1951] */
|
||||
#define DEFLATE 1 /* zlib deflate [RFC 1950 & 1951] */
|
||||
#define GZIP 2 /* gzip algorithm [RFC 1952] */
|
||||
#define COMPRESS 3 /* Not handled, added for completeness */
|
||||
|
||||
@@ -850,6 +854,13 @@ struct Curl_handler {
|
||||
curl_socket_t *socks,
|
||||
int numsocks);
|
||||
|
||||
/* Called from the multi interface during the DO_DONE, PERFORM and
|
||||
WAITPERFORM phases, and it should then return a proper fd set. Not setting
|
||||
this will make libcurl use the generic default one. */
|
||||
int (*perform_getsock)(const struct connectdata *conn,
|
||||
curl_socket_t *socks,
|
||||
int numsocks);
|
||||
|
||||
/* This function *MAY* be set to a protocol-dependent function that is run
|
||||
* by the curl_disconnect(), as a step in the disconnection.
|
||||
*/
|
||||
@@ -1139,7 +1150,8 @@ struct auth {
|
||||
request */
|
||||
bool multi; /* TRUE if this is not yet authenticated but within the auth
|
||||
multipass negotiation */
|
||||
|
||||
bool iestyle; /* TRUE if digest should be done IE-style or FALSE if it should
|
||||
be RFC compliant */
|
||||
};
|
||||
|
||||
struct conncache {
|
||||
@@ -1224,7 +1236,7 @@ struct UrlState {
|
||||
struct timeval expiretime; /* set this with Curl_expire() only */
|
||||
struct Curl_tree timenode; /* for the splay stuff */
|
||||
|
||||
/* a place to store the most recenlty set FTP entrypath */
|
||||
/* a place to store the most recently set FTP entrypath */
|
||||
char *most_recent_ftp_entrypath;
|
||||
|
||||
/* set after initial USER failure, to prevent an authentication loop */
|
||||
@@ -1270,7 +1282,7 @@ struct UrlState {
|
||||
*************************************************************************
|
||||
* Note that this data will be REMOVED after each request, so anything that
|
||||
* should be kept/stored on a per-connection basis and thus live for the
|
||||
* next requst on the same connection MUST be put in the connectdata struct!
|
||||
* next request on the same connection MUST be put in the connectdata struct!
|
||||
*************************************************************************/
|
||||
union {
|
||||
struct HTTP *http;
|
||||
|
||||
29
maketgz
29
maketgz
@@ -1,6 +1,28 @@
|
||||
#! /bin/sh
|
||||
# Script to build release-archives with
|
||||
#
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2009, 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$
|
||||
###########################################################################
|
||||
|
||||
version=$1
|
||||
|
||||
@@ -40,8 +62,11 @@ sed 's/#define CURL_VERSION .*/#define CURL_VERSION "'$curlversion'"/g' $CHEADER
|
||||
|
||||
echo "generate VC8 makefiles"
|
||||
# Generate VC8 versions from the VC6 Makefile versions
|
||||
perl -pe 's%/GX /DWIN32 /YX%/EHsc /DWIN32%;' -e 's%/GZ%/RTC1%;' -e 's%wsock32.lib%wsock32.lib bufferoverflowu.lib%g;' -e 's%(VC)6%${1}8%gi;' lib/Makefile.vc6 > lib/Makefile.vc8.dist
|
||||
perl -pe "s%/GX /DWIN32 /YX%/EHsc /DWIN32%;" -e 's%/GZ%/RTC1%;' -e 's%wsock32.lib%wsock32.lib bufferoverflowu.lib%g;' -e 's%(VC)6%${1}8%gi;' -e 's/^#MANIFESTTOOL/MANIFESTTOOL/' src/Makefile.vc6 > src/Makefile.vc8.dist
|
||||
make -f Makefile.dist vc8
|
||||
|
||||
echo "generate VC9 makefiles"
|
||||
# Generate VC9 versions from the VC6 Makefile versions
|
||||
make -f Makefile.dist vc9
|
||||
|
||||
# Replace version number in plist file:
|
||||
PLIST=lib/libcurl.plist
|
||||
|
||||
@@ -127,9 +127,11 @@
|
||||
d CURLAUTH_GSSNEGOTIATE...
|
||||
d c X'00000004'
|
||||
d CURLAUTH_NTLM c X'00000008'
|
||||
d CURLAUTH_ANY c X'7FFFFFFF'
|
||||
d CURLAUTH_DIGEST_IE...
|
||||
d c X'00000010'
|
||||
d CURLAUTH_ANY c X'7FFFFFEF'
|
||||
d CURLAUTH_ANYSAFE...
|
||||
d c X'7FFFFFFE' ~CURLAUTH_BASIC
|
||||
d c X'7FFFFFEE' ~CURLAUTH_BASIC
|
||||
*
|
||||
d CURLSSH_AUTH_ANY...
|
||||
d c X'7FFFFFFF'
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user