Compare commits

...

1107 Commits

Author SHA1 Message Date
Daniel Stenberg
c262c35676 RELEASE-NOTES: synced with ef60fdbd73
Just before 7.26.0 is about to ship
2012-05-24 18:04:41 +02:00
Steve Holme
ef60fdbd73 smtp: Fixed an issue with the multi-interface always sending postdata
Due to the result code being reset to CURLE_OK when smtp_dophase_done()
was called, postdata would incorrectly be sent to the server when the
MAIL FROM or RCPT command was rejected.

As such, libcurl would return the wrong result code from performing the
operation and additionally set CURLINFO_RESPONSE_CODE to be that
returned by the postdata command.

Bug: http://curl.haxx.se/mail/lib-2012-05/0108.html
Reported by: Gokhan Sengun
2012-05-22 22:08:25 +01:00
Steve Holme
b1f081f6e6 DOCS: Updated version number for features added in the pending release 2012-05-22 20:20:59 +01:00
Tatsuhiro Tsujikawa
6cc066a2c5 Fixed compile error with GNUTLS+NETTLE
In nettle/md5.h, md5_init and md5_update are defined as macros to
nettle_md5_init and nettle_md5_update respectively.  This causes
error when using MD5_params.md5_init and md5_update.  This patch
renames these members as md5_init_func and md5_update_func to
avoid name conflict. For completeness, MD5_params.md5_final was
also renamed as md5_final_func.

The changes in curl_ntlm_core.c is conversion error and fixed by
casting to proper type.
2012-05-22 16:40:09 +02:00
Daniel Stenberg
0fd7fa7daf TODO-RELEASE: mention the pending biggies for 7.27.0 2012-05-22 11:56:19 +02:00
Jan Ehrhardt
9258b84673 winbuild: fix IPv6 enabled build
The existing check was wrong so IPv6 support would never be enabled
2012-05-22 11:12:25 +02:00
Daniel Stenberg
fdf2517bd9 7.26.0: will be the next release version 2012-05-22 10:56:50 +02:00
Daniel Stenberg
cc36756aa2 RELEASE-NOTES: synced with 8ae1e657e8
And mention that this will become 7.26.0
2012-05-22 10:54:55 +02:00
Guenter Knauf
1c58f291cc Updated dependency libary versions. 2012-05-22 04:15:37 +02:00
Daniel Stenberg
8ae1e657e8 curl-config.1: fix curl-config usage in example
The curl-config command must be used twice in the single command line to
work properly in some environments.

Bug: http://curl.haxx.se/bug/view.cgi?id=3528241
Reported by: Julian Taylor
2012-05-20 15:38:54 +02:00
Steve Holme
7ba07c80a1 smtp: Fixed non-escaping of dot character at beginning of line
A dot character at the beginning of a line would not be escaped to a
double dot as required by RFC-2821, instead it would be deleted by the
mail server. Please see section 4.5.2 of the RFC for more information.

Note: This fix also simplifies the detection of repeated CRLF.CRLF
combinations, such as CRLF.CRLF.CRLF, a little rather than having to
advance the eob counter to 2.
2012-05-17 11:31:06 +01:00
Daniel Stenberg
fec096f153 FAQ: updated 1.10 How many are using curl?
Now linking to http://daniel.haxx.se/blog/2012/05/16/300m-users/
2012-05-16 23:17:47 +02:00
Daniel Stenberg
499ffe2f8c disable-versioned-symbols: removed superfluous 'fi'
The commit e315927a1a left this in
2012-05-14 22:23:53 +02:00
Daniel Stenberg
cf41ee3ac9 MakefileBuild.vc: use the correct IDN variable
The variable that control IDN enablement is called USE_IDN within these
Makefiles
2012-05-14 11:40:59 +02:00
Pierre Chapuis
e315927a1a autoconf: improve handling of versioned symbols
It checks whether versioned symbols should be enabled before checking
whether it is possible (i.e. the linker supports --version-script) or
not. This avoids a useless warning when building cURL on a platform that
does not use GNU ld.

Moreover, it fixes broken indentation of this chunk of code.
2012-05-12 23:46:06 +02:00
Daniel Stenberg
03c1bcf4bd curl.1: clarify -x usage
1 - fix the syntax in the .IP line

2 - Provided user names and passwords are URL decoded by libcurl

Bug: http://curl.haxx.se/bug/view.cgi?id=3525935
2012-05-12 23:35:16 +02:00
Daniel Stenberg
92f841aef7 NTLM: is supported in GnuTLS builds too
... since commit 9a4c887c4a introduced in libcurl 7.19.4
2012-05-12 23:15:51 +02:00
Daniel Stenberg
9fafa68533 TODO: happy eyeballs is now RFC6555 2012-05-12 15:08:35 +02:00
Daniel Stenberg
e7257dcf2e my_useragent: shorten user-agent
The built-in user-agent will now only say curl/[version] and nothing
else in an attempt to decrease overhead in HTTP requests.
2012-05-12 15:07:07 +02:00
Daniel Stenberg
3ebcfdda36 CURLOPT_HEADERFUNCTION: works for non-HTTP protocols too 2012-05-07 00:13:46 +02:00
Claes Jakobsson
77bac26587 Add note about default timeout in CURLOPT_TIMEOUT 2012-05-03 13:49:55 +02:00
Gokhan Sengun
d6773834f2 MD5: OOM fix
check whether md5 initialization succeeded before updating digest of
buffers onto it
2012-05-02 22:58:15 +02:00
Daniel Stenberg
6f998400d9 REALEASE-NOTES: synced with 64f48e884e 2012-04-29 23:10:37 +02:00
Jan Schaumann
64f48e884e add newly created manual page 2012-04-27 20:25:35 +02:00
Jan Schaumann
e146a5f132 add a manual page for mk-ca-bundle 2012-04-27 20:25:35 +02:00
Guenter Knauf
1beda0cbb7 Updated dependency lib versions. 2012-04-26 14:40:50 +02:00
Daniel Stenberg
72b72fe8ed URL parse: reject numerical IPv6 addresses outside brackets
Roman Mamedov spotted (in
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=670126) that curl would
not complain when given a URL with an IPv6 numerical address without
brackets. It would simply cut off the last ":[hex]" part and thus not
work correctly.

That's a URL using an illegal syntax and now libcurl will instead return
a clear error code and error message detailing the error.

The above mentioned bug report claims this to be a regression but
libcurl does not guarantee functionality when given URLs that aren't
following the URL spec (RFC3986 mostly). I consider the fact that it
used to handle this differently a mere coincidence.
2012-04-23 23:18:42 +02:00
Daniel Stenberg
bd9eb30ffd Curl_MD5_init: fix OOM memory leak
Bug: http://curl.haxx.se/mail/lib-2012-04/0246.html
Reported by: Michael Mueller
2012-04-23 23:07:40 +02:00
Gokhan Sengun
dd18e714ff OpenSSL cert: provide more details when cert check fails
curl needs to be more chatty regarding certificate verification failure
during SSL handshake
2012-04-23 20:24:15 +02:00
Yang Tse
d6c449e3b4 Revert "sspi: Added version information"
This reverts commit 2976de4808.
2012-04-23 16:28:01 +02:00
Yang Tse
071f8d4182 Revert "sspi - Small code tidy up"
This reverts commit 46cd5f1dad.
2012-04-23 16:27:47 +02:00
Yang Tse
d83233501f Revert "Fixed 'extra tokens at end of #endif directive'."
This reverts commit 77172a242f.
2012-04-23 16:27:33 +02:00
Yang Tse
419a50f817 Revert "Fixed 'Trailing whitespace' found by checksrc."
This reverts commit 683bfa60ad.
2012-04-23 16:27:20 +02:00
Yang Tse
975d23480c Revert "sspi: Code tidy up to remove unused variable."
This reverts commit 412510f974.
2012-04-23 16:27:04 +02:00
Yang Tse
13211705cd Revert "Add -lversion if build with SSPI."
This reverts commit 9ec0b7e0c4.
2012-04-23 16:26:21 +02:00
Guenter Knauf
9ec0b7e0c4 Add -lversion if build with SSPI. 2012-04-23 02:15:30 +02:00
Steve Holme
412510f974 sspi: Code tidy up to remove unused variable. 2012-04-22 21:00:32 +01:00
Guenter Knauf
683bfa60ad Fixed 'Trailing whitespace' found by checksrc. 2012-04-22 21:19:36 +02:00
Guenter Knauf
77172a242f Fixed 'extra tokens at end of #endif directive'. 2012-04-22 21:10:17 +02:00
Steve Holme
46cd5f1dad sspi - Small code tidy up 2012-04-22 18:59:07 +01:00
Steve Holme
2976de4808 sspi: Added version information
Added version information for Windows SSPI to curl's main version
string and removed SSPI from the features string.
2012-04-22 18:49:27 +01:00
Daniel Stenberg
560cd62272 HTTP: empty chunked POST ended up in two zero size chunks
When doing a chunked-encoded POST with -d (CURLOPT_POSTFIELDS) and the
size of the POST was zero length, it made libcurl first send a zero
chunk and then the terminating one. This could confuse a receiver and it
should rather just send the terminating chunk as it does with this fix.

Test case 1333 is added to verify.

Bug: http://curl.haxx.se/mail/archive-2012-04/0060.html
Reported by: Arnaud Compan
2012-04-20 22:25:31 +02:00
Guenter Knauf
0f54880277 Updated dependency lib versions. 2012-04-20 13:33:54 +02:00
Daniel Stenberg
5cd524df18 singleipconnect: return OK even when Curl_socket() fails
Commit 9109cdec11 brought this regression (shipped since 7.24.0).

The singleipconnect() function must not return an error if Curl_socket()
returns an error. It should then simply return OK and pass a SOCKET_BAD
back simply because that is how the user of this function expects it to
work and something else is not fine.

Reported by: Blaise Potard
Bug: http://curl.haxx.se/bug/view.cgi?id=3516508
2012-04-19 23:31:50 +02:00
Yang Tse
94111bbbd4 Take in account that CURLAUTH_* bitmasks are now 'unsigned long' - follow-up
MIPSPro compiler detected curl_easy_getinfo() related missing adjustments.
SunPro compiler detected curl tool --libcurl option related missing adjustments.
2012-04-19 16:31:11 +02:00
Yang Tse
df4205c10a url.c: CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH fixes
Fail with CURLE_NOT_BUILT_IN when none of requested auth methods is supported.

Reject CURLAUTH_ONLY bit when given alone or with CURLAUTH_NONE.
2012-04-19 00:35:44 +02:00
Yang Tse
9421b06397 Take in account that CURLAUTH_* bitmasks are now 'unsigned long'
Data type of internal vars holding CURLAUTH_* bitmasks changed from 'long' to
'unsigned long' for proper handling and operating.
2012-04-18 23:04:35 +02:00
Yang Tse
09690be8de curl.h: CURLAUTH_* bitmasks adjusted to become 'unsigned long' typed
Info: http://curl.haxx.se/mail/lib-2012-04/0170.html
2012-04-18 23:04:07 +02:00
Yang Tse
ce8a321dd0 Some explicit conversion to 'long' of curl_easy_setopt() third argument
Explicit conversion to 'long' of curl_easy_setopt() third argument for options
CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH given that this is how its bitmasks are
docummented to be used.
2012-04-18 21:03:20 +02:00
Yang Tse
3833765ba5 build adjustments: commit 9e24b9c7 follow-up 2012-04-17 13:29:12 +02:00
Daniel Stenberg
4d28a59fc2 -# progress meter: avoid superfluous updates and duplicate lines
By comparing if a different "progress point" is reached or not since the
previous update, the progress function callback for this now avoids many
superfluous screen updates. This has the nice side-effect that it fixes
a problem that causes a second progress meter line.

The second line output happened because when we use the -# progress
meter, we force a newline output after the transfer in the main loop in
curl, but when libcurl calls the progress callback from
curl_easy_cleanup() it would then output the progress display
again. Possibly the naive newline output is wrong but this optimization
was suitable anyway...

Reported by: Daniel Theron
Bug: http://curl.haxx.se/bug/view.cgi?id=3517418
2012-04-17 00:45:20 +02:00
Yang Tse
a498daa0e0 nss.c: fix compiler warning 2012-04-16 22:37:12 +02:00
Yang Tse
bd12c44d35 curl-compilers.m4: -Wno-pedantic-ms-format for Windows gcc 4.5 builds
When building a Windows target with gcc 4.5 or newer and strict compiler
warnings enabled use -Wno-pedantic-ms-format in addition to other flags.
2012-04-16 22:12:02 +02:00
Kamil Dudka
4c385cf896 tests/valgrind.pm: suppress memleaks of NSS_InitContext()
Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=745224
2012-04-16 20:11:47 +02:00
Yang Tse
7d4ed0b10e setup_once.h: tighten requirements for stdbool.h header inclusion
Include stdbool.h only when it is available and configure is capable of
detecting a proper 'bool' data type when the header is included.

Compilation fix for old or unpatched versions of XL C compiler.

Report: http://curl.haxx.se/mail/archive-2012-04/0022.html
2012-04-14 15:41:38 +02:00
Yang Tse
48d13b44c6 headers: require GCC 2.7 or newer in order to allow attribute GCC'isms usage
Usage in other code paths already protected and requiring even newer versions.
2012-04-14 15:12:30 +02:00
Jonathan Nieder
8b63b48627 headers: surround GCC attribute names with double underscores
This protects from attribute names being defined by third party's code.

Improvement: http://curl.haxx.se/mail/lib-2012-04/0127.html
2012-04-14 15:06:57 +02:00
Guenter Knauf
b9ac64c2cb Updated copyright year. 2012-04-13 20:35:02 +02:00
Yang Tse
4d2c3f0a4d testcurl.pl: build example programs for Android cross-compiles 2012-04-13 19:33:45 +02:00
Yang Tse
c156b916a4 nss.c: fix compiler warning 2012-04-13 18:26:42 +02:00
Yang Tse
865893fb14 examples: fix compiler warnings 2012-04-13 17:59:49 +02:00
Kamil Dudka
a60edcc6d4 nss: provide human-readable names for NSS errors 2012-04-13 12:19:36 +02:00
Kamil Dudka
20cb12db8d nss: use NSS_InitContext() to initialize NSS if available
NSS_InitContext() was introduced in NSS 3.12.5 and helps to prevent
collisions on NSS initialization/shutdown with other libraries.

Bug: https://bugzilla.redhat.com/738456
2012-04-13 12:19:36 +02:00
Kamil Dudka
42aa796150 nss: unconditionally require PK11_CreateGenericObject()
This bumps the minimal supported version of NSS to 3.12.x.
2012-04-13 12:19:36 +02:00
Guenter Knauf
2a902738fb Set batch mode to 755 to make Cygwin git pulls work. 2012-04-13 12:11:31 +02:00
Guenter Knauf
bb5d4234e3 Added section for Android configure cross-compile. 2012-04-13 10:34:03 +02:00
Guenter Knauf
930781e168 Added NetWare export. 2012-04-13 01:24:34 +02:00
Yang Tse
1c3a99b52c testcurl.pl: build example programs for MinGW cross-compiles 2012-04-12 21:21:10 +02:00
Yang Tse
5f04843e5b tool_operate.c: fix compiler warning 2012-04-12 21:21:09 +02:00
Yang Tse
8c29bf5640 url.c: fix compiler warning 2012-04-12 21:21:08 +02:00
Guenter Knauf
82306ebfba Updated dependency lib versions (2nd try). 2012-04-12 20:51:29 +02:00
Guenter Knauf
03d4b9f078 Updated dependency lib versions. 2012-04-12 20:44:50 +02:00
Yang Tse
51114f07f1 tool_formparse.c: rename a couple of vars to avoid declaration shadowing 2012-04-12 19:28:46 +02:00
Yang Tse
e19917296f OS400/initscript.sh: fix db2_name() module name generation
Allow repeatable file name length reduction on file names with underscore or
dash characters. This is done in order to better support libcurl's existing
source file names and allow OS/400 package to build out of the box again.
2012-04-12 19:13:23 +02:00
Yang Tse
8ed40acac6 testcurl.pl: log more environment vars that modify configure and build behavior 2012-04-12 17:11:17 +02:00
Yang Tse
38ae6ec1a2 configure: NATIVE_WINDOWS no longer defined in config files 2012-04-12 13:08:48 +02:00
Yang Tse
9e24b9c7af build adjustments: CURL_HIDDEN_SYMBOLS no longer defined in config files
configure script now provides conditional definitions for Makefile.am
that result in CURL_HIDDEN_SYMBOLS being defined by resulting makefiles
when appropriate.

Additionally, configure script option for symbol hiding control is now
named --enable-symbol-hiding --disable-symbol-hiding. While still valid,
old option name --enable-hidden-symbols --disable-hidden-symbols will
be deprecated in some future release.
2012-04-11 19:33:54 +02:00
Yang Tse
a144bb8b76 build adjustments: functionally revert commits 4d3fb91f and bbfe1182
Undefining CURL_HIDDEN_SYMBOLS in source files isn't the proper fix.
2012-04-11 19:28:40 +02:00
Yang Tse
4d3fb91fb4 test servers: build adjustment
Undefine CURL_HIDDEN_SYMBOLS libcurl private preprocessor macro that might
leak from lib/setup.h into source files where this should not be defined.
2012-04-10 17:32:06 +02:00
Yang Tse
bbfe118209 libtests: build adjustment
Undefine CURL_HIDDEN_SYMBOLS libcurl private preprocessor macro that might
leak from lib/setup.h into source files where this should not be defined.
2012-04-10 17:29:37 +02:00
Yang Tse
e5c14674f0 curl tool: make setup.h first header included in tool_setup.h again 2012-04-10 03:20:30 +02:00
Yang Tse
6dba7608bf curl tool: use configuration files from lib directory - follow-up II
lib/config-win32.h no longer copied to src/config-win32.h
2012-04-09 21:39:03 +02:00
Yang Tse
21423497ef configure: Windows cross-compilation fixes
BUILDING_LIBCURL and CURL_STATICLIB are no longer defined in curl_config.h,
configure will generate appropriate conditionals so that mentioned symbols
get defined and used in Makefiles at compilation time
2012-04-09 21:24:16 +02:00
Yang Tse
01b0f1061d curl tool: make curl.h first header included in tool_setup.h 2012-04-08 13:50:18 +02:00
Yang Tse
3d8c093145 curl tool: use configuration files from lib directory - follow-up I
amigaos.[ch] now integrates nicely with any libcurl build
2012-04-07 00:31:24 +02:00
Yang Tse
919c97fa65 curl tool: use configuration files from lib directory
Configuration files such as curl_config.h and all config-*.h no longer exist
nor are generated/copied into 'src' directory, now these only exist in 'lib'
directory from where curl tool sources uses them.

Additionally old src/setup.h has been refactored into src/tool_setup.h which
now pulls lib/setup.h

The possibility of a makefile needing an include path adjustment exists.
2012-04-06 23:37:05 +02:00
Daniel Stenberg
376b4d48fe PolarSSL: correct return code for CRL matches
When a server certificate matches one in the given CRL file, the code
now returns CURLE_SSL_CACERT as test case 313 expects and verifies.
2012-04-06 15:10:59 +02:00
Daniel Stenberg
118e73306d PolarSSL: include version number in version string
Previously it would say PolarSSL only, now it says PolarSSL/1.1.0 in the
same style other libs and components do.
2012-04-06 14:44:36 +02:00
Daniel Stenberg
1dd69921d3 test: added test 1332 that tests --post303 2012-04-05 23:37:16 +02:00
Daniel Stenberg
29e68b200c curl: add --post303 to set the CURL_REDIR_POST_303 option 2012-04-05 23:34:12 +02:00
Andrei Cipu
0b516b7162 CURLOPT_POSTREDIR: also allow 303 to do POST on the redirected URL
As it turns out, some people do want that after all.
2012-04-05 23:29:21 +02:00
Daniel Stenberg
a0b3535735 test1331: cookies on a 407 response
Verify that cookies are sent back even after a 407 response has been
received
2012-04-05 23:22:15 +02:00
Dag Ekengren
5e852ab9d1 PolarSSL: add support for asynchronous connect 2012-04-05 00:18:34 +02:00
Tim Heckman
f9bb5d2984 Revert "access the CA source file using HTTPS"
This reverts commit f7e2ab6.

This change caused fetching of the certificates to become unreliable.

Bug: http://curl.haxx.se/mail/lib-2012-03/0238.html
Reported by: Tim Heckman
2012-04-04 23:54:02 +02:00
Andrei Cipu
ad595c3ba9 IPv6 cookie domain: get rid of the first bracket before the second.
Commit 97b66ebe was copying a smaller buffer, thus duplicating the last
character.
2012-04-04 23:51:41 +02:00
Daniel Stenberg
7031ff23bb MAIL-ETIQUETTE: Added "How to unsubscribe"
... as it seems to hard for some people
2012-04-04 23:43:44 +02:00
Yang Tse
9753c6bec5 ftp.c: ftplistparser related OOM handling fix 2012-04-04 17:31:11 +02:00
Yang Tse
b16e3da12a smtp.c: fix compiler warnings 2012-04-04 17:24:30 +02:00
Yang Tse
e7661d198f lib599.c: fix compiler warning 2012-04-04 17:24:29 +02:00
Daniel Stenberg
13c7b91133 runtests: yassl and polarssl are not openssl
Don't set the "has_openssl" variable if yassl or polarssl is found as
they will simply not work as 100% drop-in replacements for some of the
stuff the "OpenSSL" feature is used for.

I spotted this problem when doing test runs with PolarSSL builds.
2012-04-04 00:07:26 +02:00
Lijo Antony
950b0b770e connect.c: return changed to CURLE_COULDNT_CONNECT when opensocket fails
Curl_socket returns CURLE_COULDNT_CONNECT when the opensocket callback
returns CURL_SOCKET_BAD. Previous return value CURLE_FAILED_INIT
conveys incorrect information to the user.
2012-04-03 22:56:29 +02:00
Steve Holme
15e1227ed4 pop3: Reworked the command sending and handling
Reworked the command sending from two specific LIST and RETR command
functions into a single command based function as well as the two
associated response handlers into a generic command handler.
2012-04-02 23:24:00 +01:00
Dave Reisner
ddfe821bcf curl tool: add filename_effective token for --write-out
By modifying the parameter list for ourWriteOut() and passing the
OutStruct that collects data in tool_operate, we get access to the
remote name that we're writing to. Shell scripters should find this
useful when used in conjuntion with the --remote-header-name option.
2012-04-01 23:52:05 +02:00
Steve Holme
54866b68cd smtp.c: Code policing and tidy up 2012-04-01 21:09:38 +01:00
Armel Asselin
05a443adf2 SSH: public key can now be an empty string
If an empty string is passed to CURLOPT_SSH_PUBLIC_KEYFILE, libcurl will
pass no public key to libssh2 which then tries to compute it from the
private key. This is known to work when libssh2 1.4.0+ is linked against
OpenSSL.
2012-04-01 20:22:37 +02:00
Tatsuhiro Tsujikawa
ebf315e6f3 OpenSSL: Made cert hostname check conform to RFC 6125
This change replaces RFC 2818 based hostname check in OpenSSL build with
RFC 6125 [1] based one.

The hostname check in RFC 2818 is ambiguous and each project implements
it in the their own way and they are slightly different. I check curl,
gnutls, Firefox and Chrome and they are all different.

I don't think there is a bug in current implementation of hostname
check. But it is not as strict as the modern browsers do. Currently,
curl allows multiple wildcard character '*' and it matches '.'. (as
described in the comment in ssluse.c).

Firefox implementation is also based on RFC 2818 but it only allows at
most one wildcard character and it must be in the left-most label in the
pattern and the wildcard must not be followed by any character in the
label.[2] Chromium implementation is based on RFC 6125 as my patch does.
Firefox and Chromium both require wildcard in the left-most label in the
presented identifier.

This patch is more strict than the current implementation, so there may
be some cases where old curl works but new one does not. But at the same
time I think it is good practice to follow the modern browsers do and
follow the newer RFC.

[1] http://tools.ietf.org/html/rfc6125#section-6.4.3
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=159483
2012-04-01 20:10:37 +02:00
Daniel Stenberg
c44d45db86 HTTP: reset expected DL/UL sizes on redirects
With FOLLOWLOCATION enabled. When a 3xx page is downloaded and the
download size was known (like with a Content-Length header), but the
subsequent URL (transfered after the 3xx page) was chunked encoded, then
the previous "known download size" would linger and cause the progress
meter to get incorrect information, ie the former value would remain
being sent in. This could easily result in downloads that were WAY
larger than "expected" and would cause >100% outputs with the curl
command line tool.

Test case 599 was created and it was used to repeat the bug and then
verify the fix.

Bug: http://curl.haxx.se/bug/view.cgi?id=3510057
Reported by: Michael Wallner
2012-04-01 00:07:24 +02:00
Gökhan Şengün
7a2647e162 smtp: Add support for DIGEST-MD5 authentication 2012-03-31 22:31:19 +01:00
Gökhan Şengün
9bae9ddad9 smtp: Cody tidy up of md5 digest length
Replaced the hard coded md5 digest length (16) with a preprocessor
constant
2012-03-31 22:31:18 +01:00
Gökhan Şengün
004d7251ab md5: Add support for calculating the md5 sum of buffers incrementally
It is now possible to calculate the md5 sum as the stream of buffers
becomes known where as previously it was only possible to calculate the
md5 sum of a pre-prepared buffer.
2012-03-31 22:31:16 +01:00
Daniel Stenberg
33d044a862 Revert "mk-ca-bundle.pl: use LWP::UserAgent for https"
This reverts commit 9f0e1689f1.

It turned out that "improvement" instead made the fetching of the
certificates unreliable

Bug: http://curl.haxx.se/mail/lib-2012-03/0238.html
Reported by: Tim Heckman
2012-03-31 19:51:36 +02:00
Steve Holme
a9086e8a4b DOCS: Added information regarding POP3 commands to CURLOPT_CUSTOMREQUEST 2012-03-31 18:50:04 +01:00
Steve Holme
761c3c5446 pop3: Added support for additional pop3 commands
This feature allows the user to specify and use additional POP3
commands such as UIDL and DELE via libcurl's CURLOPT_CUSTOMREQUEST or
curl's -X command line option.
2012-03-31 18:46:22 +01:00
tetetest tetetest
66c0e26e28 CMakeLists.txt: fix Windows LDAP/LDAPS option handling
bug: http://curl.haxx.se/mail/lib-2012-03/0278.html
2012-03-30 19:03:12 +02:00
tetetest tetetest
7d1b715605 CMakeLists.txt: fix MS Visual Studio x64 unsigned long long literal suffix
bug: http://curl.haxx.se/mail/lib-2012-03/0255.html
2012-03-29 21:18:55 +02:00
Steve Holme
9f494fe423 TODO: Corrected POP3 section heading 2012-03-28 22:23:17 +01:00
Yang Tse
809c809281 curl-functions.m4: update detection logic of getaddrinfo() thread-safeness
Take in account that h_errno might be a modifiable lvalue not defined as
a C preprocessor macro
2012-03-28 18:48:38 +02:00
Steve Holme
0580b60622 TODO: Added SMTP and POP3 specific features 2012-03-27 21:58:59 +01:00
Olaf Flebbe
4bdb664c33 tool_cb_dbg.c: fix tool_cb_dbg() to behave properly even for size 0
curl segfault in debug callback triggered with CURLINFO_HEADER_OUT and size 0

bug: http://curl.haxx.se/bug/view.cgi?id=3511794
2012-03-27 22:16:25 +02:00
Yang Tse
459435dca1 test #1405: support HTTP disabled builds 2012-03-26 23:54:27 +02:00
Steve Holme
3fdb7808ef test #809: Updated error code to match recent pop3 changes 2012-03-26 21:08:16 +01:00
Yang Tse
97ff646fc1 ssh.c: code cleanup, Curl_safefree() already nullifies pointer 2012-03-25 18:30:17 +02:00
Yang Tse
9801596fb3 fix some compiler warnings 2012-03-25 18:30:16 +02:00
Steve Holme
982315573c pop3.c: Corrected problem with state() introduced in 01690ed2bc 2012-03-25 12:47:39 +01:00
Steve Holme
9f96e6da28 pop.c: Small code tidy up 2012-03-25 11:28:59 +01:00
Steve Holme
01690ed2bc pop3: Removed the need for the single message LIST command handler
Simplified the code to remove the need for a separate "LIST <msg id>"
command handler and state machine and instead use the LIST command
handler for both operations.
2012-03-25 11:21:59 +01:00
Steve Holme
2da89708ec pop3.c: Code policing and tidy up
Corrected character and line spacing and re-ordered list and retr
functions based on the order of their state machines.
2012-03-24 12:28:11 +00:00
Steve Holme
5c62a551c4 email: Moved server greeting responses into separate functions
Moved the server greeting response handling code from the statemach_act
functions to separate response functions. This makes the code simpler
to follow and provides consistency with the other responses that are
handled here.
2012-03-24 11:55:34 +00:00
Steve Holme
602a8a565c pop3.c: Fixed body data being written when CURLOPT_NOBODY is specified
Body data would be forwarded to the client application in both the RETR
and LIST commands even if CURLOPT_NOBODY was specified.
2012-03-24 00:09:38 +00:00
Rodrigo Silva (MestreLion)
c4a8446c70 docs: clarify -z/--time-cond with filename (mention mtime)
Original wording could lead users in thinking it tries to
somehow parse the filename for a date expression (like
news_2012_03_05.html). It never mentions that it actually
reads the mtime of the file in filesystem.
2012-03-23 23:13:27 +01:00
Yang Tse
456d8db35e tests #1316 #1319 #1320 #1321: add missing keywords 2012-03-23 18:31:29 +01:00
Yang Tse
e952a7e710 test #598: add missing keywords 2012-03-23 18:15:34 +01:00
Yang Tse
682f0840e7 version: start working on 7.25.1-DEV 2012-03-23 16:59:03 +01:00
Benjamin Johnson
f85ec43f24 configure: check for gethostbyname in the watt lib
This allows building of libcurl on DOS using DJGPP 2.04 and Watt-32
sockets. I know there's already Makefile.djgpp, but I find this more
convenient since I'm used to using the ./configure script from other
platforms
2012-03-22 23:33:33 +01:00
Daniel Stenberg
b5713887ae THANKS: 8 new contributors from 7.25.0 2012-03-22 22:22:08 +01:00
Daniel Stenberg
c1babfad8a RELEASE-NOTES: synced with b8b2cf612b 2012-03-22 19:40:25 +01:00
Yang Tse
b8b2cf612b tests #1400 #1401: add missing keywords 2012-03-22 18:32:19 +01:00
Yang Tse
fe93b0a874 http_proxy.h: fix builds with proxy or http disabled 2012-03-22 17:27:14 +01:00
Yang Tse
e8a32438c2 parsedate.c: fix a numeric overflow 2012-03-22 15:54:34 +01:00
Andrei Cipu
97b66ebefe cookies: strip the numerical ipv6 host properly
The commit e650dbde86 that stripped off [brackets] from ipv6-only host
headers for the sake of cookie parsing wrongly incremented the host
pointer which would cause a bad free() call later on.
2012-03-22 08:56:33 +01:00
Yang Tse
d2e5222ebc test #598: add to Makefile.am 2012-03-22 04:59:16 +01:00
Yang Tse
3aab542e77 test #598: OOM handling fixes 2012-03-22 04:58:38 +01:00
Yang Tse
3c80309c27 fix several compiler warnings 2012-03-22 04:54:04 +01:00
Daniel Stenberg
c83de6d076 CONNECT: fix multi interface regression
The refactoring of HTTP CONNECT handling in commit 41b0237834 that
made it protocol independent broke it for the multi interface. This fix
now introduce a better state handling and moved some logic to the
http_proxy.c source file.

Reported by: Yang Tse
Bug: http://curl.haxx.se/mail/lib-2012-03/0162.html
2012-03-22 00:12:37 +01:00
Daniel Stenberg
805788e043 SWS: refuse to serve CONNECT unless running as proxy 2012-03-22 00:12:37 +01:00
Yang Tse
dddcd3b042 curl-functions.m4: update detection logic of getaddrinfo() thread-safeness
Take in account that POSIX standard Issue 7 drops h_errno support. Now, we also
consider getaddrinfo() to be thread-safe when (_POSIX_C_SOURCE >= 200809L) or
(_XOPEN_SOURCE >= 700) independently of whether h_errno exists or not.
2012-03-21 01:02:58 +01:00
Yang Tse
c6825b7a6b fix several compiler warnings 2012-03-20 18:28:24 +01:00
Yang Tse
e6a89cb6c4 tests 140X: fix --libcurl generated source file reading mode for MSYS builds 2012-03-18 05:56:07 +01:00
Yang Tse
fe7613932e tool_easysrc.c: fix --libcurl option output file text translation mode
Use fopen() with "w" mode instead of "wt" to fix cygwin builds.
2012-03-18 05:54:10 +01:00
Yang Tse
ffb67599b3 build: remove tool_cb_skt.[ch] references 2012-03-18 05:35:30 +01:00
Daniel Stenberg
47236d89c0 RELEASE-NOTES: synced with ad77420ac7
3 more bugs, 1 more contributor
2012-03-18 00:26:56 +01:00
Daniel Stenberg
ad77420ac7 lwip: basic checks and macros for compatiblity 2012-03-17 23:02:21 +01:00
Yang Tse
804da995c5 tool_setopt.c: more OOM handling fixes 2012-03-17 20:55:15 +01:00
Daniel Stenberg
ede9ad43fc cmake: list_spaces_append_once fails with spaces in filename
Windows standard libraries are located in C:/Program Files/Microsoft
SDKs/[...]. They are already included in the default MSVC
LIBPATH. Hence, find_library(WSOCK32_LIBRARY wsock32) and
find_library(WS2_32_LIBRARY ws2_32) are not needed. They return the full
path to the libraries including spaces. Of course,
list_spaces_append_once will mangle the result and the build fails.

Bug: http://curl.haxx.se/bug/view.cgi?id=3494968
2012-03-16 22:42:17 +01:00
Yang Tse
0c8e36c18a http_proxy.c: fix OOM handling 2012-03-16 20:11:22 +01:00
Yang Tse
862bb7bade tool_setopt.c: fix OOM handling 2012-03-16 20:10:08 +01:00
Yang Tse
b329fc7023 fix several compiler warnings 2012-03-16 20:06:18 +01:00
Yang Tse
8af4b657d0 fix some compiler warnings 2012-03-16 19:06:34 +01:00
Maxim Prohorov
97386c3c84 resolve with c-ares: don't resolve IPv6 when not working
If the Curl_ipv6works() function says no, there is no reason to try AAAA
names even if libcurl was built with IPv6 support enabled.

Bug: http://curl.haxx.se/mail/lib-2012-03/0045.html
2012-03-13 22:52:39 +01:00
Steve Holme
e25590a2b3 smtp.c: Changed the curl error code for EHLO and HELO responses
Changed the returned curl error codes for EHLO and HELO responses from
CURLE_LOGIN_DENIED to CURLE_REMOTE_ACCESS_DENIED as a negative response
from these commands represents no service as opposed to a login error.
2012-03-10 22:03:42 +00:00
Daniel Stenberg
79afcbefb4 RELEASE-NOTES: synced with e650dbde86
New: 12 bugs, 3 changes, 6 contributors and updated counters at the top
2012-03-10 22:29:30 +01:00
Andrei Cipu
e650dbde86 Curl_http: strip off [brackets] from ipv6-only host headers
Since the host name is passed in to the cookie engine it will not work
correctly if the brackets are left in the name.

Bug:http://curl.haxx.se/mail/lib-2012-03/0036.html
2012-03-10 16:48:59 +01:00
Armel Asselin
b50e9e9e9e CURLSSH_OPT_AUTH: documented it has no effect 2012-03-10 16:15:23 +01:00
John Joseph Bachir
9f0e1689f1 mk-ca-bundle.pl: use LWP::UserAgent with proper https verify behavior.
An alternative would be:

1. specify HTTPS_CA_DIR and/or HTTPS_CA_FILE
2. ensure that Net::SSL is being used, and IO::Socket::SSL is NOT being
   used

This question and answer explain:
http://stackoverflow.com/questions/74358/
2012-03-10 15:51:24 +01:00
John Joseph Bachir
f7e2ab629e access the CA source file using HTTPS 2012-03-10 15:50:27 +01:00
Daniel Stenberg
2764bf2c5b includes: remove inclusion of unused file http_proxy.h 2012-03-09 00:05:24 +01:00
Daniel Stenberg
41b0237834 CONNECT: made generically not per-protocol
Curl_protocol_connect() now does the tunneling through the HTTP proxy if
requested instead of letting each protocol specific connection function
do it.
2012-03-08 23:31:38 +01:00
Daniel Stenberg
cabd010dd4 ssh_connect: tunnel through HTTP proxy if requested 2012-03-08 21:47:54 +01:00
Daniel Stenberg
c55a0809bb LWIP: don't consider HAVE_ERRNO_H to be winsock
The check for Winsock definition was a bit too broad

Bug: http://curl.haxx.se/mail/lib-2012-03/0046.html
2012-03-08 21:25:35 +01:00
Dave Reisner
4ee2df4b46 curl-config: only provide libraries with --libs
In line with the manpage, curl-config --libs should only provide the necessary
library flags for the linker in order to compile software with libcurl. Also
with this change, we match what the pkg-config file provides.
2012-03-08 20:55:03 +01:00
Daniel Stenberg
4d71d1b17f CONTRIB: Please don't send pull requests 2012-03-05 23:42:07 +01:00
Daniel Stenberg
d185960a6d libcurl docs: version corrections
Correct some inconsistencies in which version some things were added.

Bug: http://curl.haxx.se/bug/view.cgi?id=3494091
Reported by: "curlybugs"
2012-02-25 19:34:08 +01:00
Daniel Stenberg
79b6f4a2d3 CONNECT: fix ipv6 address in the Request-Line
Commit 466150bc64 fixed the Host: header with CONNECT, but I then
forgot the preceeding request-line. Now this too uses [brackets]
properly if a ipv6 numerical address was given.

Bug: http://curl.haxx.se/bug/view.cgi?id=3493129
Reported by: "Blacat"
2012-02-24 23:33:14 +01:00
Steve Holme
5430007222 SMTP: Added support for returning SMTP response codes
Set the conn->data->info.httpcode variable in smtp_statemach_act() to
allow Curl_getinfo() to return the SMTP response code via the
CURLINFO_RESPONSE_CODE action.
2012-02-23 23:29:03 +01:00
Daniel Stenberg
779fa13ef9 curl.1: updated --libcurl
With Colin Hogben's recent work, --libcurl now also works with -F and
more. Remove the previous caveat.
2012-02-23 23:25:58 +01:00
Daniel Stenberg
1a7bba1975 test: --libcurl fixes
The line endings broke when I saved the three recent patches (my fault,
not Colin's) to 'git am' them.

Adjusted the stripping of the test program for comparing to also exclude
the SSH key file name as that will differ and use a local path name.
2012-02-23 23:16:58 +01:00
Colin Hogben
21130dab4f Add helper script convsrctest.pl to manipulate --libcurl tests.
The intention is to take the output of curl's --libcurl option,
as exercised in test 14xx, and generate a corresponding test15xx
in which the generated code is compiled and run.  This will verify
that the generated code behaves equivalently to the original
invocation of the curl command.

The script is not yet integrated into the configure / makefile
machinery.
2012-02-23 22:33:06 +01:00
Colin Hogben
c3cae332c5 Add tests for curl's --libcurl output.
These tests check the output of the --libcurl option of curl,
including the improved option handling added in a related patch.
2012-02-23 22:33:02 +01:00
Colin Hogben
9954242980 Generate lists and use symbols in --libcurl code output.
This patch improves the output of curl's --libcurl option by
generating code which builds curl_httppost and curl_slist lists, and
uses symbolic names for enum and flag values.  Variants of the
my_setopt macro in tool_setopt.h are added in order to pass extra type
information to the code-generation step in tool_setopt.c.

If curl is configured with --disable-libcurl-option then the macros
call curl_easy_setopt directly.
2012-02-23 22:32:57 +01:00
Steve Holme
2f1ad7d6e2 smtp.c: Fixed an issue with writing postdata
Fixed a problem in smtp_done() when writing out the postdata as
Curl_write() would periodically return zero bytes written.
2012-02-21 22:50:46 +01:00
Daniel Stenberg
30c44edad3 CURLOPT_MAIL_AUTH: added in 7.25.0
Brought in commit 0cf0ab6f30
2012-02-21 22:40:55 +01:00
Daniel Stenberg
77a21ff623 pop3 test server: send terminating ".CRLF" only
With commit 035ef06bda applied, the test pop3 server needs to send
".\r\n" as the body terminating sequence and there needs to be a final
CRLF in the actual body in the test data file.
2012-02-21 22:24:44 +01:00
Steve Holme
035ef06bda pop3.c: Fixed drop of final CRLF in EOB checking
Curl_pop3_write() would drop the final CRLF of a message as it was
considered part of the EOB as opposed to part of the message. Whilst
the EOB sequence needs to be searched for by the function only the
final 3 characters should be removed as per RFC-1939 section 3.

Reported by: Rich Gray
Bug: http://curl.haxx.se/mail/lib-2012-02/0051.html
2012-02-19 23:48:14 +01:00
Steve Holme
3d98aed5b3 smtp.c: Fixed an issue with the EOB checking
Curl_smtp_escape_eob() would leave off final CRLFs from emails ending
in multiple blank lines additionally leaving the smtpc->eob variable
with the character count in, which would cause problems for additional
emails when sent through multiple calls to curl_easy_perform() after a
CURLOPT_CONNECT_ONLY.
2012-02-17 22:47:19 +01:00
Daniel Stenberg
4cf742f34f CURLE_FTP_PRET_FAILED: listed twice
Make sure it is mentioned once and with the correct description
2012-02-17 14:40:07 +01:00
Daniel Stenberg
4bf3131979 --mail-auth documented 2012-02-16 13:24:48 +01:00
Steve Holme
5c409d03ec SMTP: Code policing and tidy up 2012-02-16 13:20:34 +01:00
Steve Holme
a053560cfa curl: Added support for --mail-auth
Added an extra command-line argument to support the optional AUTH
parameter in SMTPs MAIL FROM command.
2012-02-16 13:19:47 +01:00
Kamil Dudka
674699b212 docs: mention that NTLM works with NSS, too 2012-02-16 12:20:57 +01:00
Steve Holme
154c0d4b93 DOCS: Added information for CURLOPT_MAIL_AUTH.
Added information relating to the new CURLOPT_MAIL_AUTH parameter and
reworked CURLOPT_MAIL_FROM and CURLOPT_MAIL_RCPT to be a clearer.

Fixed inconsistencies of "vocalisation of the abbreviation" versus
"vocalisation of the first word" for all abbreviations.

Corrected a typo in CURLOPT_NOPROXY.
2012-02-15 21:51:48 +01:00
Steve Holme
b685481d52 smtp.c: Fixed use of angled brackets in AUTH parameter.
Fixed the use of angled brackets "<>" in the optional AUTH parameter as
per RFC-2554 section 5. The address should not include them but an
empty address should be replaced by them.
2012-02-15 21:51:45 +01:00
Steve Holme
0cf0ab6f30 smtp_mail: Added support to MAIL FROM for the optional AUTH parameter
Added a new CURLOPT_MAIL_AUTH option that allows the calling program to
set the optional AUTH parameter in the MAIL FROM command.

When this option is specified and an authentication mechanism is used
to communicate with the mail server then the AUTH parameter will be
included in the MAIL FROM command. This is particularly useful when the
calling program is acting as a relay in a trusted environment and
performing server to server communication, as it allows the relaying
server to specify the address of the mailbox that was used to
authenticate and send the original email.
2012-02-14 22:50:49 +01:00
toddouska
ee7e4fc1d1 cyassl: update to CyaSSL 2.0.x API
Modify configure.ac to test for new CyaSSL Init function and remove
default install path to system.  Change to CyaSSL OpenSSL header and
proper Init in code as well.

Note that this no longer detects or works with CyaSSL before v2
2012-02-14 19:49:54 +01:00
Daniel Stenberg
0201280533 LIBCURL_VERSION_NUM: 0x071900
I accidentally left the lowest bits 01 before
2012-02-14 19:24:03 +01:00
Steve Holme
69406f0be7 SMTP: Fixed error when using CURLOPT_CONNECT_ONLY
Fixed incorrect behavior in smtp_done() which would cause the end of
block data to be sent to the SMTP server if libcurl was operating in
connect only mode. This would cause the server to return an error as
data would not be expected which in turn caused libcurl to return
CURLE_RECV_ERROR.
2012-02-14 19:12:28 +01:00
Daniel Stenberg
ea4ceca222 s/7.24.1/7.25.0
We will go straight to 7.25.0 due to the new additions
2012-02-13 23:57:18 +01:00
Daniel Stenberg
714accd090 curlver.h: bumped to 7.25.0
and updated the end year in the generic copyright string
2012-02-13 23:28:26 +01:00
Daniel Stenberg
35e965c9a0 RELEASE-NOTES: synced with 2b26eb985
9 bug fixes, 4 changes and numerous contributors

Bumped release version and option counters
2012-02-13 23:26:48 +01:00
Colin Hogben
2b26eb9857 configure: add option disable --libcurl output 2012-02-13 22:36:10 +01:00
Alessandro Ghedini
e71ac0c6fa curl tool: allow negative numbers as option values
Fix the str2num() function to not check if the input string starts with a
digit, since strtol() supports numbers prepended with '-' (and '+') too.
This makes the --max-redirs option work as documented.
2012-02-13 19:58:23 +01:00
Daniel Stenberg
7ed25fcc5c parse_proxy: simply memory handling
... by making sure that the string is always freed after the invoke as
parse_proxy will always copy the data and this way there's a single
free() instead of multiple ones.
2012-02-10 17:00:55 +01:00
Daniel Stenberg
ecc93caaeb parse_proxy: bail out on zero-length proxy names!
The proxy parser function strips off trailing slashes off the proxy name
which could lead to a mistaken zero length proxy name which would be
treated as no proxy at all by subsequent functions!

This is now detected and an error is returned. Verified by the new test
1329.

Reported by: Chandrakant Bagul
Bug: http://curl.haxx.se/mail/lib-2012-02/0000.html
2012-02-10 16:26:20 +01:00
Kamil Dudka
ebf3138992 nss: add support for the CURLSSLOPT_ALLOW_BEAST option
... and fix some typos from the 62d15f1 commit.
2012-02-09 23:25:55 +01:00
Rob Ward
8ef8a2b5ac configure: don't modify LD_LIBRARY_PATH for cross compiles 2012-02-09 23:02:26 +01:00
Daniel Stenberg
62d15f159e --ssl-allow-beast added
This new option tells curl to not work around a security flaw in the
SSL3 and TLS1.0 protocols. It uses the new libcurl option
CURLOPT_SSL_OPTIONS with the CURLSSLOPT_ALLOW_BEAST bit set.
2012-02-09 22:28:58 +01:00
Daniel Stenberg
2a699bc6e9 CURLOPT_SSL_OPTIONS: added
Allow an appliction to set libcurl specific SSL options. The first and
only options supported right now is CURLSSLOPT_ALLOW_BEAST.

It will make libcurl to disable any work-arounds the underlying SSL
library may have to address a known security flaw in the SSL3 and TLS1.0
protocol versions.

This is a reaction to us unconditionally removing that behavior after
this security advisory:

http://curl.haxx.se/docs/adv_20120124B.html

... it did however cause a lot of programs to fail because of old
servers not liking this work-around. Now programs can opt to decrease
the security in order to interoperate with old servers better.
2012-02-09 22:22:54 +01:00
Dave Reisner
2a266c1c7c curl: use new library-side TCP_KEEPALIVE options
Use the new library CURLOPT_TCP_KEEPALIVE rather than disabling this via
the sockopt callback. If --keepalive-time is used, apply the value to
CURLOPT_TCP_KEEPIDLE and CURLOPT_TCP_KEEPINTVL.
2012-02-09 19:05:40 +01:00
Dave Reisner
705f0f7a5b add library support for tuning TCP_KEEPALIVE
This adds three new options to control the behavior of TCP keepalives:

- CURLOPT_TCP_KEEPALIVE: enable/disable probes
- CURLOPT_TCP_KEEPIDLE: idle time before sending first probe
- CURLOPT_TCP_KEEPINTVL: delay between successive probes

While not all operating systems support the TCP_KEEPIDLE and
TCP_KEEPINTVL knobs, the library will still allow these options to be
set by clients, silently ignoring the values.
2012-02-09 18:53:51 +01:00
Daniel Stenberg
ea055407fa curl_easy_reset: reset the referer string
When CURLOPT_REFERER has been used, curl_easy_reset() did not properly
clear it.

Verified with the new test 598

Bug: http://curl.haxx.se/bug/view.cgi?id=3481551
Reported by: Michael Day
2012-02-07 23:07:43 +01:00
Yang Tse
4405039fdc curl tool: allow glob-loops to abort again upon critical errors
This prevents clobbering of non recoverable error return codes while
retaining intended functionality of commit 65103efe
2012-02-07 22:10:01 +01:00
Daniel Stenberg
65103efe49 curl tool: don't abort glob-loop due to failures
We want to continue to the next URL to try even on failures returned
from libcurl. This makes -f with ranges still get subsequent URLs even
if occasional ones return error. This was a regression as it used to
work and broke in the 7.23.0 release.

Added test case 1328 to verify the fix.

Bug: http://curl.haxx.se/bug/view.cgi?id=3481223
Reported by: Juan Barreto
2012-02-06 16:52:17 +01:00
Daniel Stenberg
466150bc64 CONNECT: send correct Host: with IPv6 numerical address
When the target host was given as a IPv6 numerical address, it was not
properly put within square brackets for the Host: header in the CONNECT
request. The "normal" request did fine.

Reported by: "zooloo"
Bug: http://curl.haxx.se/bug/view.cgi?id=3482093
2012-01-31 22:52:10 +01:00
Martin Storsjo
f710aa40b3 Explicitly link to the nettle/gcrypt libraries
When support for nettle was added in 64f328c787, I overlooked
the fact that AC_CHECK_LIB doesn't add the tested lib to LIBS
if the check succeeded, if a custom success code block was present.
(The previous version of the check had an empty block for
successful checks, adding the lib to LIBS implicitly.)

Therefore, explicitly add either nettle or gcrypt to LIBS, after
deciding which one to use. Even if they can be linked in
transitively, it is safer to actually link explicitly to them.

This fixes building with gnutls with linkers that don't allow
linking transitively, such as for windows.
2012-01-28 14:09:51 +01:00
Pierre Ynard
f4d3c0cbfb more resilient connection times among IP addresses
When connecting to a domain with multiple IP addresses, allow different,
decreasing connection timeout values. This should guarantee some
connections attempts with sufficiently long timeouts, while still
providing fallback.
2012-01-28 14:00:52 +01:00
Pierre Ynard
4d2737bcb2 remove write-only variable 2012-01-28 13:58:49 +01:00
Pierre Joye
8ee2576b6f Merge branch 'master' of github.com:bagder/curl 2012-01-26 16:39:53 +01:00
Pierre Joye
575f3c30ed - fix IPV6 and IDN options 2012-01-26 16:39:26 +01:00
Yang Tse
cf9fb08ca4 TODO-RELEASE: added item #308 2012-01-25 23:35:42 +01:00
Daniel Stenberg
5a53409e2c THANKS: imported contributors from 7.24.0 RELEASE-NOTES 2012-01-25 13:53:10 +01:00
Yang Tse
e277d3b52b test harness: update stunnel.pem Diffie-Hellman parameters from 512 to 1024 bit 2012-01-25 11:50:44 +01:00
Yang Tse
93e344bbf4 version: start working on 7.24.1-DEV 2012-01-25 11:27:39 +01:00
Dan Fandrich
75b6f7d9ef curl_easy_setopt.3: Fixed SEEKDATA & CLOSESOCKETDATA descriptions 2012-01-24 21:31:57 -08:00
Daniel Stenberg
a8e063b087 RELEASE-NOTES: synced with 70f71bb99f
Synced and prepared for 7.24.0 release. Two security problems, one bug fix,
two more contributors.
2012-01-24 09:24:37 +01:00
Daniel Stenberg
70f71bb99f gnutls: enforced use of SSLv3
With advice from Nikos Mavrogiannopoulos, changed the priority string to
add "actual priorities" and favour ARCFOUR. This makes libcurl work
better when enforcing SSLv3 with GnuTLS. Both in the sense that the
libmicrohttpd test is now working again but also that it mitigates a
weakness in the older SSL/TLS protocols.

Bug: http://curl.haxx.se/mail/lib-2012-01/0225.html
Reported by: Christian Grothoff
2012-01-24 08:54:26 +01:00
Daniel Stenberg
c11c30a8c8 tests: test CRLF in URLs
Related to the security vulnerability: CVE-2012-0036

Bug: http://curl.haxx.se/docs/adv_20120124.html
2012-01-24 08:54:26 +01:00
Daniel Stenberg
75ca568fa1 URL sanitize: reject URLs containing bad data
Protocols (IMAP, POP3 and SMTP) that use the path part of a URL in a
decoded manner now use the new Curl_urldecode() function to reject URLs
with embedded control codes (anything that is or decodes to a byte value
less than 32).

URLs containing such codes could easily otherwise be used to do harm and
allow users to do unintended actions with otherwise innocent tools and
applications. Like for example using a URL like
pop3://pop3.example.com/1%0d%0aDELE%201 when the app wants a URL to get
a mail and instead this would delete one.

This flaw is considered a security vulnerability: CVE-2012-0036

Security advisory at: http://curl.haxx.se/docs/adv_20120124.html

Reported by: Dan Fandrich
2012-01-24 08:54:26 +01:00
Daniel Stenberg
db1a856b4f OpenSSL: don't disable security work-around
OpenSSL added a work-around for a SSL 3.0/TLS 1.0 CBC vulnerability
(http://www.openssl.org/~bodo/tls-cbc.txt). In 0.9.6e they added a bit
to SSL_OP_ALL that _disables_ that work-around despite the fact that
SSL_OP_ALL is documented to do "rather harmless" workarounds.

The libcurl code uses the SSL_OP_ALL define and thus logically always
disables the OpenSSL fix.

In order to keep the secure work-around workding, the
SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS bit must not be set and this change
makes sure of this.

Reported by: product-security at Apple
2012-01-24 08:54:26 +01:00
Daniel Stenberg
ee57e9dea6 RELEASE-NOTES: synced with 6e2fd2c9ea
3 more bugfixes, 3 more contributors
2012-01-22 23:44:51 +01:00
Daniel Stenberg
6e2fd2c9ea CURLOPT_ACCEPTTIMEOUT_MS: spellfix 2012-01-22 00:00:55 +01:00
Dan Fandrich
5d7a319a55 examples: updated README with two new example programs 2012-01-20 22:44:59 -08:00
Daniel Stenberg
7883cd5af3 URL parse: user name with ipv6 numerical address
Using a URL with embedded user name and password didn't work if the host
was given as a numerical IPv6 string, like ftp://user:password@[::1]/

Reported by: Brandon Wang
Bug: http://curl.haxx.se/mail/archive-2012-01/0047.html
2012-01-20 23:32:43 +01:00
Yang Tse
d7af7de5b2 telnet.c: fix OOM triggered segfault 2012-01-20 00:11:15 +01:00
Yang Tse
a7e8f4aabc testtrace.c: fix compiler warning 2012-01-19 22:54:57 +01:00
Yang Tse
e64d332e79 OpenSSL: follow-up for commit a20daf90e3
avoid checking preprocessor definition official value
2012-01-19 22:29:00 +01:00
Pierre Joye
00e615de7e - s, use, enable, for options name, avoiding conflicts with the names used in the makefile 2012-01-19 14:08:24 +01:00
Daniel Stenberg
b2aaf3c2ad curl.1: improve --stderr wording
As is pointed out in this bug report, there can indeed be situation
where --stderr has a point even when the "real" stderr can be
redirected. Remove the superfluous and wrong comment.

bug: http://curl.haxx.se/bug/view.cgi?id=3476020
2012-01-19 13:42:56 +01:00
Daniel Stenberg
c41f304c43 KNOWN_BUGS: can't receive zero bytes file properly
http://curl.haxx.se/bug/view.cgi?id=3438362
2012-01-18 23:45:09 +01:00
Yang Tse
d56b4c3f89 ssl session caching: fix compiler warnings 2012-01-18 23:42:39 +01:00
Daniel Stenberg
d1becc3231 polarssl: show cipher suite name correctly with 1.1.0
Apparently ssl_get_ciphersuite() is needed to get the name of the used
cipher suite.
2012-01-18 23:19:37 +01:00
Daniel Stenberg
f55f95d49c polarssl: show error code correctly
The value was turned negative when it shouldn't have been
2012-01-18 23:19:01 +01:00
Daniel Stenberg
61d31a3caf polarssl: havege_rand is not present in version 1.1.0
... it is now named havege_random!

Reported by: Robert Schumann
Bug: http://curl.haxx.se/mail/lib-2012-01/0178.html
2012-01-18 23:17:54 +01:00
Daniel Stenberg
4b9af77d54 RELEASE-NOTES: synced with 5d70a61b94
5 more bug fixes, 1 more contributor
2012-01-18 22:33:45 +01:00
Colin Hogben
5d70a61b94 Add two tests for telnet: URLs
Add simple telnet tests which (ab)use the http server.
The second test checks for an input file handling bug.
2012-01-18 22:20:33 +01:00
Colin Hogben
51c485342b Remove bogus optimisation of telnet upload.
Remove wrongly implemented optimisation of telnet upload, apparently
intended to allow the library to avoid manually polling for input.
2012-01-18 22:17:46 +01:00
Colin Hogben
4563eeb9f4 Use correct file descriptor for telnet upload.
Fix a bug where input was read from stdin even when a different FILE *
had been configured via CURLOPT_READDATA
2012-01-18 22:17:10 +01:00
Yang Tse
2cafb0e97c OpenLDAP: fix LDAP connection phase memory leak
bug: http://curl.haxx.se/bug/view.cgi?id=3474308
2012-01-18 16:06:29 +01:00
Johannes Bauer
6ea7acf5a9 OpenSSL: fix PKCS#12 certificate parsing related memory leak
Leak triggered when CURLOPT_SSLCERTTYPE and CURLOPT_SSLKEYTYPE set to P12
and both CURLOPT_SSLCERT and CURLOPT_SSLKEY point to the same PKCS#12 file.
2012-01-18 13:39:12 +01:00
Yang Tse
a20daf90e3 OpenSSL: SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG option is no longer enabled
SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG option enabling allowed successfull
interoperability with web server Netscape Enterprise Server 2.0.1 released
back in 1996 more than 15 years ago.

Due to CVE-2010-4180, option SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG has
become ineffective as of OpenSSL 0.9.8q and 1.0.0c. In order to mitigate
CVE-2010-4180 when using previous OpenSSL versions we no longer enable
this option regardless of OpenSSL version and SSL_OP_ALL definition.
2012-01-18 11:59:20 +01:00
Yang Tse
24526d0c0f tests: enable time tracing on tests 500, 573 and 585 2012-01-17 21:33:17 +01:00
Yang Tse
a752850acc tests: testtrace.[ch] provides debug callback for libtest usage
Allows tests from the libtest subdir to generate log traces
similar to those of curl with --tracetime and --trace-ascii
options but with output going to stderr.
2012-01-17 21:32:05 +01:00
Yang Tse
2b9fafd622 sws.c: fix proxy mode secondary connection monitoring condition 2012-01-17 12:28:28 +01:00
Yang Tse
0ce2bca741 add LF termination to infof() trace string 2012-01-16 21:14:05 +01:00
Yang Tse
b15024be4d sws.c: improve proxy mode torture testing support - followup to 18c6c8a5 2012-01-16 19:01:35 +01:00
Daniel Stenberg
21401840fa url2file: new simple example
Just showing how to download the contents of a given URL into a local
file.

Based on a suggestion and example code by Georg Potthast
2012-01-16 14:47:00 +01:00
Daniel Stenberg
e3e24e5b36 imap.c: a dead simple imap example
Just to show that IMAP is used just like other protocols
2012-01-16 14:47:00 +01:00
Yang Tse
18c6c8a5e7 sws.c: improve proxy mode torture testing support - followup to c731fc58 2012-01-16 12:30:03 +01:00
Yang Tse
c731fc58ea sws.c: improve proxy mode torture testing support - followup to d4bf87dc 2012-01-15 20:13:32 +01:00
Yang Tse
6d62c5a6fc Curl_proxyCONNECT() trace known bug #39 2012-01-15 19:21:55 +01:00
Daniel Stenberg
f1092b387e test: verify HTTP response code 308
This newly speced HTTP status code already works as intended in the new
spec:
http://greenbytes.de/tech/webdav/draft-reschke-http-status-308-02.html

Test 1325 is added to verify that the method is kept after the redirect
2012-01-14 16:34:59 +01:00
Yang Tse
8e82ef9c32 http_negotiate_sspi.c: fix compiler warning 2012-01-13 13:34:43 +01:00
Yang Tse
d016f5f5f5 ssh.c: fix compiler warning 2012-01-13 12:57:09 +01:00
Yang Tse
d4bf87dc0e sws.c: improve proxy mode torture testing support 2012-01-13 05:13:48 +01:00
Daniel Stenberg
54dede4166 RELEASE-NOTES: synced with 9f20379fe4
5 bug fixes, 3 more contributors
2012-01-12 23:30:19 +01:00
Daniel Stenberg
9f20379fe4 hostip: avoid getaddrinfo when c-ares is used
Some functions using getaddrinfo and gethostbyname were still
mistakingly being used/linked even if c-ares was selected as resolver
backend.

Reported by: Arthur Murray
Bug: http://curl.haxx.se/mail/lib-2012-01/0160.html
2012-01-12 23:13:19 +01:00
Yang Tse
123c92c904 sws.c: replace sleep() usage with wait_ms() 2012-01-09 22:50:47 +01:00
gsengun
d28411c3cc FTP: CURLE_PARTIAL_FILE should not cause control connection to be closed
Test 161 updated accordingly
2012-01-09 22:50:20 +01:00
Yang Tse
2705af6267 sws.c: some compiler warning fixes 2012-01-08 19:28:46 +01:00
Yang Tse
f34ddb90e6 lib/setup.h: portable symbolic names for Winsock shutdown() mode flags 2012-01-08 02:32:51 +01:00
Yang Tse
dd69a3e868 sws.c: 812fa73057 follow-up 2012-01-06 01:52:45 +01:00
Yang Tse
812fa73057 sws.c: some IPv6 proxy mode peparatory adjustments 2012-01-05 20:52:48 +01:00
Daniel Stenberg
52824ed1ab curl.h: provide backwards compatible symbols
In commit c834213ad5 we re-used some obsolete error codes, and here are
two defines that makes sure existing source codes that happen to use any
of these deprecated ones will still compile.

As usual, define CURL_NO_OLDIES to avoid getting these "precaution
defines".
2012-01-05 19:57:39 +01:00
Daniel Stenberg
4897f4e517 win32-threaded-resolver: stop using a dummy socket
Previously the code would create a dummy socket while resolving just to
have curl_multi_fdset() return something but the non-win32 version
doesn't do it this way and the creation and use of a socket that isn't
made with the common create-socket callback can be confusing to apps
using the multi_socket API etc.

This change removes the dummy socket and thus will cause
curl_multi_fdset() to return with maxfd == -1 more often.
2012-01-04 23:16:30 +01:00
Peter Sylvester
81524cbfa0 OpenSSL: remove reference to openssl internal struct
With this change, curl compiles with the new OPENSSL_NO_SSL_INTERN
cflag. This flag might become the default in some distant future.
2012-01-04 23:02:36 +01:00
Yang Tse
8ef7a5706e test1320 test1321: avoid User-Agent comparison 2012-01-04 19:34:52 +01:00
Yang Tse
c358bab809 httpserver.pl: reorder sws command line options
make 'pidfile' and 'logfile' options appear first on command line in order
to ensure that processing of other options which write to logfile do this
to intended file and not the default one.
2012-01-04 19:28:22 +01:00
Yang Tse
4bc6c1a026 sws.c: fix proxy mode segfault 2012-01-04 19:14:19 +01:00
Yang Tse
3a55daee3d tool_formparse.c: fix compiler warning: enumerated type mixed with another type 2012-01-04 19:11:55 +01:00
Yang Tse
7bd2add06f krb5.c: fix compiler warning: variable set but not used 2012-01-04 19:11:54 +01:00
Daniel Stenberg
3b06f1fb36 KNOWN_BUGS: #77 CURLOPT_FORBID_REUSE kills NTLM 2012-01-04 16:33:33 +01:00
Steve Holme
db4f69ef06 Fixed use of CURLUSESSL_TRY for POP3 and IMAP based connections.
Fixed a problem in POP3 and IMAP where a connection would fail when
CURLUSESSL_TRY was specified for a server that didn't support
SSL/TLS connections rather than continuing.
2012-01-04 00:48:20 +01:00
Steve Holme
277022b2e4 Fixed incorrect error code being returned in STARTTLS
The STARTTLS response code in SMTP, POP3 and IMAP would return
CURLE_LOGIN_DENIED rather than CURLE_USE_SSL_FAILED when SSL/TLS
was not available on the server.

Reported by: Gokhan Sengun
Bug: http://curl.haxx.se/mail/lib-2012-01/0018.html
2012-01-04 00:47:58 +01:00
Daniel Stenberg
0f8239d5b4 curl_easy_setopt: refer to the most recent URI RFC 2012-01-03 23:39:22 +01:00
Daniel Stenberg
a4202be655 RELEASE-NOTES: synced with 2f4a487a68
Two bugfixes, two more contributors
2012-01-03 23:33:52 +01:00
Daniel Stenberg
2f4a487a68 tests: test IMAP, POP3 and SMTP over HTTP proxy tunnel 2012-01-03 16:12:58 +01:00
Daniel Stenberg
82180643f4 test proxy supports CONNECT
There's a new 'http-proxy' server for tests that runs on a separate port
and lets clients do HTTP CONNECT to other ports on the same host to
allow us to test HTTP "tunneling" properly.

Test cases now have a <proxy> section in <verify> to check that the
proxy protocol part matches correctly.

Test case 80, 83, 95, 275, 503 and 1078 have been converted. Test 1316
was added.
2012-01-03 15:01:22 +01:00
Daniel Stenberg
585b89a6c3 curl_easy_strerror.3: minor synopsis edit of the look 2012-01-02 16:00:46 +01:00
Yang Tse
cc69e56ce3 hostip.c: fix potential write past the end of string buffer 2012-01-02 13:44:56 +01:00
Yang Tse
8e25d1b93b hostip.c: fix Curl_loadhostpairs() OOM handling 2012-01-02 13:41:09 +01:00
Yang Tse
63e2718f8d runtests.pl: on test failure, don't show trace log files of other tests 2012-01-02 13:40:12 +01:00
Daniel Stenberg
7f472618de Curl_input_negotiate: use the correct buffer for input
Unfortunately we have no test cases for this and I have no SSPI build or
server to verify this with. The change seems simple enough though.

Bug: http://curl.haxx.se/bug/view.cgi?id=3466497
Reported by: Patrice Guerin
2012-01-01 22:36:32 +01:00
Daniel Stenberg
08107111ac runtests: put trace outputs in log/trace[num] for all tests 2012-01-01 19:48:24 +01:00
Daniel Stenberg
a3403db02f just a stupid typo 2011-12-31 23:53:52 +01:00
Daniel Stenberg
c9a3cab6c4 SFTP dir: increase buffer size counter
When the buffer gets realloced to hold the file name in the
SSH_SFTP_READDIR_LINK state, the counter was not bumped accordingly.

Reported by: Armel Asselin
Patch by: Armel Asselin
Bug: http://curl.haxx.se/mail/lib-2011-12/0249.html
2011-12-31 23:52:15 +01:00
Daniel Stenberg
f4949e56eb RELEASE-NOTES: synced with 81ebdd9e28
6 more bugfixes, 3 more contributors
2011-12-31 11:22:26 +01:00
Daniel Stenberg
81ebdd9e28 create_hostcache_id: use the key lower cased
... to make sure the DNS cache is properly case insensitive
2011-12-31 10:58:05 +01:00
Daniel Stenberg
207cf15032 changed case: use new host name for subsequent HTTP requests
When a HTTP connection is re-used for a subsequent request without
proxy, it would always re-use the Host: header of the first request. As
host names are case insensitive it would make curl send another host
name case that what the particular request used.

Now it will instead always use the most recent host name to always use
the desired casing.

Added test case 1318 to verify.

Bug: http://curl.haxx.se/mail/lib-2011-12/0314.html
Reported by: Alex Vinnik
2011-12-31 10:45:28 +01:00
Daniel Stenberg
5e0a44e4d5 CURLOPT_RESOLVE: avoid adding already present host names
The load host names to DNS cache function was moved to hostip.c and it
now makes sure to not add host names that already are present in the
cache. It would previously lead to memory leaks when for example using
the --resolve and multiple URLs on the command line.
2011-12-31 10:45:27 +01:00
Dan Fandrich
9e3f8c4850 runtests.pl: Use logmsg more consistently 2011-12-31 00:49:34 -08:00
Alessandro Ghedini
90343c76c6 examples: update README, Makefile.inc and gitignore with pop3s examples 2011-12-30 15:30:11 +01:00
Alessandro Ghedini
ecd75e8cb8 examples: add a couple of simple pop3s examples
These examples show how to fetch a single message (RETR command) and how to
list all the messages in a given mailbox (LIST command), with authentication
via SSL.

They were both based on the https.c example.
2011-12-30 15:30:11 +01:00
Yang Tse
e63c9f8ff3 removed execute file permission 2011-12-30 03:53:25 +01:00
Yang Tse
ed0364343d removed trailing whitespace 2011-12-30 03:36:18 +01:00
Yang Tse
5c0ad9581d ftpserver.pl: arbitrary application data splitting among TCP packets [II]
Take in account that 'pingpong' server commands may arrive splitted among
several sockfilt 'DATA' PDU's.
2011-12-29 23:40:06 +01:00
Yang Tse
e99128a5c9 ftpserver.pl: arbitrary application data splitting among TCP packets [I]
Initial step in order to allow our pingpong server to better support arbitrary
application data splitting among TCP packets. This first commit only addresses
reasembly of data that sockfilter processes reads from soockets and pingpong
server later reads from sockfilters stdout.
2011-12-28 23:04:23 +01:00
Yang Tse
33c2e1cafc testcurl.pl: 82c344a3 follow-up 2011-12-27 13:23:47 +01:00
Yang Tse
84f736981c testcurl.pl: log ACLOCAL_FLAGS 2011-12-26 17:09:44 +01:00
Yang Tse
82c344a347 testcurl.pl: third party m4 warnings filtering adjustment
Make testcurl.pl ignore messages pertaining to third party m4 files we don't
care nor use on a file basis policy while retaining all other warnings.

This closes temporary commit e71e226f
2011-12-26 17:01:04 +01:00
Kamil Dudka
9f7f6a62ff transfer: avoid unnecessary timeout event when waiting for 100-continue
The commit 9dd85bc unintentionally changed the way we compute the time
spent waiting for 100-continue.  In particular, when using a SSL client
certificate, the time spent by SSL handshake was included and could
cause the CURL_TIMEOUT_EXPECT_100 timeout to be mistakenly fired up.

Bug: https://bugzilla.redhat.com/767490
Reported by: Mamoru Tasaka
2011-12-25 22:37:24 +01:00
Yang Tse
98292bcdd0 transfer.c: move a logging statement placement 2011-12-25 12:11:51 +01:00
Yang Tse
996f2454ba hash.c: fix OOM triggered segfault 2011-12-25 11:35:45 +01:00
Daniel Stenberg
99a12baa34 ftp_do_more: don't return success until all is done
ftp_do_more() returns after accepting the server connect however it
needs to fall through and set "*complete" to TRUE before exit from the
function.

Bug: http://curl.haxx.se/mail/lib-2011-12/0250.html
Reported by: Gokhan Sengun
2011-12-24 00:12:00 +01:00
Daniel Stenberg
4f8db8bf95 Curl_do_more: fix typo logic
In the recent do_more fix the new logic was mistakenly checking the
pointer instead of what it points to.

Reported by: Gokhan Sengun
Bug: http://curl.haxx.se/mail/lib-2011-12/0250.html
2011-12-24 00:09:41 +01:00
Daniel Stenberg
5ac9ec7205 SFTP mkdir: use correct permission
When sending quote command to a SFTP server and 'mkdir' was used, it
would send fixed permissions and not use the CURLOPT_NEW_DIRECTORY_PERMS
as it should.

Reported by: Armel
Patch by: Armel
Bug: http://curl.haxx.se/mail/lib-2011-12/0249.html
2011-12-24 00:04:04 +01:00
Yang Tse
f8cd217f04 buildconf: minor tweaks commit 430527a1 follow-up 2011-12-23 17:45:42 +01:00
Colin Hogben
84e7ea2ffc Require a less ancient version of perl
The INTERNALS document suggested that compatibility should be
maintained with perl version 4, but this was untrue - scripts such as
chksource.pl and runtests.pl use perl5-isms.
2011-12-23 14:49:03 +01:00
Daniel Stenberg
2caa454dc1 resolve: don't leak pre-populated dns entries
CURLOPT_RESOLVE populates the DNS cache with entries that are marked as
eternally in use. Those entries need to be taken care of when the cache
is killed off.

Bug: http://curl.haxx.se/bug/view.cgi?id=3463121
Reported by: "tw84452852"
2011-12-23 14:46:20 +01:00
Daniel Stenberg
3e4181f88e new test: verify --resolve
Test 1317 verifies --resolve (leaked memory)

Bug: http://curl.haxx.se/bug/view.cgi?id=3463121
Reported by: "tw84452852"
2011-12-23 14:46:20 +01:00
Yang Tse
e71e226f6b testcurl.pl: temporary change
Allow autobuilds to run a couple of days without filtering out aclocal
underquoted definition warnings.
2011-12-23 11:13:39 +01:00
Daniel Stenberg
b0eb963bc7 operate: removed a single trailing space 2011-12-21 21:17:34 +01:00
Dan Fandrich
2cf9e78a22 --retry: Retry transfers on timeout and DNS errors 2011-12-21 11:09:09 -08:00
Yang Tse
430527a1d7 buildconf: minor tweaks 2011-12-21 16:21:37 +01:00
Yang Tse
1afbccc676 formdata.c: OOM handling fixes 2011-12-21 15:39:44 +01:00
Daniel Stenberg
1dd654644a TODO: 1.7 Happy Eyeball dual stack connect 2011-12-21 09:54:29 +01:00
Dan Fandrich
ba238e3a18 runtests.pl: Fixed perl warning when using the -l option 2011-12-20 18:31:53 -08:00
Daniel Stenberg
4bb140bfc9 RELEASE-NOTES: added two references 2011-12-20 23:57:39 +01:00
Daniel Stenberg
926916e28e Curl_socket_check: enlarge poll struct array to 3
This function was introduced in commit 5527417afa and as pointed out
by Gokhan Sengun, the array with poll structs must large enough to hold
3 sockets since that is what the function can accept. It could be noted
that he had this fixed in his patch as posted in
http://curl.haxx.se/mail/lib-2011-12/0179.html

Bug: http://curl.haxx.se/mail/lib-2011-12/0228.html
Reported by: Gokhan Sengun
2011-12-20 23:33:54 +01:00
Daniel Stenberg
3d6e2ec925 RELEASE-NOTES: synced with 380bade777
5 new bugfixes, 2 new changes and 4 new contributors
2011-12-20 23:27:41 +01:00
Daniel Stenberg
380bade777 TODO: remove active FTP from section 2.1
It is no longer done blocking in the multi interface
2011-12-20 23:26:47 +01:00
Daniel Stenberg
26ce3ac328 libcurl docs: add the new FTP accept option + errors 2011-12-20 23:14:18 +01:00
Daniel Stenberg
130fac6c16 timeleft_accept: ack global timeout, moved to ftp.c
First off the timeout for accepting a server connect back must of course
respect a global timeout. Then the timeleft function is only used by ftp
code so it was moved to ftp.c and made static.
2011-12-20 20:55:54 +01:00
Daniel Stenberg
6222ef8052 libcurl-tutorial.3: curl doesn't sent pragma no-cache
It did a long time ago
2011-12-20 20:32:47 +01:00
Daniel Stenberg
b06ed249d2 libcurl-multi.3: active FTP is no longer blocking! 2011-12-20 20:32:31 +01:00
Daniel Stenberg
377471f387 FTP: move FTP-specific struct field to ftpc_conn
"wait_data_conn" was added to the connectionbits in commit c834213ad5 for
handling active FTP connections but as it is purely FTP specific and now
only ever accessed by ftp.c I moved it into the FTP connection struct.
2011-12-20 20:30:38 +01:00
Daniel Stenberg
dfdac61522 non-blocking active FTP: cleanup multi state usage
Backpedaled out the funny double-change of state in the multi state
machine by adding a new argument to the do_more() function to signal
completion. This way it can remain in the DO_MORE state properly until
done. Long term, the entire DO_MORE logic should be moved into the FTP
code and be hidden from the multi code as the logic is only used for
FTP.
2011-12-20 20:30:02 +01:00
Gokhan Sengun
c834213ad5 FTP: perform active connections non-blocking
1- Two new error codes are introduced.

CURLE_FTP_ACCEPT_FAILED to be set whenever ACCEPTing fails because of
FTP server connected.

CURLE_FTP_ACCEPT_TIMEOUT to be set whenever ACCEPTing timeouts.

Neither of these errors are considered fatal and control connection
remains OK because it could just be a firewall blocking server to
connect to the client.

2- One new setopt option was introduced.

CURLOPT_ACCEPTTIMEOUT_MS

It sets the maximum amount of time FTP client is going to wait for a
server to connect. Internal default accept timeout is 60 seconds.
2011-12-20 20:30:02 +01:00
Daniel Stenberg
5527417afa sockets: new Curl_socket_check() can wait for 3 sockets
This offers an alternative to the existing Curl_socket_ready() API which
only checks one socket for read and one for write.
2011-12-20 20:30:02 +01:00
Cédric Deltheil
bedfafe38e curl.h: add __ANDROID__ macro check
When working with the Android Standalone Toolchain the compiler defines
this macro:

  /path/to/arm-linux-androideabi-gcc -E -dM - < /dev/null \
  | grep -i android
  #define __ANDROID__ 1

We really need to check both ANDROID and __ANDROID__ since I've observed
that:

* if you use Android.mk file(s) and the 'ndk-build' script (aka vanilla
way), ANDROID is predefined (see -DANDROID extra C flag),

* if you use the Android Standalone Toolchain, then __ANDROID__ is
predefined as stated by the compiler
2011-12-20 20:18:14 +01:00
Daniel Stenberg
e9040f2954 lib500: verify timers relative each other
As commit ce896875f8 fixed a timer that accidentally had been moved in
code and then returned a bad timer, the lib500.c code (used in test 500
and some others) now verifies 5 timers against each other to verify that
they have the correct relative values. We cannot compare against
absolute values as the timings will vary a lot.
2011-12-20 15:41:43 +01:00
Daniel Stenberg
51d4885ca0 Curl_pgrsTime: store now in an auto variable
It makes it easier to introduce debug outputs in this function, and
everything in the function is using the value anyway so it might even be
more efficient.
2011-12-20 15:05:50 +01:00
Daniel Stenberg
ce896875f8 timer: restore PRETRANSFER timing
Regression introduced in 7.23.0 with commit 9dd85bce. The function in
which the PRETRANSFER time stamp was recorded was moved in time causing
it be stored very quickly after the start timestamp. On most systems
shorter than 1 millisecond and thus it wouldn't even show with -w
"%{time_pretransfer}" using the command line tool.

Bug: http://curl.haxx.se/mail/archive-2011-12/0022.html
Reported by: Toni Moreno
2011-12-20 14:59:46 +01:00
Bernhard Reutner-Fischer
eb6e9593c4 libcurl.m4: Fix quoting arguments of AC_LANG_PROGRAM
Parameters were underquoted, resulting in
warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-12-20 13:35:27 +01:00
Daniel Stenberg
5c71544fc6 gitignore: ignore the symbol versioning file 2011-12-20 11:07:23 +01:00
Daniel Stenberg
7799ac434e tutorial: remove CURLM_CALL_MULTI_PERFORM add sharing
The CURLM_CALL_MULTI_PERFORM reference is an old leftover I had to
remove.

I also added some blurb to the previously blank "sharing" section.
2011-12-20 09:48:32 +01:00
Alessandro Ghedini
7cc2e8b349 configure: add symbols versioning option
Allow, at configure time, the production of versioned symbols. The
symbols will look like "CURL_<FLAVOUR>_<VERSION> <SYMBOL>", where
<FLAVOUR> represents the SSL flavour (e.g. OPENSSL, GNUTLS, NSS, ...),
<VERSION> is the major SONAME version and <SYMBOL> is the actual symbol
name. If no SSL library is enabled the symbols will be just
"CURL_<VERSION> <SYMBOL>".
2011-12-19 23:25:36 +01:00
Sven Wegener
3c18b38dcc Use Curl_ssl_connect for non-blocking connect fallback
This gets the appconnect time right for ssl backends, which don't
support non-blocking connects.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
2011-12-19 22:37:37 +01:00
Daniel Stenberg
1fc5cd6a1a RELEASE-NOTES: synced with af9bc1604c
One new feature, one bug fix. Introduced references in this file for
mentioned issues after this discussion:
http://curl.haxx.se/mail/lib-2011-12/0187.html

The plan is to let the references get moved over to the changes.html
file at release-time
2011-12-19 20:08:59 +01:00
Daniel Stenberg
af9bc1604c curl.1: minor white space cleanup 2011-12-19 14:23:23 +01:00
Alessandro Ghedini
b235d5ade8 docs: improve description of the --capath option
Document the possibility of providing multiple values using the ":"
separator, and the fact that the default value will be ignored if the
option is used.
2011-12-19 11:10:47 +01:00
Steve Holme
ee3d3adc6f DOCS: Added SMTP information to CURLOPT_INFILESIZE 2011-12-19 11:08:01 +01:00
Daniel Stenberg
583a902789 Curl_proxyCONNECT: use newlines in debug output 2011-12-19 09:32:54 +01:00
Daniel Stenberg
7b8590d1f5 curl -F: fix multiple file upload with custom type
Test case 1315 was added to verify this functionality. When passing in
multiple files to a single -F, the parser would get all confused if one
of the specified files had a custom type= assigned.

Reported by: Colin Hogben
2011-12-16 11:43:25 +01:00
Colin Hogben
9b185aac43 New test for multiple file upload
test 1315 checks correct behaviour when uploading multiple files.
Buggy behaviour has been seen where only two attachments are sent.
2011-12-16 11:39:53 +01:00
Yang Tse
34f9ec0c54 configure: libtool 1.5 tweaks 2011-12-15 18:01:00 +01:00
Colin Hogben
7111ca6f5f Correct substitution var names
Two variable names were wrong in the documentation.
2011-12-15 17:27:51 +01:00
Colin Hogben
612a61b267 Correct default upload mimetype in manual
The default content-type for file uploads is application/octet-stream,
not text/plain as stated in the MANUAL.
2011-12-15 17:27:38 +01:00
Alessandro Ghedini
cd4cd66839 docs: fix typo in curl_easy_setopt manpage 2011-12-15 17:25:07 +01:00
Yang Tse
4c4e8ba1f0 if2ip.[ch]: fix compilation with MinGW
Avoid 'interface' literal that some MinGW versions define as a macro
2011-12-13 18:37:33 +01:00
Yang Tse
de6f4f356e connect.c: fix compiler warning 'enumerated type is mixed with another type' 2011-12-13 16:18:08 +01:00
Yang Tse
66c5076252 if2ip.c: fix compiler warning 'unused parameter' 2011-12-13 16:08:42 +01:00
Yang Tse
b9b772fefe pop3.c: fix compiler warning variable may be used uninitialized 2011-12-13 15:58:02 +01:00
Yang Tse
07efe110cc if2ip.c: fix compiler warning 'enumerated type is mixed with another type' 2011-12-13 15:47:26 +01:00
Jason Glasgow
6e4835c795 CURLOPT_INTERFACE: avoid resolving interfaces names
Do not try to resolve interfaces names via DNS by recognizing interface
names in a few ways.  If the interface option argument has a prefix of
"if!" then treat the argument as only an interface.  Similarly, if the
interface argument is the name of an interface (even if it does not have
an IP address assigned), treat it as an interface name.  Finally, if the
interface argument is prefixed by "host!" treat it as a hostname that
must be resolved by /etc/hosts or DNS.

These changes allow a client using the multi interfaces to avoid
blocking on name resolution if the interface loses its IP address or
disappears.
2011-12-12 23:12:37 +01:00
Daniel Stenberg
ba057c2e19 RELEASE-NOTES: synced with 1259ccf747
5 more bugfixes, 5 more contributors
2011-12-12 20:06:50 +01:00
Steve Holme
1259ccf747 ConnectionExists: Fix reuse for TLS upgraded connections
Fixed the connection reuse detection in ConnectionExists() when
comparing a new connection that is non-SSL based against that of a SSL
based connection that has become so by being upgraded via TLS.
2011-12-12 00:32:47 +01:00
Daniel Stenberg
07e3b7512c create_conn: don't switch to HTTP protocol if tunneling is enabled
This is a regression since who knows when. When spotting that a HTTP
proxy is used we must not uncondititionally enable the HTTP protocol
since if we do tunneling through the proxy we're still using the target
protocol.

Reported by: Naveen Chandran
2011-12-09 22:51:08 +01:00
Daniel Stenberg
50d88bf4b5 FAQ: add --resolve details to question 3.19 2011-12-07 23:08:15 +01:00
Gokhan Sengun
1cacf853da Curl_closesocket: clear sock_accepted on close
As a follow-up from commit d5b5f64bce, clear the sock_accepted status
when such a socket is closed to avoid a re-used connection to retain the
state wrongly.

Bug: http://curl.haxx.se/mail/lib-2011-12/0079.html
2011-12-07 16:03:00 +01:00
Daniel Stenberg
9dbe6565d4 static SSL windows builds: add more libs to the link
Starting with some recent OpenSSL versions (1.0.0e was mentioned)
linking with a static openssl requires a set of more libs to be linked
on Windows.

Thanks also to Steve Holme and Martin Storsj for additional feedback.

Bug: http://curl.haxx.se/mail/lib-2011-12/0063.html
Reported by: Ward Willats
2011-12-07 15:52:25 +01:00
Gokhan Sengun
2b24dd870e multi interface: fix block when CONNECT_ONLY option is used 2011-12-07 15:37:05 +01:00
Dan Fandrich
46724b87b7 Added some include files in a couple of example programs
This improves portability of the examples.  This patch was
submitted to the OpenBSD ports collection by naddy.
2011-12-06 19:54:48 -08:00
Daniel Stenberg
82a4d26e7f MakefileBuild: fix the static build
This is a left-over fix from commit b7e242de0e that Tom Wright
suggested.

Reported by: Ward Willats
2011-12-06 20:02:57 +01:00
Daniel Stenberg
2b0e09b0f9 OpenSSL: check for the SSLv2 function in configure
If no SSLv2 was detected in OpenSSL by configure, then we enforce the
OPENSSL_NO_SSL2 define as it seems some people report it not being
defined properly in the OpenSSL headers.
2011-12-06 14:22:45 +01:00
Daniel Stenberg
361cd03d58 CURLOPT_CONNECTTIMEOUT: default is 300 seconds
If the option is set to 0, the default timeout will be used - which in
modern libcurl versions equals 300 seconds (== 5 minutes).

Bug: http://curl.haxx.se/mail/lib-2011-12/0051.html
Reported by: Vladimir Grishchenko
2011-12-05 23:19:50 +01:00
Rob Ward
7e4daaf908 progress function example: include timed interval
Adds a timer based off of CURLINFO_TOTAL_TIME that is used to perform
certain actions after a minimum amount of time has passed using the
progress function. As a consequence the curl handle is now also passed
into the progress function. Progress example now also includes an
example of how to retreive the TOTAL_TIME and print it out.
2011-12-05 23:13:34 +01:00
Daniel Stenberg
3bbe219be2 RELEASE-NOTES: synced with 347f951c39
8 more bugs, 5 more contributors
2011-12-05 22:58:30 +01:00
Daniel Stenberg
347f951c39 SSH: fix CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
When a 32 digit hex key is given as a hostkey md5 checksum, the code
would still run it against the knownhost check and not properly
acknowledge that the md5 should then be the sole guide for.

The verbose output now includes the evaluated MD5 hostkey checksum.

Some related source code comments were also updated.

Bug: http://curl.haxx.se/bug/view.cgi?id=3451592
Reported by: Reza Arbab
2011-12-05 22:24:28 +01:00
Daniel Stenberg
c50dbf670f Curl_resolver_is_resolved: differentiate between host/proxy errors
As there are different return codes for host vs proxy errors, this function
now properly returns the code properly depending on what was attempted to get
resolved.

Bug: http://curl.haxx.se/mail/archive-2011-12/0010.html
Reported by: Jason Liu
2011-12-05 12:44:55 +01:00
Daniel Stenberg
0cf05af744 c-ares: return proxy failure for all proxy types
When making a distinction which return code to return, the code previously
only regarded HTTP proxies to be proxies and thus return host-related errors
for failures on other proxy types than HTTP. Now all proxy types will be
considered proxies...
2011-12-05 12:41:38 +01:00
Daniel Stenberg
d5b5f64bce FTP: close callback fix
Keep track of which sockets that are the result of accept() calls and
refuse to call the closesocket callback for those sockets. Test case 596
now verifies that the open socket callback is called the same number of
times as the closed socket callback for active FTP connections.

Bug: http://curl.haxx.se/mail/lib-2011-12/0018.html
Reported by: Gokhan Sengun
2011-12-05 12:34:27 +01:00
Daniel Stenberg
088ba97a24 FTP: call opensocket callback properly
When the new socket is created for an active connection, it is now done
using the open socket callback.

Test case 596 was modified to run fine, although it hides the fact that
the close callback is still called too many times, as it also gets
called for closing sockets that were created with accept().
2011-12-05 11:42:10 +01:00
Daniel Stenberg
9109cdec11 Curl_socket: internal replacement for socket()
Moved out into a separate function to work as a "generic" socket()
replacement.
2011-12-05 10:58:38 +01:00
Daniel Stenberg
5971d401d4 test: verify the opensocket callback for FTP
test 595: for passive FTP
test 596: for active FTP
2011-12-04 23:10:12 +01:00
Jason Glasgow
62d3652b43 CURLOPT_DNS_SERVERS: set name servers if possible (fix)
Ensure that CURLE_OK is returned if setting the name servers is successfull.
2011-12-02 21:54:15 +01:00
Daniel Stenberg
d81f5ea3e0 multi interface: only use non-NULL function pointer!
If the socket callback function pointer hasn't been set, we must not
attempt to use it. Commit adc88ca20 made it more likely to occur.
2011-12-02 21:10:28 +01:00
Jason Glasgow
adc88ca203 multi: handle timeouts on DNS servers by checking for new sockets
If the first name server is not available, the multi interface does
not invoke the socket_cb when the DNS request to the first name server
timesout.  Ensure that the list of sockets are always updated after
calling Curl_resolver_is_resolved.

This bug can be reproduced if Curl is complied with --enable_ares and
your code uses the multi socket interfaces and the
CURLMOPT_SOCKETFUNCTION option.  To test try:
  iptables -I INPUT \
           -s $(sed -n -e '/name/{s/.* //p;q}' /etc/resolv.conf)/32 \
           -j REJECT
and then run a program which uses the multi-interface.
2011-12-02 10:18:52 +01:00
Daniel Stenberg
83350c9cc4 test 815: verify POP3 dot-first-on-line unescaping 2011-12-01 10:20:42 +01:00
Steve Holme
bdb647814e POP3: fixed escaped dot not being striped out
Changed the eob detection to work across the whole of the buffer so that
lines that begin with a dot (which the server will have escaped) are
passed to the client application correctly.
2011-12-01 00:06:47 +01:00
Yang Tse
c92234c3bc buildconf: follow-up for commit 7e02f7fd 2011-11-30 21:53:21 +01:00
Yang Tse
7e02f7fdee buildconf: fix libtool 1.5.x warnings triggered with autoconf 2.6x or later
Using libtool 1.5.x (x < 26) with autoconf 2.6x or later generates warnings
due to some libtool variables not following naming convention for variables
that will be cached.

This is addressed renaming a couple of variables to make these follow expected
naming convention.
2011-11-30 19:33:38 +01:00
Daniel Stenberg
bd94807003 RELEASE-NOTES: synced with 1038d0aa1
5 bugfixes and 1 new contributor
2011-11-30 16:38:58 +01:00
Yang Tse
1038d0aa16 pop3.c: fix compiler warning 2011-11-29 20:28:49 +01:00
Yang Tse
f80a508297 configure: avoid usage of macro PKG_CHECK_MODULES
libidn option adjusted in order to use pkg-config info when available
in a similar way as we already do for other libraries.
2011-11-29 19:11:34 +01:00
Daniel Stenberg
af64666434 POP3: detect when LIST returns no mails
By making sure the function can detect an "end of body" sequence
immediately on the first line, test 811 is now enabled.
2011-11-29 13:43:46 +01:00
Daniel Stenberg
2d72489f0f ftpserver: output CRLF in logs
Previously the log function would just filter out all CR and LF
occurances from the log to make it more readable. This had the downside
that it made it very hard to see CR LFs when they actually matters.

Now, they're instead converted to "[CR]" and "[LR]" in the log to become
apparent to readers.
2011-11-29 13:43:12 +01:00
Daniel Stenberg
dda815b776 POP3: fix end of body detection
Curl_pop3_write() now has a state machine that scans for the end of a
POP3 body so that the CR LF '.' CR LF sequence can come in everything
from one up to five subsequent packets.

Test case 810 is modified to use SLOWDOWN which makes the server pause
between each single byte and thus makes the POP3 body get sent to curl
basically one byte at a time.
2011-11-29 00:25:21 +01:00
Daniel Stenberg
8d3efb6be0 test: added POP3 test with dot-prefixed line
Test 815 is disabled for now since libcurl currently doesn't unescape
such lines the way it should. See mail:

http://curl.haxx.se/mail/lib-2011-11/0324.html
2011-11-28 23:34:16 +01:00
Daniel Stenberg
11e52ef0a1 configure: fix to make older pkg-config play well
configure.ac:1349: error: possibly undefined macro: PKG_CONFIG_LIBDIR

Obviously this is not a problem with pkg-config 0.26 but older versions
seem to show this.

Fix suggested by: Kamil Dudka
Reported by: Guenter
Bug: http://curl.haxx.se/mail/lib-2011-11/0298.html
2011-11-27 20:00:30 +01:00
Daniel Stenberg
71ce2470dc test 1211: FTP test to repeat bug #3429299
"Active FTP hangs if server does not open data connection"

The server first sends a 150 and then when libcurl waits for the data
transfer, the server sends a 425.
2011-11-25 23:15:58 +01:00
Mark Brand
874855b743 configure: add support for pkg-config detection of libidn 2011-11-25 23:05:37 +01:00
Daniel Stenberg
ac54d27d4b FTP tests 1206 - 1209: don't expect QUIT
The protocol parts for these tests do not include QUIT simply because
the error is CURLE_OPERATION_TIMEDOUT (28) which is a generic timeout
error without specificly saying for which connection it concerns, and
for timeouts libcurl marks the control channel as "invalid". As this
test case times out for the data connection it could still use the
control channel.
2011-11-25 22:49:49 +01:00
Yang Tse
2d833852f6 CyaSSL 2.0+ library initialization adjustment 2011-11-25 17:23:36 +01:00
Jonas Schnelli
0604b2fb90 rectify comment 2011-11-25 15:02:43 +01:00
Daniel Stenberg
8f50a5c7e5 SSLSESSION_SHARED: new macro to check if session is shared
Added convenience macro to use to check if a handle is using a shared
SSL session, and fixed so that Curl_ssl_close_all() doesn't lock when
the session isn't shared.
2011-11-25 15:00:37 +01:00
Yang Tse
703fa0a6a8 telnet.c: fix MSVC compiler warning 2011-11-25 14:30:53 +01:00
Yang Tse
97d7a9260e tvdiff_secs(): sub-zero time difference adjustment
Skip a floating point addition operation when integral part of time difference
is zero. This avoids potential floating point addition rounding problems while
preserving decimal part value.
2011-11-25 13:51:55 +01:00
Daniel Stenberg
4a4d04446d telnet: fix macros to allow proper semicolon use
Macros that look like function calls need to be made so that we can use
semicolons properly for indentation and for reducing the risk for
mistakes when using them.
2011-11-25 10:56:18 +01:00
Laurent Rabret
b9223a17b8 TELNET: improved treatment of options
1) enables the Window Size option
2) allows the server to enable the echo mode
3) allows an app using libcurl to disable the default binary mode

Signed-off-by: Laurent Rabret
2011-11-25 10:46:49 +01:00
Daniel Stenberg
f712ace9d7 RELEASE-NOTES: synced with 2c905fd1f8 2011-11-25 00:09:43 +01:00
Jonas Schnelli
2c905fd1f8 query-part: ignore the URI part for given protocols
By setting PROTOPT_NOURLQUERY in the protocol handler struct, the
protocol will get the "query part" of the URL cut off before the data is
handled by the protocol-specific code. This makes libcurl adhere to
RFC3986 section 2.2.

Test 1220 is added to verify a file:// URL with query-part.
2011-11-24 23:31:19 +01:00
Daniel Stenberg
4403e82f32 symbols.pl: provide LIBCURL_HAS macro for apps
Experience has shown that the symbols-in-versions file is very useful to
applications that want to build with a wide range of libcurl versions.
It is however easy to get it wrong and the source gets a bit messy with
all the fixed numerical comparisions.

The point of this script is to provide an easy-to-use macro for libcurl-
using applications to do preprocessor checks for specific libcurl
defines, and yet make the code clearly show what the macro is used for.
2011-11-24 22:56:39 +01:00
Yang Tse
c482e946f7 lib573.c: fix double data type variable comparison with zero 2011-11-24 18:18:42 +01:00
Yang Tse
46bd8b330a getinfo.c: reset app connect time when clearing session-info time variables 2011-11-24 18:13:09 +01:00
Yang Tse
78feaff9d8 Fix unreleased regression when using windows gnutls versions older than 2.8 2011-11-24 12:11:52 +01:00
Mark Brand
28bac99674 gnutls: only translate winsock errors for old versions
Bugfix: https handshake fails using gnutls 3 on windows
http://sourceforge.net/tracker/index.php?func=detail&aid=3441084&group_id=976&atid=100976

New gnutls versions have an error handler that knows about Winsock
errors, which is why gnutls_transport_set_global_errno() was deprecated
and then removed.

This is a correction of commit f5bb370 (blame me) which meant to
reimplement gnutls_transport_set_global_errno(), which is not necessary.
2011-11-23 22:38:11 +01:00
Daniel Stenberg
7248439fec protocol_connect: show verbose connect and set connect time
Regression: commit b998d95b (shipped first in release 7.22.0) made the
condition always equal false that should reset the TIMER_CONNECT timer
and call the Curl_verboseconnect() function.

Reported by: "Captain Basil"
Bug: http://curl.haxx.se/mail/archive-2011-11/0035.html
2011-11-21 23:36:21 +01:00
Daniel Stenberg
c532604b13 -J -O: use -O name if no Content-Disposition header comes!
A regression between 7.22.0 and 7.23.0 -- downloading a file with the
flags -O and -J results in the content being written to stdout if and
only if there was no Content-Disposition header in the http response. If
there is a C-D header with a filename attribute, the output is correctly
written.

Reported by: Dave Reisner
Bug: http://curl.haxx.se/mail/archive-2011-11/0030.html
2011-11-20 23:35:49 +01:00
Martin Storsjo
64f328c787 Add support for using nettle instead of gcrypt as gnutls backend 2011-11-19 22:23:14 +01:00
Jonas Schnelli
c0db5ff678 test: SFTP quote commands with * prefix
Related to the f64812ca63 commit
2011-11-18 20:30:46 +01:00
Daniel Stenberg
66617b79d7 CURLOPT_QUOTE: SFTP supports the '*'-prefix now 2011-11-18 20:27:07 +01:00
Jonas Schnelli
f64812ca63 SFTP: support '*' prefix for quote operations
prefixing a command with '*' means it is allowed to fail without
aborting the chain actions
2011-11-18 16:04:52 +01:00
Daniel Stenberg
10ecdf5078 getsessionid: don't ever return while locked
Also, check for the session sharing bit instead of comparing pointers
2011-11-17 23:57:21 +01:00
Daniel Stenberg
bb4eb58996 Curl_ssl_getsessionid: increase the value, not the pointer 2011-11-17 23:46:29 +01:00
Daniel Stenberg
fc8809f993 THANKS: one new contributor in 7.23.1 2011-11-17 23:43:38 +01:00
Alejandro Alvarez Ayllon
35f61c404d SSL session share: move the age counter to the share object
Previously the age counter would be counted individually in each easy
handle that shared SSL sessions!
2011-11-17 23:34:38 +01:00
Alejandro Alvarez Ayllon
97b73fec7a libtest build: add the missing lib586 2011-11-17 23:33:42 +01:00
Jason Glasgow
8d0a504f0d CURLOPT_DNS_SERVERS: set name servers if possible 2011-11-17 22:52:33 +01:00
Daniel Stenberg
967b2f87a8 RELEASE-NOTES: correct the release and contributor numbers 2011-11-17 18:29:15 +01:00
Daniel Stenberg
b9660dc4b2 FindWin32CACert: return OK even if CA cert isn't found
Bug: http://curl.haxx.se/mail/lib-2011-11/0180.html
Reported by: Mark Brand
2011-11-17 18:05:27 +01:00
Dan Fandrich
591c29aa49 curl has been built on many Android versions 2011-11-16 17:11:31 -08:00
Daniel Stenberg
5e0aa3aac9 7.24.0: start the work 2011-11-15 20:44:49 +01:00
Daniel Stenberg
7cfd10e255 THANKS: added 18 new contributors from 7.23.0 2011-11-15 20:44:24 +01:00
Dan Fandrich
95ddbdb1db curl_easy_setopt arguments should be of type long in the examples 2011-11-14 14:07:25 -08:00
Daniel Stenberg
6c4216b2a7 RELEASE-NOTES: synced with 10120e6a
one more bug fix and contributor
2011-11-12 10:09:54 +01:00
Daniel Stenberg
10120e6ab5 progress_cb: avoid buffer overflow
The progress bar output function would blindly use the terminal width
without bounds checking. When using a very wide terminal that caused a
buffer overflow and segfault.

We now limit the max bar with to 255 columns, and I simplified the code
to avoid an extra snprintf and buffer.

Bug: http://curl.haxx.se/bug/view.cgi?id=3435710
Reported by: Alexey Zakhlestin
2011-11-11 19:57:49 +01:00
Yang Tse
082e8a3b03 Active mode FTP test cases with server not establishing data connection
591 -> FTP multi PORT and 425 on upload
592 -> FTP multi PORT and 421 on upload
593 -> FTP multi PORT upload, no data conn and no transient neg. reply
594 -> FTP multi PORT upload, no data conn and no positive prelim. reply

1206 -> FTP PORT and 425 on download
1207 -> FTP PORT and 421 on download
1208 -> FTP PORT download, no data conn and no transient negative reply
1209 -> FTP PORT download, no data conn and no positive preliminary reply
2011-11-11 19:46:44 +01:00
Guenter Knauf
fd765c627f Fix to skip untrusted certs. 2011-11-08 05:46:46 +01:00
Daniel Stenberg
c8ffb4049a RELEASE-NOTES: synced with e3166df1bb
4 new bugfixes, 2 more contributors
2011-11-06 23:42:28 +01:00
Daniel Stenberg
e3166df1bb ftp PORT: don't hang if bind() fails
When the user requests PORT with a specific port or port range, the code
could lock up in an endless loop. There's now an extra conditional that
makes sure to special treat the error and try the local address only
once so a second failure will abort the loop correctly.

Bug: http://curl.haxx.se/bug/view.cgi?id=3433968
Reported by: Gokhan Sengun
2011-11-06 23:02:27 +01:00
Daniel Stenberg
06a83e8050 pingpong: change two comments wrongly referring "FTP"
Just a sign of where the code originally was ripped out from. Now it is
generic "pingpong".
2011-11-06 17:38:36 +01:00
Daniel Stenberg
2c09d21fdf test 590: verify the bug fix in 4851dafcf1
This test is created to verify Rene Bernhardt's patch which makes sure
libcurl properly _not_ deals with Negotiate if not asked to even if the
proxy says it can serve it.
2011-11-06 17:28:28 +01:00
Rene Bernhardt
4851dafcf1 HTTP auth: fix proxy Negotiate bug
If a proxy offers several Authentication schemes where NTLM and
Negotiate are offered by the proxy and you tell libcurl not to use the
Negotiate scheme then the request never returns when the proxy answers
with its HTTP 407 reply.

It is reproducible by the following steps:

- Use a proxy that offers NTLM and Negotiate ( CURLOPT_PROXY and
CURLOPT_PROXYPORT )

- Tell libcurl NOT to use Negotiate CURL_EASY_SETOPT(CURLOPT_PROXYAUTH,
CURLAUTH_BASIC | CURLAUTH_DIGEST | CURLAUTH_NTLM )

- Start the request

The call to CURL_EASY_PERFORM never returns. If you switch on debug
logging you can see that libcurl issues a new request As soon as it
received the 407 reply. Instead it should return and set the response
code to 407.

Bug: http://curl.haxx.se/mail/lib-2011-10/0323.html
2011-11-06 17:19:37 +01:00
Yang Tse
73029dca5a ssluse.c: fix calling of OpenSSL's ERR_remove_state(0)
Move calling of ERR_remove_state(0) a.k.a ERR_remove_thread_state(NULL)
from Curl_ossl_close_all() to Curl_ossl_cleanup().

In this way ERR_remove_state(0) is now only called in libcurl by
curl_global_cleanup(). Previously it would get called by functions
curl_easy_cleanup(), curl_multi_cleanup and potentially each time a
connection was removed from a connection cache leading to premature
destruction of OpenSSL's thread local state hash.

Multi-threaded apps using OpenSSL enabled libcurl should still call
function ERR_remove_state(0) or ERR_remove_thread_state(NULL) at the
very end end of threads that do not call curl_global_cleanup().
2011-11-04 13:08:37 +01:00
Yang Tse
5b57c54416 tool_cb_wrt.c: disambiguate warning message 2011-11-03 23:26:38 +01:00
Yang Tse
7fe9a50ab5 tool_cfgable.c: pending check done 2011-11-03 23:21:01 +01:00
Yang Tse
6fa6567b92 url.c and file.c: fix OOM triggered segfault 2011-11-03 21:56:51 +01:00
Daniel Stenberg
93e57d0628 rename ftp_ssl: the struct field is used for many protocols
Now called 'use_ssl' instead, which better matches the current CURLOPT
name and since the option is used for all pingpong protocols (at least)
it makes sense to not use 'ftp' in the name.
2011-11-03 09:54:12 +01:00
Daniel Stenberg
a873b95c21 gtls_connect_step1: remove use of deprecated functions
Use gnutls_priority_set_direct() instead of gnutls_protocol_set_priority().

Remove the gnutls_certificate_type_set_priority() use since x509 is the
default certificate type anyway.

Reported by: Vincent Torri
2011-11-02 22:44:22 +01:00
Yang Tse
6bdeca967d url.c and transfer.c: nullify connection pointer when free()'ed 2011-11-02 22:34:41 +01:00
Yang Tse
3f5e267b9d FTP test server: NODATACONN commands follow-up
Make NODATACONN425 and NODATACONN421 return a 150 positive preliminary reply
before 425 or 421.

New NODATACONN150 returns 150 without further positive nor negative reply

Now NODATACONN doesn't reply anything at all.
2011-11-02 13:38:31 +01:00
Yang Tse
f7dfe2b87a multi.c: OOM handling fix 2011-11-01 14:38:21 +01:00
Yang Tse
af425efe83 FTP test server: NODATACONN commands follow-up
Make NODATACONN custom commands apply to both active and passive FTP,
and ensure 425 and 421 are not returned unless data channel usage is
attempted.
2011-11-01 14:11:36 +01:00
Yang Tse
9cfc0c73a7 tool_cb_see.h: fix compiler warning 2011-11-01 12:53:23 +01:00
Yang Tse
49e3b2e03a setup.h: fix compiler warning 2011-10-31 22:42:43 +01:00
Yang Tse
8bfc3a800a FTP test server: NODATACONN commands commit c761fcb0 follow-up
Adjustments that make NODATACONN custom commands fully usable.
2011-10-31 07:29:13 +01:00
Dave Reisner
b24c28e6c2 doc/curl.1: fix sentence with ending for -# option
Try to be a little more descriptive about the effect of this flag,
rather than parroting what was said in the paragraph just above.
2011-10-30 19:43:38 +01:00
Yang Tse
0b315c1cf1 FTP test server: fix server unresponsiveness
Some torture tests left FTP test server in an unresponsive state, resulting
in torture tests that actually completed following unexpected code paths.

Changes in this commit solely address this issue and some adjustments for
ftpserver.pl logging relative to data channel establishment and tear down.
Pending NODATACONN relative adjustments reserved for a further commit.
2011-10-30 17:12:20 +01:00
Yang Tse
e2928e1555 runtests.pl: running server checks - commit 4464583a follow-up
Ensure verification takes place with no server commands file.
Ignore verbose setting for running server precheck.
Tweak unresponsive server message, to allow detection by haxx.se scripts.
2011-10-30 16:45:14 +01:00
Yang Tse
f5bb370186 gtls.c: gnutls_transport_set_global_errno() deprecated in version 2.12.3 2011-10-29 14:58:50 +02:00
Yang Tse
bae4e3f035 runtests.pl: running server checks - commit 3676ec96 follow-up
Fix called sub when checking TFTP server, and adjust message.
2011-10-28 15:59:36 +02:00
Yang Tse
3676ec9680 runtests.pl: running server checks - commit 4464583a follow-up
Extended server checks to others in addition to pingpong when torture testing.
2011-10-28 00:05:16 +02:00
Yang Tse
8ccf7bf8d7 lib589.c: add CURLOPT_READDATA missing stuff 2011-10-27 22:00:23 +02:00
Yang Tse
c761fcb055 ftpserver.pl: three new custom FTP server commands to disable data channel
NODATACONN421: applies only to active FTP mode, instructs server to not
establish data connection back to client and reply with FTP 421.

NODATACONN425: applies only to active FTP mode, instructs server to not
establish data connection back to client and reply with FTP 425.

NODATACONN: applies to both active and passive FTP modes, instructs server
to not establish nor accept a data channel and fool client into believing
that the data channel connection is possible.

Some polishing probably required.
2011-10-27 21:59:00 +02:00
Yang Tse
ddeab48245 multi.c: OOM handling fix
Fix curl_multi_cleanup() segfault when using weird cleanup sequence.
2011-10-27 17:08:02 +02:00
Daniel Stenberg
b0d42da26b multi: start ftp state machine when switching to DO_MORE
This extends the fix from commit d7934b8bd4

When the multi state is changed within the multi_runsingle from DOING to
DO_MORE, we didn't immediately start the FTP state machine again. That
then left the FTP state in FTP_STOP. When curl_multi_fdset() was
subsequently called, the ftp_domore_getsock() function would return the
wrong fd info.

Reported by: Gokhan Sengun
2011-10-27 12:46:29 +02:00
Daniel Stenberg
120025b7f8 libcurl-multi.3: update the list of areas still blocking 2011-10-27 09:22:15 +02:00
Yang Tse
692f344118 test 589: active FTP upload using multi timeout and EPRT disabled server 2011-10-26 18:57:14 +02:00
Yang Tse
51e5a2bf3f multi tests: OOM handling fixes - commit 629d2e34 follow-up 2011-10-26 18:57:14 +02:00
Patrick Monnerat
8165e05f29 - Prepare the ILE/RPG binding and OS400 documentation for the upcoming release 2011-10-26 14:48:20 +02:00
Daniel Stenberg
4c88866737 RELEASE-NOTES: synced with 4464583a6e
5 more bug fixes, 4 additional contributors
2011-10-25 23:28:30 +02:00
Yang Tse
4464583a6e runtests.pl: running server checks
When running torture tests, verify before each test case that required
pingpong servers which are supposed to be alive are actually responsive.
If found not responsive then restart them.
2011-10-25 23:19:36 +02:00
Daniel Stenberg
22502c9550 dist: add test 587
I created test 587 in commit 840eff44f2 but forgot to add the file to
the tarball. Added now.
2011-10-24 23:09:59 +02:00
Daniel Stenberg
39c6d18d9c test 588: verify active FTP with multi interface without EPRT
This is using the verbatim 525 test code but it disables EPRT in the
server and this should work just as well anyway.
2011-10-24 23:08:16 +02:00
Daniel Stenberg
f4405d30e0 FTP server: allow EPRT by default
EPRT is now supported by default by the server. To disable it, use the
generic REPLY instruction in the <servercmd> tag. Test 116 now has it
disabled. All other existing active FTP port tests strip out the port
commands from the logs already so the change of the server isn't that
noticable.
2011-10-24 23:07:53 +02:00
Yang Tse
e8d8843a02 ftp.c: some OOM handling fixes 2011-10-24 20:45:13 +02:00
Yang Tse
134e87c53b ftpserver.pl: ensure integral number usage for passive mode string 2011-10-24 20:45:12 +02:00
Daniel Stenberg
515f11e79b large headers: have curl accept >16K headers
As commit 5850cc4808 clarifies, libcurl can deliver header lines that
are longer than CURL_MAX_WRITE_SIZE, only body data is limited to that
size. The curl tool has check (when built debug-enabled) that made the
wrong checks and this new test 1205 verifies that larger headers work.
2011-10-24 17:28:41 +02:00
Daniel Stenberg
5850cc4808 curl_easy_setopt.3: headers can be CURL_MAX_HTTP_HEADER bytes
Mention this maximum header size for the header callback cases
2011-10-24 16:43:53 +02:00
Daniel Stenberg
c295565569 Merge pull request #25 from trtom/master
make sure the static build uses the static build option!
2011-10-24 04:11:43 -07:00
Daniel Stenberg
e771344611 curl_easy_setopt.3: fix typo
shoot, Dan Fandrich already had this pointed out...
2011-10-24 00:13:47 +02:00
Steve Holme
a4471045bb curl_easy_setopt: Added pop3 to CURLOPT_URL.
Added pop3 username and password example as well as an explanation of
how path part of the URL is used under pop3.

Additionally have corrected a couple of typos.
2011-10-24 00:10:58 +02:00
Yang Tse
cc76bbe79b tool_operate.c: OOM handling fix
Move curl_easy_perform source code geneartion out of curl_easy_perform's loop
for proper OOM handling and source code geneartion.
2011-10-22 14:49:02 +02:00
Daniel Stenberg
d7934b8bd4 curl_multi_fdset: correct fdset with FTP PORT use
After a PORT has been issued, and the multi handle would switch to the
CURLM_STATE_DO_MORE state (which is unique for FTP), libcurl would
return the wrong fdset to wait for when curl_multi_fdset() is
called. The code would blindly assume that it was waiting for a connect
of the second connection, while that isn't true immediately after the
PORT command.

Also, the function multi.c:domore_getsock() was highly FTP-centric and
therefore ugly to keep in protocol-agnostic code. I solved this problem
by introducing a new function pointer in the Curl_handler struct called
domore_getsock() which is only called during the DOMORE state for
protocols that set that pointer.

The new ftp.c:ftp_domore_getsock() function now returns fdset info about
the control connection's command/response handling while such a state is
in use, and goes over to waiting for a writable second connection first
once the commands are done.

The original problem could be seen by running test 525 and checking the
time stamps in the FTP server log. I can verify that this fix at least
fixes this problem.

Bug: http://curl.haxx.se/mail/lib-2011-10/0250.html
Reported by: Gokhan Sengun
2011-10-21 23:36:54 +02:00
Dan Fandrich
d67b75c9f9 Added some missing test case XML tags and keywords 2011-10-21 13:33:40 -07:00
Yang Tse
95d23d1ceb file.c: OOM handling fix
file_disconnect() free's resources for multi API
2011-10-21 16:52:17 +02:00
Yang Tse
a4758c3276 multi.c: fix segfault 2011-10-21 16:52:16 +02:00
Yang Tse
9d0d1ada05 runtests.pl: fix printing of multivalued error codes 2011-10-21 16:52:15 +02:00
Yang Tse
629d2e3450 multi tests: OOM handling fixes
Additionally, improved error checking and logging.
2011-10-21 16:52:14 +02:00
Dan Fandrich
90fcad63cb Fixed compilation when HTTP or cookies are disabled 2011-10-20 17:54:18 -07:00
Daniel Stenberg
1399c3da0d KNOWN_BUGS: #74 fixed
Multiple auths in the same WWW-Authenticate header

Fixed in commit 7d81e3f7193b8c
2011-10-20 13:12:02 +02:00
Daniel Stenberg
ff0a295cdb Curl_http_input_auth: handle multiple auths in WWW-Authenticate
The fix is pretty much the one Nick Zitzmann provided, just edited to do
the right indent levels and with test case 1204 added to verify the fix.

Bug: http://curl.haxx.se/mail/lib-2011-10/0190.html
Reported by: Nick Zitzmann
2011-10-20 13:12:02 +02:00
Daniel Stenberg
4fa0166173 Curl_smtp_escape_eob: first byte is index 0...
Fix a bug with with commit 2621dd42a4 that happened due to my last
second pre-commit cleanup of the change without proper testing
afterwards!
2011-10-20 13:12:02 +02:00
Daniel Stenberg
adaa3f6e14 CURLM_CALL_MULTI_PERFORM: remove mention
This return code has not been used since 7.20.0 so we can stop
mentioning it for current libcurl.
2011-10-20 13:12:02 +02:00
Dan Fandrich
cf0f6729e7 Silenced a compiler warning about an unused variable 2011-10-19 21:18:52 -07:00
Tim Harder
8036da870c gtls: only call gnutls_transport_set_lowat with <gnutls-2.12.0
The default lowat level for gnutls-2.12* is set to zero to avoid
unnecessary system calls and the gnutls_transport_set_lowat function has
been totally removed in >=gnutls-3 which causes build failures.

Therefore, the function shouldn't be used except for versions that
require it, <gnutls-2.12.0.
2011-10-20 00:28:29 +02:00
Daniel Stenberg
2621dd42a4 Curl_smtp_escape_eob: fix EOB escaping
As the EOB string can come byte by byte over a series of writes we must
match byte-wise.

Bug: http://curl.haxx.se/mail/lib-2011-10/0172.html
2011-10-20 00:13:09 +02:00
Daniel Stenberg
2c8c46619b RELEASE-NOTES: synced with ecbb08cea3 2011-10-18 22:34:32 +02:00
Daniel Stenberg
ecbb08cea3 singleipconnect: unstick the ipv6-connection boolean
Previously the bit was set before the connection was found working so if
it would first fail to an ipv6 address and then connect fine to a IPv4
address the variable would still be TRUE.

Reported by: Thomas L. Shinnick
Bug: http://curl.haxx.se/bug/view.cgi?id=3421912
2011-10-17 23:12:58 +02:00
Kamil Dudka
491c5a497c nss: avoid a SIGSEGV with immature version of NSS
Bug: https://bugzilla.redhat.com/733685
2011-10-17 12:13:44 +02:00
Kamil Dudka
06e6755e87 nss: big cleanup in nss_load_cert() and cert_stuff() 2011-10-17 12:13:42 +02:00
Kamil Dudka
052a08ff59 nss: refactor fmt_nickname() -> dup_nickname()
Do not use artificial nicknames for certificates from files.
2011-10-17 12:11:40 +02:00
Kamil Dudka
f6980bbf24 nss: select client certificates by DER
... instead of nicknames, which are not unique.
2011-10-17 12:11:38 +02:00
Daniel Stenberg
d47d95ac3b --epsv: fix typo
Reported by: Thomas L. Shinnick
2011-10-17 00:04:43 +02:00
Daniel Stenberg
b229c8ca8b --show-error: position indepdenent
Previously we required that -S/--show-error was used _after_
-s/--silent. This was slightly confusing since we strive to make
arguments as position independent as possible.

Now, you can use them in any order and the result should still be the
same.

Bug: http://curl.haxx.se/bug/view.cgi?id=3424286
Reported by: Andreas Olsson
2011-10-16 23:39:59 +02:00
Daniel Stenberg
337252bdd4 curl_multi_fdset: clarify the max_fd == -1 case
Elaborate what max_fd == -1 means

Remove the reference to CURLM_CALL_MULTI_PERFORM as modern libcurl
versions don't ever return that.
2011-10-16 23:38:48 +02:00
Daniel Stenberg
840eff44f2 formdata: ack read callback abort
When doing a multipart formpost with a read callback, and that callback
returns CURL_READFUNC_ABORT, that return code must be properly
propagated back and handled accordingly. Previously it would be handled
as a zero byte read which would cause a hang!

Added test case 587 to verify. It uses the lib554.c source code with a
small ifdef.

Reported by: Anton Bychkov
Bug: http://curl.haxx.se/mail/lib-2011-10/0097.html
2011-10-16 01:09:56 +02:00
Daniel Stenberg
ff03ee2a3c TODO: have form functions use CURL handle argument 2011-10-16 01:06:48 +02:00
Dave Reisner
62bcf005f4 typecheck: allow NULL to unset CURLOPT_ERRORBUFFER
There might be situations where a user would want to unset this option.
Avoid forcing him/her to cast the NULL argument to (char *) in order to
get past the compile time typecheck.
2011-10-15 23:59:22 +02:00
Daniel Stenberg
1a416cd27a singleipconnect: don't clobber errno
Save the errno value immediately after a connect() failure so that it
won't get reset to something else before we read it.

Bug: http://curl.haxx.se/mail/lib-2011-10/0066.html
Reported by: Frank Van Uffelen and Fabian Hiernaux
2011-10-15 23:44:28 +02:00
Michal Marek
54ef47a5a0 docs: --xattr 2011-10-14 22:34:04 +02:00
Yang Tse
8af94de50a file.c: fix compiler warning 2011-10-14 18:23:16 +02:00
Yang Tse
1bab38780b url.c: fix endless loop upon transport connection timeout
Jerry Wu detected and provided detailed info about this issue.
2011-10-14 17:34:42 +02:00
Yang Tse
fd10c047df sws.c: HTTP and GOPHER test server-side connection closing adjustment
When, for a given test, server is instructed to close connection after
server reply we now wait a very small amount of time (50ms) before doing
so. This is done to allow client to, at least partially, read server
reply before getting an ECONNRESET.

The above is required to make test cases 1070, 1200, 1201 and 1202 pass
with Cygwin 1.5.X on W2K.

GOPHER test server closes connection after _every_ server-reply, as such,
at some point it could require a bigger time or using shutdown() before
a server-side initiated disconnection.
2011-10-14 17:33:05 +02:00
Yang Tse
ea12c72d12 curl_gethostname.c: fix signed/unsigned comparison and avoid a double copy
both introduced in 42be24af
2011-10-13 23:00:24 +02:00
Yang Tse
47e4537ac6 curl_ntlm_msgs.c: fix variable shadowing declaration introduced in 185ed340 2011-10-13 22:59:36 +02:00
Marcin Adamski
03adff1eba tftp.c: TFTP timeout and unexpected block adjustments
Set ACK timeout to 5 seconds.

If we are waiting for block X and receive block Y that is the expected one, we
should send ACK and increase X (which is already implemented). Otherwise drop
the packet and don't increase retry counter.
2011-10-13 19:45:36 +02:00
Yang Tse
34770b8ab0 multi.c: OOM handling fixes
Prevent modification of easy handle being added with curl_multi_add_handle()
unless this function actually suceeds.

Run Curl_posttransfer() to allow restoring of SIGPIPE handler when
Curl_connect() fails early in multi_runsingle().
2011-10-13 18:04:56 +02:00
Yang Tse
880cf0bedc url.c: make line shorter than 80 chars 2011-10-13 01:52:56 +02:00
Yang Tse
bff78cc18e OOM handling/cleanup slight adjustments 2011-10-12 21:32:10 +02:00
Yang Tse
584dc8b8af OOM handling/cleanup slight adjustments 2011-10-11 19:41:30 +02:00
Yang Tse
a84b8a3922 lib540.c: OOM handling fixes making test 540 pass torture testing 2011-10-10 12:27:17 +02:00
Dan Fandrich
acaf466401 RELEASE-NOTES: Fixed a couple of typos 2011-10-08 23:12:07 -07:00
Yang Tse
71c9453393 telnet.c: fix compiler warning 2011-10-08 01:27:03 +02:00
Yang Tse
17f48fe879 libcurl: some OOM handling fixes 2011-10-07 20:50:57 +02:00
Yang Tse
b82bd05354 multi.c: OOM handling fixes making torture tests 560 580 581 pass 2011-10-06 20:30:34 +02:00
Yang Tse
1958fe5745 test harness: non-stunnel https server integration overhaul 2011-10-06 20:26:42 +02:00
Yang Tse
f7bfdbabf2 curl tool: reviewed code moved to tool_*.[ch] files 2011-10-06 17:39:00 +02:00
Yang Tse
7afccf7a1e buildconf: warn about autoconf 2.67 and 2.68 generating bad/unusable scripts 2011-10-06 12:57:12 +02:00
Yang Tse
4a57bf6d10 curl tool: fix compiler warning 2011-10-05 22:27:29 +02:00
Yang Tse
7296b2aa25 curl tool: OOM handling fixes 2011-10-05 22:01:42 +02:00
Yang Tse
6c849321d7 curl tool: reviewed code moved to tool_*.[ch] files 2011-10-05 20:16:16 +02:00
Yang Tse
0f19e0145a curl tool: OOM handling fixes 2011-10-05 19:33:46 +02:00
Yang Tse
ec73fd89ed curl tool: OOM handling fixes 2011-10-05 16:41:04 +02:00
Yang Tse
5bf0d74120 curl tool: OOM handling fixes 2011-10-05 15:06:26 +02:00
Yang Tse
fd87d9d2b9 curl tool: header inclusion adjustment 2011-10-05 12:40:30 +02:00
Yang Tse
0572ad6d01 curl tool: symbol check adjustment 2011-10-05 02:58:18 +02:00
Yang Tse
aa7d5b946a curl tool: header inclusion adjustment 2011-10-05 01:19:58 +02:00
Yang Tse
49b79b7631 curl tool: code moved to tool_*.[ch] files 2011-10-05 00:03:58 +02:00
Daniel Stenberg
ca2c326361 curl_share_cleanup: avoid compiler warning
Move the variable declaration to within the #ifdef
2011-10-04 16:34:45 +02:00
Daniel Stenberg
5c809178c2 struct Curl_share: provide sslsession unconditionally
It makes much nicer and less convuluted code everywhere if this struct
member is always present even when libcurl is built without SSL support.

This reverts parts of commit 15e3e45170
2011-10-04 16:33:07 +02:00
Daniel Stenberg
fa77f54a03 ftp: improved the failed PORT host name resolved error message 2011-10-04 16:24:50 +02:00
Daniel Stenberg
bc007d8ef5 codepolicing 2011-10-03 23:28:17 +02:00
Daniel Stenberg
d0dbd1e98e sspi build fix
define away Curl_ntlm_sspi_cleanup() when no windows SSPI build
2011-10-03 23:28:17 +02:00
Steve Holme
4d327d20c6 smtp: Added support for NTLM authentication
Modified smtp_endofresp() to detect NTLM from the server specified list
of supported authentication mechanisms.

Modified smtp_authenticate() to start the sending of the NTLM data.

Added smtp_auth_ntlm_type1_message() which creates a NTLM type-1
message. This function is used by authenticate() to start the sending
of data and by smtp_state_auth_ntlm_resp() when the AUTH command
doesn't contain the type-1 message as part of the initial response.
This lack of initial response can happen if an OOM error occurs or the
type-1 message is longer than 504 characters. As the main AUTH command
is limited to 512 character the data has to be transmitted in two
parts; one containing the AUTH NTLM and the second containing the
type-1 message.

Added smtp_state_auth_ntlm_type2msg_resp() which handles the incoming
type-2 message and sends an outgoing type-3 message. This type-2
message is sent by the server in response to our type-1 message.

Modified smtp_state_auth_resp() to handle the response to: the AUTH
NTLM without the initial response and the type-2 response.

Modified smtp_disconnect() to cleanup the NTLM SSPI stack.
2011-10-03 23:28:17 +02:00
Steve Holme
185ed3409a Curl_ntlm_create_typeX_message: Added the outlen parameter
Added the output message length as a parameter to both
Curl_ntlm_create_type1_message() and Curl_ntlm_create_type3_message()
for use by future functions that require it.

Updated curl_ntlm.c to cater for the extra parameter on these two
functions.
2011-10-03 23:28:17 +02:00
Steve Holme
d54bcebad4 smtp: General tidy up ready for adding NTLM support
Changed the name of variable l, in several functions, which represents
the length of strings being sent to the server, to len which is more
meaningful and consistent with other code in smtp.c and elsewhere.

Reworked smtp_authenticate() to be simpler and easier to follow.
Variables and now initialised in their definitions and if no username
and password are specified the function sets the state to SMTP_STOP and
returns immediately, rather than being part of a huge if statement.
2011-10-03 23:28:17 +02:00
Yang Tse
0435800f65 curl tool: reviewed code moved to tool_*.[ch] files 2011-10-03 23:00:47 +02:00
Steve Holme
56ed07f7df smtp_mail: fixed another memory leak
... introduced in 7f304ab84f
2011-10-03 22:55:25 +02:00
Dominique Leuenberger
381459fa65 m4: Use x in order to avoid variable 'x' set but not used [-Werror=unused-but-set-variable]
This error could be caused by configure scripts being run with -Werror
-Wall, which would lead to libcurl being detected as unusable.
2011-10-03 22:46:28 +02:00
Daniel Stenberg
15e3e45170 share: don't use SSL unless enabled
Don't even declare the struct members for disabled features

Introducing the CURLSHE_NOT_BUILT_IN return code for the share interface
when trying to set a sharing option that has been disabled (or not
enabled) in the library.
2011-10-03 22:35:04 +02:00
Daniel Stenberg
9dd85bced5 multi: progress function abort must close connection
When the progress function returns to cancel the request, we must mark
the connection to get closed and it must do to the DONE state.

do_init() must be called as early as possible so that state variables
for new connections are reset early. We could otherwise see that the old
values were still there when a connection was to be disconnected very
early and it would make it behave wrongly.

Bug: http://curl.haxx.se/mail/lib-2011-10/0006.html
Reported by: Vladimir Grishchenko
2011-10-02 19:28:39 +02:00
Daniel Stenberg
5d45285cf3 tutorial: clarify the handle sharing when treaded
Previously there was wording that made people uncertain of the exact
rules.

Feedback by: Julien Royer and Georg Lippitsch
URL: http://curl.haxx.se/mail/lib-2011-09/0357.html
2011-09-30 23:42:47 +02:00
Daniel Stenberg
3d19e1eedf multi_runsingle: change state on callback abort
Reported by: Marcin Adamski
Bug: http://curl.haxx.se/mail/lib-2011-09/0329.html
2011-09-30 22:59:50 +02:00
Yang Tse
7be872c389 curl tool: fix some more OOM handling 2011-09-30 21:10:58 +02:00
Yang Tse
0c903ea189 Fix SSL disabled builds broken with 'SSL session sharing' commit 5793bc37 2011-09-30 21:09:59 +02:00
Daniel Stenberg
affed6725e smtp_mail: fix memory leak
... introduced in 7f304ab84f
2011-09-29 23:45:36 +02:00
Steve Holme
7f304ab84f smtp_mail: Added support to MAIL FROM for the optional SIZE parameter
The size of the email can now be set via CURLOPT_INFILESIZE. This
allows the email to be rejected by the server, if supported, and the
maximum size has been configured on the server.
2011-09-29 23:15:46 +02:00
Daniel Stenberg
e709cc8627 curlverh.h: next release will be 7.23.0 2011-09-29 08:52:47 +02:00
Daniel Stenberg
db060304de RELEASE-NOTES: synced with 5898a6a09b
Bumped next release version to become 7.23.0 for the changes
2011-09-29 08:51:52 +02:00
Dan Fandrich
5898a6a09b curl_easy_setopt: Added scp and sftp to the URL section 2011-09-28 21:39:48 -07:00
Steve Holme
57fffa728b curl_easy_setopt: A brief tidy up
Slight rewording of the CURLOPT_URL SMTP sub-section.

Corrected the incorrect use of hyphens on the three uses of
"zero-terminated" with "zero terminated" to match the rest of the
document.

Corrected the use of an out of place hyphen in CURLOPT_NOPROXY section.
2011-09-28 23:31:37 +02:00
Daniel Stenberg
421a460278 configure openssl version check: handle lack of L suffix
It seems some versions of the OpenSSL version defines don't come with L
appended to the number, so let's deal with that nicely.
2011-09-28 23:09:46 +02:00
Alejandro Alvarez
5793bc370c SSL session sharing support added
With locking, plus test, plus documentation
2011-09-28 23:06:34 +02:00
Yang Tse
ff5ba6e43d curl tool: adjust header callback single call write limit warning
Maximum amount of data a header callback is supposed to get in
a single call from libcurl is limited by the lowest value of
CURL_MAX_WRITE_SIZE and CURL_MAX_HTTP_HEADER.
2011-09-28 19:04:38 +02:00
Daniel Stenberg
9f2f8d5122 multi docs: extended the multi_socket API description 2011-09-28 13:53:59 +02:00
Daniel Stenberg
bd158607ca tests/README: extended and reformatted 2011-09-27 22:14:24 +02:00
Albert Chin
a2d4a98ddd configure - m4: make CURL_CHECK_DEF ignore leading whitespace on symbol def
When using Sun C compiler the preprocessor somehow inserts an extra space
in front of replaced symbol, breaking CURL_CHECK_DEF macro. To workaround
this, macro CURL_CHECK_DEF now ignores all leading whitespace in front of
symbol substitution result.
2011-09-27 22:01:58 +02:00
Guenter Knauf
b4fccc1d8e Added SPNEGO to NetWare build. 2011-09-27 16:02:07 +02:00
Yang Tse
e2be8ceed9 curl tool: fix a compiler warning 2011-09-26 21:19:41 +02:00
Yang Tse
d439830621 curl tool: fix some OOM handling - f4853db5 follow-up 2011-09-26 13:44:24 +02:00
Yang Tse
f4853db5e6 curl tool: fix some OOM handling 2011-09-26 13:07:34 +02:00
Yang Tse
d9f686db88 remove short-lived CURL_WRITEFUNC_OUT_OF_MEMORY 2011-09-26 13:05:42 +02:00
Guenter Knauf
a1087db5c6 Added unsigned char* to _curl_is_debug_cb. 2011-09-26 12:42:15 +02:00
Steve Holme
400055bfaa smtp_connect: use defined buffer length for hostname 2011-09-26 00:01:09 +02:00
Steve Holme
5801ddb85c Curl_ntlm_create_type3_message: Tidied up the use of Curl_gethostname.
Removed the code that striped off the domain name when Curl_gethostname
returned the fully qualified domain name as the function has been
updated to return the un-qualified host name.

Replaced the use of HOSTNAME_MAX as the size of the buffer in the call
to Curl_gethostname with sizeof(host) as this is safer should the buffer
size ever be changed.
2011-09-25 23:59:53 +02:00
Steve Holme
38b5744266 HOSTNAME_MAX: Moved to curl_gethostname.h
Moved HOSTNAME_MAX #define into curl_gethostname.h rather than being
locally defined in curl_gethostname.c, curl_ntlm_msgs.c and smtp.c.
2011-09-25 23:58:47 +02:00
Daniel Stenberg
bc28a35dbc RELEASE-NOTES: synced with d2a47021c0 2011-09-25 23:20:46 +02:00
Yang Tse
d2a47021c0 Q&D fix header inclusion order 2011-09-25 19:08:12 +02:00
Yang Tse
119f43360b allow write callbacks to indicate OOM to libcurl
Allow (*curl_write_callback) write callbacks to return
CURL_WRITEFUNC_OUT_OF_MEMORY to properly indicate libcurl of OOM conditions
inside the callback itself.
2011-09-25 19:05:46 +02:00
Guenter Knauf
e276802ff8 Changed some main makefile targets. 2011-09-25 17:43:50 +02:00
Daniel Stenberg
2d6796aac5 curl_multi_fdset: avoid FD_SET out of bounds
If a socket is larger than FD_SETSIZE, avoid using FD_SET() on the
platforms where this is possible.

Bug: http://curl.haxx.se/bug/view.cgi?id=3413274
Reported by: Tim Starling
2011-09-25 17:34:12 +02:00
Guenter Knauf
bb94b92894 Fixed MinGW examples makefile. 2011-09-25 16:31:31 +02:00
Guenter Knauf
230459dd00 NetWare makefile tweaks to select different builds. 2011-09-25 16:29:08 +02:00
Daniel Stenberg
745014b726 POST: always set postfieldsize
When we use binary posts and regular ones intermixed on a single command
line, we cannot do strlen() etc on the data to figure out the length
(when inserting '&' and more). We must therefore keep track of the post
data length. Then we also end up setting the libcurl option with the
known size, so that we don't risk that libcurl will do strlen() on the
data.

This has the minor side-effect that --libcurl source codes now always
will use CURLOPT_POSTFIELDSIZE but I don't consider that terribly
damaging.

Bug: http://curl.haxx.se/bug/view.cgi?id=3413181
Reported by: Taneli Vhkangas
2011-09-25 00:02:58 +02:00
Yang Tse
b3ea4881a8 curl tool: fix a compiler warning 2011-09-24 18:33:59 +02:00
Yang Tse
c6702c7d3f curl tool: reviewed code moved to tool_*.[ch] files 2011-09-24 17:40:46 +02:00
Guenter Knauf
8bab6700d9 Added header to be included by dist script.
Probably the wrong place, but I dont know better.
2011-09-24 15:06:21 +02:00
Yang Tse
081e289315 curl tool: fix some OOM handling issues 2011-09-24 05:33:41 +02:00
Daniel Stenberg
5f0764870f http header: allow Content-Length to be replaced
In some cases Content-Length: couldn't be replaced by an application

Also, indented some code properly
2011-09-24 00:05:58 +02:00
Guenter Knauf
87a45c7998 MinGW64 has this prototype already. 2011-09-23 03:56:34 +02:00
Guenter Knauf
dafa2fc944 Fixed scanf format for WORD = unsigned short. 2011-09-23 03:21:50 +02:00
Guenter Knauf
ef3f1f3146 Added Win32-only samples. 2011-09-23 03:00:32 +02:00
Guenter Knauf
ba52e0a93b Added a workaround for printing size_t. 2011-09-23 02:16:20 +02:00
Daniel Stenberg
40c27e299f Curl_pgrsStartNow: keep HEADERS_OUT set
To avoid that the progress meter headers get output between each
transfer, make sure the bits gets kept when (re-)inited.

Reported by: Christopher Stone
2011-09-22 22:41:06 +02:00
Yang Tse
fa775b56de curl tool: fix some OOM handling issues 2011-09-22 21:21:21 +02:00
Yang Tse
fb3845a438 curl tool: reviewed code moved to tool_*.[ch] files
my_setopt and my_setopt_str no longer ignores curl_easy_setopt result.

Fixed some OOM handling issues.
2011-09-22 21:21:20 +02:00
Guenter Knauf
3c3aa09c65 Added NetWare examples makefile. 2011-09-22 14:35:49 +02:00
Yang Tse
01c172f5e8 NTLM_WB: fix disabling of NTLM_WB when NTLM is disabled 2011-09-22 00:24:02 +02:00
Daniel Stenberg
e9cf4cb791 test 814: smtp without --mail-from
Verifies the fix from commit 322f3d5af7
2011-09-21 22:32:27 +02:00
Gisle Vanem
322f3d5af7 smtp: without a MAIL_FROM, send blank MAIL FROM
I think curl should ignore this case and smtp.c should test for this.
Since RFC-2821 seems to allow a "null reverse-path". Ref.  "MAIL
FROM:<>" in section 3.7, page 25.
2011-09-21 22:24:45 +02:00
Dave Reisner
c1057fc9aa lib/http: add missing whitespace in verbose output
Example:
* upload completely sent off: 35out of 35 bytes

Should be:
* upload completely sent off: 35 out of 35 bytes
2011-09-21 22:19:53 +02:00
Guenter Knauf
62b0fdca9e Another MinGW example makefile tweak. 2011-09-21 18:21:05 +02:00
Guenter Knauf
3317160c19 Fixed sample to compile for Windows platform. 2011-09-21 18:09:34 +02:00
Yang Tse
28526ed6e0 curl tool: make my_setopt ignore curl_easy_setopt result again.
Related code not ready yet for this kind of checks.
2011-09-21 04:30:08 +02:00
Guenter Knauf
e4172d934d Changed suffix rules to pattern rules.
Suffix rules cannot have any prerequisites of their own.
2011-09-21 03:25:19 +02:00
Guenter Knauf
977825a68c Added dependency so that curlbuild.h is created. 2011-09-21 02:13:18 +02:00
Guenter Knauf
a6b69b64ad Some more MinGW build tweaks.
Added envvars to specify OpenSSL include, libpath and lib.
Added rule to create curlbuild.h from curlbuild.h.dist.
2011-09-21 02:06:05 +02:00
Yang Tse
9ecf53e154 curl tool: reviewed code moved to tool_*.[ch] files
my_setopt and my_setopt_str no longer ignores curl_easy_setopt result.

Fixed some OOM handling issues.
2011-09-21 01:54:14 +02:00
Yang Tse
84221006c9 curl tool: reviewed code moved to tool_*.[ch] files
Overhauled FindWin32CACert()
2011-09-20 15:59:19 +02:00
Guenter Knauf
a6c168b893 A bunch of MinGW build tweaks.
All paths to dependencies now quoted; synced examples makefile.
2011-09-20 15:05:28 +02:00
Guenter Knauf
dee7a08f64 Changed Windows 64bit OS define to x86_64.
Also added check for __x86_64__ define since MinGW64 seems to define
the _M_X64 macro through a header not available for config-win32.h.
2011-09-20 12:32:04 +02:00
Guenter Knauf
cd3cf55b47 Also skip certs masked as CKT_NSS_TRUST_UNKNOWN.
Fix posted by Tomas Hoger <thoger redhat com>.
2011-09-20 12:05:31 +02:00
Guenter Knauf
98a61d8e2e Added _WIN32_WINNT define for IPv6 builds. 2011-09-20 11:59:49 +02:00
Daniel Stenberg
81b41095ef Curl_follow: handle redirects to "//hostname/path" 2011-09-20 11:16:40 +02:00
Yang Tse
49c35a7f9f curl tool: truly fix compiler warning 2011-09-19 20:27:25 +02:00
Yang Tse
57119495da curl tool: fix compiler warning 2011-09-19 19:45:58 +02:00
Yang Tse
fdecb56cbf curl tool: reviewed code moved to tool_*.[ch] files 2011-09-19 18:18:17 +02:00
Daniel Stenberg
00532341b5 CURLOPT_URL docs: no need to mention function names 2011-09-18 23:42:29 +02:00
Steve Holme
dae0b7d1aa CURLOPT_URL: Expanded URL description
Expanded the section about CURLOPT_URL to include the format of the URL
and detailed information and examples relating to specific protocols.
2011-09-18 23:38:08 +02:00
Steve Holme
42be24af89 Curl_gethostname: return un-qualified machine name
Fixed Curl_gethostname() so that it always returns the un-qualified
machine name rather than being dependent on the socket provider.

Note: The return of getenv("CURL_GETHOSTNAME") is also parsed in case
the developer / test harness provided a fully qualified domain name as
it's value as well.
2011-09-18 13:24:58 +02:00
Yang Tse
260b0f4d0c curl tool: create tool_myfunc.[ch] which later on will hold my_* functions
Additionally function my_useragent() now provides default User-Agent string
2011-09-18 01:59:25 +02:00
Yang Tse
f50d4647d0 curl tool: reorder free_config_fields() field handling
Reorder handling of fields to match same order as the one given by current
definition order of 'Configurable' struct fields. Fields currently not handled
marked for further inspection.
2011-09-18 01:59:21 +02:00
Guenter Knauf
805b4740c7 Fixed MinGW WinIDN lib dependency. 2011-09-17 17:59:35 +02:00
Yang Tse
a75888f1d3 tool_convert.c: fix no newline at end of file 2011-09-17 03:28:57 +02:00
Yang Tse
b4b642eb45 curl tool: add new files to Symbian's .mmp project file 2011-09-16 21:55:13 +02:00
Yang Tse
c0159d0edc curl tool: move 'Configurable' and free_config_fields() to tool_cfgable.[ch]
Reviewing fields being free'd in free_config_fields() still pending
2011-09-16 21:44:45 +02:00
Yang Tse
93579cc363 src/setup.h: add conditional include of assert.h 2011-09-16 21:12:32 +02:00
Yang Tse
4322d512ea curl tool: move so called 'multi_files' stuff into tool_mfiles.[ch]
Additionally some code reorganization and direct OOM handling fixes,
just another step towards fixing curl tool issues uncovered 2011-09-15
2011-09-16 19:46:01 +02:00
Yang Tse
e4819ae1ef curl tool: move convert_* functions into tool_convert.[ch]
Additionally fix data type of result vars for iconv() calls
2011-09-16 15:31:29 +02:00
Yang Tse
43c59765e1 main.c: convert GetStr() into a macro to ease leak debugging 2011-09-16 00:57:54 +02:00
Yang Tse
e533f59025 main.c: de-obfuscate a couple for-loop exit conditions 2011-09-16 00:36:21 +02:00
Yang Tse
e6697ef59c curl tool: fix a bunch of double free's uncovered 2011-09-15
Re-enabling MemoryTracking capability on 'src' subdirectory files and torture
tests have uncovered many issues which were going unnoticed in curl tool. So
here we go fixing some of them. Others still remain and should be addressed
ASAP, given that curl tool is used in our test harness also for test server
start verification purposes. There are even non-socket file descriptor leaks.
2011-09-15 20:03:30 +02:00
Yang Tse
ff9d858722 Make Curl_safefree() macro assign NULL to given pointer when free'd 2011-09-15 17:35:23 +02:00
Yang Tse
f7583b2dea curl MSVC project files: adjust resource compiler include path 2011-09-15 11:40:54 +02:00
Yang Tse
6b33873c57 src/Makefile.vc6: adjust resource compiler include path 2011-09-14 20:31:23 +02:00
Yang Tse
90080da5fe curl tool: re-enable MemoryTracking capability on 'src' subdirectory files.
Use same preprocessor logic for curl tool MemoryTracking activation in source
files located in 'src' subdirectory as the one used for libcurl sources.
2011-09-14 11:30:22 +02:00
Yang Tse
0216e517d0 ftp.c: add a couple of failure messages 2011-09-14 11:30:22 +02:00
warp kawada
aff70e2e95 Curl_add_custom_headers: support headers with no data
A custom HTTP header ending in a semicolon instead of a colon
will be treated as a header to be added without any data
portion.
2011-09-13 16:17:21 -07:00
Daniel Stenberg
6790a543d4 progressfunc: a simple CURLOPT_PROGRESSFUNCTION example 2011-09-13 22:48:55 +02:00
Daniel Stenberg
2411adb40b 7.22.1: start working 2011-09-13 20:04:03 +02:00
Daniel Stenberg
d52cd3bd17 THANKS: 16 new contributors from 7.22.0 2011-09-13 20:03:17 +02:00
Daniel Stenberg
64c613c27a RELEASE-NOTES: ready for 7.22.0 2011-09-13 18:53:00 +02:00
Daniel Stenberg
73b18a9d24 codestyle: minor whitespace fix 2011-09-13 18:46:09 +02:00
Jeff Pohlmeyer
1bac153ea3 polarssl: build with PolarSSL-1.0.0
With this fix, it should work for PolarSSL-1.0.0 (and SVN-1091 trunk)
and retain compatibility with earlier versions. (Tested with 0.14.1)

PolarSSL still doesn't play nicely with curl's CA bundle (we discussed
this before) but I was at least able to retrieve the
https://www.gmail.com/ login page using a modified ca-certificates.crt
file with all 3 versions of PolarSSL.
2011-09-13 18:44:41 +02:00
Daniel Stenberg
432044b774 BUGS: spellfixed, slightly reformatted for web looks
Reported by: Jeff Pohlmeyer
2011-09-13 13:05:31 +02:00
Dan Fandrich
9dfd7a3d13 Document NTLM winbind options (and caveats) 2011-09-12 14:45:37 -07:00
Daniel Stenberg
deb3321092 BUGS: renumbered to look better in the web version 2011-09-12 23:02:59 +02:00
Daniel Stenberg
68253ca52e BUGS: revamped bug report documentation 2011-09-12 22:55:40 +02:00
Yang Tse
50c3c20416 Mention that BSD-style lwIP TCP/IP stack support on Windows is experimental. 2011-09-12 16:01:07 +02:00
Yang Tse
4e9a1c5bba ftp.c: fix socket leak torture tests detected 2011-08-30
Also fix inappropriate error handling when sending ftp EPRT or PORT commands.
2011-09-12 15:16:07 +02:00
Daniel Stenberg
587ed3234b TODO: remove 4 entries, add one new
Zero-copy and "Avoid having to remove/readd handles" are not really
features we think are worthwhile to add. Removed.

SRP features have been added already, removed.

11.9 IPv6 addresses with globbing added
2011-09-11 19:26:17 +02:00
Daniel Stenberg
94d64f8d4c spell-checked comments 2011-09-11 19:26:17 +02:00
Daniel Stenberg
0d3584c482 TODO-RELEASE: postpone the remainders
There's three pending bug fixes but there's no time left so let's
try to get them fixed for next release...
2011-09-11 19:26:17 +02:00
Guenter Knauf
2a9fec16cc Updated makefiles to latest libssh2. 2011-09-11 16:50:30 +02:00
Yang Tse
777f9aea13 urlglob.c: fix OOM handling 2011-09-10 18:46:05 +02:00
Yang Tse
72c14bd6f0 ftp.c: fix ftp active connects which got broken with commit fdf157abdf 2011-09-10 05:05:27 +02:00
Yang Tse
0413e24891 runtests.pl: replace TAB with spaces 2011-09-10 01:23:21 +02:00
Yang Tse
be8e68494c test harness: revert needless commit 0a5bbb2ac1
https, ftps and ssh servers allowed start up time back to previous values
2011-09-10 01:14:52 +02:00
Yang Tse
a7d8894291 ssh.c: revert needless commit 7b7c45879e 2011-09-10 00:52:13 +02:00
Daniel Stenberg
08a5a9b68d RELEASE-NOTES: synced with 303c90074d
Five more bugfixes, one more contributor
2011-09-09 15:38:30 +02:00
Daniel Stenberg
303c90074d tcpnodelay: rename variable
Renamed the variable from 'proto' to 'level' simply because it is not
protocol you set but level and that is the name of the argument used in
man pages and the POSIX documentation of the setsockopt function.
2011-09-09 15:31:11 +02:00
Guenter Knauf
443ab77e1f Avoid ftruncate() static define with MinGW64. 2011-09-08 11:17:16 +02:00
Yang Tse
7b7c45879e libssh2: use calloc as alloc function for libssh2 versions older than 1.3
This workarounds old libssh2 versions not properly initializing
some ssh session variables, which would trigger memory debuggers
warnings on memory being used without having been initialized.
2011-09-08 11:08:00 +02:00
Adriano Meirelles
81ead2c4e7 Curl_speedcheck: don't mistakenly clear Curl_expire()
The current version of speedcheck.c may disable timeout by setting zero
to Curl_expire. Which is fine using the curl_multi_perform, because it
recheck all timeout internals, but when using custom event poller (like
hiperfifo.c) it may keep stalle connection forever.
2011-09-08 08:39:53 +02:00
Yang Tse
28d09cb0f5 lib582.c: fix segfault triggered when torture testing test case 582 2011-09-08 01:22:47 +02:00
Daniel Stenberg
2147492050 ftp_state_use_port: minor code indent fix 2011-09-07 22:46:06 +02:00
Daniel Stenberg
58a7c51362 checksrc: detect "}else" uses as well 2011-09-07 22:45:43 +02:00
Daniel Stenberg
450975b0c3 getinmemory.c: use better argument names for write callback 2011-09-07 22:43:28 +02:00
Yang Tse
5658aa9574 ssh.c: fix memory leaks triggered upon OOM or other failures 2011-09-07 01:26:43 +02:00
Yang Tse
6539047694 test case 583: ensure that test failures don't go unnoticed - follow-up 2011-09-06 19:59:42 +02:00
Yang Tse
774ad4e31d test suite: libtest header inclusion cleanup - follow-up
Adjust tests/libtest/Makefile.inc and remove a couple of unused headers from
tests/libtest/lib583.c
2011-09-06 18:11:11 +02:00
Yang Tse
f764da8afb test case 583: ensure that test failures don't go unnoticed 2011-09-06 17:56:39 +02:00
Yang Tse
c8ba8740b9 test suite: libtest header inclusion cleanup
Added missing memoryTracking to test cases 560 and 583. If this triggers
leak detection on these, it only means that previously it was going unnoticed.
2011-09-06 17:47:54 +02:00
Yang Tse
46df51a391 fix bool variables checking and assignment 2011-09-06 01:57:21 +02:00
Yang Tse
e9e894905c pingpong.c: avoid a memmove call in function Curl_pp_vsendf 2011-09-05 23:45:04 +02:00
Yang Tse
a50210710a fix bool variables checking and assignment 2011-09-05 20:46:09 +02:00
Yang Tse
eb44ac0138 test suite: use test case specific netrc file names 2011-09-05 12:39:50 +02:00
Guenter Knauf
d52f3eb598 Fixed final message output. 2011-09-04 22:05:32 +02:00
Daniel Stenberg
8e154225b5 TODO-RELEASE: deleteing five issues due to no response
No feedback and no updates, removing these issues
2011-09-04 19:42:11 +02:00
Yang Tse
196e0d699f setup_once.h cleanup and sync 2011-09-04 17:10:51 +02:00
Guenter Knauf
809cde5416 Fix to skip untrusted certs. 2011-09-04 17:05:49 +02:00
Guenter Knauf
476f194d7f Added SPNEGO to MinGW makefiles. 2011-09-04 10:03:08 +02:00
Yang Tse
bdc311cf98 NTLM WB: fix file descriptor leak upon OOM condition 2011-09-04 01:56:30 +02:00
Yang Tse
a405a8976d revert changes not intended to be pushed with commit 6b75d2c2 2011-09-03 18:26:21 +02:00
Yang Tse
6b75d2c2df fix a bunch of MSVC compiler warnings 2011-09-03 16:07:09 +02:00
Guenter Knauf
2be65bb0c5 Updated dependecies versions. 2011-09-03 14:01:09 +02:00
Guenter Knauf
f02325ea65 Some MinGW makefile tweaks for MinGW64. 2011-09-03 13:55:16 +02:00
Guenter Knauf
b98594c8bf Changed MinGW to use own winidn prototypes. 2011-09-03 13:39:22 +02:00
Dan Fandrich
ded3638d97 Fix NTLM winbind support to pass the torture tests
Calling sclose() both in the child and the parent fools the
socket leak detector into thinking it's been closed twice.
Calling close() in the child instead overcomes this problem. It's
not as portable as the sclose() macro, but this code is highly
POSIX-specific, anyway.
2011-09-02 13:22:20 -07:00
Yang Tse
9194e17003 MemoryTracking: fix logging of free() calls done where Curl_safefree is called
Just internal stuff...

Curl_safefree is now a macro defined in memdebug.h instead of a function
prototyped in url.h and implemented in url.c, so inclusion of url.h is no
longer required in order to simply use Curl_safefree.

Provide definition of macro WHILE_FALSE in setup_once.h in order to allow
other macros such as DEBUGF and DEBUGASSERT, and code using it, to compile
without 'conditional expression is constant' warnings.

The WHILE_FALSE stuff fixes 150+ MSVC compiler warnings.
2011-09-02 19:40:53 +02:00
Yang Tse
749dbfbc87 transfer.c: fix parentheses/braces placement for vi/emacs delimiter matching 2011-09-02 17:41:39 +02:00
Yang Tse
6b59bc1805 transfer.c: fix loadhostpairs() OOM handling 2011-09-02 00:06:19 +02:00
Yang Tse
0a5bbb2ac1 test harness: https, ftps and ssh servers allowed start up time increased 33% 2011-09-01 22:21:57 +02:00
Yang Tse
f2285a6d39 hostip.c: return immediately from Curl_resolv_timeout() upon expired timeout.
Ensure existing logic in Curl_resolv_timeout() is not subverted upon getting a
negative timeout from resolve_server(). The timeout in resolve_server() could
be checked to avoid calling Curl_resolv_timeout() with an expired timeout, but
fixing this in this way allows existing logic in resolve_server() to be kept
unchanged.
2011-09-01 17:09:46 +02:00
Yang Tse
fdf157abdf ftp.c: fix some leaks torture tests detected 2011-08-30 - follow-up
follow-up for commit d20408e8
2011-09-01 15:38:30 +02:00
Yang Tse
437848d754 test harness: fix detection of test harness client knownhosts file
Regenerate curl's tests client knownhosts file also when, somehow,
this file is empty.
2011-08-31 19:59:26 +02:00
Yang Tse
38fff918f9 test harness: fix detection of test harness host and client key files
Regenerate curl's tests host and client key files also when, somehow,
any of these files are empty.
2011-08-31 18:16:14 +02:00
Yang Tse
5ea65fbc79 ssh.c: fix realloc() OOM handling 2011-08-31 18:15:29 +02:00
Yang Tse
0b018a0a05 ftp.c: fix some leaks torture tests detected 2011-08-30 - follow-up
follow-up for commit c06de200
2011-08-31 18:14:38 +02:00
Yang Tse
d20408e816 fix some leaks torture tests detected 2011-08-30 2011-08-31 03:50:07 +02:00
Yang Tse
c06de20025 fix some leaks torture tests detected 2011-08-30 2011-08-31 01:58:06 +02:00
Daniel Stenberg
e495f82f86 RELEASE-NOTES: synced with 3445fa2e3f 2011-08-29 15:37:06 +02:00
Kamil Dudka
3445fa2e3f tests: break busy loops in tests 502, 555, and 573 2011-08-29 15:14:39 +02:00
Yang Tse
5a45dc4a29 pingpong.c: fix Curl_pp_vsendf() arbitrary restrictions on command length
This removes command length restrictions on calling functions.
2011-08-29 14:27:06 +02:00
Yang Tse
78199b6030 NTLM: header inclusion cleanup follow-up 2011-08-28 11:29:09 +02:00
Yang Tse
05ef245170 NTLM: header inclusion cleanup 2011-08-28 07:15:46 +02:00
Yang Tse
662c1d87f3 NTLM: END of refactoring/splitting/moving
First:

File curl_ntlm.h renamed curl_ntlm_msgs.h
File curl_ntlm.c renamed curl_ntlm_msgs.c

Afterwards:

File http_ntlm.c renamed curl_ntlm.c
File http_ntlm.h renamed curl_ntlm.h
2011-08-28 02:00:02 +02:00
Yang Tse
135f694058 NTLM: move NTLM core specifics into curl_ntlm_core.[ch] 2011-08-28 01:19:08 +02:00
Yang Tse
260ee6b7bf NTLM_WB: move NTLM_WB specifics into curl_ntlm_wb.[ch] 2011-08-27 19:16:10 +02:00
Yang Tse
b976d108f1 NTLM_WB: final congruency naming adjustments
Configure script option --enable-wb-ntlm-auth renamed to --enable-ntlm-wb
Configure script option --disable-wb-ntlm-auth renamed to --disable-ntlm-wb

Preprocessor symbol WINBIND_NTLM_AUTH_ENABLED renamed to NTLM_WB_ENABLED
Preprocessor symbol WINBIND_NTLM_AUTH_FILE renamed to NTLM_WB_FILE

Test harness env var CURL_NTLM_AUTH renamed to CURL_NTLM_WB_FILE

Static function wb_ntlm_close renamed to ntlm_wb_cleanup
Static function wb_ntlm_initiate renamed to ntlm_wb_init
Static function wb_ntlm_response renamed to ntlm_wb_response
2011-08-27 06:31:18 +02:00
Yang Tse
b4f6319cf7 NTLM single-sign on adjustments (XI)
Feature string literal NTLM_SSO renamed to NTLM_WB.
Preprocessor symbol USE_NTLM_SSO renamed to WINBIND_NTLM_AUTH_ENABLED.
curl's 'long' option 'ntlm-sso' renamed to 'ntlm-wb'.
Fix some comments to make clear that this is actually a NTLM delegation.
2011-08-27 01:33:35 +02:00
Daniel Stenberg
e18c3f447e --cookie-jar: activates the cookie engine 2011-08-26 23:23:07 +02:00
Daniel Stenberg
0fd2bf3726 Curl_read_plain: indent code 2011-08-26 23:20:27 +02:00
Yang Tse
407e08baad NTLM single-sign on adjustments (X)
Functions renamed:

Curl_output_ntlm_sso -> Curl_output_ntlm_wb
sso_ntlm_close -> wb_ntlm_close
sso_ntlm_response -> wb_ntlm_response
sso_ntlm_initiate -> wb_ntlm_initiate

Preprocessor symbols renamed:

CURLAUTH_NTLM_SSO -> CURLAUTH_NTLM_WB
CURL_VERSION_NTLM_SSO -> CURL_VERSION_NTLM_WB
2011-08-26 18:57:50 +02:00
Daniel Stenberg
186463e7fa TODO: progress callback without doubles 2011-08-25 16:05:04 +02:00
Steve Holme
d535cff775 http NTLM: refactoring followup
Output of Curl_ntlm_create_type1_message() and Curl_ntlm_create_type3_message()
functions is now already base64 encoded.
2011-08-25 15:13:13 +02:00
Kamil Dudka
f5ad192d23 docs: the next release is going to be 7.22.0 2011-08-24 23:51:21 +02:00
Yang Tse
e83421baf4 include limits.h for INT_MAX 2011-08-24 14:00:42 +02:00
Yang Tse
aa5c72af15 add missing semicolons 2011-08-24 13:58:37 +02:00
Daniel Stenberg
b9c63b9a73 add missing semicolons 2011-08-24 11:56:23 +02:00
Daniel Stenberg
cb5e72bf62 safefree use: fix compiler warning
include the prototype header
2011-08-24 11:55:49 +02:00
Steve Holme
e882416e75 SMTP authentication: fix ordering of preferred authentication method
Fixed the order of the preferred SMTP authentication method to:
AUTH CRAM-MD5, AUTH LOGIN then AUTH PLAIN.

AUTH PLAIN should be the last as it slightly more insecure than AUTH LOGIN
as the username and password are sent together - there is no handshaking
between the client and server like there is with AUTH LOGIN.
2011-08-24 08:55:25 +02:00
Yang Tse
fd00b382b2 base64: fix Curl_base64_encode and Curl_base64_decode interfaces
Previous interfaces for these libcurl internal functions did not allow to tell
apart a legitimate zero size result from an error condition. These functions
now return a CURLcode indicating function success or otherwise specific error.
Output size is returned using a pointer argument.

All usage of these two functions, and others closely related, has been adapted
to the new interfaces. Relative error and OOM handling adapted or added where
missing. Unit test 1302 also adapted.
2011-08-24 08:10:30 +02:00
Daniel Stenberg
cce6508242 resolve.c: new example showing off CURLOPT_RESOLVE 2011-08-23 16:31:10 +02:00
Daniel Stenberg
af809923e4 externalsocket.c: new example 2011-08-23 11:28:35 +02:00
Steve Holme
006b011cdf http NTLM: remaining bits from 0001-Moved-ntlm-[...]-curl_ntlm-mod_3.patch
* Added function comments:
    - Curl_ntlm_decode_type2_message
    - Curl_ntlm_create_type1_message
    - Curl_ntlm_create_type3_message

* Modification of ntlm processing state to NTLMSTATE_TYPE2 is now done
  only when Curl_ntlm_decode_type2_message() has fully succeeded.
2011-08-22 16:42:59 +02:00
Yang Tse
a659cc4794 runtests.pl: option -gw for single test windowed debugging (where possible) 2011-08-21 19:25:35 +02:00
Yang Tse
1c400b4e5e zlib: ensure user provided memory functions are used by zlib, when given
As a bonus, this lets our MemoryTracking subsystem track zlib operations.
And also fixes a shortcut some zlib 1.2.x versions took using malloc()
instead of calloc(), which would trigger memory debuggers warnings on
memory being used without having been initialized.
2011-08-21 13:24:46 +02:00
Daniel Stenberg
61ae7e9ce7 main: fix segfault
Follow-up to commit 5eb2396cd as that wasn't complete.

At times HEADERFUNCTION+HEADERDATA was set only to have only HEADERDATA
set in the subsequent loop which could cause a NULL to get sent as
userdata to 'header_callback' which wasn't made to handle that.

Now HEADERFUNCTION is explicitly set to NULL if it isn't set to the
callback.
2011-08-21 12:59:06 +02:00
Yang Tse
838dd8f594 MemoryTracking: adjust initialization calling - followup
Fix macro definition
2011-08-21 06:10:52 +02:00
Yang Tse
aaab5fa299 MemoryTracking: adjust initialization calling
Calling of curl_memdebug() was still done with a pending free()
2011-08-20 17:26:42 +02:00
Daniel Stenberg
2d7c79af76 tcpconnect: follow-up commit after b998d95b
As I modified conn->bits.tcpconnect to become an array that holds one
bool for each potential connection all uses of that struct field must
index it correctly.
2011-08-19 23:39:56 +02:00
Yang Tse
38c5e81a67 ssh.c: add PATH_MAX definition for WIN32 2011-08-19 21:25:39 +02:00
Daniel Stenberg
3af9ba166c connect: set TIMER_CONNECT
When connecting, make sure TIMER_CONNECT is set.
2011-08-19 00:16:01 +02:00
Daniel Stenberg
7b054a42aa test573: fix the keywords 2011-08-19 00:15:37 +02:00
Daniel Stenberg
b998d95b4d FTP: fix proxy connect race condition
When using the multi interface, a SOCKS proxy, and a connection that
wouldn't immediately consider itself connected (which my Linux tests do
by default), libcurl would be tricked into doing _two_ connects to the
SOCKS proxy when it setup the data connection and then of course the
second attempt would fail miserably and cause error.

This problem is a regression that was introduced by commit
4a42e5cdaa that was introduced in the 7.21.7 release.

Bug: http://curl.haxx.se/mail/lib-2011-08/0199.html
Reported by: Fabian Keil
2011-08-18 23:35:15 +02:00
Daniel Stenberg
d44896508c Curl_SOCKS4: minor code compression 2011-08-18 23:28:50 +02:00
Yang Tse
9afb343368 zlib: enforce full initialization of our data space z_stream structs 2011-08-18 20:10:51 +02:00
Daniel Stenberg
1833984664 VC makefiles: fixed variable name mistake 2011-08-17 23:51:37 +02:00
Yang Tse
31a1af5ebb MemoryTracking: adjust curl_domalloc() and curl_dofree() memory filling
Until 2011-08-17 libcurl's Memory Tracking feature also performed
automatic malloc and free filling operations using 0xA5 and 0x13
values. Our own preinitialization of dynamically allocated memory
might be useful when not using third party memory debuggers, but
on the other hand this would fool memory debuggers into thinking
that all dynamically allocated memory is properly initialized.

As a default setting, libcurl's Memory Tracking feature no longer
performs preinitialization of dynamically allocated memory on its
own. If you know what you are doing, and really want to retain old
behavior, you can achieve this compiling with preprocessor symbols
CURL_MT_MALLOC_FILL and CURL_MT_FREE_FILL defined with appropriate
values.
2011-08-17 19:02:42 +02:00
Yang Tse
9710f387c4 MemoryTracking: make curl_docalloc() call calloc() avoiding our zero fill 2011-08-16 22:24:23 +02:00
Daniel Stenberg
4ed7abb537 MSVC makefiles: provide SSH build targets
"release-ssl-ssh2-zlib" and "debug-ssl-ssh2-zlib" are two new makefile
targets that build libcurl with MSVC and link with libssh2

Bug: http://curl.haxx.se/bug/view.cgi?id=3388920
Reported by: "kdekker"
2011-08-15 23:22:06 +02:00
Daniel Stenberg
ef2059a44c test572: fixed
Two problems were fixed:

GET_PARAMETER responses that have no body must be 204 response or
properly set length to 0.

One of the <data> sections had the wrong content-length for its
GET_PARAMETER response.

Enabled test 572 again.
2011-08-15 22:40:28 +02:00
Daniel Stenberg
93ba8b9560 Curl_pgrsStartNow: clear all flags but HIDE
As bug 3385258 pointed out but I missed up the fix for. This is another
take at a fix.

Bug: http://curl.haxx.se/bug/view.cgi?id=3392101
Reported by: Wu Yongzheng
2011-08-15 22:13:18 +02:00
Yang Tse
ade87b32c7 unittests: disable unit tests for some autobuild configurations
IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to a
problem related with OpenSSL headers and library versions not matching.

All AIX autobuilds fails unit tests linking against unittests library due to
unittests library being built with no symbols or members. Libtool ?
2011-08-15 18:30:21 +02:00
Kamil Dudka
d6f319fb64 nss: start with no database if the selected database is broken
Bug: https://bugzilla.redhat.com/728562
2011-08-15 14:44:49 +02:00
Yang Tse
b9d5e72adc http NTLM: reinstate "nssg.h" "curl_sspi.h" header inclusions 2011-08-15 01:34:34 +02:00
Yang Tse
6a7ce5cc76 tests: disable #572 2011-08-15 00:20:32 +02:00
Daniel Stenberg
7d738baeb5 TODO-RELEASE: synced
Added comments to some remaining issues
2011-08-14 23:30:15 +02:00
Daniel Stenberg
44b44a751d telnet: allow programatic use on Windows
Summary of the issue can be found at:
http://curl.haxx.se/mail/lib-2010-04/0367.html

That patch only updated the unix sockets code - the winsock code was not
updated and no longer works the same was as the unix code. This change
updates the windows code accordingly.

Bug: http://curl.haxx.se/bug/view.cgi?id=3163118
2011-08-14 23:30:15 +02:00
Daniel Stenberg
2828b8ef9e TODO-RELEASE: fixed issue #291
291 - bug 3383692 "GET PARAMETER request and body in response"
2011-08-14 23:30:15 +02:00
Yang Tse
e575cbc815 http NTLM: reinstate "memdebug.h" header inclusion
Inclusion of header "memdebug.h" in http_ntlm.c got lost in commit 98fb0ef7.
2011-08-14 21:19:22 +02:00
Daniel Stenberg
f0c59c6c2c RTSP: GET_PARAMETER requests have a body
Bug: http://curl.haxx.se/bug/view.cgi?id=3383692
2011-08-14 19:07:54 +02:00
Daniel Stenberg
dfb18da5dc Curl_output_ntlm: remove unused variable 2011-08-14 18:54:21 +02:00
Yang Tse
0c4ec8033b http NTLM: add curl_ntlm.c to Symbian's libcurl.mmp 2011-08-14 17:26:42 +02:00
Yang Tse
dc4f9d185d http NTLM: fix 8 compiler warnings
Strict splitting of http_ntlm.[ch] may trigger 8 compiler warnings when
building with some compilers and strict compiler warnings enabled, depending
on other specific configuration options some could get triggered or not.

Seven are related with 'unused function parameters' and another one with
'var may be used before its value is set'.
2011-08-14 16:36:47 +02:00
Yang Tse
98fb0ef73e http NTLM: split http_ntlm.[ch] between http_ntlm.[ch] and curl_ntlm.[ch]
For modularity purposes, huge chunks of NTLM existing code is transformed into
functions to allow future internal code reuse.

Resulting three new libcurl private functions:

 - Curl_ntlm_create_type1_message()
 - Curl_ntlm_create_type3_message()
 - Curl_ntlm_decode_type2_message()

Changing static ntlm_sspi_cleanup() into non-static Curl_ntlm_sspi_cleanup()

This 'refactoring' has been prepared by previous commits to allow that this
specific one does not introduce any change to existing code. All existing
goodness and badness previous to this commit should remain the same once it is
applied, the only difference should be that existing code is moved into
functions.

Given the quite big portions of code being moved around, and the importance of
change traceability, this commit has been done in such a way that it is
possible to perform a three-way diff from initial http_ntlm.[ch] to resulting
http_ntlm.[ch] and curl_ntlm.[ch] to actually verify that no functional change
is introduced here.

Notice that Steve Holme has provided several patches, but these included this
refactoring along with 'extra' fixes. I really wanted this 'clean' refactoring
done first, in order to allow discussion or committing of 'extra' fixes on a
case by case basis, so, I had to bite the bullet ;-)

Comments, line adjustments, compiler warning fixes, whatever, may follow
afterwards.
2011-08-14 15:45:19 +02:00
Yang Tse
08b05efd20 http_negotiate_sspi.c: fix compiler warning
warning C4706: assignment within conditional expression
2011-08-14 00:05:05 +02:00
Yang Tse
b4d6db83de http NTLM: change return type of Curl_input_ntlm() to CURLcode
Remove CURLntlm enum, no longer required.
2011-08-13 23:59:29 +02:00
Daniel Stenberg
e209f3f176 RELEASE-NOTES: synced with a30ede868a
Three more bugs fixed, three more contributors mentioned
2011-08-13 23:03:43 +02:00
Daniel Stenberg
a30ede868a VC6 makefiles: added embedded documentation
Just a note about the fact that all VC[6/8/9/10] makefiles are generated
from the VC6 one as source.
2011-08-13 22:30:56 +02:00
Daniel Stenberg
40afeea2fb cmake: find winsock when building on windows
When building on Windows, with CMake and mingw, curl fails to compile
because the CMake build system is not properly looking for the Winsock
libraries

Patch by: Pau Garcia i Quiles
Bug: http://curl.haxx.se/bug/view.cgi?id=3389231
2011-08-13 14:42:21 +02:00
Daniel Stenberg
e40c663d36 Curl_retry_request: check return code!
Curl_readrewind() was called without checking its return code, which
could lead to badness.

Bug: http://curl.haxx.se/bug/view.cgi?id=3349227
2011-08-13 00:51:16 +02:00
Daniel Stenberg
c8766ed3fb ignore rtsp 2011-08-13 00:22:47 +02:00
Yang Tse
1e4187f8bf http NTLM: update NTLM type-* message structure descriptions - followup 2011-08-13 00:20:51 +02:00
Daniel Stenberg
8bd877d179 docs: --delegation 2011-08-12 23:51:41 +02:00
Daniel Stenberg
5538904d77 added --delegation
Using this option with an argument being set to one of
none/policy/always instructs libcurl how to deal with GSS
credentials. Or rather how it tells the server that delegation is fine
or not.
2011-08-12 23:06:12 +02:00
Yang Tse
a472ceb174 http NTLM: fix inclusion of curl_ntlm.h 2011-08-12 22:01:27 +02:00
Yang Tse
092189c664 http NTLM: update NTLM message structure notes 2011-08-12 21:13:01 +02:00
Steve Holme
301e907aed http NTLM: move portions of http_ntlm.h into new curl_ntlm.h 2011-08-12 20:02:01 +02:00
Yang Tse
3293150da2 http NTLM: more adjustments in preparation of code refactoring
Use preprocessor symbol NTLM_BUFSIZE to define private NTLM buffer fixed size.

Use a SessionHandle 'data' pointer variable to ease refactoring.

Update NTLM type-* message structure descriptions.

Fix some more spacing and typos (Steve Holme).
2011-08-12 19:51:50 +02:00
Daniel Stenberg
784971743d curl_easy_cleanup: clarify the callback situation 2011-08-11 14:55:17 +02:00
Yang Tse
448f982d54 http NTLM: fix compiler warning 2011-08-11 09:06:06 +02:00
Steve Holme
f396d94736 http NTLM: Tidied up more inconsistent spacing.
Moved NTLMSSP_SIGNATURE, HOSTNAME_MAX, SHORTPAIR and LONGQUARTET definitions in ready for move to curl_ntlm.c.

Used separate variables for Windows SSPI and native code to ease moving of code to curl_ntlm.c.

Fixed typographical erros where SPPI should be SSPI.

Fixed compilation warnings on 64-bit builds when calling Windows SSPI functions.
2011-08-11 02:18:16 +02:00
Daniel Stenberg
657d02fbac rtsp.c: converted to C
Trimmed the newlines to be LF-only. Converted the source to plain C, to
use curl style indents, to compile warning-free with picky options and
fixed the minor fprintf() bug on line 245. Added to makefile.
2011-08-10 10:57:50 +02:00
Jim Hollinger
8e2de86723 rtsp.c: new example
Code from
http://code.google.com/p/rtsprequest/source/browse/trunk/rtsprequest.cpp
2011-08-10 10:54:53 +02:00
Daniel Stenberg
4b48adb876 TODO: remove curl_formpost in a future version
15.8 remove 'curl_httppost' from public
2011-08-10 08:55:13 +02:00
Yang Tse
c7fb556f26 http NTLM: Further tiding up to libcurl standards 2011-08-09 22:57:22 +02:00
Steve Holme
5ed17de326 http NTLM: Tidied up http_ntlm prior to splitting the ntlm specific code 2011-08-09 22:57:22 +02:00
Daniel Stenberg
209cf2df37 TODO-RELEASE: issue #289 is fixed
289 - bug 3349227 "secure attribute in cookie does not work with equals sign"
2011-08-09 14:23:35 +02:00
Daniel Stenberg
7c21c1c4f9 cookie parser: handle 'secure='
There are two keywords in cookie headers that don't follow the regular
name=value style: secure and httponly. Still we must support that they
are written like 'secure=' and then treat them as if they were written
'secure'. Test case 31 was much extended by Rob Ward to test this.

Bug: http://curl.haxx.se/bug/view.cgi?id=3349227
Reported by: "gnombat"
2011-08-09 14:02:05 +02:00
Daniel Stenberg
f8831d55e0 curl.h: mark deprecated CURLOPT_ options on same line
This is to aid easier machine parsing and to make sure nobody who reads
these header lines can miss the info.
2011-08-09 10:46:02 +02:00
Daniel Stenberg
43d2c66454 RELEASE-NOTES: recounted and updated some numbers 2011-08-09 09:32:53 +02:00
Daniel Stenberg
27dbc3f526 proxy protocol docs: rephrased and updated 2011-08-09 09:12:51 +02:00
Daniel Stenberg
9f10dabc43 RELEASE-NOTES: synced with 45d883d88d
Mention 5 bugixes and 1 change more
2011-08-08 19:40:45 +02:00
Daniel Stenberg
45d883d88d CURLFORM_BUFFER: insert filename as documented
A regression where CURLFORM_BUFFER stopped to properly insert the file
name part in the formpart. Bug introduced in commit f851f76857.

Added CURLFORM_BUFFER use to test 554 to verify this.

Bug: http://curl.haxx.se/mail/lib-2011-07/0176.html
Reported by: Henry Ludemann
2011-08-08 18:45:03 +02:00
Yang Tse
3ef6418b61 curl-compilers.m4: serial number bump 2011-08-08 18:25:01 +02:00
Yang Tse
56ef3e295f curl-compilers.m4: CURL_CONVERT_INCLUDE_TO_ISYSTEM adjustments:
Add CURL_CHECK_COMPILER as a requirement.

Ensure macro does nothing unless GNU_C or CLANG compiler is used.

This should allow usage of this macro in unforeseen placements.
2011-08-08 17:50:16 +02:00
Daniel Stenberg
3dcc0df5cc SOCKS: fix the connect timeout
The connect timeout logic when using SOCKS was done wrong

Bug: http://curl.haxx.se/mail/lib-2011-07/0177.html
Reported by: "Spoon Man"
2011-08-08 11:23:31 +02:00
Daniel Stenberg
da3ae20da5 ftp_doing: bail out on error properly
When a failure has been detected we must abort immdiately.

Bug: http://curl.haxx.se/mail/lib-2011-07/0177.html
Reported by: "Spoon Man"
2011-08-08 10:43:09 +02:00
Daniel Stenberg
73548e1d22 s/7.21.8/7.22.0 2011-08-08 10:13:09 +02:00
Daniel Stenberg
56a0635216 version bump: next release is 7.22.0 2011-08-08 09:27:53 +02:00
Daniel Stenberg
967deb43f8 VERSIONS: clarify our versioning concept
Drop the pre-release part from this text as we don't use that in
practise since many years.

Update the phrasing to reflect our more strict interpretation:
http://curl.haxx.se/mail/lib-2011-08/0064.html
2011-08-08 09:25:59 +02:00
Cristian Rodríguez
3d919440c8 OpenSSL: Use SSL_MODE_RELEASE_BUFFERS if available, reduces memory use
See also :
http://www.openssl.org/docs/ssl/SSL_CTX_set_mode.html
http://www.imperialviolet.org/2010/06/25/overclocking-ssl.html

Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org>
2011-08-07 22:58:31 +02:00
Daniel Stenberg
339fef4440 TODO-RELEASE: close issue #292
Fixed:
292 - bug 3385258 "Addendum to 3370895"

Basically brushing up commit 27b8814017
2011-08-07 22:54:37 +02:00
Daniel Stenberg
15379f0614 Curl_pgrsStartNow: clear all bits except HIDE
Bug: http://curl.haxx.se/bug/view.cgi?id=3385258
Reported by: Ben Winslow
2011-08-07 22:26:57 +02:00
Daniel Stenberg
f2a6373629 readwrite_data: improved C-E decoding error message 2011-08-07 19:55:23 +02:00
Yang Tse
2ccffbb37e BSD-style lwIP TCP/IP stack support - followup
lwIP library initialization.
2011-08-07 08:45:57 +02:00
Yang Tse
1db023d3cb NTLM single-sign on adjustments (IX)
Use swrite/sread instead of write/read to avoid SIGPIPE
2011-08-07 03:05:04 +02:00
Yang Tse
91ad42412f config-win32.h: comments adjustments 2011-08-06 19:18:43 +02:00
Daniel Stenberg
7d69e31023 TODO-RELEASE: committed issue #304
304 - "Async-DNS-resolve-thread gets started even when a dotted IP is
      provided" by Christian H<E4>gele
      http://curl.haxx.se/mail/lib-2011-08/0009.html
2011-08-06 15:24:48 +02:00
Christian Hägele
704dc18440 asyn-thread: check for dotted addresses before thread starts 2011-08-06 15:21:42 +02:00
Daniel Stenberg
b0f18c4beb TODO-RELEASE: Add #307 two issues by "Spoon Man" 2011-08-06 12:18:59 +02:00
Yang Tse
40e1d03c5d checksrc.pl: add quotes to var 2011-08-05 21:24:59 +02:00
Yang Tse
c95fec5e5b keep a single copy of config-win32.h in version control repository - followup
Allow configure builds to generate src/config-win32.h

Skip checksrc on src/config-win32.h contents already checked at lib/config-win32.h

Allow multiple -W in checksrc.pl
2011-08-05 21:01:39 +02:00
Yang Tse
817b863466 BSD-style lwIP TCP/IP stack support - docs/INSTALL blurb 2011-08-05 16:32:20 +02:00
Yang Tse
f6272dd9b8 BSD-style lwIP TCP/IP stack support - followup 2011-08-05 15:53:00 +02:00
Yang Tse
40597fd942 git ignore src/config-win32.h 2011-08-05 13:24:02 +02:00
Yang Tse
f0fae85acd keep a single copy of config-win32.h in version control repository.
maketgz and buildconf.bat updated to reflect this.
2011-08-05 13:20:22 +02:00
Daniel Stenberg
e1f3536bac RELEASE-NOTES: synced with afe88d85f4 2011-08-05 01:12:24 +02:00
Daniel Stenberg
afe88d85f4 test710: verify that --proxy socks5://hostname works 2011-08-05 00:46:59 +02:00
Daniel Stenberg
17f343290c create_conn: mark non-HTTP proxies accordingly
A proxy could be marked 'httpproxy' wrongly before if set with an
environment variable or with the CURLOPT_PROXY option with a socks*://
prefix or similar.

Added test 710 to verify

Bug: http://curl.haxx.se/mail/lib-2011-07/0194.html
2011-08-05 00:44:40 +02:00
Daniel Stenberg
75fa3d2d6e test709: HTTP GET via SOCKS5 set in environment 2011-08-05 00:28:03 +02:00
Daniel Stenberg
9812446c65 TODO-RELEASE: issue #293 is done
Fixed:
293 - from http://bugzilla.redhat.com/723075 "curl segfaults"
2011-08-04 23:27:05 +02:00
Daniel Stenberg
5eb2396cd1 segfault fixed
When using both -J and a single -O with multiple URLs, a missing init
could cause badness.

Bug: http://curl.haxx.se/mail/lib-2011-07/0126.html and
     http://bugzilla.redhat.com/723075
Reported by: Paul Howarth and Garrett Holmstrom
2011-08-04 23:25:55 +02:00
Daniel Stenberg
86b50a1fe5 test1313: test content-disposition with uneven quotes 2011-08-04 23:25:55 +02:00
Daniel Stenberg
8f890470f1 parse_filename: deal with escaped quotes 2011-08-04 23:25:55 +02:00
Yang Tse
a6ed2b8426 BSD-style lwIP TCP/IP stack support:
Allow compilation of libcurl and curl using BSD-style lwIP on Win32.

In order to compile libcurl and curl with this support it is necessary
to edit files lib/config-win32.h and src/config-win32.h and uncomment
a line to make definition of preprocessor symbol USE_LWIPSOCK visible.

Afterwards you can compile as usual.

In order to use compiled library with BSD-style lwIP TCP/IP stack in
your program it is mandatory that you include lwIP header file <lwip/opt.h>
before including <curl/curl.h> or <curl/multi.h>

Compilation has been verified with lwIP 1.4.0 and contrib-1.4.0 from:

http://download.savannah.gnu.org/releases/lwip/lwip-1.4.0.zip
http://download.savannah.gnu.org/releases/lwip/contrib-1.4.0.zip

Have fun!
2011-08-04 21:27:29 +02:00
Yang Tse
b56bbabee0 curl.h: untangle a preprocessor block, removing duplicate sys/types.h inclusion 2011-08-04 20:47:31 +02:00
Daniel Stenberg
a04912bb65 TODO-RELEASE: issue #290 fixed
Closed this entry:
290 - bug 3375603 "curl has problem with remote names containing ';'"
2011-08-04 17:51:08 +02:00
Daniel Stenberg
519d0c0dd2 -J: support ';' in quoted file names
Content-disposition headers can provide file names with semicolons which
previously would be cut off at that point.

Added test case 1311 and 1312 to verify -J.

Bug: http://curl.haxx.se/bug/view.cgi?id=3375603
Reported by: Peter Hjalmarsson
2011-08-04 17:48:45 +02:00
Daniel Stenberg
d2c22411af getpart.pm: when no part match, return blank when section ends 2011-08-04 17:36:31 +02:00
Daniel Stenberg
c4142034ff runtests.pl: support option=no-include 2011-08-04 17:36:00 +02:00
Daniel Stenberg
efc8ef7cc4 TODO-RELESE: #306 - SSL Sessions shared 2011-08-04 11:11:03 +02:00
Daniel Stenberg
b698f90051 TODO-RELEASE: updated with current issues 2011-08-04 00:22:04 +02:00
Kamil Dudka
ddf0b30ffd curl_gssapi: add a missing include of sendf.h
... to avoid build failure when GSS_C_DELEG_POLICY_FLAG is not defined.

Reported by: Paul Howarth
2011-08-03 18:07:07 +02:00
Kamil Dudka
a7864c41db curl_gssapi: refine the handling of CURLOPT_GSSAPI_DELEGATION
Suggested by Richard Silverman.
2011-08-03 10:56:41 +02:00
Adam Tkac
ebf42c4be7 Add new CURLOPT_GSSAPI_DELEGATION option.
Curl_gss_init_sec_context got new parameter - SessionHandle.

Signed-off-by: Adam Tkac <atkac@redhat.com>
2011-08-03 10:23:34 +02:00
Yang Tse
7688a99bef configure: add check for <sys/wait.h> 2011-07-31 22:36:54 +02:00
Yang Tse
10a0bed485 NTLM single-sign on adjustments (VIII)
Use preprocessor symbols WINBIND_NTLM_AUTH_ENABLED and WINBIND_NTLM_AUTH_FILE
for Samba's winbind daemon ntlm_auth helper code implementation and filename.

Retain preprocessor symbol USE_NTLM_SSO for NTLM single-sign-on feature
availability implementation independent.

For test harness, prefix NTLM_AUTH environment vars with CURL_

Refactor and rename configure option --with-ntlm-auth to --enable-wb-ntlm-auth[=FILE]
2011-07-31 20:44:41 +02:00
Dan Fandrich
cc3e01cfae Renumbered test2005 to test1310
The 20xx range is for multiple sequential tests.
2011-07-29 12:35:52 -07:00
Yang Tse
65cc163195 curl-functions.m4 serial # bump 2011-07-29 20:29:48 +02:00
Yang Tse
9417e71f4a Revert "configure: additional flag checks for fcntl() socket() and socketpair()"
This reverts commit bc6e6a465a.
2011-07-29 20:24:37 +02:00
Yang Tse
bc6e6a465a configure: additional flag checks for fcntl() socket() and socketpair() 2011-07-29 18:28:04 +02:00
Yang Tse
ad8193fbb9 NTLM single-sign on adjustments (VII)
Initialize variables when connectdata object is created.
2011-07-29 16:27:15 +02:00
Yang Tse
bcbac913d6 socketpair() usage tracking to allow fd leak detection 2011-07-29 13:27:10 +02:00
Yang Tse
5cdbfa1837 fix compiler warning 2011-07-29 13:27:08 +02:00
Dan Fandrich
c01c000b16 Avoid a "shadows global declaration" warning on old MIT Kerberos
Defining NCOMPAT eliminates the backwards-compatibility macros
that are the source of the problem and which we don't need,
anyway.
2011-07-28 14:04:13 -07:00
Yang Tse
35051d274f NTLM single-sign on adjustments (VI)
Fix compiler warning
2011-07-28 22:47:42 +02:00
Dan Fandrich
9779553221 Give the NTLM SSO helper a moment to cleanly shut down if needed 2011-07-28 12:42:39 -07:00
Dan Fandrich
435e2bc757 Removed an extraneous \n that violated the SSO daemon protocol
This caused fake_ntlm to abort due to an invalid command
causing sporadic test 2005 failures.
2011-07-28 12:41:44 -07:00
Yang Tse
99848d3dab NTLM single-sign on adjustments (V)
Enhance test harness fake_ntlm logging upon invalid input.
2011-07-28 21:12:41 +02:00
Dan Fandrich
02e59579ef Fixed a couple of memory leaks in NTLM SSO support 2011-07-27 18:08:10 -07:00
Yang Tse
dddf9aa610 NTLM single-sign on adjustments (IV)
Fix compiler warning
2011-07-27 20:10:02 +02:00
Yang Tse
4eb08ac1c0 NTLM single-sign on adjustments (III)
Provide some error tracing and fix execl() calling.
2011-07-27 19:12:06 +02:00
Yang Tse
6ac4eeab2f NTLM single-sign on adjustments (II)
Ensure test harness fake_ntlm main function can properly handle arguments.
2011-07-27 19:04:55 +02:00
Yang Tse
8350fb8f2f NTLM single-sign on adjustments (I)
Use fake_ntlm absolute filename in NTLM_AUTH environment variable for test
2005 definition.
2011-07-27 18:58:21 +02:00
Dan Fandrich
cfcca89b76 Fixed test 2005 to work in out-of-tree builds
Also, set the test number in the test data file so fake_ntlm can
be reused in future tests.
2011-07-26 12:48:16 -07:00
Yang Tse
41c6c78a08 fix compiler warning 2011-07-26 21:36:35 +02:00
Yang Tse
78bbd0eecf fix compiler warning 2011-07-26 19:42:16 +02:00
Yang Tse
f1586cb477 stdio.h, stdlib.h, string.h, stdarg.h and ctype.h inclusion done in setup_once.h 2011-07-26 17:23:27 +02:00
Yang Tse
983f3d70f9 WIN32 io.h and fcntl.h inclusion done in setup_once.h 2011-07-25 05:30:14 +02:00
Yang Tse
0337b87197 time.h and sys/time.h inclusion conditionally done in setup_once.h 2011-07-25 04:08:08 +02:00
Yang Tse
0a26b0e3e7 errno.h inclusion conditionally done in setup_once.h - followup 2011-07-25 03:10:24 +02:00
Yang Tse
ef2176109f errno.h inclusion conditionally done in setup_once.h 2011-07-24 04:39:43 +02:00
Ben Winslow
27b8814017 progress: reset flags at transfer start
When an easy handle is used to download an URI which has no
Content-Length header (or equivalent) after downloading an URI which
does, the value from the previous transfer is reused and returned by
CURLINFO_CONTENT_LENGTH_DOWNLOAD. This is because the progress flags
(used to determine whether such a header was received) are not reset
between transfers.

Bug: http://curl.haxx.se/bug/view.cgi?id=3370895
2011-07-22 22:50:58 +02:00
Daniel Stenberg
dcc8481a13 RELEASE-NOTES: HTTP error handling on request body send 2011-07-20 00:08:41 +02:00
Daniel Stenberg
3f9b4afdfd http error response: stop sending when error is received
When libcurl has said to the server that there's a POST or PUT coming
(with a content-length and all) it has to either deliver that amount of
data or it needs to close the connection before trying a second request.

Adds test case 1129, 1130 and 1131

The bug report is about when used with 100-continue, but the change is
more generic.

Bug: http://curl.haxx.se/mail/lib-2011-06/0191.html
Reported by: Steven Parkes
2011-07-20 00:08:41 +02:00
Michael Mueller
d007c3ca76 sso_ntlm_initiate: unassigned variable
Bug: http://curl.haxx.se/mail/lib-2011-07/0109.html
2011-07-19 23:54:21 +02:00
Daniel Stenberg
0ae15092d4 test2005: require a debug build 2011-07-19 23:50:34 +02:00
Daniel Stenberg
b9313af838 runtests: add 'debug' as a feature a test can require 2011-07-19 23:49:40 +02:00
Daniel Stenberg
d0d36f312f configure: avoid "test -e"
"test -e" is POSIX but clearly was not supported by the SunOS sh
version, -f is supported and should be a decent equivalent

Bug: http://curl.haxx.se/bug/view.cgi?id=3371574
2011-07-19 20:12:58 +02:00
Daniel Stenberg
d95f45cd40 symbols-in-versions: add NTLM_SSO symbols 2011-07-19 00:54:41 +02:00
Daniel Stenberg
177fd0a14c gitignore: ignore fake_ntlm 2011-07-18 23:49:31 +02:00
Mandy Wu
aa26c2751a test2005: verify ntlm single-signon 2011-07-18 23:48:53 +02:00
Mandy Wu
a6d4807d02 NTLM single-sign on supported
With the use of the 'ntlm_auth' tool from the Samba project
2011-07-18 23:36:36 +02:00
Daniel Stenberg
650a504b2f sws: don't enable pipelining for requests with content-length
Log texts also modified and some white space edits
2011-07-17 00:39:23 +02:00
Patrick Monnerat
e3a9804d3a Fix OS400 scripts to make it compilable again.
Upgrade ILE/RPG binding to 7.21.7.
Update OS400 documentation accordingly.
2011-07-14 17:07:35 +02:00
Daniel Stenberg
9c1f50c583 runtests: ignore the 'all_proxy' environment variable as well
We should probably also make sure that [protocol]_proxy for all possible
protocols libcurl supports are unset.
2011-07-14 11:04:00 +02:00
Julien Chaffraix
6e3285d5b1 curl_gssapi: Guard files with HAVE_GSSAPI.
Bug: http://curl.haxx.se/mail/lib-2011-07/0074.html
Reported and fix suggested by: Ben Greear
2011-07-13 21:16:03 -07:00
Daniel Stenberg
44b5847237 gssapi: rename our files to avoid conflicts
gssapi.h is used as a header name by Heimdal-style GSSAPI so it would
conflict with a private header using that name, and while renaming the
header I figured we should name the .c file accordingly as well.

Bug: http://curl.haxx.se/mail/lib-2011-07/0071.html
Reported by: Ben Greear
2011-07-13 22:54:54 +02:00
Daniel Stenberg
ee4ed46128 silence picky compilers: mark unused parameters
Modern gcc versions (4.6.X) get more picky by default and have started
to warn for unused parameters, but luckily gcc also allows us to mark
them as unused so that we can avoid the warnings.
2011-07-12 23:24:52 +02:00
Julien Chaffraix
2af0287856 gssapi.c: Simplified the function.
Removed the parameters that were common to all our invocation.
2011-07-12 07:06:26 -07:00
Julien Chaffraix
20485a4885 Added Curl_gss_init_sec_context.
This function wraps our calls to gss_init_sec_context so that we
have a unified way to talk to GSSAPI.
2011-07-12 07:06:25 -07:00
Julien Chaffraix
6488e03f44 http_negociate: Be consistent in gss_init_sec_context attributes.
This change makes this callsite match the rest of the code.
2011-07-12 07:06:25 -07:00
Daniel Stenberg
b680fd180b code style: space between close paren and open brace 2011-07-04 22:10:32 +02:00
Daniel Stenberg
dc97475ded checksrc: detect open brace without space
We use "if(condition) {" with a space between the close paren and the
open brace.
2011-07-04 22:08:14 +02:00
Daniel Stenberg
c6e3081090 polarssl.h: remove CVS leftover 2011-07-04 22:04:04 +02:00
Daniel Stenberg
902d3dc33d help output: more gnu like output
First, the -J/--remote-header-name was wrongly sorted in the --help
output as pointed out in bug report #3349271.

Then, I changed the format of the texts to follow the man page better in
that it now uses "-A, --long" intead of "-A/--long". I also made all
additional arguments get written as in "-A, --long FILENAME" instead of
the previous "<filename>" style.

Reported by: Herve Amblard
Bug: http://curl.haxx.se/bug/view.cgi?id=3349271
2011-07-03 22:13:18 +02:00
Daniel Stenberg
c7a4df16e0 sws: allow multiple commands in <servercmd> 2011-07-03 19:15:06 +02:00
Daniel Stenberg
bcf50283fc Curl_http_readwrite_headers: minor indent fix 2011-07-01 22:57:28 +02:00
Daniel Stenberg
3e16c3e73e gitignore: config.cache 2011-06-30 09:58:45 +02:00
Daniel Stenberg
3e71ebe4eb docs: FTP quotes support '*' prefix to ignore errors
By default libcurl stops processing quote commands on failures.
2011-06-30 09:57:23 +02:00
Daniel Stenberg
bfca0e2f50 THANKS: new contributors from 7.21.7 2011-06-29 20:42:02 +02:00
Daniel Stenberg
2e2e5f247a get_gss_name: proxy auth without proxy set equals error
Previously it would access a NULL pointer and die.

Bug: http://curl.haxx.se/mail/lib-2011-06/0170.html
Reported by: Christian Hagele
2011-06-29 12:27:37 +02:00
Daniel Stenberg
ac28971aa6 examples: cleanup curl includes
Only <curl/curl.h> is needed typically and curl/types.h has been removed
2011-06-28 19:08:51 +02:00
Daniel Stenberg
fb48e2050b libtests: stop checking for CURLM_CALL_MULTI_PERFORM
CURLM_CALL_MULTI_PERFORM stopped being a valid return code from
curl_multi_perform back in 7.20.0. All the libcurl tests are ajusted to
this and no longer check for this return code. Makes them simpler.
2011-06-27 16:01:41 +02:00
Dan Fandrich
78480892cd Fixed test 1300 to pass the memory torture test 2011-06-24 12:33:30 -07:00
Tom Wright
b7e242de0e looks like this should be static, not dll 2011-06-24 11:49:07 -07:00
Dan Fandrich
17a2d70dc4 Display notes from setup file in testcurl.pl
Autobuild submitters can use this to add some text to their
setup files to describe issues they've found with the build
or tests. This could include laying blame on test failures on
network issues or dependent libraries, explaining away compiler
warnings or providing any additional information that could be
useful to people reviewing and investigating problems with the
publicly available autobuild logs.  Note that persistent test
failures that are not issues with curl itself should normally be
fixed by excluding them from the test run instead.

This is an entirely optional field that is not entered by the
user the first time a new build is created.
2011-06-23 22:49:28 -07:00
Dan Fandrich
43ce5580a8 Added a leap second test to test517 2011-06-23 21:20:29 -07:00
Daniel Stenberg
0215f7cb4d runtests.pl: warn if a test is explicitly disabled
Just to make sure a user is aware of it.
2011-06-23 23:10:00 +02:00
Daniel Stenberg
67f28662e1 bump release: start working towards 7.21.8 2011-06-23 13:51:53 +02:00
Daniel Stenberg
57d51be60c parsedate: detect more invalid dates better 2011-06-23 13:49:29 +02:00
Daniel Stenberg
8da5da9b65 curl_formfree: clarify which pointer to free 2011-06-23 09:31:12 +02:00
Daniel Stenberg
42c6b7577f RELEASE-NOTES: mention security issue 20110623
libcurl inappropriate GSSAPI delegation. Full details at
http://curl.haxx.se/docs/adv_20110623.html
2011-06-22 23:12:39 +02:00
Daniel Stenberg
e5010ec3ff RELEASE-NOTES: synced with 9016958aa8 2011-06-22 23:04:26 +02:00
Daniel Stenberg
5c314c6bb4 Curl_input_negotiate: do not delegate GSSAPI credentials
This is a security flaw. See curl advisory 20110623 for details.

Reported by: Richard Silverman
2011-06-22 23:04:26 +02:00
Josue Andrade Gomes
9016958aa8 windows build: use correct MS CRT 2011-06-21 20:05:06 +02:00
Daniel Stenberg
1614dc0745 Merge pull request #23 from salty-horse/pop3_list_space
[pop3] remove extra space in LIST command
2011-06-21 08:54:25 -07:00
Ori Avtalion
af6dcc92d5 [pop3] remove extra space in LIST command
Some servers, e.g. mail.bezeqint.net:110, consider it a syntax error
2011-06-21 18:12:05 +03:00
Yang Tse
57064e4a0d http: fix compiler warning
compiler warning: conditional expression is constant
2011-06-21 16:28:15 +02:00
Yang Tse
d9e71809cb asyn-thread: fix compiler warning
compiler warning: variable is initialized but not referenced
2011-06-21 16:06:56 +02:00
Yang Tse
a7cc54a5a8 cmake: remove spurious definition 2011-06-21 15:28:03 +02:00
Daniel Stenberg
c9a82f39e2 FAQ: more blurb on persistent connections 2011-06-21 08:45:45 +02:00
Yang Tse
e4bca6a01c xc-translit.m4 fix quoting 2011-06-21 00:03:44 +02:00
Daniel Stenberg
56e5302b53 INSTALL: mention the GIT-INFO file 2011-06-20 22:20:39 +02:00
Dan Fandrich
4cbc6fc6ab Added LOCAL_MODULE_TAGS to support Android gingerbread 2011-06-20 12:01:38 -07:00
Amr Shahin
c9f16e67ef unitteset: Curl_llist_move
adding unit test for Curl_llist_move, documenting unit-tested functions
in llist.c, changing unit-test to unittest, replacing assert calls with
abort_unless calls
2011-06-19 22:22:49 +02:00
Daniel Stenberg
f851f76857 CURLFORM_STREAM: acknowledge CURLFORM_FILENAME
The CURLFORM_STREAM is documented to only insert a file name (and thus
look like a file upload) in the part if CURLFORM_FILENAME is set, but in
reality it always inserted a filename="" and if CURLFORM_FILENAME wasn't
set, it would insert insert rubbish (or possibly crash).

This is now fixed to work as documented, and test 554 has been extended
to verify this.

Reported by: Sascha Swiercy
Bug: http://curl.haxx.se/mail/lib-2011-06/0070.html
2011-06-17 22:23:42 +02:00
Yang Tse
0126b4a959 configure: avoid direct usage of AS_TR_* macros 2011-06-17 21:01:41 +02:00
Yang Tse
49a8fe5142 xc-translit.m4 provides transliteration macros with well defined behavior. 2011-06-17 20:59:58 +02:00
Daniel Stenberg
8fc4be9e7b RELEASE-NOTES: add more contributors for this release 2011-06-14 19:17:41 +02:00
Daniel Stenberg
70eee054f2 RELEASE-NOTES: synced with 0aedccc18a 2011-06-14 14:45:44 +02:00
Daniel Stenberg
0aedccc18a curl_formget: fix FILE * leak
Properly deal with the fact that the last fread() call most probably is
a short read, and when using callbacks in fact all calls can be short
reads. No longer consider a file read done until it returns a 0 from the
read function.

Reported by: Aaron Orenstein
Bug: http://curl.haxx.se/mail/lib-2011-06/0048.html
2011-06-13 22:32:00 +02:00
Daniel Stenberg
85881f9f35 curl_formget: treat CURLFORM_STREAM better
If a piece is set to use a callback to get the data, it should not be
treated as data. It unfortunately also requires that curl_easy_perform()
or similar has been used as otherwise the callback function hasn't been
figured out and curl_formget won't know how to get the content.
2011-06-13 22:05:13 +02:00
Daniel Stenberg
84e13f2e07 curl_formget.3: CURLFORM_STREAM has its drawbacks
Due to a design flaw, the CURLFORM_STREAM option doesn't really work
with curl_formget until after curl_easy_perform (or similar).
2011-06-13 22:03:33 +02:00
Daniel Stenberg
832e827518 FAQ: binding clarification
We don't author the bindings, they are created outside the main project.
2011-06-13 19:02:38 +02:00
Dan Fandrich
a6fa7fc38e Added http as a dependency of test 1308 2011-06-11 17:02:37 -07:00
Daniel Stenberg
b122f8be61 test1309: added to the dist 2011-06-12 00:10:51 +02:00
Daniel Stenberg
950fb3efcc write: add return code checks when used
These were just warnings in test code but it still makes it nicer to not
generate them.
2011-06-11 23:01:09 +02:00
Daniel Stenberg
ee015947d4 long/int mess
Typecast when converting to int from long to avoid some compiler warnings
2011-06-11 22:56:45 +02:00
Yang Tse
a2a2863306 configure: OpenSSL API detection cleanup 2011-06-11 18:40:26 +02:00
Dan Fandrich
b688f2c260 Fixed test 1309 to pass the torture test
Removing dynamic allocations also simplifies the test.
2011-06-11 00:10:09 -07:00
Daniel Stenberg
c4dd8df081 splay: add unit tests
The test code that was #ifdef'ed in the code was converted into unit
tests in test case 1309. I also removed the #if 0'ed code from splay.c
2011-06-10 20:19:35 +02:00
Daniel Stenberg
0f7bea7c3a unittest: mark all unit tested functions
With "@unittest: [num]" in the header comment for each tested function.
Shows we have a log way to go still...
2011-06-10 14:40:46 +02:00
Daniel Stenberg
d5cc77b744 CURLOPT_WRITEHEADER: clarify the docs 2011-06-10 13:17:17 +02:00
Daniel Stenberg
36a22f9074 unit test formpost: added test case 1308
This is a few first rather basic tests of curl_formadd() and
curl_formget(). Should serve as building blocks to add more variations
to the test.
2011-06-10 12:03:29 +02:00
Yang Tse
6e0dd48f97 configure: warn if OpenSSL headers and library versions don't match 2011-06-09 22:55:16 +02:00
Yang Tse
cb2f300364 configure: get API info for a couple of OpenSSL functions (followup 2) 2011-06-09 19:03:10 +02:00
Yang Tse
7530a28878 configure: get API info for a couple of OpenSSL functions (followup 1) 2011-06-09 00:45:38 +02:00
Yang Tse
e8d73c9c2d configure: fix recvfrom 5th arg type qualifier detection (followup) 2011-06-08 15:57:36 +02:00
Yang Tse
8a3c0fe56c configure: fix recvfrom 5th arg type qualifier detection 2011-06-08 13:37:35 +02:00
Kamil Dudka
f551aa5c16 disconnect: wipe out the keeps_speed time stamp
When closing a connection, the speedchecker's timestamp is now deleted
so that it cannot accidentally be used by a fresh connection on the same
handle when examining the transfer speed.

Bug: https://bugzilla.redhat.com/679709
2011-06-08 00:23:41 +02:00
Yang Tse
377f88364e urldata: use uniform inclusion style for OpenSSL headers 2011-06-07 18:35:42 +02:00
Daniel Stenberg
c0b9dd27b5 HTTP time condition: force closure for 200 OK
When a time condition isn't met, so that no body is delivered to the
application even though a 2xx response is being read from the server, we
must close the connection to avoid a re-use of the connection to be
completely tricked.

Added test 1128 to verify.
2011-06-07 13:40:11 +02:00
Daniel Stenberg
6aff805942 RELEASE-NOTES: synced with b772f3a321 2011-06-07 13:15:50 +02:00
Yang Tse
b772f3a321 configure: get API info for a couple of OpenSSL functions 2011-06-06 20:47:36 +02:00
Daniel Stenberg
7559b77727 wait_ms: takes an int argument
Typecasts added since I changed more code to use long for timeouts
2011-06-05 12:06:50 +02:00
Daniel Stenberg
4f170ee8f9 Curl_socket_ready: make timeout a 'long'
It was mostly typecasted to int all over the code so switching to long
instead all over should be a net gain.
2011-06-04 21:19:14 +02:00
Yang Tse
fba00c9f7b xlc: avoid preprocessor definition usage when linking 2011-06-04 04:27:09 +02:00
Yang Tse
10a7d05be3 unit tests: disable unit tests for a given cross-compilation configuration.
cross-compilation of unit tests static library/programs fails when
libcurl shared library is also built. This might be due to a libtool or
automake issue. In this case we disable unit tests.
2011-06-03 20:08:00 +02:00
Daniel Stenberg
9776f3445d cookie_output: made private 2011-06-03 20:02:07 +02:00
Daniel Stenberg
adeac15d8e digest_cleanup_one: made private 2011-06-03 19:54:17 +02:00
Daniel Stenberg
5d4e5593d5 privatise: make private functions static 2011-06-03 19:51:08 +02:00
Daniel Stenberg
c2eb8c932d Curl_fileinfo_dup: removed, not used 2011-06-03 19:33:23 +02:00
Daniel Stenberg
a6f14e17b7 parsedate: turn private and static
I removed the prefix as well accordingly.
2011-06-03 19:31:32 +02:00
Dan Fandrich
b3740f0e09 curl hasn't sent a Pragma: header by default for a while 2011-06-02 18:41:57 -07:00
Yang Tse
2a31dde76c unit tests: attempt to fix linkage issue 2011-06-02 22:26:01 +02:00
Yang Tse
bf749bb2c5 urlglob: fix zero size malloc 2011-06-02 22:19:39 +02:00
Yang Tse
65a9fa59dc Remove unnecessary typecast 2011-06-02 19:42:24 +02:00
Yang Tse
9eea43dce2 compiler warning: fix
Fix compiler warning: cast increases required alignment
2011-06-02 19:19:36 +02:00
Yang Tse
910d7953aa unit tests: make unit tests building actually depend on --enable-debug option. 2011-06-02 17:02:46 +02:00
Yang Tse
970117ef2d OpenSSL enabled: require OPENSSL_VERSION_NUMBER definition before usage. 2011-06-02 12:52:52 +02:00
Yang Tse
aa76dec33a unit tests: more build adjustments 2011-06-01 21:40:09 +02:00
Daniel Stenberg
d6bb8dcc23 CURLOPT_WILDCARDMATCH: minor style edit
Due to some flaw in roffit I removed some style changes to make the web
page look better.
2011-06-01 19:51:16 +02:00
Yang Tse
685359d4c3 makefile: avoid preprocessor definition usage when linking 2011-06-01 14:43:25 +02:00
Yang Tse
a689072f33 warnless: icc 9.1 workaround 2011-06-01 12:13:42 +02:00
Daniel Stenberg
3d64ed25df testcurl.pl: allow configure args to use '=' 2011-05-31 13:35:26 +02:00
Yang Tse
ecfe0b5b18 Makefile.am: fix spurious CFLAGS duplication 2011-05-30 22:34:06 +02:00
Dan Fandrich
9460896cbe Removed types.h from Android makefile 2011-05-30 13:11:38 -07:00
Daniel Stenberg
a87102c792 configure.ac: skip /dev/urandom check when cross-compiling
Bug: http://curl.haxx.se/bug/view.cgi?id=3307835
2011-05-30 11:59:13 +02:00
Yang Tse
2e7a2027f1 main: fix header inclusion order
Currently, Windows cross-compiled autobuilds require inclusion of setup.h
before curl.h to get definitions of CURL_STATICLIB and BUILDING_LIBCURL.
2011-05-29 18:25:49 +02:00
Yang Tse
ae677edf90 main: fix header inclusion order 2011-05-29 03:56:26 +02:00
Yang Tse
f5d78919af distribution: Fix EXTRA_DIST letter case 2011-05-27 13:37:20 +02:00
Daniel Stenberg
f3d77f772d curl_easy_setopt.3: NOPROGRESS also affects the callback 2011-05-27 11:13:13 +02:00
Yang Tse
7dd449d843 warnless: header inclusion fix 2011-05-27 06:56:56 +02:00
Yang Tse
f461c6e61d Make checksrc.pl work on more out-of-tree builds
Source files given with relative paths do not have the
-D directory specifier prepended.
2011-05-26 19:17:10 +02:00
Yang Tse
3c9ff41a1f compiler warning: fix
Fix compiler warning: conversion may lose significant bits
2011-05-26 15:44:53 +02:00
Yang Tse
c8c8816a97 socks: fix unaligned memory access 2011-05-26 14:53:13 +02:00
Yang Tse
5d39dea3b3 compiler warning: fix
Fix compiler warning: variable was set but never used

Fix compiler warning: clobber ignored
2011-05-26 12:40:04 +02:00
Yang Tse
9f390a356e unit tests: build adjustment
Also define UNITTESTS macro when building unit test sources.

Fixing compiler warning: external definition with no prior declaration
2011-05-25 20:24:03 +02:00
Daniel Stenberg
017ee34bba create_conn: only switch protocol handler if necessary
When switching to HTTP because a HTTP proxy is being used, the existing
handler is now checked if it already is "compatible". This allows the https
handler remain while other non-http handlers will be redirected.

Bug: http://curl.haxx.se/mail/lib-2011-05/0214.html
Reported by: Jerome Robert
2011-05-25 15:57:38 +02:00
Daniel Stenberg
340228cc81 setopt.3: remove leftover style change 2011-05-25 13:51:57 +02:00
Daniel Stenberg
edf282c096 setopt.3: CURLOPT_WRITEFUNCTION had wrong function proto 2011-05-25 13:50:52 +02:00
Yang Tse
a947a9ac62 compiler warning: fix followup
Fix compiler warning: variable was set but never used

Fix compiler warning: clobber ignored
2011-05-25 09:56:57 +02:00
Yang Tse
9b5343054a unit tests: README, adjust header inclusion order 2011-05-24 21:23:52 +02:00
Yang Tse
b735717606 compiler warning: fix
Fix compiler warning: variable was set but never used

Fix compiler warning: clobber ignored
2011-05-24 20:39:58 +02:00
Yang Tse
ec33742d1b compiler warning: fix
Fix compiler warning: external definition with no prior declaration
2011-05-24 17:35:08 +02:00
Yang Tse
2ea31b0e6f compiler warning: fix
Fix compiler warning: external definition with no prior declaration
2011-05-24 17:29:50 +02:00
Yang Tse
de70ddb749 compiler warning: fix
Fix compiler warning: argument is incompatible with corresponding format
string conversion
2011-05-24 17:24:59 +02:00
Yang Tse
a41c7f9736 build: inclusion guard
Enclose header file in an inclusion guard
2011-05-24 15:42:02 +02:00
Yang Tse
512b2f7740 compiler warning: fix
Fix compiler warning: expression has no effect
2011-05-24 15:18:26 +02:00
Yang Tse
8bdc48eddb compiler warning: fix
Fix compiler warning: `keycheck' might be used uninitialized in this function.
Fix compiler warning: `keybit' might be used uninitialized in this function.
2011-05-23 19:37:41 +02:00
Yang Tse
328600e02b compiler warning: fix
Fix variable declaration placement
2011-05-23 19:04:49 +02:00
Yang Tse
e2747ebbc0 compiler warning: fix
Fix missing semicolon
2011-05-23 16:59:43 +02:00
Yang Tse
41ebda02b2 compiler warning: fix
Fix compiler warning: expression has no effect

Fix OOM handling
2011-05-23 16:55:49 +02:00
Yang Tse
30c9799f72 compiler warning: fix
Fix compiler warning: expression has no effect
2011-05-23 16:55:09 +02:00
Yang Tse
bed6b89a2f compiler warning: fix
Fix compiler warning: unused variable 'data'
2011-05-23 12:57:23 +02:00
Yang Tse
3e70c28ce5 compiler warning: fix
Fix compiler warning: enumerated type mixed with another type
2011-05-21 15:06:50 +02:00
Yang Tse
79cc6c244a compiler warning: fix
Fix compiler warning: enumerated type mixed with another type
2011-05-21 14:59:03 +02:00
Yang Tse
d30ddd9977 compiler warning: fix
Fix compiler warning: enumerated type mixed with another type
2011-05-21 14:55:10 +02:00
Yang Tse
8b849265d8 compiler warning: fix
Fix compiler warning: enumerated type mixed with another type
2011-05-21 14:39:42 +02:00
Yang Tse
fce7276f54 compiler warning: fix
Fix compiler warning: enumerated type mixed with another type
2011-05-21 14:10:17 +02:00
Yang Tse
004d84fcc1 compiler warning: fix
Fix compiler warning: empty body in an if-statement
2011-05-21 13:46:37 +02:00
Yang Tse
02f3ff3b0a unit tests: adjust header inclusion order
Additionally, prevent multiple inclusions of curl_config.h
2011-05-21 13:22:11 +02:00
Daniel Stenberg
3f6ffcd26d Merge pull request #19 from pierrejoye/master
winbuild: typo in docs
2011-05-20 14:45:16 -07:00
Ola Mork
3912e7bde3 cyassl: build without filesystem
Get cyassl's NO_FILESYSTEM to work with libcurl. Otherwise I'd get linker
errors for the missing "SSL_CTX_load_verify_locations" functions.
2011-05-20 23:40:59 +02:00
Pierre Joye
488521427f - typo 2011-05-20 13:35:23 +02:00
Daniel Stenberg
e83816bfcf typo: close is in man page section 3 2011-05-19 22:31:04 +02:00
Yang Tse
b578534508 tests: verify OPEN/CLOSESOCKETFUNCTION
Test 585: Fix opensocket return type, and avoid function name clash.
2011-05-19 22:28:28 +02:00
Yang Tse
5db30a1d8c version: linkage fix
Fix linkage on c-ares enabled Windows static builds
2011-05-19 11:50:20 +02:00
Daniel Stenberg
664ff30650 curl_easy_setopt.3: document CLOSESOCKET* options 2011-05-18 22:56:46 +02:00
Daniel Stenberg
873d70a6d8 tests: verify OPEN/CLOSESOCKETFUNCTION
Test 585 and 586 were added. Using a modified lib500.c
2011-05-18 22:56:46 +02:00
Daniel Stenberg
6dfa16c3c4 symbols-in-versions: add CLOSESOCKET* 2011-05-18 22:56:46 +02:00
Daniel Stenberg
60f0ebbdc9 CLOSESOCKETFUNCTION: use the callback
Fix the return type of the callback to match close() and make use of it.
2011-05-18 22:56:46 +02:00
Daniel Stenberg
b5d170b551 CLOSESOCKETFUNCTION: added
Introduced the initial setup to allow closesocket callbacks by making
sure sclose() is only ever called from one place in the libcurl source
and still run all test cases fine.
2011-05-18 22:56:46 +02:00
Daniel Stenberg
d4e000906a GnuTLS handshake: fix timeout
Commit cbf4961bf3 garbled the timeout handling while doing SSL
handshaking (in an attempt at fixing another bug). This puts sanity
back.

Bug: http://curl.haxx.se/mail/lib-2011-05/0167.html
Reported by: Ethan Glasser Camp
2011-05-18 20:48:42 +02:00
Daniel Stenberg
bb7ff942d3 checksrc: trailing whitespace detection fix 2011-05-16 15:21:32 +02:00
Marcel Roelofs
48a40f0402 negotiate sspi: fix sequential requests 2011-05-16 15:21:32 +02:00
Daniel Stenberg
0c8e6f598a tests: added HTTP If-Modified-Since tests
Added test 1126 and 1127 to verify curl's behaviour when If-Modified-Since
is used and a 200 is returned.

The list of test cases in Makefile.am is now sorted numerically.
2011-05-13 08:55:15 +02:00
Daniel Stenberg
2ef7a28a71 include: cleanup
Made the public headers checksrc compliant

Removed types.h (it's been unused since April 2004)

Made the root makefile do make in include by default as well, so that
TAGS and the checksrc will work better.
2011-05-09 10:20:31 +02:00
Dan Fandrich
2a02c07a15 Fixed compilation when RTSP is disabled 2011-05-06 13:48:59 -07:00
Dan Fandrich
212d8c8f65 Fixed LDAP after RTSP readwrite change 2011-05-06 13:48:24 -07:00
Daniel Stenberg
b996b202c4 RELEASE-NOTES: synced with 32001ac414 2011-05-06 11:26:37 +02:00
Daniel Stenberg
32001ac414 set_userpass: convert from protocol-specific to generic
The protocol handler's flags field now can set that the protocol
requires a password, so that the set_userpass function doesn't have to
have the specific knowledge of which protocols that do.
2011-05-05 17:07:21 +02:00
Daniel Stenberg
9c629e5348 RTSP: cleanups
Made several functions static

Made one function defined to nothing when RTSP is disabled to avoid
the #ifdefs in code.

Removed explicit rtsp.h includes
2011-05-05 16:53:05 +02:00
Daniel Stenberg
f0612f166a RTSP: convert protocol-specific checks to generic
Add a 'readwrite' function to the protocol handler struct and use that
for the extra readwrite functionality RTSP needs.
2011-05-05 16:27:03 +02:00
Daniel Stenberg
e34131db78 SSL: check for SSL, not specific protocols
Code cleanup to check less for protocols and more for the specific
relevant feature. Like if SSL is required.
2011-05-05 15:49:43 +02:00
Daniel Stenberg
335dfa793c http_perhapsrewind: remove HTTP check
No need to check for HTTP as this is now a HTTP-specific function
2011-05-05 15:38:01 +02:00
Daniel Stenberg
574aecee20 http_perhapsrewind:
make it static, remove Curl_ prefix
2011-05-05 15:18:31 +02:00
Daniel Stenberg
51075a6777 remove FILE protocol-specific checks
Also, convert the BANPROXY flag into NONETWORK for the protocols
(file:// only atm) that don't work over networks.
2011-05-05 15:14:19 +02:00
Daniel Stenberg
4508ea103f curl.1: --socks* options no longer needed
As we now can specify all the socks proxy types with the regular --proxy
option using protocol prefix.
2011-05-05 11:54:58 +02:00
Daniel Stenberg
558f997e99 socks proxy: allow socks5h:// prefix too
Using 'socks5h' as proxy protocol will make it a
CURLPROXY_SOCKS5_HOSTNAME proxy which is SOCKS5 and asking the proxy to
resolve host names. I found no "standard" protocol name for this.
2011-05-05 11:47:55 +02:00
Daniel Stenberg
fda0985bfd curl.1: minor edit of --ftp-ssl* 2011-05-05 11:28:03 +02:00
Jari Aalto
93ec4555ff curl.1: use GNU style and sort options
Follow style of GNU layout (cp, mv ...) where options are separated with
comma: -o, --option

Order item alphabetically (by length also): -o, -O, --option

Follow style of GNU layout by moving help related options to the end:
--help, -M, --version
2011-05-05 11:26:12 +02:00
Daniel Stenberg
61877b569f Corrected comments
closepolicy has been deprecated and unused for years
2011-05-05 00:02:39 +02:00
Daniel Stenberg
dc15a88076 ConnectionStore: remove unused return code 2011-05-04 23:56:18 +02:00
Daniel Stenberg
adae5926dd indent correctly 2011-05-04 23:45:30 +02:00
Daniel Stenberg
ade337d79e curl_easy_getinfo.3: clarify some timing info 2011-05-03 22:47:56 +02:00
Daniel Stenberg
365db94e0a curl_easy_setopt.3: clarify the SSH KEYFILE options usage
The internal defaults are important info
2011-05-02 23:33:03 +02:00
Daniel Stenberg
d4ebf3c6b0 docs: mention the protocol:// support in proxy strings 2011-05-02 22:15:14 +02:00
Daniel Stenberg
f78fa6a57d --data-ascii: add mention
As it is a separate option it should have a .IP title
2011-05-02 14:40:17 +02:00
Daniel Stenberg
038a631274 url encode docs: mention '-', '.', '_' and '~'
Clarify that the '-', '.', '_' or '~' letters are also not escaped since
they shouldn't according to RFC3986 section 2.3.

This is how this function has behaved since sep 2010, commit
5df13c3173.
2011-05-02 11:14:30 +02:00
Daniel Stenberg
7d94af497d SSH: set non-blocking earlier
Introduce an INIT state for the SSH state machine and set libssh2
non-blocking in that so that it is set properly before
libssh2_session_startup() is called.

Bug: http://curl.haxx.se/mail/archive-2011-05/0001.html
2011-05-01 23:02:39 +02:00
Daniel Stenberg
a490961b10 curl_formfree.3: mention argument may be NULL
As the code already checks for it we can just as well make it official!
2011-04-30 18:49:35 +02:00
Daniel Stenberg
821301de15 ConnectionExists: avoid NULL dereference
When checking for connections that are bound to a particular device we
must make sure we don't compare with a NULL pointer.
2011-04-29 16:46:49 +02:00
Daniel Stenberg
3440f4d374 resolver_error: remove bad semicolon 2011-04-29 16:33:45 +02:00
Daniel Stenberg
f83c36934f RELEASE-NOTES: synced with c4bc1d473f 2011-04-28 22:23:11 +02:00
Daniel Stenberg
c4bc1d473f anyauthput.c: stdint.h must not be included unconditionally
As it is already included by curlbuild.h if it exists on the platform it
was included here superfluously anyway.

Reported by: Dagobert Michelsen
Bug: http://curl.haxx.se/bug/view.cgi?id=3294509
2011-04-28 22:14:05 +02:00
Daniel Stenberg
5b7e1f9efe gai_strerror: provide private implementation
There are systems (like NetWare) without its own gai_strerror()
function.
2011-04-28 15:25:03 +02:00
Daniel Stenberg
c33aee1667 treaded-resolver: better error messages
Now use gai_strerror() to get proper error messages when getaddrinfo()
has failed. Detect the function in configure.

Code based on work and suggestions by Jeff Pohlmeyer and Guenter Knauf
2011-04-28 15:25:03 +02:00
Daniel Stenberg
3b1b26578f proxy: allow socks:// prefix in proxy string
Inspired by a patch from OB.Conseil. Added test case 708 to verify.
2011-04-28 15:08:09 +02:00
Zmey Petroff
2cbe885c1a CMake: improve library search, implement install.
Improved library search by check_function_exists_concat() macro:
it does not revert the list of libraries any more.

Improved OpenSSL library search: first find zlib, then search for
openssl libraries that may depend on zlib.

For Unix: openssl libraries can now be detected in nonstandard
locations. Supply CMAKE_LIBRARY_PATH to CMake on command line.

Added installation capability (very basic one yet).
2011-04-28 10:12:33 +02:00
Daniel Stenberg
4a42e5cdaa multi-socks: fix connect to proxy
When connecting to a socks or similar proxy we do the proxy handshake at
once when we know the TCP connect is completed and we only consider the
"connection" complete after the proxy handshake. This fixes test 564
which is now no longer considered disabled.

Reported by: Dmitri Shubin
Bug: http://curl.haxx.se/mail/lib-2011-04/0127.html
2011-04-28 10:06:49 +02:00
Daniel Stenberg
53ef3493bf cleanup: remove old unused debug code 2011-04-28 09:21:20 +02:00
Dan Fandrich
cbd98b2c28 Make checksrc.pl work on out-of-tree builds
Source files given with absolute paths do not have the
-D directory specifier prepended.
2011-04-27 12:42:15 -07:00
Daniel Stenberg
4685db9462 make: add checksrc.pl to dist 2011-04-27 11:42:02 +02:00
Daniel Stenberg
45de057920 make: add 'checksrc' as target to check code style
The make target checksrc now works in the root makefile and in both the
src and lib directories.

It is also run automatically on "all" if configure --enable-debug was
used.
2011-04-27 10:23:27 +02:00
Daniel Stenberg
aa87f0ab15 checksrc: whitespace and code style cleanup
Make everything adhere to the standards upheld by checksrc.pl and now
run checksrc from the makefile on debug builds.
2011-04-27 09:09:35 +02:00
Daniel Stenberg
6a6981503e checksrc: add -W to allow a file to be whitelisted
Useful when a known file just doesn't comply and there's no intention to
make it do so.
2011-04-27 09:09:35 +02:00
Daniel Stenberg
889d1e973f whitespace cleanup: no space first in conditionals
"if(a)" is our style, not "if( a )"
2011-04-27 09:09:35 +02:00
Daniel Stenberg
1b758b01c1 lib/make: run checksrc.pl once for all files
Since it now supports multiple files this will be faster and will show
problems for more file than one at a time - more convenient.
2011-04-27 09:09:35 +02:00
Daniel Stenberg
7ddcc8fea4 checksrc: scan many files, more checks
It now scans multiple files and outputs an error+warning count summary
at the end in case at least one was detected.

-D can be used to specify in which dir the files are located

The script now scans for conditions that starts with a space for
if/while/for lines.
2011-04-27 09:09:35 +02:00
Daniel Stenberg
068d656c6d Makefile: run checksrc if debug enabled
And make the build fail if a warning or error was detected
2011-04-27 09:09:35 +02:00
Daniel Stenberg
92f722017c checksrc: exit error code if warnings or errors 2011-04-27 09:09:35 +02:00
Daniel Stenberg
9869668884 SSH: move knownhost logic to separate function 2011-04-27 09:09:35 +02:00
Daniel Stenberg
b903186fa0 source cleanup: unify look, style and indent levels
By the use of a the new lib/checksrc.pl script that checks that our
basic source style rules are followed.
2011-04-27 09:09:35 +02:00
Guenter Knauf
592eda8e3f Windows native IDN fixes.
For now provide prototypes instead of including the
non-standard normalisation.h which is only available in the
"Internationalized Domain Names Mitigation APIs" download.
2011-04-27 03:53:03 +02:00
Dan Fandrich
6d013b0aab Fixed compiler warning in Windows SSPI case 2011-04-25 21:58:37 -07:00
Dan Fandrich
bcc29cda8e Fixed compilation when the synchronous resolver is used 2011-04-25 19:01:40 -07:00
Dan Fandrich
4235457129 Added new resolver sources to Symbian and VC6 build files 2011-04-25 18:07:32 -07:00
Daniel Stenberg
e9542ccab6 hostip: comment fixed to state current situation 2011-04-25 19:50:56 +02:00
Daniel Stenberg
7de2f9271c async resolvers: further cleanups
asyn-ares.c and asyn-thread.c are two separate backends that implement
the same (internal) async resolver API for libcurl to use. Backend is
specified at build time.

The internal resolver API is defined in asyn.h for asynch resolvers.
2011-04-25 19:47:16 +02:00
Daniel Stenberg
24d84da073 asynch resolvers: cleanup
Fixed indents, coding conventions and white space edits.

Modified the c-ares completion callback function to again NOT read the
conn data when the ares handle is being taken down as then it may have
been freed already.
2011-04-25 19:47:16 +02:00
Vsevolod Novikov
ca015f1a45 asynch resolvers: unified
Introducing an internal API for handling of different async resolver
backends.
2011-04-25 19:47:16 +02:00
Guenter Knauf
722f286f80 Enabled OpenWatcom native Windows IDN build.
For now we directly import the Idn* symbols with the linker;
an upcoming release of OWC will have these added to the import
lib normaliz.lib, and prototypes are added to winnnls.h.
2011-04-24 18:58:07 +02:00
Daniel Stenberg
f20b4606de NTLM: work with unicode
Rewritten code from a patch brought by Matteo Rocco.
2011-04-22 22:04:10 +02:00
Daniel Stenberg
c985a8df51 bump version: work towards 7.21.7 2011-04-22 22:02:55 +02:00
Daniel Stenberg
a0fad3017e THANKS: contributors from 7.21.6 2011-04-22 22:02:33 +02:00
Daniel Stenberg
2a05025510 RELEASE-NOTES: two more contributors 2011-04-22 19:17:26 +02:00
Dan Fandrich
d8373cb992 Fixed test 1023 when using daily snapshots 2011-04-21 14:47:35 -07:00
Dan Fandrich
17df5d8caa Include unistd.h to declare close() 2011-04-21 14:47:07 -07:00
Fabian Keil
210278d9a1 In lib/, change 'wanna' to 'want to'.
Found with codespell.
2011-04-21 07:55:53 -07:00
Fabian Keil
5942362847 Fix spelling errors in buildconf
Found with codespell.
2011-04-21 07:55:53 -07:00
Fabian Keil
7d86e467fa Fix spelling errors in src/
Found with codespell.
2011-04-21 07:55:53 -07:00
Fabian Keil
7609b32e7c Fix spelling errors in include/ 2011-04-21 07:55:53 -07:00
Fabian Keil
1702a2c08d Fix a couple of spelling errors in lib/
Found with codespell.
2011-04-21 07:55:53 -07:00
Julien Chaffraix
9230be0797 transfer.c: Fixed indentation in readwrite_data. 2011-04-21 07:55:53 -07:00
Dan Fandrich
7872c8d5a2 Fixed closing test tag 2011-04-20 16:51:44 -07:00
Daniel Stenberg
37b9fe104a RELEASE-NOTES: synced with 3242abd87a 2011-04-20 23:59:36 +02:00
Daniel Stenberg
3242abd87a SFTP: close file before postquote
Make sure that files are closed before the post quote commands run as if
they operate on the just transferred file they could otherwise easily
fail.

Patch by: Rajesh Naganathan (edited)
2011-04-20 23:37:29 +02:00
Dan Fandrich
1b6df743f6 Fixed test 1022 when using daily snapshots 2011-04-20 14:11:12 -07:00
Daniel Stenberg
c2c8948190 Curl_http_connect: detect HTTPS properly after CONNECT
libcurl failed to check the correct struct for HTTPS after CONNECT was
issued to the proxy, so it didn't do the TLS handshake and subsequently
failed the connection. A regression released in 7.21.5 (introduced
around commit 8831000bc0).

Bug: http://curl.haxx.se/mail/lib-2011-04/0134.html
Reported by: Josue Andrade Gomes
2011-04-20 22:50:04 +02:00
Daniel Stenberg
c6a0abdd97 curl_easy_setopt.3: CURLOPT_PROXYTYPE clarification
When set to a HTTP 1.0 proxy, that only affects the CONNECT request and
not the regular HTTP request.
2011-04-20 15:42:23 +02:00
Gisle Vanem
9039d19f01 CURL_DOES_CONVERSIONS: fixes
Made it compile and work again after the code move.
2011-04-20 15:23:57 +02:00
Daniel Stenberg
c828646f60 CURL_DOES_CONVERSIONS: cleanup
Massively reduce #ifdefs all over (23 #ifdef lines less so far)
Moved conversion-specific code to non-ascii.c
2011-04-20 00:50:07 +02:00
Guenter Knauf
eb65a49bef Improve MinGW static makefile builds.
It is now possible to use any combination of features without
having to 1st add makefile targets to the main makefile. The
main makefile now passes the 'mingw32-feat1-feat2' as var CFG,
and the ./[lib|src]/Makefile.m32 parses the CFG var to determine
the features to be enabled.
2011-04-19 20:59:24 +02:00
Guenter Knauf
b2140a09f8 Enabled MinGW native Windows IDN build. 2011-04-19 17:28:28 +02:00
Guenter Knauf
519bec7c91 Windows native IDN fixes.
changed windows.h include to system header;
changed obsolete 2nd check for str_w to str_utf8 in order to catch
malloc() failure and avoid a free(NULL);
changed calls to GetLastError() to void to kill unsused var compiler
warnings;
moved one call to GetLastError() into else case so that its only
called when WideCharToMultiByte() really fails.
2011-04-19 17:13:09 +02:00
Guenter Knauf
24e5a40156 Windows native IDN fixes.
Provide prototype for curl_win32_idn_to_ascii();
remove wrong 3rd parameter from curl_win32_idn_to_ascii() call.
2011-04-19 16:48:32 +02:00
Daniel Stenberg
2d1b6242f2 curl-config: fix version output
do the s/VERSION/CURLVERSION replacement for the human redable output
for --checkfor

Reported by: Ryan Schmidt
2011-04-19 16:41:34 +02:00
Daniel Stenberg
a5db4a46ac RELEASE-NOTES: synced with 5aae3c13e2 2011-04-19 16:40:24 +02:00
Guenter Knauf
65aadf2118 Updated default (recommended) dependency versions. 2011-04-19 14:32:08 +02:00
Guenter Knauf
24667466f0 Updated default (recommended) dependency versions. 2011-04-19 14:26:51 +02:00
Daniel Stenberg
5aae3c13e2 transfer-encoding: document the options
The new libcurl and command line options are now described.
2011-04-18 19:46:21 +02:00
Daniel Stenberg
8e4fb01e64 transfer-encoding: added new option and cmdline
Added CURLOPT_TRANSFER_ENCODING as the option to set to request Transfer
Encoding in HTTP requests (if built zlib enabled). I also renamed
CURLOPT_ENCODING to CURLOPT_ACCEPT_ENCODING (while keeping the old name
around) to reduce the confusion when we have to encoding options for
HTTP.

--tr-encoding is now the new command line option for curl to request
this, and thus I updated the test cases accordingly.
2011-04-18 19:46:21 +02:00
Daniel Stenberg
ebb37eac8b CURLE_BAD_CONTENT_ENCODING: now used for transfer encoding too 2011-04-18 19:46:21 +02:00
Daniel Stenberg
9d191a6a40 TE: do the Connection: header
When TE: is inserted in the request, we must add a "Connection: TE" as
well to be HTTP 1.1 compliant. If a custom Connection: header is passed
in, we must use that and only append TE to it. Test case 1125 verifies
TE: + custom Connection:.
2011-04-18 19:46:21 +02:00
Daniel Stenberg
be973b6f91 test1124: verify gzip AND chunked transfer-encoding 2011-04-18 19:46:21 +02:00
Daniel Stenberg
2db6f7e703 TE: rename struct field content_encoding
Since this struct member is used in the code to determine what and how
to decode automatically and since it is now also used for compressed
Transfer-Encodings, I renamed it to the more suitable 'auto_decoding'
2011-04-18 19:46:21 +02:00
Daniel Stenberg
0790b27910 HTTP: add support for gzip and deflate Transfer-Encoding
Transfer-Encoding differs from Content-Encoding in a few subtle ways,
but primarily it concerns the transfer only and not the content so when
discovered to be compressed we know we have to uncompress it. There will
only arrive compressed transfers in a response after we have requested
them with the appropriate TE: header.

Test case 1122 and 1123 verify.
2011-04-18 19:46:21 +02:00
Patrick Monnerat
e80b957789 OS400 pragma comment: replace (date) by (user, __DATE__) to include year. 2011-04-18 16:52:27 +02:00
Patrick Monnerat
213939c8ba Augment RPG binding with "OLDIES" definitions.
Fix OS400 LDAP wrappers: strings were non null-terminated.
2011-04-18 15:54:45 +02:00
Daniel Stenberg
82ecc85d9e curl-config: fix --version
curl-config --version didn't output the correct version string (bug
introduced in commit 0355e33b5f), and unfortunately the test
case 1022 that was supposed to check for this was broken.

This change fixes the test to detect this problem and it fixes the
output.

Bug: http://curl.haxx.se/bug/view.cgi?id=3288727
2011-04-18 09:03:12 +02:00
Daniel Stenberg
84f809e7a8 RELEASE-NOTES: updated contributor amount 2011-04-17 23:48:50 +02:00
Daniel Stenberg
cae351e9f5 THANKS: 11 new contributors from 7.21.5 2011-04-17 23:46:21 +02:00
Daniel Stenberg
909acfbbba 7.21.6: next planned release number 2011-04-17 23:44:24 +02:00
619 changed files with 41623 additions and 20580 deletions

1
.gitignore vendored
View File

@@ -14,6 +14,7 @@ Makefile
Makefile.in Makefile.in
aclocal.m4 aclocal.m4
autom4te.cache autom4te.cache
config.cache
config.guess config.guess
config.log config.log
config.status config.status

View File

@@ -2,7 +2,7 @@
# #
# Place the curl source (including this makefile) into external/curl/ in the # Place the curl source (including this makefile) into external/curl/ in the
# Android source tree. Then build them with 'make curl' or just 'make libcurl' # Android source tree. Then build them with 'make curl' or just 'make libcurl'
# from the Android root. Tested with Android 1.5 and 2.1 # from the Android root. Tested with Android versions 1.5, 2.1-2.3
# #
# Note: you must first create a curl_config.h file by running configure in the # Note: you must first create a curl_config.h file by running configure in the
# Android environment. The only way I've found to do this is tricky. Perform a # Android environment. The only way I've found to do this is tricky. Perform a
@@ -42,7 +42,7 @@
# into the right place (but see the note about this below). # into the right place (but see the note about this below).
# #
# Dan Fandrich # Dan Fandrich
# August 2010 # November 2011
LOCAL_PATH:= $(call my-dir) LOCAL_PATH:= $(call my-dir)
@@ -62,8 +62,7 @@ CURL_HEADERS := \
mprintf.h \ mprintf.h \
multi.h \ multi.h \
stdcheaders.h \ stdcheaders.h \
typecheck-gcc.h \ typecheck-gcc.h
types.h
LOCAL_SRC_FILES := $(addprefix lib/,$(CSOURCES)) LOCAL_SRC_FILES := $(addprefix lib/,$(CSOURCES))
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include/ LOCAL_C_INCLUDES += $(LOCAL_PATH)/include/
@@ -73,6 +72,7 @@ LOCAL_COPY_HEADERS_TO := libcurl/curl
LOCAL_COPY_HEADERS := $(addprefix include/curl/,$(CURL_HEADERS)) LOCAL_COPY_HEADERS := $(addprefix include/curl/,$(CURL_HEADERS))
LOCAL_MODULE:= libcurl LOCAL_MODULE:= libcurl
LOCAL_MODULE_TAGS := optional
# Copy the licence to a place where Android will find it. # Copy the licence to a place where Android will find it.
# Actually, this doesn't quite work because the build system searches # Actually, this doesn't quite work because the build system searches
@@ -93,6 +93,7 @@ include $(LOCAL_PATH)/src/Makefile.inc
LOCAL_SRC_FILES := $(addprefix src/,$(CURL_CFILES)) LOCAL_SRC_FILES := $(addprefix src/,$(CURL_CFILES))
LOCAL_MODULE := curl LOCAL_MODULE := curl
LOCAL_MODULE_TAGS := optional
LOCAL_STATIC_LIBRARIES := libcurl LOCAL_STATIC_LIBRARIES := libcurl
LOCAL_SYSTEM_SHARED_LIBRARIES := libc LOCAL_SYSTEM_SHARED_LIBRARIES := libc

0
CMake/FindCARES.cmake Executable file → Normal file
View File

View File

@@ -23,7 +23,6 @@ include(Utilities)
project( CURL C ) project( CURL C )
file (READ ${CURL_SOURCE_DIR}/include/curl/curlver.h CURL_VERSION_H_CONTENTS) file (READ ${CURL_SOURCE_DIR}/include/curl/curlver.h CURL_VERSION_H_CONTENTS)
string (REGEX MATCH "LIBCURL_VERSION_MAJOR[ \t]+([0-9]+)" string (REGEX MATCH "LIBCURL_VERSION_MAJOR[ \t]+([0-9]+)"
LIBCURL_VERSION_MJ ${CURL_VERSION_H_CONTENTS}) LIBCURL_VERSION_MJ ${CURL_VERSION_H_CONTENTS})
@@ -58,10 +57,6 @@ set(OS "\"${CMAKE_SYSTEM_NAME}\"")
include_directories(${PROJECT_BINARY_DIR}/include/curl) include_directories(${PROJECT_BINARY_DIR}/include/curl)
include_directories( ${CURL_SOURCE_DIR}/include ) include_directories( ${CURL_SOURCE_DIR}/include )
if(WIN32)
set(NATIVE_WINDOWS ON)
endif()
option(BUILD_CURL_EXE "Set to ON to build cURL executable." ON) option(BUILD_CURL_EXE "Set to ON to build cURL executable." ON)
option(BUILD_CURL_TESTS "Set to ON to build cURL tests." ON) option(BUILD_CURL_TESTS "Set to ON to build cURL tests." ON)
option(CURL_STATICLIB "Set to ON to build libcurl with static linking." OFF) option(CURL_STATICLIB "Set to ON to build libcurl with static linking." OFF)
@@ -114,22 +109,11 @@ mark_as_advanced(CURL_DISABLE_HTTP)
option(CURL_DISABLE_LDAPS "to disable LDAPS" OFF) option(CURL_DISABLE_LDAPS "to disable LDAPS" OFF)
mark_as_advanced(CURL_DISABLE_LDAPS) mark_as_advanced(CURL_DISABLE_LDAPS)
if(WIN32)
set(CURL_DEFAULT_DISABLE_LDAP OFF)
# some windows compilers do not have wldap32
if( NOT HAVE_WLDAP32)
set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE)
message(STATUS "wldap32 not found CURL_DISABLE_LDAP set ON")
option(CURL_LDAP_WIN "Use Windows LDAP implementation" OFF)
else()
option(CURL_LDAP_WIN "Use Windows LDAP implementation" ON)
endif()
mark_as_advanced(CURL_LDAP_WIN)
endif()
if(HTTP_ONLY) if(HTTP_ONLY)
set(CURL_DISABLE_FTP ON) set(CURL_DISABLE_FTP ON)
set(CURL_DISABLE_LDAP ON) set(CURL_DISABLE_LDAP ON)
set(CURL_DISABLE_LDAPS ON)
set(CURL_DISABLE_TELNET ON) set(CURL_DISABLE_TELNET ON)
set(CURL_DISABLE_DICT ON) set(CURL_DISABLE_DICT ON)
set(CURL_DISABLE_FILE ON) set(CURL_DISABLE_FILE ON)
@@ -149,6 +133,8 @@ option(ENABLE_IPV6 "Define if you want to enable IPv6 support" OFF)
mark_as_advanced(ENABLE_IPV6) mark_as_advanced(ENABLE_IPV6)
if(WIN32) if(WIN32)
# Windows standard libraries are located in C:/Program Files/Microsoft SDKs/[...]
# They are already included in the default MSVC LIBPATH => no find_library is needed!
list_spaces_append_once(CMAKE_C_STANDARD_LIBRARIES wsock32.lib ws2_32.lib) # bufferoverflowu.lib list_spaces_append_once(CMAKE_C_STANDARD_LIBRARIES wsock32.lib ws2_32.lib) # bufferoverflowu.lib
if(CURL_DISABLE_LDAP) if(CURL_DISABLE_LDAP)
# Remove wldap32.lib from space-separated list # Remove wldap32.lib from space-separated list
@@ -191,12 +177,12 @@ if(WIN32)
endif(WIN32) endif(WIN32)
# This macro checks if the symbol exists in the library and if it # This macro checks if the symbol exists in the library and if it
# does, it appends library to the list. # does, it prepends library to the list.
macro(CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE) macro(CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE)
check_library_exists("${LIBRARY};${CURL_LIBS}" ${SYMBOL} "" check_library_exists("${LIBRARY};${CURL_LIBS}" ${SYMBOL} "${CMAKE_LIBRARY_PATH}"
${VARIABLE}) ${VARIABLE})
if(${VARIABLE}) if(${VARIABLE})
set(CURL_LIBS ${CURL_LIBS} ${LIBRARY}) set(CURL_LIBS ${LIBRARY} ${CURL_LIBS})
endif(${VARIABLE}) endif(${VARIABLE})
endmacro(CHECK_LIBRARY_EXISTS_CONCAT) endmacro(CHECK_LIBRARY_EXISTS_CONCAT)
@@ -220,29 +206,24 @@ check_library_exists_concat("ws2_32" getch HAVE_LIBWS2_32)
check_library_exists_concat("winmm" getch HAVE_LIBWINMM) check_library_exists_concat("winmm" getch HAVE_LIBWINMM)
check_library_exists("wldap32" cldap_open "" HAVE_WLDAP32) check_library_exists("wldap32" cldap_open "" HAVE_WLDAP32)
if(WIN32)
set(CURL_DEFAULT_DISABLE_LDAP OFF)
# some windows compilers do not have wldap32
if(NOT HAVE_WLDAP32)
set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE)
message(STATUS "wldap32 not found CURL_DISABLE_LDAP set ON")
option(CURL_LDAP_WIN "Use Windows LDAP implementation" OFF)
else()
option(CURL_LDAP_WIN "Use Windows LDAP implementation" ON)
endif()
mark_as_advanced(CURL_LDAP_WIN)
endif()
# IF(NOT CURL_SPECIAL_LIBZ) # IF(NOT CURL_SPECIAL_LIBZ)
# CHECK_LIBRARY_EXISTS_CONCAT("z" inflateEnd HAVE_LIBZ) # CHECK_LIBRARY_EXISTS_CONCAT("z" inflateEnd HAVE_LIBZ)
# ENDIF(NOT CURL_SPECIAL_LIBZ) # ENDIF(NOT CURL_SPECIAL_LIBZ)
option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ON)
mark_as_advanced(CMAKE_USE_OPENSSL)
if(CMAKE_USE_OPENSSL)
if(WIN32)
find_package(OpenSSL)
if(OPENSSL_FOUND)
set(USE_SSLEAY TRUE)
set(USE_OPENSSL TRUE)
list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES} )
else()
set(CMAKE_USE_OPENSSL FALSE)
message(STATUS "OpenSSL NOT Found, disabling CMAKE_USE_OPENSSL")
endif()
else(WIN32)
check_library_exists_concat("crypto" CRYPTO_lock HAVE_LIBCRYPTO)
check_library_exists_concat("ssl" SSL_connect HAVE_LIBSSL)
endif(WIN32)
endif(CMAKE_USE_OPENSSL)
# Check for idn # Check for idn
check_library_exists_concat("idn" idna_to_ascii_lz HAVE_LIBIDN) check_library_exists_concat("idn" idna_to_ascii_lz HAVE_LIBIDN)
@@ -271,6 +252,25 @@ if(CURL_ZLIB) # AND CURL_CONFIG_HAS_BEEN_RUN_BEFORE
endif() endif()
endif() endif()
option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ON)
mark_as_advanced(CMAKE_USE_OPENSSL)
if(CMAKE_USE_OPENSSL)
if(WIN32)
find_package(OpenSSL)
if(OPENSSL_FOUND)
set(USE_SSLEAY TRUE)
set(USE_OPENSSL TRUE)
list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES} )
else()
set(CMAKE_USE_OPENSSL FALSE)
message(STATUS "OpenSSL NOT Found, disabling CMAKE_USE_OPENSSL")
endif()
else(WIN32)
check_library_exists_concat("crypto" CRYPTO_lock HAVE_LIBCRYPTO)
check_library_exists_concat("ssl" SSL_connect HAVE_LIBSSL)
endif(WIN32)
endif(CMAKE_USE_OPENSSL)
# If we have features.h, then do the _BSD_SOURCE magic # If we have features.h, then do the _BSD_SOURCE magic
check_include_file("features.h" HAVE_FEATURES_H) check_include_file("features.h" HAVE_FEATURES_H)
@@ -386,6 +386,13 @@ if(NOT HAVE_LDAP_H)
set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE) set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE)
endif() endif()
# No ldap, no ldaps.
if(CURL_DISABLE_LDAP)
if(NOT CURL_DISABLE_LDAPS)
message(STATUS "LDAP needs to be enabled to support LDAPS")
set(CURL_DISABLE_LDAPS ON CACHE BOOL "" FORCE)
endif()
endif()
check_type_size(size_t SIZEOF_SIZE_T) check_type_size(size_t SIZEOF_SIZE_T)
check_type_size(ssize_t SIZEOF_SSIZE_T) check_type_size(ssize_t SIZEOF_SSIZE_T)
@@ -425,7 +432,7 @@ if(SIZEOF_LONG EQUAL 8)
set(CURL_FORMAT_CURL_OFF_TU "lu") set(CURL_FORMAT_CURL_OFF_TU "lu")
set(CURL_FORMAT_OFF_T "%ld") set(CURL_FORMAT_OFF_T "%ld")
set(CURL_SUFFIX_CURL_OFF_T L) set(CURL_SUFFIX_CURL_OFF_T L)
set(CURL_SUFFIX_CURL_OFF_TU LU) set(CURL_SUFFIX_CURL_OFF_TU UL)
endif(SIZEOF_LONG EQUAL 8) endif(SIZEOF_LONG EQUAL 8)
if(SIZEOF_LONG_LONG EQUAL 8) if(SIZEOF_LONG_LONG EQUAL 8)
@@ -435,7 +442,7 @@ if(SIZEOF_LONG_LONG EQUAL 8)
set(CURL_FORMAT_CURL_OFF_TU "llu") set(CURL_FORMAT_CURL_OFF_TU "llu")
set(CURL_FORMAT_OFF_T "%lld") set(CURL_FORMAT_OFF_T "%lld")
set(CURL_SUFFIX_CURL_OFF_T LL) set(CURL_SUFFIX_CURL_OFF_T LL)
set(CURL_SUFFIX_CURL_OFF_TU LLU) set(CURL_SUFFIX_CURL_OFF_TU ULL)
endif(SIZEOF_LONG_LONG EQUAL 8) endif(SIZEOF_LONG_LONG EQUAL 8)
if(NOT CURL_TYPEOF_CURL_OFF_T) if(NOT CURL_TYPEOF_CURL_OFF_T)
@@ -852,3 +859,13 @@ endif()
if(NOT CURL_CONFIG_HAS_BEEN_RUN_BEFORE) if(NOT CURL_CONFIG_HAS_BEEN_RUN_BEFORE)
set(CURL_CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before") set(CURL_CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before")
endif() endif()
# Installation.
# First, install generated curlbuild.h
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/include/curl/curlbuild.h"
DESTINATION include/curl )
# Next, install other headers excluding curlbuild.h
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/curl"
DESTINATION include
FILES_MATCHING PATTERN "*.h"
PATTERN "curlbuild.h" EXCLUDE)

View File

@@ -1,6 +1,6 @@
COPYRIGHT AND PERMISSION NOTICE COPYRIGHT AND PERMISSION NOTICE
Copyright (c) 1996 - 2011, Daniel Stenberg, <daniel@haxx.se>. Copyright (c) 1996 - 2012, Daniel Stenberg, <daniel@haxx.se>.
All rights reserved. All rights reserved.

View File

@@ -36,12 +36,12 @@ winbuild/MakefileBuild.vc winbuild/Makefile.vc
EXTRA_DIST = CHANGES COPYING maketgz Makefile.dist curl-config.in \ EXTRA_DIST = CHANGES COPYING maketgz Makefile.dist curl-config.in \
curl-style.el sample.emacs RELEASE-NOTES buildconf \ curl-style.el sample.emacs RELEASE-NOTES buildconf \
libcurl.pc.in vc6curl.dsw MacOSX-Framework Android.mk $(CMAKE_DIST) \ libcurl.pc.in vc6curl.dsw MacOSX-Framework Android.mk $(CMAKE_DIST) \
Makefile.msvc.names $(WINBUILD_DIST) Makefile.msvc.names $(WINBUILD_DIST) lib/libcurl.vers.in
bin_SCRIPTS = curl-config bin_SCRIPTS = curl-config
SUBDIRS = lib src SUBDIRS = lib src include
DIST_SUBDIRS = $(SUBDIRS) tests include packages docs DIST_SUBDIRS = $(SUBDIRS) tests packages docs
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libcurl.pc pkgconfig_DATA = libcurl.pc
@@ -155,3 +155,7 @@ ca-bundle: lib/mk-ca-bundle.pl
ca-firefox: lib/firefox-db2pem.sh ca-firefox: lib/firefox-db2pem.sh
@echo "generate a fresh ca-bundle.crt" @echo "generate a fresh ca-bundle.crt"
./lib/firefox-db2pem.sh lib/ca-bundle.crt ./lib/firefox-db2pem.sh lib/ca-bundle.crt
checksrc:
cd lib && $(MAKE) checksrc
cd src && $(MAKE) checksrc

View File

@@ -70,29 +70,22 @@ mingw32:
$(MAKE) -C lib -f Makefile.m32 $(MAKE) -C lib -f Makefile.m32
$(MAKE) -C src -f Makefile.m32 $(MAKE) -C src -f Makefile.m32
mingw32-zlib:
$(MAKE) -C lib -f Makefile.m32 ZLIB=1
$(MAKE) -C src -f Makefile.m32 ZLIB=1
mingw32-ssl-zlib:
$(MAKE) -C lib -f Makefile.m32 SSL=1 ZLIB=1
$(MAKE) -C src -f Makefile.m32 SSL=1 ZLIB=1
mingw32-ssh2-ssl-zlib:
$(MAKE) -C lib -f Makefile.m32 SSH2=1 SSL=1 ZLIB=1
$(MAKE) -C src -f Makefile.m32 SSH2=1 SSL=1 ZLIB=1
mingw32-ssh2-ssl-sspi-zlib:
$(MAKE) -C lib -f Makefile.m32 SSH2=1 SSL=1 SSPI=1 ZLIB=1
$(MAKE) -C src -f Makefile.m32 SSH2=1 SSL=1 SSPI=1 ZLIB=1
mingw32-rtmp-ssh2-ssl-sspi-zlib:
$(MAKE) -C lib -f Makefile.m32 RTMP=1 SSH2=1 SSL=1 SSPI=1 ZLIB=1
$(MAKE) -C src -f Makefile.m32 RTMP=1 SSH2=1 SSL=1 SSPI=1 ZLIB=1
mingw32-clean: mingw32-clean:
$(MAKE) -C lib -f Makefile.m32 clean $(MAKE) -C lib -f Makefile.m32 clean
$(MAKE) -C src -f Makefile.m32 clean $(MAKE) -C src -f Makefile.m32 clean
$(MAKE) -C docs/examples -f Makefile.m32 clean
mingw32-vclean mingw32-distclean:
$(MAKE) -C lib -f Makefile.m32 vclean
$(MAKE) -C src -f Makefile.m32 vclean
$(MAKE) -C docs/examples -f Makefile.m32 vclean
mingw32-examples%:
$(MAKE) -C docs/examples -f Makefile.m32 CFG=$@
mingw32%:
$(MAKE) -C lib -f Makefile.m32 CFG=$@
$(MAKE) -C src -f Makefile.m32 CFG=$@
vc-clean: $(VC) vc-clean: $(VC)
cd lib cd lib
@@ -229,34 +222,27 @@ netware:
$(MAKE) -C lib -f Makefile.netware $(MAKE) -C lib -f Makefile.netware
$(MAKE) -C src -f Makefile.netware $(MAKE) -C src -f Makefile.netware
netware-ares:
$(MAKE) -C lib -f Makefile.netware WITH_ARES=1
$(MAKE) -C src -f Makefile.netware WITH_ARES=1
netware-ssl:
$(MAKE) -C lib -f Makefile.netware WITH_SSL=1
$(MAKE) -C src -f Makefile.netware WITH_SSL=1
netware-ssl-zlib:
$(MAKE) -C lib -f Makefile.netware WITH_SSL=1 WITH_ZLIB=1
$(MAKE) -C src -f Makefile.netware WITH_SSL=1 WITH_ZLIB=1
netware-ssh2-ssl-zlib:
$(MAKE) -C lib -f Makefile.netware WITH_SSH2=1 WITH_SSL=1 WITH_ZLIB=1
$(MAKE) -C src -f Makefile.netware WITH_SSH2=1 WITH_SSL=1 WITH_ZLIB=1
netware-zlib:
$(MAKE) -C lib -f Makefile.netware WITH_ZLIB=1
$(MAKE) -C src -f Makefile.netware WITH_ZLIB=1
netware-clean: netware-clean:
$(MAKE) -C lib -f Makefile.netware clean $(MAKE) -C lib -f Makefile.netware clean
$(MAKE) -C src -f Makefile.netware clean $(MAKE) -C src -f Makefile.netware clean
$(MAKE) -C docs/examples -f Makefile.netware clean
netware-vclean netware-distclean:
$(MAKE) -C lib -f Makefile.netware vclean
$(MAKE) -C src -f Makefile.netware vclean
$(MAKE) -C docs/examples -f Makefile.netware vclean
netware-install: netware-install:
$(MAKE) -C lib -f Makefile.netware install $(MAKE) -C lib -f Makefile.netware install
$(MAKE) -C src -f Makefile.netware install $(MAKE) -C src -f Makefile.netware install
netware-examples-%:
$(MAKE) -C docs/examples -f Makefile.netware CFG=$@
netware-%:
$(MAKE) -C lib -f Makefile.netware CFG=$@
$(MAKE) -C src -f Makefile.netware CFG=$@
unix: all unix: all
unix-ssl: ssl unix-ssl: ssl

View File

@@ -1,69 +1,54 @@
Curl and libcurl 7.21.5 Curl and libcurl 7.26.0
Public curl releases: 121 Public curl releases: 127
Command line options: 143 Command line options: 151
curl_easy_setopt() options: 185 curl_easy_setopt() options: 199
Public functions in libcurl: 58 Public functions in libcurl: 58
Known libcurl bindings: 39 Known libcurl bindings: 39
Contributors: 854 Contributors: 929
This release includes the following changes: This release includes the following changes:
o SOCKOPTFUNCTION: callback can say already-connected o nss: the minimal supported version of NSS bumped to 3.12.x
o Added --netrc-file o nss: human-readable names are now provided for NSS errors if available
o Added (new) support for cyassl o add a manual page for mk-ca-bundle
o TSL-SRP: enabled with OpenSSL o added --post303 and the CURL_REDIR_POST_303 option for CURLOPT_POSTREDIR
o Added CURLE_NOT_BUILT_IN and CURLE_UNKNOWN_OPTION o smtp: Add support for DIGEST-MD5 authentication
o pop3: Added support for additional pop3 commands
This release includes the following bugfixes: This release includes the following bugfixes:
o nss: avoid memory leak on SSL connection failure o nss: libcurl now uses NSS_InitContext() to prevent collisions if available
o nss: do not ignore failure of SSL handshake [1]
o multi: better failed connect handling when using FTP, SMTP, POP3 and IMAP o URL parse: reject numerical IPv6 addresses outside brackets [4]
o runtests.pl: fix pid number concatenation that prevented it from killing o MD5: fix OOM memory leak [5]
the correct process at times o OpenSSL cert: provide more details when cert check fails
o PolarSSL: Return 0 on receiving TLS CLOSE_NOTIFY alert o HTTP: empty chunked POST ended up in two zero size chunks [6]
o curl_easy_setopt.3: Removed wrong reference to CURLOPT_USERPASSWORD o fixed a regression when curl resolved to multiple addresses and the first
o multi: close connection on timeout isn't supported [7]
o IMAP in multi mode does SSL connections non-blocking o -# progress meter: avoid superfluous updates and duplicate lines [8]
o honours the --disable-ldaps configure option o headers: surround GCC attribute names with double underscores [9]
o Force setopt constants written by --libcurl to be long o PolarSSL: correct return code for CRL matches
o ssh_connect: treat libssh2 return code better o PolarSSL: include version number in version string
o SFTP upload could stall the state machine when the multi_socket API was o PolarSSL: add support for asynchronous connect
used o mk-ca-bundle: revert the LWP usage [12]
o SFTP and SCP could leak memory when used with the multi interface and o IPv6 cookie domain: get rid of the first bracket before the second
the connection was closed o connect.c: return changed to CURLE_COULDNT_CONNECT when opensocket fails
o Added missing file to repair the MSVC makefiles o OpenSSL: Made cert hostname check conform to RFC 6125 [10]
o Fixed detection of recvfrom arguments on Android/bionic o HTTP: reset expected DL/UL sizes on redirects [11]
o GSS: handle reuse fix o CMake: fix Windows LDAP/LDAPS option handling [2]
o transfer: avoid insane conversion of time_t o CMake: fix MS Visual Studio x64 unsigned long long literal suffix [3]
o nss: do not ignore value of CURLOPT_SSL_VERIFYPEER in certain cases o configure: update detection logic of getaddrinfo() thread-safeness
o SMTP-multi: non-blocking connect o configure: check for gethostbyname in the watt lib
o SFTP-multi: set cselect for sftp and scp to fix "stall" risk o curl-config.1: fix curl-config usage in example [13]
o configure: removed wrongly claimed default paths o smtp: Fixed non-escaping of dot character at beginning of line
o pop3: fixed torture tests to succeed o MakefileBuild.vc: use the correct IDN variable
o symbols-in-versions: many corrections o autoconf: improve handling of versioned symbols
o if a HTTP request gets retried because the connection was dead, rewind if o curl.1: clarify -x usage
any data was sent as part of it o curl: shorten user-agent
o only probe for working ipv6 once and then re-use that info for further o smtp: issue with the multi-interface always sending postdata [14]
requests o compile error with GnuTLS+Nettle fixed
o requests that are asked to bound to a local interface/port will no longer o winbuild: fix IPv6 enabled build
wrongly re-use connections that aren't
o libcurl.m4: Add missing quotes in AC_LINK_IFELSE
o progress output: don't print the last update on a separate line
o POP3: the command to send is STLS, not STARTTLS
o POP3: PASS command was not sent after upgrade to TLS
o configure: fix libtool warning
o nss: allow to use multiple client certificates for a single host
o HTTP pipelining: Fix handling of zero-length responses
o Don't list NTLM in curl-config when HTTP is disabled
o curl_easy_setopt.3: CURLOPT_RESOLVE typo version
o OpenSSL: build fine with no-sslv2 versions
o checkconnection: don't call with NULL pointer with RTSP and multi interface
o Borland makefile updates
o configure: libssh2 link fix without pkg-config
o certinfo crash
o CCC crash
This release includes the following known bugs: This release includes the following known bugs:
@@ -72,10 +57,29 @@ This release includes the following known bugs:
This release would not have looked like this without help, code, reports and This release would not have looked like this without help, code, reports and
advice from friends like these: advice from friends like these:
Mike Crowe, Kamil Dudka, Julien Chaffraix, Hoi-Ho Chan, Ben Noordhuis, Andrei Cipu, Armel Asselin, Benjamin Johnson, Dag Ekengren, Dave Reisner,
Dan Fandrich, Henry Ludemann, Karl M, Manuel Massing, Marcus Sundberg, Gokhan Sengun, Guenter Knauf, Jan Schaumann, Jonathan Nieder, Kamil Dudka,
Stefan Krause, Todd A Ouska, Saqib Ali, Andre Guibert de Bruet, Lijo Antony, Olaf Flebbe, Rodrigo Silva, Steve Holme, Tatsuhiro Tsujikawa,
Tor Arntsen, Vincent Torri, Dave Reisner, Chris Smowton, Tinus van den Berg, Tim Heckman, Yang Tse, Arnaud Compan, Blaise Potard, Daniel Theron,
Hongli Lai, Gisle Vanem, Andrei Benea, Mehmet Bozkurt Michael Mueller, Michael Wallner, Tim Heckman, Roman Mamedov, Julian Taylor,
Claes Jakobsson, Pierre Chapuis, Jan Ehrhardt
Thanks! (and sorry if I forgot to mention someone) Thanks! (and sorry if I forgot to mention someone)
References to bug reports and discussions on issues:
[1] = https://bugzilla.redhat.com/738456
[2] = http://curl.haxx.se/mail/lib-2012-03/0278.html
[3] = http://curl.haxx.se/mail/lib-2012-03/0255.html
[4] = http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=670126
[5] = http://curl.haxx.se/mail/lib-2012-04/0246.html
[6] = http://curl.haxx.se/mail/archive-2012-04/0060.html
[7] = http://curl.haxx.se/bug/view.cgi?id=3516508
[8] = http://curl.haxx.se/bug/view.cgi?id=3517418
[9] = http://curl.haxx.se/mail/lib-2012-04/0127.html
[10] = http://tools.ietf.org/html/rfc6125#section-6.4.3
[11] = http://curl.haxx.se/bug/view.cgi?id=3510057
[12] = http://curl.haxx.se/mail/lib-2012-03/0238.html
[13] = http://curl.haxx.se/bug/view.cgi?id=3528241
[14] = http://curl.haxx.se/mail/lib-2012-05/0108.html

View File

@@ -1,15 +1,10 @@
To be addressed in 7.21.6 To be addressed in 7.27
========================= =======================
284 - bug 3172608 "No re-authentication when HTTP connecton is closed" 309 - metalink support for the curl tool
http://curl.haxx.se/bug/view.cgi?id=3172608
Would be nice if someone could verify the suggested patch
285 - bug 3163118 "Allow programatic use of telnet on Windows" 310 - a new authentication callback
http://curl.haxx.se/bug/view.cgi?id=3163118
Would appreciate a Windows developer to give it a look before we apply
the suggested patch
287 - bug 3215314 Post quote operation to rename fails in Windows 311 - support for SSPI schannel for SSL on windows
289 - 312 -

View File

@@ -5,7 +5,7 @@
# | (__| |_| | _ <| |___ # | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____| # \___|\___/|_| \_\_____|
# #
# Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. # Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
# #
# This software is licensed as described in the file COPYING, which # This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms # you should have received as part of this distribution. The terms
@@ -51,7 +51,7 @@ CURL_DEF_TOKEN $1
],[ ],[
tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \ tmp_exp=`eval "$ac_cpp conftest.$ac_ext" 2>/dev/null | \
"$GREP" CURL_DEF_TOKEN 2>/dev/null | \ "$GREP" CURL_DEF_TOKEN 2>/dev/null | \
"$SED" 's/.*CURL_DEF_TOKEN[[ ]]//' 2>/dev/null | \ "$SED" 's/.*CURL_DEF_TOKEN[[ ]][[ ]]*//' 2>/dev/null | \
"$SED" 's/[["]][[ ]]*[["]]//g' 2>/dev/null` "$SED" 's/[["]][[ ]]*[["]]//g' 2>/dev/null`
if test -z "$tmp_exp" || test "$tmp_exp" = "$1"; then if test -z "$tmp_exp" || test "$tmp_exp" = "$1"; then
tmp_exp="" tmp_exp=""
@@ -228,12 +228,7 @@ AC_DEFUN([CURL_CHECK_NATIVE_WINDOWS], [
]) ])
fi fi
]) ])
case "$ac_cv_native_windows" in AM_CONDITIONAL(DOING_NATIVE_WINDOWS, test "x$ac_cv_native_windows" = xyes)
yes)
AC_DEFINE_UNQUOTED(NATIVE_WINDOWS, 1,
[Define to 1 if you are building a native Windows target.])
;;
esac
]) ])
@@ -1663,7 +1658,7 @@ AC_DEFUN([CURL_CHECK_FUNC_RECVFROM], [
for recvfrom_arg2 in 'char *' 'void *'; do for recvfrom_arg2 in 'char *' 'void *'; do
for recvfrom_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do for recvfrom_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do
for recvfrom_arg4 in 'int' 'unsigned int'; do for recvfrom_arg4 in 'int' 'unsigned int'; do
for recvfrom_arg5 in 'const struct sockaddr *' 'struct sockaddr *' 'void *'; do for recvfrom_arg5 in 'struct sockaddr *' 'void *' 'const struct sockaddr *'; do
for recvfrom_arg6 in 'socklen_t *' 'int *' 'unsigned int *' 'size_t *' 'void *'; do for recvfrom_arg6 in 'socklen_t *' 'int *' 'unsigned int *' 'size_t *' 'void *'; do
if test "$curl_cv_func_recvfrom_args" = "unknown"; then if test "$curl_cv_func_recvfrom_args" = "unknown"; then
AC_COMPILE_IFELSE([ AC_COMPILE_IFELSE([
@@ -1731,7 +1726,7 @@ AC_DEFUN([CURL_CHECK_FUNC_RECVFROM], [
shift shift
# #
recvfrom_ptrt_arg2=$[2] recvfrom_ptrt_arg2=$[2]
recvfrom_ptrt_arg5=$[5] recvfrom_qual_ptrt_arg5=$[5]
recvfrom_ptrt_arg6=$[6] recvfrom_ptrt_arg6=$[6]
# #
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG1, $[1], AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG1, $[1],
@@ -1753,12 +1748,25 @@ AC_DEFUN([CURL_CHECK_FUNC_RECVFROM], [
;; ;;
esac esac
# #
case "$recvfrom_qual_ptrt_arg5" in
const*)
recvfrom_qual_arg5=const
recvfrom_ptrt_arg5=`echo $recvfrom_qual_ptrt_arg5 | sed 's/^const //'`
;;
*)
recvfrom_qual_arg5=
recvfrom_ptrt_arg5=$recvfrom_qual_ptrt_arg5
;;
esac
#
recvfrom_type_arg2=`echo $recvfrom_ptrt_arg2 | sed 's/ \*//'` recvfrom_type_arg2=`echo $recvfrom_ptrt_arg2 | sed 's/ \*//'`
recvfrom_type_arg5=`echo $recvfrom_ptrt_arg5 | sed 's/ \*//'` recvfrom_type_arg5=`echo $recvfrom_ptrt_arg5 | sed 's/ \*//'`
recvfrom_type_arg6=`echo $recvfrom_ptrt_arg6 | sed 's/ \*//'` recvfrom_type_arg6=`echo $recvfrom_ptrt_arg6 | sed 's/ \*//'`
# #
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG2, $recvfrom_type_arg2, AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG2, $recvfrom_type_arg2,
[Define to the type pointed by arg 2 for recvfrom.]) [Define to the type pointed by arg 2 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_QUAL_ARG5, $recvfrom_qual_arg5,
[Define to the type qualifier pointed by arg 5 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG5, $recvfrom_type_arg5, AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG5, $recvfrom_type_arg5,
[Define to the type pointed by arg 5 for recvfrom.]) [Define to the type pointed by arg 5 for recvfrom.])
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG6, $recvfrom_type_arg6, AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG6, $recvfrom_type_arg6,
@@ -2843,7 +2851,7 @@ AC_DEFUN([DO_CURL_OFF_T_CHECK], [
tmp_includes="" tmp_includes=""
tmp_source="" tmp_source=""
tmp_fmt="" tmp_fmt=""
case AS_TR_SH([$1]) in case XC_SH_TR_SH([$1]) in
int64_t) int64_t)
tmp_includes="$curl_includes_inttypes" tmp_includes="$curl_includes_inttypes"
tmp_source="char f@<:@@:>@ = PRId64;" tmp_source="char f@<:@@:>@ = PRId64;"
@@ -2901,7 +2909,7 @@ AC_DEFUN([DO_CURL_OFF_T_SUFFIX_CHECK], [
curl_suffix_curl_off_t="unknown" curl_suffix_curl_off_t="unknown"
curl_suffix_curl_off_tu="unknown" curl_suffix_curl_off_tu="unknown"
# #
case AS_TR_SH([$1]) in case XC_SH_TR_SH([$1]) in
long_long | __longlong | __longlong_t) long_long | __longlong | __longlong_t)
tst_suffixes="LL::" tst_suffixes="LL::"
;; ;;
@@ -3073,7 +3081,7 @@ AC_DEFUN([CURL_CONFIGURE_CURL_OFF_T], [
curl_format_curl_off_tu=`echo "$curl_format_curl_off_tu" | "$SED" 's/D$/U/'` curl_format_curl_off_tu=`echo "$curl_format_curl_off_tu" | "$SED" 's/D$/U/'`
else else
x_pull_headers="no" x_pull_headers="no"
case AS_TR_SH([$curl_typeof_curl_off_t]) in case XC_SH_TR_SH([$curl_typeof_curl_off_t]) in
long_long | __longlong | __longlong_t) long_long | __longlong | __longlong_t)
curl_format_curl_off_t="lld" curl_format_curl_off_t="lld"
curl_format_curl_off_tu="llu" curl_format_curl_off_tu="llu"

175
buildconf
View File

@@ -6,7 +6,7 @@
# | (__| |_| | _ <| |___ # | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____| # \___|\___/|_| \_\_____|
# #
# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al. # Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
# #
# This software is licensed as described in the file COPYING, which # This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms # you should have received as part of this distribution. The terms
@@ -21,9 +21,12 @@
# #
########################################################################### ###########################################################################
#--------------------------------------------------------------------------
# die prints argument string to stdout and exits this shell script.
#
die(){ die(){
echo "$@" echo "buildconf: $@"
exit exit 1
} }
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
@@ -33,11 +36,8 @@ die(){
findtool(){ findtool(){
file="$1" file="$1"
if { echo $file | grep "/" >/dev/null 2>&1; } then if { echo "$file" | grep "/" >/dev/null 2>&1; } then
# we only check for the explicit file name if the file is given # when file is given with a path check it first
# including a slash. Use ./ for current dir. Previously this would
# otherwise always cause findtool to search the local dir first, which
# is wrong.
if test -f "$file"; then if test -f "$file"; then
echo "$file" echo "$file"
return return
@@ -80,16 +80,19 @@ removethis(){
# Ensure that buildconf runs from the subdirectory where configure.ac lives # Ensure that buildconf runs from the subdirectory where configure.ac lives
# #
if test ! -f configure.ac || if test ! -f configure.ac ||
test ! -f src/main.c || test ! -f src/tool_main.c ||
test ! -f lib/urldata.h || test ! -f lib/urldata.h ||
test ! -f include/curl/curl.h; then test ! -f include/curl/curl.h ||
test ! -f m4/curl-functions.m4; then
echo "Can not run buildconf from outside of curl's source subdirectory!" echo "Can not run buildconf from outside of curl's source subdirectory!"
echo "Change to the subdirectory where buildconf is found, and try again." echo "Change to the subdirectory where buildconf is found, and try again."
exit 1 exit 1
fi fi
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# autoconf 2.57 or newer # autoconf 2.57 or newer. Unpatched version 2.67 does not generate proper
# configure script. Unpatched version 2.68 is simply unusable, we should
# disallow 2.68 usage.
# #
need_autoconf="2.57" need_autoconf="2.57"
ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|head -n 1| sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|head -n 1| sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
@@ -108,7 +111,15 @@ if test "$1" = "2" -a "$2" -lt "57" || test "$1" -lt "2"; then
exit 1 exit 1
fi fi
echo "buildconf: autoconf version $ac_version (ok)" if test "$1" = "2" -a "$2" -eq "67"; then
echo "buildconf: autoconf version $ac_version (BAD)"
echo " Unpatched version generates broken configure script."
elif test "$1" = "2" -a "$2" -eq "68"; then
echo "buildconf: autoconf version $ac_version (BAD)"
echo " Unpatched version generates unusable configure script."
else
echo "buildconf: autoconf version $ac_version (ok)"
fi
am4te_version=`${AUTOM4TE:-autom4te} --version 2>/dev/null|head -n 1| sed -e 's/autom4te\(.*\)/\1/' -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` am4te_version=`${AUTOM4TE:-autom4te} --version 2>/dev/null|head -n 1| sed -e 's/autom4te\(.*\)/\1/' -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
if test -z "$am4te_version"; then if test -z "$am4te_version"; then
@@ -178,27 +189,24 @@ else
fi fi
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# libtool check # GNU libtool preliminary check
# #
LIBTOOL_WANTED_MAJOR=1 want_lt_major=1
LIBTOOL_WANTED_MINOR=4 want_lt_minor=4
LIBTOOL_WANTED_PATCH=2 want_lt_patch=2
LIBTOOL_WANTED_VERSION=1.4.2 want_lt_version=1.4.2
# This approach that tries 'glibtool' first is intended for systems that
# have GNU libtool named as 'glibtool' and libtool not being GNU's.
# this approach that tries 'glibtool' first is some kind of work-around for
# some BSD-systems I believe that use to provide the GNU libtool named
# glibtool, with 'libtool' being something completely different.
libtool=`findtool glibtool 2>/dev/null` libtool=`findtool glibtool 2>/dev/null`
if test ! -x "$libtool"; then if test ! -x "$libtool"; then
libtool=`findtool ${LIBTOOL:-libtool}` libtool=`findtool ${LIBTOOL:-libtool}`
fi fi
if test -z "$libtool"; then
if test -z "$LIBTOOLIZE"; then echo "buildconf: libtool not found."
# set the LIBTOOLIZE here so that glibtoolize is used if glibtool was found echo " You need GNU libtool $want_lt_version or newer installed."
# $libtool is already the full path exit 1
libtoolize="${libtool}ize"
else
libtoolize=`findtool $LIBTOOLIZE`
fi fi
lt_pver=`$libtool --version 2>/dev/null|head -n 1` lt_pver=`$libtool --version 2>/dev/null|head -n 1`
@@ -206,42 +214,55 @@ lt_qver=`echo $lt_pver|sed -e "s/([^)]*)//g" -e "s/^[^0-9]*//g"`
lt_version=`echo $lt_qver|sed -e "s/[- ].*//" -e "s/\([a-z]*\)$//"` lt_version=`echo $lt_qver|sed -e "s/[- ].*//" -e "s/\([a-z]*\)$//"`
if test -z "$lt_version"; then if test -z "$lt_version"; then
echo "buildconf: libtool not found." echo "buildconf: libtool not found."
echo " You need libtool version $LIBTOOL_WANTED_VERSION or newer installed" echo " You need GNU libtool $want_lt_version or newer installed."
exit 1 exit 1
fi fi
old_IFS=$IFS; IFS='.'; set $lt_version; IFS=$old_IFS old_IFS=$IFS; IFS='.'; set $lt_version; IFS=$old_IFS
lt_major=$1 lt_major=$1
lt_minor=$2 lt_minor=$2
lt_patch=$3 lt_patch=$3
lt_status="good"
if test "$lt_major" = "$LIBTOOL_WANTED_MAJOR"; then if test -z "$lt_major"; then
if test "$lt_minor" -lt "$LIBTOOL_WANTED_MINOR"; then
lt_status="bad" lt_status="bad"
elif test -n "$LIBTOOL_WANTED_PATCH"; then elif test "$lt_major" -gt "$want_lt_major"; then
if test "$lt_minor" -gt "$LIBTOOL_WANTED_MINOR"; then
lt_status="good" lt_status="good"
elif test -n "$lt_patch"; then elif test "$lt_major" -lt "$want_lt_major"; then
if test "$lt_patch" -lt "$LIBTOOL_WANTED_PATCH"; then
lt_status="bad" lt_status="bad"
fi elif test -z "$lt_minor"; then
else
lt_status="bad" lt_status="bad"
fi elif test "$lt_minor" -gt "$want_lt_minor"; then
fi lt_status="good"
elif test "$lt_minor" -lt "$want_lt_minor"; then
lt_status="bad"
elif test -z "$lt_patch"; then
lt_status="bad"
elif test "$lt_patch" -gt "$want_lt_patch"; then
lt_status="good"
elif test "$lt_patch" -lt "$want_lt_patch"; then
lt_status="bad"
else
lt_status="good"
fi fi
if test $lt_status != "good"; then if test "$lt_status" != "good"; then
echo "buildconf: libtool version $lt_version found." echo "buildconf: libtool version $lt_version found."
echo " You need libtool version $LIBTOOL_WANTED_VERSION or newer installed" echo " You need GNU libtool $want_lt_version or newer installed."
exit 1 exit 1
fi fi
echo "buildconf: libtool version $lt_version (ok)" echo "buildconf: libtool version $lt_version (ok)"
if test -f "$libtoolize"; then #--------------------------------------------------------------------------
echo "buildconf: libtoolize found" # GNU libtoolize check
#
if test -z "$LIBTOOLIZE"; then
# use (g)libtoolize from same location as (g)libtool
libtoolize="${libtool}ize"
else else
echo "buildconf: libtoolize not found. Weird libtool installation!" libtoolize=`findtool $LIBTOOLIZE`
fi
if test ! -f "$libtoolize"; then
echo "buildconf: libtoolize not found."
echo " You need GNU libtoolize $want_lt_version or newer installed."
exit 1 exit 1
fi fi
@@ -266,6 +287,10 @@ fi
# perl check # perl check
# #
PERL=`findtool ${PERL:-perl}` PERL=`findtool ${PERL:-perl}`
if test -z "$PERL"; then
echo "buildconf: perl not found"
exit 1
fi
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Remove files generated on previous buildconf/configure run. # Remove files generated on previous buildconf/configure run.
@@ -301,6 +326,7 @@ for fname in .deps \
libcurl.pc \ libcurl.pc \
libtool \ libtool \
libtool.m4 \ libtool.m4 \
libtool.m4.tmp \
ltmain.sh \ ltmain.sh \
ltoptions.m4 \ ltoptions.m4 \
ltsugar.m4 \ ltsugar.m4 \
@@ -317,32 +343,49 @@ done
# #
echo "buildconf: running libtoolize" echo "buildconf: running libtoolize"
$libtoolize --copy --automake --force || die "The libtoolize command failed" ${libtoolize} --copy --automake --force || die "libtoolize command failed"
if test ! -f m4/curl-functions.m4; then # When using libtool 1.5.X (X < 26) we copy libtool.m4 to our local m4
echo "buildconf: cURL m4 macros not found" # subdirectory and this local copy is patched to fix some warnings that
exit 1 # are triggered when running aclocal and using autoconf 2.62 or later.
if test "$lt_major" = "1" && test "$lt_minor" = "5"; then
if test -z "$lt_patch" || test "$lt_patch" -lt "26"; then
echo "buildconf: copying libtool.m4 to local m4 subdir"
ac_dir=`${ACLOCAL:-aclocal} --print-ac-dir`
if test -f $ac_dir/libtool.m4; then
cp -f $ac_dir/libtool.m4 m4/libtool.m4
else
echo "buildconf: $ac_dir/libtool.m4 not found"
fi
if test -f m4/libtool.m4; then
echo "buildconf: renaming some variables in local m4/libtool.m4"
$PERL -i.tmp -pe \
's/lt_prog_compiler_pic_works/lt_cv_prog_compiler_pic_works/g; \
s/lt_prog_compiler_static_works/lt_cv_prog_compiler_static_works/g;' \
m4/libtool.m4
rm -f m4/libtool.m4.tmp
fi
fi
fi
if test -f m4/libtool.m4; then
echo "buildconf: converting all mv to mv -f in local m4/libtool.m4"
$PERL -i.tmp -pe 's/\bmv +([^-\s])/mv -f $1/g' m4/libtool.m4
rm -f m4/libtool.m4.tmp
fi fi
echo "buildconf: running aclocal" echo "buildconf: running aclocal"
${ACLOCAL:-aclocal} -I m4 $ACLOCAL_FLAGS || die "The aclocal command line failed" ${ACLOCAL:-aclocal} -I m4 $ACLOCAL_FLAGS || die "aclocal command failed"
if test -n "$PERL"; then echo "buildconf: converting all mv to mv -f in local aclocal.m4"
echo "buildconf: running aclocal hack to convert all mv to mv -f" $PERL -i.bak -pe 's/\bmv +([^-\s])/mv -f $1/g' aclocal.m4
$PERL -i.bak -pe 's/\bmv +([^-\s])/mv -f $1/g' aclocal.m4
else
echo "buildconf: perl not found"
exit 1
fi
echo "buildconf: running autoheader" echo "buildconf: running autoheader"
${AUTOHEADER:-autoheader} || die "The autoheader command failed" ${AUTOHEADER:-autoheader} || die "autoheader command failed"
echo "buildconf: cp lib/curl_config.h.in src/curl_config.h.in"
cp lib/curl_config.h.in src/curl_config.h.in
echo "buildconf: running autoconf" echo "buildconf: running autoconf"
${AUTOCONF:-autoconf} || die "The autoconf command failed" ${AUTOCONF:-autoconf} || die "autoconf command failed"
if test -d ares; then if test -d ares; then
cd ares cd ares
@@ -352,14 +395,15 @@ if test -d ares; then
fi fi
echo "buildconf: running automake" echo "buildconf: running automake"
${AUTOMAKE:-automake} -a -c || die "The automake command failed" ${AUTOMAKE:-automake} --add-missing --copy || die "automake command failed"
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# GNU libtool complementary check
#
# Depending on the libtool and automake versions being used, config.guess # Depending on the libtool and automake versions being used, config.guess
# might not be installed in the subdirectory until automake has finished. # might not be installed in the subdirectory until automake has finished.
# So we can not attempt to use it until this very last buildconf stage. # So we can not attempt to use it until this very last buildconf stage.
# #
if test ! -f ./config.guess; then if test ! -f ./config.guess; then
echo "buildconf: config.guess not found" echo "buildconf: config.guess not found"
else else
@@ -403,7 +447,7 @@ else
if test "$lt_status" != "good"; then if test "$lt_status" != "good"; then
need_lt_version="$need_lt_major.$need_lt_minor.$need_lt_patch" need_lt_version="$need_lt_major.$need_lt_minor.$need_lt_patch"
echo "buildconf: libtool version $lt_version found." echo "buildconf: libtool version $lt_version found."
echo " $buildhost requires libtool $need_lt_version or newer installed." echo " $buildhost requires GNU libtool $need_lt_version or newer installed."
rm -f configure rm -f configure
exit 1 exit 1
fi fi
@@ -411,8 +455,7 @@ else
fi fi
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Finished succesfully. # Finished successfully.
# #
echo "buildconf: OK" echo "buildconf: OK"
exit 0 exit 0

View File

@@ -5,7 +5,7 @@
# | (__| |_| | _ <| |___ # | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____| # \___|\___/|_| \_\_____|
# #
# Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. # Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
# #
# This software is licensed as described in the file COPYING, which # This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms # you should have received as part of this distribution. The terms
@@ -26,6 +26,7 @@ AC_PREREQ(2.57)
dnl We don't know the version number "statically" so we use a dash here dnl We don't know the version number "statically" so we use a dash here
AC_INIT([curl], [-], [a suitable curl mailing list: http://curl.haxx.se/mail/]) AC_INIT([curl], [-], [a suitable curl mailing list: http://curl.haxx.se/mail/])
XC_OVR_ZZ50
CURL_OVERRIDE_AUTOCONF CURL_OVERRIDE_AUTOCONF
dnl configure script copyright dnl configure script copyright
@@ -34,7 +35,7 @@ This configure script may be copied, distributed and modified under the
terms of the curl license; see COPYING for more details]) terms of the curl license; see COPYING for more details])
AC_CONFIG_SRCDIR([lib/urldata.h]) AC_CONFIG_SRCDIR([lib/urldata.h])
AM_CONFIG_HEADER(lib/curl_config.h src/curl_config.h include/curl/curlbuild.h) AM_CONFIG_HEADER(lib/curl_config.h include/curl/curlbuild.h)
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])
AM_MAINTAINER_MODE AM_MAINTAINER_MODE
@@ -43,6 +44,7 @@ CURL_CHECK_OPTION_OPTIMIZE
CURL_CHECK_OPTION_WARNINGS CURL_CHECK_OPTION_WARNINGS
CURL_CHECK_OPTION_WERROR CURL_CHECK_OPTION_WERROR
CURL_CHECK_OPTION_CURLDEBUG CURL_CHECK_OPTION_CURLDEBUG
CURL_CHECK_OPTION_SYMBOL_HIDING
CURL_CHECK_OPTION_ARES CURL_CHECK_OPTION_ARES
CURL_CHECK_PATH_SEPARATOR_REQUIRED CURL_CHECK_PATH_SEPARATOR_REQUIRED
@@ -154,6 +156,7 @@ curl_tls_srp_msg="no (--enable-tls-srp)"
curl_ipv6_msg="no (--enable-ipv6)" curl_ipv6_msg="no (--enable-ipv6)"
curl_idn_msg="no (--with-libidn)" curl_idn_msg="no (--with-libidn)"
curl_manual_msg="no (--enable-manual)" curl_manual_msg="no (--enable-manual)"
curl_libcurl_msg="enabled (--disable-libcurl-option)"
curl_verbose_msg="enabled (--disable-verbose)" curl_verbose_msg="enabled (--disable-verbose)"
curl_sspi_msg="no (--enable-sspi)" curl_sspi_msg="no (--enable-sspi)"
curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)" curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
@@ -234,21 +237,18 @@ esac
AC_MSG_RESULT($mimpure) AC_MSG_RESULT($mimpure)
AM_CONDITIONAL(MIMPURE, test x$mimpure = xyes) AM_CONDITIONAL(MIMPURE, test x$mimpure = xyes)
dnl 'STATICLIB' is, in spite of its name, not generic but only for static-only
dnl builds on Windows
AM_CONDITIONAL(STATICLIB, false)
AC_MSG_CHECKING([if we need BUILDING_LIBCURL]) AC_MSG_CHECKING([if we need BUILDING_LIBCURL])
use_cppflag_building_libcurl="no"
use_cppflag_curl_staticlib="no"
case $host in case $host in
*-*-mingw*) *-*-mingw*)
AC_DEFINE(BUILDING_LIBCURL, 1, [when building libcurl itself])
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
use_cppflag_building_libcurl="yes"
AC_MSG_CHECKING([if we need CURL_STATICLIB]) AC_MSG_CHECKING([if we need CURL_STATICLIB])
if test "X$enable_shared" = "Xno" if test "X$enable_shared" = "Xno"
then then
AC_DEFINE(CURL_STATICLIB, 1, [when not building a shared library])
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
AM_CONDITIONAL(STATICLIB, true) use_cppflag_curl_staticlib="yes"
else else
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
fi fi
@@ -257,6 +257,8 @@ case $host in
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
;; ;;
esac esac
AM_CONDITIONAL(USE_CPPFLAG_BUILDING_LIBCURL, test x$use_cppflag_building_libcurl = xyes)
AM_CONDITIONAL(USE_CPPFLAG_CURL_STATICLIB, test x$use_cppflag_curl_staticlib = xyes)
# Determine whether all dependent libraries must be specified when linking # Determine whether all dependent libraries must be specified when linking
if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno" if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno"
@@ -298,6 +300,7 @@ fi
CURL_CHECK_COMPILER_HALT_ON_ERROR CURL_CHECK_COMPILER_HALT_ON_ERROR
CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
CURL_CHECK_COMPILER_SYMBOL_HIDING
CURL_CHECK_NO_UNDEFINED CURL_CHECK_NO_UNDEFINED
AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes) AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
@@ -305,6 +308,44 @@ AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
CURL_CHECK_CURLDEBUG CURL_CHECK_CURLDEBUG
AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes) AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
supports_unittests=yes
# cross-compilation of unit tests static library/programs fails when
# libcurl shared library is built. This might be due to a libtool or
# automake issue. In this case we disable unit tests.
if test "x$cross_compiling" != "xno" &&
test "x$enable_shared" != "xno"; then
supports_unittests=no
fi
# IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to
# a problem related with OpenSSL headers and library versions not matching.
# Disable unit tests while time to further investigate this is found.
case $host in
mips-sgi-irix6.5)
if test "$compiler_id" = "GNU_C"; then
supports_unittests=no
fi
;;
esac
# All AIX autobuilds fails unit tests linking against unittests library
# due to unittests library being built with no symbols or members. Libtool ?
# Disable unit tests while time to further investigate this is found.
case $host_os in
aix*)
supports_unittests=no
;;
esac
dnl Build unit tests when option --enable-debug is given.
if test "x$want_debug" = "xyes" &&
test "x$supports_unittests" = "xyes"; then
want_unittests=yes
else
want_unittests=no
fi
AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_unittests = xyes)
dnl ********************************************************************** dnl **********************************************************************
dnl Compilation based checks should not be done before this point. dnl Compilation based checks should not be done before this point.
dnl ********************************************************************** dnl **********************************************************************
@@ -612,6 +653,25 @@ AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
dnl The actual use of the USE_MANUAL variable is done much later in this dnl The actual use of the USE_MANUAL variable is done much later in this
dnl script to allow other actions to disable it as well. dnl script to allow other actions to disable it as well.
dnl ************************************************************
dnl disable C code generation support
dnl
AC_MSG_CHECKING([whether to enable generation of C code])
AC_ARG_ENABLE(libcurl_option,
AC_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation support])
AC_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option])
curl_libcurl_msg="no"
;;
*) AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
dnl ********************************************************************** dnl **********************************************************************
dnl Checks for libraries. dnl Checks for libraries.
dnl ********************************************************************** dnl **********************************************************************
@@ -637,6 +697,17 @@ then
]) ])
fi fi
if test "$HAVE_GETHOSTBYNAME" != "1"
then
dnl gethostbyname in the watt lib?
AC_CHECK_LIB(watt, gethostbyname,
[HAVE_GETHOSTBYNAME="1"
CPPFLAGS="-I/dev/env/WATT_ROOT/inc"
LDFLAGS="-L/dev/env/WATT_ROOT/lib"
LIBS="$LIBS -lwatt"
])
fi
dnl At least one system has been identified to require BOTH nsl and socket dnl At least one system has been identified to require BOTH nsl and socket
dnl libs at the same time to link properly. dnl libs at the same time to link properly.
if test "$HAVE_GETHOSTBYNAME" != "1" if test "$HAVE_GETHOSTBYNAME" != "1"
@@ -1312,7 +1383,7 @@ if test X"$OPT_SSL" != Xno; then
dnl the user told us to look dnl the user told us to look
OPENSSL_PCDIR="$OPT_SSL/lib/pkgconfig" OPENSSL_PCDIR="$OPT_SSL/lib/pkgconfig"
AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$OPENSSL_PCDIR"]) AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$OPENSSL_PCDIR"])
if test -e "$OPENSSL_PCDIR/openssl.pc"; then if test -f "$OPENSSL_PCDIR/openssl.pc"; then
PKGTEST="yes" PKGTEST="yes"
fi fi
@@ -1476,7 +1547,8 @@ if test X"$OPT_SSL" != Xno; then
RAND_egd \ RAND_egd \
ENGINE_cleanup \ ENGINE_cleanup \
CRYPTO_cleanup_all_ex_data \ CRYPTO_cleanup_all_ex_data \
SSL_get_shutdown ) SSL_get_shutdown \
SSLv2_client_method )
dnl Make an attempt to detect if this is actually yassl's headers and dnl Make an attempt to detect if this is actually yassl's headers and
dnl OpenSSL emulation layer. We still leave everything else believing dnl OpenSSL emulation layer. We still leave everything else believing
@@ -1508,12 +1580,14 @@ if test X"$OPT_SSL" != Xno; then
dnl when the ssl shared libs were found in a path that the run-time dnl when the ssl shared libs were found in a path that the run-time
dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
dnl to prevent further configure tests to fail due to this dnl to prevent further configure tests to fail due to this
if test "x$cross_compiling" != "xyes"; then
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL"
export LD_LIBRARY_PATH export LD_LIBRARY_PATH
AC_MSG_NOTICE([Added $LIB_OPENSSL to LD_LIBRARY_PATH]) AC_MSG_NOTICE([Added $LIB_OPENSSL to LD_LIBRARY_PATH])
fi fi
fi fi
CURL_CHECK_OPENSSL_API
fi
fi fi
@@ -1624,8 +1698,12 @@ if test X"$OPENSSL_ENABLED" = X"1"; then
[read randomness from FILE (default=/dev/urandom)]), [read randomness from FILE (default=/dev/urandom)]),
[ RANDOM_FILE="$withval" ], [ RANDOM_FILE="$withval" ],
[ [
if test x$cross_compiling != xyes; then
dnl Check for random device dnl Check for random device
AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] ) AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
else
AC_MSG_WARN([skipped the /dev/urandom detection when cross-compiling])
fi
] ]
) )
if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
@@ -1742,12 +1820,13 @@ if test "$OPENSSL_ENABLED" != "1"; then
dnl linker doesn't search through, we need to add it to dnl linker doesn't search through, we need to add it to
dnl LD_LIBRARY_PATH to prevent further configure tests to fail dnl LD_LIBRARY_PATH to prevent further configure tests to fail
dnl due to this dnl due to this
if test "x$cross_compiling" != "xyes"; then
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlslib" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlslib"
export LD_LIBRARY_PATH export LD_LIBRARY_PATH
AC_MSG_NOTICE([Added $gtlslib to LD_LIBRARY_PATH]) AC_MSG_NOTICE([Added $gtlslib to LD_LIBRARY_PATH])
fi fi
fi fi
fi
fi fi
@@ -1756,17 +1835,33 @@ if test "$OPENSSL_ENABLED" != "1"; then
fi dnl OPENSSL != 1 fi dnl OPENSSL != 1
dnl --- dnl ---
dnl If GnuTLS is enabled, we MUST verify that it uses libgcrypt since dnl Check which crypto backend GnuTLS uses
dnl curl code relies on that but recent GnuTLS versions can in fact build
dnl with different crypto libraries which curl right now cannot handle
dnl --- dnl ---
if test "$GNUTLS_ENABLED" = "1"; then if test "$GNUTLS_ENABLED" = "1"; then
AC_CHECK_LIB(gcrypt, USE_GNUTLS_NETTLE=
gcry_control, , # First check if we can detect either crypto library via transitive linking
[ AC_CHECK_LIB(gnutls, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ])
AC_MSG_ERROR([need GnuTLS built with gcrypt to function with GnuTLS]) if test "$USE_GNUTLS_NETTLE" = ""; then
]) AC_CHECK_LIB(gnutls, gcry_control, [ USE_GNUTLS_NETTLE=0 ])
fi
# If not, try linking directly to both of them to see if they are available
if test "$USE_GNUTLS_NETTLE" = ""; then
AC_CHECK_LIB(nettle, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ])
fi
if test "$USE_GNUTLS_NETTLE" = ""; then
AC_CHECK_LIB(gcrypt, gcry_control, [ USE_GNUTLS_NETTLE=0 ])
fi
if test "$USE_GNUTLS_NETTLE" = ""; then
AC_MSG_ERROR([GnuTLS found, but neither gcrypt nor nettle found])
fi
if test "$USE_GNUTLS_NETTLE" = "1"; then
AC_DEFINE(USE_GNUTLS_NETTLE, 1, [if GnuTLS uses nettle as crypto backend])
AC_SUBST(USE_GNUTLS_NETTLE, [1])
LIBS="$LIBS -lnettle"
else
LIBS="$LIBS -lgcrypt"
fi
fi fi
dnl --- dnl ---
@@ -1852,12 +1947,12 @@ if test "$OPENSSL_ENABLED" != "1"; then
dnl linker doesn't search through, we need to add it to dnl linker doesn't search through, we need to add it to
dnl LD_LIBRARY_PATH to prevent further configure tests to fail dnl LD_LIBRARY_PATH to prevent further configure tests to fail
dnl due to this dnl due to this
if test "x$cross_compiling" != "xyes"; then
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$polarssllib" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$polarssllib"
export LD_LIBRARY_PATH export LD_LIBRARY_PATH
AC_MSG_NOTICE([Added $polarssllib to LD_LIBRARY_PATH]) AC_MSG_NOTICE([Added $polarssllib to LD_LIBRARY_PATH])
fi fi
fi
fi fi
fi dnl PolarSSL not disabled fi dnl PolarSSL not disabled
@@ -1874,7 +1969,7 @@ OPT_CYASSL=no
_cppflags=$CPPFLAGS _cppflags=$CPPFLAGS
_ldflags=$LDFLAGS _ldflags=$LDFLAGS
AC_ARG_WITH(cyassl,dnl AC_ARG_WITH(cyassl,dnl
AC_HELP_STRING([--with-cyassl=PATH],[where to look for CyaSSL, PATH points to the installation root (default: /usr/local/cyassl)]) AC_HELP_STRING([--with-cyassl=PATH],[where to look for CyaSSL, PATH points to the installation root (default: system lib default)])
AC_HELP_STRING([--without-cyassl], [disable CyaSSL detection]), AC_HELP_STRING([--without-cyassl], [disable CyaSSL detection]),
OPT_CYASSL=$withval) OPT_CYASSL=$withval)
@@ -1887,14 +1982,9 @@ if test "$OPENSSL_ENABLED" != "1"; then
fi fi
if test -z "$OPT_CYASSL" ; then if test -z "$OPT_CYASSL" ; then
dnl check for lib in default first dnl check for lib in system default first
trycyassldir="/usr/local/cyassl" AC_CHECK_LIB(cyassl, CyaSSL_Init,
LDFLAGS="$LDFLAGS -L$trycyassldir/lib"
CPPFLAGS="$CPPFLAGS -I$trycyassldir/include"
AC_CHECK_LIB(cyassl, InitCyaSSL,
dnl libcyassl found, set the variable dnl libcyassl found, set the variable
[ [
AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled]) AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled])
@@ -1916,7 +2006,7 @@ if test "$OPENSSL_ENABLED" != "1"; then
CPPFLAGS="$CPPFLAGS $addcflags" CPPFLAGS="$CPPFLAGS $addcflags"
fi fi
AC_CHECK_LIB(cyassl, InitCyaSSL, AC_CHECK_LIB(cyassl, CyaSSL_Init,
[ [
AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled]) AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled])
AC_SUBST(USE_CYASSL, [1]) AC_SUBST(USE_CYASSL, [1])
@@ -1941,11 +2031,12 @@ if test "$OPENSSL_ENABLED" != "1"; then
dnl linker doesn't search through, we need to add it to dnl linker doesn't search through, we need to add it to
dnl LD_LIBRARY_PATH to prevent further configure tests to fail dnl LD_LIBRARY_PATH to prevent further configure tests to fail
dnl due to this dnl due to this
if test "x$cross_compiling" != "xyes"; then
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$cyassllib" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$cyassllib"
export LD_LIBRARY_PATH export LD_LIBRARY_PATH
AC_MSG_NOTICE([Added $cyassllib to LD_LIBRARY_PATH]) AC_MSG_NOTICE([Added $cyassllib to LD_LIBRARY_PATH])
fi fi
fi
fi fi
@@ -2000,13 +2091,6 @@ if test "$OPENSSL_ENABLED" != "1" -a "$GNUTLS_ENABLED" != "1"; then
nssprefix=$OPT_NSS nssprefix=$OPT_NSS
fi fi
dnl Check for functionPK11_CreateGenericObject
dnl this is needed for using the PEM PKCS#11 module
AC_CHECK_LIB(nss3, PK11_CreateGenericObject,
[
AC_DEFINE(HAVE_PK11_CREATEGENERICOBJECT, 1, [if you have the function PK11_CreateGenericObject])
AC_SUBST(HAVE_PK11_CREATEGENERICOBJECT, [1])
])
if test -n "$addlib"; then if test -n "$addlib"; then
CLEANLIBS="$LIBS" CLEANLIBS="$LIBS"
@@ -2017,7 +2101,8 @@ if test "$OPENSSL_ENABLED" != "1" -a "$GNUTLS_ENABLED" != "1"; then
CPPFLAGS="$CPPFLAGS $addcflags" CPPFLAGS="$CPPFLAGS $addcflags"
fi fi
AC_CHECK_LIB(nss3, NSS_Initialize, dnl The function PK11_CreateGenericObject is needed to load libnsspem.so
AC_CHECK_LIB(nss3, PK11_CreateGenericObject,
[ [
AC_DEFINE(USE_NSS, 1, [if NSS is enabled]) AC_DEFINE(USE_NSS, 1, [if NSS is enabled])
AC_SUBST(USE_NSS, [1]) AC_SUBST(USE_NSS, [1])
@@ -2033,15 +2118,24 @@ if test "$OPENSSL_ENABLED" != "1" -a "$GNUTLS_ENABLED" != "1"; then
if test "x$USE_NSS" = "xyes"; then if test "x$USE_NSS" = "xyes"; then
AC_MSG_NOTICE([detected NSS version $version]) AC_MSG_NOTICE([detected NSS version $version])
dnl NSS_InitContext() was introduced in NSS 3.12.5 and helps to prevent
dnl collisions on NSS initialization/shutdown with other libraries
AC_CHECK_FUNC(NSS_InitContext,
[
AC_DEFINE(HAVE_NSS_INITCONTEXT, 1, [if you have the NSS_InitContext function])
AC_SUBST(HAVE_NSS_INITCONTEXT, [1])
])
dnl when shared libs were found in a path that the run-time 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 linker doesn't search through, we need to add it to
dnl LD_LIBRARY_PATH to prevent further configure tests to fail dnl LD_LIBRARY_PATH to prevent further configure tests to fail
dnl due to this dnl due to this
if test "x$cross_compiling" != "xyes"; then
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff"
export LD_LIBRARY_PATH export LD_LIBRARY_PATH
AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH]) AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH])
fi fi
fi
fi fi
@@ -2197,11 +2291,12 @@ if test X"$OPT_LIBSSH2" != Xno; then
dnl libssh2_session_handshake was added in 1.2.8 dnl libssh2_session_handshake was added in 1.2.8
AC_CHECK_FUNCS( libssh2_version libssh2_init libssh2_exit \ AC_CHECK_FUNCS( libssh2_version libssh2_init libssh2_exit \
libssh2_scp_send64 libssh2_session_handshake) libssh2_scp_send64 libssh2_session_handshake)
if test "x$cross_compiling" != "xyes"; then
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_SSH2" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_SSH2"
export LD_LIBRARY_PATH export LD_LIBRARY_PATH
AC_MSG_NOTICE([Added $DIR_SSH2 to LD_LIBRARY_PATH]) AC_MSG_NOTICE([Added $DIR_SSH2 to LD_LIBRARY_PATH])
fi fi
fi
else else
dnl no libssh2, revert back to clean variables dnl no libssh2, revert back to clean variables
LDFLAGS=$CLEANLDFLAGS LDFLAGS=$CLEANLDFLAGS
@@ -2288,56 +2383,197 @@ if test X"$OPT_LIBRTMP" != Xno; then
fi fi
dnl **********************************************************************
dnl Check for linker switch for versioned symbols
dnl **********************************************************************
versioned_symbols_flavour=
AC_MSG_CHECKING([whether versioned symbols are wanted])
AC_ARG_ENABLE(versioned-symbols,
AC_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library])
AC_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]),
[ case "$enableval" in
yes) AC_MSG_RESULT(yes)
AC_MSG_CHECKING([if libraries can be versioned])
GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
if test -z "$GLD"; then
AC_MSG_RESULT(no)
AC_MSG_WARN([You need an ld version supporting the --version-script option])
else
AC_MSG_RESULT(yes)
if test "x$OPENSSL_ENABLED" = "x1"; then
versioned_symbols_flavour="OPENSSL_"
elif test "x$GNUTLS_ENABLED" == "x1"; then
versioned_symbols_flavour="GNUTLS_"
elif test "x$NSS_ENABLED" == "x1"; then
versioned_symbols_flavour="NSS_"
elif test "x$POLARSSL_ENABLED" == "x1"; then
versioned_symbols_flavour="POLARSSL_"
elif test "x$CYASSL_ENABLED" == "x1"; then
versioned_symbols_flavour="CYASSL_"
elif test "x$AXTLS_ENABLED" == "x1"; then
versioned_symbols_flavour="AXTLS_"
else
versioned_symbols_flavour=""
fi
versioned_symbols="yes"
fi
;;
*) AC_MSG_RESULT(no)
;;
esac
], [
AC_MSG_RESULT(no)
]
)
AC_SUBST(VERSIONED_FLAVOUR, ["$versioned_symbols_flavour"])
AM_CONDITIONAL(VERSIONED_SYMBOLS, test "x$versioned_symbols" = "xyes")
dnl ********************************************************************** dnl **********************************************************************
dnl Check for the presence of IDN libraries and headers dnl Check for the presence of IDN libraries and headers
dnl ********************************************************************** dnl **********************************************************************
AC_MSG_CHECKING([whether to build with libidn]) AC_MSG_CHECKING([whether to build with libidn])
OPT_IDN="default"
AC_ARG_WITH(libidn, AC_ARG_WITH(libidn,
AC_HELP_STRING([--with-libidn=PATH],[Enable libidn usage]) AC_HELP_STRING([--with-libidn=PATH],[Enable libidn usage])
AC_HELP_STRING([--without-libidn],[Disable libidn usage]), AC_HELP_STRING([--without-libidn],[Disable libidn usage]),
[LIBIDN="$withval"]) [OPT_IDN=$withval])
case "$OPT_IDN" in
case "$LIBIDN" in
no) no)
AC_MSG_RESULT(no) dnl --without-libidn option used
want_idn="no"
AC_MSG_RESULT([no])
;; ;;
*) AC_MSG_RESULT(yes) default)
dnl configure option not specified
idn="" want_idn="yes"
dnl if there is a given path, check that FIRST want_idn_path="default"
if test -n "$LIBIDN"; then AC_MSG_RESULT([(assumed) yes])
if test "x$LIBIDN" != "xyes"; then ;;
oldLDFLAGS=$LDFLAGS yes)
oldCPPFLAGS=$CPPFLAGS dnl --with-libidn option used without path
LDFLAGS="$LDFLAGS -L$LIBIDN/lib" want_idn="yes"
CPPFLAGS="$CPPFLAGS -I$LIBIDN/include" want_idn_path="default"
idn="yes" AC_MSG_RESULT([yes])
AC_CHECK_LIB(idn, idna_to_ascii_4i, , ;;
idn="" *)
LDFLAGS=$oldLDFLAGS dnl --with-libidn option used with path
CPPFLAGS=$oldCPPFLAGS) want_idn="yes"
fi want_idn_path="$withval"
fi AC_MSG_RESULT([yes ($withval)])
if test "x$idn" != "xyes"; then
dnl check with default paths
idn="yes"
AC_CHECK_LIB(idn, idna_to_ascii_lz, ,
idn="")
fi
if test "x$idn" = "xyes"; then
curl_idn_msg="enabled"
AC_SUBST(IDN_ENABLED, [1])
dnl different versions of libidn have different setups of these:
AC_CHECK_FUNCS( idn_free idna_strerror tld_strerror)
AC_CHECK_HEADERS( idn-free.h tld.h )
fi
;; ;;
esac esac
if test "$want_idn" = "yes"; then
dnl idn library support has been requested
clean_CPPFLAGS="$CPPFLAGS"
clean_LDFLAGS="$LDFLAGS"
clean_LIBS="$LIBS"
PKGCONFIG="no"
#
if test "$want_idn_path" != "default"; then
dnl path has been specified
IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
CURL_CHECK_PKGCONFIG(libidn, [$IDN_PCDIR])
if test "$PKGCONFIG" != "no"; then
IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
$PKGCONFIG --libs-only-l libidn 2>/dev/null`
IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
$PKGCONFIG --libs-only-L libidn 2>/dev/null`
IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
$PKGCONFIG --cflags-only-I libidn 2>/dev/null`
IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
else
dnl pkg-config not available or provides no info
IDN_LIBS="-lidn"
IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
IDN_CPPFLAGS="-I$want_idn_path/include"
IDN_DIR="$want_idn_path/lib$libsuff"
fi
else
dnl path not specified
CURL_CHECK_PKGCONFIG(libidn)
if test "$PKGCONFIG" != "no"; then
IDN_LIBS=`$PKGCONFIG --libs-only-l libidn 2>/dev/null`
IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn 2>/dev/null`
IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn 2>/dev/null`
IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
else
dnl pkg-config not available or provides no info
IDN_LIBS="-lidn"
fi
fi
#
if test "$PKGCONFIG" != "no"; then
AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
else
AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
fi
#
CPPFLAGS="$IDN_CPPFLAGS $CPPFLAGS"
LDFLAGS="$IDN_LDFLAGS $LDFLAGS"
LIBS="$IDN_LIBS $LIBS"
#
AC_MSG_CHECKING([if idna_to_ascii_4i can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([idna_to_ascii_4i])
],[
AC_MSG_RESULT([yes])
tst_links_libidn="yes"
],[
AC_MSG_RESULT([no])
tst_links_libidn="no"
])
if test "$tst_links_libidn" = "no"; then
AC_MSG_CHECKING([if idna_to_ascii_lz can be linked])
AC_LINK_IFELSE([
AC_LANG_FUNC_LINK_TRY([idna_to_ascii_lz])
],[
AC_MSG_RESULT([yes])
tst_links_libidn="yes"
],[
AC_MSG_RESULT([no])
tst_links_libidn="no"
])
fi
#
if test "$tst_links_libidn" = "yes"; then
AC_DEFINE(HAVE_LIBIDN, 1, [Define to 1 if you have the `idn' library (-lidn).])
dnl different versions of libidn have different setups of these:
AC_CHECK_FUNCS( idn_free idna_strerror tld_strerror )
AC_CHECK_HEADERS( idn-free.h tld.h )
if test "x$ac_cv_header_tld_h" = "xyes"; then
AC_SUBST([IDN_ENABLED], [1])
curl_idn_msg="enabled"
if test -n "$IDN_DIR"; then
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR"
export LD_LIBRARY_PATH
AC_MSG_NOTICE([Added $IDN_DIR to LD_LIBRARY_PATH])
fi
else
AC_MSG_WARN([Libraries for IDN support too old: IDN disabled])
CPPFLAGS="$clean_CPPFLAGS"
LDFLAGS="$clean_LDFLAGS"
LIBS="$clean_LIBS"
fi
else
AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
CPPFLAGS="$clean_CPPFLAGS"
LDFLAGS="$clean_LDFLAGS"
LIBS="$clean_LIBS"
fi
fi
dnl Let's hope this split URL remains working: dnl Let's hope this split URL remains working:
dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \ dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
@@ -2396,6 +2632,7 @@ AC_CHECK_HEADERS(
stdbool.h \ stdbool.h \
arpa/tftp.h \ arpa/tftp.h \
sys/filio.h \ sys/filio.h \
sys/wait.h \
setjmp.h, setjmp.h,
dnl to do if not found dnl to do if not found
[], [],
@@ -2517,6 +2754,7 @@ CURL_CHECK_FUNC_FREEIFADDRS
CURL_CHECK_FUNC_FSETXATTR CURL_CHECK_FUNC_FSETXATTR
CURL_CHECK_FUNC_FTRUNCATE CURL_CHECK_FUNC_FTRUNCATE
CURL_CHECK_FUNC_GETADDRINFO CURL_CHECK_FUNC_GETADDRINFO
CURL_CHECK_FUNC_GAI_STRERROR
CURL_CHECK_FUNC_GETHOSTBYADDR CURL_CHECK_FUNC_GETHOSTBYADDR
CURL_CHECK_FUNC_GETHOSTBYADDR_R CURL_CHECK_FUNC_GETHOSTBYADDR_R
CURL_CHECK_FUNC_GETHOSTBYNAME CURL_CHECK_FUNC_GETHOSTBYNAME
@@ -2540,6 +2778,7 @@ CURL_CHECK_FUNC_SIGINTERRUPT
CURL_CHECK_FUNC_SIGNAL CURL_CHECK_FUNC_SIGNAL
CURL_CHECK_FUNC_SIGSETJMP CURL_CHECK_FUNC_SIGSETJMP
CURL_CHECK_FUNC_SOCKET CURL_CHECK_FUNC_SOCKET
CURL_CHECK_FUNC_SOCKETPAIR
CURL_CHECK_FUNC_STRCASECMP CURL_CHECK_FUNC_STRCASECMP
CURL_CHECK_FUNC_STRCASESTR CURL_CHECK_FUNC_STRCASESTR
CURL_CHECK_FUNC_STRCMPI CURL_CHECK_FUNC_STRCMPI
@@ -2593,7 +2832,7 @@ AC_CHECK_FUNCS([fork \
],[ ],[
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
eval "ac_cv_func_$func=yes" eval "ac_cv_func_$func=yes"
AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$func]), [1], AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1],
[Define to 1 if you have the $func function.]) [Define to 1 if you have the $func function.])
],[ ],[
AC_MSG_RESULT([but still no]) AC_MSG_RESULT([but still no])
@@ -2770,6 +3009,10 @@ AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
) )
CURL_CHECK_OPTION_NTLM_WB
CURL_CHECK_NTLM_WB
dnl ************************************************************ dnl ************************************************************
dnl disable TLS-SRP authentication dnl disable TLS-SRP authentication
dnl dnl
@@ -2816,48 +3059,9 @@ AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
) )
dnl ************************************************************ dnl ************************************************************
dnl Enable hiding of internal symbols in library to reduce its size and dnl hiding of library internal symbols
dnl speed dynamic linking of applications. This currently is only supported
dnl on gcc >= 4.0 and SunPro C.
dnl dnl
AC_MSG_CHECKING([whether to enable hidden symbols in the library]) CURL_CONFIGURE_SYMBOL_HIDING
AC_ARG_ENABLE(hidden-symbols,
AC_HELP_STRING([--enable-hidden-symbols],[Hide internal symbols in library])
AC_HELP_STRING([--disable-hidden-symbols],[Leave all symbols with default visibility in library]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_CHECKING([whether $CC supports it])
if test "$GCC" = yes ; then
if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ||
dnl clang always supports -fvisibility= but it doesn't show up
dnl under --help.
test "$compiler_id" = "CLANG"; then
AC_MSG_RESULT(yes)
AC_DEFINE(CURL_HIDDEN_SYMBOLS, 1, [to enable hidden symbols])
AC_DEFINE(CURL_EXTERN_SYMBOL, [__attribute__ ((visibility ("default")))], [to make a symbol visible])
CFLAGS="$CFLAGS -fvisibility=hidden"
else
AC_MSG_RESULT(no)
fi
else
dnl Test for SunPro cc
if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then
AC_MSG_RESULT(yes)
AC_DEFINE(CURL_HIDDEN_SYMBOLS, 1, [to enable hidden symbols])
AC_DEFINE(CURL_EXTERN_SYMBOL, [__global], [to make a symbol visible])
CFLAGS="$CFLAGS -xldscope=hidden"
else
AC_MSG_RESULT(no)
fi
fi
;;
esac ],
AC_MSG_RESULT(no)
)
dnl ************************************************************ dnl ************************************************************
dnl enforce SONAME bump dnl enforce SONAME bump
@@ -2945,6 +3149,9 @@ if test "x$CURL_DISABLE_HTTP" != "x1"; then
if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \ if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
-o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1"; then -o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM" SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
if test "x$NTLM_WB_ENABLED" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB"
fi
fi fi
fi fi
if test "x$USE_TLS_SRP" = "x1"; then if test "x$USE_TLS_SRP" = "x1"; then
@@ -3055,6 +3262,7 @@ AC_CONFIG_FILES([Makefile \
include/curl/Makefile \ include/curl/Makefile \
src/Makefile \ src/Makefile \
lib/Makefile \ lib/Makefile \
lib/libcurl.vers \
tests/Makefile \ tests/Makefile \
tests/data/Makefile \ tests/data/Makefile \
tests/server/Makefile \ tests/server/Makefile \
@@ -3099,6 +3307,7 @@ AC_MSG_NOTICE([Configured to build curl/libcurl:
IDN support: ${curl_idn_msg} IDN support: ${curl_idn_msg}
Build libcurl: Shared=${enable_shared}, Static=${enable_static} Build libcurl: Shared=${enable_shared}, Static=${enable_static}
Built-in manual: ${curl_manual_msg} Built-in manual: ${curl_manual_msg}
--libcurl option: ${curl_libcurl_msg}
Verbose errors: ${curl_verbose_msg} Verbose errors: ${curl_verbose_msg}
SSPI support: ${curl_sspi_msg} SSPI support: ${curl_sspi_msg}
ca cert bundle: ${ca} ca cert bundle: ${ca}

View File

@@ -6,7 +6,7 @@
# | (__| |_| | _ <| |___ # | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____| # \___|\___/|_| \_\_____|
# #
# Copyright (C) 2001 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al. # Copyright (C) 2001 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
# #
# This software is licensed as described in the file COPYING, which # This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms # you should have received as part of this distribution. The terms
@@ -94,7 +94,7 @@ while test $# -gt 0; do
;; ;;
--version) --version)
echo libcurl @VERSION@ echo libcurl @CURLVERSION@
exit 0 exit 0
;; ;;
@@ -113,7 +113,7 @@ while test $# -gt 0; do
# silent success # silent success
exit 0 exit 0
else else
echo "requested version $checkfor is newer than existing @VERSION@" echo "requested version $checkfor is newer than existing @CURLVERSION@"
exit 1 exit 1
fi fi
;; ;;
@@ -142,9 +142,9 @@ while test $# -gt 0; do
CURLLIBDIR="" CURLLIBDIR=""
fi fi
if test "X@REQUIRE_LIB_DEPS@" = "Xyes"; then if test "X@REQUIRE_LIB_DEPS@" = "Xyes"; then
echo ${CURLLIBDIR}-lcurl @LDFLAGS@ @LIBCURL_LIBS@ @LIBS@ echo ${CURLLIBDIR}-lcurl @LIBCURL_LIBS@ @LIBS@
else else
echo ${CURLLIBDIR}-lcurl @LDFLAGS@ @LIBS@ echo ${CURLLIBDIR}-lcurl @LIBS@
fi fi
;; ;;

View File

@@ -6,21 +6,34 @@
BUGS BUGS
1. Bugs
1.1 There are still bugs
1.2 Where to report
1.3 What to report
1.4 libcurl problems
1.5 Who will fix the problems
1.6 How to get a stack trace
1.7 Bugs in libcurl bindings
==============================================================================
1.1 There are still bugs
Curl and libcurl have grown substantially since the beginning. At the time Curl and libcurl have grown substantially since the beginning. At the time
of writing (July 2007), there are about 47000 lines of source code, and by of writing (September 2011), there are about 66000 lines of source code, and
the time you read this it has probably grown even more. by the time you read this it has probably grown even more.
Of course there are lots of bugs left. And lots of misfeatures. Of course there are lots of bugs left. And lots of misfeatures.
To help us make curl the stable and solid product we want it to be, we need To help us make curl the stable and solid product we want it to be, we need
bug reports and bug fixes. bug reports and bug fixes.
WHERE TO REPORT 1.2 Where to report
If you can't fix a bug yourself and submit a fix for it, try to report an as If you can't fix a bug yourself and submit a fix for it, try to report an as
detailed report as possible to a curl mailing list to allow one of us to detailed report as possible to a curl mailing list to allow one of us to
have a go at a solution. You should also post your bug/problem at curl's bug have a go at a solution. You can optionally also post your bug/problem at
tracking system over at curl's bug tracking system over at
http://sourceforge.net/bugs/?group_id=976 http://sourceforge.net/bugs/?group_id=976
@@ -29,16 +42,18 @@ WHERE TO REPORT
If you feel you need to ask around first, find a suitable mailing list and If you feel you need to ask around first, find a suitable mailing list and
post there. The lists are available on http://curl.haxx.se/mail/ post there. The lists are available on http://curl.haxx.se/mail/
WHAT TO REPORT 1.3 What to report
When reporting a bug, you should include all information that will help us When reporting a bug, you should include all information that will help us
understand what's wrong, what you expected to happen and how to repeat the understand what's wrong, what you expected to happen and how to repeat the
bad behavior. You therefore need to tell us: bad behavior. You therefore need to tell us:
- your operating system's name and version number (uname -a under a unix - your operating system's name and version number
is fine)
- what version of curl you're using (curl -V is fine) - what version of curl you're using (curl -V is fine)
- versions of the used libraries that libcurl is built to use - versions of the used libraries that libcurl is built to use
- what URL you were working with (if possible), at least which protocol - what URL you were working with (if possible), at least which protocol
and anything and everything else you think matters. Tell us what you and anything and everything else you think matters. Tell us what you
@@ -59,7 +74,48 @@ WHAT TO REPORT
The address and how to subscribe to the mailing lists are detailed in the The address and how to subscribe to the mailing lists are detailed in the
MANUAL file. MANUAL file.
HOW TO GET A STACK TRACE 1.4 libcurl problems
First, post all libcurl problems on the curl-library mailing list.
When you've written your own application with libcurl to perform transfers,
it is even more important to be specific and detailed when reporting bugs.
Tell us the libcurl version and your operating system. Tell us the name and
version of all relevant sub-components like for example the SSL library
you're using and what name resolving your libcurl uses. If you use SFTP or
SCP, the libssh2 version is relevant etc.
Showing us a real source code example repeating your problem is the best way
to get our attention and it will greatly increase our chances to understand
your problem and to work on a fix (if we agree it truly is a problem).
Lots of problems that appear to be libcurl problems are actually just abuses
of the libcurl API or other malfunctions in your applications. It is adviced
that you run your problematic program using a memory debug tool like
valgrind or similar before you post memory-related or "crashing" problems to
us.
1.5 Who will fix the problems
If the problems or bugs you describe are considered to be bugs, we want to
have the problems fixed.
There are no developers in the curl project that are paid to work on bugs.
All developers that take on reported bugs do this on a voluntary basis. We
do it out of an ambition to keep curl and libcurl excellent products and out
of pride.
But please do not assume that you can just lump over something to us and it
will then magically be fixed after some given time. Most often we need
feedback and help to understand what you've experienced and how to repeat a
problem. Then we may only be able to assist YOU to debug the problem and to
track down the proper fix.
We get reports from many people every month and each report can take a
considerable amount of time to really go to the bottom with.
1.6 How to get a stack trace
First, you must make sure that you compile all sources with -g and that you First, you must make sure that you compile all sources with -g and that you
don't 'strip' the final executable. Try to avoid optimizing the code as don't 'strip' the final executable. Try to avoid optimizing the code as
@@ -79,3 +135,12 @@ HOW TO GET A STACK TRACE
crashed. Include the stack trace with your detailed bug report. It'll help a crashed. Include the stack trace with your detailed bug report. It'll help a
lot. lot.
1.7 Bugs in libcurl bindings
There will of course pop up bugs in libcurl bindings. You should then
primarily approach the team that works on that particular binding and see
what you can do to help them fix the problem.
If you suspect that the problem exists in the underlying libcurl, then
please convert your program over to plain C and follow the steps outlined
above.

View File

@@ -34,6 +34,7 @@
3.3 How To Make a Patch without git 3.3 How To Make a Patch without git
3.4 How to get your changes into the main sources 3.4 How to get your changes into the main sources
3.5 Write good commit messages 3.5 Write good commit messages
3.6 Please don't send pull requests
============================================================================== ==============================================================================
@@ -276,3 +277,27 @@
and make sure that you have your own user and email setup correctly in git and make sure that you have your own user and email setup correctly in git
before you commit before you commit
3.6 Please don't send pull requests
With git (and expecially github) it is easy and tempting to send a pull
request to one or more people in the curl project to have changes merged this
way instead of mailing patches to the curl-library mailing list.
We don't like that. We want them mailed for these reasons:
- Peer review. Anyone and everyone on the list can review, comment and
improve on the patch. Pull requests limit this ability.
- Anyone can merge the patch into their own trees for testing and those who
have push rights can push it to the main repo. It doesn't have to be anyone
the patch author knows beforehand.
- Commit messages can be tweaked and changed if merged locally instead of
using github. Merges directly on github requires the changes to be perfect
already, which they seldomly are.
- Merges on github prevents rebases and even enforces --no-ff which is a git
style we don't otherwise use in the project
However: once patches have been reviewed and deemed fine on list they are
perfectly OK to be pulled from a published git tree.

View File

@@ -1,4 +1,4 @@
Updated: March 8, 2011 (http://curl.haxx.se/docs/faq.html) Updated: December 7, 2011 (http://curl.haxx.se/docs/faq.html)
_ _ ____ _ _ _ ____ _
___| | | | _ \| | ___| | | | _ \| |
/ __| | | | |_) | | / __| | | | |_) | |
@@ -36,7 +36,7 @@ FAQ
3.2 How do I tell curl to resume a transfer? 3.2 How do I tell curl to resume a transfer?
3.3 Why doesn't my posting using -F work? 3.3 Why doesn't my posting using -F work?
3.4 How do I tell curl to run custom FTP commands? 3.4 How do I tell curl to run custom FTP commands?
3.5 How can I disable the Pragma: nocache header? 3.5 How can I disable the Accept: */* header?
3.6 Does curl support ASP, XML, XHTML or HTML version Y? 3.6 Does curl support ASP, XML, XHTML or HTML version Y?
3.7 Can I use curl to delete/rename a file through FTP? 3.7 Can I use curl to delete/rename a file through FTP?
3.8 How do I tell curl to follow HTTP redirects? 3.8 How do I tell curl to follow HTTP redirects?
@@ -306,41 +306,10 @@ FAQ
We don't know how many users that downloaded or installed curl and then We don't know how many users that downloaded or installed curl and then
never use it. never use it.
Some facts to use as input to the math: In May 2012 Daniel did a counting game and came up with a number that may
be completely wrong or somewhat accurate. 300 million!
curl packages are downloaded from the curl.haxx.se and mirrors over a See http://daniel.haxx.se/blog/2012/05/16/300m-users/
million times per year. curl is installed by default with most Linux
distributions. curl is installed by default with Mac OS X. curl and libcurl
as used by numerous applications that include libcurl binaries in their
distribution packages (like Adobe Acrobat Reader and Google Earth).
More than a hundred known named companies use curl in commercial
environments and products and more than a hundred known named open source
projects depend on (lib)curl.
In a poll on the curl web site mid-2005, more than 50% of the 300+ answers
estimated a user base of one million users or more.
In March 2005, the "Linux Counter project" estimated a total Linux user base
of some 29 millions, while Netcraft detected some 4 million "active" Linux
based web servers. A guess is that a fair amount of these Linux
installations have curl installed.
The Debian project maintains statistics on packages installed by people
who have voluntarily run their package counting application. In mid-2010,
libcurl3 was installed on over 55000 such systems (62% of reporting systems)
and was one of the 320 most popular installed packages (out of about 107000
possible packages).
All this taken together, there is no doubt that there are millions of
(lib)curl users.
http://curl.haxx.se/docs/companies.html
http://curl.haxx.se/docs/programs.html
http://curl.haxx.se/libcurl/using/apps.html
http://counter.li.org/estimates.php
http://news.netcraft.com/archives/2005/03/14/fedora_makes_rapid_progress.html
http://qa.debian.org/popcon.php?package=curl
1.11 Why don't you update ca-bundle.crt 1.11 Why don't you update ca-bundle.crt
@@ -491,7 +460,6 @@ FAQ
3.2 How do I tell curl to resume a transfer? 3.2 How do I tell curl to resume a transfer?
Curl supports resumed transfers both ways on both FTP and HTTP. Curl supports resumed transfers both ways on both FTP and HTTP.
Try the -C option. Try the -C option.
3.3 Why doesn't my posting using -F work? 3.3 Why doesn't my posting using -F work?
@@ -517,11 +485,11 @@ FAQ
FTP commands without transferring anything. Therefore you must always specify FTP commands without transferring anything. Therefore you must always specify
a URL to transfer to/from even when doing custom FTP commands. a URL to transfer to/from even when doing custom FTP commands.
3.5 How can I disable the Pragma: nocache header? 3.5 How can I disable the Accept: */* header?
You can change all internally generated headers by adding a replacement with You can change all internally generated headers by adding a replacement with
the -H/--header option. By adding a header with empty contents you safely the -H/--header option. By adding a header with empty contents you safely
disable that one. Use -H "Pragma:" to disable that specific header. disable that one. Use -H "Accept:" to disable that specific header.
3.6 Does curl support ASP, XML, XHTML or HTML version Y? 3.6 Does curl support ASP, XML, XHTML or HTML version Y?
@@ -565,6 +533,12 @@ FAQ
install and use them, in the libcurl section of the curl web site: install and use them, in the libcurl section of the curl web site:
http://curl.haxx.se/libcurl/ http://curl.haxx.se/libcurl/
All the various bindings to libcurl are made by other projects and people,
outside of the cURL project. The cURL project itself only produces libcurl
with its plain C API. If you don't find anywhere else to ask you can ask
about bindings on the curl-library list too, but be prepared that people on
that list may not know anything about bindings.
In October 2009, there were interfaces available for the following In October 2009, there were interfaces available for the following
languages: Ada95, Basic, C, C++, Ch, Cocoa, D, Dylan, Eiffel, Euphoria, languages: Ada95, Basic, C, C++, Ch, Cocoa, D, Dylan, Eiffel, Euphoria,
Ferite, Gambas, glib/GTK+, Haskell, ILE/RPG, Java, Lisp, Lua, Mono, .NET, Ferite, Gambas, glib/GTK+, Haskell, ILE/RPG, Java, Lisp, Lua, Mono, .NET,
@@ -721,6 +695,12 @@ FAQ
curl --header "Host: www.example.com" http://127.0.0.1/ curl --header "Host: www.example.com" http://127.0.0.1/
You can also opt to add faked host name entries to curl with the --resolve
option. That has the added benefit that things like redirects will also work
properly. The above operation would instead be done as:
curl --resolve www.example.com:80:127.0.0.1 http://www.example.com/
3.20 How to SFTP from my user's home directory? 3.20 How to SFTP from my user's home directory?
Contrary to how FTP works, SFTP and SCP URLs specify the exact directory to Contrary to how FTP works, SFTP and SCP URLs specify the exact directory to
@@ -1152,6 +1132,11 @@ FAQ
libcurl will reuse connections for all transfers that are made using the libcurl will reuse connections for all transfers that are made using the
same libcurl handle. same libcurl handle.
When you use the easy interface, the connection cache is kept within the
easy handle. If you instead use the multi interface, the connection cache
will be kept within the multi handle and will be shared among all the easy
handles that are used within the same multi handle.
5.7 Link errors when building libcurl on Windows! 5.7 Link errors when building libcurl on Windows!
You need to make sure that your project, and all the libraries (both static You need to make sure that your project, and all the libraries (both static
@@ -1260,14 +1245,13 @@ FAQ
With the easy interface you make sure to return the correct error code from With the easy interface you make sure to return the correct error code from
one of the callbacks, but none of them are instant. There is no function you one of the callbacks, but none of them are instant. There is no function you
can call from another thread or similar that will stop it immediately. can call from another thread or similar that will stop it immediately.
Instead you need to make sure that one of the callbacks you use return an Instead, you need to make sure that one of the callbacks you use returns an
appropriate value that will stop the transfer. appropriate value that will stop the transfer. Suitable callbacks that you
can do this with include the progress callback, the read callback and the
Suitable callbacks that you can do this with include the progress callback, write callback.
the read callback and the write callback.
If you're using the multi interface, you can also stop a transfer by If you're using the multi interface, you can also stop a transfer by
removing the particular easy handle from the multi stack. At any moment you removing the particular easy handle from the multi stack at any moment you
think the transfer is done. think the transfer is done.
5.14 Using C++ non-static functions for callbacks? 5.14 Using C++ non-static functions for callbacks?

View File

@@ -14,6 +14,12 @@ Installing Binary Packages
binary package. This document describes how to compile, build and install binary package. This document describes how to compile, build and install
curl and libcurl from source code. curl and libcurl from source code.
Building from git
=================
If you get your code off a git repository, see the GIT-INFO file in the
root directory for specific instructions on how to proceed.
UNIX UNIX
==== ====
A normal unix installation is made in three or four steps (after you've A normal unix installation is made in three or four steps (after you've
@@ -211,9 +217,9 @@ Win32
adjust as necessary. It is also possible to override these paths with adjust as necessary. It is also possible to override these paths with
environment variables, for example: environment variables, for example:
set ZLIB_PATH=c:\zlib-1.2.5 set ZLIB_PATH=c:\zlib-1.2.7
set OPENSSL_PATH=c:\openssl-0.9.8r set OPENSSL_PATH=c:\openssl-0.9.8x
set LIBSSH2_PATH=c:\libssh2-1.2.7 set LIBSSH2_PATH=c:\libssh2-1.4.2
ATTENTION: if you want to build with libssh2 support you have to use latest ATTENTION: if you want to build with libssh2 support you have to use latest
version 0.17 - previous versions will NOT work with 7.17.0 and later! version 0.17 - previous versions will NOT work with 7.17.0 and later!
@@ -314,7 +320,7 @@ Win32
documentation on how to compile zlib. Define the ZLIB_PATH environment documentation on how to compile zlib. Define the ZLIB_PATH environment
variable to the location of zlib.h and zlib.lib, for example: variable to the location of zlib.h and zlib.lib, for example:
set ZLIB_PATH=c:\zlib-1.2.5 set ZLIB_PATH=c:\zlib-1.2.7
Then run 'nmake vc-zlib' in curl's root directory. Then run 'nmake vc-zlib' in curl's root directory.
@@ -328,7 +334,7 @@ Win32
Before running nmake define the OPENSSL_PATH environment variable with Before running nmake define the OPENSSL_PATH environment variable with
the root/base directory of OpenSSL, for example: the root/base directory of OpenSSL, for example:
set OPENSSL_PATH=c:\openssl-0.9.8q set OPENSSL_PATH=c:\openssl-0.9.8x
Then run 'nmake vc-ssl' or 'nmake vc-ssl-dll' in curl's root Then run 'nmake vc-ssl' or 'nmake vc-ssl-dll' in curl's root
directory. 'nmake vc-ssl' will create a libcurl static and dynamic directory. 'nmake vc-ssl' will create a libcurl static and dynamic
@@ -461,6 +467,34 @@ Win32
in the vc6libcurl.dsw/vc6libcurl.dsp Visual C++ 6 IDE project. in the vc6libcurl.dsw/vc6libcurl.dsp Visual C++ 6 IDE project.
Using BSD-style lwIP instead of Winsock TCP/IP stack in Win32 builds
--------------------------------------------------------------------
In order to compile libcurl and curl using BSD-style lwIP TCP/IP stack
it is necessary to make definition of preprocessor symbol USE_LWIPSOCK
visible to libcurl and curl compilation processes. To set this definition
you have the following alternatives:
- Modify lib/config-win32.h and src/config-win32.h
- Modify lib/Makefile.vc6
- Add definition to Project/Settings/C/C++/General/Preprocessor Definitions
in the vc6libcurl.dsw/vc6libcurl.dsp Visual C++ 6 IDE project.
Once that libcurl has been built with BSD-style lwIP TCP/IP stack support,
in order to use it with your program it is mandatory that your program
includes lwIP header file <lwip/opt.h> (or another lwIP header that includes
this) before including any libcurl header. Your program does not need the
USE_LWIPSOCK preprocessor definition which is for libcurl internals only.
Compilation has been verified with lwIP 1.4.0 and contrib-1.4.0 from:
http://download.savannah.gnu.org/releases/lwip/lwip-1.4.0.zip
http://download.savannah.gnu.org/releases/lwip/contrib-1.4.0.zip
This BSD-style lwIP TCP/IP stack support must be considered experimental
given that it has been verified that lwIP 1.4.0 still needs some polish,
and libcurl might yet need some additional adjustment, caveat emptor.
Important static libcurl usage note Important static libcurl usage note
----------------------------------- -----------------------------------
@@ -806,7 +840,30 @@ VxWorks
Android Android
======= =======
See the build notes in the Android.mk file. Method using the static makefile:
- see the build notes in the Android.mk file.
Method using a configure cross-compile (tested with Android NDK r7b):
- prepare the toolchain of the Android NDK for standalone use; this can
be done by invoking the script:
./tools/make-standalone-toolchain.sh
which creates a usual cross-compile toolchain. Lets assume that you put
this toolchain below /opt then invoke configure with something like:
export PATH=/opt/arm-linux-androideabi-4.4.3/bin:$PATH
./configure --host=arm-linux-androideabi [more configure options]
make
- if you want to compile directly from our GIT repo you might run into
this issue with older automake stuff:
checking host system type...
Invalid configuration `arm-linux-androideabi':
system `androideabi' not recognized
configure: error: /bin/sh ./config.sub arm-linux-androideabi failed
this issue can be fixed with using more recent versions of config.sub
and config.guess which can be obtained here:
http://git.savannah.gnu.org/gitweb/?p=config.git;a=tree
you need to replace your system-own versions which usually can be
found in your automake folder:
find /usr -name config.sub
CROSS COMPILE CROSS COMPILE

16
docs/INSTALL.cmake Executable file → Normal file
View File

@@ -18,6 +18,17 @@ Building with CMake
CMake builds can be configured either from the command line, or from one CMake builds can be configured either from the command line, or from one
of CMake's GUI's. of CMake's GUI's.
Important notice
==================
If you got your curl sources from a distribution tarball, make sure to
delete the generic 'include/curl/curlbuild.h' file that comes with it:
rm -f curl/include/curl/curlbuild.h
The purpose of this file is to provide reasonable definitions for systems
where autoconfiguration is not available. CMake will create its own
version of this file in its build directory. If the "generic" version
is not deleted, weird build errors may occur on some systems.
Command Line CMake Command Line CMake
================== ==================
A command line build of Curl is similar to the autotools build of Curl. It A command line build of Curl is similar to the autotools build of Curl. It
@@ -32,9 +43,10 @@ Command Line CMake
# variable prior to running CMake. # variable prior to running CMake.
cmake ../curl cmake ../curl
make make
# currently make test and make install are not implemented # currently make test is not implemented
#make test #make test
#make install # Install to default location:
make install
ccmake ccmake
========= =========

View File

@@ -39,11 +39,11 @@ Portability
libssh2 0.16 libssh2 0.16
c-ares 1.6.0 c-ares 1.6.0
libidn 0.4.1 libidn 0.4.1
cyassl 1.4.0 cyassl 2.0.0
openldap 2.0 openldap 2.0
MIT krb5 lib 1.2.4 MIT krb5 lib 1.2.4
qsossl V5R2M0 qsossl V5R2M0
NSS 3.11.x NSS 3.12.x
axTLS 1.2.7 axTLS 1.2.7
Heimdal ? Heimdal ?
@@ -68,7 +68,7 @@ Portability
GNU Autoconf 2.57 GNU Autoconf 2.57
GNU Automake 1.7 (we currently avoid 1.10 due to Solaris-related bugs) GNU Automake 1.7 (we currently avoid 1.10 due to Solaris-related bugs)
GNU M4 1.4 GNU M4 1.4
perl 4 perl 5.004
roffit 0.5 roffit 0.5
groff ? (any version that supports "groff -Tps -man [in] [out]") groff ? (any version that supports "groff -Tps -man [in] [out]")
ps2pdf (gs) ? ps2pdf (gs) ?
@@ -104,9 +104,9 @@ Windows vs Unix
Inside the source code, We make an effort to avoid '#ifdef [Your OS]'. All Inside the source code, We make an effort to avoid '#ifdef [Your OS]'. All
conditionals that deal with features *should* instead be in the format conditionals that deal with features *should* instead be in the format
'#ifdef HAVE_THAT_WEIRD_FUNCTION'. Since Windows can't run configure scripts, '#ifdef HAVE_THAT_WEIRD_FUNCTION'. Since Windows can't run configure scripts,
we maintain two curl_config-win32.h files (one in lib/ and one in src/) that we maintain a curl_config-win32.h file in lib directory that is supposed to
are supposed to look exactly as a curl_config.h file would have looked like on look exactly as a curl_config.h file would have looked like on a Windows
a Windows machine! machine!
Generally speaking: always remember that this will be compiled on dozens of Generally speaking: always remember that this will be compiled on dozens of
operating systems. Don't walk on the edge. operating systems. Don't walk on the edge.

View File

@@ -3,6 +3,15 @@ join in and help us correct one or more of these! Also be sure to check the
changelog of the current development status, as one or more of these problems changelog of the current development status, as one or more of these problems
may have been fixed since this was written! may have been fixed since this was written!
78. curl and libcurl don't always signal the client properly when "sending"
zero bytes files - it makes for example the command line client not creating
any file at all. Like when using FTP.
http://curl.haxx.se/bug/view.cgi?id=3438362
77. CURLOPT_FORBID_REUSE on a handle prevents NTLM from working since it
"absuses" the underlying connection re-use system and if connections are
forced to close they break the NTLM support.
76. The SOCKET type in Win64 is 64 bits large (and thus so is curl_socket_t on 76. The SOCKET type in Win64 is 64 bits large (and thus so is curl_socket_t on
that platform), and long is only 32 bits. It makes it impossible for that platform), and long is only 32 bits. It makes it impossible for
curl_easy_getinfo() to return a socket properly with the CURLINFO_LASTSOCKET curl_easy_getinfo() to return a socket properly with the CURLINFO_LASTSOCKET
@@ -12,12 +21,6 @@ may have been fixed since this was written!
http://curl.haxx.se/mail/lib-2009-10/0024.html http://curl.haxx.se/mail/lib-2009-10/0024.html
http://curl.haxx.se/bug/view.cgi?id=2944325 http://curl.haxx.se/bug/view.cgi?id=2944325
74. The HTTP spec allows headers to be merged and become comma-separated
instead of being repeated several times. This also include Authenticate: and
Proxy-Authenticate: headers and while this hardly every happens in real life
it will confuse libcurl which does not properly support it for all headers -
like those Authenticate headers.
73. if a connection is made to a FTP server but the server then just never 73. if a connection is made to a FTP server but the server then just never
sends the 220 response or otherwise is dead slow, libcurl will not sends the 220 response or otherwise is dead slow, libcurl will not
acknowledge the connection timeout during that phase but only the "real" acknowledge the connection timeout during that phase but only the "real"

View File

@@ -13,6 +13,7 @@ MAIL ETIQUETTE
1.4 Subscription Required 1.4 Subscription Required
1.5 Moderation of new posters 1.5 Moderation of new posters
1.6 Handling trolls and spam 1.6 Handling trolls and spam
1.7 How to unsubscribe
2. Sending mail 2. Sending mail
2.1 Reply or New Mail 2.1 Reply or New Mail
@@ -110,6 +111,20 @@ MAIL ETIQUETTE
Don't feed the trolls! Don't feed the trolls!
1.7 How to unsubscribe
You unsubscribe the same way you subscribed in the first place. You go to
the page for the particular mailing list you're subscribed to and you enter
your email address and password and press the unsubscribe button.
Also, this information is included in the headers of every mail that is sent
out to all curl related mailing lists and there's footer in each mail that
links to the "admin" page on which you can unsubscribe and change other
options.
You NEVER EVER email the mailing list requesting someone else to get you off
the list.
2. Sending mail 2. Sending mail

View File

@@ -328,7 +328,7 @@ POST (HTTP)
If the content-type is not specified, curl will try to guess from the file If the content-type is not specified, curl will try to guess from the file
extension (it only knows a few), or use the previously specified type (from extension (it only knows a few), or use the previously specified type (from
an earlier file if several files are specified in a list) or else it will an earlier file if several files are specified in a list) or else it will
using the default type 'text/plain'. use the default type 'application/octet-stream'.
Emulate a fill-in form with -F. Let's say you fill in three fields in a Emulate a fill-in form with -F. Let's say you fill in three fields in a
form. One field is a file name which to post, one field is your name and one form. One field is a file name which to post, one field is your name and one

View File

@@ -22,9 +22,9 @@
AUTOMAKE_OPTIONS = foreign no-dependencies AUTOMAKE_OPTIONS = foreign no-dependencies
man_MANS = curl.1 curl-config.1 man_MANS = curl.1 curl-config.1 mk-ca-bundle.1
GENHTMLPAGES = curl.html curl-config.html GENHTMLPAGES = curl.html curl-config.html mk-ca-bundle.html
PDFPAGES = curl.pdf curl-config.pdf PDFPAGES = curl.pdf curl-config.pdf mk-ca-bundle.pdf
HTMLPAGES = $(GENHTMLPAGES) index.html HTMLPAGES = $(GENHTMLPAGES) index.html

0
docs/README.cmake Executable file → Normal file
View File

View File

@@ -5,21 +5,28 @@
If you have contributed but are missing here, please let us know! If you have contributed but are missing here, please let us know!
Aaron Oneal Aaron Oneal
Aaron Orenstein
Adam D. Moss Adam D. Moss
Adam Light Adam Light
Adam Piggott Adam Piggott
Adam Tkac
Adrian Schuur Adrian Schuur
Adriano Meirelles
Akos Pasztory Akos Pasztory
Alan Pinstein Alan Pinstein
Albert Chin
Albert Chin-A-Young Albert Chin-A-Young
Albert Choy Albert Choy
Ale Vesely Ale Vesely
Alejandro Alvarez
Aleksandar Milivojevic Aleksandar Milivojevic
Alessandro Ghedini
Alessandro Vesely Alessandro Vesely
Alex Bligh Alex Bligh
Alex Fishman Alex Fishman
Alex Neblett Alex Neblett
Alex Suykov Alex Suykov
Alex Vinnik
Alex aka WindEagle Alex aka WindEagle
Alexander Beedie Alexander Beedie
Alexander Kourakos Alexander Kourakos
@@ -29,6 +36,7 @@ Alexander Zhuravlev
Alexey Borzov Alexey Borzov
Alexey Pesternikov Alexey Pesternikov
Alexey Simak Alexey Simak
Alexey Zakhlestin
Alexis Carvalho Alexis Carvalho
Alfred Gebert Alfred Gebert
Allen Pulsifer Allen Pulsifer
@@ -47,6 +55,7 @@ Andreas Rieke
Andreas Schuldei Andreas Schuldei
Andreas Wurf Andreas Wurf
Andrei Benea Andrei Benea
Andrei Cipu
Andres Garcia Andres Garcia
Andrew Benham Andrew Benham
Andrew Biggs Andrew Biggs
@@ -63,10 +72,12 @@ Andy Tsouladze
Angus Mackay Angus Mackay
Anthony Bryan Anthony Bryan
Antoine Calando Antoine Calando
Anton Bychkov
Anton Kalmykov Anton Kalmykov
Arkadiusz Miskiewicz Arkadiusz Miskiewicz
Armel Asselin Armel Asselin
Arnaud Ebalard Arnaud Ebalard
Arthur Murray
Arve Knudsen Arve Knudsen
Ates Goral Ates Goral
Augustus Saunders Augustus Saunders
@@ -78,10 +89,13 @@ Bas Mevissen
Ben Darnell Ben Darnell
Ben Greear Ben Greear
Ben Madsen Ben Madsen
Ben Noordhuis
Ben Van Hof Ben Van Hof
Ben Winslow
Benbuck Nason Benbuck Nason
Benjamin Gerard Benjamin Gerard
Bernard Leak Bernard Leak
Bernhard Reutner-Fischer
Bertrand Demiddelaer Bertrand Demiddelaer
Bill Egert Bill Egert
Bill Hoffman Bill Hoffman
@@ -96,6 +110,7 @@ Brad Burdick
Brad Hards Brad Hards
Brad King Brad King
Bradford Bruce Bradford Bruce
Brandon Wang
Brendan Jurd Brendan Jurd
Brent Beardsley Brent Beardsley
Brian Akins Brian Akins
@@ -112,7 +127,9 @@ Camille Moncelier
Caolan McNamara Caolan McNamara
Carsten Lange Carsten Lange
Casey O'Donnell Casey O'Donnell
Cedric Deltheil
Chad Monroe Chad Monroe
Chandrakant Bagul
Charles Kerr Charles Kerr
Chih-Chung Chang Chih-Chung Chang
Chris "Bob Bob" Chris "Bob Bob"
@@ -123,6 +140,9 @@ Chris Flerackers
Chris Gaukroger Chris Gaukroger
Chris Maltby Chris Maltby
Chris Mumford Chris Mumford
Chris Smowton
Christian Grothoff
Christian Hagele
Christian Krause Christian Krause
Christian Kurz Christian Kurz
Christian Robottom Reis Christian Robottom Reis
@@ -133,6 +153,7 @@ Christophe Legry
Christopher Conroy Christopher Conroy
Christopher Palow Christopher Palow
Christopher R. Palmer Christopher R. Palmer
Christopher Stone
Ciprian Badescu Ciprian Badescu
Claes Jakobsson Claes Jakobsson
Clarence Gardner Clarence Gardner
@@ -147,8 +168,10 @@ Craig A West
Craig Davison Craig Davison
Craig Markwardt Craig Markwardt
Cris Bailiff Cris Bailiff
Cristian Rodriguez
Curt Bogmine Curt Bogmine
Cyrill Osterwalder Cyrill Osterwalder
Dagobert Michelsen
Damien Adant Damien Adant
Dan Becker Dan Becker
Dan C Dan C
@@ -216,6 +239,7 @@ Dmitry Rechkin
Dolbneff A.V Dolbneff A.V
Domenico Andreoli Domenico Andreoli
Dominick Meglio Dominick Meglio
Dominique Leuenberger
Doug Kaufman Doug Kaufman
Doug Porter Doug Porter
Douglas E. Wegscheid Douglas E. Wegscheid
@@ -256,6 +280,7 @@ Erwin Authried
Eugene Kotlyarov Eugene Kotlyarov
Evan Jordan Evan Jordan
Eygene Ryabinkin Eygene Ryabinkin
Fabian Hiernaux
Fabian Keil Fabian Keil
Fabrizio Ammollo Fabrizio Ammollo
Fedor Karpelevitch Fedor Karpelevitch
@@ -268,11 +293,13 @@ Frank Keeney
Frank McGeough Frank McGeough
Frank Meier Frank Meier
Frank Ticheler Frank Ticheler
Frank Van Uffelen
Fred Machado Fred Machado
Fred New Fred New
Fred Noz Fred Noz
Frederic Lepied Frederic Lepied
Gabriel Kuri Gabriel Kuri
Garrett Holmstrom
Gary Maxwell Gary Maxwell
Gautam Kachroo Gautam Kachroo
Gautam Mani Gautam Mani
@@ -296,6 +323,7 @@ Giuseppe Attardi
Giuseppe D'Ambrosio Giuseppe D'Ambrosio
Glen Nakamura Glen Nakamura
Glen Scott Glen Scott
Gokhan Sengun
Grant Erickson Grant Erickson
Greg Hewgill Greg Hewgill
Greg Morse Greg Morse
@@ -320,6 +348,8 @@ Heikki Korpela
Heinrich Ko Heinrich Ko
Hendrik Visage Hendrik Visage
Henrik Storner Henrik Storner
Henry Ludemann
Herve Amblard
Hidemoto Nakada Hidemoto Nakada
Hoi-Ho Chan Hoi-Ho Chan
Hongli Lai Hongli Lai
@@ -361,6 +391,8 @@ Jan Kunder
Jan Van Boghout Jan Van Boghout
Jared Lundell Jared Lundell
Jari Sundell Jari Sundell
Jason Glasgow
Jason Liu
Jason McDonald Jason McDonald
Jason S. Priebe Jason S. Priebe
Jay Austin Jay Austin
@@ -381,11 +413,13 @@ Jeffrey Pohlmeyer
Jeremy Friesner Jeremy Friesner
Jerome Muffat-Meridol Jerome Muffat-Meridol
Jerome Vouillon Jerome Vouillon
Jerry Wu
Jes Badwal Jes Badwal
Jesper Jensen Jesper Jensen
Jesse Noller Jesse Noller
Jim Drash Jim Drash
Jim Freeman Jim Freeman
Jim Hollinger
Jim Meyering Jim Meyering
Jocelyn Jaubert Jocelyn Jaubert
Joe Halpin Joe Halpin
@@ -395,11 +429,13 @@ Jofell Gallardo
Johan Anderson Johan Anderson
Johan Nilsson Johan Nilsson
Johan van Selst Johan van Selst
Johannes Bauer
John Bradshaw John Bradshaw
John Crow John Crow
John Dennis John Dennis
John E. Malmberg John E. Malmberg
John Janssen John Janssen
John Joseph Bachir
John Kelly John Kelly
John Lask John Lask
John Lightsey John Lightsey
@@ -414,6 +450,7 @@ Jon Sargeant
Jon Travis Jon Travis
Jon Turner Jon Turner
Jonas Forsman Jonas Forsman
Jonas Schnelli
Jonatan Lander Jonatan Lander
Jonathan Hseu Jonathan Hseu
Jongki Suwandi Jongki Suwandi
@@ -421,6 +458,8 @@ Jose Kahan
Josef Wolf Josef Wolf
Josh Kapell Josh Kapell
Joshua Kwan Joshua Kwan
Josue Andrade Gomes
Juan Barreto
Juan F. Codagnone Juan F. Codagnone
Juan Ignacio Herv<72>s Juan Ignacio Herv<72>s
Judson Bishop Judson Bishop
@@ -428,6 +467,7 @@ Juergen Wilke
Jukka Pihl Jukka Pihl
Julian Noble Julian Noble
Julien Chaffraix Julien Chaffraix
Julien Royer
Jun-ichiro itojun Hagino Jun-ichiro itojun Hagino
Jurij Smakov Jurij Smakov
Justin Fletcher Justin Fletcher
@@ -438,6 +478,7 @@ Kai-Uwe Rommel
Kalle Vahlman Kalle Vahlman
Kamil Dudka Kamil Dudka
Kang-Jin Lee Kang-Jin Lee
Karl M
Karl Moerder Karl Moerder
Karol Pietrzak Karol Pietrzak
Kaspar Brand Kaspar Brand
@@ -498,16 +539,22 @@ Luke Call
Luong Dinh Dung Luong Dinh Dung
Maciej Karpiuk Maciej Karpiuk
Maciej W. Rozycki Maciej W. Rozycki
Mamoru Tasaka
Mandy Wu
Manfred Schwarb Manfred Schwarb
Manuel Massing
Marc Boucher Marc Boucher
Marc Kleine-Budde Marc Kleine-Budde
Marcel Roelofs Marcel Roelofs
Marcelo Juchem Marcelo Juchem
Marcin Adamski
Marcin Konicki Marcin Konicki
Marco G. Salvagno Marco G. Salvagno
Marco Maggi Marco Maggi
Marcus Sundberg
Marcus Webster Marcus Webster
Mario Schroeder Mario Schroeder
Mark Brand
Mark Butler Mark Butler
Mark Davies Mark Davies
Mark Eichin Mark Eichin
@@ -537,6 +584,7 @@ Matt Kraai
Matt Veenstra Matt Veenstra
Matt Witherspoon Matt Witherspoon
Matt Wixson Matt Wixson
Matteo Rocco
Matthew Blain Matthew Blain
Matthew Clarke Matthew Clarke
Matthias Bolte Matthias Bolte
@@ -545,16 +593,20 @@ Mauro Iorio
Max Katsev Max Katsev
Maxim Ivanov Maxim Ivanov
Maxim Perenesenko Maxim Perenesenko
Maxim Prohorov
Mehmet Bozkurt
Mekonikum Mekonikum
Mettgut Jamalla Mettgut Jamalla
Michael Benedict Michael Benedict
Michael Calmer Michael Calmer
Michael Cronenworth Michael Cronenworth
Michael Curtis Michael Curtis
Michael Day
Michael Goffioul Michael Goffioul
Michael Jahn Michael Jahn
Michael Jerris Michael Jerris
Michael Mealling Michael Mealling
Michael Mueller
Michael Smith Michael Smith
Michael Stillwell Michael Stillwell
Michael Wallner Michael Wallner
@@ -580,6 +632,7 @@ Moonesamy
Nathan Coulter Nathan Coulter
Nathan O'Sullivan Nathan O'Sullivan
Nathanael Nerode Nathanael Nerode
Naveen Chandran
Naveen Noel Naveen Noel
Neil Dunbar Neil Dunbar
Neil Spring Neil Spring
@@ -597,6 +650,7 @@ Nikita Schmidt
Nikitinskit Dmitriy Nikitinskit Dmitriy
Niklas Angebrand Niklas Angebrand
Nikolai Kondrashov Nikolai Kondrashov
Nikos Mavrogiannopoulos
Ning Dong Ning Dong
Nir Soffer Nir Soffer
Nis Jorgensen Nis Jorgensen
@@ -607,15 +661,19 @@ Ofer
Olaf Stueben Olaf Stueben
Olaf St<53>ben Olaf St<53>ben
Oren Tirosh Oren Tirosh
Ori Avtalion
P R Schaffner P R Schaffner
Paolo Piacentini
Pascal Terjan Pascal Terjan
Pasha Kuznetsov Pasha Kuznetsov
Pat Ray Pat Ray
Patrice Guerin
Patrick Bihan-Faou Patrick Bihan-Faou
Patrick Monnerat Patrick Monnerat
Patrick Scott Patrick Scott
Patrick Smith Patrick Smith
Patrik Thunstrom Patrik Thunstrom
Pau Garcia i Quiles
Paul Harrington Paul Harrington
Paul Howarth Paul Howarth
Paul Marquis Paul Marquis
@@ -633,6 +691,7 @@ Pete Su
Peter Bray Peter Bray
Peter Forret Peter Forret
Peter Heuchert Peter Heuchert
Peter Hjalmarsson
Peter Korsgaard Peter Korsgaard
Peter Lamberg Peter Lamberg
Peter O'Gorman Peter O'Gorman
@@ -656,6 +715,7 @@ Philippe Vaucher
Pierre Pierre
Pierre Brico Pierre Brico
Pierre Joye Pierre Joye
Pierre Ynard
Pooyan McSporran Pooyan McSporran
Pramod Sharma Pramod Sharma
Puneet Pawaia Puneet Pawaia
@@ -666,6 +726,7 @@ Rafa Muyo
Rafael Sagula Rafael Sagula
Rainer Canavan Rainer Canavan
Rainer Koenig Rainer Koenig
Rajesh Naganathan
Ralf S. Engelschall Ralf S. Engelschall
Ralph Beckmann Ralph Beckmann
Ralph Mitchell Ralph Mitchell
@@ -681,6 +742,7 @@ Renaud Duhaut
Rene Bernhardt Rene Bernhardt
Rene Rebe Rene Rebe
Reuven Wachtfogel Reuven Wachtfogel
Reza Arbab
Ricardo Cadime Ricardo Cadime
Rich Gray Rich Gray
Rich Rauenzahn Rich Rauenzahn
@@ -691,16 +753,19 @@ Richard Clayton
Richard Cooper Richard Cooper
Richard Gorton Richard Gorton
Richard Prescott Richard Prescott
Richard Silverman
Rick Jones Rick Jones
Rick Richardson Rick Richardson
Rob Crittenden Rob Crittenden
Rob Jones Rob Jones
Rob Stanzel Rob Stanzel
Rob Ward
Robert A. Monat Robert A. Monat
Robert D. Young Robert D. Young
Robert Foreman Robert Foreman
Robert Iakobashvili Robert Iakobashvili
Robert Olson Robert Olson
Robert Schumann
Robert Weaver Robert Weaver
Robin Cornelius Robin Cornelius
Robin Johnson Robin Johnson
@@ -720,6 +785,7 @@ Ruslan Gazizov
Rutger Hofman Rutger Hofman
Ryan Chan Ryan Chan
Ryan Nelson Ryan Nelson
Ryan Schmidt
S. Moonesamy S. Moonesamy
Salvador D<>vila Salvador D<>vila
Salvatore Sorrentino Salvatore Sorrentino
@@ -730,6 +796,7 @@ Samuel Listopad
Samuel Thibault Samuel Thibault
Sander Gates Sander Gates
Sandor Feldi Sandor Feldi
Saqib Ali
Saul good Saul good
Scott Barrett Scott Barrett
Scott Cantor Scott Cantor
@@ -767,6 +834,8 @@ Stephen Kick
Stephen More Stephen More
Sterling Hughes Sterling Hughes
Steve Green Steve Green
Steve H Truong
Steve Holme
Steve Lhomme Steve Lhomme
Steve Little Steve Little
Steve Marx Steve Marx
@@ -775,6 +844,7 @@ Steve Roskowski
Steven Bazyl Steven Bazyl
Steven G. Johnson Steven G. Johnson
Steven M. Schweda Steven M. Schweda
Steven Parkes
Stoned Elipot Stoned Elipot
Sven Anders Sven Anders
Sven Neuhaus Sven Neuhaus
@@ -782,10 +852,12 @@ Sven Wegener
S<EFBFBD>bastien Willemijns S<EFBFBD>bastien Willemijns
T. Bharath T. Bharath
T. Yamada T. Yamada
Taneli Vahakangas
Tanguy Fautre Tanguy Fautre
Temprimus Temprimus
Thomas J. Moore Thomas J. Moore
Thomas Klausner Thomas Klausner
Thomas L. Shinnick
Thomas Lopatic Thomas Lopatic
Thomas Schwinge Thomas Schwinge
Thomas Tonino Thomas Tonino
@@ -794,11 +866,15 @@ Tim Baker
Tim Bartley Tim Bartley
Tim Chen Tim Chen
Tim Costello Tim Costello
Tim Harder
Tim Newsome Tim Newsome
Tim Sneddon Tim Sneddon
Tinus van den Berg
Tobias Rundstr<74>m Tobias Rundstr<74>m
Toby Peterson Toby Peterson
Todd A Ouska
Todd Kulesza Todd Kulesza
Todd Ouska
Todd Vierling Todd Vierling
Tom Benoist Tom Benoist
Tom Donovan Tom Donovan
@@ -807,6 +883,7 @@ Tom Mattison
Tom Moers Tom Moers
Tom Mueller Tom Mueller
Tom Regner Tom Regner
Tom Wright
Tom Zerucha Tom Zerucha
Tomas Pospisek Tomas Pospisek
Tomas Szepe Tomas Szepe
@@ -814,6 +891,7 @@ Tomasz Lacki
Tommie Gannert Tommie Gannert
Tommy Tam Tommy Tam
Ton Voon Ton Voon
Toni Moreno
Toon Verwaest Toon Verwaest
Tor Arntsen Tor Arntsen
Torsten Foertsch Torsten Foertsch
@@ -833,13 +911,16 @@ Vincent Bronner
Vincent Le Normand Vincent Le Normand
Vincent Penquerc'h Vincent Penquerc'h
Vincent Sanders Vincent Sanders
Vincent Torri
Vlad Grachov Vlad Grachov
Vlad Ureche Vlad Ureche
Vladimir Grishchenko
Vladimir Lazarenko Vladimir Lazarenko
Vojtech Janota Vojtech Janota
Vojtech Minarik Vojtech Minarik
Vsevolod Novikov Vsevolod Novikov
Walter J. Mack Walter J. Mack
Ward Willats
Wayne Haigh Wayne Haigh
Werner Koch Werner Koch
Wesley Laxton Wesley Laxton
@@ -847,10 +928,12 @@ Wesley Miaw
Wez Furlong Wez Furlong
Wilfredo Sanchez Wilfredo Sanchez
Wojciech Zwiefka Wojciech Zwiefka
Wu Yongzheng
Xavier Bouchoux Xavier Bouchoux
Yang Tse Yang Tse
Yarram Sunil Yarram Sunil
Yehoshua Hershberg Yehoshua Hershberg
Yukihiro Kawada
Yuriy Sosov Yuriy Sosov
Yves Lejeune Yves Lejeune
Zmey Petroff Zmey Petroff

276
docs/TODO
View File

@@ -12,16 +12,16 @@
All bugs documented in the KNOWN_BUGS document are subject for fixing! All bugs documented in the KNOWN_BUGS document are subject for fixing!
1. libcurl 1. libcurl
1.1 Zero-copy interface
1.2 More data sharing 1.2 More data sharing
1.3 struct lifreq 1.3 struct lifreq
1.4 signal-based resolver timeouts 1.4 signal-based resolver timeouts
1.5 get rid of PATH_MAX 1.5 get rid of PATH_MAX
1.6 progress callback without doubles
1.7 Happy Eyeball dual stack connect
2. libcurl - multi interface 2. libcurl - multi interface
2.1 More non-blocking 2.1 More non-blocking
2.2 Remove easy interface internally 2.2 Remove easy interface internally
2.3 Avoid having to remove/readd handles
2.4 Fix HTTP Pipelining for PUT 2.4 Fix HTTP Pipelining for PUT
3. Documentation 3. Documentation
@@ -54,63 +54,69 @@
7.5 Export session ids 7.5 Export session ids
7.6 Provide callback for cert verification 7.6 Provide callback for cert verification
7.7 Support other SSL libraries 7.7 Support other SSL libraries
7.8 Support SRP on the TLS layer
7.9 improve configure --with-ssl 7.9 improve configure --with-ssl
8. GnuTLS 8. GnuTLS
8.1 SSL engine stuff 8.1 SSL engine stuff
8.2 SRP
8.3 check connection 8.3 check connection
8.4 non-gcrypt 8.4 non-gcrypt
9. Other protocols 9. SMTP
9.1 Other authentication mechanims
9.2 Specify the preferred authentication mechanism
9.3 Initial response
9.4 Pipelining
10. New protocols 10. POP3
10.1 RSYNC 10.1 APOP Authentication
10.2 Other authentication mechanims
10.3 auth= in URLs
11. Client 11. Other protocols
11.1 sync
11.2 glob posts
11.3 prevent file overwriting
11.4 simultaneous parallel transfers
11.5 provide formpost headers
11.6 url-specific options
11.7 metalink support
11.8 warning when setting an option
12. Build 12. New protocols
12.1 roffit 12.1 RSYNC
13. Test suite 13. Client
13.1 SSL tunnel 13.1 sync
13.2 nicer lacking perl message 13.2 glob posts
13.3 more protocols supported 13.3 prevent file overwriting
13.4 more platforms supported 13.4 simultaneous parallel transfers
13.5 provide formpost headers
13.6 url-specific options
13.7 metalink support
13.8 warning when setting an option
13.9 IPv6 addresses with globbing
14. Next SONAME bump 14. Build
14.1 http-style HEAD output for ftp 14.1 roffit
14.2 combine error codes
14.3 extend CURLOPT_SOCKOPTFUNCTION prototype
15. Next major release 15. Test suite
15.1 cleanup return codes 15.1 SSL tunnel
15.2 remove obsolete defines 15.2 nicer lacking perl message
15.3 size_t 15.3 more protocols supported
15.4 remove several functions 15.4 more platforms supported
15.5 remove CURLOPT_FAILONERROR
15.6 remove CURLOPT_DNS_USE_GLOBAL_CACHE 16. Next SONAME bump
15.7 remove progress meter from libcurl 16.1 http-style HEAD output for ftp
16.2 combine error codes
16.3 extend CURLOPT_SOCKOPTFUNCTION prototype
17. Next major release
17.1 cleanup return codes
17.2 remove obsolete defines
17.3 size_t
17.4 remove several functions
17.5 remove CURLOPT_FAILONERROR
17.6 remove CURLOPT_DNS_USE_GLOBAL_CACHE
17.7 remove progress meter from libcurl
17.8 remove 'curl_httppost' from public
17.9 have form functions use CURL handle argument
============================================================================== ==============================================================================
1. libcurl 1. libcurl
1.1 Zero-copy interface
Introduce another callback interface for upload/download that makes one less
copy of data and thus a faster operation.
[http://curl.haxx.se/dev/no_copy_callbacks.txt]
1.2 More data sharing 1.2 More data sharing
curl_share_* functions already exist and work, and they can be extended to curl_share_* functions already exist and work, and they can be extended to
@@ -144,6 +150,28 @@
we need libssh2 to properly tell us when we pass in a too small buffer and we need libssh2 to properly tell us when we pass in a too small buffer and
its current API (as of libssh2 1.2.7) doesn't. its current API (as of libssh2 1.2.7) doesn't.
1.6 progress callback without doubles
The progress callback was introduced way back in the days and the choice to
use doubles in the arguments was possibly good at the time. Today the doubles
only confuse users and make the amounts less precise. We should introduce
another progress callback option that take precedence over the old one and
have both co-exist for a forseeable time until we can remove the double-using
one.
1.7 Happy Eyeball dual stack connect
In order to make alternative technologies not suffer when transitioning, like
when introducing IPv6 as an alternative to IPv4 and there are more than one
option existing simultaneously there are reasons to reconsider internal
choices.
To make libcurl do blazing fast IPv6 in a dual-stack configuration, this needs
to be addressed:
http://tools.ietf.org/html/rfc6555
2. libcurl - multi interface 2. libcurl - multi interface
2.1 More non-blocking 2.1 More non-blocking
@@ -153,7 +181,6 @@
- Name resolves on non-windows unless c-ares is used - Name resolves on non-windows unless c-ares is used
- NSS SSL connections - NSS SSL connections
- Active FTP connections
- HTTP proxy CONNECT operations - HTTP proxy CONNECT operations
- SOCKS proxy handshakes - SOCKS proxy handshakes
- file:// transfers - file:// transfers
@@ -170,23 +197,6 @@
internally use and assume the multi interface. The select()-loop should use internally use and assume the multi interface. The select()-loop should use
curl_multi_socket(). curl_multi_socket().
2.3 Avoid having to remove/readd handles
curl_multi_handle_control() - this can control the easy handle (while) added
to a multi handle in various ways:
o RESTART, unconditionally restart this easy handle's transfer from the
start, re-init the state
o RESTART_COMPLETED, restart this easy handle's transfer but only if the
existing transfer has already completed and it is in a "finished state".
o STOP, just stop this transfer and consider it completed
o PAUSE?
o RESUME?
2.4 Fix HTTP Pipelining for PUT 2.4 Fix HTTP Pipelining for PUT
HTTP Pipelining can be a way to greatly enhance performance for multiple HTTP Pipelining can be a way to greatly enhance performance for multiple
@@ -334,12 +344,6 @@ to provide the data to send.
Make curl's SSL layer capable of using other free SSL libraries. Such as Make curl's SSL layer capable of using other free SSL libraries. Such as
MatrixSSL (http://www.matrixssl.org/). MatrixSSL (http://www.matrixssl.org/).
7.8 Support SRP on the TLS layer
Peter Sylvester's patch for SRP on the TLS layer. Awaits OpenSSL support for
this, no need to support this in libcurl before there's an OpenSSL release
that does it.
7.9 improve configure --with-ssl 7.9 improve configure --with-ssl
make the configure --with-ssl option first check for OpenSSL, then GnuTLS, make the configure --with-ssl option first check for OpenSSL, then GnuTLS,
@@ -351,11 +355,6 @@ to provide the data to send.
Is this even possible? Is this even possible?
8.2 SRP
Work out a common method with Peter Sylvester's OpenSSL-patch for SRP on the
TLS to provide name and password. GnuTLS already supports it...
8.3 check connection 8.3 check connection
Add a way to check if the connection seems to be alive, to correspond to the Add a way to check if the connection seems to be alive, to correspond to the
@@ -372,18 +371,65 @@ to provide the data to send.
The correct fix would be to detect which crypto layer that is in use and The correct fix would be to detect which crypto layer that is in use and
adapt our code to use that instead of blindly assuming gcrypt. adapt our code to use that instead of blindly assuming gcrypt.
9. Other protocols 9. SMTP
10. New protocols 9.1 Other authentication mechanims
10.1 RSYNC Add support for other authentication mechanisms such as digest-md5 and
gssapi.
There's no RFC for protocol nor URI/URL format. An implementation should 9.2 Specify the preferred authentication mechanism
most probably use an existing rsync library, such as librsync.
11. Client Add the ability to specify the preferred authentication mechanism or a list
of mechanims that should be used. Not only that, but the order that is
returned by the server during the EHLO response should be honored by curl.
11.1 sync 9.3 Initial response
Add the ability for the user to specify whether the initial response is
included in the AUTH command. Some email servers, such as Microsoft
Exchange, can work with either whilst others need to have the initial
response sent separately:
http://curl.haxx.se/mail/lib-2012-03/0114.html
9.4 Pipelining
Add support for pipelining emails.
10. POP3
10.1 APOP Authentication
Add support for the APOP command rather than using plain text authentication
(USER and PASS) as this is very week security wise. Note: The APOP command
is specified as "APOP <username> <md5 password>", however, it isn't
supported by all mail servers.
10.2 Other authentication mechanims
SASL offers support for additional authentication mechanisms via the AUTH
command. Detection of an email server's support for SASL authentication
can be detected via the CAPA command whilst a list of supported mechanisms
can be retrieved with an empty AUTH command.
10.3 auth= in URLs
Being able to specify the preferred authentication mechanim in the URL as
per RFC-2384 (http://tools.ietf.org/html/rfc2384).
11. Other protocols
12. New protocols
12.1 RSYNC
There's no RFC for the protocol or an URI/URL format. An implementation
should most probably use an existing rsync library, such as librsync.
13. Client
13.1 sync
"curl --sync http://example.com/feed[1-100].rss" or "curl --sync http://example.com/feed[1-100].rss" or
"curl --sync http://example.net/{index,calendar,history}.html" "curl --sync http://example.net/{index,calendar,history}.html"
@@ -392,12 +438,12 @@ to provide the data to send.
remote file is newer than the local file. A Last-Modified HTTP date header remote file is newer than the local file. A Last-Modified HTTP date header
should also be used to set the mod date on the downloaded file. should also be used to set the mod date on the downloaded file.
11.2 glob posts 13.2 glob posts
Globbing support for -d and -F, as in 'curl -d "name=foo[0-9]" URL'. Globbing support for -d and -F, as in 'curl -d "name=foo[0-9]" URL'.
This is easily scripted though. This is easily scripted though.
11.3 prevent file overwriting 13.3 prevent file overwriting
Add an option that prevents cURL from overwriting existing local files. When Add an option that prevents cURL from overwriting existing local files. When
used, and there already is an existing file with the target file name used, and there already is an existing file with the target file name
@@ -405,14 +451,14 @@ to provide the data to send.
existing). So that index.html becomes first index.html.1 and then existing). So that index.html becomes first index.html.1 and then
index.html.2 etc. index.html.2 etc.
11.4 simultaneous parallel transfers 13.4 simultaneous parallel transfers
The client could be told to use maximum N simultaneous parallel transfers and The client could be told to use maximum N simultaneous parallel transfers and
then just make sure that happens. It should of course not make more than one then just make sure that happens. It should of course not make more than one
connection to the same remote host. This would require the client to use the connection to the same remote host. This would require the client to use the
multi interface. http://curl.haxx.se/bug/feature.cgi?id=1558595 multi interface. http://curl.haxx.se/bug/feature.cgi?id=1558595
11.5 provide formpost headers 13.5 provide formpost headers
Extending the capabilities of the multipart formposting. How about leaving Extending the capabilities of the multipart formposting. How about leaving
the ';type=foo' syntax as it is and adding an extra tag (headers) which the ';type=foo' syntax as it is and adding an extra tag (headers) which
@@ -426,7 +472,7 @@ to provide the data to send.
which should overwrite the program reasonable defaults (plain/text, which should overwrite the program reasonable defaults (plain/text,
8bit...) 8bit...)
11.6 url-specific options 13.6 url-specific options
Provide a way to make options bound to a specific URL among several on the Provide a way to make options bound to a specific URL among several on the
command line. Possibly by letting ':' separate options between URLs, command line. Possibly by letting ':' separate options between URLs,
@@ -440,55 +486,62 @@ to provide the data to send.
The example would do a POST-GET-POST combination on a single command line. The example would do a POST-GET-POST combination on a single command line.
11.7 metalink support 13.7 metalink support
Add metalink support to curl (http://www.metalinker.org/). This is most useful Add metalink support to curl (http://www.metalinker.org/). This is most useful
with simultaneous parallel transfers (11.6) but not necessary. with simultaneous parallel transfers (11.6) but not necessary.
11.8 warning when setting an option 13.8 warning when setting an option
Display a warning when libcurl returns an error when setting an option. Display a warning when libcurl returns an error when setting an option.
This can be useful to tell when support for a particular feature hasn't been This can be useful to tell when support for a particular feature hasn't been
compiled into the library. compiled into the library.
12. Build 13.9 IPv6 addresses with globbing
12.1 roffit Currently the command line client needs to get url globbing disabled (with
-g) for it to support IPv6 numerical addresses. This is a rather silly flaw
that should be corrected. It probably involves a smarter detection of the
'[' and ']' letters.
14. Build
14.1 roffit
Consider extending 'roffit' to produce decent ASCII output, and use that Consider extending 'roffit' to produce decent ASCII output, and use that
instead of (g)nroff when building src/hugehelp.c instead of (g)nroff when building src/hugehelp.c
13. Test suite 15. Test suite
13.1 SSL tunnel 15.1 SSL tunnel
Make our own version of stunnel for simple port forwarding to enable HTTPS Make our own version of stunnel for simple port forwarding to enable HTTPS
and FTP-SSL tests without the stunnel dependency, and it could allow us to and FTP-SSL tests without the stunnel dependency, and it could allow us to
provide test tools built with either OpenSSL or GnuTLS provide test tools built with either OpenSSL or GnuTLS
13.2 nicer lacking perl message 15.2 nicer lacking perl message
If perl wasn't found by the configure script, don't attempt to run the tests If perl wasn't found by the configure script, don't attempt to run the tests
but explain something nice why it doesn't. but explain something nice why it doesn't.
13.3 more protocols supported 15.3 more protocols supported
Extend the test suite to include more protocols. The telnet could just do ftp Extend the test suite to include more protocols. The telnet could just do ftp
or http operations (for which we have test servers). or http operations (for which we have test servers).
13.4 more platforms supported 15.4 more platforms supported
Make the test suite work on more platforms. OpenBSD and Mac OS. Remove Make the test suite work on more platforms. OpenBSD and Mac OS. Remove
fork()s and it should become even more portable. fork()s and it should become even more portable.
14. Next SONAME bump 16. Next SONAME bump
14.1 http-style HEAD output for ftp 16.1 http-style HEAD output for ftp
#undef CURL_FTP_HTTPSTYLE_HEAD in lib/ftp.c to remove the HTTP-style headers #undef CURL_FTP_HTTPSTYLE_HEAD in lib/ftp.c to remove the HTTP-style headers
from being output in NOBODY requests over ftp from being output in NOBODY requests over ftp
14.2 combine error codes 16.2 combine error codes
Combine some of the error codes to remove duplicates. The original Combine some of the error codes to remove duplicates. The original
numbering should not be changed, and the old identifiers would be numbering should not be changed, and the old identifiers would be
@@ -506,29 +559,29 @@ to provide the data to send.
CURLE_TFTP_NOTFOUND => CURLE_REMOTE_FILE_NOT_FOUND CURLE_TFTP_NOTFOUND => CURLE_REMOTE_FILE_NOT_FOUND
CURLE_TFTP_PERM => CURLE_REMOTE_ACCESS_DENIED CURLE_TFTP_PERM => CURLE_REMOTE_ACCESS_DENIED
14.3 extend CURLOPT_SOCKOPTFUNCTION prototype 16.3 extend CURLOPT_SOCKOPTFUNCTION prototype
The current prototype only provides 'purpose' that tells what the The current prototype only provides 'purpose' that tells what the
connection/socket is for, but not any protocol or similar. It makes it hard connection/socket is for, but not any protocol or similar. It makes it hard
for applications to differentiate on TCP vs UDP and even HTTP vs FTP and for applications to differentiate on TCP vs UDP and even HTTP vs FTP and
similar. similar.
15. Next major release 17. Next major release
15.1 cleanup return codes 17.1 cleanup return codes
curl_easy_cleanup() returns void, but curl_multi_cleanup() returns a curl_easy_cleanup() returns void, but curl_multi_cleanup() returns a
CURLMcode. These should be changed to be the same. CURLMcode. These should be changed to be the same.
15.2 remove obsolete defines 17.2 remove obsolete defines
remove obsolete defines from curl/curl.h remove obsolete defines from curl/curl.h
15.3 size_t 17.3 size_t
make several functions use size_t instead of int in their APIs make several functions use size_t instead of int in their APIs
15.4 remove several functions 17.4 remove several functions
remove the following functions from the public API: remove the following functions from the public API:
@@ -549,18 +602,18 @@ to provide the data to send.
curl_multi_socket_all curl_multi_socket_all
15.5 remove CURLOPT_FAILONERROR 17.5 remove CURLOPT_FAILONERROR
Remove support for CURLOPT_FAILONERROR, it has gotten too kludgy and weird Remove support for CURLOPT_FAILONERROR, it has gotten too kludgy and weird
internally. Let the app judge success or not for itself. internally. Let the app judge success or not for itself.
15.6 remove CURLOPT_DNS_USE_GLOBAL_CACHE 17.6 remove CURLOPT_DNS_USE_GLOBAL_CACHE
Remove support for a global DNS cache. Anything global is silly, and we Remove support for a global DNS cache. Anything global is silly, and we
already offer the share interface for the same functionality but done already offer the share interface for the same functionality but done
"right". "right".
15.7 remove progress meter from libcurl 17.7 remove progress meter from libcurl
The internally provided progress meter output doesn't belong in the library. The internally provided progress meter output doesn't belong in the library.
Basically no application wants it (apart from curl) but instead applications Basically no application wants it (apart from curl) but instead applications
@@ -569,3 +622,20 @@ to provide the data to send.
The progress callback should then be bumped as well to get proper 64bit The progress callback should then be bumped as well to get proper 64bit
variable types passed to it instead of doubles so that big files work variable types passed to it instead of doubles so that big files work
correctly. correctly.
17.8 remove 'curl_httppost' from public
curl_formadd() was made to fill in a public struct, but the fact that the
struct is public is never really used by application for their own advantage
but instead often restricts how the form functions can or can't be modified.
Changing them to return a private handle will benefit the implementation and
allow us much greater freedoms while still maintining a solid API and ABI.
17.9 have form functions use CURL handle argument
curl_formadd() and curl_formget() both currently have no CURL handle
argument, but both can use a callback that is set in the easy handle, and
thus curl_formget() with callback cannot function without first having
curl_easy_perform() (or similar) called - which is hard to grasp and a design
mistake.

View File

@@ -11,32 +11,25 @@ Version Numbers and Releases
The version numbering is always built up using the same system: The version numbering is always built up using the same system:
X.Y[.Z][-preN] X.Y[.Z]
Where Where
X is main version number X is main version number
Y is release number Y is release number
Z is patch number Z is patch number
N is pre-release number
One of these numbers will get bumped in each new release. The numbers to the One of these numbers will get bumped in each new release. The numbers to the
right of a bumped number will be reset to zero. If Z is zero, it may not be right of a bumped number will be reset to zero. If Z is zero, it may not be
included in the version number. The pre release number is only included in included in the version number.
pre releases (they're never used in public, official, releases).
The main version number will get bumped when *really* big, world colliding The main version number will get bumped when *really* big, world colliding
changes are made. The release number is bumped when big changes are changes are made. The release number is bumped when changes are performed or
performed. The patch number is bumped when the changes are mere bugfixes and things/features are added. The patch number is bumped when the changes are
only minor feature changes. The pre-release is a counter, to identify which mere bugfixes.
pre-release a certain release is.
When reaching the end of a pre-release period, the version without the
pre-release part will be released as a public release.
It means that after release 1.2.3, we can release 2.0 if something really big It means that after release 1.2.3, we can release 2.0 if something really big
has been made, 1.3 if not that big changes were made or 1.2.4 if mostly bugs has been made, 1.3 if not that big changes were made or 1.2.4 if mostly bugs
were fixed. Before 1.2.4 is released, we might release a 1.2.4-pre1 release were fixed.
for the brave people to try before the actual release.
Bumping, as in increasing the number with 1, is unconditionally only Bumping, as in increasing the number with 1, is unconditionally only
affecting one of the numbers (except the ones to the right of it, that may be affecting one of the numbers (except the ones to the right of it, that may be
@@ -56,12 +49,12 @@ Version Numbers and Releases
#define LIBCURL_VERSION_NUM 0xXXYYZZ #define LIBCURL_VERSION_NUM 0xXXYYZZ
Where XX, YY and ZZ are the main version, release and patch numbers in Where XX, YY and ZZ are the main version, release and patch numbers in
hexadecimal. All three numbers are always represented using two digits. 1.2 hexadecimal. All three number fields are always represented using two digits
would appear as "0x010200" while version 9.11.7 appears as "0x090b07". (eight bits each). 1.2 would appear as "0x010200" while version 9.11.7
appears as "0x090b07".
This 6-digit hexadecimal number does not show pre-release number, and it is This 6-digit hexadecimal number is always a greater number in a more recent
always a greater number in a more recent release. It makes comparisons with release. It makes comparisons with greater than and less than work.
greater than and less than work.
This number is also available as three separate defines: This number is also available as three separate defines:
LIBCURL_VERSION_MAJOR, LIBCURL_VERSION_MINOR and LIBCURL_VERSION_PATCH. LIBCURL_VERSION_MAJOR, LIBCURL_VERSION_MINOR and LIBCURL_VERSION_PATCH.

View File

@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___ .\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____| .\" * \___|\___/|_| \_\_____|
.\" * .\" *
.\" * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al. .\" * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" * .\" *
.\" * This software is licensed as described in the file COPYING, which .\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms .\" * you should have received as part of this distribution. The terms
@@ -93,7 +93,6 @@ What's the installed libcurl version?
How do I build a single file with a one-line command? How do I build a single file with a one-line command?
$ `curl-config --cc --cflags --libs` -o example example.c $ `curl-config --cc --cflags` -o example example.c `curl-config --libs`
.SH "SEE ALSO" .SH "SEE ALSO"
.BR curl (1) .BR curl (1)

File diff suppressed because it is too large Load Diff

View File

@@ -4,6 +4,7 @@ certinfo
chkspeed chkspeed
cookie_interface cookie_interface
debug debug
externalsocket
fileupload fileupload
fopen fopen
ftp-wildcard ftp-wildcard
@@ -17,14 +18,20 @@ http-post
httpcustomheader httpcustomheader
httpput httpput
https https
imap
multi-app multi-app
multi-debugcallback multi-debugcallback
multi-double multi-double
multi-post multi-post
multi-single multi-single
persistant persistant
pop3s
pop3slist
post-callback post-callback
postit2 postit2
progressfunc
resolve
rtsp
sendrecv sendrecv
sepheaders sepheaders
simple simple
@@ -33,3 +40,4 @@ simplesmtp
simplessl simplessl
smtp-multi smtp-multi
smtp-tls smtp-tls
url2file

View File

@@ -5,7 +5,7 @@
# | (__| |_| | _ <| |___ # | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____| # \___|\___/|_| \_\_____|
# #
# Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. # Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
# #
# This software is licensed as described in the file COPYING, which # This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms # you should have received as part of this distribution. The terms
@@ -23,7 +23,7 @@
AUTOMAKE_OPTIONS = foreign nostdinc AUTOMAKE_OPTIONS = foreign nostdinc
EXTRA_DIST = README Makefile.example Makefile.inc Makefile.m32 \ EXTRA_DIST = README Makefile.example Makefile.inc Makefile.m32 \
makefile.dj $(COMPLICATED_EXAMPLES) Makefile.netware makefile.dj $(COMPLICATED_EXAMPLES)
# Specify our include paths here, and do it relative to $(top_srcdir) and # Specify our include paths here, and do it relative to $(top_srcdir) and
# $(top_builddir), to ensure that these paths which belong to the library # $(top_builddir), to ensure that these paths which belong to the library
@@ -40,12 +40,12 @@ INCLUDES = -I$(top_builddir)/include/curl \
LIBDIR = $(top_builddir)/lib LIBDIR = $(top_builddir)/lib
if STATICLIB AM_CPPFLAGS = -DCURL_NO_OLDIES
# we need this define when building with a static lib on Windows
STATICCPPFLAGS = -DCURL_STATICLIB
endif
CPPFLAGS = -DCURL_NO_OLDIES $(STATICCPPFLAGS) # Mostly for Windows build targets, when using static libcurl
if USE_CPPFLAG_CURL_STATICLIB
AM_CPPFLAGS += -DCURL_STATICLIB
endif
# Dependencies # Dependencies
LDADD = $(LIBDIR)/libcurl.la LDADD = $(LIBDIR)/libcurl.la

View File

@@ -4,7 +4,8 @@ check_PROGRAMS = 10-at-a-time anyauthput cookie_interface debug fileupload \
https multi-app multi-debugcallback multi-double multi-post multi-single \ https multi-app multi-debugcallback multi-double multi-post multi-single \
persistant post-callback postit2 sepheaders simple simplepost simplessl \ persistant post-callback postit2 sepheaders simple simplepost simplessl \
sendrecv httpcustomheader certinfo chkspeed ftpgetinfo ftp-wildcard \ sendrecv httpcustomheader certinfo chkspeed ftpgetinfo ftp-wildcard \
smtp-multi simplesmtp smtp-tls smtp-multi simplesmtp smtp-tls rtsp externalsocket resolve \
progressfunc pop3s pop3slist imap url2file
# These examples require external dependencies that may not be commonly # These examples require external dependencies that may not be commonly
# available on POSIX systems, so don't bother attempting to compile them here. # available on POSIX systems, so don't bother attempting to compile them here.

View File

@@ -19,31 +19,50 @@
# KIND, either express or implied. # KIND, either express or implied.
# #
########################################################################### ###########################################################################
#########################################################################
# #
## Makefile for building curl examples with MingW32 ## Makefile for building curl examples with MingW (GCC-3.2 or later)
## and optionally OpenSSL (0.9.8), libssh2 (0.18), zlib (1.2.3) ## and optionally OpenSSL (0.9.8), libssh2 (1.3), zlib (1.2.5), librtmp (2.3)
## ##
## Usage: ## Usage: mingw32-make -f Makefile.m32 CFG=-feature1[-feature2][-feature3][...]
## mingw32-make -f Makefile.m32 [SSL=1] [SSH2=1] [ZLIB=1] [SSPI=1] [IPV6=1] [DYN=1] ## Example: mingw32-make -f Makefile.m32 CFG=-zlib-ssl-spi-winidn
## ##
## Hint: you can also set environment vars to control the build, f.e.: ## Hint: you can also set environment vars to control the build, f.e.:
## set ZLIB_PATH=c:/zlib-1.2.3 ## set ZLIB_PATH=c:/zlib-1.2.7
## set ZLIB=1 ## set ZLIB=1
## #
######################################################################### ###########################################################################
# Edit the path below to point to the base of your Zlib sources. # Edit the path below to point to the base of your Zlib sources.
ifndef ZLIB_PATH ifndef ZLIB_PATH
ZLIB_PATH = ../../zlib-1.2.3 ZLIB_PATH = ../../../zlib-1.2.7
endif endif
# Edit the path below to point to the base of your OpenSSL package. # Edit the path below to point to the base of your OpenSSL package.
ifndef OPENSSL_PATH ifndef OPENSSL_PATH
OPENSSL_PATH = ../../openssl-0.9.8k OPENSSL_PATH = ../../../openssl-0.9.8x
endif
ifndef OPENSSL_LIBPATH
OPENSSL_LIBPATH = $(OPENSSL_PATH)/out
endif
ifndef OPENSSL_LIBS
OPENSSL_LIBS = -leay32 -lssl32
endif endif
# Edit the path below to point to the base of your LibSSH2 package. # Edit the path below to point to the base of your LibSSH2 package.
ifndef LIBSSH2_PATH ifndef LIBSSH2_PATH
LIBSSH2_PATH = ../../libssh2-1.2 LIBSSH2_PATH = ../../../libssh2-1.4.2
endif
# Edit the path below to point to the base of your librtmp package.
ifndef LIBRTMP_PATH
LIBRTMP_PATH = ../../../librtmp-2.3
endif
# Edit the path below to point to the base of your libidn package.
ifndef LIBIDN_PATH
LIBIDN_PATH = ../../../libidn-1.18
endif
# Edit the path below to point to the base of your MS IDN package.
# Microsoft Internationalized Domain Names (IDN) Mitigation APIs 1.1
# http://www.microsoft.com/downloads/en/details.aspx?FamilyID=ad6158d7-ddba-416a-9109-07607425a815
ifndef WINIDN_PATH
WINIDN_PATH = ../../../Microsoft IDN Mitigation APIs
endif endif
# Edit the path below to point to the base of your Novell LDAP NDK. # Edit the path below to point to the base of your Novell LDAP NDK.
ifndef LDAP_SDK ifndef LDAP_SDK
@@ -51,25 +70,76 @@ LDAP_SDK = c:/novell/ndk/cldapsdk/win32
endif endif
PROOT = ../.. PROOT = ../..
ARES_LIB = $(PROOT)/ares
SSL = 1 # Edit the path below to point to the base of your c-ares package.
ZLIB = 1 ifndef LIBCARES_PATH
LIBCARES_PATH = $(PROOT)/ares
endif
# Edit the var below to set to your architecture or set environment var.
ifndef ARCH
ARCH = w32
endif
CC = gcc CC = gcc
CFLAGS = -g -O2 -Wall CFLAGS = -g -O2 -Wall
CFLAGS += -fno-strict-aliasing
ifeq ($(ARCH),w64)
CFLAGS += -D_AMD64_
endif
# comment LDFLAGS below to keep debug info # comment LDFLAGS below to keep debug info
LDFLAGS = -s LDFLAGS = -s
RC = windres RC = windres
RCFLAGS = --include-dir=$(PROOT)/include -O COFF -i RCFLAGS = --include-dir=$(PROOT)/include -O COFF -i
RM = del /q /f > NUL 2>&1
RM = del /q /f 2>NUL
CP = copy CP = copy
######################################################## ########################################################
## Nothing more to do below this line! ## Nothing more to do below this line!
ifeq ($(findstring -dyn,$(CFG)),-dyn)
DYN = 1
endif
ifeq ($(findstring -ares,$(CFG)),-ares)
ARES = 1
endif
ifeq ($(findstring -rtmp,$(CFG)),-rtmp)
RTMP = 1
SSL = 1
ZLIB = 1
endif
ifeq ($(findstring -ssh2,$(CFG)),-ssh2)
SSH2 = 1
SSL = 1
ZLIB = 1
endif
ifeq ($(findstring -ssl,$(CFG)),-ssl)
SSL = 1
endif
ifeq ($(findstring -zlib,$(CFG)),-zlib)
ZLIB = 1
endif
ifeq ($(findstring -idn,$(CFG)),-idn)
IDN = 1
endif
ifeq ($(findstring -winidn,$(CFG)),-winidn)
WINIDN = 1
endif
ifeq ($(findstring -sspi,$(CFG)),-sspi)
SSPI = 1
endif
ifeq ($(findstring -spnego,$(CFG)),-spnego)
SPNEGO = 1
endif
ifeq ($(findstring -ldaps,$(CFG)),-ldaps)
LDAPS = 1
endif
ifeq ($(findstring -ipv6,$(CFG)),-ipv6)
IPV6 = 1
endif
INCLUDES = -I. -I$(PROOT) -I$(PROOT)/include -I$(PROOT)/lib INCLUDES = -I. -I$(PROOT) -I$(PROOT)/include -I$(PROOT)/lib
LINK = $(CC) $(LDFLAGS) -o $@
ifdef DYN ifdef DYN
curl_DEPENDENCIES = $(PROOT)/lib/libcurldll.a $(PROOT)/lib/libcurl.dll curl_DEPENDENCIES = $(PROOT)/lib/libcurldll.a $(PROOT)/lib/libcurl.dll
@@ -81,34 +151,45 @@ else
endif endif
ifdef ARES ifdef ARES
ifndef DYN ifndef DYN
curl_DEPENDENCIES += $(ARES_LIB)/libcares.a curl_DEPENDENCIES += $(LIBCARES_PATH)/libcares.a
endif endif
CFLAGS += -DUSE_ARES CFLAGS += -DUSE_ARES
curl_LDADD += -L$(ARES_LIB) -lcares curl_LDADD += -L"$(LIBCARES_PATH)" -lcares
endif
ifdef RTMP
CFLAGS += -DUSE_LIBRTMP
curl_LDADD += -L"$(LIBRTMP_PATH)/librtmp" -lrtmp -lwinmm
endif endif
ifdef SSH2 ifdef SSH2
CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
curl_LDADD += -L$(LIBSSH2_PATH)/win32 -lssh2 curl_LDADD += -L"$(LIBSSH2_PATH)/win32" -lssh2
endif endif
ifdef SSL ifdef SSL
INCLUDES += -I"$(OPENSSL_PATH)/outinc"
CFLAGS += -DUSE_SSLEAY -DHAVE_OPENSSL_ENGINE_H CFLAGS += -DUSE_SSLEAY -DHAVE_OPENSSL_ENGINE_H
ifdef DYN curl_LDADD += -L"$(OPENSSL_LIBPATH)" $(OPENSSL_LIBS)
curl_LDADD += -L$(OPENSSL_PATH)/out -leay32 -lssl32
else
curl_LDADD += -L$(OPENSSL_PATH)/out -lssl -lcrypto -lgdi32
endif
endif endif
ifdef ZLIB ifdef ZLIB
INCLUDES += -I"$(ZLIB_PATH)" INCLUDES += -I"$(ZLIB_PATH)"
CFLAGS += -DHAVE_LIBZ -DHAVE_ZLIB_H CFLAGS += -DHAVE_LIBZ -DHAVE_ZLIB_H
curl_LDADD += -L$(ZLIB_PATH) -lz curl_LDADD += -L"$(ZLIB_PATH)" -lz
endif
ifdef IDN
CFLAGS += -DUSE_LIBIDN
curl_LDADD += -L"$(LIBIDN_PATH)/lib" -lidn
else
ifdef WINIDN
CFLAGS += -DUSE_WIN32_IDN
curl_LDADD += -L"$(WINIDN_PATH)" -lnormaliz
endif
endif endif
ifdef SSPI ifdef SSPI
CFLAGS += -DUSE_WINDOWS_SSPI CFLAGS += -DUSE_WINDOWS_SSPI
endif endif
ifdef SPNEGO
CFLAGS += -DHAVE_SPNEGO
endif
ifdef IPV6 ifdef IPV6
CFLAGS += -DENABLE_IPV6 CFLAGS += -DENABLE_IPV6 -D_WIN32_WINNT=0x0501
endif endif
ifdef LDAPS ifdef LDAPS
CFLAGS += -DHAVE_LDAP_SSL CFLAGS += -DHAVE_LDAP_SSL
@@ -123,32 +204,32 @@ ifdef USE_LDAP_OPENLDAP
endif endif
ifndef USE_LDAP_NOVELL ifndef USE_LDAP_NOVELL
ifndef USE_LDAP_OPENLDAP ifndef USE_LDAP_OPENLDAP
curl_LDADD += -lwldap32 curl_LDADD += -lwldap32
endif endif
endif endif
curl_LDADD += -lws2_32 curl_LDADD += -lws2_32
COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
# Makefile.inc provides the check_PROGRAMS and COMPLICATED_EXAMPLES defines # Makefile.inc provides the check_PROGRAMS and COMPLICATED_EXAMPLES defines
include Makefile.inc include Makefile.inc
example_PROGRAMS := $(patsubst %,%.exe,$(strip $(check_PROGRAMS))) check_PROGRAMS := $(patsubst %,%.exe,$(strip $(check_PROGRAMS)))
check_PROGRAMS += ftpuploadresume.exe synctime.exe
.SUFFIXES: .rc .res .o .exe
all: $(example_PROGRAMS) all: $(check_PROGRAMS)
.o.exe: $(curl_DEPENDENCIES) %.exe: %.o $(curl_DEPENDENCIES)
$(LINK) $< $(curl_LDADD) $(CC) $(LDFLAGS) -o $@ $< $(curl_LDADD)
.c.o: %.o: %.c
$(COMPILE) -c $< $(CC) $(INCLUDES) $(CFLAGS) -c $<
.rc.res: %.res: %.rc
$(RC) $(RCFLAGS) $< -o $@ $(RC) $(RCFLAGS) $< -o $@
clean: clean:
$(RM) $(example_PROGRAMS) -$(RM) $(check_PROGRAMS:.exe=.o)
distclean vclean: clean
-$(RM) $(check_PROGRAMS)

View File

@@ -0,0 +1,441 @@
#################################################################
#
## Makefile for building curl.nlm (NetWare version - gnu make)
## Use: make -f Makefile.netware
##
## Comments to: Guenter Knauf http://www.gknw.net/phpbb
#
#################################################################
# Edit the path below to point to the base of your Novell NDK.
ifndef NDKBASE
NDKBASE = c:/novell
endif
# Edit the path below to point to the base of your Zlib sources.
ifndef ZLIB_PATH
ZLIB_PATH = ../../../zlib-1.2.7
endif
# Edit the path below to point to the base of your OpenSSL package.
ifndef OPENSSL_PATH
OPENSSL_PATH = ../../../openssl-0.9.8x
endif
# Edit the path below to point to the base of your LibSSH2 package.
ifndef LIBSSH2_PATH
LIBSSH2_PATH = ../../../libssh2-1.4.2
endif
# Edit the path below to point to the base of your axTLS package.
ifndef AXTLS_PATH
AXTLS_PATH = ../../../axTLS-1.2.7
endif
# Edit the path below to point to the base of your libidn package.
ifndef LIBIDN_PATH
LIBIDN_PATH = ../../../libidn-1.18
endif
# Edit the path below to point to the base of your librtmp package.
ifndef LIBRTMP_PATH
LIBRTMP_PATH = ../../../librtmp-2.3
endif
# Edit the path below to point to the base of your fbopenssl package.
ifndef FBOPENSSL_PATH
FBOPENSSL_PATH = ../../fbopenssl-0.4
endif
# Edit the path below to point to the base of your c-ares package.
ifndef LIBCARES_PATH
LIBCARES_PATH = ../../ares
endif
ifndef INSTDIR
INSTDIR = ..$(DS)..$(DS)curl-$(LIBCURL_VERSION_STR)-bin-nw
endif
# Edit the vars below to change NLM target settings.
TARGET = examples
VERSION = $(LIBCURL_VERSION)
COPYR = Copyright (C) $(LIBCURL_COPYRIGHT_STR)
DESCR = cURL ($(LIBARCH))
MTSAFE = YES
STACK = 8192
SCREEN = Example Program
# Comment the line below if you dont want to load protected automatically.
# LDRING = 3
# Uncomment the next line to enable linking with POSIX semantics.
# POSIXFL = 1
# Edit the var below to point to your lib architecture.
ifndef LIBARCH
LIBARCH = LIBC
endif
# must be equal to NDEBUG or DEBUG, CURLDEBUG
ifndef DB
DB = NDEBUG
endif
# Optimization: -O<n> or debugging: -g
ifeq ($(DB),NDEBUG)
OPT = -O2
OBJDIR = release
else
OPT = -g
OBJDIR = debug
endif
# The following lines defines your compiler.
ifdef CWFolder
METROWERKS = $(CWFolder)
endif
ifdef METROWERKS
# MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support
MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support/Metrowerks Support
CC = mwccnlm
else
CC = gcc
endif
PERL = perl
# Here you can find a native Win32 binary of the original awk:
# http://www.gknw.net/development/prgtools/awk-20100523.zip
AWK = awk
CP = cp -afv
MKDIR = mkdir
# RM = rm -f
# If you want to mark the target as MTSAFE you will need a tool for
# generating the xdc data for the linker; here's a minimal tool:
# http://www.gknw.net/development/prgtools/mkxdc.zip
MPKXDC = mkxdc
# LIBARCH_U = $(shell $(AWK) 'BEGIN {print toupper(ARGV[1])}' $(LIBARCH))
LIBARCH_L = $(shell $(AWK) 'BEGIN {print tolower(ARGV[1])}' $(LIBARCH))
# Include the version info retrieved from curlver.h
-include $(OBJDIR)/version.inc
# Global flags for all compilers
CFLAGS += $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
ifeq ($(CC),mwccnlm)
LD = mwldnlm
LDFLAGS = -nostdlib $< $(PRELUDE) $(LDLIBS) -o $@ -commandfile
LIBEXT = lib
CFLAGS += -gccinc -inline off -opt nointrinsics -proc 586
CFLAGS += -relax_pointers
#CFLAGS += -w on
ifeq ($(LIBARCH),LIBC)
ifeq ($(POSIXFL),1)
PRELUDE = $(NDK_LIBC)/imports/posixpre.o
else
PRELUDE = $(NDK_LIBC)/imports/libcpre.o
endif
CFLAGS += -align 4
else
# PRELUDE = $(NDK_CLIB)/imports/clibpre.o
# to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj"
# CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h"
CFLAGS += -align 1
endif
else
LD = nlmconv
LDFLAGS = -T
LIBEXT = a
CFLAGS += -m32
CFLAGS += -fno-builtin -fno-strict-aliasing
ifeq ($(findstring gcc,$(CC)),gcc)
CFLAGS += -fpcc-struct-return
endif
CFLAGS += -Wall # -pedantic
ifeq ($(LIBARCH),LIBC)
ifeq ($(POSIXFL),1)
PRELUDE = $(NDK_LIBC)/imports/posixpre.gcc.o
else
PRELUDE = $(NDK_LIBC)/imports/libcpre.gcc.o
endif
else
# PRELUDE = $(NDK_CLIB)/imports/clibpre.gcc.o
# to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
# http://www.gknw.net/development/mk_nlm/gcc_pre.zip
PRELUDE = $(NDK_ROOT)/pre/prelude.o
CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
endif
endif
NDK_ROOT = $(NDKBASE)/ndk
ifndef NDK_CLIB
NDK_CLIB = $(NDK_ROOT)/nwsdk
endif
ifndef NDK_LIBC
NDK_LIBC = $(NDK_ROOT)/libc
endif
ifndef NDK_LDAP
NDK_LDAP = $(NDK_ROOT)/cldapsdk/netware
endif
CURL_INC = ../../include
CURL_LIB = ../../lib
INCLUDES = -I$(CURL_INC)
ifeq ($(findstring -static,$(CFG)),-static)
LINK_STATIC = 1
endif
ifeq ($(findstring -ares,$(CFG)),-ares)
WITH_ARES = 1
endif
ifeq ($(findstring -rtmp,$(CFG)),-rtmp)
WITH_RTMP = 1
WITH_SSL = 1
WITH_ZLIB = 1
endif
ifeq ($(findstring -ssh2,$(CFG)),-ssh2)
WITH_SSH2 = 1
WITH_SSL = 1
WITH_ZLIB = 1
endif
ifeq ($(findstring -axtls,$(CFG)),-axtls)
WITH_AXTLS = 1
WITH_SSL =
else
ifeq ($(findstring -ssl,$(CFG)),-ssl)
WITH_SSL = 1
endif
endif
ifeq ($(findstring -zlib,$(CFG)),-zlib)
WITH_ZLIB = 1
endif
ifeq ($(findstring -idn,$(CFG)),-idn)
WITH_IDN = 1
endif
ifeq ($(findstring -spnego,$(CFG)),-spnego)
WITH_SPNEGO = 1
endif
ifeq ($(findstring -ipv6,$(CFG)),-ipv6)
ENABLE_IPV6 = 1
endif
ifdef LINK_STATIC
LDLIBS = $(CURL_LIB)/libcurl.$(LIBEXT)
ifdef WITH_ARES
LDLIBS += $(LIBCARES_PATH)/libcares.$(LIBEXT)
endif
else
MODULES = libcurl.nlm
IMPORTS = @$(CURL_LIB)/libcurl.imp
endif
ifdef WITH_SSH2
# INCLUDES += -I$(LIBSSH2_PATH)/include
ifdef LINK_STATIC
LDLIBS += $(LIBSSH2_PATH)/nw/libssh2.$(LIBEXT)
else
MODULES += libssh2.nlm
IMPORTS += @$(LIBSSH2_PATH)/nw/libssh2.imp
endif
endif
ifdef WITH_RTMP
# INCLUDES += -I$(LIBRTMP_PATH)
ifdef LINK_STATIC
LDLIBS += $(LIBRTMP_PATH)/librtmp/librtmp.$(LIBEXT)
endif
endif
ifdef WITH_SSL
INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)
LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/ssl.$(LIBEXT)
LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/crypto.$(LIBEXT)
IMPORTS += GetProcessSwitchCount RunningProcess
ifdef WITH_SPNEGO
# INCLUDES += -I$(FBOPENSSL_PATH)/include
LDLIBS += $(FBOPENSSL_PATH)/nw/fbopenssl.$(LIBEXT)
endif
else
ifdef WITH_AXTLS
INCLUDES += -I$(AXTLS_PATH)/inc
ifdef LINK_STATIC
LDLIBS += $(AXTLS_PATH)/lib/libaxtls.$(LIBEXT)
else
MODULES += libaxtls.nlm
IMPORTS += $(AXTLS_PATH)/lib/libaxtls.imp
endif
endif
endif
ifdef WITH_ZLIB
# INCLUDES += -I$(ZLIB_PATH)
ifdef LINK_STATIC
LDLIBS += $(ZLIB_PATH)/nw/$(LIBARCH)/libz.$(LIBEXT)
else
MODULES += libz.nlm
IMPORTS += @$(ZLIB_PATH)/nw/$(LIBARCH)/libz.imp
endif
endif
ifdef WITH_IDN
# INCLUDES += -I$(LIBIDN_PATH)/include
LDLIBS += $(LIBIDN_PATH)/lib/libidn.$(LIBEXT)
endif
ifeq ($(LIBARCH),LIBC)
INCLUDES += -I$(NDK_LIBC)/include
# INCLUDES += -I$(NDK_LIBC)/include/nks
# INCLUDES += -I$(NDK_LIBC)/include/winsock
CFLAGS += -D_POSIX_SOURCE
else
INCLUDES += -I$(NDK_CLIB)/include/nlm
# INCLUDES += -I$(NDK_CLIB)/include
endif
ifndef DISABLE_LDAP
# INCLUDES += -I$(NDK_LDAP)/$(LIBARCH_L)/inc
endif
CFLAGS += $(INCLUDES)
ifeq ($(MTSAFE),YES)
XDCOPT = -n
endif
ifeq ($(MTSAFE),NO)
XDCOPT = -u
endif
ifdef XDCOPT
XDCDATA = $(OBJDIR)/$(TARGET).xdc
endif
ifeq ($(findstring /sh,$(SHELL)),/sh)
DL = '
DS = /
PCT = %
#-include $(NDKBASE)/nlmconv/ncpfs.inc
else
DS = \\
PCT = %%
endif
# Makefile.inc provides the CSOURCES and HHEADERS defines
include Makefile.inc
check_PROGRAMS := $(patsubst %,%.nlm,$(strip $(check_PROGRAMS)))
.PRECIOUS: $(OBJDIR)/%.o $(OBJDIR)/%.def $(OBJDIR)/%.xdc
all: prebuild $(check_PROGRAMS)
prebuild: $(OBJDIR) $(OBJDIR)/version.inc
$(OBJDIR)/%.o: %.c
@echo Compiling $<
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/version.inc: $(CURL_INC)/curl/curlver.h $(OBJDIR)
@echo Creating $@
@$(AWK) -f ../../packages/NetWare/get_ver.awk $< > $@
install: $(INSTDIR) all
@$(CP) $(check_PROGRAMS) $(INSTDIR)
clean:
-$(RM) -r $(OBJDIR)
distclean vclean: clean
-$(RM) $(check_PROGRAMS)
$(OBJDIR) $(INSTDIR):
@$(MKDIR) $@
%.nlm: $(OBJDIR)/%.o $(OBJDIR)/%.def $(XDCDATA)
@echo Linking $@
@-$(RM) $@
@$(LD) $(LDFLAGS) $(OBJDIR)/$(@:.nlm=.def)
$(OBJDIR)/%.xdc: Makefile.netware
@echo Creating $@
@$(MPKXDC) $(XDCOPT) $@
$(OBJDIR)/%.def: Makefile.netware
@echo $(DL)# DEF file for linking with $(LD)$(DL) > $@
@echo $(DL)# Do not edit this file - it is created by Make!$(DL) >> $@
@echo $(DL)# All your changes will be lost!!$(DL) >> $@
@echo $(DL)#$(DL) >> $@
@echo $(DL)copyright "$(COPYR)"$(DL) >> $@
@echo $(DL)description "$(DESCR) $(notdir $(@:.def=)) Example"$(DL) >> $@
@echo $(DL)version $(VERSION)$(DL) >> $@
ifdef NLMTYPE
@echo $(DL)type $(NLMTYPE)$(DL) >> $@
endif
ifdef STACK
@echo $(DL)stack $(STACK)$(DL) >> $@
endif
ifdef SCREEN
@echo $(DL)screenname "$(DESCR) $(notdir $(@:.def=)) $(SCREEN)"$(DL) >> $@
else
@echo $(DL)screenname "DEFAULT"$(DL) >> $@
endif
ifneq ($(DB),NDEBUG)
@echo $(DL)debug$(DL) >> $@
endif
@echo $(DL)threadname "_$(notdir $(@:.def=))"$(DL) >> $@
ifdef XDCDATA
@echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@
endif
ifeq ($(LDRING),0)
@echo $(DL)flag_on 16$(DL) >> $@
endif
ifeq ($(LDRING),3)
@echo $(DL)flag_on 512$(DL) >> $@
endif
ifeq ($(LIBARCH),CLIB)
@echo $(DL)start _Prelude$(DL) >> $@
@echo $(DL)exit _Stop$(DL) >> $@
@echo $(DL)import @$(NDK_CLIB)/imports/clib.imp$(DL) >> $@
@echo $(DL)import @$(NDK_CLIB)/imports/threads.imp$(DL) >> $@
@echo $(DL)import @$(NDK_CLIB)/imports/nlmlib.imp$(DL) >> $@
@echo $(DL)import @$(NDK_CLIB)/imports/socklib.imp$(DL) >> $@
@echo $(DL)module clib$(DL) >> $@
ifndef DISABLE_LDAP
@echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@
@echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@
# @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@
@echo $(DL)module ldapsdk ldapssl$(DL) >> $@
endif
else
ifeq ($(POSIXFL),1)
@echo $(DL)flag_on 4194304$(DL) >> $@
endif
@echo $(DL)flag_on 64$(DL) >> $@
@echo $(DL)pseudopreemption$(DL) >> $@
ifeq ($(findstring posixpre,$(PRELUDE)),posixpre)
@echo $(DL)start POSIX_Start$(DL) >> $@
@echo $(DL)exit POSIX_Stop$(DL) >> $@
@echo $(DL)check POSIX_CheckUnload$(DL) >> $@
else
@echo $(DL)start _LibCPrelude$(DL) >> $@
@echo $(DL)exit _LibCPostlude$(DL) >> $@
@echo $(DL)check _LibCCheckUnload$(DL) >> $@
endif
@echo $(DL)import @$(NDK_LIBC)/imports/libc.imp$(DL) >> $@
@echo $(DL)import @$(NDK_LIBC)/imports/netware.imp$(DL) >> $@
@echo $(DL)module libc$(DL) >> $@
ifndef DISABLE_LDAP
@echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@
@echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@
# @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@
@echo $(DL)module lldapsdk lldapssl$(DL) >> $@
endif
endif
ifdef MODULES
@echo $(DL)module $(MODULES)$(DL) >> $@
endif
ifdef EXPORTS
@echo $(DL)export $(EXPORTS)$(DL) >> $@
endif
ifdef IMPORTS
@echo $(DL)import $(IMPORTS)$(DL) >> $@
endif
ifeq ($(findstring nlmconv,$(LD)),nlmconv)
@echo $(DL)input $(PRELUDE)$(DL) >> $@
@echo $(DL)input $(@:.def=.o)$(DL) >> $@
ifdef LDLIBS
@echo $(DL)input $(LDLIBS)$(DL) >> $@
endif
@echo $(DL)output $(notdir $(@:.def=.nlm))$(DL) >> $@
endif

View File

@@ -55,6 +55,7 @@ htmltitle.cc - download a HTML file and extract the <title> tag from a HTML
http-post.c - HTTP POST http-post.c - HTTP POST
httpput.c - HTTP PUT a local file httpput.c - HTTP PUT a local file
https.c - simple HTTPS transfer https.c - simple HTTPS transfer
imap.c - simple IMAP transfer
multi-app.c - a multi-interface app multi-app.c - a multi-interface app
multi-debugcallback.c - a multi-interface app using the debug callback multi-debugcallback.c - a multi-interface app using the debug callback
multi-double.c - a multi-interface app doing two simultaneous transfers multi-double.c - a multi-interface app doing two simultaneous transfers
@@ -63,6 +64,8 @@ multi-single.c - a multi-interface app getting a single file
multithread.c - an example using multi-treading transferring multiple files multithread.c - an example using multi-treading transferring multiple files
opensslthreadlock.c - show how to do locking when using OpenSSL multi-threaded opensslthreadlock.c - show how to do locking when using OpenSSL multi-threaded
persistant.c - request two URLs with a persistent connection persistant.c - request two URLs with a persistent connection
pop3s.c - POP3S transfer
pop3slist.c - POP3S LIST
post-callback.c - send a HTTP POST using a callback post-callback.c - send a HTTP POST using a callback
postit2.c - send a HTTP multipart formpost postit2.c - send a HTTP multipart formpost
sampleconv.c - showing how a program on a non-ASCII platform would invoke sampleconv.c - showing how a program on a non-ASCII platform would invoke
@@ -73,4 +76,5 @@ simple.c - the most simple download a URL source
simplepost.c - HTTP POST simplepost.c - HTTP POST
simplessl.c - HTTPS example with certificates many options set simplessl.c - HTTPS example with certificates many options set
synctime.c - Sync local time by extracting date from remote HTTP servers synctime.c - Sync local time by extracting date from remote HTTP servers
url2file.c - download a document and store it in a file
10-at-a-time.c - Download many files simultaneously, 10 at a time. 10-at-a-time.c - Download many files simultaneously, 10 at a time.

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -26,9 +26,8 @@
#else #else
# ifdef __VMS # ifdef __VMS
typedef int intptr_t; typedef int intptr_t;
# else
# include <stdint.h>
# endif # endif
# include <stdint.h>
# include <unistd.h> # include <unistd.h>
#endif #endif
#include <sys/types.h> #include <sys/types.h>
@@ -89,12 +88,16 @@ static curlioerr my_ioctl(CURL *handle, curliocmd cmd, void *userp)
static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream) static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
{ {
size_t retcode; size_t retcode;
curl_off_t nread;
intptr_t fd = (intptr_t)stream; intptr_t fd = (intptr_t)stream;
retcode = read(fd, ptr, size * nmemb); retcode = read(fd, ptr, size * nmemb);
fprintf(stderr, "*** We read %d bytes from file\n", retcode); nread = (curl_off_t)retcode;
fprintf(stderr, "*** We read %" CURL_FORMAT_CURL_OFF_T
" bytes from file\n", nread);
return retcode; return retcode;
} }

View File

@@ -22,8 +22,6 @@
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>
static size_t wrfu(void *ptr, size_t size, size_t nmemb, void *stream) static size_t wrfu(void *ptr, size_t size, size_t nmemb, void *stream)
{ {

View File

@@ -35,8 +35,6 @@
#include <time.h> #include <time.h>
#include <curl/curl.h> #include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>
#define URL_BASE "http://speedtest.your.domain/" #define URL_BASE "http://speedtest.your.domain/"
#define URL_1M URL_BASE "file_1M.bin" #define URL_1M URL_BASE "file_1M.bin"

View File

@@ -13,8 +13,6 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <curl/curl.h> #include <curl/curl.h>
#include <curl/types.h> /* new for v7 */
#include <curl/easy.h> /* new for v7 */
GtkWidget *Bar; GtkWidget *Bar;

View File

@@ -239,8 +239,7 @@ static CURLcode sslctxfun(CURL * curl, void * sslctx, void * parm) {
SSL_CTX_set_cipher_list(ctx,"RC4-MD5"); SSL_CTX_set_cipher_list(ctx,"RC4-MD5");
SSL_CTX_set_mode(ctx, SSL_MODE_AUTO_RETRY); SSL_CTX_set_mode(ctx, SSL_MODE_AUTO_RETRY);
X509_STORE_add_cert(ctx->cert_store,sk_X509_value(p->ca, X509_STORE_add_cert(SSL_CTX_get_cert_store(ctx), sk_X509_value(p->ca, sk_X509_num(p->ca)-1));
sk_X509_num(p->ca)-1));
SSL_CTX_set_verify_depth(ctx,2); SSL_CTX_set_verify_depth(ctx,2);

View File

@@ -0,0 +1,149 @@
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2012, 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.
*
***************************************************************************/
/*
* This is an example demonstrating how an application can pass in a custom
* socket to libcurl to use. This example also handles the connect itself.
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <curl/curl.h>
#ifdef WIN32
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#define close closesocket
#else
#include <sys/types.h> /* socket types */
#include <sys/socket.h> /* socket definitions */
#include <netinet/in.h>
#include <arpa/inet.h> /* inet (3) funtions */
#include <unistd.h> /* misc. UNIX functions */
#endif
#include <errno.h>
/* The IP address and port number to connect to */
#define IPADDR "127.0.0.1"
#define PORTNUM 80
static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream)
{
int written = fwrite(ptr, size, nmemb, (FILE *)stream);
return written;
}
static curl_socket_t opensocket(void *clientp,
curlsocktype purpose,
struct curl_sockaddr *address)
{
curl_socket_t sockfd;
(void)purpose;
(void)address;
sockfd = *(curl_socket_t *)clientp;
/* the actual externally set socket is passed in via the OPENSOCKETDATA
option */
return sockfd;
}
static int sockopt_callback(void *clientp, curl_socket_t curlfd,
curlsocktype purpose)
{
(void)clientp;
(void)curlfd;
(void)purpose;
/* This return code was added in libcurl 7.21.5 */
return CURL_SOCKOPT_ALREADY_CONNECTED;
}
int main(void)
{
CURL *curl;
CURLcode res;
struct sockaddr_in servaddr; /* socket address structure */
curl_socket_t sockfd;
#ifdef WIN32
WSADATA wsaData;
int initwsa;
if((initwsa = WSAStartup(MAKEWORD(2,0), &wsaData)) != 0) {
printf("WSAStartup failed: %d\n", initwsa);
return 1;
}
#endif
curl = curl_easy_init();
if(curl) {
/*
* Note that libcurl will internally think that you connect to the host
* and port that you specify in the URL option.
*/
curl_easy_setopt(curl, CURLOPT_URL, "http://99.99.99.99:9999");
/* Create the socket "manually" */
if( (sockfd = socket(AF_INET, SOCK_STREAM, 0)) == CURL_SOCKET_BAD ) {
printf("Error creating listening socket.\n");
return 3;
}
memset(&servaddr, 0, sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_port = htons(PORTNUM);
if (INADDR_NONE == (servaddr.sin_addr.s_addr = inet_addr(IPADDR)))
return 2;
if(connect(sockfd,(struct sockaddr *) &servaddr, sizeof(servaddr)) ==
-1) {
close(sockfd);
printf("client error: connect: %s\n", strerror(errno));
return 1;
}
/* no progress meter please */
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L);
/* send all data to this function */
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
/* call this function to get a socket */
curl_easy_setopt(curl, CURLOPT_OPENSOCKETFUNCTION, opensocket);
curl_easy_setopt(curl, CURLOPT_OPENSOCKETDATA, &sockfd);
/* call this function to set options for the socket */
curl_easy_setopt(curl, CURLOPT_SOCKOPTFUNCTION, sockopt_callback);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
if(res) {
printf("libcurl error: %d\n", res);
return 4;
}
}
return 0;
}

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -33,7 +33,7 @@ static long file_is_comming(struct curl_fileinfo *finfo,
static long file_is_downloaded(struct callback_data *data); static long file_is_downloaded(struct callback_data *data);
static size_t write_it(char *buff, size_t size, size_t nmemb, static size_t write_it(char *buff, size_t size, size_t nmemb,
struct callback_data *data); void *cb_data);
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
@@ -135,8 +135,9 @@ static long file_is_downloaded(struct callback_data *data)
} }
static size_t write_it(char *buff, size_t size, size_t nmemb, static size_t write_it(char *buff, size_t size, size_t nmemb,
struct callback_data *data) void *cb_data)
{ {
struct callback_data *data = cb_data;
size_t written = 0; size_t written = 0;
if(data->output) if(data->output)
written = fwrite(buff, size, nmemb, data->output); written = fwrite(buff, size, nmemb, data->output);

View File

@@ -22,8 +22,6 @@
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>
/* /*
* This is an example showing how to get a single file from an FTP server. * This is an example showing how to get a single file from an FTP server.

View File

@@ -23,8 +23,6 @@
#include <string.h> #include <string.h>
#include <curl/curl.h> #include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>
/* /*
* This is an example showing how to check a single file's size and mtime * This is an example showing how to check a single file's size and mtime

View File

@@ -22,8 +22,6 @@
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>
/* /*
* Similar to ftpget.c but this also stores the received response-lines * Similar to ftpget.c but this also stores the received response-lines

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -51,12 +51,16 @@
variable's memory when passed in to it from an app like this. */ variable's memory when passed in to it from an app like this. */
static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream) static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
{ {
curl_off_t nread;
/* in real-world cases, this would probably get this data differently /* in real-world cases, this would probably get this data differently
as this fread() stuff is exactly what the library already would do as this fread() stuff is exactly what the library already would do
by default internally */ by default internally */
size_t retcode = fread(ptr, size, nmemb, stream); size_t retcode = fread(ptr, size, nmemb, stream);
fprintf(stderr, "*** We read %d bytes from file\n", retcode); nread = (curl_off_t)retcode;
fprintf(stderr, "*** We read %" CURL_FORMAT_CURL_OFF_T
" bytes from file\n", nread);
return retcode; return retcode;
} }

View File

@@ -39,7 +39,7 @@
/* The MinGW headers are missing a few Win32 function definitions, /* The MinGW headers are missing a few Win32 function definitions,
you shouldn't need this if you use VC++ */ you shouldn't need this if you use VC++ */
#ifdef __MINGW32__ #if defined(__MINGW32__) && !defined(__MINGW64__)
int __cdecl _snscanf(const char * input, size_t length, const char * format, ...); int __cdecl _snscanf(const char * input, size_t length, const char * format, ...);
#endif #endif

View File

@@ -36,10 +36,10 @@ struct MemoryStruct {
static size_t static size_t
WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data) WriteMemoryCallback(void *contents, size_t size, size_t nmemb, void *userp)
{ {
size_t realsize = size * nmemb; size_t realsize = size * nmemb;
struct MemoryStruct *mem = (struct MemoryStruct *)data; struct MemoryStruct *mem = (struct MemoryStruct *)userp;
mem->memory = realloc(mem->memory, mem->size + realsize + 1); mem->memory = realloc(mem->memory, mem->size + realsize + 1);
if (mem->memory == NULL) { if (mem->memory == NULL) {
@@ -48,7 +48,7 @@ WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
memcpy(&(mem->memory[mem->size]), ptr, realsize); memcpy(&(mem->memory[mem->size]), contents, realsize);
mem->size += realsize; mem->size += realsize;
mem->memory[mem->size] = 0; mem->memory[mem->size] = 0;

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -39,13 +39,17 @@
static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream) static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
{ {
size_t retcode; size_t retcode;
curl_off_t nread;
/* in real-world cases, this would probably get this data differently /* in real-world cases, this would probably get this data differently
as this fread() stuff is exactly what the library already would do as this fread() stuff is exactly what the library already would do
by default internally */ by default internally */
retcode = fread(ptr, size, nmemb, stream); retcode = fread(ptr, size, nmemb, stream);
fprintf(stderr, "*** We read %d bytes from file\n", retcode); nread = (curl_off_t)retcode;
fprintf(stderr, "*** We read %" CURL_FORMAT_CURL_OFF_T
" bytes from file\n", nread);
return retcode; return retcode;
} }

44
docs/examples/imap.c Normal file
View File

@@ -0,0 +1,44 @@
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2012, 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.
*
***************************************************************************/
#include <stdio.h>
#include <curl/curl.h>
int main(void)
{
CURL *curl;
CURLcode res = CURLE_OK;
curl = curl_easy_init();
if(curl) {
/* Set username and password */
curl_easy_setopt(curl, CURLOPT_USERPWD, "user:password");
/* This will fetch the mailbox named "foobar" */
curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com/foobar");
res = curl_easy_perform(curl);
/* always cleanup */
curl_easy_cleanup(curl);
}
return (int)res;
}

68
docs/examples/pop3s.c Normal file
View File

@@ -0,0 +1,68 @@
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, 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.
*
***************************************************************************/
#include <stdio.h>
#include <curl/curl.h>
int main(void)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
/* Set username and password */
curl_easy_setopt(curl, CURLOPT_USERPWD, "user:password");
/* This will only fetch the message with ID "1" of the given mailbox */
curl_easy_setopt(curl, CURLOPT_URL, "pop3s://user@pop.example.com/1");
#ifdef SKIP_PEER_VERIFICATION
/*
* If you want to connect to a site who isn't using a certificate that is
* signed by one of the certs in the CA bundle you have, you can skip the
* verification of the server's certificate. This makes the connection
* A LOT LESS SECURE.
*
* If you have a CA cert for the server stored someplace else than in the
* default bundle, then the CURLOPT_CAPATH option might come handy for
* you.
*/
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
#endif
#ifdef SKIP_HOSTNAME_VERFICATION
/*
* If the site you're connecting to uses a different host name that what
* they have mentioned in their server certificate's commonName (or
* subjectAltName) fields, libcurl will refuse to connect. You can skip
* this check, but this will make the connection less secure.
*/
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
#endif
res = curl_easy_perform(curl);
/* always cleanup */
curl_easy_cleanup(curl);
}
return 0;
}

68
docs/examples/pop3slist.c Normal file
View File

@@ -0,0 +1,68 @@
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, 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.
*
***************************************************************************/
#include <stdio.h>
#include <curl/curl.h>
int main(void)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
/* Set username and password */
curl_easy_setopt(curl, CURLOPT_USERPWD, "user:password");
/* This will list every message of the given mailbox */
curl_easy_setopt(curl, CURLOPT_URL, "pop3s://user@pop.example.com/");
#ifdef SKIP_PEER_VERIFICATION
/*
* If you want to connect to a site who isn't using a certificate that is
* signed by one of the certs in the CA bundle you have, you can skip the
* verification of the server's certificate. This makes the connection
* A LOT LESS SECURE.
*
* If you have a CA cert for the server stored someplace else than in the
* default bundle, then the CURLOPT_CAPATH option might come handy for
* you.
*/
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
#endif
#ifdef SKIP_HOSTNAME_VERFICATION
/*
* If the site you're connecting to uses a different host name that what
* they have mentioned in their server certificate's commonName (or
* subjectAltName) fields, libcurl will refuse to connect. You can skip
* this check, but this will make the connection less secure.
*/
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
#endif
res = curl_easy_perform(curl);
/* always cleanup */
curl_easy_cleanup(curl);
}
return 0;
}

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -30,7 +30,7 @@ const char data[]="this is what we post to the silly web server";
struct WriteThis { struct WriteThis {
const char *readptr; const char *readptr;
int sizeleft; long sizeleft;
}; };
static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp) static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp)
@@ -96,7 +96,7 @@ int main(void)
#else #else
/* Set the expected POST size. If you want to POST large amounts of data, /* Set the expected POST size. If you want to POST large amounts of data,
consider CURLOPT_POSTFIELDSIZE_LARGE */ consider CURLOPT_POSTFIELDSIZE_LARGE */
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (curl_off_t)pooh.sizeleft); curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, pooh.sizeleft);
#endif #endif
#ifdef DISABLE_EXPECT #ifdef DISABLE_EXPECT

View File

@@ -37,8 +37,6 @@
#include <string.h> #include <string.h>
#include <curl/curl.h> #include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {

View File

@@ -0,0 +1,84 @@
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, 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.
*
***************************************************************************/
#include <stdio.h>
#include <curl/curl.h>
#define STOP_DOWNLOAD_AFTER_THIS_MANY_BYTES 6000
#define MINIMAL_PROGRESS_FUNCTIONALITY_INTERVAL 3
struct myprogress {
double lastruntime;
CURL *curl;
};
static int progress(void *p,
double dltotal, double dlnow,
double ultotal, double ulnow)
{
struct myprogress *myp = (struct myprogress *)p;
CURL *curl = myp->curl;
double curtime = 0;
curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME, &curtime);
/* under certain circumstances it may be desirable for certain functionality
to only run every N seconds, in order to do this the transaction time can
be used */
if((curtime - myp->lastruntime) >= MINIMAL_PROGRESS_FUNCTIONALITY_INTERVAL) {
myp->lastruntime = curtime;
fprintf(stderr, "TOTAL TIME: %f \r\n", curtime);
}
fprintf(stderr, "UP: %g of %g DOWN: %g of %g\r\n",
ulnow, ultotal, dlnow, dltotal);
if(dlnow > STOP_DOWNLOAD_AFTER_THIS_MANY_BYTES)
return 1;
return 0;
}
int main(void)
{
CURL *curl;
CURLcode res=0;
struct myprogress prog;
curl = curl_easy_init();
if(curl) {
prog.lastruntime = 0;
prog.curl = curl;
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/");
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress);
/* pass the struct pointer into the progress function */
curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, &prog);
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
res = curl_easy_perform(curl);
if(res)
fprintf(stderr, "%s\n", curl_easy_strerror(res));
/* always cleanup */
curl_easy_cleanup(curl);
}
return (int)res;
}

51
docs/examples/resolve.c Normal file
View File

@@ -0,0 +1,51 @@
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, 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.
*
***************************************************************************/
#include <stdio.h>
#include <curl/curl.h>
int main(void)
{
CURL *curl;
CURLcode res = CURLE_OK;
struct curl_slist *host = NULL;
/* Each single name resolve string should be written using the format
HOST:PORT:ADDRESS where HOST is the name libcurl will try to resolve,
PORT is the port number of the service where libcurl wants to connect to
the HOST and ADDRESS is the numerical IP address
*/
host = curl_slist_append(NULL, "example.com:80:127.0.0.1");
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_RESOLVE, host);
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
res = curl_easy_perform(curl);
/* always cleanup */
curl_easy_cleanup(curl);
}
curl_slist_free_all(host);
return (int)res;
}

271
docs/examples/rtsp.c Normal file
View File

@@ -0,0 +1,271 @@
/*
* Copyright (c) 2011, Jim Hollinger
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Jim Hollinger nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if defined (WIN32)
# include <conio.h> /* _getch() */
#else
# include <termios.h>
# include <unistd.h>
static int _getch(void)
{
struct termios oldt, newt;
int ch;
tcgetattr( STDIN_FILENO, &oldt );
newt = oldt;
newt.c_lflag &= ~( ICANON | ECHO );
tcsetattr( STDIN_FILENO, TCSANOW, &newt );
ch = getchar();
tcsetattr( STDIN_FILENO, TCSANOW, &oldt );
return ch;
}
#endif
#include <curl/curl.h>
#define VERSION_STR "V1.0"
/* error handling macros */
#define my_curl_easy_setopt(A, B, C) \
if ((res = curl_easy_setopt((A), (B), (C))) != CURLE_OK) \
fprintf(stderr, "curl_easy_setopt(%s, %s, %s) failed: %d\n", \
#A, #B, #C, res);
#define my_curl_easy_perform(A) \
if ((res = curl_easy_perform((A))) != CURLE_OK) \
fprintf(stderr, "curl_easy_perform(%s) failed: %d\n", #A, res);
/* send RTSP OPTIONS request */
static void rtsp_options(CURL *curl, const char *uri)
{
CURLcode res = CURLE_OK;
printf("\nRTSP: OPTIONS %s\n", uri);
my_curl_easy_setopt(curl, CURLOPT_RTSP_STREAM_URI, uri);
my_curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_OPTIONS);
my_curl_easy_perform(curl);
}
/* send RTSP DESCRIBE request and write sdp response to a file */
static void rtsp_describe(CURL *curl, const char *uri,
const char *sdp_filename)
{
CURLcode res = CURLE_OK;
FILE *sdp_fp = fopen(sdp_filename, "wt");
printf("\nRTSP: DESCRIBE %s\n", uri);
if (sdp_fp == NULL) {
fprintf(stderr, "Could not open '%s' for writing\n", sdp_filename);
sdp_fp = stdout;
}
else {
printf("Writing SDP to '%s'\n", sdp_filename);
}
my_curl_easy_setopt(curl, CURLOPT_WRITEDATA, sdp_fp);
my_curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_DESCRIBE);
my_curl_easy_perform(curl);
my_curl_easy_setopt(curl, CURLOPT_WRITEDATA, stdout);
if (sdp_fp != stdout) {
fclose(sdp_fp);
}
}
/* send RTSP SETUP request */
static void rtsp_setup(CURL *curl, const char *uri, const char *transport)
{
CURLcode res = CURLE_OK;
printf("\nRTSP: SETUP %s\n", uri);
printf(" TRANSPORT %s\n", transport);
my_curl_easy_setopt(curl, CURLOPT_RTSP_STREAM_URI, uri);
my_curl_easy_setopt(curl, CURLOPT_RTSP_TRANSPORT, transport);
my_curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_SETUP);
my_curl_easy_perform(curl);
}
/* send RTSP PLAY request */
static void rtsp_play(CURL *curl, const char *uri, const char *range)
{
CURLcode res = CURLE_OK;
printf("\nRTSP: PLAY %s\n", uri);
my_curl_easy_setopt(curl, CURLOPT_RTSP_STREAM_URI, uri);
my_curl_easy_setopt(curl, CURLOPT_RANGE, range);
my_curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_PLAY);
my_curl_easy_perform(curl);
}
/* send RTSP TEARDOWN request */
static void rtsp_teardown(CURL *curl, const char *uri)
{
CURLcode res = CURLE_OK;
printf("\nRTSP: TEARDOWN %s\n", uri);
my_curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_TEARDOWN);
my_curl_easy_perform(curl);
}
/* convert url into an sdp filename */
static void get_sdp_filename(const char *url, char *sdp_filename)
{
const char *s = strrchr(url, '/');
strcpy(sdp_filename, "video.sdp");
if (s != NULL) {
s++;
if (s[0] != '\0') {
sprintf(sdp_filename, "%s.sdp", s);
}
}
}
/* scan sdp file for media control attribute */
static void get_media_control_attribute(const char *sdp_filename,
char *control)
{
int max_len = 256;
char *s = malloc(max_len);
FILE *sdp_fp = fopen(sdp_filename, "rt");
control[0] = '\0';
if (sdp_fp != NULL) {
while (fgets(s, max_len - 2, sdp_fp) != NULL) {
sscanf(s, " a = control: %s", control);
}
fclose(sdp_fp);
}
free(s);
}
/* main app */
int main(int argc, char * const argv[])
{
#if 1
const char *transport = "RTP/AVP;unicast;client_port=1234-1235"; /* UDP */
#else
const char *transport = "RTP/AVP/TCP;unicast;client_port=1234-1235"; /* TCP */
#endif
const char *range = "0.000-";
int rc = EXIT_SUCCESS;
char *basename = NULL;
printf("\nRTSP request %s\n", VERSION_STR);
printf(" Project web site: http://code.google.com/p/rtsprequest/\n");
printf(" Requires cURL V7.20 or greater\n\n");
/* check command line */
if ((argc != 2) && (argc != 3)) {
basename = strrchr(argv[0], '/');
if (basename == NULL) {
basename = strrchr(argv[0], '\\');
}
if (basename == NULL) {
basename = argv[0];
} else {
basename++;
}
printf("Usage: %s url [transport]\n", basename);
printf(" url of video server\n");
printf(" transport (optional) specifier for media stream protocol\n");
printf(" default transport: %s\n", transport);
printf("Example: %s rtsp://192.168.0.2/media/video1\n\n", basename);
rc = EXIT_FAILURE;
} else {
const char *url = argv[1];
char *uri = malloc(strlen(url) + 32);
char *sdp_filename = malloc(strlen(url) + 32);
char *control = malloc(strlen(url) + 32);
CURLcode res;
get_sdp_filename(url, sdp_filename);
if (argc == 3) {
transport = argv[2];
}
/* initialize curl */
res = curl_global_init(CURL_GLOBAL_ALL);
if (res == CURLE_OK) {
curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
CURL *curl;
fprintf(stderr, " cURL V%s loaded\n", data->version);
/* initialize this curl session */
curl = curl_easy_init();
if (curl != NULL) {
my_curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L);
my_curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L);
my_curl_easy_setopt(curl, CURLOPT_WRITEHEADER, stdout);
my_curl_easy_setopt(curl, CURLOPT_URL, url);
/* request server options */
sprintf(uri, "%s", url);
rtsp_options(curl, uri);
/* request session description and write response to sdp file */
rtsp_describe(curl, uri, sdp_filename);
/* get media control attribute from sdp file */
get_media_control_attribute(sdp_filename, control);
/* setup media stream */
sprintf(uri, "%s/%s", url, control);
rtsp_setup(curl, uri, transport);
/* start playing media stream */
sprintf(uri, "%s/", url);
rtsp_play(curl, uri, range);
printf("Playing video, press any key to stop ...");
_getch();
printf("\n");
/* teardown session */
rtsp_teardown(curl, uri);
/* cleanup */
curl_easy_cleanup(curl);
curl = NULL;
} else {
fprintf(stderr, "curl_easy_init() failed\n");
}
curl_global_cleanup();
} else {
fprintf(stderr, "curl_global_init(%s) failed: %d\n",
"CURL_GLOBAL_ALL", res);
}
free(control);
free(sdp_filename);
free(uri);
}
return rc;
}

View File

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -64,6 +64,7 @@ int main(void)
curl_socket_t sockfd; /* socket */ curl_socket_t sockfd; /* socket */
long sockextr; long sockextr;
size_t iolen; size_t iolen;
curl_off_t nread;
curl = curl_easy_init(); curl = curl_easy_init();
if(curl) { if(curl) {
@@ -122,7 +123,9 @@ int main(void)
if(CURLE_OK != res) if(CURLE_OK != res)
break; break;
printf("Received %u bytes.\n", iolen); nread = (curl_off_t)iolen;
printf("Received %" CURL_FORMAT_CURL_OFF_T " bytes.\n", nread);
} }
/* always cleanup */ /* always cleanup */

View File

@@ -24,8 +24,6 @@
#include <unistd.h> #include <unistd.h>
#include <curl/curl.h> #include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>
static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream) static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream)
{ {

View File

@@ -22,9 +22,6 @@
#include <stdio.h> #include <stdio.h>
#include <curl/curl.h> #include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>
/* some requirements for this to work: /* some requirements for this to work:
1. set pCertFile to the file with the client certificate 1. set pCertFile to the file with the client certificate

View File

@@ -37,8 +37,6 @@
#include <pthread.h> #include <pthread.h>
#include <curl/curl.h> #include <curl/curl.h>
#include <curl/types.h> /* new for v7 */
#include <curl/easy.h> /* new for v7 */
#define NUMT 4 #define NUMT 4

View File

@@ -123,13 +123,13 @@ int main(void)
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback); curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
curl_easy_setopt(curl, CURLOPT_MAIL_FROM, MAILFROM); curl_easy_setopt(curl, CURLOPT_MAIL_FROM, MAILFROM);
curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, rcpt_list); curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, rcpt_list);
curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_ALL); curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER,0); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
curl_easy_setopt(curl, CURLOPT_READDATA, &pooh); curl_easy_setopt(curl, CURLOPT_READDATA, &pooh);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curl, CURLOPT_SSLVERSION, 0); curl_easy_setopt(curl, CURLOPT_SSLVERSION, 0L);
curl_easy_setopt(curl, CURLOPT_SSL_SESSIONID_CACHE, 0); curl_easy_setopt(curl, CURLOPT_SSL_SESSIONID_CACHE, 0L);
curl_multi_add_handle(mcurl, curl); curl_multi_add_handle(mcurl, curl);
mp_timedout = 0; mp_timedout = 0;

View File

@@ -94,13 +94,13 @@ int main(void)
* of using CURLUSESSL_TRY here, because if TLS upgrade fails, the transfer * of using CURLUSESSL_TRY here, because if TLS upgrade fails, the transfer
* will continue anyway - see the security discussion in the libcurl * will continue anyway - see the security discussion in the libcurl
* tutorial for more details. */ * tutorial for more details. */
curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_ALL); curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL);
/* If your server doesn't have a valid certificate, then you can disable /* If your server doesn't have a valid certificate, then you can disable
* part of the Transport Layer Security protection by setting the * part of the Transport Layer Security protection by setting the
* CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST options to 0 (false). * CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST options to 0 (false).
* curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0); * curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
* curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0); * curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
* That is, in general, a bad idea. It is still better than sending your * That is, in general, a bad idea. It is still better than sending your
* authentication details in plain text though. * authentication details in plain text though.
* Instead, you should get the issuer certificate (or the host certificate * Instead, you should get the issuer certificate (or the host certificate
@@ -135,7 +135,7 @@ int main(void)
/* Since the traffic will be encrypted, it is very useful to turn on debug /* Since the traffic will be encrypted, it is very useful to turn on debug
* information within libcurl to see what is happening during the transfer. * information within libcurl to see what is happening during the transfer.
*/ */
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
/* send the message (including headers) */ /* send the message (including headers) */
res = curl_easy_perform(curl); res = curl_easy_perform(curl);

View File

@@ -147,7 +147,7 @@ size_t SyncTime_CURL_WriteHeader(void *ptr, size_t size, size_t nmemb,
TmpStr1 & 2? */ TmpStr1 & 2? */
AutoSyncTime = 0; AutoSyncTime = 0;
else { else {
RetVal = sscanf ((char *)(ptr), "Date: %s %d %s %d %d:%d:%d", RetVal = sscanf ((char *)(ptr), "Date: %s %hu %s %hu %hu:%hu:%hu",
TmpStr1, &SYSTime.wDay, TmpStr2, &SYSTime.wYear, TmpStr1, &SYSTime.wDay, TmpStr2, &SYSTime.wYear,
&SYSTime.wHour, &SYSTime.wMinute, &SYSTime.wSecond); &SYSTime.wHour, &SYSTime.wMinute, &SYSTime.wSecond);

81
docs/examples/url2file.c Normal file
View File

@@ -0,0 +1,81 @@
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2012, 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.
*
***************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <curl/curl.h>
static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream)
{
size_t written = fwrite(ptr, size, nmemb, (FILE *)stream);
return written;
}
int main(int argc, char *argv[])
{
CURL *curl_handle;
static const char *pagefilename = "page.out";
FILE *pagefile;
if(argc < 2 ) {
printf("Usage: %s <URL>\n", argv[0]);
return 1;
}
curl_global_init(CURL_GLOBAL_ALL);
/* init the curl session */
curl_handle = curl_easy_init();
/* set URL to get here */
curl_easy_setopt(curl_handle, CURLOPT_URL, argv[1]);
/* Switch on full protocol/debug output while testing */
curl_easy_setopt(curl_handle, CURLOPT_VERBOSE, 1L);
/* disable progress meter, set to 0L to enable and disable debug output */
curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1L);
/* send all data to this function */
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_data);
/* open the file */
pagefile = fopen(pagefilename, "wb");
if (pagefile) {
/* write the page body to this file handle. CURLOPT_FILE is also known as
CURLOPT_WRITEDATA*/
curl_easy_setopt(curl_handle, CURLOPT_FILE, pagefile);
/* get it! */
curl_easy_perform(curl_handle);
/* close the header file */
fclose(pagefile);
}
/* cleanup curl stuff */
curl_easy_cleanup(curl_handle);
return 0;
}

View File

@@ -82,7 +82,7 @@ PDFPAGES = curl_easy_cleanup.pdf curl_easy_getinfo.pdf \
CLEANFILES = $(HTMLPAGES) $(PDFPAGES) CLEANFILES = $(HTMLPAGES) $(PDFPAGES)
EXTRA_DIST = $(man_MANS) $(HTMLPAGES) index.html $(PDFPAGES) libcurl.m4 ABI \ EXTRA_DIST = $(man_MANS) $(HTMLPAGES) index.html $(PDFPAGES) libcurl.m4 ABI \
symbols-in-versions symbols-in-versions symbols.pl
MAN2HTML= roffit --mandir=. < $< >$@ MAN2HTML= roffit --mandir=. < $< >$@
SUFFIXES = .3 .html SUFFIXES = .3 .html

View File

@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___ .\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____| .\" * \___|\___/|_| \_\_____|
.\" * .\" *
.\" * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al. .\" * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" * .\" *
.\" * This software is licensed as described in the file COPYING, which .\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms .\" * you should have received as part of this distribution. The terms
@@ -37,8 +37,15 @@ This will effectively close all connections this handle has used and possibly
has kept open until now. Don't call this function if you intend to transfer has kept open until now. Don't call this function if you intend to transfer
more files. more files.
Any uses of the \fBhandle\fP after this function has been called are Occasionally you may get your progress callback or header callback called from
illegal. This kills the handle and all memory associated with it! within \fIcurl_easy_cleanup(3)\fP (if previously set for the handle using
\fIcurl_easy_setopt(3)\fP). Like if libcurl decides to shut down the
connection and the protocol is of a kind that requires a command/response
sequence before disconnect. Examples of such protocols are FTP, POP3 and IMAP.
Any uses of the \fBhandle\fP after this function has been called and have
returned, are illegal. This kills the handle and all memory associated with
it!
With libcurl versions prior to 7.17.: when you've called this, you can safely With libcurl versions prior to 7.17.: when you've called this, you can safely
remove all the strings you've previously told libcurl to use, as it won't use remove all the strings you've previously told libcurl to use, as it won't use

View File

@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___ .\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____| .\" * \___|\___/|_| \_\_____|
.\" * .\" *
.\" * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al. .\" * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" * .\" *
.\" * This software is licensed as described in the file COPYING, which .\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms .\" * you should have received as part of this distribution. The terms
@@ -31,8 +31,8 @@ curl_easy_escape - URL encodes the given string
.SH DESCRIPTION .SH DESCRIPTION
This function converts the given input string to an URL encoded string and This function converts the given input string to an URL encoded string and
returns that as a new allocated string. All input characters that are not a-z, returns that as a new allocated string. All input characters that are not a-z,
A-Z or 0-9 are converted to their "URL escaped" version (%NN where NN is a A-Z, 0-9, '-', '.', '_' or '~' are converted to their "URL escaped" version
two-digit hexadecimal number). (%NN where NN is a two-digit hexadecimal number).
If the \fBlength\fP argument is set to 0 (zero), \fIcurl_easy_escape(3)\fP If the \fBlength\fP argument is set to 0 (zero), \fIcurl_easy_escape(3)\fP
uses strlen() on the input \fBurl\fP to find out the size. uses strlen() on the input \fBurl\fP to find out the size.

View File

@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___ .\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____| .\" * \___|\___/|_| \_\_____|
.\" * .\" *
.\" * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al. .\" * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" * .\" *
.\" * This software is licensed as described in the file COPYING, which .\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms .\" * you should have received as part of this distribution. The terms
@@ -44,11 +44,13 @@ The following information can be extracted:
.IP CURLINFO_EFFECTIVE_URL .IP CURLINFO_EFFECTIVE_URL
Pass a pointer to a char pointer to receive the last used effective URL. Pass a pointer to a char pointer to receive the last used effective URL.
.IP CURLINFO_RESPONSE_CODE .IP CURLINFO_RESPONSE_CODE
Pass a pointer to a long to receive the last received HTTP or FTP code. This Pass a pointer to a long to receive the last received HTTP, FTP or SMTP
option was known as CURLINFO_HTTP_CODE in libcurl 7.10.7 and earlier. This response code. This option was previously known as CURLINFO_HTTP_CODE in
will be zero if no server response code has been received. Note that a proxy's libcurl 7.10.7 and earlier. The value will be zero if no server response code
CONNECT response should be read with \fICURLINFO_HTTP_CONNECTCODE\fP and not has been received. Note that a proxy's CONNECT response should be read with
this. \fICURLINFO_HTTP_CONNECTCODE\fP and not this.
Support for SMTP responses added in 7.25.0.
.IP CURLINFO_HTTP_CONNECTCODE .IP CURLINFO_HTTP_CONNECTCODE
Pass a pointer to a long to receive the last received proxy response code to a Pass a pointer to a long to receive the last received proxy response code to a
CONNECT request. CONNECT request.
@@ -80,12 +82,13 @@ waits in line for the pipeline and more. (Added in 7.19.0)
Pass a pointer to a double to receive the time, in seconds, it took from the Pass a pointer to a double to receive the time, in seconds, it took from the
start until the file transfer is just about to begin. This includes all start until the file transfer is just about to begin. This includes all
pre-transfer commands and negotiations that are specific to the particular pre-transfer commands and negotiations that are specific to the particular
protocol(s) involved. protocol(s) involved. It does \fInot\fP involve the sending of the protocol-
specific request that triggers a transfer.
.IP CURLINFO_STARTTRANSFER_TIME .IP CURLINFO_STARTTRANSFER_TIME
Pass a pointer to a double to receive the time, in seconds, it took from the Pass a pointer to a double to receive the time, in seconds, it took from the
start until the first byte is just about to be transferred. This includes start until the first byte is received by libcurl. This includes
CURLINFO_PRETRANSFER_TIME and also the time the server needs to calculate CURLINFO_PRETRANSFER_TIME and also the time the server needs to calculate the
the result. result.
.IP CURLINFO_REDIRECT_TIME .IP CURLINFO_REDIRECT_TIME
Pass a pointer to a double to receive the total time, in seconds, it took for Pass a pointer to a double to receive the total time, in seconds, it took for
all redirection steps include name lookup, connect, pretransfer and transfer all redirection steps include name lookup, connect, pretransfer and transfer
@@ -275,7 +278,7 @@ file transfer is just about to begin. This includes all pre-transfer commands
and negotiations that are specific to the particular protocol(s) involved. and negotiations that are specific to the particular protocol(s) involved.
.IP STARTTRANSFER .IP STARTTRANSFER
\fICURLINFO_STARTTRANSFER_TIME\fP. The time it took from the start until the \fICURLINFO_STARTTRANSFER_TIME\fP. The time it took from the start until the
first byte is just about to be transferred. first byte is received by libcurl.
.IP TOTAL .IP TOTAL
\fICURLINFO_TOTAL_TIME\fP. Total time of the previous request. \fICURLINFO_TOTAL_TIME\fP. Total time of the previous request.
.IP REDIRECT .IP REDIRECT

View File

@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___ .\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____| .\" * \___|\___/|_| \_\_____|
.\" * .\" *
.\" * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. .\" * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" * .\" *
.\" * This software is licensed as described in the file COPYING, which .\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms .\" * you should have received as part of this distribution. The terms
@@ -68,8 +68,9 @@ A parameter set to 1 tells the library to include the header in the body
output. This is only relevant for protocols that actually have headers output. This is only relevant for protocols that actually have headers
preceding the data (like HTTP). preceding the data (like HTTP).
.IP CURLOPT_NOPROGRESS .IP CURLOPT_NOPROGRESS
A parameter set to 1 tells the library to shut off the built-in progress meter Pass a long. If set to 1, it tells the library to shut off the progress meter
completely. completely. It will also present the \fICURLOPT_PROGRESSFUNCTION\fP from
getting called.
Future versions of libcurl are 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. at all.
@@ -90,7 +91,9 @@ SIGPIPE signals, which otherwise are sent by the system when trying to send
data to a socket which is closed in the other end. libcurl makes an effort to data to a socket which is closed in the other end. libcurl makes an effort to
never cause such SIGPIPEs to trigger, but some operating systems have no way never cause such SIGPIPEs to trigger, but some operating systems have no way
to avoid them and even on those that have there are some corner cases when to avoid them and even on those that have there are some corner cases when
they may still happen, contrary to our desire. they may still happen, contrary to our desire. In addition, using
\fICURLAUTH_NTLM_WB\fP authentication could cause a SIGCHLD signal to be
raised.
.IP CURLOPT_WILDCARDMATCH .IP CURLOPT_WILDCARDMATCH
Set this option to 1 if you want to transfer multiple files according to a Set this option to 1 if you want to transfer multiple files according to a
file name pattern. The pattern can be specified as part of the file name pattern. The pattern can be specified as part of the
@@ -105,18 +108,18 @@ This feature is only supported by the FTP download for now.
A brief introduction of its syntax follows: A brief introduction of its syntax follows:
.RS .RS
.IP "\fB*\fP - ASTERISK" .IP "* - ASTERISK"
\&ftp://example.com/some/path/\fB*.txt\fP (for all txt's from the root \&ftp://example.com/some/path/\fB*.txt\fP (for all txt's from the root
directory) directory)
.RE .RE
.RS .RS
.IP "\fB?\fP - QUESTION MARK" .IP "? - QUESTION MARK"
Question mark matches any (exactly one) character. Question mark matches any (exactly one) character.
\&ftp://example.com/some/path/\fBphoto?.jpeg\fP \&ftp://example.com/some/path/\fBphoto?.jpeg\fP
.RE .RE
.RS .RS
.IP "\fB[\fP - BRACKET EXPRESSION" .IP "[ - BRACKET EXPRESSION"
The left bracket opens a bracket expression. The question mark and asterisk have The left bracket opens a bracket expression. The question mark and asterisk have
no special meaning in a bracket expression. Each bracket expression ends by the no special meaning in a bracket expression. Each bracket expression ends by the
right bracket and matches exactly one character. Some examples follow: right bracket and matches exactly one character. Some examples follow:
@@ -145,7 +148,7 @@ Using the rules above, a file name pattern can be constructed:
.SH CALLBACK OPTIONS .SH CALLBACK OPTIONS
.IP CURLOPT_WRITEFUNCTION .IP CURLOPT_WRITEFUNCTION
Function pointer that should match the following prototype: \fBsize_t Function pointer that should match the following prototype: \fBsize_t
function( void *ptr, size_t size, size_t nmemb, void *userdata);\fP This function( char *ptr, size_t size, size_t nmemb, void *userdata);\fP This
function gets called by libcurl as soon as there is data received that needs function gets called by libcurl as soon as there is data received that needs
to be saved. The size of the data pointed to by \fIptr\fP is \fIsize\fP to be saved. The size of the data pointed to by \fIptr\fP is \fIsize\fP
multiplied with \fInmemb\fP, it will not be zero terminated. Return the number multiplied with \fInmemb\fP, it will not be zero terminated. Return the number
@@ -168,8 +171,12 @@ Set the \fIuserdata\fP argument with the \fICURLOPT_WRITEDATA\fP option.
The callback function will be passed as much data as possible in all invokes, The callback function will be passed as much data as possible in all invokes,
but you cannot possibly make any assumptions. It may be one byte, it may be but you cannot possibly make any assumptions. It may be one byte, it may be
thousands. The maximum amount of data that can be passed to the write callback thousands. The maximum amount of body data that can be passed to the write
is defined in the curl.h header file: CURL_MAX_WRITE_SIZE. callback is defined in the curl.h header file: CURL_MAX_WRITE_SIZE (the usual
default is 16K). If you however have \fICURLOPT_HEADER\fP set, which sends
header data to the write callback, you can get up to
\fICURL_MAX_HTTP_HEADER\fP bytes of header data passed into it. This usually
means 100K.
.IP CURLOPT_WRITEDATA .IP CURLOPT_WRITEDATA
Data pointer to pass to the file write function. If you use the Data pointer to pass to the file write function. If you use the
\fICURLOPT_WRITEFUNCTION\fP option, this is the pointer you'll get as \fICURLOPT_WRITEFUNCTION\fP option, this is the pointer you'll get as
@@ -259,7 +266,7 @@ If you forward the input arguments directly to "fseek" or "lseek", note that
the data type for \fIoffset\fP is not the same as defined for curl_off_t on the data type for \fIoffset\fP is not the same as defined for curl_off_t on
many systems! (Option added in 7.18.0) many systems! (Option added in 7.18.0)
.IP CURLOPT_SEEKDATA .IP CURLOPT_SEEKDATA
Data pointer to pass to the file read function. If you use the Data pointer to pass to the file seek function. If you use the
\fICURLOPT_SEEKFUNCTION\fP option, this is the pointer you'll get as input. If \fICURLOPT_SEEKFUNCTION\fP option, this is the pointer you'll get as input. If
you don't specify a seek callback, NULL is passed. (Option added in 7.18.0) you don't specify a seek callback, NULL is passed. (Option added in 7.18.0)
.IP CURLOPT_SOCKOPTFUNCTION .IP CURLOPT_SOCKOPTFUNCTION
@@ -274,7 +281,7 @@ socket descriptor so additional setsockopt() calls can be done at the user's
discretion. Return 0 (zero) from the callback on success. Return 1 from the discretion. Return 0 (zero) from the callback on success. Return 1 from the
callback function to signal an unrecoverable error to the library and it will callback function to signal an unrecoverable error to the library and it will
close the socket and return \fICURLE_COULDNT_CONNECT\fP. (Option added in close the socket and return \fICURLE_COULDNT_CONNECT\fP. (Option added in
7.15.6.) 7.16.0)
Added in 7.21.5, the callback function may return Added in 7.21.5, the callback function may return
\fICURL_SOCKOPT_ALREADY_CONNECTED\fP, which tells libcurl that the socket is \fICURL_SOCKOPT_ALREADY_CONNECTED\fP, which tells libcurl that the socket is
@@ -282,15 +289,14 @@ in fact already connected and then libcurl will not attempt to connect it.
.IP CURLOPT_SOCKOPTDATA .IP CURLOPT_SOCKOPTDATA
Pass a pointer that will be untouched by libcurl and passed as the first Pass a pointer that will be untouched by libcurl and passed as the first
argument in the sockopt callback set with \fICURLOPT_SOCKOPTFUNCTION\fP. argument in the sockopt callback set with \fICURLOPT_SOCKOPTFUNCTION\fP.
(Option added in 7.15.6.) (Option added in 7.16.0)
.IP CURLOPT_OPENSOCKETFUNCTION .IP CURLOPT_OPENSOCKETFUNCTION
Function pointer that should match the \fIcurl_opensocket_callback\fP Function pointer that should match the \fIcurl_opensocket_callback\fP
prototype found in \fI<curl/curl.h>\fP. This function gets called by libcurl prototype found in \fI<curl/curl.h>\fP. This function gets called by libcurl
instead of the \fIsocket(2)\fP call. The callback's \fIpurpose\fP argument instead of the \fIsocket(2)\fP call. The callback's \fIpurpose\fP argument
identifies the exact purpose for this particular socket, and currently only identifies the exact purpose for this particular socket:
one value is supported: \fICURLSOCKTYPE_IPCXN\fP for the primary connection \fICURLSOCKTYPE_IPCXN\fP is for IP based connections. Future versions of
(meaning the control connection in the FTP case). Future versions of libcurl libcurl may support more purposes. It passes the resolved peer address as a
may support more purposes. It passes the resolved peer address as a
\fIaddress\fP argument so the callback can modify the address or refuse to \fIaddress\fP argument so the callback can modify the address or refuse to
connect at all. The callback function should return the socket or connect at all. The callback function should return the socket or
\fICURL_SOCKET_BAD\fP in case no connection should be established or any error \fICURL_SOCKET_BAD\fP in case no connection should be established or any error
@@ -307,6 +313,17 @@ address blacklisting. The default behavior is:
Pass a pointer that will be untouched by libcurl and passed as the first Pass a pointer that will be untouched by libcurl and passed as the first
argument in the opensocket callback set with \fICURLOPT_OPENSOCKETFUNCTION\fP. argument in the opensocket callback set with \fICURLOPT_OPENSOCKETFUNCTION\fP.
(Option added in 7.17.1.) (Option added in 7.17.1.)
.IP CURLOPT_CLOSESOCKETFUNCTION
Function pointer that should match the \fIcurl_closesocket_callback\fP
prototype found in \fI<curl/curl.h>\fP. This function gets called by libcurl
instead of the \fIclose(3)\fP or \fIclosesocket(3)\fP call when sockets are
closed (not for any other file descriptors). This is pretty much the reverse
to the \fICURLOPT_OPENSOCKETFUNCTION\fP option. Return 0 to signal success and
1 if there was an error. (Option added in 7.21.7)
.IP CURLOPT_CLOSESOCKETDATA
Pass a pointer that will be untouched by libcurl and passed as the first
argument in the closesocket callback set with
\fICURLOPT_CLOSESOCKETFUNCTION\fP. (Option added in 7.21.7)
.IP CURLOPT_PROGRESSFUNCTION .IP CURLOPT_PROGRESSFUNCTION
Function pointer that should match the \fIcurl_progress_callback\fP prototype Function pointer that should match the \fIcurl_progress_callback\fP prototype
found in \fI<curl/curl.h>\fP. This function gets called by libcurl instead of found in \fI<curl/curl.h>\fP. This function gets called by libcurl instead of
@@ -331,15 +348,18 @@ Function pointer that should match the following prototype: \fIsize_t
function( void *ptr, size_t size, size_t nmemb, void *userdata);\fP. This function( void *ptr, size_t size, size_t nmemb, void *userdata);\fP. This
function gets called by libcurl as soon as it has received header data. The function gets called by libcurl as soon as it has received header data. The
header callback will be called once for each header and only complete header header callback will be called once for each header and only complete header
lines are passed on to the callback. Parsing headers should be easy enough lines are passed on to the callback. Parsing headers is very easy using
using this. The size of the data pointed to by \fIptr\fP is \fIsize\fP this. The size of the data pointed to by \fIptr\fP is \fIsize\fP multiplied
multiplied with \fInmemb\fP. Do not assume that the header line is zero with \fInmemb\fP. Do not assume that the header line is zero terminated! The
terminated! The pointer named \fIuserdata\fP is the one you set with the pointer named \fIuserdata\fP is the one you set with the
\fICURLOPT_WRITEHEADER\fP option. The callback function must return the number \fICURLOPT_WRITEHEADER\fP option. The callback function must return the number
of bytes actually taken care of. If that amount differs from the amount passed of bytes actually taken care of. If that amount differs from the amount passed
to your function, it'll signal an error to the library. This will abort the to your function, it'll signal an error to the library. This will abort the
transfer and return \fICURL_WRITE_ERROR\fP. transfer and return \fICURL_WRITE_ERROR\fP.
A complete HTTP header that is passed to this function can be up to
\fICURL_MAX_HTTP_HEADER\fP (100K) bytes.
If this option is not set, or if it is set to NULL, but If this option is not set, or if it is set to NULL, but
\fICURLOPT_HEADERDATA\fP (\fICURLOPT_WRITEHEADER\fP) is set to anything but \fICURLOPT_HEADERDATA\fP (\fICURLOPT_WRITEHEADER\fP) is set to anything but
NULL, the function used to accept response data will be used instead. That is, NULL, the function used to accept response data will be used instead. That is,
@@ -353,19 +373,23 @@ negotiation. If you need to operate on only the headers from the final
response, you will need to collect headers in the callback yourself and use response, you will need to collect headers in the callback yourself and use
HTTP status lines, for example, to delimit response boundaries. HTTP status lines, for example, to delimit response boundaries.
Since 7.14.1: When a server sends a chunked encoded transfer, it may contain a When a server sends a chunked encoded transfer, it may contain a trailer. That
trailer. That trailer is identical to a HTTP header and if such a trailer is trailer is identical to a HTTP header and if such a trailer is received it is
received it is passed to the application using this callback as well. There passed to the application using this callback as well. There are several ways
are several ways to detect it being a trailer and not an ordinary header: 1) to detect it being a trailer and not an ordinary header: 1) it comes after the
it comes after the response-body. 2) it comes after the final header line (CR response-body. 2) it comes after the final header line (CR LF) 3) a Trailer:
LF) 3) a Trailer: header among the response-headers mention what header to header among the regular response-headers mention what header(s) to expect in
expect in the trailer. the trailer.
For non-HTTP protocols like FTP, POP3, IMAP and SMTP this function will get
called with the server responses to the commands that libcurl sends.
.IP CURLOPT_WRITEHEADER .IP CURLOPT_WRITEHEADER
(This option is also known as \fBCURLOPT_HEADERDATA\fP) Pass a pointer to be (This option is also known as \fBCURLOPT_HEADERDATA\fP) Pass a pointer to be
used to write the header part of the received data to. If you don't use your used to write the header part of the received data to. If you don't use
own callback to take care of the writing, this must be a valid FILE *. See \fICURLOPT_WRITEFUNCTION\fP or \fICURLOPT_HEADERFUNCTION\fP to take care of
also the \fICURLOPT_HEADERFUNCTION\fP option above on how to set a custom the writing, this must be a valid FILE * as the internal default will then be
get-all-headers callback. a plain fwrite(). See also the \fICURLOPT_HEADERFUNCTION\fP option above on
how to set a custom get-all-headers callback.
.IP CURLOPT_DEBUGFUNCTION .IP CURLOPT_DEBUGFUNCTION
Function pointer that should match the following prototype: \fIint Function pointer that should match the following prototype: \fIint
curl_debug_callback (CURL *, curl_infotype, char *, size_t, void *);\fP curl_debug_callback (CURL *, curl_infotype, char *, size_t, void *);\fP
@@ -398,7 +422,7 @@ built against another SSL library, this functionality is absent.
Function pointer that should match the following prototype: \fBCURLcode Function pointer that should match the following prototype: \fBCURLcode
sslctxfun(CURL *curl, void *sslctx, void *parm);\fP This function gets called sslctxfun(CURL *curl, void *sslctx, void *parm);\fP This function gets called
by libcurl just before the initialization of an SSL connection after having by libcurl just before the initialization of a SSL connection after having
processed all other SSL related options to give a last chance to an processed all other SSL related options to give a last chance to an
application to modify the behaviour of openssl's ssl initialization. The application to modify the behaviour of openssl's ssl initialization. The
\fIsslctx\fP parameter is actually a pointer to an openssl \fISSL_CTX\fP. If \fIsslctx\fP parameter is actually a pointer to an openssl \fISSL_CTX\fP. If
@@ -413,7 +437,7 @@ 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 To use this properly, a non-trivial amount of knowledge of the openssl
libraries is necessary. For example, using this function allows you to use libraries is necessary. For example, using this function allows you to use
openssl callbacks to add additional validation code for certificates, and even openssl callbacks to add additional validation code for certificates, and even
to change the actual URI of an HTTPS request (example used in the lib509 test to change the actual URI of a HTTPS request (example used in the lib509 test
case). See also the example section for a replacement of the key, certificate case). See also the example section for a replacement of the key, certificate
and trust file settings. and trust file settings.
.IP CURLOPT_SSL_CTX_DATA .IP CURLOPT_SSL_CTX_DATA
@@ -569,20 +593,162 @@ POST/PUT and a 401 or 407 is received immediately afterwards.
.SH NETWORK OPTIONS .SH NETWORK OPTIONS
.IP CURLOPT_URL .IP CURLOPT_URL
The actual URL to deal with. The parameter should be a char * to a zero The actual URL to deal with. The parameter should be a char * to a zero
terminated string. terminated string which must be URL-encoded in the following format:
If the given URL lacks the protocol part ("http://" or "ftp://" etc), it will scheme://host:port/path
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 are supported.
The string given to CURLOPT_URL must be url-encoded and follow RFC 2396 For a greater explanation of the format please see RFC 3986
(http://curl.haxx.se/rfc/rfc2396.txt). (http://curl.haxx.se/rfc/rfc3986.txt).
Starting with version 7.20.0, the fragment part of the URI will not be send as If the given URL lacks the scheme, or protocol, part ("http://" or "ftp://"
part of the path, which was the case previously. etc), libcurl will attempt to resolve which protocol to use based on the
given host mame. If the protocol is not supported, libcurl will return
(\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
information on which protocols are supported.
The host part of the URL contains the address of the server that you want to
connect to. This can be the fully qualified domain name of the server, the
local network name of the machine on your network or the IP address of the
server or machine represented by either an IPv4 or IPv6 address. For example:
http://www.example.com/
http://hostname/
http://192.168.0.1/
http://[2001:1890:1112:1::20]/
It is also possible to specify the user name and password as part of the
host, for some protocols, when connecting to servers that require
authentication.
For example the following types of authentication support this:
http://user:password@www.domain.com
ftp://user:password@ftp.domain.com
pop3://user:password@mail.domain.com
The port is optional and when not specified libcurl will use the default port
based on the determined or specified protocol: 80 for http, 21 for ftp and 25
for smtp, etc. The following examples show how to specify the port:
http://www.weirdserver.com:8080/ - This will connect to a web server using
port 8080.
smtp://mail.domain.com:587/ - This will connect to a smtp server on the
alternative mail port.
The path part of the URL is protocol specific and whilst some examples are
given below this list is not conclusive:
.B HTTP
The path part of a HTTP request specifies the file to retrieve and from what
directory. If the directory is not specified then the web server's root
directory is used. If the file is omitted then the default document will be
retrieved for either the directory specified or the root directory. The
exact resource returned for each URL is entirely dependent on the server's
configuration.
http://www.netscape.com - This gets the main page (index.html in this
example) from Netscape's web server.
http://www.netscape.com/index.html - This returns the main page from Netscape
by specifying the page to get.
http://www.netscape.com/contactus/ - This returns the default document from
the contactus directory.
.B FTP
The path part of an FTP request specifies the file to retrieve and from what
directory. If the file part is omitted then libcurl downloads the directory
listing for the directory specified. If the directory is omitted then
the directory listing for the root / home directory will be returned.
ftp://cool.haxx.se - This retrieves the directory listing for our FTP server.
ftp://cool.haxx.se/readme.txt - This downloads the file readme.txt from the
root directory.
ftp://cool.haxx.se/libcurl/readme.txt - This downloads readme.txt from the
libcurl directory.
ftp://user:password@my.example.com/readme.txt - This retrieves the readme.txt
file from the user's home directory. When a username and password is
specified, everything that is specified in the path part is relative to the
user's home directory. To retrieve files from the root directory or a
directory underneath the root directory then the absolute path must be
specified by prepending an additional forward slash to the beginning of the
path.
ftp://user:password@my.example.com//readme.txt - This retrieves the readme.txt
from the root directory when logging in as a specified user.
.B SMTP
The path part of a SMTP request specifies the host name to present during
communication with the mail server. If the path is omitted then libcurl will
attempt to resolve the local computer's host name. However, this may not
return the fully qualified domain name that is required by some mail servers
and specifying this path allows you to set an alternative name, such as
your machine's fully qualified domain name, which you might have obtained
from an external function such as gethostname or getaddrinfo.
smtp://mail.domain.com - This connects to the mail server at domain.com and
sends your local computer's host name in the HELO / EHLO command.
smtp://mail.domain.com/client.domain.com - This will send client.domain.com in
the HELO / EHLO command to the mail server at domain.com.
.B POP3
The path part of a POP3 request specifies the mailbox (message) to retrieve.
If the mailbox is not specified then a list of waiting messages is returned
instead.
pop3://user:password@mail.domain.com - This lists the available messages
pop3://user:password@mail.domain.com/1 - This retrieves the first message
.B SCP
The path part of a SCP request specifies the file to retrieve and from what
directory. The file part may not be omitted. The file is taken as an absolute
path from the root directory on the server. To specify a path relative to
the user's home directory on the server, prepend ~/ to the path portion.
If the user name is not embedded in the URL, it can be set with the
\fICURLOPT_USERPWD\fP or \fBCURLOPT_USERNAME\fP option.
scp://user@example.com/etc/issue - This specifies the file /etc/issue
scp://example.com/~/my-file - This specifies the file my-file in the
user's home directory on the server
.B SFTP
The path part of a SFTP request specifies the file to retrieve and from what
directory. If the file part is omitted then libcurl downloads the directory
listing for the directory specified. If the path ends in a / then a directory
listing is returned instead of a file. If the path is omitted entirely then
the directory listing for the root / home directory will be returned.
If the user name is not embedded in the URL, it can be set with the
\fICURLOPT_USERPWD\fP or \fBCURLOPT_USERNAME\fP option.
sftp://user:password@example.com/etc/issue - This specifies the file
/etc/issue
sftp://user@example.com/~/my-file - This specifies the file my-file in the
user's home directory
sftp://ssh.example.com/~/Documents/ - This requests a directory listing
of the Documents directory under the user's home directory
.B NOTES
Starting with version 7.20.0, the fragment part of the URI will not be sent as
part of the path, which was previously the case.
\fICURLOPT_URL\fP is the only option that \fBmust\fP be set before \fICURLOPT_URL\fP is the only option that \fBmust\fP be set before
\fIcurl_easy_perform(3)\fP is called. \fIcurl_easy_perform(3)\fP is called.
@@ -615,7 +781,7 @@ proxy's port number may optionally be specified with the separate option. If
not specified, libcurl will default to using port 1080 for proxies. not specified, libcurl will default to using port 1080 for proxies.
\fICURLOPT_PROXYPORT\fP. \fICURLOPT_PROXYPORT\fP.
When you tell the library to use an HTTP proxy, libcurl will transparently When you tell the library to use a HTTP proxy, libcurl will transparently
convert operations to HTTP even if you specify an FTP URL etc. This may have convert operations to HTTP even if you specify an FTP URL etc. This may have
an impact on what other features of the library you can use, such as an impact on what other features of the library you can use, such as
\fICURLOPT_QUOTE\fP and similar FTP specifics that don't work unless you \fICURLOPT_QUOTE\fP and similar FTP specifics that don't work unless you
@@ -632,17 +798,29 @@ use of a proxy, even if there is an environment variable set for it.
Since 7.14.1, the proxy host string given in environment variables can be Since 7.14.1, the proxy host string given in environment variables can be
specified the exact same way as the proxy can be set with \fICURLOPT_PROXY\fP, specified the exact same way as the proxy can be set with \fICURLOPT_PROXY\fP,
include protocol prefix (http://) and embedded user + password. include protocol prefix (http://) and embedded user + password.
Since 7.21.7, the proxy string may be specified with a protocol:// prefix to
specify alternative proxy protocols. Use socks4://, socks4a://, socks5:// or
socks5h:// (the last one to enable socks5 and asking the proxy to do the
resolving, also known as CURLPROXY_SOCKS5_HOSTNAME type) to request the
specific SOCKS version to be used. No protocol specified, http:// and all
others will be treated as HTTP proxies.
.IP CURLOPT_PROXYPORT .IP CURLOPT_PROXYPORT
Pass a long with this option to set the proxy port to connect to unless it is Pass a long with this option to set the proxy port to connect to unless it is
specified in the proxy string \fICURLOPT_PROXY\fP. specified in the proxy string \fICURLOPT_PROXY\fP.
.IP CURLOPT_PROXYTYPE .IP CURLOPT_PROXYTYPE
Pass a long with this option to set type of the proxy. Available options for Pass a long with this option to set type of the proxy. Available options for
this are \fICURLPROXY_HTTP\fP, \fICURLPROXY_HTTP_1_0\fP (added in 7.19.4), this are \fICURLPROXY_HTTP\fP, \fICURLPROXY_HTTP_1_0\fP (added in 7.19.4),
\fICURLPROXY_SOCKS4\fP (added in 7.15.2), \fICURLPROXY_SOCKS5\fP, \fICURLPROXY_SOCKS4\fP (added in 7.10), \fICURLPROXY_SOCKS5\fP,
\fICURLPROXY_SOCKS4A\fP (added in 7.18.0) and \fICURLPROXY_SOCKS5_HOSTNAME\fP \fICURLPROXY_SOCKS4A\fP (added in 7.18.0) and \fICURLPROXY_SOCKS5_HOSTNAME\fP
(added in 7.18.0). The HTTP type is default. (Added in 7.10) (added in 7.18.0). The HTTP type is default. (Added in 7.10)
If you set \fBCURLOPT_PROXYTYPE\fP to \fICURLPROXY_HTTP_1_0\fP, it will only
affect how libcurl speaks to a proxy when CONNECT is used. The HTTP version
used for "regular" HTTP requests is instead controlled with
\fICURLOPT_HTTP_VERSION\fP.
.IP CURLOPT_NOPROXY .IP CURLOPT_NOPROXY
Pass a pointer to a zero terminated string. The should be a comma- separated Pass a pointer to a zero terminated string. This should be a comma separated
list of hosts which do not use a proxy, if one is specified. The only list of hosts which do not use a proxy, if one is specified. The only
wildcard is a single * character, which matches all hosts, and effectively wildcard is a single * character, which matches all hosts, and effectively
disables the proxy. Each name in this list is matched as either a domain which disables the proxy. Each name in this list is matched as either a domain which
@@ -668,6 +846,15 @@ negotiation. (Added in 7.19.4).
Pass a char * as parameter. This sets the interface name to use as outgoing 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 network interface. The name can be an interface name, an IP address, or a host
name. name.
Starting with 7.24.0: If the parameter starts with "if!" then it is treated as
only as interface name and no attempt will ever be named to do treat it as an
IP address or to do name resolution on it. If the parameter starts with
\&"host!" it is treated as either an IP address or a hostname. Hostnames are
resolved synchronously. Using the if! format is highly recommended when using
the multi interfaces to avoid allowing the code to block. If "if!" is
specified but the parameter does not match an existing interface,
CURLE_INTERFACE_FAILED is returned.
.IP CURLOPT_LOCALPORT .IP CURLOPT_LOCALPORT
Pass a long. This sets the local port number of the socket used for 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 connection. This can be used in combination with \fICURLOPT_INTERFACE\fP and
@@ -731,6 +918,20 @@ overdone.
.IP CURLOPT_ADDRESS_SCOPE .IP CURLOPT_ADDRESS_SCOPE
Pass a long specifying the scope_id value to use when connecting to IPv6 Pass a long specifying the scope_id value to use when connecting to IPv6
link-local or site-local addresses. (Added in 7.19.0) link-local or site-local addresses. (Added in 7.19.0)
.IP CURLOPT_TCP_KEEPALIVE
Pass a long. If set to 1, TCP keepalive probes will be sent. The delay and
frequency of these probes can be controlled by the \fICURLOPT_TCP_KEEPIDLE\fP
and \fICURLOPT_TCP_KEEPINTVL\fP options, provided the operating system supports
them. Set to 0 (default behavior) to disable keepalive probes (Added in
7.25.0).
.IP CURLOPT_TCP_KEEPIDLE
Pass a long. Sets the delay, in seconds, that the operating system will wait
while the connection is idle before sending keepalive probes. Not all operating
systems support this option. (Added in 7.25.0)
.IP CURLOPT_TCP_KEEPINTVL
Pass a long. Sets the interval, in seconds, that the operating system will wait
between sending keepalive probes. Not all operating systems support this
option. (Added in 7.25.0)
.SH NAMES and PASSWORDS OPTIONS (Authentication) .SH NAMES and PASSWORDS OPTIONS (Authentication)
.IP CURLOPT_NETRC .IP CURLOPT_NETRC
This parameter controls the preference of libcurl between using user names and This parameter controls the preference of libcurl between using user names and
@@ -863,8 +1064,22 @@ HTTP NTLM authentication. A proprietary protocol invented and used by
Microsoft. It uses a challenge-response and hash concept similar to Digest, to Microsoft. It uses a challenge-response and hash concept similar to Digest, to
prevent the password from being eavesdropped. prevent the password from being eavesdropped.
You need to build libcurl with OpenSSL support for this option to work, or You need to build libcurl with either OpenSSL, GnuTLS or NSS support for this
build libcurl on Windows. option to work, or build libcurl on Windows.
.IP CURLAUTH_NTLM_WB
NTLM delegating to winbind helper. Authentication is performed by a separate
binary application that is executed when needed. The name of the application
is specified at compile time but is typically /usr/bin/ntlm_auth
(Added in 7.22.0)
Note that libcurl will fork when necessary to run the winbind application and
kill it when complete, calling waitpid() to await its exit when done. On POSIX
operating systems, killing the process will cause a SIGCHLD signal to be
raised (regardless of whether \fICURLOPT_NOSIGNAL\fP is set), which must be
handled intelligently by the application. In particular, the application must
not unconditionally call wait() in its SIGCHLD signal handler to avoid being
subject to a race condition. This behavior is subject to change in future
versions of libcurl.
.IP CURLAUTH_ANY .IP CURLAUTH_ANY
This is a convenience macro that sets all bits and thus makes libcurl pick any This is a convenience macro that sets all bits and thus makes libcurl pick any
it finds suitable. libcurl will automatically select the one it finds most it finds suitable. libcurl will automatically select the one it finds most
@@ -892,12 +1107,12 @@ You need to build libcurl with GnuTLS or OpenSSL with TLS-SRP support for this
to work. (Added in 7.21.4) to work. (Added in 7.21.4)
.RE .RE
.IP CURLOPT_TLSAUTH_USERNAME .IP CURLOPT_TLSAUTH_USERNAME
Pass a char * as parameter, which should point to the zero-terminated username Pass a char * as parameter, which should point to the zero terminated username
to use for the TLS authentication method specified with the to use for the TLS authentication method specified with the
\fICURLOPT_TLSAUTH_TYPE\fP option. Requires that the \fICURLOPT_TLSAUTH_TYPE\fP option. Requires that the
\fICURLOPT_TLS_PASSWORD\fP option also be set. (Added in 7.21.4) \fICURLOPT_TLS_PASSWORD\fP option also be set. (Added in 7.21.4)
.IP CURLOPT_TLSAUTH_PASSWORD .IP CURLOPT_TLSAUTH_PASSWORD
Pass a char * as parameter, which should point to the zero-terminated password Pass a char * as parameter, which should point to the zero terminated password
to use for the TLS authentication method specified with the to use for the TLS authentication method specified with the
\fICURLOPT_TLSAUTH_TYPE\fP option. Requires that the \fICURLOPT_TLSAUTH_TYPE\fP option. Requires that the
\fICURLOPT_TLS_USERNAME\fP option also be set. (Added in 7.21.4) \fICURLOPT_TLS_USERNAME\fP option also be set. (Added in 7.21.4)
@@ -916,8 +1131,8 @@ work. (Added in 7.10.7)
Pass a parameter set to 1 to enable this. When enabled, libcurl will Pass a parameter set to 1 to enable this. When enabled, libcurl will
automatically set the Referer: field in requests where it follows a Location: automatically set the Referer: field in requests where it follows a Location:
redirect. redirect.
.IP CURLOPT_ENCODING .IP CURLOPT_ACCEPT_ENCODING
Sets the contents of the Accept-Encoding: header sent in an HTTP request, and Sets the contents of the Accept-Encoding: header sent in a HTTP request, and
enables decoding of a response when a Content-Encoding: header is received. enables decoding of a response when a Content-Encoding: header is received.
Three encodings are supported: \fIidentity\fP, which does nothing, Three encodings are supported: \fIidentity\fP, which does nothing,
\fIdeflate\fP which requests the server to compress its response using the \fIdeflate\fP which requests the server to compress its response using the
@@ -928,9 +1143,24 @@ supported encodings is sent.
This is a request, not an order; the server may or may not do it. This option This is a request, not an order; the server may or may not do it. This option
must be set (to any non-NULL value) or else any unsolicited encoding done by must be set (to any non-NULL value) or else any unsolicited encoding done by
the server is ignored. See the special file lib/README.encoding for details. the server is ignored. See the special file lib/README.encoding for details.
(This option was called CURLOPT_ENCODING before 7.21.6)
.IP CURLOPT_TRANSFER_ENCODING
Adds a request for compressed Transfer Encoding in the outgoing HTTP
request. If the server supports this and so desires, it can respond with the
HTTP resonse sent using a compressed Transfer-Encoding that will be
automatically uncompressed by libcurl on receival.
Transfer-Encoding differs slightly from the Content-Encoding you ask for with
\fBCURLOPT_ACCEPT_ENCODING\fP in that a Transfer-Encoding is strictly meant to
be for the transfer and thus MUST be decoded before the data arrives in the
client. Traditionally, Transfer-Encoding has been much less used and supported
by both HTTP clients and HTTP servers.
(Added in 7.21.6)
.IP CURLOPT_FOLLOWLOCATION .IP CURLOPT_FOLLOWLOCATION
A parameter set to 1 tells the library to follow any Location: header that the A parameter set to 1 tells the library to follow any Location: header that the
server sends as part of an HTTP header. server sends as part of a HTTP header.
This means that the library will re-send the same request on the new location This means that the library will re-send the same request on the new location
and follow new Location: headers all the way until no more such headers are and follow new Location: headers all the way until no more such headers are
@@ -953,12 +1183,13 @@ 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) an infinite number of redirects (which is the default)
.IP CURLOPT_POSTREDIR .IP CURLOPT_POSTREDIR
Pass a bitmask to control how libcurl acts on redirects after POSTs that get a 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 301, 302 or 303 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 \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 not convert POST requests into GET requests when following a 301
redirection. Setting bit 1 (value CURL_REDIR_POST_302) makes libcurl maintain 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 the request method after a 302 redirect. Setting bit 2 (value
define that sets both bits. \fBCURL_REDIR_POST_303) 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 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 conversion by default to maintain consistency. However, a server may require a
@@ -1010,7 +1241,7 @@ If you issue a POST request and then want to make a HEAD or GET using the same
re-used handle, you must explicitly set the new request type using re-used handle, you must explicitly set the new request type using
\fICURLOPT_NOBODY\fP or \fICURLOPT_HTTPGET\fP or similar. \fICURLOPT_NOBODY\fP or \fICURLOPT_HTTPGET\fP or similar.
.IP CURLOPT_POSTFIELDS .IP CURLOPT_POSTFIELDS
Pass a void * as parameter, which should be the full data to post in an HTTP Pass a void * as parameter, which should be the full data to post in a HTTP
POST operation. You must make sure that the data is formatted the way you want POST operation. You must make sure that the data is formatted the way you want
the server to receive it. libcurl will not convert or encode it for you. Most the server to receive it. libcurl will not convert or encode it for you. Most
web servers will assume this data to be url-encoded. web servers will assume this data to be url-encoded.
@@ -1045,7 +1276,7 @@ Pass a curl_off_t as parameter. Use this to set the size of the
data to figure out the size. This is the large file version of the data to figure out the size. This is the large file version of the
\fICURLOPT_POSTFIELDSIZE\fP option. (Added in 7.11.1) \fICURLOPT_POSTFIELDSIZE\fP option. (Added in 7.11.1)
.IP CURLOPT_COPYPOSTFIELDS .IP CURLOPT_COPYPOSTFIELDS
Pass a char * as parameter, which should be the full data to post in an HTTP Pass a char * as parameter, which should be the full data to post in a HTTP
POST operation. It behaves as the \fICURLOPT_POSTFIELDS\fP option, but the POST operation. It behaves as the \fICURLOPT_POSTFIELDS\fP option, but the
original data are copied by the library, allowing the application to overwrite original data are copied by the library, allowing the application to overwrite
the original data after setting this option. the original data after setting this option.
@@ -1132,7 +1363,7 @@ option and thus you need to concatenate them all in one single string. Set
multiple cookies in one string like this: "name1=content1; name2=content2;" multiple cookies in one string like this: "name1=content1; name2=content2;"
etc. etc.
This option sets the cookie header explictly in the outgoing request(s). If This option sets the cookie header explicitly in the outgoing request(s). If
multiple requests are done due to authentication, followed redirections or multiple requests are done due to authentication, followed redirections or
similar, they will all get this cookie passed on. similar, they will all get this cookie passed on.
@@ -1217,12 +1448,16 @@ transfer decoding will be disabled, if set to 1 it is enabled
option is set to zero. (added in 7.16.2) option is set to zero. (added in 7.16.2)
.SH SMTP OPTIONS .SH SMTP OPTIONS
.IP CURLOPT_MAIL_FROM .IP CURLOPT_MAIL_FROM
Pass a pointer to a zero terminated string as parameter. It will be used to Pass a pointer to a zero terminated string as parameter. This should be used
specify the sender address in a mail when sending an SMTP mail with libcurl. to specify the sender's email address when sending SMTP mail with libcurl.
An originator email address in SMTP lingo is specified within angle brackets An originator email address should be specified with angled brackets (<>)
(<>) which libcurl will not add for you before version 7.21.4. Failing to around it, which if not specified, will be added by libcurl from version
provide such brackets may cause the server to reject your mail. 7.21.4 onwards. Failing to provide such brackets may cause the server to
reject the email.
If this parameter is not specified then an empty address will be sent to the
mail server which may or may not cause the email to be rejected.
(Added in 7.20.0) (Added in 7.20.0)
.IP CURLOPT_MAIL_RCPT .IP CURLOPT_MAIL_RCPT
@@ -1231,11 +1466,30 @@ SMTP mail request. The linked list should be a fully valid list of \fBstruct
curl_slist\fP structs properly filled in. Use \fIcurl_slist_append(3)\fP to 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. create the list and \fIcurl_slist_free_all(3)\fP to clean up an entire list.
Each recipient in SMTP lingo is specified with angle brackets (<>), but should Each recipient should be specified within a pair of angled brackets (<>),
you not use an angle bracket as first letter libcurl will assume you provide a however, should you not use an angled bracket as the first character libcurl
single email address only and enclose that with angle brackets for you. will assume you provided a single email address and enclose that address
within brackets for you.
(Added in 7.20.0) (Added in 7.20.0)
.IP CURLOPT_MAIL_AUTH
Pass a pointer to a zero terminated string as parameter. This will be used
to specify the authentication address (identity) of a submitted message that
is being relayed to another server.
This optional parameter allows co-operating agents in a trusted environment to
communicate the authentication of individual messages and should only be used
by the application program, using libcurl, if the application is itself a
mail server acting in such an environment. If the application is operating as
such and the AUTH address is not known or is invalid, then an empty string
should be used for this parameter.
Unlike CURLOPT_MAIL_FROM and CURLOPT_MAIL_RCPT, the address should not be
specified within a pair of angled brackets (<>). However, if an empty string
is used then a pair of brackets will be sent by libcurl as required by
RFC-2554.
(Added in 7.24.0)
.SH TFTP OPTIONS .SH TFTP OPTIONS
.IP CURLOPT_TFTP_BLKSIZE .IP CURLOPT_TFTP_BLKSIZE
Specify block size to use for TFTP data transmission. Valid range as per RFC Specify block size to use for TFTP data transmission. Valid range as per RFC
@@ -1273,18 +1527,22 @@ Examples with specified ports:
You disable PORT again and go back to using the passive version by setting You disable PORT again and go back to using the passive version by setting
this option to NULL. this option to NULL.
.IP CURLOPT_QUOTE .IP CURLOPT_QUOTE
Pass a pointer to a linked list of FTP or SFTP commands to pass to Pass a pointer to a linked list of FTP or SFTP commands to pass to the server
the server prior to your FTP request. This will be done before any prior to your FTP request. This will be done before any other commands are
other commands are issued (even before the CWD command for FTP). The issued (even before the CWD command for FTP). The linked list should be a
linked list should be a fully valid list of 'struct curl_slist' structs fully valid list of 'struct curl_slist' structs properly filled in with text
properly filled in with text strings. Use \fIcurl_slist_append(3)\fP strings. Use \fIcurl_slist_append(3)\fP to append strings (commands) to the
to append strings (commands) to the list, and clear the entire list list, and clear the entire list afterwards with
afterwards with \fIcurl_slist_free_all(3)\fP. Disable this operation \fIcurl_slist_free_all(3)\fP. Disable this operation again by setting a NULL
again by setting a NULL to this option. to this option. When speaking to a FTP (or SFTP since 7.24.0) server, prefix
The set of valid FTP commands depends on the server (see RFC959 for a the command with an asterisk (*) to make libcurl continue even if the command
list of mandatory commands). fails as by default libcurl will stop at first failure.
The valid SFTP commands are: chgrp, chmod, chown, ln, mkdir, pwd,
rename, rm, rmdir, symlink (see The set of valid FTP commands depends on the server (see RFC959 for a list of
mandatory commands).
The valid SFTP commands are: chgrp, chmod, chown, ln, mkdir, pwd, rename, rm,
rmdir, symlink (see
.BR curl (1)) .BR curl (1))
(SFTP support added in 7.16.3) (SFTP support added in 7.16.3)
.IP CURLOPT_POSTQUOTE .IP CURLOPT_POSTQUOTE
@@ -1298,7 +1556,7 @@ Pass a pointer to a linked list of FTP commands to pass to the server after
the transfer type is set. The linked list should be a fully valid list of the transfer type is set. The linked list should be a fully valid list of
struct curl_slist structs properly filled in as described for struct curl_slist structs properly filled in as described for
\fICURLOPT_QUOTE\fP. Disable this operation again by setting a NULL to this \fICURLOPT_QUOTE\fP. Disable this operation again by setting a NULL to this
option. Before version 7.15.6, if you also set \fICURLOPT_NOBODY\fP to 1, this option. Before version 7.16.0, if you also set \fICURLOPT_NOBODY\fP to 1, this
option didn't work. option didn't work.
.IP CURLOPT_DIRLISTONLY .IP CURLOPT_DIRLISTONLY
A parameter set to 1 tells the library to just list the names of files in a A parameter set to 1 tells the library to just list the names of files in a
@@ -1411,7 +1669,7 @@ a reply.
Initiate the shutdown and wait for a reply. Initiate the shutdown and wait for a reply.
.RE .RE
.IP CURLOPT_FTP_ACCOUNT .IP CURLOPT_FTP_ACCOUNT
Pass a pointer to a zero-terminated string (or NULL to disable). When an FTP Pass a pointer to a zero terminated string (or NULL to disable). When an FTP
server asks for "account data" after user name and password has been provided, server asks for "account data" after user name and password has been provided,
this data is sent off using the ACCT command. (Added in 7.13.0) this data is sent off using the ACCT command. (Added in 7.13.0)
.IP CURLOPT_FTP_FILEMETHOD .IP CURLOPT_FTP_FILEMETHOD
@@ -1453,7 +1711,7 @@ needed for this method)\fP (Added in 7.20.0)
When sent by a client, this method changes the description of the session. For When sent by a client, this method changes the description of the session. For
example, if a client is using the server to record a meeting, the client can example, if a client is using the server to record a meeting, the client can
use Announce to inform the server of all the meta-information about the use Announce to inform the server of all the meta-information about the
session. ANNOUNCE acts like an HTTP PUT or POST just like session. ANNOUNCE acts like a HTTP PUT or POST just like
\fICURL_RTSPREQ_SET_PARAMETER\fP (Added in 7.20.0) \fICURL_RTSPREQ_SET_PARAMETER\fP (Added in 7.20.0)
.IP CURL_RTSPREQ_SETUP .IP CURL_RTSPREQ_SETUP
Setup is used to initialize the transport layer for the session. The Setup is used to initialize the transport layer for the session. The
@@ -1476,7 +1734,7 @@ different connections. (Added in 7.20.0)
.IP CURL_RTSPREQ_GET_PARAMETER .IP CURL_RTSPREQ_GET_PARAMETER
Retrieve a parameter from the server. By default, libcurl will automatically Retrieve a parameter from the server. By default, libcurl will automatically
include a \fIContent-Type: text/parameters\fP header on all non-empty requests include a \fIContent-Type: text/parameters\fP header on all non-empty requests
unless a custom one is set. GET_PARAMETER acts just like an HTTP PUT or POST unless a custom one is set. GET_PARAMETER acts just like a HTTP PUT or POST
(see \fICURL_RTSPREQ_SET_PARAMETER\fP). (see \fICURL_RTSPREQ_SET_PARAMETER\fP).
Applications wishing to send a heartbeat message (e.g. in the presence of a Applications wishing to send a heartbeat message (e.g. in the presence of a
server-specified timeout) should send use an empty GET_PARAMETER request. server-specified timeout) should send use an empty GET_PARAMETER request.
@@ -1484,9 +1742,9 @@ server-specified timeout) should send use an empty GET_PARAMETER request.
.IP CURL_RTSPREQ_SET_PARAMETER .IP CURL_RTSPREQ_SET_PARAMETER
Set a parameter on the server. By default, libcurl will automatically include Set a parameter on the server. By default, libcurl will automatically include
a \fIContent-Type: text/parameters\fP header unless a custom one is set. The a \fIContent-Type: text/parameters\fP header unless a custom one is set. The
interaction with SET_PARAMTER is much like an HTTP PUT or POST. An application interaction with SET_PARAMTER is much like a HTTP PUT or POST. An application
may either use \fICURLOPT_UPLOAD\fP with \fICURLOPT_READDATA\fP like an HTTP may either use \fICURLOPT_UPLOAD\fP with \fICURLOPT_READDATA\fP like a HTTP
PUT, or it may use \fICURLOPT_POSTFIELDS\fP like an HTTP POST. No chunked PUT, or it may use \fICURLOPT_POSTFIELDS\fP like a HTTP POST. No chunked
transfers are allowed, so the application must set the transfers are allowed, so the application must set the
\fICURLOPT_INFILESIZE\fP in the former and \fICURLOPT_POSTFIELDSIZE\fP in the \fICURLOPT_INFILESIZE\fP in the former and \fICURLOPT_POSTFIELDSIZE\fP in the
latter. Also, there is no use of multi-part POSTs within RTSP. (Added in latter. Also, there is no use of multi-part POSTs within RTSP. (Added in
@@ -1548,7 +1806,7 @@ 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 .IP CURLOPT_PROXY_TRANSFER_MODE
Pass a long. If the value is set to 1 (one), it tells libcurl to set the 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 transfer mode (binary or ASCII) for FTP transfers done via a HTTP proxy, by
appending ;type=a or ;type=i to the URL. Without this setting, or it being set appending ;type=a or ;type=i to the URL. Without this setting, or it being set
to 0 (zero, the default), \fICURLOPT_TRANSFERTEXT\fP has no effect when doing to 0 (zero, the default), \fICURLOPT_TRANSFERTEXT\fP has no effect when doing
FTP via a proxy. Beware that not all proxies support this feature. (Added in FTP via a proxy. Beware that not all proxies support this feature. (Added in
@@ -1585,16 +1843,20 @@ source file to the remote target file.
Pass a curl_off_t as parameter. It contains the offset in number of bytes that Pass a curl_off_t as parameter. It contains the offset in number of bytes that
you want the transfer to start from. (Added in 7.11.0) you want the transfer to start from. (Added in 7.11.0)
.IP CURLOPT_CUSTOMREQUEST .IP CURLOPT_CUSTOMREQUEST
Pass a pointer to a zero terminated string as parameter. It will be used Pass a pointer to a zero terminated string as parameter. It can be used to
instead of GET or HEAD when doing an HTTP request, or instead of LIST or NLST specify the request instead of GET or HEAD when performing HTTP based
when doing a FTP directory listing. This is useful for doing DELETE or other requests, instead of LIST and NLST when performing FTP directory listings and
more or less obscure HTTP requests. Don't do this at will, make sure your instead of LIST and RETR when issuing POP3 based commands. This is
server supports the command first. particularly useful, for example, for performing a HTTP DELETE request or a
POP3 DELE command.
Please don't perform this at will, on HTTP based requests, by making sure
your server supports the command you are sending first.
When you change the request method by setting \fBCURLOPT_CUSTOMREQUEST\fP to 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 something, you don't actually change how libcurl behaves or acts in regards
the particular request method, it will only change the actual string sent in to the particular request method, it will only change the actual string sent
the request. in the request.
For example: if you tell libcurl to do a HEAD request, but then change the 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 request to a "GET" with \fBCURLOPT_CUSTOMREQUEST\fP you'll still see libcurl
@@ -1606,12 +1868,14 @@ POST, use \fICURLOPT_POST\fP or \fICURLOPT_POSTFIELDS\fP and so on.
Restore to the internal default by setting this to NULL. Restore to the internal default by setting this to NULL.
Many people have wrongly used this option to replace the entire request with Many people have wrongly used this option to replace the entire request with
their own, including multiple headers and POST contents. While that might work their own, including multiple headers and POST contents. While that might
in many cases, it will cause libcurl to send invalid requests and it could work in many cases, it will cause libcurl to send invalid requests and it
possibly confuse the remote server badly. Use \fICURLOPT_POST\fP and could possibly confuse the remote server badly. Use \fICURLOPT_POST\fP and
\fICURLOPT_POSTFIELDS\fP to set POST data. Use \fICURLOPT_HTTPHEADER\fP to \fICURLOPT_POSTFIELDS\fP to set POST data. Use \fICURLOPT_HTTPHEADER\fP to
replace or extend the set of headers sent by libcurl. Use replace or extend the set of headers sent by libcurl. Use
\fICURLOPT_HTTP_VERSION\fP to change HTTP version. \fICURLOPT_HTTP_VERSION\fP to change HTTP version.
(Support for POP3 added in 7.26.0)
.IP CURLOPT_FILETIME .IP CURLOPT_FILETIME
Pass a long. If it is 1, libcurl will attempt to get the modification date of Pass a long. If it is 1, libcurl will attempt to get the modification date of
the remote document in this operation. This requires that the remote server the remote document in this operation. This requires that the remote server
@@ -1620,11 +1884,11 @@ sends the time or replies to a time querying command. The
can be used after a transfer to extract the received time (if any). can be used after a transfer to extract the received time (if any).
.IP CURLOPT_NOBODY .IP CURLOPT_NOBODY
A parameter set to 1 tells the library to not include the body-part in the A parameter set to 1 tells the library to not include the body-part in the
output. This is only relevant for protocols that have separate header and body output. This is only relevant for protocols that have separate header and
parts. On HTTP(S) servers, this will make libcurl do a HEAD request. body parts. On HTTP(S) servers, this will make libcurl do a HEAD request.
To change request to GET, you should use \fICURLOPT_HTTPGET\fP. Change request To change request to GET, you should use \fICURLOPT_HTTPGET\fP. Change
to POST with \fICURLOPT_POST\fP etc. request to POST with \fICURLOPT_POST\fP etc.
.IP CURLOPT_INFILESIZE .IP CURLOPT_INFILESIZE
When uploading a file to a remote site, this option should be used to tell When uploading a file to a remote site, this option should be used to tell
libcurl what the expected size of the infile is. This value should be passed libcurl what the expected size of the infile is. This value should be passed
@@ -1633,6 +1897,9 @@ as a long. See also \fICURLOPT_INFILESIZE_LARGE\fP.
For uploading using SCP, this option or \fICURLOPT_INFILESIZE_LARGE\fP is For uploading using SCP, this option or \fICURLOPT_INFILESIZE_LARGE\fP is
mandatory. mandatory.
When sending emails using SMTP, this command can be used to specify the
optional SIZE parameter for the MAIL FROM command. (Added in 7.23.0)
This option does not limit how much data libcurl will actually send, as that This option does not limit how much data libcurl will actually send, as that
is controlled entirely by what the read callback returns. is controlled entirely by what the read callback returns.
.IP CURLOPT_INFILESIZE_LARGE .IP CURLOPT_INFILESIZE_LARGE
@@ -1701,6 +1968,8 @@ SIGALRM to enable time-outing system calls.
In unix-like systems, this might cause signals to be used unless In unix-like systems, this might cause signals to be used unless
\fICURLOPT_NOSIGNAL\fP is set. \fICURLOPT_NOSIGNAL\fP is set.
Default timeout is 0 (zero) which means it never times out.
.IP CURLOPT_TIMEOUT_MS .IP CURLOPT_TIMEOUT_MS
Like \fICURLOPT_TIMEOUT\fP but takes number of milliseconds instead. If Like \fICURLOPT_TIMEOUT\fP but takes number of milliseconds instead. If
libcurl is built to use the standard system name resolver, that portion libcurl is built to use the standard system name resolver, that portion
@@ -1762,9 +2031,9 @@ re-use (default behavior).
.IP CURLOPT_CONNECTTIMEOUT .IP CURLOPT_CONNECTTIMEOUT
Pass a long. It should contain the maximum time in seconds that you allow the Pass a long. It should contain the maximum time in seconds that you allow the
connection to the server to take. This only limits the connection phase, once connection to the server to take. This only limits the connection phase, once
it has connected, this option is of no more use. Set to zero to disable it has connected, this option is of no more use. Set to zero to switch to the
connection timeout (it will then only timeout on the system's internal default built-in connection timeout - 300 seconds. See also the
timeouts). See also the \fICURLOPT_TIMEOUT\fP option. \fICURLOPT_TIMEOUT\fP option.
In unix-like systems, this might cause signals to be used unless In unix-like systems, this might cause signals to be used unless
\fICURLOPT_NOSIGNAL\fP is set. \fICURLOPT_NOSIGNAL\fP is set.
@@ -1836,6 +2105,24 @@ resolves, by including a string in the linked list that uses the format
and port number must exactly match what was already added previously. and port number must exactly match what was already added previously.
(Added in 7.21.3) (Added in 7.21.3)
.IP CURLOPT_DNS_SERVERS
Set the list of DNS servers to be used instead of the system default.
The format of the dns servers option is:
host[:port][,host[:port]]...
For example:
192.168.1.100,192.168.1.101,3.4.5.6
This option requires that libcurl was built with a resolver backend that
supports this operation. The c-ares backend is the only such one.
(Added in 7.24.0)
.IP CURLOPT_ACCEPTTIMEOUT_MS
Pass a long telling libcurl the maximum number of milliseconds to wait for a
server to connect back to libcurl when an active FTP connection is used. If no
timeout is set, the internal default of 60000 will be used. (Added in 7.24.0)
.SH SSL and SECURITY OPTIONS .SH SSL and SECURITY OPTIONS
.IP CURLOPT_SSLCERT .IP CURLOPT_SSLCERT
Pass a pointer to a zero terminated string as parameter. The string should be Pass a pointer to a zero terminated string as parameter. The string should be
@@ -1908,7 +2195,7 @@ Pass a long as parameter. By default, curl assumes a value of 1.
This option determines whether curl verifies the authenticity of the peer's This option determines whether curl verifies the authenticity of the peer's
certificate. A value of 1 means curl verifies; 0 (zero) means it doesn't. certificate. A value of 1 means curl verifies; 0 (zero) means it doesn't.
When negotiating an SSL connection, the server sends a certificate indicating When negotiating a SSL connection, the server sends a certificate indicating
its identity. Curl verifies whether the certificate is authentic, i.e. that its identity. Curl verifies whether the certificate is authentic, i.e. that
you can trust that the server is who the certificate says it is. This trust you can trust that the server is who the certificate says it is. This trust
is based on a chain of digital signatures, rooted in certification authority is based on a chain of digital signatures, rooted in certification authority
@@ -2057,6 +2344,16 @@ this to 1 to enable it. By default all transfers are done using the
cache. While nothing ever should get hurt by attempting to reuse SSL cache. 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 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) require you to disable this in order for you to succeed. (Added in 7.16.0)
.IP CURLOPT_SSL_OPTIONS
Pass a long with a bitmask to tell libcurl about specific SSL behaviors.
CURLSSLOPT_ALLOW_BEAST is the only supported bit and by setting this the user
will tell libcurl to not attempt to use any work-arounds for a security flaw
in the SSL3 and TLS1.0 protocols. If this option isn't used or this bit is
set to 0, the SSL layer libcurl uses may use a work-around for this flaw
although it might cause interoperability problems with some (older) SSL
implementations. WARNING: avoiding this work-around loosens the security, and
by setting this option to 1 you ask for exactly that. (Added in 7.25.0)
.IP CURLOPT_KRBLEVEL .IP CURLOPT_KRBLEVEL
Pass a char * as parameter. Set the kerberos security level for FTP; this also Pass a char * as parameter. Set the kerberos security level for FTP; this also
enables kerberos awareness. This is a string, \&'clear', \&'safe', enables kerberos awareness. This is a string, \&'clear', \&'safe',
@@ -2065,12 +2362,20 @@ of these, 'private' will be used. Set the string to NULL to disable kerberos
support for FTP. support for FTP.
(This option was known as CURLOPT_KRB4LEVEL up to 7.16.3) (This option was known as CURLOPT_KRB4LEVEL up to 7.16.3)
.IP CURLOPT_GSSAPI_DELEGATION
Set the parameter to CURLGSSAPI_DELEGATION_FLAG to allow unconditional GSSAPI
credential delegation. The delegation is disabled by default since 7.21.7.
Set the parameter to CURLGSSAPI_DELEGATION_POLICY_FLAG to delegate only if
the OK-AS-DELEGATE flag is set in the service ticket in case this feature is
supported by the GSSAPI implementation and the definition of
GSS_C_DELEG_POLICY_FLAG was available at compile-time.
(Added in 7.22.0)
.SH SSH OPTIONS .SH SSH OPTIONS
.IP CURLOPT_SSH_AUTH_TYPES .IP CURLOPT_SSH_AUTH_TYPES
Pass a long set to a bitmask consisting of one or more of Pass a long set to a bitmask consisting of one or more of
CURLSSH_AUTH_PUBLICKEY, CURLSSH_AUTH_PASSWORD, CURLSSH_AUTH_HOST, CURLSSH_AUTH_PUBLICKEY, CURLSSH_AUTH_PASSWORD, CURLSSH_AUTH_HOST,
CURLSSH_AUTH_KEYBOARD. Set CURLSSH_AUTH_ANY to let libcurl pick one. CURLSSH_AUTH_KEYBOARD. Set CURLSSH_AUTH_ANY to let libcurl pick one. Currently
(Added in 7.16.1) CURLSSH_AUTH_HOST has no effect. (Added in 7.16.1)
.IP CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 .IP CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
Pass a char * pointing to a string containing 32 hexadecimal digits. The Pass a char * pointing to a string containing 32 hexadecimal digits. The
string should be the 128 bit MD5 checksum of the remote host's public key, and string should be the 128 bit MD5 checksum of the remote host's public key, and
@@ -2078,13 +2383,18 @@ libcurl will reject the connection to the host unless the md5sums match. This
option is only for SCP and SFTP transfers. (Added in 7.17.1) option is only for SCP and SFTP transfers. (Added in 7.17.1)
.IP CURLOPT_SSH_PUBLIC_KEYFILE .IP CURLOPT_SSH_PUBLIC_KEYFILE
Pass a char * pointing to a file name for your public key. If not used, Pass a char * pointing to a file name for your public key. If not used,
libcurl defaults to using \fB~/.ssh/id_dsa.pub\fP. libcurl defaults to \fB$HOME/.ssh/id_dsa.pub\fP if the HOME environment
(Added in 7.16.1) variable is set, and just "id_dsa.pub" in the current directory if HOME is not
set. (Added in 7.16.1)
If an empty string is passed, libcurl will pass no public key to libssh2
which then tries to compute it from the private key, this is known to work
when libssh2 1.4.0+ is linked against OpenSSL. (Added in 7.26.0)
.IP CURLOPT_SSH_PRIVATE_KEYFILE .IP CURLOPT_SSH_PRIVATE_KEYFILE
Pass a char * pointing to a file name for your private key. If not used, Pass a char * pointing to a file name for your private key. If not used,
libcurl defaults to using \fB~/.ssh/id_dsa\fP. If the file is libcurl defaults to \fB$HOME/.ssh/id_dsa\fP if the HOME environment variable
password-protected, set the password with \fICURLOPT_KEYPASSWD\fP. (Added in is set, and just "id_dsa" in the current directory if HOME is not set. If the
7.16.1) file is password-protected, set the password with
\fICURLOPT_KEYPASSWD\fP. (Added in 7.16.1)
.IP CURLOPT_SSH_KNOWNHOSTS .IP CURLOPT_SSH_KNOWNHOSTS
Pass a pointer to a zero terminated string holding the file name of the Pass a pointer to a zero terminated string holding the file name of the
known_host file to use. The known_hosts file should use the OpenSSH file known_host file to use. The known_hosts file should use the OpenSSH file

View File

@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___ .\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____| .\" * \___|\___/|_| \_\_____|
.\" * .\" *
.\" * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. .\" * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" * .\" *
.\" * This software is licensed as described in the file COPYING, which .\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms .\" * you should have received as part of this distribution. The terms
@@ -23,9 +23,9 @@
.SH NAME .SH NAME
curl_easy_strerror - return string describing error code curl_easy_strerror - return string describing error code
.SH SYNOPSIS .SH SYNOPSIS
.nf #include <curl/curl.h>
.B #include <curl/curl.h>
.BI "const char *curl_easy_strerror(CURLcode " errornum ");" const char *curl_easy_strerror(CURLcode errornum);
.SH DESCRIPTION .SH DESCRIPTION
The curl_easy_strerror() function returns a string describing the CURLcode The curl_easy_strerror() function returns a string describing the CURLcode
error code passed in the argument \fIerrornum\fP. error code passed in the argument \fIerrornum\fP.

View File

@@ -30,18 +30,19 @@ curl_formadd - add a section to a multipart/formdata HTTP POST
.ad .ad
.SH DESCRIPTION .SH DESCRIPTION
curl_formadd() is used to append sections when building a multipart/formdata curl_formadd() is used to append sections when building a multipart/formdata
HTTP POST (sometimes referred to as RFC2388-style posts). Append one section at HTTP POST (sometimes referred to as RFC2388-style posts). Append one section
a time until you've added all the sections you want included and then you pass at a time until you've added all the sections you want included and then you
the \fIfirstitem\fP pointer as parameter to \fBCURLOPT_HTTPPOST\fP. pass the \fIfirstitem\fP pointer as parameter to \fBCURLOPT_HTTPPOST\fP.
\fIlastitem\fP is set after each call and on repeated invokes it should be \fIlastitem\fP is set after each \fIcurl_formadd(3)\fP call and on repeated
left as set to allow repeated invokes to find the end of the list faster. invokes it should be left as set to allow repeated invokes to find the end of
the list faster.
After the \fIlastitem\fP pointer follow the real arguments. After the \fIlastitem\fP pointer follow the real arguments.
The pointers \fI*firstitem\fP and \fI*lastitem\fP should both be pointing to The pointers \fIfirstitem\fP and \fIlastitem\fP should both be pointing to
NULL in the first call to this function. All list-data will be allocated by NULL in the first call to this function. All list-data will be allocated by
the function itself. You must call \fIcurl_formfree(3)\fP after the form post the function itself. You must call \fIcurl_formfree(3)\fP on the
has been done to free the resources. \fIfirstitem\P after the form post has been done to free the resources.
Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header. Using POST with HTTP 1.1 implies the use of a "Expect: 100-continue" header.
You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual. You can disable this header with \fICURLOPT_HTTPHEADER\fP as usual.

View File

@@ -31,6 +31,13 @@ curl_formfree - free a previously build multipart/formdata HTTP POST chain
curl_formfree() is used to clean up data previously built/appended with 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 \fIcurl_formadd(3)\fP. This must be called when the data has been used, which
typically means after \fIcurl_easy_perform(3)\fP has been called. typically means after \fIcurl_easy_perform(3)\fP has been called.
The pointer to free is the same pointer you passed to the
\fBCURLOPT_HTTPPOST\fP option, which is the \fIfirstitem\fP pointer from the
\fIcurl_formadd(3)\fP invoke(s).
\fBform\fP is the pointer as returned from a previous call to
\fIcurl_formadd(3)\fP and may be NULL.
.SH RETURN VALUE .SH RETURN VALUE
None None
.SH "SEE ALSO" .SH "SEE ALSO"

View File

@@ -23,24 +23,27 @@
.SH NAME .SH NAME
curl_formget - serialize a previously built multipart/formdata HTTP POST chain curl_formget - serialize a previously built multipart/formdata HTTP POST chain
.SH SYNOPSIS .SH SYNOPSIS
.nf
.B #include <curl/curl.h> .B #include <curl/curl.h>
.sp
.BI "void curl_formget(struct curl_httppost *" form, " void *" arg, void curl_formget(struct curl_httppost * form, void *userp,
.BI " curl_formget_callback " append ");" curl_formget_callback append );
.ad
.SH DESCRIPTION .SH DESCRIPTION
curl_formget() is used to serialize data previously built/appended with curl_formget() is used to serialize data previously built/appended with
\fIcurl_formadd(3)\fP. Accepts a void pointer as second argument which will be \fIcurl_formadd(3)\fP. Accepts a void pointer as second argument named
passed to the curl_formget_callback function. \fIuserp\fP which will be passed as the first argument to the
curl_formget_callback function.
.BI "typedef size_t (*curl_formget_callback)(void *" arg, " const char *" buf, .BI "typedef size_t (*curl_formget_callback)(void *" userp, " const char *" buf,
.BI " size_t " len ");" .BI " size_t " len ");"
.nf
The curl_formget_callback will be executed for each part of the HTTP POST The curl_formget_callback will be executed for each part of the HTTP POST
chain. The void *arg pointer will be the one passed as second argument to chain. The character buffer passed to the callback must not be freed. The
curl_formget(). The character buffer passed to it must not be freed. The
callback should return the buffer length passed to it on success. callback should return the buffer length passed to it on success.
If the \fBCURLFORM_STREAM\fP option is used in the formpost, it will prevent
\fIcurl_formget(3)\fP from working until you've performed the actual HTTP
request as only then will libcurl get the actual read callback to use!
.SH RETURN VALUE .SH RETURN VALUE
0 means everything was ok, non-zero means an error occurred 0 means everything was ok, non-zero means an error occurred
.SH EXAMPLE .SH EXAMPLE
@@ -52,6 +55,7 @@ callback should return the buffer length passed to it on success.
(*(size_t *) arg) += len; (*(size_t *) arg) += len;
return len; return len;
} }
size_t print_httppost(struct curl_httppost *post) size_t print_httppost(struct curl_httppost *post)
{ {
size_t total_size = 0; size_t total_size = 0;

View File

@@ -40,19 +40,28 @@ but be sure to FD_ZERO them before calling this function as
otherwise remove any others. The \fIcurl_multi_perform(3)\fP function should be 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. called as soon as one of them is ready to be read from or written to.
To be sure to have up-to-date results, you should call
\fIcurl_multi_perform\fP until it does not return CURLM_CALL_MULTI_PERFORM
prior to calling \fIcurl_multi_fdset\fP. This will make sure that libcurl has
updated the handles' socket states.
If no file descriptors are set by libcurl, \fImax_fd\fP will contain -1 when 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 this function returns. Otherwise it will contain the higher descriptor number
libcurl set. libcurl set. When libcurl returns -1 in \fImax_fd\fP, it is because libcurl
currently does something that isn't possible for your application to monitor
with a socket and unfortunately you can then not know exactly when the current
action is completed using select(). When max_fd returns with -1, you need to
wait a while and then proceed and call \fIcurl_multi_perform\fP anyway. How
long to wait? I would suggest 100 milliseconds at least, but you may want to
test it out in your own particular conditions to find a suitable value.
When doing select(), you should use \fBcurl_multi_timeout\fP to figure out how When doing select(), you should use \fBcurl_multi_timeout\fP to figure out how
long to wait for action. Call \fIcurl_multi_perform\fP even if no activity has long to wait for action. Call \fIcurl_multi_perform\fP even if no activity has
been seen on the fd_sets after the timeout expires as otherwise internal been seen on the fd_sets after the timeout expires as otherwise internal
retries and timeouts may not work as you'd think and want. retries and timeouts may not work as you'd think and want.
If one of the sockets used by libcurl happens to be larger than what can be
set in an fd_set, which on POSIX systems means that the file descriptor is
larger than FD_SETSIZE, then libcurl will try to not set it. Setting a too
large file descriptor in an fd_set implies an out of bounds write which can
cause crashes, or worse. The effect of NOT storing it will possibly save you
from the crash, but will make your program NOT wait for sockets it should wait
for...
.SH RETURN VALUE .SH RETURN VALUE
CURLMcode type, general libcurl multi interface error code. See CURLMcode type, general libcurl multi interface error code. See
\fIlibcurl-errors(3)\fP \fIlibcurl-errors(3)\fP

View File

@@ -64,6 +64,11 @@ Cached DNS hosts will be shared across the easy handles using this shared
object. Note that when you use the multi interface, all easy handles added to object. Note that when you use the multi interface, all easy handles added to
the same multi handle will share DNS cache by default without this having to the same multi handle will share DNS cache by default without this having to
be used! be used!
.IP CURL_LOCK_DATA_SSL_SESSION
SSL session IDs will be shared accross the easy handles using this shared
object. This will reduce the time spent in the SSL handshake when reconnecting
to the same server. Note SSL session IDs are reused within the same easy handle
by default.
.RE .RE
.IP CURLSHOPT_UNSHARE .IP CURLSHOPT_UNSHARE
This option does the opposite of \fICURLSHOPT_SHARE\fP. It specifies that This option does the opposite of \fICURLSHOPT_SHARE\fP. It specifies that

View File

@@ -128,6 +128,11 @@ the app having to pass them on. (Added in 7.13.2)
.IP CURL_VERSION_CONV .IP CURL_VERSION_CONV
libcurl was built with support for character conversions, as provided by the libcurl was built with support for character conversions, as provided by the
CURLOPT_CONV_* callbacks. (Added in 7.15.4) CURLOPT_CONV_* callbacks. (Added in 7.15.4)
.IP CURL_VERSION_TLSAUTH_SRP
libcurl was built with support for TLS-SRP. (Added in 7.21.4)
.IP CURL_VERSION_NTLM_WB
libcurl was built with support for NTLM delegation to a winbind helper.
(Added in 7.22.0)
.RE .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. has no SSL support, this is NULL.

View File

@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___ .\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____| .\" * \___|\___/|_| \_\_____|
.\" * .\" *
.\" * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. .\" * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" * .\" *
.\" * This software is licensed as described in the file COPYING, which .\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms .\" * you should have received as part of this distribution. The terms
@@ -66,20 +66,21 @@ remote server is probably not an OK FTP server.
.IP "CURLE_REMOTE_ACCESS_DENIED (9)" .IP "CURLE_REMOTE_ACCESS_DENIED (9)"
We were denied access to the resource given in the URL. For FTP, this occurs We were denied access to the resource given in the URL. For FTP, this occurs
while trying to change to the remote directory. while trying to change to the remote directory.
.IP "CURLE_FTP_ACCEPT_FAILED (10)"
While waiting for the server to connect back when an active FTP session is
used, an error code was sent over the control connection or similar.
.IP "CURLE_FTP_WEIRD_PASS_REPLY (11)" .IP "CURLE_FTP_WEIRD_PASS_REPLY (11)"
After having sent the FTP password to the server, libcurl expects a proper After having sent the FTP password to the server, libcurl expects a proper
reply. This error code indicates that an unexpected code was returned. reply. This error code indicates that an unexpected code was returned.
.IP "CURLE_FTP_ACCEPT_TIMEOUT (12)"
During an active FTP session while waiting for the server to connect, the
\fICURLOPT_ACCEPTTIMOUT_MS\fP (or the internal default) timeout expired.
.IP "CURLE_FTP_WEIRD_PASV_REPLY (13)" .IP "CURLE_FTP_WEIRD_PASV_REPLY (13)"
libcurl failed to get a sensible result back from the server as a response to libcurl failed to get a sensible result back from the server as a response to
either a PASV or a EPSV command. The server is flawed. either a PASV or a EPSV command. The server is flawed.
.IP "CURLE_FTP_WEIRD_227_FORMAT (14)" .IP "CURLE_FTP_WEIRD_227_FORMAT (14)"
FTP servers return a 227-line as a response to a PASV command. If libcurl FTP servers return a 227-line as a response to a PASV command. If libcurl
fails to parse that line, this return code is passed back. fails to parse that line, this return code is passed back.
.IP "CURLE_FTP_PRET_FAILED (84)"
The FTP server does not understand the PRET command at all or does not support
the given argument. Be careful when using \fICURLOPT_CUSTOMREQUEST\fP, a
custom LIST command will be sent with PRET CMD before PASV as well. (Added in
7.20.0)
.IP "CURLE_FTP_CANT_GET_HOST (15)" .IP "CURLE_FTP_CANT_GET_HOST (15)"
An internal failure to lookup the host used for the new connection. An internal failure to lookup the host used for the new connection.
.IP "CURLE_FTP_COULDNT_SET_TYPE (17)" .IP "CURLE_FTP_COULDNT_SET_TYPE (17)"
@@ -227,7 +228,10 @@ Failed to load CRL file (Added in 7.19.0)
.IP "CURLE_SSL_ISSUER_ERROR (83)" .IP "CURLE_SSL_ISSUER_ERROR (83)"
Issuer check failed (Added in 7.19.0) Issuer check failed (Added in 7.19.0)
.IP "CURLE_FTP_PRET_FAILED (84)" .IP "CURLE_FTP_PRET_FAILED (84)"
PRET command failed The FTP server does not understand the PRET command at all or does not support
the given argument. Be careful when using \fICURLOPT_CUSTOMREQUEST\fP, a
custom LIST command will be sent with PRET CMD before PASV as well. (Added in
7.20.0)
.IP "CURLE_RTSP_CSEQ_ERROR (85)" .IP "CURLE_RTSP_CSEQ_ERROR (85)"
Mismatch of RTSP CSeq numbers. Mismatch of RTSP CSeq numbers.
.IP "CURLE_RTSP_SESSION_ERROR (86)" .IP "CURLE_RTSP_SESSION_ERROR (86)"
@@ -277,3 +281,6 @@ An invalid share object was passed to the function.
.IP "CURLSHE_NOMEM (4)" .IP "CURLSHE_NOMEM (4)"
Not enough memory was available. Not enough memory was available.
(Added in 7.12.0) (Added in 7.12.0)
.IP "CURLSHE_NOT_BUILT_IN (5)"
The requsted sharing could not be done because the library you use don't have
that particular feature enabled. (Added in 7.23.0)

View File

@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___ .\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____| .\" * \___|\___/|_| \_\_____|
.\" * .\" *
.\" * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al. .\" * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" * .\" *
.\" * This software is licensed as described in the file COPYING, which .\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms .\" * you should have received as part of this distribution. The terms
@@ -82,14 +82,6 @@ might need attention. This also makes it very easy for your program to wait
for input on your own private file descriptors at the same time or perhaps for input on your own private file descriptors at the same time or perhaps
timeout every now and then, should you want that. timeout every now and then, should you want that.
A little note here about the return codes from the multi functions, and
especially the \fIcurl_multi_perform(3)\fP: if you receive
\fICURLM_CALL_MULTI_PERFORM\fP, this basically means that you should call
\fIcurl_multi_perform(3)\fP again, before you select() on more 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".
\fIcurl_multi_perform(3)\fP stores the number of still running transfers in \fIcurl_multi_perform(3)\fP stores the number of still running transfers in
one of its input arguments, and by reading that you can figure out when all one of its input arguments, and by reading that you can figure out when all
the transfers in the multi handles are done. 'done' does not mean the transfers in the multi handles are done. 'done' does not mean
@@ -118,23 +110,40 @@ If you want to re-use an easy handle that was added to the multi handle for
transfer, you must first remove it from the multi stack and then re-add it transfer, you must first remove it from the multi stack and then re-add it
again (possibly after having altered some options at your own choice). again (possibly after having altered some options at your own choice).
.SH "MULTI_SOCKET" .SH "MULTI_SOCKET"
Since 7.16.0, the \fIcurl_multi_socket_action(3)\fP function offers a way for \fIcurl_multi_socket_action(3)\fP function offers a way for applications to
applications to not only avoid being forced to use select(), but it also not only avoid being forced to use select(), but it also offers a much more
offers a much more high-performance API that will make a significant high-performance API that will make a significant difference for applications
difference for applications using large numbers of simultaneous connections. using large numbers of simultaneous connections.
\fIcurl_multi_socket_action(3)\fP is then used \fIcurl_multi_socket_action(3)\fP is then used instead of
instead of \fIcurl_multi_perform(3)\fP. \fIcurl_multi_perform(3)\fP.
When using this API, you add easy handles to the multi handle just as with the
normal multi interface. Then you also set two callbacks with the
CURLMOPT_SOCKETFUNCTION and CURLMOPT_TIMERFUNCTION options to
\fIcurl_multi_setopt(3)\fP.
The API is then designed to inform your application about which sockets
libcurl is currently using and for what activities (read and/or write) on
those sockets your application is expected to wait for.
Your application must then make sure to receive all sockets informed about in
the CURLMOPT_SOCKETFUNCTION callback and make sure it reacts on the given
activity on them. When a socket has the given activity, you call
\fIcurl_multi_socket_action(3)\fP specifying which socket and action there
are.
The CURLMOPT_TIMERFUNCTION callback is called to set a timeout. When that
timeout expires, your application should call the
\fIcurl_multi_socket_action(3)\fP function saying it was due to a timeout.
.SH "BLOCKING" .SH "BLOCKING"
A few areas in the code are still using blocking code, even when used from the A few areas in the code are still using blocking code, even when used from the
multi interface. While we certainly want and intend for these to get fixed in multi interface. While we certainly want and intend for these to get fixed in
the future, you should be aware of the following current restrictions: the future, you should be aware of the following current restrictions:
.nf .nf
- Name resolves on non-windows unless c-ares is used - Name resolves unless the c-ares or threaded-resolver backends are used
- GnuTLS SSL connections
- NSS SSL connections - NSS SSL connections
- Active FTP connections
- HTTP proxy CONNECT operations - HTTP proxy CONNECT operations
- SOCKS proxy handshakes - SOCKS proxy handshakes
- file:// transfers - file:// transfers

View File

@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___ .\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____| .\" * \___|\___/|_| \_\_____|
.\" * .\" *
.\" * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al. .\" * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" * .\" *
.\" * This software is licensed as described in the file COPYING, which .\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms .\" * you should have received as part of this distribution. The terms
@@ -249,9 +249,11 @@ complication for you. Given simply the URL to a file, libcurl will take care
of all the details needed to get the file moved from one machine to another. of all the details needed to get the file moved from one machine to another.
.SH "Multi-threading Issues" .SH "Multi-threading Issues"
The first basic rule is that you must \fBnever\fP share a libcurl handle (be The first basic rule is that you must \fBnever\fP simultaneously share a
it easy or multi or whatever) between multiple threads. Only use one handle in libcurl handle (be it easy or multi or whatever) between multiple
one thread at a time. threads. Only use one handle in one thread at any time. You can pass the
handles around among threads, but you must never use a single handle from more
than one thread at any given time.
libcurl is completely thread safe, except for two issues: signals and SSL/TLS 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) - handlers. Signals are used for timing out name resolves (during DNS lookup) -
@@ -815,10 +817,6 @@ This header is required by HTTP 1.1 and even many 1.0 servers and should be
the name of the server we want to talk to. This includes the port number if the name of the server we want to talk to. This includes the port number if
anything but default. anything but default.
.IP "Pragma"
\&"no-cache". Tells a possible proxy to not grab a copy from the cache but to
fetch a fresh one.
.IP "Accept" .IP "Accept"
\&"*/*". \&"*/*".
@@ -1301,9 +1299,7 @@ ones at any time), you start the transfers by calling
\fIcurl_multi_perform(3)\fP is asynchronous. It will only execute as little as \fIcurl_multi_perform(3)\fP is asynchronous. It will only execute as little as
possible and then return back control to your program. It is designed to never possible and then return back control to your program. It is designed to never
block. If it returns CURLM_CALL_MULTI_PERFORM you better call it again soon, block.
as that is a signal that it still has local data to send or remote data to
receive.
The best usage of this interface is when you do a select() on all possible The best usage of this interface is when you do a select() on all possible
file descriptors or sockets to know when to call libcurl again. This also file descriptors or sockets to know when to call libcurl again. This also
@@ -1339,9 +1335,21 @@ to figure out success on each individual transfer.
[ seeding, passwords, keys, certificates, ENGINE, ca certs ] [ seeding, passwords, keys, certificates, ENGINE, ca certs ]
.SH "Sharing Data Between Easy Handles" .SH "Sharing Data Between Easy Handles"
You can share some data between easy handles when the easy interface is used,
and some data is share automatically when you use the multi interface.
[ fill in ] When you add easy handles to a multi handle, these easy handles will
automatically share a lot of the data that otherwise would be kept on a
per-easy handle basis when the easy interface is used.
The DNS cache is shared between handles within a multi handle, making
subsequent name resolvings faster and the connection pool that is kept to
better allow persistent connections and connection re-use is shared. If you're
using the easy interface, you can still share these between specific easy
handles by using the share interface, see \fIlibcurl-share(3)\fP.
Some things are never shared automatically, not within multi handles, like for
example cookies so the only way to share that is with the share interface.
.SH "Footnotes" .SH "Footnotes"
.IP "[1]" .IP "[1]"

View File

@@ -146,7 +146,7 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG],
_libcurl_save_libs=$LIBS _libcurl_save_libs=$LIBS
LIBS="$LIBCURL $LIBS" LIBS="$LIBCURL $LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <curl/curl.h>],[ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curl/curl.h>]],[[
/* Try and use a few common options to force a failure if we are /* Try and use a few common options to force a failure if we are
missing symbols or can't link. */ missing symbols or can't link. */
int x; int x;
@@ -157,7 +157,8 @@ x=CURLOPT_FILE;
x=CURLOPT_ERRORBUFFER; x=CURLOPT_ERRORBUFFER;
x=CURLOPT_STDERR; x=CURLOPT_STDERR;
x=CURLOPT_VERBOSE; x=CURLOPT_VERBOSE;
])],libcurl_cv_lib_curl_usable=yes,libcurl_cv_lib_curl_usable=no) if (x) ;
]])],libcurl_cv_lib_curl_usable=yes,libcurl_cv_lib_curl_usable=no)
CPPFLAGS=$_libcurl_save_cppflags CPPFLAGS=$_libcurl_save_cppflags
LIBS=$_libcurl_save_libs LIBS=$_libcurl_save_libs

View File

@@ -20,6 +20,7 @@ CURLAUTH_DIGEST_IE 7.19.3
CURLAUTH_GSSNEGOTIATE 7.10.6 CURLAUTH_GSSNEGOTIATE 7.10.6
CURLAUTH_NONE 7.10.6 CURLAUTH_NONE 7.10.6
CURLAUTH_NTLM 7.10.6 CURLAUTH_NTLM 7.10.6
CURLAUTH_NTLM_WB 7.22.0
CURLAUTH_ONLY 7.21.3 CURLAUTH_ONLY 7.21.3
CURLCLOSEPOLICY_CALLBACK 7.7 CURLCLOSEPOLICY_CALLBACK 7.7
CURLCLOSEPOLICY_LEAST_RECENTLY_USED 7.7 CURLCLOSEPOLICY_LEAST_RECENTLY_USED 7.7
@@ -44,6 +45,8 @@ CURLE_COULDNT_RESOLVE_PROXY 7.1
CURLE_FAILED_INIT 7.1 CURLE_FAILED_INIT 7.1
CURLE_FILESIZE_EXCEEDED 7.10.8 CURLE_FILESIZE_EXCEEDED 7.10.8
CURLE_FILE_COULDNT_READ_FILE 7.1 CURLE_FILE_COULDNT_READ_FILE 7.1
CURLE_FTP_ACCEPT_FAILED 7.24.0
CURLE_FTP_ACCEPT_TIMEOUT 7.24.0
CURLE_FTP_ACCESS_DENIED 7.1 CURLE_FTP_ACCESS_DENIED 7.1
CURLE_FTP_BAD_DOWNLOAD_RESUME 7.1 7.1 CURLE_FTP_BAD_DOWNLOAD_RESUME 7.1 7.1
CURLE_FTP_BAD_FILE_LIST 7.21.0 CURLE_FTP_BAD_FILE_LIST 7.21.0
@@ -186,6 +189,9 @@ CURLFTPSSL_TRY 7.11.0 7.17.0
CURLFTP_CREATE_DIR 7.19.4 CURLFTP_CREATE_DIR 7.19.4
CURLFTP_CREATE_DIR_NONE 7.19.4 CURLFTP_CREATE_DIR_NONE 7.19.4
CURLFTP_CREATE_DIR_RETRY 7.19.4 CURLFTP_CREATE_DIR_RETRY 7.19.4
CURLGSSAPI_DELEGATION_FLAG 7.22.0
CURLGSSAPI_DELEGATION_NONE 7.22.0
CURLGSSAPI_DELEGATION_POLICY_FLAG 7.22.0
CURLINFO_APPCONNECT_TIME 7.19.0 CURLINFO_APPCONNECT_TIME 7.19.0
CURLINFO_CERTINFO 7.19.1 CURLINFO_CERTINFO 7.19.1
CURLINFO_CONDITION_UNMET 7.19.4 CURLINFO_CONDITION_UNMET 7.19.4
@@ -282,6 +288,8 @@ CURLOPTTYPE_FUNCTIONPOINT 7.1
CURLOPTTYPE_LONG 7.1 CURLOPTTYPE_LONG 7.1
CURLOPTTYPE_OBJECTPOINT 7.1 CURLOPTTYPE_OBJECTPOINT 7.1
CURLOPTTYPE_OFF_T 7.11.0 CURLOPTTYPE_OFF_T 7.11.0
CURLOPT_ACCEPTTIMEOUT_MS 7.24.0
CURLOPT_ACCEPT_ENCODING 7.21.6
CURLOPT_ADDRESS_SCOPE 7.19.0 CURLOPT_ADDRESS_SCOPE 7.19.0
CURLOPT_APPEND 7.17.0 CURLOPT_APPEND 7.17.0
CURLOPT_AUTOREFERER 7.1 CURLOPT_AUTOREFERER 7.1
@@ -294,6 +302,8 @@ CURLOPT_CHUNK_DATA 7.21.0
CURLOPT_CHUNK_END_FUNCTION 7.21.0 CURLOPT_CHUNK_END_FUNCTION 7.21.0
CURLOPT_CLOSEFUNCTION 7.7 7.11.1 7.15.5 CURLOPT_CLOSEFUNCTION 7.7 7.11.1 7.15.5
CURLOPT_CLOSEPOLICY 7.7 7.16.1 CURLOPT_CLOSEPOLICY 7.7 7.16.1
CURLOPT_CLOSESOCKETDATA 7.21.7
CURLOPT_CLOSESOCKETFUNCTION 7.21.7
CURLOPT_CONNECTTIMEOUT 7.7 CURLOPT_CONNECTTIMEOUT 7.7
CURLOPT_CONNECTTIMEOUT_MS 7.16.2 CURLOPT_CONNECTTIMEOUT_MS 7.16.2
CURLOPT_CONNECT_ONLY 7.15.2 CURLOPT_CONNECT_ONLY 7.15.2
@@ -313,6 +323,7 @@ CURLOPT_DEBUGDATA 7.9.6
CURLOPT_DEBUGFUNCTION 7.9.6 CURLOPT_DEBUGFUNCTION 7.9.6
CURLOPT_DIRLISTONLY 7.17.0 CURLOPT_DIRLISTONLY 7.17.0
CURLOPT_DNS_CACHE_TIMEOUT 7.9.3 CURLOPT_DNS_CACHE_TIMEOUT 7.9.3
CURLOPT_DNS_SERVERS 7.24.0
CURLOPT_DNS_USE_GLOBAL_CACHE 7.9.3 7.11.1 CURLOPT_DNS_USE_GLOBAL_CACHE 7.9.3 7.11.1
CURLOPT_EGDSOCKET 7.7 CURLOPT_EGDSOCKET 7.7
CURLOPT_ENCODING 7.10 CURLOPT_ENCODING 7.10
@@ -341,6 +352,7 @@ CURLOPT_FTP_SSL_CCC 7.16.1
CURLOPT_FTP_USE_EPRT 7.10.5 CURLOPT_FTP_USE_EPRT 7.10.5
CURLOPT_FTP_USE_EPSV 7.9.2 CURLOPT_FTP_USE_EPSV 7.9.2
CURLOPT_FTP_USE_PRET 7.20.0 CURLOPT_FTP_USE_PRET 7.20.0
CURLOPT_GSSAPI_DELEGATION 7.22.0
CURLOPT_HEADER 7.1 CURLOPT_HEADER 7.1
CURLOPT_HEADERDATA 7.10 CURLOPT_HEADERDATA 7.10
CURLOPT_HEADERFUNCTION 7.7.2 CURLOPT_HEADERFUNCTION 7.7.2
@@ -372,6 +384,7 @@ CURLOPT_LOCALPORT 7.15.2
CURLOPT_LOCALPORTRANGE 7.15.2 CURLOPT_LOCALPORTRANGE 7.15.2
CURLOPT_LOW_SPEED_LIMIT 7.1 CURLOPT_LOW_SPEED_LIMIT 7.1
CURLOPT_LOW_SPEED_TIME 7.1 CURLOPT_LOW_SPEED_TIME 7.1
CURLOPT_MAIL_AUTH 7.25.0
CURLOPT_MAIL_FROM 7.20.0 CURLOPT_MAIL_FROM 7.20.0
CURLOPT_MAIL_RCPT 7.20.0 CURLOPT_MAIL_RCPT 7.20.0
CURLOPT_MAXCONNECTS 7.7 CURLOPT_MAXCONNECTS 7.7
@@ -395,7 +408,7 @@ CURLOPT_OPENSOCKETFUNCTION 7.17.1
CURLOPT_PASSWDDATA 7.4.2 7.11.1 7.15.5 CURLOPT_PASSWDDATA 7.4.2 7.11.1 7.15.5
CURLOPT_PASSWDFUNCTION 7.4.2 7.11.1 7.15.5 CURLOPT_PASSWDFUNCTION 7.4.2 7.11.1 7.15.5
CURLOPT_PASSWORD 7.19.1 CURLOPT_PASSWORD 7.19.1
CURLOPT_PASV_HOST 7.12.1 7.15.6 7.15.5 CURLOPT_PASV_HOST 7.12.1 7.16.0 7.15.5
CURLOPT_PORT 7.1 CURLOPT_PORT 7.1
CURLOPT_POST 7.1 CURLOPT_POST 7.1
CURLOPT_POST301 7.17.1 7.19.1 CURLOPT_POST301 7.17.1 7.19.1
@@ -470,10 +483,14 @@ CURLOPT_SSLVERSION 7.1
CURLOPT_SSL_CIPHER_LIST 7.9 CURLOPT_SSL_CIPHER_LIST 7.9
CURLOPT_SSL_CTX_DATA 7.10.6 CURLOPT_SSL_CTX_DATA 7.10.6
CURLOPT_SSL_CTX_FUNCTION 7.10.6 CURLOPT_SSL_CTX_FUNCTION 7.10.6
CURLOPT_SSL_OPTIONS 7.25.0
CURLOPT_SSL_SESSIONID_CACHE 7.16.0 CURLOPT_SSL_SESSIONID_CACHE 7.16.0
CURLOPT_SSL_VERIFYHOST 7.8.1 CURLOPT_SSL_VERIFYHOST 7.8.1
CURLOPT_SSL_VERIFYPEER 7.4.2 CURLOPT_SSL_VERIFYPEER 7.4.2
CURLOPT_STDERR 7.1 CURLOPT_STDERR 7.1
CURLOPT_TCP_KEEPALIVE 7.25.0
CURLOPT_TCP_KEEPIDLE 7.25.0
CURLOPT_TCP_KEEPINTVL 7.25.0
CURLOPT_TCP_NODELAY 7.11.2 CURLOPT_TCP_NODELAY 7.11.2
CURLOPT_TELNETOPTIONS 7.7 CURLOPT_TELNETOPTIONS 7.7
CURLOPT_TFTP_BLKSIZE 7.19.4 CURLOPT_TFTP_BLKSIZE 7.19.4
@@ -485,6 +502,7 @@ CURLOPT_TLSAUTH_PASSWORD 7.21.4
CURLOPT_TLSAUTH_TYPE 7.21.4 CURLOPT_TLSAUTH_TYPE 7.21.4
CURLOPT_TLSAUTH_USERNAME 7.21.4 CURLOPT_TLSAUTH_USERNAME 7.21.4
CURLOPT_TRANSFERTEXT 7.1.1 CURLOPT_TRANSFERTEXT 7.1.1
CURLOPT_TRANSFER_ENCODING 7.21.6
CURLOPT_UNRESTRICTED_AUTH 7.10.4 CURLOPT_UNRESTRICTED_AUTH 7.10.4
CURLOPT_UPLOAD 7.1 CURLOPT_UPLOAD 7.1
CURLOPT_URL 7.1 CURLOPT_URL 7.1
@@ -541,6 +559,7 @@ CURLSHE_BAD_OPTION 7.10.3
CURLSHE_INVALID 7.10.3 CURLSHE_INVALID 7.10.3
CURLSHE_IN_USE 7.10.3 CURLSHE_IN_USE 7.10.3
CURLSHE_NOMEM 7.12.0 CURLSHE_NOMEM 7.12.0
CURLSHE_NOT_BUILT_IN 7.23.0
CURLSHE_OK 7.10.3 CURLSHE_OK 7.10.3
CURLSHOPT_LOCKFUNC 7.10.3 CURLSHOPT_LOCKFUNC 7.10.3
CURLSHOPT_NONE 7.10.3 CURLSHOPT_NONE 7.10.3
@@ -548,7 +567,7 @@ CURLSHOPT_SHARE 7.10.3
CURLSHOPT_UNLOCKFUNC 7.10.3 CURLSHOPT_UNLOCKFUNC 7.10.3
CURLSHOPT_UNSHARE 7.10.3 CURLSHOPT_UNSHARE 7.10.3
CURLSHOPT_USERDATA 7.10.3 CURLSHOPT_USERDATA 7.10.3
CURLSOCKTYPE_IPCXN 7.15.6 CURLSOCKTYPE_IPCXN 7.16.0
CURLSSH_AUTH_ANY 7.16.1 CURLSSH_AUTH_ANY 7.16.1
CURLSSH_AUTH_DEFAULT 7.16.1 CURLSSH_AUTH_DEFAULT 7.16.1
CURLSSH_AUTH_HOST 7.16.1 CURLSSH_AUTH_HOST 7.16.1
@@ -556,6 +575,7 @@ CURLSSH_AUTH_KEYBOARD 7.16.1
CURLSSH_AUTH_NONE 7.16.1 CURLSSH_AUTH_NONE 7.16.1
CURLSSH_AUTH_PASSWORD 7.16.1 CURLSSH_AUTH_PASSWORD 7.16.1
CURLSSH_AUTH_PUBLICKEY 7.16.1 CURLSSH_AUTH_PUBLICKEY 7.16.1
CURLSSLOPT_ALLOW_BEAST 7.25.0
CURLUSESSL_ALL 7.17.0 CURLUSESSL_ALL 7.17.0
CURLUSESSL_CONTROL 7.17.0 CURLUSESSL_CONTROL 7.17.0
CURLUSESSL_NONE 7.17.0 CURLUSESSL_NONE 7.17.0
@@ -629,6 +649,7 @@ CURL_READFUNC_PAUSE 7.18.0
CURL_REDIR_GET_ALL 7.19.1 CURL_REDIR_GET_ALL 7.19.1
CURL_REDIR_POST_301 7.19.1 CURL_REDIR_POST_301 7.19.1
CURL_REDIR_POST_302 7.19.1 CURL_REDIR_POST_302 7.19.1
CURL_REDIR_POST_303 7.25.1
CURL_REDIR_POST_ALL 7.19.1 CURL_REDIR_POST_ALL 7.19.1
CURL_RTSPREQ_ANNOUNCE 7.20.0 CURL_RTSPREQ_ANNOUNCE 7.20.0
CURL_RTSPREQ_DESCRIBE 7.20.0 CURL_RTSPREQ_DESCRIBE 7.20.0
@@ -671,6 +692,7 @@ CURL_VERSION_KERBEROS4 7.10
CURL_VERSION_LARGEFILE 7.11.1 CURL_VERSION_LARGEFILE 7.11.1
CURL_VERSION_LIBZ 7.10 CURL_VERSION_LIBZ 7.10
CURL_VERSION_NTLM 7.10.6 CURL_VERSION_NTLM 7.10.6
CURL_VERSION_NTLM_WB 7.22.0
CURL_VERSION_SPNEGO 7.10.8 CURL_VERSION_SPNEGO 7.10.8
CURL_VERSION_SSL 7.10 CURL_VERSION_SSL 7.10
CURL_VERSION_SSPI 7.13.2 CURL_VERSION_SSPI 7.13.2

100
docs/libcurl/symbols.pl Executable file
View File

@@ -0,0 +1,100 @@
#!/usr/bin/perl
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 2011, 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.
#
###########################################################################
#
# Experience has shown that the symbols-in-versions file is very useful to
# applications that want to build with a wide range of libcurl versions.
# It is however easy to get it wrong and the source gets a bit messy with all
# the fixed numerical comparisions.
#
# The point of this script is to provide an easy-to-use macro for libcurl-
# using applications to do preprocessor checks for specific libcurl defines,
# and yet make the code clearly show what the macro is used for.
#
# Run this script and generate libcurl-symbols.h and then use that header in
# a fashion similar to:
#
# #include "libcurl-symbols.h"
#
# #if LIBCURL_HAS(CURLOPT_MUTE)
# has mute
# #else
# no mute
# #endif
#
#
open F, "<symbols-in-versions";
sub str2num {
my ($str)=@_;
if($str =~ /([0-9]*)\.([0-9]*)\.*([0-9]*)/) {
return sprintf("0x%06x", $1<<16 | $2 << 8 | $3);
}
}
print <<EOS
#include <curl/curl.h>
#define LIBCURL_HAS(x) \\
(defined(x ## _FIRST) && (x ## _FIRST <= LIBCURL_VERSION_NUM) && \\
(!defined(x ## _LAST) || ( x ## _LAST >= LIBCURL_VERSION_NUM)))
EOS
;
while(<F>) {
if(/^(CURL[^ ]*)[ \t]*(.*)/) {
my ($sym, $vers)=($1, $2);
my $intr;
my $rm;
my $dep;
# is there removed info?
if($vers =~ /([\d.]+)[ \t-]+([\d.]+)[ \t]+([\d.]+)/) {
($intr, $dep, $rm)=($1, $2, $3);
}
# is it a dep-only line?
elsif($vers =~ /([\d.]+)[ \t-]+([\d.]+)/) {
($intr, $dep)=($1, $2);
}
else {
$intr = $vers;
}
my $inum = str2num($intr);
print <<EOS
#define ${sym}_FIRST $inum /* Added in $intr */
EOS
;
my $irm = str2num($rm);
if($rm) {
print <<EOS
#define ${sym}_LAST $irm /* Last featured in $rm */
EOS
;
}
}
}

51
docs/mk-ca-bundle.1 Normal file
View File

@@ -0,0 +1,51 @@
.Dd April 27, 2012
.Dt MK-CA-BUNDLE 1
.Os
.Sh NAME
.Nm mk-ca-bundle
.Nd create a new ca-bundle.crt from mozilla's certdata.txt
.Sh SYNOPSIS
.Nm
.Op Fl bilnqtuv
.Or outputfile
.Sh DESCRIPTION
The
.Nm
tool downloads the certdata.txt file from Mozilla's source tree, then
parses certdata.txt and extracts CA Root Certificates into PEM format.
These are then processed with the OpenSSL commandline tool to produce the
final ca-bundle.crt file.
.Sh OPTIONS
The following options are supported by
.Nm :
.Bl -tag -width _h
.It Fl b
backup an existing version of ca-bundle.crt
.It Fl i
print version info about used modules
.It Fl l
print license info about certdata.txt
.It Fl n
no download of certdata.txt (to use existing)
.It Fl q
be really quiet (no progress output at all)
.It Fl t
include plain text listing of certificates
.It Fl u
unlink (remove) certdata.txt after processing
.It Fl v
be verbose and print out processed CAs
.El
.Sh EXIT STATUS
.Ex -std
.Sh SEE ALSO
.Xr curl 1
.Sh HISTORY
.Nm
was based on the parse-certs script written by
.An Roland Krikava
and hacked by
.An Guenter Knauf .
This manual page was written by
.An Jan Schaumann
.Aq jschauma@netmeister.org .

View File

@@ -36,7 +36,7 @@ The following notes apply to libcurl version 7.19.0 and later.
* If you intend to distribute an already compiled libcurl library you _MUST_ * If you intend to distribute an already compiled libcurl library you _MUST_
also distribute along with it the generated curl/curlbuild.h which has been also distribute along with it the generated curl/curlbuild.h which has been
used to compile it. Otherwise the library will be of no use for the users of used to compile it. Otherwise the library will be of no use for the users of
the library that you have built. It is _your_ responsability to provide this the library that you have built. It is _your_ responsibility to provide this
file. No one at the cURL project can know how you have built the library. file. No one at the cURL project can know how you have built the library.
* File curl/curlbuild.h includes platform and configuration dependent info, * File curl/curlbuild.h includes platform and configuration dependent info,

View File

@@ -1,3 +1,4 @@
curlbuild.h curlbuild.h
stamp-h2
stamp-h3 stamp-h3
curlver.h.dist curlver.h.dist

View File

@@ -20,7 +20,7 @@
# #
########################################################################### ###########################################################################
pkginclude_HEADERS = \ pkginclude_HEADERS = \
curl.h curlver.h easy.h mprintf.h stdcheaders.h types.h multi.h \ curl.h curlver.h easy.h mprintf.h stdcheaders.h multi.h \
typecheck-gcc.h curlbuild.h curlrules.h typecheck-gcc.h curlbuild.h curlrules.h
pkgincludedir= $(includedir)/curl pkgincludedir= $(includedir)/curl
@@ -44,3 +44,10 @@ EXTRA_DIST = curlbuild.h.in
DISTCLEANFILES = curlbuild.h DISTCLEANFILES = curlbuild.h
checksrc:
@@PERL@ $(top_srcdir)/lib/checksrc.pl -Wcurlbuild.h -D$(top_srcdir)/include/curl $(pkginclude_HEADERS) $(EXTRA_DIST)
if CURLDEBUG
# for debug builds, we scan the sources on all regular make invokes
all-local: checksrc
endif

View File

@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -55,34 +55,32 @@
#include <sys/types.h> #include <sys/types.h>
#include <time.h> #include <time.h>
#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) && \ #if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)
!defined(__CYGWIN__) || defined(__MINGW32__) #if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || defined(__LWIP_OPT_H__))
#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H))
/* The check above prevents the winsock2 inclusion if winsock.h already was /* The check above prevents the winsock2 inclusion if winsock.h already was
included, since they can't co-exist without problems */ included, since they can't co-exist without problems */
#include <winsock2.h> #include <winsock2.h>
#include <ws2tcpip.h> #include <ws2tcpip.h>
#endif #endif
#else #endif
/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
libc5-based Linux systems. Only include it on system that are known to libc5-based Linux systems. Only include it on systems that are known to
require it! */ require it! */
#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \ #if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \ defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
defined(ANDROID) || \ defined(ANDROID) || defined(__ANDROID__) || \
(defined(__FreeBSD_version) && (__FreeBSD_version < 800000)) (defined(__FreeBSD_version) && (__FreeBSD_version < 800000))
#include <sys/select.h> #include <sys/select.h>
#endif #endif
#ifndef _WIN32_WCE #if !defined(WIN32) && !defined(_WIN32_WCE)
#include <sys/socket.h> #include <sys/socket.h>
#endif #endif
#if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__) #if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__)
#include <sys/time.h> #include <sys/time.h>
#endif #endif
#include <sys/types.h>
#endif
#ifdef __BEOS__ #ifdef __BEOS__
#include <support/SupportDefs.h> #include <support/SupportDefs.h>
@@ -122,7 +120,7 @@ typedef void CURL;
#ifndef curl_socket_typedef #ifndef curl_socket_typedef
/* socket typedef */ /* socket typedef */
#ifdef WIN32 #if defined(WIN32) && !defined(__LWIP_OPT_H__)
typedef SOCKET curl_socket_t; typedef SOCKET curl_socket_t;
#define CURL_SOCKET_BAD INVALID_SOCKET #define CURL_SOCKET_BAD INVALID_SOCKET
#else #else
@@ -189,10 +187,10 @@ typedef int (*curl_progress_callback)(void *clientp,
#define CURL_MAX_HTTP_HEADER (100*1024) #define CURL_MAX_HTTP_HEADER (100*1024)
#endif #endif
/* This is a magic return code for the write callback that, when returned, /* This is a magic return code for the write callback that, when returned,
will signal libcurl to pause receiving on the current transfer. */ will signal libcurl to pause receiving on the current transfer. */
#define CURL_WRITEFUNC_PAUSE 0x10000001 #define CURL_WRITEFUNC_PAUSE 0x10000001
typedef size_t (*curl_write_callback)(char *buffer, typedef size_t (*curl_write_callback)(char *buffer,
size_t size, size_t size,
size_t nitems, size_t nitems,
@@ -341,6 +339,9 @@ typedef curl_socket_t
curlsocktype purpose, curlsocktype purpose,
struct curl_sockaddr *address); struct curl_sockaddr *address);
typedef int
(*curl_closesocket_callback)(void *clientp, curl_socket_t item);
typedef enum { typedef enum {
CURLIOE_OK, /* I/O operation successful */ CURLIOE_OK, /* I/O operation successful */
CURLIOE_UNKNOWNCMD, /* command was unknown to callback */ CURLIOE_UNKNOWNCMD, /* command was unknown to callback */
@@ -410,9 +411,12 @@ typedef enum {
CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server
due to lack of access - when login fails due to lack of access - when login fails
this is not returned. */ this is not returned. */
CURLE_OBSOLETE10, /* 10 - NOT USED */ CURLE_FTP_ACCEPT_FAILED, /* 10 - [was obsoleted in April 2006 for
7.15.4, reused in Dec 2011 for 7.24.0]*/
CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */ CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */
CURLE_OBSOLETE12, /* 12 - NOT USED */ CURLE_FTP_ACCEPT_TIMEOUT, /* 12 - timeout occurred accepting server
[was obsoleted in August 2007 for 7.17.0,
reused in Dec 2011 for 7.24.0]*/
CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */ CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */
CURLE_FTP_WEIRD_227_FORMAT, /* 14 */ CURLE_FTP_WEIRD_227_FORMAT, /* 14 */
CURLE_FTP_CANT_GET_HOST, /* 15 */ CURLE_FTP_CANT_GET_HOST, /* 15 */
@@ -467,7 +471,7 @@ typedef enum {
CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */ CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */
CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */ CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */
CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */ CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */
CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */ CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized/bad encoding */
CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */ CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */
CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */ CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */
CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */ CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */
@@ -507,17 +511,21 @@ typedef enum {
7.19.0) */ 7.19.0) */
CURLE_FTP_PRET_FAILED, /* 84 - a PRET command failed */ CURLE_FTP_PRET_FAILED, /* 84 - a PRET command failed */
CURLE_RTSP_CSEQ_ERROR, /* 85 - mismatch of RTSP CSeq numbers */ CURLE_RTSP_CSEQ_ERROR, /* 85 - mismatch of RTSP CSeq numbers */
CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Identifiers */ CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Ids */
CURLE_FTP_BAD_FILE_LIST, /* 87 - unable to parse FTP file list */ CURLE_FTP_BAD_FILE_LIST, /* 87 - unable to parse FTP file list */
CURLE_CHUNK_FAILED, /* 88 - chunk callback reported error */ CURLE_CHUNK_FAILED, /* 88 - chunk callback reported error */
CURL_LAST /* never use! */ CURL_LAST /* never use! */
} CURLcode; } CURLcode;
#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
the obsolete stuff removed! */ the obsolete stuff removed! */
/* Backwards compatibility with older names */ /* Previously obsoletes error codes re-used in 7.24.0 */
#define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED
#define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT
/* compatibility with older names */
#define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING
/* The following were added in 7.21.5, April 2011 */ /* The following were added in 7.21.5, April 2011 */
#define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION #define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION
@@ -528,7 +536,7 @@ typedef enum {
/* The following were added in 7.17.0 */ /* The following were added in 7.17.0 */
/* These are scheduled to disappear by 2009 */ /* These are scheduled to disappear by 2009 */
#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* noone should be using this! */ #define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */
#define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46 #define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46
#define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44 #define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44
#define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10 #define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10
@@ -590,16 +598,31 @@ typedef enum {
in 7.18.0 */ in 7.18.0 */
} curl_proxytype; /* this enum was added in 7.10 */ } curl_proxytype; /* this enum was added in 7.10 */
#define CURLAUTH_NONE 0 /* nothing */ /*
#define CURLAUTH_BASIC (1<<0) /* Basic (default) */ * Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options:
#define CURLAUTH_DIGEST (1<<1) /* Digest */ *
#define CURLAUTH_GSSNEGOTIATE (1<<2) /* GSS-Negotiate */ * CURLAUTH_NONE - No HTTP authentication
#define CURLAUTH_NTLM (1<<3) /* NTLM */ * CURLAUTH_BASIC - HTTP Basic authentication (default)
#define CURLAUTH_DIGEST_IE (1<<4) /* Digest with IE flavour */ * CURLAUTH_DIGEST - HTTP Digest authentication
#define CURLAUTH_ONLY (1<<31) /* used together with a single other * CURLAUTH_GSSNEGOTIATE - HTTP GSS-Negotiate authentication
type to force no auth or just that * CURLAUTH_NTLM - HTTP NTLM authentication
single type */ * CURLAUTH_DIGEST_IE - HTTP Digest authentication with IE flavour
#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE) /* all fine types set */ * CURLAUTH_NTLM_WB - HTTP NTLM authentication delegated to winbind helper
* CURLAUTH_ONLY - Use together with a single other type to force no
* authentication or just that single type
* CURLAUTH_ANY - All fine types set
* CURLAUTH_ANYSAFE - All fine types except Basic
*/
#define CURLAUTH_NONE ((unsigned long)0)
#define CURLAUTH_BASIC (((unsigned long)1)<<0)
#define CURLAUTH_DIGEST (((unsigned long)1)<<1)
#define CURLAUTH_GSSNEGOTIATE (((unsigned long)1)<<2)
#define CURLAUTH_NTLM (((unsigned long)1)<<3)
#define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4)
#define CURLAUTH_NTLM_WB (((unsigned long)1)<<5)
#define CURLAUTH_ONLY (((unsigned long)1)<<31)
#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE)
#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE)) #define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
#define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */ #define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */
@@ -610,6 +633,10 @@ typedef enum {
#define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */ #define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */
#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY #define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY
#define CURLGSSAPI_DELEGATION_NONE 0 /* no delegation (default) */
#define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */
#define CURLGSSAPI_DELEGATION_FLAG (1<<1) /* delegate always */
#define CURL_ERROR_SIZE 256 #define CURL_ERROR_SIZE 256
struct curl_khkey { struct curl_khkey {
@@ -660,6 +687,15 @@ typedef enum {
CURLUSESSL_LAST /* not an option, never use */ CURLUSESSL_LAST /* not an option, never use */
} curl_usessl; } curl_usessl;
/* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */
/* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the
name of improving interoperability with older servers. Some SSL libraries
have introduced work-arounds for this flaw but those work-arounds sometimes
make the SSL communication fail. To regain functionality with those broken
servers, a user can this way allow the vulnerability back. */
#define CURLSSLOPT_ALLOW_BEAST (1<<0)
#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
the obsolete stuff removed! */ the obsolete stuff removed! */
@@ -754,7 +790,7 @@ typedef enum {
#endif #endif
#ifdef CURL_ISOCPP #ifdef CURL_ISOCPP
#define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_ ## type + number #define CINIT(na,t,nu) CURLOPT_ ## na = CURLOPTTYPE_ ## t + nu
#else #else
/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ /* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
#define LONG CURLOPTTYPE_LONG #define LONG CURLOPTTYPE_LONG
@@ -912,9 +948,7 @@ typedef enum {
/* send linked-list of post-transfer QUOTE commands */ /* send linked-list of post-transfer QUOTE commands */
CINIT(POSTQUOTE, OBJECTPOINT, 39), CINIT(POSTQUOTE, OBJECTPOINT, 39),
/* Pass a pointer to string of the output using full variable-replacement CINIT(WRITEINFO, OBJECTPOINT, 40), /* DEPRECATED, do not use! */
as described elsewhere. */
CINIT(WRITEINFO, OBJECTPOINT, 40),
CINIT(VERBOSE, LONG, 41), /* talk a lot */ CINIT(VERBOSE, LONG, 41), /* talk a lot */
CINIT(HEADER, LONG, 42), /* throw the header out too */ CINIT(HEADER, LONG, 42), /* throw the header out too */
@@ -923,7 +957,7 @@ typedef enum {
CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */ CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */
CINIT(UPLOAD, LONG, 46), /* this is an upload */ CINIT(UPLOAD, LONG, 46), /* this is an upload */
CINIT(POST, LONG, 47), /* HTTP POST method */ CINIT(POST, LONG, 47), /* HTTP POST method */
CINIT(DIRLISTONLY, LONG, 48), /* return bare names when listing directories */ CINIT(DIRLISTONLY, LONG, 48), /* bare names when listing directories */
CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */ CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */
@@ -990,9 +1024,7 @@ typedef enum {
/* Max amount of cached alive connections */ /* Max amount of cached alive connections */
CINIT(MAXCONNECTS, LONG, 71), CINIT(MAXCONNECTS, LONG, 71),
/* What policy to use when closing connections when the cache is filled CINIT(CLOSEPOLICY, LONG, 72), /* DEPRECATED, do not use! */
up */
CINIT(CLOSEPOLICY, LONG, 72),
/* 73 = OBSOLETE */ /* 73 = OBSOLETE */
@@ -1066,7 +1098,7 @@ typedef enum {
CINIT(SSLENGINE_DEFAULT, LONG, 90), CINIT(SSLENGINE_DEFAULT, LONG, 90),
/* Non-zero value means to use the global dns cache */ /* Non-zero value means to use the global dns cache */
CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* To become OBSOLETE soon */ CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* DEPRECATED, do not use! */
/* DNS cache timeout */ /* DNS cache timeout */
CINIT(DNS_CACHE_TIMEOUT, LONG, 92), CINIT(DNS_CACHE_TIMEOUT, LONG, 92),
@@ -1103,8 +1135,9 @@ typedef enum {
CINIT(PROXYTYPE, LONG, 101), CINIT(PROXYTYPE, LONG, 101),
/* Set the Accept-Encoding string. Use this to tell a server you would like /* Set the Accept-Encoding string. Use this to tell a server you would like
the response to be compressed. */ the response to be compressed. Before 7.21.6, this was known as
CINIT(ENCODING, OBJECTPOINT, 102), CURLOPT_ENCODING */
CINIT(ACCEPT_ENCODING, OBJECTPOINT, 102),
/* Set pointer to private data */ /* Set pointer to private data */
CINIT(PRIVATE, OBJECTPOINT, 103), CINIT(PRIVATE, OBJECTPOINT, 103),
@@ -1117,8 +1150,8 @@ typedef enum {
and password to whatever host the server decides. */ and password to whatever host the server decides. */
CINIT(UNRESTRICTED_AUTH, LONG, 105), CINIT(UNRESTRICTED_AUTH, LONG, 105),
/* Specifically switch on or off the FTP engine's use of the EPRT command ( it /* Specifically switch on or off the FTP engine's use of the EPRT command (
also disables the LPRT attempt). By default, those ones will always be it also disables the LPRT attempt). By default, those ones will always be
attempted before the good old traditional PORT command. */ attempted before the good old traditional PORT command. */
CINIT(FTP_USE_EPRT, LONG, 106), CINIT(FTP_USE_EPRT, LONG, 106),
@@ -1462,6 +1495,46 @@ typedef enum {
/* Set authentication type for authenticated TLS */ /* Set authentication type for authenticated TLS */
CINIT(TLSAUTH_TYPE, OBJECTPOINT, 206), CINIT(TLSAUTH_TYPE, OBJECTPOINT, 206),
/* Set to 1 to enable the "TE:" header in HTTP requests to ask for
compressed transfer-encoded responses. Set to 0 to disable the use of TE:
in outgoing requests. The current default is 0, but it might change in a
future libcurl release.
libcurl will ask for the compressed methods it knows of, and if that
isn't any, it will not ask for transfer-encoding at all even if this
option is set to 1.
*/
CINIT(TRANSFER_ENCODING, LONG, 207),
/* Callback function for closing socket (instead of close(2)). The callback
should have type curl_closesocket_callback */
CINIT(CLOSESOCKETFUNCTION, FUNCTIONPOINT, 208),
CINIT(CLOSESOCKETDATA, OBJECTPOINT, 209),
/* allow GSSAPI credential delegation */
CINIT(GSSAPI_DELEGATION, LONG, 210),
/* Set the name servers to use for DNS resolution */
CINIT(DNS_SERVERS, OBJECTPOINT, 211),
/* Time-out accept operations (currently for FTP only) after this amount
of miliseconds. */
CINIT(ACCEPTTIMEOUT_MS, LONG, 212),
/* Set TCP keepalive */
CINIT(TCP_KEEPALIVE, LONG, 213),
/* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */
CINIT(TCP_KEEPIDLE, LONG, 214),
CINIT(TCP_KEEPINTVL, LONG, 215),
/* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */
CINIT(SSL_OPTIONS, LONG, 216),
/* set the SMTP auth originator */
CINIT(MAIL_AUTH, OBJECTPOINT, 217),
CURLOPT_LASTENTRY /* the last unused */ CURLOPT_LASTENTRY /* the last unused */
} CURLoption; } CURLoption;
@@ -1565,13 +1638,16 @@ enum CURL_TLSAUTH {
}; };
/* symbols to use with CURLOPT_POSTREDIR. /* symbols to use with CURLOPT_POSTREDIR.
CURL_REDIR_POST_301 and CURL_REDIR_POST_302 can be bitwise ORed so that CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_303
CURL_REDIR_POST_301 | CURL_REDIR_POST_302 == CURL_REDIR_POST_ALL */ can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302
| CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */
#define CURL_REDIR_GET_ALL 0 #define CURL_REDIR_GET_ALL 0
#define CURL_REDIR_POST_301 1 #define CURL_REDIR_POST_301 1
#define CURL_REDIR_POST_302 2 #define CURL_REDIR_POST_302 2
#define CURL_REDIR_POST_ALL (CURL_REDIR_POST_301|CURL_REDIR_POST_302) #define CURL_REDIR_POST_303 4
#define CURL_REDIR_POST_ALL \
(CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303)
typedef enum { typedef enum {
CURL_TIMECOND_NONE, CURL_TIMECOND_NONE,
@@ -1690,7 +1766,8 @@ CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost,
* Should return the buffer length passed to it as the argument "len" on * Should return the buffer length passed to it as the argument "len" on
* success. * success.
*/ */
typedef size_t (*curl_formget_callback)(void *arg, const char *buf, size_t len); typedef size_t (*curl_formget_callback)(void *arg, const char *buf,
size_t len);
/* /*
* NAME curl_formget() * NAME curl_formget()
@@ -1989,7 +2066,8 @@ typedef enum {
CURLSHE_BAD_OPTION, /* 1 */ CURLSHE_BAD_OPTION, /* 1 */
CURLSHE_IN_USE, /* 2 */ CURLSHE_IN_USE, /* 2 */
CURLSHE_INVALID, /* 3 */ CURLSHE_INVALID, /* 3 */
CURLSHE_NOMEM, /* out of memory */ CURLSHE_NOMEM, /* 4 out of memory */
CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */
CURLSHE_LAST /* never use */ CURLSHE_LAST /* never use */
} CURLSHcode; } CURLSHcode;
@@ -2070,8 +2148,9 @@ typedef struct {
#define CURL_VERSION_CONV (1<<12) /* character conversions supported */ #define CURL_VERSION_CONV (1<<12) /* character conversions supported */
#define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */ #define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */
#define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */ #define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */
#define CURL_VERSION_NTLM_WB (1<<15) /* NTLM delegating to winbind helper */
/* /*
* NAME curl_version_info() * NAME curl_version_info()
* *
* DESCRIPTION * DESCRIPTION

View File

@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -58,52 +58,52 @@
/* ================================================================ */ /* ================================================================ */
#ifdef CURL_SIZEOF_LONG #ifdef CURL_SIZEOF_LONG
# error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h" #error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
#endif #endif
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T #ifdef CURL_TYPEOF_CURL_SOCKLEN_T
# error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h" #error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
#endif #endif
#ifdef CURL_SIZEOF_CURL_SOCKLEN_T #ifdef CURL_SIZEOF_CURL_SOCKLEN_T
# error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h" #error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
#endif #endif
#ifdef CURL_TYPEOF_CURL_OFF_T #ifdef CURL_TYPEOF_CURL_OFF_T
# error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h" #error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
#endif #endif
#ifdef CURL_FORMAT_CURL_OFF_T #ifdef CURL_FORMAT_CURL_OFF_T
# error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h" #error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
#endif #endif
#ifdef CURL_FORMAT_CURL_OFF_TU #ifdef CURL_FORMAT_CURL_OFF_TU
# error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h" #error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
#endif #endif
#ifdef CURL_FORMAT_OFF_T #ifdef CURL_FORMAT_OFF_T
# error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h" #error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
#endif #endif
#ifdef CURL_SIZEOF_CURL_OFF_T #ifdef CURL_SIZEOF_CURL_OFF_T
# error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h" #error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
#endif #endif
#ifdef CURL_SUFFIX_CURL_OFF_T #ifdef CURL_SUFFIX_CURL_OFF_T
# error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h" #error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
#endif #endif
#ifdef CURL_SUFFIX_CURL_OFF_TU #ifdef CURL_SUFFIX_CURL_OFF_TU
# error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h" #error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
#endif #endif

View File

@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -26,17 +26,17 @@
a script at release-time. This was made its own header file in 7.11.2 */ a script at release-time. This was made its own header file in 7.11.2 */
/* This is the global package copyright */ /* This is the global package copyright */
#define LIBCURL_COPYRIGHT "1996 - 2011 Daniel Stenberg, <daniel@haxx.se>." #define LIBCURL_COPYRIGHT "1996 - 2012 Daniel Stenberg, <daniel@haxx.se>."
/* This is the version number of the libcurl package from which this header /* This is the version number of the libcurl package from which this header
file origins: */ file origins: */
#define LIBCURL_VERSION "7.21.5-DEV" #define LIBCURL_VERSION "7.26.0-DEV"
/* The numeric version number is also available "in parts" by using these /* The numeric version number is also available "in parts" by using these
defines: */ defines: */
#define LIBCURL_VERSION_MAJOR 7 #define LIBCURL_VERSION_MAJOR 7
#define LIBCURL_VERSION_MINOR 21 #define LIBCURL_VERSION_MINOR 26
#define LIBCURL_VERSION_PATCH 5 #define LIBCURL_VERSION_PATCH 0
/* This is the numeric version of the libcurl version number, meant for easier /* This is the numeric version of the libcurl version number, meant for easier
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
@@ -53,7 +53,7 @@
and it is always a greater number in a more recent release. It makes and it is always a greater number in a more recent release. It makes
comparisons with greater than and less than work. comparisons with greater than and less than work.
*/ */
#define LIBCURL_VERSION_NUM 0x071505 #define LIBCURL_VERSION_NUM 0x071A00
/* /*
* This is the date and time when the full source package was created. The * This is the date and time when the full source package was created. The

View File

@@ -53,8 +53,8 @@ CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
* *
* Creates a new curl session handle with the same options set for the handle * Creates a new curl session handle with the same options set for the handle
* passed in. Duplicating a handle could only be a matter of cloning data and * passed in. Duplicating a handle could only be a matter of cloning data and
* options, internal state info and things like persistant connections cannot * options, internal state info and things like persistent connections cannot
* be transfered. It is useful in multithreaded applications when you can run * be transferred. It is useful in multithreaded applications when you can run
* curl_easy_duphandle() for each new thread to avoid a series of identical * curl_easy_duphandle() for each new thread to avoid a series of identical
* curl_easy_setopt() invokes in every thread. * curl_easy_setopt() invokes in every thread.
*/ */

View File

@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@@ -41,66 +41,66 @@
#define curl_easy_setopt(handle, option, value) \ #define curl_easy_setopt(handle, option, value) \
__extension__ ({ \ __extension__ ({ \
__typeof__ (option) _curl_opt = option; \ __typeof__ (option) _curl_opt = option; \
if (__builtin_constant_p(_curl_opt)) { \ if(__builtin_constant_p(_curl_opt)) { \
if (_curl_is_long_option(_curl_opt)) \ if(_curl_is_long_option(_curl_opt)) \
if (!_curl_is_long(value)) \ if(!_curl_is_long(value)) \
_curl_easy_setopt_err_long(); \ _curl_easy_setopt_err_long(); \
if (_curl_is_off_t_option(_curl_opt)) \ if(_curl_is_off_t_option(_curl_opt)) \
if (!_curl_is_off_t(value)) \ if(!_curl_is_off_t(value)) \
_curl_easy_setopt_err_curl_off_t(); \ _curl_easy_setopt_err_curl_off_t(); \
if (_curl_is_string_option(_curl_opt)) \ if(_curl_is_string_option(_curl_opt)) \
if (!_curl_is_string(value)) \ if(!_curl_is_string(value)) \
_curl_easy_setopt_err_string(); \ _curl_easy_setopt_err_string(); \
if (_curl_is_write_cb_option(_curl_opt)) \ if(_curl_is_write_cb_option(_curl_opt)) \
if (!_curl_is_write_cb(value)) \ if(!_curl_is_write_cb(value)) \
_curl_easy_setopt_err_write_callback(); \ _curl_easy_setopt_err_write_callback(); \
if ((_curl_opt) == CURLOPT_READFUNCTION) \ if((_curl_opt) == CURLOPT_READFUNCTION) \
if (!_curl_is_read_cb(value)) \ if(!_curl_is_read_cb(value)) \
_curl_easy_setopt_err_read_cb(); \ _curl_easy_setopt_err_read_cb(); \
if ((_curl_opt) == CURLOPT_IOCTLFUNCTION) \ if((_curl_opt) == CURLOPT_IOCTLFUNCTION) \
if (!_curl_is_ioctl_cb(value)) \ if(!_curl_is_ioctl_cb(value)) \
_curl_easy_setopt_err_ioctl_cb(); \ _curl_easy_setopt_err_ioctl_cb(); \
if ((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \ if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \
if (!_curl_is_sockopt_cb(value)) \ if(!_curl_is_sockopt_cb(value)) \
_curl_easy_setopt_err_sockopt_cb(); \ _curl_easy_setopt_err_sockopt_cb(); \
if ((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \ if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \
if (!_curl_is_opensocket_cb(value)) \ if(!_curl_is_opensocket_cb(value)) \
_curl_easy_setopt_err_opensocket_cb(); \ _curl_easy_setopt_err_opensocket_cb(); \
if ((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \ if((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \
if (!_curl_is_progress_cb(value)) \ if(!_curl_is_progress_cb(value)) \
_curl_easy_setopt_err_progress_cb(); \ _curl_easy_setopt_err_progress_cb(); \
if ((_curl_opt) == CURLOPT_DEBUGFUNCTION) \ if((_curl_opt) == CURLOPT_DEBUGFUNCTION) \
if (!_curl_is_debug_cb(value)) \ if(!_curl_is_debug_cb(value)) \
_curl_easy_setopt_err_debug_cb(); \ _curl_easy_setopt_err_debug_cb(); \
if ((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \ if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \
if (!_curl_is_ssl_ctx_cb(value)) \ if(!_curl_is_ssl_ctx_cb(value)) \
_curl_easy_setopt_err_ssl_ctx_cb(); \ _curl_easy_setopt_err_ssl_ctx_cb(); \
if (_curl_is_conv_cb_option(_curl_opt)) \ if(_curl_is_conv_cb_option(_curl_opt)) \
if (!_curl_is_conv_cb(value)) \ if(!_curl_is_conv_cb(value)) \
_curl_easy_setopt_err_conv_cb(); \ _curl_easy_setopt_err_conv_cb(); \
if ((_curl_opt) == CURLOPT_SEEKFUNCTION) \ if((_curl_opt) == CURLOPT_SEEKFUNCTION) \
if (!_curl_is_seek_cb(value)) \ if(!_curl_is_seek_cb(value)) \
_curl_easy_setopt_err_seek_cb(); \ _curl_easy_setopt_err_seek_cb(); \
if (_curl_is_cb_data_option(_curl_opt)) \ if(_curl_is_cb_data_option(_curl_opt)) \
if (!_curl_is_cb_data(value)) \ if(!_curl_is_cb_data(value)) \
_curl_easy_setopt_err_cb_data(); \ _curl_easy_setopt_err_cb_data(); \
if ((_curl_opt) == CURLOPT_ERRORBUFFER) \ if((_curl_opt) == CURLOPT_ERRORBUFFER) \
if (!_curl_is_error_buffer(value)) \ if(!_curl_is_error_buffer(value)) \
_curl_easy_setopt_err_error_buffer(); \ _curl_easy_setopt_err_error_buffer(); \
if ((_curl_opt) == CURLOPT_STDERR) \ if((_curl_opt) == CURLOPT_STDERR) \
if (!_curl_is_FILE(value)) \ if(!_curl_is_FILE(value)) \
_curl_easy_setopt_err_FILE(); \ _curl_easy_setopt_err_FILE(); \
if (_curl_is_postfields_option(_curl_opt)) \ if(_curl_is_postfields_option(_curl_opt)) \
if (!_curl_is_postfields(value)) \ if(!_curl_is_postfields(value)) \
_curl_easy_setopt_err_postfields(); \ _curl_easy_setopt_err_postfields(); \
if ((_curl_opt) == CURLOPT_HTTPPOST) \ if((_curl_opt) == CURLOPT_HTTPPOST) \
if (!_curl_is_arr((value), struct curl_httppost)) \ if(!_curl_is_arr((value), struct curl_httppost)) \
_curl_easy_setopt_err_curl_httpost(); \ _curl_easy_setopt_err_curl_httpost(); \
if (_curl_is_slist_option(_curl_opt)) \ if(_curl_is_slist_option(_curl_opt)) \
if (!_curl_is_arr((value), struct curl_slist)) \ if(!_curl_is_arr((value), struct curl_slist)) \
_curl_easy_setopt_err_curl_slist(); \ _curl_easy_setopt_err_curl_slist(); \
if ((_curl_opt) == CURLOPT_SHARE) \ if((_curl_opt) == CURLOPT_SHARE) \
if (!_curl_is_ptr((value), CURLSH)) \ if(!_curl_is_ptr((value), CURLSH)) \
_curl_easy_setopt_err_CURLSH(); \ _curl_easy_setopt_err_CURLSH(); \
} \ } \
curl_easy_setopt(handle, _curl_opt, value); \ curl_easy_setopt(handle, _curl_opt, value); \
@@ -111,18 +111,18 @@ __extension__ ({ \
#define curl_easy_getinfo(handle, info, arg) \ #define curl_easy_getinfo(handle, info, arg) \
__extension__ ({ \ __extension__ ({ \
__typeof__ (info) _curl_info = info; \ __typeof__ (info) _curl_info = info; \
if (__builtin_constant_p(_curl_info)) { \ if(__builtin_constant_p(_curl_info)) { \
if (_curl_is_string_info(_curl_info)) \ if(_curl_is_string_info(_curl_info)) \
if (!_curl_is_arr((arg), char *)) \ if(!_curl_is_arr((arg), char *)) \
_curl_easy_getinfo_err_string(); \ _curl_easy_getinfo_err_string(); \
if (_curl_is_long_info(_curl_info)) \ if(_curl_is_long_info(_curl_info)) \
if (!_curl_is_arr((arg), long)) \ if(!_curl_is_arr((arg), long)) \
_curl_easy_getinfo_err_long(); \ _curl_easy_getinfo_err_long(); \
if (_curl_is_double_info(_curl_info)) \ if(_curl_is_double_info(_curl_info)) \
if (!_curl_is_arr((arg), double)) \ if(!_curl_is_arr((arg), double)) \
_curl_easy_getinfo_err_double(); \ _curl_easy_getinfo_err_double(); \
if (_curl_is_slist_info(_curl_info)) \ if(_curl_is_slist_info(_curl_info)) \
if (!_curl_is_arr((arg), struct curl_slist *)) \ if(!_curl_is_arr((arg), struct curl_slist *)) \
_curl_easy_getinfo_err_curl_slist(); \ _curl_easy_getinfo_err_curl_slist(); \
} \ } \
curl_easy_getinfo(handle, _curl_info, arg); \ curl_easy_getinfo(handle, _curl_info, arg); \
@@ -141,15 +141,17 @@ __extension__ ({ \
/* To define a new warning, use _CURL_WARNING(identifier, "message") */ /* To define a new warning, use _CURL_WARNING(identifier, "message") */
#define _CURL_WARNING(id, message) \ #define _CURL_WARNING(id, message) \
static void __attribute__((warning(message))) __attribute__((unused)) \ static void __attribute__((__warning__(message))) \
__attribute__((noinline)) id(void) { __asm__(""); } __attribute__((__unused__)) __attribute__((__noinline__)) \
id(void) { __asm__(""); }
_CURL_WARNING(_curl_easy_setopt_err_long, _CURL_WARNING(_curl_easy_setopt_err_long,
"curl_easy_setopt expects a long argument for this option") "curl_easy_setopt expects a long argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_curl_off_t, _CURL_WARNING(_curl_easy_setopt_err_curl_off_t,
"curl_easy_setopt expects a curl_off_t argument for this option") "curl_easy_setopt expects a curl_off_t argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_string, _CURL_WARNING(_curl_easy_setopt_err_string,
"curl_easy_setopt expects a string (char* or char[]) argument for this option" "curl_easy_setopt expects a "
"string (char* or char[]) argument for this option"
) )
_CURL_WARNING(_curl_easy_setopt_err_write_callback, _CURL_WARNING(_curl_easy_setopt_err_write_callback,
"curl_easy_setopt expects a curl_write_callback argument for this option") "curl_easy_setopt expects a curl_write_callback argument for this option")
@@ -160,7 +162,8 @@ _CURL_WARNING(_curl_easy_setopt_err_ioctl_cb,
_CURL_WARNING(_curl_easy_setopt_err_sockopt_cb, _CURL_WARNING(_curl_easy_setopt_err_sockopt_cb,
"curl_easy_setopt expects a curl_sockopt_callback argument for this option") "curl_easy_setopt expects a curl_sockopt_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_opensocket_cb, _CURL_WARNING(_curl_easy_setopt_err_opensocket_cb,
"curl_easy_setopt expects a curl_opensocket_callback argument for this option" "curl_easy_setopt expects a "
"curl_opensocket_callback argument for this option"
) )
_CURL_WARNING(_curl_easy_setopt_err_progress_cb, _CURL_WARNING(_curl_easy_setopt_err_progress_cb,
"curl_easy_setopt expects a curl_progress_callback argument for this option") "curl_easy_setopt expects a curl_progress_callback argument for this option")
@@ -173,9 +176,11 @@ _CURL_WARNING(_curl_easy_setopt_err_conv_cb,
_CURL_WARNING(_curl_easy_setopt_err_seek_cb, _CURL_WARNING(_curl_easy_setopt_err_seek_cb,
"curl_easy_setopt expects a curl_seek_callback argument for this option") "curl_easy_setopt expects a curl_seek_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_cb_data, _CURL_WARNING(_curl_easy_setopt_err_cb_data,
"curl_easy_setopt expects a private data pointer as argument for this option") "curl_easy_setopt expects a "
"private data pointer as argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_error_buffer, _CURL_WARNING(_curl_easy_setopt_err_error_buffer,
"curl_easy_setopt expects a char buffer of CURL_ERROR_SIZE as argument for this option") "curl_easy_setopt expects a "
"char buffer of CURL_ERROR_SIZE as argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_FILE, _CURL_WARNING(_curl_easy_setopt_err_FILE,
"curl_easy_setopt expects a FILE* argument for this option") "curl_easy_setopt expects a FILE* argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_postfields, _CURL_WARNING(_curl_easy_setopt_err_postfields,
@@ -224,7 +229,7 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
(option) == CURLOPT_PROXYUSERNAME || \ (option) == CURLOPT_PROXYUSERNAME || \
(option) == CURLOPT_PROXYPASSWORD || \ (option) == CURLOPT_PROXYPASSWORD || \
(option) == CURLOPT_NOPROXY || \ (option) == CURLOPT_NOPROXY || \
(option) == CURLOPT_ENCODING || \ (option) == CURLOPT_ACCEPT_ENCODING || \
(option) == CURLOPT_REFERER || \ (option) == CURLOPT_REFERER || \
(option) == CURLOPT_USERAGENT || \ (option) == CURLOPT_USERAGENT || \
(option) == CURLOPT_COOKIE || \ (option) == CURLOPT_COOKIE || \
@@ -388,7 +393,8 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */ /* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */
/* XXX: also check size of an char[] array? */ /* XXX: also check size of an char[] array? */
#define _curl_is_error_buffer(expr) \ #define _curl_is_error_buffer(expr) \
(__builtin_types_compatible_p(__typeof__(expr), char *) || \ (_curl_is_NULL(expr) || \
__builtin_types_compatible_p(__typeof__(expr), char *) || \
__builtin_types_compatible_p(__typeof__(expr), char[])) __builtin_types_compatible_p(__typeof__(expr), char[]))
/* evaluates to true if expr is of type (const) void* or (const) FILE* */ /* evaluates to true if expr is of type (const) void* or (const) FILE* */
@@ -481,7 +487,8 @@ typedef int (_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);
typedef int (_curl_sockopt_callback2)(const void *, curl_socket_t, typedef int (_curl_sockopt_callback2)(const void *, curl_socket_t,
curlsocktype); curlsocktype);
/* evaluates to true if expr is of type curl_opensocket_callback or "similar" */ /* evaluates to true if expr is of type curl_opensocket_callback or
"similar" */
#define _curl_is_opensocket_cb(expr) \ #define _curl_is_opensocket_cb(expr) \
(_curl_is_NULL(expr) || \ (_curl_is_NULL(expr) || \
__builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\ __builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\
@@ -516,7 +523,11 @@ typedef int (_curl_progress_callback2)(const void *,
_curl_callback_compatible((expr), _curl_debug_callback1) || \ _curl_callback_compatible((expr), _curl_debug_callback1) || \
_curl_callback_compatible((expr), _curl_debug_callback2) || \ _curl_callback_compatible((expr), _curl_debug_callback2) || \
_curl_callback_compatible((expr), _curl_debug_callback3) || \ _curl_callback_compatible((expr), _curl_debug_callback3) || \
_curl_callback_compatible((expr), _curl_debug_callback4)) _curl_callback_compatible((expr), _curl_debug_callback4) || \
_curl_callback_compatible((expr), _curl_debug_callback5) || \
_curl_callback_compatible((expr), _curl_debug_callback6) || \
_curl_callback_compatible((expr), _curl_debug_callback7) || \
_curl_callback_compatible((expr), _curl_debug_callback8))
typedef int (_curl_debug_callback1) (CURL *, typedef int (_curl_debug_callback1) (CURL *,
curl_infotype, char *, size_t, void *); curl_infotype, char *, size_t, void *);
typedef int (_curl_debug_callback2) (CURL *, typedef int (_curl_debug_callback2) (CURL *,
@@ -525,6 +536,14 @@ typedef int (_curl_debug_callback3) (CURL *,
curl_infotype, const char *, size_t, void *); curl_infotype, const char *, size_t, void *);
typedef int (_curl_debug_callback4) (CURL *, typedef int (_curl_debug_callback4) (CURL *,
curl_infotype, const char *, size_t, const void *); curl_infotype, const char *, size_t, const void *);
typedef int (_curl_debug_callback5) (CURL *,
curl_infotype, unsigned char *, size_t, void *);
typedef int (_curl_debug_callback6) (CURL *,
curl_infotype, unsigned char *, size_t, const void *);
typedef int (_curl_debug_callback7) (CURL *,
curl_infotype, const unsigned char *, size_t, void *);
typedef int (_curl_debug_callback8) (CURL *,
curl_infotype, const unsigned char *, size_t, const void *);
/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */ /* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */
/* this is getting even messier... */ /* this is getting even messier... */
@@ -550,7 +569,8 @@ typedef CURLcode (_curl_ssl_ctx_callback4)(CURL *, const void *, const void *);
typedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *); typedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *);
typedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *); typedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *);
typedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *); typedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *);
typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX, const void *); typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX,
const void *);
#else #else
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5; typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5;
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6; typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6;

View File

@@ -1 +0,0 @@
/* not used */

1
lib/.gitignore vendored
View File

@@ -10,3 +10,4 @@ libcurl.plist.dist
libcurl.vcproj libcurl.vcproj
vc6libcurl.dsp vc6libcurl.dsp
Makefile.vc10.dist Makefile.vc10.dist
libcurl.vers

View File

@@ -122,3 +122,5 @@ if(WIN32)
set_target_properties(${LIB_NAME} PROPERTIES IMPORT_SUFFIX "_imp.lib") set_target_properties(${LIB_NAME} PROPERTIES IMPORT_SUFFIX "_imp.lib")
endif() endif()
endif() endif()
install(TARGETS ${LIB_NAME} DESTINATION lib)

View File

@@ -70,19 +70,26 @@ CFLAGS += -d_WIN32_WINNT=0x0501 -dENABLE_IPV6
CFLAGS += -dUSE_WINDOWS_SSPI CFLAGS += -dUSE_WINDOWS_SSPI
!endif !endif
!ifdef %use_winidn
CFLAGS += -dWINVER=0x0600 -dUSE_WIN32_IDN
! if $(__VERSION__) <= 1290
CFLAGS += -dWANT_IDN_PROTOTYPES
! endif
!endif
# #
# Change to suite. # Change to suite.
# #
!ifdef %zlib_root !ifdef %zlib_root
ZLIB_ROOT = $(%zlib_root) ZLIB_ROOT = $(%zlib_root)
!else !else
ZLIB_ROOT = ..$(DS)..$(DS)zlib-1.2.5 ZLIB_ROOT = ..$(DS)..$(DS)zlib-1.2.7
!endif !endif
!ifdef %libssh2_root !ifdef %libssh2_root
LIBSSH2_ROOT = $(%libssh2_root) LIBSSH2_ROOT = $(%libssh2_root)
!else !else
LIBSSH2_ROOT = ..$(DS)..$(DS)libssh2-1.2.7 LIBSSH2_ROOT = ..$(DS)..$(DS)libssh2-1.4.2
!endif !endif
!ifdef %librtmp_root !ifdef %librtmp_root
@@ -94,7 +101,7 @@ LIBRTMP_ROOT = ..$(DS)..$(DS)rtmpdump-2.3
!ifdef %openssl_root !ifdef %openssl_root
OPENSSL_ROOT = $(%openssl_root) OPENSSL_ROOT = $(%openssl_root)
!else !else
OPENSSL_ROOT = ..$(DS)..$(DS)openssl-0.9.8r OPENSSL_ROOT = ..$(DS)..$(DS)openssl-0.9.8x
!endif !endif
!ifdef %ares_root !ifdef %ares_root
@@ -229,6 +236,14 @@ $(LINK_ARG): $(__MAKEFILES__)
!ifdef %use_ares !ifdef %use_ares
@%append $^@ library $(ARES_ROOT)$(DS)cares.lib @%append $^@ library $(ARES_ROOT)$(DS)cares.lib
!endif !endif
!ifdef %use_winidn
! if $(__VERSION__) > 1290
@%append $^@ library normaliz.lib
! else
@%append $^@ import '_IdnToAscii@20' 'NORMALIZ.DLL'.'IdnToAscii'
@%append $^@ import '_IdnToUnicode@20' 'NORMALIZ.DLL'.'IdnToUnicode'
! endif
!endif
$(LIB_ARG): $(__MAKEFILES__) $(LIB_ARG): $(__MAKEFILES__)
%create $^@ %create $^@

View File

@@ -5,7 +5,7 @@
# | (__| |_| | _ <| |___ # | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____| # \___|\___/|_| \_\_____|
# #
# Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. # Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
# #
# This software is licensed as described in the file COPYING, which # This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms # you should have received as part of this distribution. The terms
@@ -33,12 +33,12 @@ CMAKE_DIST = CMakeLists.txt curl_config.h.cmake
EXTRA_DIST = Makefile.b32 Makefile.m32 Makefile.vc6 $(DSP) \ EXTRA_DIST = Makefile.b32 Makefile.m32 Makefile.vc6 $(DSP) \
vc6libcurl.dsw config-win32.h config-win32ce.h config-riscos.h \ vc6libcurl.dsw config-win32.h config-win32ce.h config-riscos.h \
config-mac.h curl_config.h.in makefile.dj config-dos.h libcurl.plist \ config-mac.h curl_config.h.in makefile.dj config-dos.h libcurl.plist \
libcurl.rc config-amigaos.h amigaos.c amigaos.h makefile.amiga \ libcurl.rc config-amigaos.h makefile.amiga \
Makefile.netware nwlib.c nwos.c libcurl.imp msvcproj.head msvcproj.foot \ Makefile.netware nwlib.c nwos.c libcurl.imp msvcproj.head msvcproj.foot \
config-win32ce.h config-os400.h setup-os400.h config-symbian.h \ config-win32ce.h config-os400.h setup-os400.h config-symbian.h \
Makefile.Watcom config-tpf.h $(DOCS) $(VCPROJ) mk-ca-bundle.pl \ Makefile.Watcom config-tpf.h $(DOCS) $(VCPROJ) mk-ca-bundle.pl \
mk-ca-bundle.vbs firefox-db2pem.sh $(CMAKE_DIST) config-vxworks.h \ mk-ca-bundle.vbs firefox-db2pem.sh $(CMAKE_DIST) config-vxworks.h \
Makefile.vxworks config-vms.h Makefile.vxworks config-vms.h checksrc.pl
CLEANFILES = $(DSP) $(VCPROJ) CLEANFILES = $(DSP) $(VCPROJ)
@@ -46,7 +46,9 @@ lib_LTLIBRARIES = libcurl.la
LIBCURL_LIBS = @LIBCURL_LIBS@ LIBCURL_LIBS = @LIBCURL_LIBS@
# This might hold -Werror # This might hold -Werror
libcurl_la_CFLAGS = $(CFLAGS) @CURL_CFLAG_EXTRAS@ CFLAGS += @CURL_CFLAG_EXTRAS@
CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@
# Specify our include paths here, and do it relative to $(top_srcdir) and # Specify our include paths here, and do it relative to $(top_srcdir) and
# $(top_builddir), to ensure that these paths which belong to the library # $(top_builddir), to ensure that these paths which belong to the library
@@ -77,6 +79,18 @@ INCLUDES = -I$(top_builddir)/include/curl \
-I$(top_srcdir)/lib -I$(top_srcdir)/lib
endif endif
AM_CPPFLAGS =
# Mostly for Windows build targets, when building libcurl library
if USE_CPPFLAG_BUILDING_LIBCURL
AM_CPPFLAGS += -DBUILDING_LIBCURL
endif
# Mostly for Windows build targets, when building static libcurl
if USE_CPPFLAG_CURL_STATICLIB
AM_CPPFLAGS += -DCURL_STATICLIB
endif
if SONAME_BUMP if SONAME_BUMP
# #
# Bumping of SONAME conditionally may seem like a weird thing to do, and yeah # Bumping of SONAME conditionally may seem like a weird thing to do, and yeah
@@ -106,7 +120,7 @@ endif
# For the full guide on libcurl ABI rules, see docs/libcurl/ABI # For the full guide on libcurl ABI rules, see docs/libcurl/ABI
if NO_UNDEFINED if NO_UNDEFINED
# The -no-undefined flag is CRUCIAL for this to build fine on Cygwin. # The -no-undefined flag is crucial to build fine on some platforms
UNDEF = -no-undefined UNDEF = -no-undefined
endif endif
@@ -116,18 +130,31 @@ if MIMPURE
MIMPURE = -mimpure-text MIMPURE = -mimpure-text
endif endif
LINKFLAGS=$(UNDEF) $(MIMPURE) $(LIBCURL_LIBS) if VERSIONED_SYMBOLS
VERSIONED_SYMBOLS = -Wl,--version-script=libcurl.vers
libcurl_la_LDFLAGS = $(LINKFLAGS) $(VERSIONINFO)
# as unit testing will compile and link everything an extra time, we only
# do it if debug is enabled
if CURLDEBUG
noinst_LTLIBRARIES = libcurlu.la
libcurlu_la_CFLAGS = -DUNITTESTS
libcurlu_la_LDFLAGS = -static $(LINKFLAGS)
endif endif
libcurl_la_LDFLAGS = $(UNDEF) $(VERSIONINFO) $(MIMPURE) $(VERSIONED_SYMBOLS) $(LIBCURL_LIBS)
if DOING_CURL_SYMBOL_HIDING
libcurl_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_HIDDEN_SYMBOLS
libcurl_la_CFLAGS = $(AM_CFLAGS) $(CFLAG_CURL_SYMBOL_HIDING)
else
libcurl_la_CPPFLAGS = $(AM_CPPFLAGS)
libcurl_la_CFLAGS = $(AM_CFLAGS)
endif
# unit testing static library built only along with unit tests
if BUILD_UNITTESTS
noinst_LTLIBRARIES = libcurlu.la
else
noinst_LTLIBRARIES =
endif
libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DUNITTESTS
libcurlu_la_LDFLAGS = -static $(LIBCURL_LIBS)
libcurlu_la_CFLAGS = $(AM_CFLAGS)
# Makefile.inc provides the CSOURCES and HHEADERS defines # Makefile.inc provides the CSOURCES and HHEADERS defines
include Makefile.inc include Makefile.inc
@@ -184,3 +211,12 @@ $(VCPROJ): vc8proj.head vc8proj.foot Makefile.am
echo "<File RelativePath=\""$$file"\"></File>" $(VCPROJOUT); \ echo "<File RelativePath=\""$$file"\"></File>" $(VCPROJOUT); \
done; \ done; \
cat $(srcdir)/vc8proj.foot $(VCPROJOUT) ) cat $(srcdir)/vc8proj.foot $(VCPROJOUT) )
checksrc:
@@PERL@ $(top_srcdir)/lib/checksrc.pl -D$(top_srcdir)/lib $(CSOURCES) $(HHEADERS)
if CURLDEBUG
# for debug builds, we scan the sources on all regular make invokes
all-local: checksrc
endif

View File

@@ -22,12 +22,12 @@ BCCDIR = $(MAKEDIR)\..
# Edit the path below to point to the base of your Zlib sources. # Edit the path below to point to the base of your Zlib sources.
!ifndef ZLIB_PATH !ifndef ZLIB_PATH
ZLIB_PATH = ..\..\zlib-1.2.5 ZLIB_PATH = ..\..\zlib-1.2.7
!endif !endif
# Edit the path below to point to the base of your OpenSSL package. # Edit the path below to point to the base of your OpenSSL package.
!ifndef OPENSSL_PATH !ifndef OPENSSL_PATH
OPENSSL_PATH = ..\..\openssl-0.9.8q OPENSSL_PATH = ..\..\openssl-0.9.8x
!endif !endif
# Set libcurl static lib, dll and import lib # Set libcurl static lib, dll and import lib

View File

@@ -14,14 +14,16 @@ CSOURCES = file.c timeval.c base64.c hostip.c progress.c formdata.c \
curl_fnmatch.c fileinfo.c ftplistparser.c wildcard.c krb5.c \ curl_fnmatch.c fileinfo.c ftplistparser.c wildcard.c krb5.c \
memdebug.c http_chunks.c strtok.c connect.c llist.c hash.c multi.c \ memdebug.c http_chunks.c strtok.c connect.c llist.c hash.c multi.c \
content_encoding.c share.c http_digest.c md4.c md5.c curl_rand.c \ content_encoding.c share.c http_digest.c md4.c md5.c curl_rand.c \
http_negotiate.c http_ntlm.c inet_pton.c strtoofft.c strerror.c \ http_negotiate.c inet_pton.c strtoofft.c strerror.c amigaos.c \
hostares.c hostasyn.c hostip4.c hostip6.c hostsyn.c hostthre.c \ hostasyn.c hostip4.c hostip6.c hostsyn.c inet_ntop.c parsedate.c \
inet_ntop.c parsedate.c select.c gtls.c sslgen.c tftp.c splay.c \ select.c gtls.c sslgen.c tftp.c splay.c strdup.c socks.c ssh.c nss.c \
strdup.c socks.c ssh.c nss.c qssl.c rawstr.c curl_addrinfo.c \ qssl.c rawstr.c curl_addrinfo.c socks_gssapi.c socks_sspi.c \
socks_gssapi.c socks_sspi.c curl_sspi.c slist.c nonblock.c \ curl_sspi.c slist.c nonblock.c curl_memrchr.c imap.c pop3.c smtp.c \
curl_memrchr.c imap.c pop3.c smtp.c pingpong.c rtsp.c curl_threads.c \ pingpong.c rtsp.c curl_threads.c warnless.c hmac.c polarssl.c \
warnless.c hmac.c polarssl.c curl_rtmp.c openldap.c curl_gethostname.c\ curl_rtmp.c openldap.c curl_gethostname.c gopher.c axtls.c \
gopher.c axtls.c idn_win32.c http_negotiate_sspi.c cyassl.c http_proxy.c idn_win32.c http_negotiate_sspi.c cyassl.c http_proxy.c non-ascii.c \
asyn-ares.c asyn-thread.c curl_gssapi.c curl_ntlm.c curl_ntlm_wb.c \
curl_ntlm_core.c curl_ntlm_msgs.c
HHEADERS = arpa_telnet.h netrc.h file.h timeval.h qssl.h hostip.h \ HHEADERS = arpa_telnet.h netrc.h file.h timeval.h qssl.h hostip.h \
progress.h formdata.h cookie.h http.h sendf.h ftp.h url.h dict.h \ progress.h formdata.h cookie.h http.h sendf.h ftp.h url.h dict.h \
@@ -29,12 +31,12 @@ HHEADERS = arpa_telnet.h netrc.h file.h timeval.h qssl.h hostip.h \
getinfo.h strequal.h krb4.h memdebug.h http_chunks.h curl_rand.h \ getinfo.h strequal.h krb4.h memdebug.h http_chunks.h curl_rand.h \
curl_fnmatch.h wildcard.h fileinfo.h ftplistparser.h strtok.h \ curl_fnmatch.h wildcard.h fileinfo.h ftplistparser.h strtok.h \
connect.h llist.h hash.h content_encoding.h share.h curl_md4.h \ connect.h llist.h hash.h content_encoding.h share.h curl_md4.h \
curl_md5.h http_digest.h http_negotiate.h http_ntlm.h inet_pton.h \ curl_md5.h http_digest.h http_negotiate.h inet_pton.h amigaos.h \
strtoofft.h strerror.h inet_ntop.h curlx.h curl_memory.h setup.h \ strtoofft.h strerror.h inet_ntop.h curlx.h curl_memory.h setup.h \
transfer.h select.h easyif.h multiif.h parsedate.h sslgen.h gtls.h \ transfer.h select.h easyif.h multiif.h parsedate.h sslgen.h gtls.h \
tftp.h sockaddr.h splay.h strdup.h setup_once.h socks.h ssh.h nssg.h \ tftp.h sockaddr.h splay.h strdup.h setup_once.h socks.h ssh.h nssg.h \
curl_base64.h rawstr.h curl_addrinfo.h curl_sspi.h slist.h nonblock.h \ curl_base64.h rawstr.h curl_addrinfo.h curl_sspi.h slist.h nonblock.h \
curl_memrchr.h imap.h pop3.h smtp.h pingpong.h rtsp.h curl_threads.h \ curl_memrchr.h imap.h pop3.h smtp.h pingpong.h rtsp.h curl_threads.h \
warnless.h curl_hmac.h polarssl.h curl_rtmp.h curl_gethostname.h \ warnless.h curl_hmac.h polarssl.h curl_rtmp.h curl_gethostname.h \
gopher.h axtls.h cyassl.h http_proxy.h gopher.h axtls.h cyassl.h http_proxy.h non-ascii.h asyn.h curl_ntlm.h \
curl_gssapi.h curl_ntlm_wb.h curl_ntlm_core.h curl_ntlm_msgs.h

View File

@@ -1,68 +1,137 @@
######################################################################### ###########################################################################
# #
## Makefile for building libcurl.a with MingW32 (GCC-3.2 or later) ## Makefile for building libcurl.a with MingW (GCC-3.2 or later)
## and optionally OpenSSL (0.9.8), libssh2 (1.2), zlib (1.2.5) ## and optionally OpenSSL (0.9.8), libssh2 (1.3), zlib (1.2.5), librtmp (2.3)
## ##
## Usage: ## Usage: mingw32-make -f Makefile.m32 CFG=-feature1[-feature2][-feature3][...]
## mingw32-make -f Makefile.m32 [SSL=1] [SSH2=1] [ZLIB=1] [IDN=1] [SSPI=1] [IPV6=1] [LDAPS=1] [RTMP=1] [DYN=1] ## Example: mingw32-make -f Makefile.m32 CFG=-zlib-ssl-sspi-winidn
## ##
## Hint: you can also set environment vars to control the build, f.e.: ## Hint: you can also set environment vars to control the build, f.e.:
## set ZLIB_PATH=c:/zlib-1.2.5 ## set ZLIB_PATH=c:/zlib-1.2.7
## set ZLIB=1 ## set ZLIB=1
## #
## Comments to: Troy Engel <tengel@sonic.net> or ###########################################################################
## Joern Hartroth <hartroth@acm.org>
#########################################################################
# Edit the path below to point to the base of your Zlib sources. # Edit the path below to point to the base of your Zlib sources.
ifndef ZLIB_PATH ifndef ZLIB_PATH
ZLIB_PATH = ../../zlib-1.2.5 ZLIB_PATH = ../../zlib-1.2.7
endif endif
# Edit the path below to point to the base of your OpenSSL package. # Edit the path below to point to the base of your OpenSSL package.
ifndef OPENSSL_PATH ifndef OPENSSL_PATH
OPENSSL_PATH = ../../openssl-0.9.8r OPENSSL_PATH = ../../openssl-0.9.8x
endif
ifndef OPENSSL_INCLUDE
OPENSSL_INCLUDE = $(OPENSSL_PATH)/outinc
endif
ifndef OPENSSL_LIBPATH
OPENSSL_LIBPATH = $(OPENSSL_PATH)/out
endif
ifndef OPENSSL_LIBS
OPENSSL_LIBS = -leay32 -lssl32
endif endif
# Edit the path below to point to the base of your LibSSH2 package. # Edit the path below to point to the base of your LibSSH2 package.
ifndef LIBSSH2_PATH ifndef LIBSSH2_PATH
LIBSSH2_PATH = ../../libssh2-1.2.7 LIBSSH2_PATH = ../../libssh2-1.4.2
endif
# Edit the path below to point to the base of your librtmp package.
ifndef LIBRTMP_PATH
LIBRTMP_PATH = ../../librtmp-2.3
endif endif
# Edit the path below to point to the base of your libidn package. # Edit the path below to point to the base of your libidn package.
ifndef LIBIDN_PATH ifndef LIBIDN_PATH
LIBIDN_PATH = ../../libidn-1.18 LIBIDN_PATH = ../../libidn-1.18
endif endif
# Edit the path below to point to the base of your librtmp package. # Edit the path below to point to the base of your MS IDN package.
ifndef LIBRTMP_PATH # Microsoft Internationalized Domain Names (IDN) Mitigation APIs 1.1
LIBRTMP_PATH = ../../librtmp-2.3 # http://www.microsoft.com/downloads/en/details.aspx?FamilyID=ad6158d7-ddba-416a-9109-07607425a815
ifndef WINIDN_PATH
WINIDN_PATH = ../../Microsoft IDN Mitigation APIs
endif endif
# Edit the path below to point to the base of your Novell LDAP NDK. # Edit the path below to point to the base of your Novell LDAP NDK.
ifndef LDAP_SDK ifndef LDAP_SDK
LDAP_SDK = c:/novell/ndk/cldapsdk/win32 LDAP_SDK = c:/novell/ndk/cldapsdk/win32
endif endif
PROOT = ..
# Edit the path below to point to the base of your c-ares package. # Edit the path below to point to the base of your c-ares package.
ifndef LIBCARES_PATH ifndef LIBCARES_PATH
LIBCARES_PATH = ../ares LIBCARES_PATH = $(PROOT)/ares
endif
# Edit the var below to set to your architecture or set environment var.
ifndef ARCH
ARCH = w32
endif endif
CC = gcc CC = gcc
AR = ar CFLAGS = -g -O2 -Wall
CFLAGS += -fno-strict-aliasing
ifeq ($(ARCH),w64)
CFLAGS += -D_AMD64_
endif
# comment LDFLAGS below to keep debug info # comment LDFLAGS below to keep debug info
LDFLAGS = -s LDFLAGS = -s
AR = ar
RANLIB = ranlib RANLIB = ranlib
RC = windres RC = windres
RCFLAGS = --include-dir=../include -DDEBUGBUILD=0 -O COFF -i RCFLAGS = --include-dir=$(PROOT)/include -DDEBUGBUILD=0 -O COFF -i
RM = del /q /f 2>NUL
STRIP = strip -g STRIP = strip -g
RM = del /q /f 2>NUL
CP = copy
######################################################## ########################################################
## Nothing more to do below this line! ## Nothing more to do below this line!
ifeq ($(findstring -dyn,$(CFG)),-dyn)
DYN = 1
endif
ifeq ($(findstring -ares,$(CFG)),-ares)
ARES = 1
endif
ifeq ($(findstring -rtmp,$(CFG)),-rtmp)
RTMP = 1
SSL = 1
ZLIB = 1
endif
ifeq ($(findstring -ssh2,$(CFG)),-ssh2)
SSH2 = 1
SSL = 1
ZLIB = 1
endif
ifeq ($(findstring -ssl,$(CFG)),-ssl)
SSL = 1
endif
ifeq ($(findstring -zlib,$(CFG)),-zlib)
ZLIB = 1
endif
ifeq ($(findstring -idn,$(CFG)),-idn)
IDN = 1
endif
ifeq ($(findstring -winidn,$(CFG)),-winidn)
WINIDN = 1
endif
ifeq ($(findstring -sspi,$(CFG)),-sspi)
SSPI = 1
endif
ifeq ($(findstring -spnego,$(CFG)),-spnego)
SPNEGO = 1
endif
ifeq ($(findstring -ldaps,$(CFG)),-ldaps)
LDAPS = 1
endif
ifeq ($(findstring -ipv6,$(CFG)),-ipv6)
IPV6 = 1
endif
INCLUDES = -I. -I../include INCLUDES = -I. -I../include
CFLAGS = -g -O2 -DBUILDING_LIBCURL CFLAGS += -DBUILDING_LIBCURL
ifdef ARES ifdef ARES
INCLUDES += -I$(LIBCARES_PATH) INCLUDES += -I"$(LIBCARES_PATH)"
CFLAGS += -DUSE_ARES CFLAGS += -DUSE_ARES
DLL_LIBS += -L$(LIBCARES_PATH) -lcares DLL_LIBS += -L"$(LIBCARES_PATH)" -lcares
libcurl_dll_DEPENDENCIES = $(LIBCARES_PATH)/libcares.a libcurl_dll_DEPENDENCIES = $(LIBCARES_PATH)/libcares.a
endif endif
ifdef RTMP ifdef RTMP
@@ -73,30 +142,39 @@ endif
ifdef SSH2 ifdef SSH2
INCLUDES += -I"$(LIBSSH2_PATH)/include" -I"$(LIBSSH2_PATH)/win32" INCLUDES += -I"$(LIBSSH2_PATH)/include" -I"$(LIBSSH2_PATH)/win32"
CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
DLL_LIBS += -L$(LIBSSH2_PATH)/win32 -lssh2 DLL_LIBS += -L"$(LIBSSH2_PATH)/win32" -lssh2
endif endif
ifdef SSL ifdef SSL
INCLUDES += -I"$(OPENSSL_PATH)/outinc" -I"$(OPENSSL_PATH)/outinc/openssl" INCLUDES += -I"$(OPENSSL_INCLUDE)"
CFLAGS += -DUSE_SSLEAY -DUSE_OPENSSL -DHAVE_OPENSSL_ENGINE_H -DHAVE_OPENSSL_PKCS12_H \ CFLAGS += -DUSE_SSLEAY -DUSE_OPENSSL -DHAVE_OPENSSL_ENGINE_H -DHAVE_OPENSSL_PKCS12_H \
-DHAVE_ENGINE_LOAD_BUILTIN_ENGINES -DOPENSSL_NO_KRB5 \ -DHAVE_ENGINE_LOAD_BUILTIN_ENGINES -DOPENSSL_NO_KRB5 \
-DCURL_WANTS_CA_BUNDLE_ENV -DCURL_WANTS_CA_BUNDLE_ENV
DLL_LIBS += -L$(OPENSSL_PATH)/out -leay32 -lssl32 DLL_LIBS += -L"$(OPENSSL_LIBPATH)" $(OPENSSL_LIBS)
endif endif
ifdef ZLIB ifdef ZLIB
INCLUDES += -I"$(ZLIB_PATH)" INCLUDES += -I"$(ZLIB_PATH)"
CFLAGS += -DHAVE_LIBZ -DHAVE_ZLIB_H CFLAGS += -DHAVE_LIBZ -DHAVE_ZLIB_H
DLL_LIBS += -L$(ZLIB_PATH) -lz DLL_LIBS += -L"$(ZLIB_PATH)" -lz
endif endif
ifdef IDN ifdef IDN
INCLUDES += -I"$(LIBIDN_PATH)/include" INCLUDES += -I"$(LIBIDN_PATH)/include"
CFLAGS += -DUSE_LIBIDN CFLAGS += -DUSE_LIBIDN
DLL_LIBS += -L$(LIBIDN_PATH)/lib -lidn DLL_LIBS += -L"$(LIBIDN_PATH)/lib" -lidn
else
ifdef WINIDN
CFLAGS += -DUSE_WIN32_IDN
CFLAGS += -DWANT_IDN_PROTOTYPES
DLL_LIBS += -L"$(WINIDN_PATH)" -lnormaliz
endif
endif endif
ifdef SSPI ifdef SSPI
CFLAGS += -DUSE_WINDOWS_SSPI CFLAGS += -DUSE_WINDOWS_SSPI
endif endif
ifdef SPNEGO
CFLAGS += -DHAVE_SPNEGO
endif
ifdef IPV6 ifdef IPV6
CFLAGS += -DENABLE_IPV6 CFLAGS += -DENABLE_IPV6 -D_WIN32_WINNT=0x0501
endif endif
ifdef LDAPS ifdef LDAPS
CFLAGS += -DHAVE_LDAP_SSL CFLAGS += -DHAVE_LDAP_SSL
@@ -113,11 +191,10 @@ ifdef USE_LDAP_OPENLDAP
endif endif
ifndef USE_LDAP_NOVELL ifndef USE_LDAP_NOVELL
ifndef USE_LDAP_OPENLDAP ifndef USE_LDAP_OPENLDAP
DLL_LIBS += -lwldap32 DLL_LIBS += -lwldap32
endif endif
endif endif
DLL_LIBS += -lws2_32 DLL_LIBS += -lws2_32
COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
# Makefile.inc provides the CSOURCES and HHEADERS defines # Makefile.inc provides the CSOURCES and HHEADERS defines
include Makefile.inc include Makefile.inc
@@ -131,7 +208,6 @@ libcurl_a_DEPENDENCIES := $(strip $(CSOURCES) $(HHEADERS))
RESOURCE = libcurl.res RESOURCE = libcurl.res
.SUFFIXES: .rc .res
all: $(libcurl_a_LIBRARY) $(libcurl_dll_LIBRARY) all: $(libcurl_a_LIBRARY) $(libcurl_dll_LIBRARY)
@@ -148,20 +224,25 @@ $(libcurl_dll_LIBRARY): $(libcurl_a_OBJECTS) $(RESOURCE) $(libcurl_dll_DEPENDENC
$(CC) $(LDFLAGS) -shared -Wl,--out-implib,$(libcurl_dll_a_LIBRARY) \ $(CC) $(LDFLAGS) -shared -Wl,--out-implib,$(libcurl_dll_a_LIBRARY) \
-o $@ $(libcurl_a_OBJECTS) $(RESOURCE) $(DLL_LIBS) -o $@ $(libcurl_a_OBJECTS) $(RESOURCE) $(DLL_LIBS)
.c.o: %.o: %.c $(PROOT)/include/curl/curlbuild.h
$(COMPILE) -c $< $(CC) $(INCLUDES) $(CFLAGS) -c $<
.rc.res: %.res: %.rc
$(RC) $(RCFLAGS) $< -o $@ $(RC) $(RCFLAGS) $< -o $@
clean: clean:
ifeq "$(wildcard $(PROOT)/include/curl/curlbuild.h.dist)" "$(PROOT)/include/curl/curlbuild.h.dist"
-$(RM) $(subst /,\,$(PROOT)/include/curl/curlbuild.h)
endif
-$(RM) $(libcurl_a_OBJECTS) $(RESOURCE) -$(RM) $(libcurl_a_OBJECTS) $(RESOURCE)
distclean vclean: clean distclean vclean: clean
-$(RM) $(libcurl_a_LIBRARY) $(libcurl_dll_LIBRARY) $(libcurl_dll_a_LIBRARY) -$(RM) $(libcurl_a_LIBRARY) $(libcurl_dll_LIBRARY) $(libcurl_dll_a_LIBRARY)
FORCE: ;
$(LIBCARES_PATH)/libcares.a: $(LIBCARES_PATH)/libcares.a:
$(MAKE) -C $(LIBCARES_PATH) -f Makefile.m32 $(MAKE) -C $(LIBCARES_PATH) -f Makefile.m32
$(PROOT)/include/curl/curlbuild.h:
@echo Creating $@
@$(CP) $(subst /,\,$@).dist $(subst /,\,$@)

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