Compare commits

...

1262 Commits

Author SHA1 Message Date
Daniel Stenberg
9819cec61b RELEASE-NOTES: curl 7.48.0 2016-03-23 07:55:48 +01:00
Daniel Stenberg
b733c9cb0b THANKS: 15 new contributors from 7.48.0 release 2016-03-23 07:55:48 +01:00
Jay Satiro
949c388ffb CURLINFO_TLS_SSL_PTR.3: Warn about limitations
Bug: https://github.com/curl/curl/issues/685
2016-03-23 01:16:21 -04:00
Daniel Stenberg
d5e7f50e63 Revert "sshserver: remove use of AuthorizedKeysFile2"
It seems we may have some autobuild problems after this commit went
in. Trying to see if a revert helps to get them back.

This reverts commit 2716350d1f3edc8e929f6ceeee05051090f6d642.
2016-03-22 10:43:55 +01:00
Daniel Stenberg
1d7df9ed7a maketgz: add -j to make dist
... makes it a lot faster
2016-03-22 10:35:22 +01:00
Daniel Stenberg
22b21bc40e libcurl-thread.3: minor nroff format fix 2016-03-22 10:33:44 +01:00
Daniel Stenberg
4574bde908 CURLINFO_TLS_SSL_PTR.3: minor nroff format fix 2016-03-22 10:33:24 +01:00
Daniel Stenberg
a136cdeaf1 CODE_STYLE: indend example code
... to make it look nicer in markdown outputa
2016-03-22 08:36:21 +01:00
Jay Satiro
f7bb1fc1d7 build-wolfssl: Update VS properties for wolfSSL v3.9.0
- Do not use wolfSSL's sample user-setting files.

wolfSSL starting in v3.9.0 has added their own sample user settings that
are applied by default, but we don't use them because we have our own
settings.

- Do not use wolfSSL's Visual Studio Unicode character setting.

wolfSSL Visual Studio projects use the Unicode character set however our
settings and options imitate mingw build which does not use the Unicode
character set. This does not appear to have any effect at the moment but
better safe than sorry.


These changes are backwards compatible with earlier versions.
2016-03-22 03:03:11 -04:00
Steve Holme
f974ffdd4b hostip6: Fixed compilation warnings when verbose strings disabled
warning C4189: 'data': local variable is initialized but not referenced

...and some minor formatting/spacing changes.
2016-03-22 06:16:06 +00:00
Daniel Stenberg
2716350d1f sshserver: remove use of AuthorizedKeysFile2
Support for the (undocumented) AuthorizedKeysFile2 was removed in
OpenSSH 5.9, released in September 2011

Closes #715
2016-03-21 00:53:02 +01:00
Steve Holme
9351383745 connect/ntlm/http: Fixed compilation warnings when verbose strings disabled
warning C4189: 'data': local variable is initialized but not referenced
2016-03-20 17:51:06 +00:00
Steve Holme
89f397d7eb openssl: Fixed compilation warning when /Wall enabled
warning C4706: assignment within conditional expression
2016-03-20 17:35:31 +00:00
Steve Holme
eba1b3099f CODE_STYLE: Use boolean conditions
Rather than use TRUE, FALSE, NULL, 0 or != 0 in if/while conditions.

Additionally, corrected some example code to adhere to the recommended
coding style.
2016-03-20 11:51:11 +00:00
Steve Holme
f046ac48d6 inet_pton.c: Fixed compilation warnings
warning: conversion to 'unsigned char' from 'int' may alter its value
2016-03-20 11:14:58 +00:00
Daniel Stenberg
100f991251 RELEASE-NOTES: synced with 80851028efc2fa9 2016-03-19 22:46:09 +01:00
Daniel Stenberg
80851028ef mbedtls: fix compiler warning
vtls/mbedtls.h:67:36: warning: implicit declaration of function
‘mbedtls_sha256’ [-Wimplicit-function-declaration]
2016-03-19 22:37:21 +01:00
Steve Holme
4ff5cfd5fa easy: Minor coding standard and style updates
Following commit c5744340db. Additionally removes the need for a second
'result code' variable as well.
2016-03-19 20:37:12 +00:00
Jay Satiro
c5744340db easy: Remove poll failure check in easy_transfer
.. because curl_multi_wait can no longer signal poll failure.

follow-up to 77e1726

Bug: https://github.com/curl/curl/issues/707
2016-03-19 15:29:52 -04:00
Steve Holme
e66109c1e3 build: Added missing Visual Studio filter files for VC10 onwards
As these files don't need to contain references to the source files,
although typically do, added basic files which only include three
filters and don't require the project file generator to be modified.

These files allow the source code to be viewed in the Solution Explorer
in versions of Visual Studio from 2010 onwards in the same manner as
previous versions did rather than one large view of files.
2016-03-19 17:57:43 +00:00
Steve Holme
c142e73142 ftp/imap/pop3/smtp: Fixed compilation warning when /Wall enabled
warning C4706: assignment within conditional expression
2016-03-19 17:15:53 +00:00
Steve Holme
4ff2fbd1d5 config-w32.h: Fixed compilation warning when /Wall enabled
warning C4668: 'USE_IPV6' is not defined as a preprocessor macro,
               replacing with '0' for '#if/#elif'
2016-03-19 11:05:06 +00:00
Steve Holme
97c9d2ae8c imap.c: Fixed compilation warning with /Wall enabled
warning C4701: potentially uninitialized local variable 'size' used

Technically this can't happen, as the usage of 'size' is protected by
'if(parsed)' and 'parsed' is only set after 'size' has been parsed.

Anyway, lets keep the compiler happy.
2016-03-19 11:01:36 +00:00
Steve Holme
2107a952e8 KNOWN_BUGS: #93 Issue with CURLFORM_CONTENTLEN in arrays on 32-bit platforms 2016-03-19 00:06:36 +00:00
Daniel Stenberg
997a95bbc8 bump: the coming release is 7.48.0 2016-03-18 21:59:53 +01:00
Daniel Stenberg
ecf953432d configure: use cpp -P when needed
Since gcc 5, the processor output can get split up on multiple lines
that made the configure script fail to figure out values from
definitions. The fix is to use cpp -P, and this fix now first checks if
cpp -P is necessary and then if cpp -P works before it uses that to
extract defined values.

Fixes #719
2016-03-18 16:26:05 +01:00
Steve Holme
7e312bdfdd formdata.c: Fixed compilation warning
formdata.c:390: warning: cast from pointer to integer of different size

Introduced in commit ca5f9341ef this happens because a char*, which is
32-bits wide in 32-bit land, is being cast to a curl_off_t which is
64-bits wide where 64-bit integers are supported by the compiler.

This doesn't happen in 64-bit land as a pointer is the same size as a
curl_off_t.

This fix doesn't address the fact that a 64-bit value cannot be used
for CURLFORM_CONTENTLEN when set in a form array and compiled on a
32-bit platforms, it does at least suppress the compilation warning.
2016-03-18 07:19:31 +00:00
Daniel Stenberg
9c2cbc104d FAQ: 2.5 Install libcurl for both 32bit and 64bit? 2016-03-18 08:14:05 +01:00
Gisle Vanem
d816e8cf52 openssl: adapt to API breakage in ERR_remove_thread_state()
The OpenSSL API change that broke this is "Convert ERR_STATE to new
multi-threading API": openssl commit 8509dcc.

Closes #713
2016-03-17 10:42:33 +01:00
Daniel Stenberg
8d9d03a157 version: init moved to private name space, added protos
follow-up to 80015cdd52145
2016-03-17 00:55:46 +01:00
Daniel Stenberg
5f5b626357 openssl: verbose: show matching SAN pattern
... to allow users to see which specfic wildcard that matched when such
is used.

Also minor logic cleanup to simplify the code, and I removed all tabs
from verbose strings.
2016-03-17 00:49:02 +01:00
Jay Satiro
80015cdd52 version: thread safety 2016-03-16 19:13:42 -04:00
Steve Holme
0e18b8b107 transfer: Removed redundant HTTP authentication include files
It would also seem that share.h is not required here either as there
are no references to the Curl_share structure or functions.
2016-03-16 07:13:16 +00:00
Steve Holme
cd869cf1c1 easy: Removed redundant HTTP authentication include files 2016-03-16 06:59:42 +00:00
Jay Satiro
732983eb41 CURLOPT_SSLENGINE.3: Only for OpenSSL built with engine support
Bug: https://curl.haxx.se/mail/lib-2016-03/0150.html
Reported-by: Oliver Graute
2016-03-15 16:00:36 -04:00
Steve Holme
3ccc2621a1 curl_sasl: Minor code indent fixes 2016-03-15 06:47:13 +00:00
Daniel Stenberg
42a93d4364 runtests: mention when run event-based 2016-03-14 15:39:16 +01:00
Daniel Stenberg
b51f04bf23 easy: add check to malloc() when running event-based
... to allow torture tests then too.
2016-03-14 15:37:03 +01:00
Daniel Stenberg
6a353b105a memdebug: skip logging the limit countdown, fflush when reached 2016-03-14 15:36:40 +01:00
Daniel Stenberg
0fc73d364e CODE_STYLE: Space around operators
As just discussed on the mailing list, also document how we prefer
spacing in expressions.
2016-03-14 14:31:14 +01:00
Daniel Stenberg
4ef6d6b1bc curl: glob_range: no need to check unsigned variable for negative
cppcheck warned:

[src/tool_urlglob.c:283]: (style) Checking if unsigned variable 'step_n'
is less than zero.
2016-03-14 10:51:25 +01:00
Daniel Stenberg
2ad3cf2fba CODE_STYLE: add example for indent style as well 2016-03-14 10:40:02 +01:00
Daniel Stenberg
c5c7a3e40f CODE_STYLE: mention braces for functions too 2016-03-14 10:36:51 +01:00
Daniel Stenberg
519835c4b0 docs/Makefile.am: include CODE_STYLE in tarball too 2016-03-14 10:31:36 +01:00
Daniel Stenberg
1b3d736ae3 CONTRIBUTE: moved out code style to a separate document 2016-03-14 10:31:00 +01:00
Daniel Stenberg
303bf719ff CODE_STYLE: initial version
Ripped out from CONTRIBUTE into its own document, but also extended from
there.
2016-03-14 10:28:54 +01:00
Daniel Stenberg
3c6238b3eb curl_sasl.c: minor code indent fixes 2016-03-14 09:55:38 +01:00
Daniel Stenberg
c3aca6ed47 multi: simplified singlesocket
Since sh_getentry() now checks for invalid sockets itself and by
narrowing the scope of the remove_sock_from_hash variable.
2016-03-14 09:44:14 +01:00
Daniel Stenberg
8eaf884417 multi: introduce sh_getentry() for looking up sockets in the sockhash
Simplify the code by using a single entry that looks for a socket in the
socket hash. As indicated in #712, the code looked for CURL_SOCKET_BAD
at some point and that is ineffective/wrong and this makes it easier to
avoid that.
2016-03-14 09:18:01 +01:00
Jaime Fullaondo
c0717a7059 multi hash: ensure modulo performed on curl_socket_t
Closes #712
2016-03-14 08:16:52 +01:00
Steve Holme
5dc43b975b base64: Minor coding standard and style updates 2016-03-13 17:59:06 +00:00
Steve Holme
0e16de870f base64: Use 'CURLcode result' for curl result codes 2016-03-13 17:14:57 +00:00
Steve Holme
9eb158821f negotiate: Use 'CURLcode result' for curl result codes 2016-03-13 17:09:58 +00:00
Maksim Kuzevanov
d7e3942814 multi_runsingle: avoid loop in CURLM_STATE_WAITPROXYCONNECT
Closes #703
2016-03-13 12:41:17 +01:00
Daniel Stenberg
d807fbd66d TODO: Use the RFC6265 test suite 2016-03-13 11:02:06 +01:00
Steve Holme
a8c7f0fcbf checksrc.bat: Added the ability to scan src and lib source independently 2016-03-13 01:01:33 +00:00
Steve Holme
e4a0a9ef18 digest: Use boolean based success code for Curl_sasl_digest_get_pair()
Rather than use a 0 and 1 integer base result code use a TRUE / FALSE
based success code.
2016-03-12 17:25:15 +00:00
Steve Holme
a7a653fd58 digest: Corrected some typos in comments 2016-03-12 13:20:03 +00:00
Steve Holme
f0fbd099b4 krb5: Corrected some typos in function descriptions 2016-03-12 11:59:52 +00:00
Steve Holme
dbb90e7e9f ntlm: Corrected some typos in function descriptions 2016-03-12 11:56:10 +00:00
Steve Holme
06ccaa0c68 url: Corrected indentation when calling idna_to_ascii_lz() 2016-03-11 07:46:09 +00:00
Steve Holme
58e4a06743 idn_win32: Use boolean based success codes
Rather than use 0 and 1 integer base result codes use a FALSE / TRUE
based success code.
2016-03-11 07:24:39 +00:00
Daniel Stenberg
b084173989 idn_win32.c: warning: Trailing whitespace 2016-03-10 23:32:45 +01:00
Steve Holme
28477fd67a idn_win32.c: Fixed compilation warning from commit 9e7fcd4291
warning C4267: 'function': conversion from 'size_t' to 'int',
               possible loss of data
2016-03-10 21:52:09 +00:00
Daniel Stenberg
eab769518e THANKS-filter: unify Michael König 2016-03-10 14:10:05 +01:00
Daniel Stenberg
53e2ca6896 RELEASE-NOTES: synced with 863c5766dd 2016-03-10 14:09:44 +01:00
Daniel Stenberg
863c5766dd ftp: remove a check for NULL(!)
... as it implies we need to check for that on all the other variable
references as well (as Coverity otherwise warns us for missing NULL
checks), and we're alredy making sure that the pointer is never NULL.
2016-03-10 13:52:22 +01:00
Daniel Stenberg
7f7fcd0d75 cookies: first n/v pair in Set-Cookie: is the cookie, then parameters
RFC 6265 section 4.1.1 spells out that the first name/value pair in the
header is the actual cookie name and content, while the following are
the parameters.

libcurl previously had a more liberal approach which causes significant
problems when introducing new cookie parameters, like the suggested new
cookie priority draft.

The previous logic read all n/v pairs from left-to-right and the first
name used that wassn't a known parameter name would be used as the
cookie name, thus accepting "Set-Cookie: Max-Age=2; person=daniel" to be
a cookie named 'person' while an RFC 6265 compliant parser should
consider that to be a cookie named 'Max-Age' with an (unknown) parameter
'person'.

Fixes #709
2016-03-10 11:26:12 +01:00
Daniel Stenberg
4d4ce84bb3 krb5: improved type handling to avoid clang compiler warnings 2016-03-10 10:40:10 +01:00
Daniel Stenberg
549b1a433a url.c: fix clang warning: no newline at end of file 2016-03-10 09:36:49 +01:00
Daniel Stenberg
77e1726719 curl_multi_wait: never return -1 in 'numfds'
Such a return value isn't documented but could still happen, and the
curl tool code checks for it. It would happen when the underlying
Curl_poll() function returns an error. Starting now we mask that error
as a user of curl_multi_wait() would have no way to handle it anyway.

Reported-by: Jay Satiro
Closes #707
2016-03-10 08:17:25 +01:00
Daniel Stenberg
b6665c7a44 HTTP2.md: add CURL_HTTP_VERSION_2TLS and updated alt-svc link 2016-03-09 11:09:39 +01:00
Daniel Stenberg
b7f3fe125a curl_multi_wait.3: add example 2016-03-09 08:35:17 +01:00
Steve Holme
a5aec58726 imap/pop3/smtp: Fixed connections upgraded with TLS are not reused
Regression since commit 710f14edba.

Bug: https://github.com/curl/curl/issues/422
Reported-by: Justin Ehlert
2016-03-08 19:36:46 +00:00
Jay Satiro
307f3cf3b3 opt-docs: fix heading macros
..SH should be .SH

Bug: https://github.com/curl/curl/issues/705
Reported-by: Eric S. Raymond
2016-03-08 13:23:35 -05:00
Tim Rühsen
c140bd7891 cookie: do not refuse cookies for localhost
Closes #658
2016-03-08 15:27:43 +01:00
Daniel Stenberg
cb222bcfef ftp_done: clear tunnel_state when secondary socket closes
Introducing a function for closing the secondary connection to make this
bug less likely to happen again.

Reported-by: daboul
Closes #701
2016-03-08 15:00:53 +01:00
Gisle Vanem
a7ec58a89f openssl: use the correct OpenSSL/BoringSSL/LibreSSL in messages 2016-03-08 14:19:01 +01:00
Daniel Stenberg
f0a6929553 HTTP2.md: HTTP/2 by default for curl's HTTPS connections 2016-03-08 08:15:47 +01:00
Anders Bakken
46bf7ff78d pipeline: Sanity check pipeline pointer before accessing it.
I got a crash with this stack:

curl/lib/url.c:2873 (Curl_removeHandleFromPipeline)
curl/lib/url.c:2919 (Curl_getoff_all_pipelines)
curl/lib/multi.c:561 (curl_multi_remove_handle)
curl/lib/url.c:415 (Curl_close)
curl/lib/easy.c:859 (curl_easy_cleanup)

Closes #704
2016-03-08 00:25:53 +01:00
Daniel Stenberg
7e8b65c00b HTTP2.md: mention the disable ALPN and NPN options 2016-03-08 00:08:31 +01:00
Daniel Stenberg
52a0b934ef TODO: 17.12 keep running, read instructions from pipe/socket
And delete trailing whitespace
And rename section 17 to "command line tool" from "client"

Closes #702
2016-03-07 23:21:50 +01:00
Daniel Stenberg
d42dbe6423 README.md: linkified
It also makes it less readable as plain text, so let's keep this
primarily for github use.

Removed the top ascii art logo, as it looks weird when markdownified.
2016-03-07 11:09:56 +01:00
Daniel Stenberg
01ccac8773 README.md: markdown version of README
Attempt to make it look more appealing on github
2016-03-07 11:03:55 +01:00
Jay Satiro
1e58922f1e mprintf: update trio project link 2016-03-06 22:57:47 -05:00
Daniel Stenberg
b90f9fa5ee CURLOPT_ACCEPTTIMEOUT_MS.3: added example 2016-03-06 23:33:18 +01:00
Daniel Stenberg
4da5e65dee CURLOPT_ACCEPT_ENCODING.3: added example 2016-03-06 23:30:42 +01:00
Daniel Stenberg
c13a54a2fb CURLOPT_APPEND.3: added example 2016-03-06 23:28:35 +01:00
Daniel Stenberg
4ce153c62c CURLOPT_NOPROGRESS.3: added example, conform to stardard style 2016-03-06 23:14:23 +01:00
Steve Holme
8f9be011b1 build-openssl/checksrc.bat: Fixed prepend vs append of Perl path
Fixed inconsistency from commit 1eae114065 and 0ad6c72227 of the order
in which Perl was added to the PATH.
2016-03-06 20:02:58 +00:00
Daniel Stenberg
66fa069f1b opts: added two examples 2016-03-06 17:42:37 +01:00
Daniel Stenberg
ad90a9d9d1 CURLOPT_SSL_CTX_FUNCTION.3: use .NF for example 2016-03-06 17:20:16 +01:00
Daniel Stenberg
aed91f3a7c CURLOPT_SSL_CTX_FUNCTION.3: added example
and removed erroneous reference to test case lib509
2016-03-06 16:59:06 +01:00
Daniel Stenberg
530234b325 curlx.c: use more curl style code 2016-03-06 16:54:58 +01:00
Daniel Stenberg
e6293cf876 test46: change cookie expiry date
Since two of the cookies would now otherwise expire and cause the test
to fail after commit 20de9b4f09

Discussed in #697
2016-03-06 16:22:49 +01:00
Viktor Szakats
6c7a5b9603 makefile.m32: add missing libs for static -winssl-ssh2 builds
Bug: https://github.com/curl/curl/pull/693
2016-03-05 21:50:12 -05:00
Jay Satiro
81bdd85318 mbedtls: fix user-specified SSL protocol version
Prior to this change when a single protocol CURL_SSLVERSION_ was
specified by the user that version was set only as the minimum version
but not as the maximum version as well.
2016-03-05 21:39:36 -05:00
Steve Holme
b188fe407d .gitignore: Added *.VC.opendb and *.vcxproj.user files for VC14 2016-03-05 21:49:09 +00:00
Steve Holme
1eae114065 build-openssl.bat: Fixed cannot find perl if installed but not in path 2016-03-05 21:40:53 +00:00
Steve Holme
0ad6c72227 checksrc.bat: Fixed cannot find perl if installed but not in path 2016-03-05 21:40:53 +00:00
Viktor Szakats
05401b9a3b makefile.m32: fix to allow -ssh2-winssl combination
In makefile.m32, option -ssh2 (libssh2) automatically implied -ssl
(OpenSSL) option, with no way to override it with -winssl. Since both
libssh2 and curl support using Windows's built-in SSL backend, modify
the logic to allow that combination.
2016-03-05 13:40:34 -05:00
Jay Satiro
20de9b4f09 cookie: Don't expire session cookies in remove_expired
Prior to this change cookies with an expiry date that failed parsing
and were converted to session cookies could be purged in remove_expired.

Bug: https://github.com/curl/curl/issues/697
Reported-by: Seth Mos
2016-03-05 13:35:17 -05:00
Daniel Stenberg
33a0a926c5 cookie: remove redundant check
... as it was already checked previously within the function.

Reported-by: Dmitry-Me
Closes #695
2016-03-03 21:16:06 +01:00
Anders Bakken
3c2ef2a610 url: if Curl_done is premature then pipeline not in use
Prevent a crash if 2 (or more) requests are made to the same host and
pipelining is enabled and the connection does not complete.

Bug: https://github.com/curl/curl/pull/690
2016-03-01 18:55:04 -05:00
Viktor Szakats
d678bd6f60 makefile.m32: allow to pass .dll/.exe-specific LDFLAGS
using envvars `CURL_LDFLAG_EXTRAS_DLL` and
`CURL_LDFLAG_EXTRAS_EXE` respectively. This
is useful f.e. to pass ASLR-related extra
options, that are required to make this
feature work when using the mingw toolchain.

Ref: https://github.com/curl/curl/pull/670#issuecomment-190863985

Closes https://github.com/curl/curl/pull/689
2016-03-01 17:46:16 -05:00
Daniel Stenberg
c2a809cd26 formpost: fix memory leaks in AddFormData error branches
Reported-by: Dmitry-Me
Fixes #688
2016-02-29 20:32:08 +01:00
Jay Satiro
ae7d6b7154 getinfo: Fix syntax error when mbedTLS
The assignment of the mbedTLS TLS session info in the parent commit was
incorrect. Change the assignment to a pointer to the session structure.
2016-02-28 16:05:38 -05:00
Jay Satiro
2e0a3b935c getinfo: Add support for mbedTLS TLS session info
.. and preprocessor check TLS session info is defined for all backends.
2016-02-27 19:01:00 -05:00
Daniel Stenberg
6f1735926f ROADMAP: clarify on the TLS proxy, mention HTTP cookies to work on 2016-02-26 13:02:34 +01:00
Daniel Stenberg
1e486db9c2 file: try reading from files with no size
Some systems have special files that report as 0 bytes big, but still
contain data that can be read (for example /proc/cpuinfo on
Linux). Starting now, a zero byte size is considered "unknown" size and
will be read as far as possible anyway.

Reported-by: Jesse Tan

Closes #681
2016-02-25 23:45:17 +01:00
Jay Satiro
3ae77f079a configure: warn on invalid ca bundle or path
- Warn if --with-ca-bundle file does not exist.

- Warn if --with-ca-path directory does not contain certificates.

- Improve help messages for both.

Example configure output:

  ca cert bundle:   /some/file   (warning: certs not found)
  ca cert path:     /some/dir   (warning: certs not found)

Bug: https://github.com/curl/curl/issues/404
Reported-by: Jeffrey Walton
2016-02-25 01:55:38 -05:00
Daniel Stenberg
46bf7996f4 Curl_read: check for activated HTTP/1 pipelining, not only requested
... as when pipelining is used, we read things into a unified buffer and
we don't do that with HTTP/2. This could then easily make programs that
set CURLMOPT_PIPELINING = CURLPIPE_HTTP1|CURLPIPE_MULTIPLEX to get data
intermixed or plain broken between HTTP/2 streams.

Reported-by: Anders Bakken
2016-02-24 14:20:57 +01:00
Patrick Monnerat
cac8c3206f os400: Fix ILE/RPG definition of CURLOPT_TFTP_NO_OPTIONS 2016-02-24 13:19:10 +01:00
Jay Satiro
332414a30e getinfo: CURLINFO_TLS_SSL_PTR supersedes CURLINFO_TLS_SESSION
The two options are almost the same, except in the case of OpenSSL:

CURLINFO_TLS_SESSION OpenSSL session internals is SSL_CTX *.

CURLINFO_TLS_SSL_PTR OpenSSL session internals is SSL *.

For backwards compatibility we couldn't modify CURLINFO_TLS_SESSION to
return an SSL pointer for OpenSSL.

Also, add support for the 'internals' member to point to SSL object for
the other backends axTLS, PolarSSL, Secure Channel, Secure Transport and
wolfSSL.

Bug: https://github.com/curl/curl/issues/234
Reported-by: dkjjr89@users.noreply.github.com

Bug: https://curl.haxx.se/mail/lib-2015-09/0127.html
Reported-by: Michael König
2016-02-23 19:03:03 -05:00
Daniel Stenberg
3438ce7f46 multi_remove_handle: keep the timeout list until after disconnect
The internal Curl_done() function uses Curl_expire() at times and that
uses the timeout list. Better clean up the list once we're done using
it. This caused a segfault.

Reported-by: 蔡文凱
Bug: https://curl.haxx.se/mail/lib-2016-02/0097.html
2016-02-23 13:08:11 +01:00
Kamil Dudka
effa575fc7 tests/sshserver.pl: use RSA instead of DSA for host auth
DSA is no longer supported by OpenSSH 7.0, which causes all SCP/SFTP
test cases to be skipped.  Using RSA for host authentication works with
both old and new versions of OpenSSH.

Reported-by: Karlson2k

Closes #676
2016-02-23 11:55:18 +01:00
Jay Satiro
186546f1c5 TFTP: add option to suppress TFTP option requests (Part 2)
- Add tests.

- Add an example to CURLOPT_TFTP_NO_OPTIONS.3.

- Add --tftp-no-options to expose CURLOPT_TFTP_NO_OPTIONS.

Bug: https://github.com/curl/curl/issues/481
2016-02-23 03:01:07 -05:00
Michael Koenig
9dc3eaee29 TFTP: add option to suppress TFTP option requests (Part 1)
Some TFTP server implementations ignore the "TFTP Option extension"
(RFC 1782-1784, 2347-2349), or implement it in a flawed way, causing
problems with libcurl. Another switch for curl_easy_setopt
"CURLOPT_TFTP_NO_OPTIONS" is introduced which prevents libcurl from
sending TFTP option requests to a server, avoiding many problems caused
by faulty implementations.

Bug: https://github.com/curl/curl/issues/481
2016-02-23 03:00:58 -05:00
Karlson2k
527e86b054 runtests: Fixed usage of %PWD on MinGW64
Closes #672
2016-02-22 00:07:32 +01:00
Jay Satiro
2ac3f427f7 CURLOPT_DEBUGFUNCTION.3: Fix example 2016-02-20 16:23:05 -05:00
Viktor Szakats
91cfcc5d6f src/Makefile.m32: add CURL_{LD,C}FLAGS_EXTRAS support
Sync with lib/Makefile.m32 which already uses those variables.

Bug: https://github.com/curl/curl/pull/670
2016-02-20 15:45:39 -05:00
Dan Fandrich
e50674ad28 Enabled test 1437 after the bug fix in commit 3fa220a6 2016-02-20 11:34:15 +01:00
Emil Lerner
3fa220a6a5 curl_sasl: Fix memory leak in digest parser
If any parameter in a HTTP DIGEST challenge message is present multiple
times, memory allocated for all but the last entry should be freed.

Bug: https://github.com/curl/curl/pull/667
2016-02-19 21:52:05 -05:00
Dan Fandrich
fe37695aa9 Added test 1437 to verify a memory leak
Reported-by: neex@users.noreply.github.com
2016-02-19 10:45:09 +01:00
Jay Satiro
bdaaba5315 CURLOPT_COOKIEFILE.3: HTTP headers must be Set-Cookie style
Bug: https://github.com/curl/curl/issues/666
Reported-by: baumanj@users.noreply.github.com
2016-02-18 21:07:57 -05:00
Jay Satiro
a11c5f329f curl.1: HTTP headers for --cookie must be Set-Cookie style
Bug: https://github.com/curl/curl/issues/666
Reported-by: baumanj@users.noreply.github.com
2016-02-18 19:01:19 -05:00
Daniel Stenberg
be2db60650 curl.1: add a missing dash 2016-02-18 15:32:00 +01:00
Daniel Stenberg
414055dc6d CONTRIBUTING.md: fix links 2016-02-18 11:59:17 +01:00
Daniel Stenberg
b7cd7aabd4 ISSUE_TEMPLATE: github issue template
First version, try this out!
2016-02-18 11:55:59 +01:00
Daniel Stenberg
4c6ca527b0 CONTRIBUTING.md: move into .github
To hide github specific files somewhat from the rest.
2016-02-18 11:52:25 +01:00
Daniel Stenberg
091dee8631 opts: add references 2016-02-18 09:14:48 +01:00
Daniel Stenberg
435f6bcc86 examples/make: add 'checksrc' target 2016-02-17 15:01:38 +01:00
Daniel Stenberg
e8748bc1d7 10-at-a-time: typecast the argument passed to sleep() 2016-02-17 15:01:21 +01:00
Daniel Stenberg
e624714cad externalsocket.c: fix compiler warning for fwrite return type 2016-02-17 15:00:54 +01:00
Daniel Stenberg
32e38b8f42 anyauthput.c: fix compiler warnings 2016-02-17 15:00:34 +01:00
Daniel Stenberg
0c671a1501 simplessl.c: warning: while with space 2016-02-17 15:00:18 +01:00
Daniel Stenberg
9ae7030cef curlx.c: i2s_ASN1_IA5STRING() clashes with an openssl function
Reported-By: Gisle Vanem
2016-02-17 14:51:31 +01:00
Daniel Stenberg
eb083e0d39 http2: don't decompress gzip decoding automatically
At one point during the development of HTTP/2, the commit 133cdd29ea0
introduced automatic decompression of Content-Encoding as that was what
the spec said then. Now however, HTTP/2 should work the same way as
HTTP/1 in this regard.

Reported-by: Kazuho Oku

Closes #661
2016-02-17 08:25:40 +01:00
Tatsuhiro Tsujikawa
b080a7cd06 http: Don't break the header into chunks if HTTP/2
nghttp2 callback deals with TLS layer and therefore the header does not
need to be broken into chunks.

Bug: https://github.com/curl/curl/issues/659
Reported-by: Kazuho Oku
2016-02-16 14:49:12 -05:00
Viktor Szakats
71398487e7 openssl: use macro to guard the opaque EVP_PKEY branch 2016-02-16 00:29:36 +01:00
Viktor Szakats
ae01698ea4 openssl: avoid direct PKEY access with OpenSSL 1.1.0
by using API instead of accessing an internal structure.
This is required starting OpenSSL 1.1.0-pre3.

Closes #650
2016-02-16 00:29:24 +01:00
Daniel Stenberg
569a37efe0 RELEASE-NOTES: synced with ede0bfc079da 2016-02-15 10:20:05 +01:00
Clint Clayton
ede0bfc079 CURLOPT_CONNECTTIMEOUT_MS.3: Fix example to use milliseconds option
Change the example in the docs for CURLOPT_CONNECTTIMEOUT_MS to use
CURLOPT_CONNECTTIMEOUT_MS instead of CURLOPT_CONNECTTIMEOUT.

Closes #653
2016-02-14 22:38:12 +01:00
Daniel Stenberg
a87cb257b4 opt-docs: add more references 2016-02-14 15:54:47 +01:00
David Byron
cae21ffc16 SCP: use libssh2_scp_recv2 to support > 2GB files on windows
libssh2_scp_recv2 is introduced in libssh2 1.7.0 - to be released "any
day now.

Closes #451
2016-02-14 11:03:07 +01:00
Shine Fan
078753c40d gtls: fix for builds lacking encrypted key file support
Bug: https://github.com/curl/curl/pull/651
2016-02-13 22:21:32 -05:00
Dan Fandrich
0443187611 test1604: Add to Makefile.inc so it gets run 2016-02-13 22:49:45 +01:00
Jay Satiro
464a1d03bd generate.bat: Fix comment bug by removing old comments
Remove NOTES section, it's no longer needed since we aren't setting the
errorlevel and more importantly the recently updated URL in the comments
is causing some unusual behavior that breaks the script.

Closes https://github.com/curl/curl/issues/649
2016-02-12 23:48:54 -05:00
Kamil Dudka
4ef6b2d6c6 curl.1: --disable-{eprt,epsv} are ignored for IPv6 hosts
The behavior has been clarified in CURLOPT_FTP_USE_{EPRT,EPSV}.3 man
pages since curl-7_12_3~131.  This patch makes it clear in the curl.1
man page, too.

Bug: https://bugzilla.redhat.com/1305970
2016-02-12 18:47:17 +01:00
Daniel Stenberg
50525f4f40 dist: ship buildconf.bat too
As the winbuild/* stuff uses it!
2016-02-12 16:45:25 +01:00
Daniel Stenberg
d6b37d83f9 curlx_tvdiff: handle 32bit time_t overflows
On 32bit systems, make sure we don't overflow and return funky values
for very large time differences.

Reported-by: Anders Bakken

Closes #646
2016-02-12 08:13:03 +01:00
Daniel Stenberg
d202fbcc00 examples: fix some compiler warnings 2016-02-11 10:21:09 +01:00
Daniel Stenberg
888e4b6821 simplessl.c: fix my breakage 2016-02-11 10:20:48 +01:00
Daniel Stenberg
3a6563d668 examples: adhere to curl code style
All plain C examples now (mostly) adhere to the curl code style. While
they are only examples, they had diverted so much and contained all
sorts of different mixed code styles by now. Having them use a unified
style helps users and readability. Also, as they get copy-and-pasted
widely by users, making sure they're clean and nice is a good idea.

573 checksrc warnings were addressed.
2016-02-11 09:44:45 +01:00
Daniel Stenberg
936d8f07df examples/cookie_interface.c: add cleanup call
cleaning up handles is a good idea as we leak memory otherwise

Also, line wrapped before 80 columns.
2016-02-11 08:44:59 +01:00
Kamil Dudka
64fa3b8d64 nss: search slash in forward direction in dup_nickname()
It is wasteful to search it backwards if we look for _any_ slash.
2016-02-10 18:58:49 +01:00
Kamil Dudka
6390e65664 nss: do not count enabled cipher-suites
We only care if at least one cipher-suite is enabled, so it does
not make any sense to iterate till the end and count all enabled
cipher-suites.
2016-02-10 18:58:48 +01:00
Daniel Stenberg
5f835fb266 contributors.sh: make 79 the max column width (from 80) 2016-02-10 13:49:42 +01:00
Daniel Stenberg
3a47657648 RELEASE-NOTES: synced with c276aefee3995 2016-02-10 13:49:34 +01:00
Daniel Stenberg
c276aefee3 mbedtls.c: re-indent to better match curl standards 2016-02-10 10:46:57 +01:00
Rafael Antonio
c62d7944cf mbedtls: fix memory leak when destroying SSL connection data
Closes #626
2016-02-09 23:42:57 +01:00
Daniel Stenberg
716302c2cd mbedtls: fix ALPN usage segfault
Since we didn't keep the input argument around after having called
mbedtls, it could end up accessing the wrong memory when figuring out
the ALPN protocols.

Closes #642
2016-02-09 23:37:14 +01:00
Timotej Lazar
50cd9c8aa1 opts: update references to renamed options 2016-02-09 14:19:31 -05:00
Jay Satiro
d9128de617 KNOWN_BUGS: Update #92 - Windows device prefix 2016-02-09 03:29:19 -05:00
Jay Satiro
4fc80f3e75 tool_doswin: Support for literal path prefix \\?\
For example something like --output \\?\C:\foo
2016-02-09 03:28:58 -05:00
Daniel Stenberg
6b64d735cd configure: state "BoringSSL" in summary when that was detected 2016-02-09 08:46:36 +01:00
David Benjamin
39c803cba2 openssl: remove most BoringSSL #ifdefs.
As of https://boringssl-review.googlesource.com/#/c/6980/, almost all of
BoringSSL #ifdefs in cURL should be unnecessary:

- BoringSSL provides no-op stubs for compatibility which replaces most
  #ifdefs.

- DES_set_odd_parity has been in BoringSSL for nearly a year now. Remove
  the compatibility codepath.

- With a small tweak to an extend_key_56_to_64 call, the NTLM code
  builds fine.

- Switch OCSP-related #ifdefs to the more generally useful
  OPENSSL_NO_OCSP.

The only #ifdefs which remain are Curl_ossl_version and the #undefs to
work around OpenSSL and wincrypt.h name conflicts. (BoringSSL leaves
that to the consumer. The in-header workaround makes things sensitive to
include order.)

This change errs on the side of removing conditionals despite many of
the restored codepaths being no-ops. (BoringSSL generally adds no-op
compatibility stubs when possible. OPENSSL_VERSION_NUMBER #ifdefs are
bad enough!)

Closes #640
2016-02-09 08:46:36 +01:00
Jay Satiro
674b57e76b KNOWN_BUGS: Windows device prefix is required for devices 2016-02-08 17:40:53 -05:00
Jay Satiro
c3aac48919 tool_urlglob: Allow reserved dos device names (Windows)
Allow --output to reserved dos device names without the device prefix
for backwards compatibility.

Example: --output NUL can be used instead of --output \\.\NUL

Bug: https://github.com/curl/curl/commit/4520534#commitcomment-15954863
Reported-by: Gisle Vanem
2016-02-08 15:09:42 -05:00
Daniel Stenberg
18c735e790 cookies: allow spaces in cookie names, cut of trailing spaces
It turns out Firefox and Chrome both allow spaces in cookie names and
there are sites out there using that.

Turned out the code meant to strip off trailing space from cookie names
didn't work. Fixed now.

Test case 8 modified to verify both these changes.

Closes #639
2016-02-08 15:49:54 +01:00
Patrick Monnerat
c4303fd5bb Merge branch 'master' of github.com:curl/curl 2016-02-08 14:52:18 +01:00
Patrick Monnerat
8893a45e76 os400: sync ILE/RPG definitions with latest public header files. 2016-02-08 14:50:53 +01:00
Ludwig Nussel
e49ab0a3b8 SSLCERTS: update wrt SSL CA certificate store 2016-02-08 14:45:58 +01:00
Ludwig Nussel
7b55279d1d configure: --with-ca-fallback: use built-in TLS CA fallback
When trying to verify a peer without having any root CA certificates
set, this makes libcurl use the TLS library's built in default as
fallback.

Closes #569
2016-02-08 14:45:58 +01:00
Daniel Stenberg
113f04e664 Proxy-Connection: stop sending this header by default
RFC 7230 says we should stop. Firefox already stopped.

Bug: https://github.com/curl/curl/issues/633
Reported-By: Brad Fitzpatrick

Closes #633
2016-02-08 11:09:40 +01:00
Daniel Stenberg
7f97fd5a83 bump: work toward the next release 2016-02-08 10:47:44 +01:00
Daniel Stenberg
c18e86cb4f THANKS: 2 contributors from the 7.47.1 release 2016-02-08 10:46:01 +01:00
Daniel Stenberg
108bc5d860 RELEASE-PROCEDURE: remove the github upload part
... as we're HTTPS on the main site now, there's no point in that
extra step
2016-02-08 10:35:35 +01:00
Daniel Stenberg
8f995e2e00 RELEASE-NOTES: curl 7.47.1 time! 2016-02-08 10:26:24 +01:00
Jay Satiro
d572d2664d tool_operhlp: Check for backslashes in get_url_file_name
Extract the filename from the last slash or backslash. Prior to this
change backslashes could be part of the filename.

This change needed for the curl tool built for Cygwin. Refer to the
CYGWIN addendum in advisory 20160127B.

Bug: https://curl.haxx.se/docs/adv_20160127B.html
2016-02-08 03:14:04 -05:00
Daniel Stenberg
b97307047c RELEASE-NOTES: synced with d6a8869ea34 2016-02-07 16:20:23 +01:00
Jay Satiro
d6a8869ea3 openssl: Fix signed/unsigned mismatch warning in X509V3_ext
sk_X509_EXTENSION_num may return an unsigned integer, however the value
will fit in an int.

Bug: https://github.com/curl/curl/commit/dd1b44c#commitcomment-15913896
Reported-by: Gisle Vanem
2016-02-06 19:10:49 -05:00
Daniel Stenberg
1ca54daf3e TODO: 17.11 -w output to stderr 2016-02-07 00:27:36 +01:00
Michael Kaufmann
9e7fcd4291 idn_win32: Better error checking
.. also fix a conversion bug in the unused function
curl_win32_ascii_to_idn().

And remove wprintfs on error (Jay).

Bug: https://github.com/curl/curl/pull/637
2016-02-06 17:51:51 -05:00
Gisle Vanem
c71b6a2795 examples/asiohiper: Avoid function name collision on Windows
closesocket => close_socket
Winsock already has the former.

Bug: https://curl.haxx.se/mail/lib-2016-02/0016.html
2016-02-06 17:04:38 -05:00
Gisle Vanem
6f702ebaa2 examples/htmltitle: Use _stricmp on Windows
Bug: https://curl.haxx.se/mail/lib-2016-02/0017.html
2016-02-06 17:02:55 -05:00
Daniel Stenberg
86d3d62f5a COPYING: clarify that Daniel is not the sole author
... done on request and as it is a fair point.
2016-02-06 18:40:27 +01:00
Jay Satiro
a6208704e7 unit1604: Fix unit setup return code 2016-02-05 13:37:39 -05:00
Jay Satiro
9b6598ed08 tool_doswin: Use type SANITIZEcode in sanitize_file_name 2016-02-05 02:22:24 -05:00
Jay Satiro
4520534e6d tool_doswin: Improve sanitization processing
- Add unit test 1604 to test the sanitize_file_name function.

- Use -DCURL_STATICLIB when building libcurltool for unit testing.

- Better detection of reserved DOS device names.

- New flags to modify sanitize behavior:

SANITIZE_ALLOW_COLONS: Allow colons
SANITIZE_ALLOW_PATH: Allow path separators and colons
SANITIZE_ALLOW_RESERVED: Allow reserved device names
SANITIZE_ALLOW_TRUNCATE: Allow truncating a long filename

- Restore sanitization of banned characters from user-specified outfile.

Prior to this commit sanitization of a user-specified outfile was
temporarily disabled in 2b6dadc because there was no way to allow path
separators and colons through while replacing other banned characters.
Now in such a case we call the sanitize function with
SANITIZE_ALLOW_PATH which allows path separators and colons to pass
through.


Closes https://github.com/curl/curl/issues/624
Reported-by: Octavio Schroeder
2016-02-05 01:44:27 -05:00
Viktor Szakats
d49881cb19 URLs: change more http to https 2016-02-04 18:46:54 -05:00
Jay Satiro
742deff4dd sasl_sspi: Fix memory leak in domain populate
Free an existing domain before replacing it.

Bug: https://github.com/curl/curl/issues/635
Reported-by: silveja1@users.noreply.github.com
2016-02-04 18:11:07 -05:00
Viktor Szakats
20dcd19501 URLs: follow GitHub project rename (also Travis CI)
Closes #632
2016-02-04 23:01:38 +01:00
Daniel Stenberg
0515e49b6b CHANGES.o: fix references to curl.haxx.nu
I removed the scheme prefix from the URLs references this host name, as
we don't own/run that anymore but the name is kept for historic reasons.
2016-02-03 15:33:47 +01:00
Daniel Stenberg
42f725fb9b HISTORY: add some info about when we used which host names 2016-02-03 15:33:30 +01:00
Viktor Szakats
b4f595bde4 URLs: change more http to https 2016-02-02 22:29:47 -05:00
Dan Fandrich
093f9cd38d URLs: Change more haxx.se URLs from http: to https: 2016-02-03 01:45:21 +01:00
Daniel Stenberg
493f54c6c0 RELEASE-NOTES: synced with 4af40b364 2016-02-03 00:32:07 +01:00
Daniel Stenberg
4af40b3646 URLs: change all http:// URLs to https:// 2016-02-03 00:19:02 +01:00
Daniel Stenberg
d33dd0b195 configure: update the copyright year range in output 2016-02-02 22:49:05 +01:00
Daniel Stenberg
41ae9f717a dotdot: allow an empty input string too
It isn't used by the code in current conditions but for safety it seems
sensible to at least not crash on such input.

Extended unit test 1395 to verify this too as well as a plain "/" input.
2016-02-02 22:43:54 +01:00
Daniel Stenberg
6b485c7407 HTTPS: update a bunch of URLs from HTTP to HTTPS 2016-02-02 00:24:30 +01:00
Sergei Nikulov
7a8a7ca7b0 AppVeyor: updated to handle OpenSSL/WinSSL builds
Closes #621
2016-02-01 23:55:08 +01:00
Jay Satiro
2b6dadc52d tool_operate: Don't sanitize --output path (Windows)
Due to path separators being incorrectly sanitized in --output
pathnames, eg -o c:\foo => c__foo

This is a partial revert of 3017d8a until I write a proper fix. The
remote-name will continue to be sanitized, but if the user specified an
--output with string replacement (#1, #2, etc) that data is unsanitized
until I finish a fix.

Bug: https://github.com/bagder/curl/issues/624
Reported-by: Octavio Schroeder
2016-02-01 04:11:46 -05:00
Jay Satiro
96596334c8 curl.1: Explain remote-name behavior if file already exists
.. also warn about letting the server pick the filename.
2016-01-29 03:28:48 -05:00
Gisle Vanem
bdb465274f urldata: Error on missing SSL backend-specific connect info 2016-01-29 00:11:43 -05:00
Daniel Stenberg
300718382f bump: towards the next (7.47.1 ?) 2016-01-28 16:36:29 +01:00
Sergei Nikulov
a8135f0768 cmake: fixed when OpenSSL enabled on Windows and schannel detected
Closes #617
2016-01-28 16:34:01 +01:00
Sergei Nikulov
91460b2b8a urldata: moved common variable out of ifdef
Closes https://github.com/bagder/curl/pull/618
2016-01-28 03:01:51 -05:00
Viktor Szakats
1597af51b1 tool_doswin: silence unused function warning
tool_doswin.c:185:14: warning: 'msdosify' defined but not used
[-Wunused-function]

Closes https://github.com/bagder/curl/pull/616
2016-01-28 02:45:36 -05:00
Daniel Stenberg
e400a89b18 getredirect.c: fix variable name
Reported-by: Bernard Spil
2016-01-27 09:35:55 +01:00
Daniel Stenberg
06bf874bbc examples/Makefile.inc: specify programs without .c! 2016-01-27 08:30:04 +01:00
Daniel Stenberg
87a5d3d13e THANKS: 6 new contributors from 7.47.0 release notes 2016-01-26 23:45:02 +01:00
Isaac Boukris
d41dcba4e9 NTLM: Fix ConnectionExists to compare Proxy credentials
Proxy NTLM authentication should compare credentials when
re-using a connection similar to host authentication, as it
authenticate the connection.

Example:
curl -v -x http://proxy:port http://host/ -U good_user:good_pwd
  --proxy-ntlm --next -x http://proxy:port http://host/
    [-U fake_user:fake_pwd --proxy-ntlm]

CVE-2016-0755

Bug: http://curl.haxx.se/docs/adv_20160127A.html
2016-01-26 23:42:55 +01:00
Ray Satiro
3017d8a8d8 curl: avoid local drive traversal when saving file (Windows)
curl does not sanitize colons in a remote file name that is used as the
local file name. This may lead to a vulnerability on systems where the
colon is a special path character. Currently Windows/DOS is the only OS
where this vulnerability applies.

CVE-2016-0754

Bug: http://curl.haxx.se/docs/adv_20160127B.html
2016-01-26 23:42:55 +01:00
Daniel Stenberg
cea1fd7a94 RELEASE-NOTES: 7.47.0 2016-01-26 23:42:55 +01:00
Daniel Stenberg
14f92f2d2c FAQ: language fix in 4.19 2016-01-25 11:11:29 +01:00
paulehoffman
53d1e42c41 FAQ: Update to point to GitHub
Current FAQ didn't make it clear where the main repo is.

Closes #612
2016-01-24 23:29:01 +01:00
Daniel Stenberg
b9da2cfed1 maketgz: generate date stamp with LC_TIME=C
bug: http://curl.haxx.se/mail/lib-2016-01/0123.html
2016-01-24 20:31:30 +01:00
Daniel Stenberg
5a28126b22 curl_multi_socket_action.3: line wrap 2016-01-24 20:31:30 +01:00
Daniel Stenberg
1783070801 RELEASE-NOTES: synced with d58ba66eeceb 2016-01-24 20:31:30 +01:00
Steve Holme
b03f01742d TODO: "Create remote directories" for SMB 2016-01-21 21:05:55 +00:00
Jay Satiro
d58ba66eec mbedtls: Fix pinned key return value on fail
- Switch from verifying a pinned public key in a callback during the
certificate verification to inline after the certificate verification.

The callback method had three problems:

1. If a pinned public key didn't match, CURLE_SSL_PINNEDPUBKEYNOTMATCH
was not returned.

2. If peer certificate verification was disabled the pinned key
verification did not take place as it should.

3. (related to #2) If there was no certificate of depth 0 the callback
would not have checked the pinned public key.

Though all those problems could have been fixed it would have made the
code more complex. Instead we now verify inline after the certificate
verification in mbedtls_connect_step2.

Ref: http://curl.haxx.se/mail/lib-2016-01/0047.html
Ref: https://github.com/bagder/curl/pull/601
2016-01-18 03:48:10 -05:00
Jay Satiro
d566371130 tests: Add a test for pinnedpubkey fail even when insecure
Because disabling the peer verification (--insecure) must not disable
the public key pinning check (--pinnedpubkey).
2016-01-18 03:10:10 -05:00
Daniel Schauenberg
1074cca8cd CURLINFO_RESPONSE_CODE.3: add example 2016-01-16 23:05:07 -05:00
Kamil Dudka
be538e0766 ssh: make CURLOPT_SSH_PUBLIC_KEYFILE treat "" as NULL
The CURLOPT_SSH_PUBLIC_KEYFILE option has been documented to handle
empty strings specially since curl-7_25_0-31-g05a443a but the behavior
was unintentionally removed in curl-7_38_0-47-gfa7d04f.

This commit restores the original behavior and clarifies it in the
documentation that NULL and "" have both the same meaning when passed
to CURLOPT_SSH_PUBLIC_KEYFILE.

Bug: http://curl.haxx.se/mail/lib-2016-01/0072.html
2016-01-15 10:34:34 +01:00
Daniel Stenberg
be79d83b00 RELEASE-NOTES: synced with 35083ca60ed035a 2016-01-14 22:09:09 +01:00
Daniel Stenberg
35083ca60e openssl: improved error detection/reporting
... by extracting the LIB + REASON from the OpenSSL error code. OpenSSL
1.1.0+ returned a new func number of another cerfificate fail so this
required a fix and this is the better way to catch this error anyway.
2016-01-14 21:25:30 +01:00
Daniel Stenberg
fdcc4d6daa openssl: for 1.1.0+ they now provide a SSLeay() macro of their own 2016-01-14 16:38:14 +01:00
Daniel Stenberg
133cd19244 CURLOPT_RESOLVE.3: minor language polish 2016-01-13 09:11:12 +01:00
Daniel Stenberg
4bed87f8fa configure: assume IPv6 works when cross-compiled
The configure test uses AC_TRY_RUN to figure out if an ipv6 socket
works, and testing like that doesn't work for cross-compiles. These days
IPv6 support is widespread so a blind guess is probably more likely to
be 'yes' than 'no' now.

Further: anyone who cross-compiles can use configure's --disable-ipv6 to
explicitly disable IPv6 and that also works for cross-compiles.

Made happen after discussions in issue #594
2016-01-12 10:30:54 +01:00
Daniel Stenberg
3ea77f6add TODO: "Try to URL encode given URL"
Closes #514
2016-01-12 00:03:05 +01:00
Daniel Stenberg
13b6d3b7dd ConnectionExists: only do pipelining/multiplexing when asked
When an HTTP/2 upgrade request fails (no protocol switch), it would
previously detect that as still possible to pipeline on (which is
acorrect) and do that when PIPEWAIT was enabled even if pipelining was
not explictily enabled.

It should only pipelined if explicitly asked to.

Closes #584
2016-01-11 23:55:13 +01:00
Mohammad AlSaleh
3d209b5fb0 lib: Prefix URLs with lower-case protocol names/schemes
Before this patch, if a URL does not start with the protocol
name/scheme, effective URLs would be prefixed with upper-case protocol
names/schemes. This behavior might not be expected by library users or
end users.

For example, if `CURLOPT_DEFAULT_PROTOCOL` is set to "https". And the
URL is "hostname/path". The effective URL would be
"HTTPS://hostname/path" instead of "https://hostname/path".

After this patch, effective URLs would be prefixed with a lower-case
protocol name/scheme.

Closes #597

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2016-01-11 23:38:42 +01:00
Alessandro Ghedini
ebfe00c050 scripts: don't generate and install zsh completion when cross-compiling 2016-01-11 23:32:30 +01:00
Alessandro Ghedini
fb7cbf75a5 scripts: fix zsh completion generation
The script should use the just-built curl, not the system one. This fixes
zsh completion generation when no system curl is installed.
2016-01-11 23:32:30 +01:00
Alessandro Ghedini
92a20413ac zsh.pl: fail if no curl is found
Instead of generation a broken completion file.
2016-01-11 23:32:30 +01:00
Michael Kaufmann
5d7c9379ef IDN host names: Remove the port number before converting to ACE
Closes #596
2016-01-11 00:11:28 +01:00
Jay Satiro
036c465e88 runtests: Add mbedTLS to the SSL backends
.. and enable SSLpinning tests for mbedTLS, BoringSSL and LibreSSL.
2016-01-10 02:56:26 -05:00
Thomas Glanzmann
bf93a1217c mbedtls: implement CURLOPT_PINNEDPUBLICKEY 2016-01-10 00:17:26 +01:00
Tatsuhiro Tsujikawa
5da7461a55 url: Fix compile error with --enable-werror 2016-01-09 02:26:23 -05:00
Tatsuhiro Tsujikawa
b019af41e7 http2: Ensure that http2_handle_stream_close is called
Previously, when HTTP/2 is enabled and used, and stream has content
length known, Curl_read was not called when there was no bytes left to
read. Because of this, we could not make sure that
http2_handle_stream_close was called for every stream. Since we use
http2_handle_stream_close to emit trailer fields, they were
effectively ignored. This commit changes the code so that Curl_read is
called even if no bytes left to read, to ensure that
http2_handle_stream_close is called for every stream.

Discussed in https://github.com/bagder/curl/pull/564
2016-01-08 17:16:47 -05:00
Daniel Stenberg
325686ef9e http2: handle the received SETTINGS frame
This regression landed in 5778e6f5 and made libcurl not act on received
settings and instead stayed with its internal defaults.

Bug: http://curl.haxx.se/mail/lib-2016-01/0031.html
Reported-by: Bankde
2016-01-08 23:06:59 +01:00
Daniel Stenberg
c338d8cf9c Revert "multiplex: allow only once HTTP/2 is actually used"
This reverts commit 46cb70e9fa81c9a56de484cdd7c5d9d0d9fbec36.

Bug: http://curl.haxx.se/mail/lib-2016-01/0031.html
2016-01-08 14:39:54 +01:00
Tatsuhiro Tsujikawa
984d1e9e23 http2: Fix PUSH_PROMISE headers being treated as trailers
Discussed in https://github.com/bagder/curl/pull/564
2016-01-08 03:06:25 -05:00
Michael Kaufmann
d9b4d1ce20 connection reuse: IDN host names fixed
Use the ACE form of IDN hostnames as key in the connection cache.  Add
new tests.

Closes #592
2016-01-08 00:19:46 +01:00
Daniel Stenberg
336e8feec4 tests: mark IPv6 FTP and FTPS tests with the FTP keyword 2016-01-07 14:30:55 +01:00
Jay Satiro
89a1eb7b1c mbedtls: Fix ALPN support
- Fix ALPN reply detection.

- Wrap nghttp2 code in ifdef USE_NGHTTP2.


Prior to this change ALPN and HTTP/2 did not work properly in mbedTLS.
2016-01-07 01:49:31 -05:00
Jay Satiro
973ee6bdd3 http2: Fix client write for trailers on stream close
Check that the trailer buffer exists before attempting a client write
for trailers on stream close.

Refer to comments in https://github.com/bagder/curl/pull/564
2016-01-06 22:10:49 -05:00
Daniel Stenberg
3de2d48d4c COPYING: update general copyright year range 2016-01-07 00:11:16 +01:00
Daniel Stenberg
a2cae9aafd ConnectionExists: add missing newline in infof() call
Mistake from commit a464f33843ee1
2016-01-06 00:54:49 +01:00
Daniel Stenberg
46cb70e9fa multiplex: allow only once HTTP/2 is actually used
To make sure curl doesn't allow multiplexing before a connection is
upgraded to HTTP/2 (like when Upgrade: h2c fails), we must make sure the
connection uses HTTP/2 as well and not only check what's wanted.

Closes #584

Patch-by: c0ff
2016-01-06 00:54:49 +01:00
Jay Satiro
19ca40100b curl_global_init.3: Add Windows-specific info for init via DLL
- Add to both curl_global_init.3 and libcurl.3 the caveat for Windows
that initializing libcurl via a DLL's DllMain or static initializer
could cause a deadlock.

Bug: https://github.com/bagder/curl/issues/586
Reported-by: marc-groundctl@users.noreply.github.com
2016-01-04 17:44:39 -05:00
Daniel Stenberg
b82359643d FAQ: clarify who to mail about ECCN clarifications 2016-01-04 18:59:29 +01:00
Daniel Stenberg
1d15a509dd progressfunc.c: spellfix description 2016-01-04 18:49:10 +01:00
Daniel Stenberg
a3b8a9e036 docs/examples/multi-app.c: fix bad desc formatting 2016-01-04 15:35:16 +01:00
Daniel Stenberg
2e503441ed examples: added descriptions 2016-01-04 15:34:05 +01:00
Daniel Stenberg
e45059214c example/simple.c: add description 2016-01-04 15:12:37 +01:00
Daniel Stenberg
1c9298ff1b getredirect.c: a new example 2016-01-04 15:12:37 +01:00
Marc Hoersken
ddfa0d850b RELEASE-NOTES: add 5e0e81a9c4e35f04ca 2015-12-27 18:18:45 +01:00
Daniel Stenberg
752171f016 RELEASE-NOTES: synced with 2aec4359db1088b10d 2015-12-26 23:13:32 +01:00
Marc Hoersken
2aec4359db test 1515: add data check 2015-12-26 17:25:59 +01:00
Marc Hoersken
38b055446a test 1515: add MSYS support by passing a relative path
MSYS would otherwise turn a /-style path into a C:\-style path.
2015-12-26 17:25:42 +01:00
Marc Hoersken
4ca246c3a8 test 539: use datacheck mode text for ASCII-mode LISTings
While still using datacheck mode binary for the inline reply data.
2015-12-26 11:01:47 +01:00
Marc Hoersken
a9ebd1bddc runtests.pl: check up to 5 data parts with different text modes
Move the text-mode conversion for reply/replycheck from the verify
section into the load section and add support for 4 more check parts.
2015-12-26 11:01:47 +01:00
Daniel Stenberg
90c2d215d7 CURLOPT_RANGE: for HTTP servers, range support is optional 2015-12-24 23:35:54 +01:00
Marc Hoersken
8fb8e16ea4 tests 1048 and 1050: use datacheck mode text for ASCII-mode LISTings 2015-12-24 14:56:47 +01:00
Marc Hoersken
2eb933e8aa tests 706 and 707: use datacheck mode text for ASCII-mode LISTings 2015-12-24 14:48:36 +01:00
Marc Hoersken
08554dff65 tests 400,403,406: use datacheck mode text for ASCII-mode LISTings 2015-12-24 14:22:26 +01:00
Marc Hoersken
7bf5f6e054 sockfilt.c: fix calculation of sleep timeout on Windows
Not converting to double caused small timeouts to be skipped.
2015-12-23 15:04:02 +01:00
Marc Hoersken
520bd9e49f tests first.c: fix calculation of sleep timeout on Windows
Not converting to double caused small timeouts to be skipped.
2015-12-23 15:03:40 +01:00
Marc Hoersken
24cf20ec68 test 573: add more debug output 2015-12-23 15:02:43 +01:00
Marc Hoersken
7cbe4d8d79 ftplistparser.c: fix handling of file LISTings using Windows EOL
Previously file.txt[CR][LF] would have been returned as file.tx
(without the last t) if filetype is symlink. Now the t is
included and the internal item_length includes the zero byte.

Spotted using test 576 on Windows.
2015-12-23 14:19:36 +01:00
Marc Hoersken
fcabed6cd8 test 16: fix on Linux (and Windows) by using plain ASCII characters
Follow up on b064ff0c351bb287557228575ef4c1d079b866fb, thanks Daniel.
2015-12-23 13:35:36 +01:00
Marc Hoersken
18c95d4bc0 tftpd server: add Windows support by writing files in binary mode 2015-12-23 13:04:00 +01:00
Marc Hoersken
328771981a tests 252-255: use datacheck mode text for ASCII-mode LISTings 2015-12-23 12:49:40 +01:00
Marc Hoersken
b064ff0c35 test 16: fix on Windows by converting data file from ANSI to UTF-8 2015-12-23 12:41:52 +01:00
Daniel Stenberg
bfe6f1f788 Makefile.inc: s/curl_SOURCES/CURL_FILES
This allows the root Makefile.am to include the Makefile.inc without
causing automake to warn on it (variables named *_SOURCES are
magic). curl_SOURCES is then instead assigned properly in
src/Makefile.am only.

Closes #577
2015-12-23 12:07:50 +01:00
Anders Bakken
a464f33843 ConnectionExists: with *PIPEWAIT, wait for connections
Try harder to prevent libcurl from opening up an additional socket when
CURLOPT_PIPEWAIT is set. Accomplished by letting ongoing TCP and TLS
handshakes complete first before the decision is made.

Closes #575
2015-12-23 10:20:37 +01:00
Anders Bakken
04cb90948e Add .dir-locals and set c-basic-offset to 2.
This makes it easier for emacs users to automatically get the right
2-space indentation when they edit curl source files.

c++-mode is in there as well because Emacs can't easily know if
something is a C or C++ header.

Closes #574
2015-12-23 10:16:14 +01:00
Johannes Schindelin
c208c783f5 configure: detect IPv6 support on Windows
This patch was "nicked" from the MINGW-packages project by Daniel.

9253d0bf58
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-12-20 23:48:25 +01:00
Daniel Stenberg
bd431eef04 configure: allow static builds on mingw
This patch is adopted from the MINGW-packages project. It makes it
possible to build curl both shared and static again.

URL: https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-curl
2015-12-20 23:43:46 +01:00
Marc Hoersken
5e0e81a9c4 test 1326: fix file check since curl is outputting binary data 2015-12-17 16:04:33 +01:00
Marc Hoersken
9e093f0e74 test 1326: fix getting stuck on Windows due to incomplete request
The request needs to be read and send in binary mode in order to use
CRLF instead of LF. Adding --upload-file - causes curl to read stdin
in binary mode.
2015-12-17 15:14:36 +01:00
Daniel Stenberg
58ac23dd16 RELEASE-NOTES: command line option recount 2015-12-17 13:22:14 +01:00
Dan Fandrich
28533d3277 scripts/Makefile: build zsh script even in an out-of-tree build 2015-12-16 22:13:02 +01:00
Marc Hoersken
c3eeb526ae sockfilt.c: added some debug output to select_ws 2015-12-16 15:33:36 +01:00
Marc Hoersken
234abd9013 sockfilt.c: keep lines shorter than 80 chars 2015-12-16 15:33:13 +01:00
Marc Hoersken
f4646b9069 sockfilt.c: do not wait on unreliable file or pipe handle
The previous implementation caused issues on modern MSYS2 runtimes.
2015-12-16 15:32:31 +01:00
Daniel Stenberg
151da51404 cyassl: deal with lack of *get_peer_certificate
The function is only present in wolfssl/cyassl if it was built with
--enable-opensslextra. With these checks added, pinning support is disabled
unless the TLS lib has that function available.

Also fix the mistake in configure that checks for the wrong lib name.

Closes #566
2015-12-16 10:27:18 +01:00
Daniel Stenberg
1ff3a07be9 wolfssl: handle builds without SSLv3 support 2015-12-16 10:06:09 +01:00
Tatsuhiro Tsujikawa
15cb03ad84 http2: Support trailer fields
This commit adds trailer support in HTTP/2.  In HTTP/1.1, chunked
encoding must be used to send trialer fields.  HTTP/2 deprecated any
trandfer-encoding, including chunked.  But trailer fields are now
always available.

Since trailer fields are relatively rare these days (gRPC uses them
extensively though), allocating buffer for trailer fields is done when
we detect that HEADERS frame containing trailer fields is started.  We
use Curl_add_buffer_* functions to buffer all trailers, just like we
do for regular header fields.  And then deliver them when stream is
closed.  We have to be careful here so that all data are delivered to
upper layer before sending trailers to the application.

We can deliver trailer field one by one using NGHTTP2_ERR_PAUSE
mechanism, but current method is far more simple.

Another possibility is use chunked encoding internally for HTTP/2
traffic.  I have not tested it, but it could add another overhead.

Closes #564
2015-12-15 23:47:46 +01:00
Daniel Stenberg
871ad2a0f2 RELEASE-NOTES: synced with 6c2c019654e658a 2015-12-15 23:12:32 +01:00
Jay Satiro
6c2c019654 x509asn1: Fix host altname verification
- In Curl_verifyhost check all altnames in the certificate.

Prior to this change only the first altname was checked. Only the GSKit
SSL backend was affected by this bug.

Bug: http://curl.haxx.se/mail/lib-2015-12/0062.html
Reported-by: John Kohl
2015-12-15 14:07:28 -05:00
Daniel Stenberg
b4a39491ca curl --expect100-timeout: added
This is the new command line option to set the value for the existing
libcurl option CURLOPT_EXPECT_100_TIMEOUT_MS
2015-12-15 13:59:56 +01:00
Daniel Stenberg
afcab2c2b6 cyassl: fix compiler warning on type conversion 2015-12-15 00:36:08 +01:00
Daniel Stenberg
18ecdd0430 curlver: the pending release will become 7.47.0 2015-12-15 00:02:20 +01:00
Anders Bakken
8fbaf6749a setstropt: const-correctness
Closes #565
2015-12-14 23:14:39 +01:00
Daniel Stenberg
63a5a756a8 ROADMAP: implemented HTTP2 for HTTPS-only 2015-12-14 10:13:21 +01:00
Daniel Stenberg
15cf5a98b7 HTTP2.md: spell fix and remove TODO now implemented 2015-12-14 10:10:35 +01:00
Daniel Stenberg
727f775e59 libressl: the latest openssl x509 funcs are not in libressl 2015-12-14 09:49:54 +01:00
Daniel Stenberg
536f5f442e curl: use 2TLS by default
Make this the default for the curl tool (if built with HTTP/2 powers
enabled) unless a specific HTTP version is requested on the command
line.

This should allow more users to get HTTP/2 powers without having to
change anything.
2015-12-13 09:26:43 +01:00
Daniel Stenberg
4bcc532de5 http: add libcurl option to allow HTTP/2 for HTTPS only
... and stick to 1.1 for HTTP. This is in line with what browsers do and
should have very little risk.
2015-12-13 09:24:51 +01:00
Daniel Stenberg
7f683b0ea8 openssl: adapt to openssl >= 1.1.0 X509 opaque structs
Closes #491
2015-12-10 22:45:38 +01:00
Daniel Stenberg
dd1b44c612 openssl: avoid BIO_reset() warnings since it returns a value 2015-12-10 17:31:37 +01:00
Daniel Stenberg
fa9332d3ca openssl: adapt to 1.1.0+ name changes 2015-12-10 17:31:37 +01:00
Daniel Stenberg
3b51652328 scripts/makefile: add standard header 2015-12-09 00:34:39 +01:00
Daniel Stenberg
f08fea7169 scripts/Makefile: fix GNUism and survive no perl
Closes #555

Reported-by: Thomas Klausner
2015-12-09 00:34:12 +01:00
Daniel Stenberg
034317d2af fix b6d5cb40d7038fe 2015-12-09 00:27:04 +01:00
Tatsuhiro Tsujikawa
12f6bf5e58 http2: Fix hanging paused stream
When NGHTTP2_ERR_PAUSE is returned from data_source_read_callback, we
might not process DATA frame fully.  Calling nghttp2_session_mem_recv()
again will continue to process DATA frame, but if there is no incoming
frames, then we have to call it again with 0-length data.  Without this,
on_stream_close callback will not be called, and stream could be hanged.

Bug: http://curl.haxx.se/mail/lib-2015-11/0103.html
Reported-by: Francisco Moraes
2015-12-08 18:40:32 +01:00
Christian Stewart
b6d5cb40d7 build: fix compilation error with CURL_DISABLE_VERBOSE_STRINGS
With curl disable verbose strings in http.c the compilation fails due to
the data variable being undefined later on in the function.

Closes #558
2015-12-08 18:12:16 +01:00
Gisle Vanem
6c2a10e963 config-win32: Fix warning HAVE_WINSOCK2_H undefined 2015-12-07 19:07:51 -05:00
Gisle Vanem
df40b20e44 openssl: BoringSSL doesn't have CONF_modules_free 2015-12-07 18:47:26 -05:00
Gisle Vanem
e1b6b2219d lwip: Fix compatibility issues with later versions
The name of the header guard in lwIP's <lwip/opt.h> has changed from
'__LWIP_OPT_H__' to 'LWIP_HDR_OPT_H' (bug #35874 in May 2015).

Other fixes:

- In curl_setup.h, the problem with an old PSDK doesn't apply if lwIP is
used.

- In memdebug.h, the 'socket' should be undefined first due to lwIP's
lwip_socket() macro.

- In curl_addrinfo.c lwIP's getaddrinfo() + freeaddrinfo() macros need
special handling because they were undef'ed in memdebug.h.

- In select.c we can't use preprocessor conditionals inside select if
MSVC and select is a macro, as it is with lwIP.

http://curl.haxx.se/mail/lib-2015-12/0023.html
http://curl.haxx.se/mail/lib-2015-12/0024.html
2015-12-07 14:27:55 -05:00
Patrick Monnerat
ec26399bf9 os400: define CURL_VERSION_PSL in ILE/RPG binding 2015-12-07 10:09:33 +01:00
Gisle Vanem
b1f9424fa7 version: Add flag CURL_VERSION_PSL for libpsl 2015-12-07 02:59:54 -05:00
Jay Satiro
738b0ba09e formdata: Check if length is too large for memory
- If the size of the length type (curl_off_t) is greater than the size
of the size_t type then check before allocating memory to make sure the
value of length will fit in a size_t without overflow. If it doesn't
then return CURLE_BAD_FUNCTION_ARGUMENT.

Bug: https://github.com/bagder/curl/issues/425#issuecomment-154518679
Reported-by: Steve Holme
2015-12-07 02:43:24 -05:00
Steve Holme
a62000ecc9 tests: Corrected copy and pasted comments from commit e643c5c908 2015-12-03 23:31:24 +00:00
Daniel Stenberg
f606435419 curl: remove keepalive #ifdef checks done on libcurl's behalf
They didn't match the ifdef logic used within libcurl anyway so they
could indeed warn for the wrong case - plus the tool cannot know how the
lib actually performs at that level.
2015-12-03 09:55:00 +01:00
Steve Holme
5eba895b4c test947: Corrected typo in test name 2015-12-02 23:45:29 +00:00
Steve Holme
e643c5c908 tests: Disable the OAUTHBEARER tests when using a non-default port number
Tests 842, 843, 844, 845, 887, 888, 889, 890, 946, 947, 948 and 949 fail
if a custom port number is specified via the -b option of runtests.pl.

Suggested by: Kamil Dudka
Bug: http://curl.haxx.se/mail/lib-2015-12/0003.html
2015-12-02 23:10:02 +00:00
Daniel Stenberg
e7d8d8e257 bump: towards next release
for all we know now, it might be called 7.46.1
2015-12-02 23:24:47 +01:00
Daniel Stenberg
e2ae32ff5f RELEASE-NOTES: updated contributor count for 7.46.0 2015-12-01 23:10:16 +01:00
Daniel Stenberg
6623a485d3 THANKS: new contributors from the 7.46.0 release 2015-12-01 22:53:24 +01:00
Daniel Stenberg
940c2f51aa THANKS-filter: single Tim Rühsen spelling 2015-12-01 22:51:50 +01:00
Daniel Stenberg
a47137c4a5 docs/examples: gitignore some more built examples 2015-12-01 09:09:04 +01:00
Daniel Stenberg
5648f0a32c RELEASE-NOTES; this bug was never released 2015-11-30 08:22:32 +01:00
Daniel Stenberg
2fddc4e3e1 RELEASE-NOTES: synced with e55f15454efacb0 2015-11-30 08:03:28 +01:00
Flavio Medeiros
e55f15454e Curl_read_plain: clean up ifdefs that break statements
Closes #546
2015-11-30 00:28:28 +01:00
Daniel Stenberg
fe7c39d353 http2: convert some verbose output into debug-only output 2015-11-30 00:12:46 +01:00
Daniel Stenberg
8f281fb76d http2 push: add missing inits of new stream
- set the correct stream_id for pushed streams
- init maxdownload and size properly
2015-11-30 00:11:42 +01:00
Daniel Stenberg
8cbd80686e http2 push: set weight for new stream
give the new stream the old one's stream_weight internally to avoid
sending a PRIORITY frame unless asked for it
2015-11-30 00:10:35 +01:00
Daniel Stenberg
a14fa8f8ff curl_setup.h: undef freeaddrinfo in c-ares block to fix build
Fixes warnings 78c25c854a added.
2015-11-28 17:26:38 +01:00
Daniel Stenberg
81ae6d01fa nonblock: fix setting non-blocking mode for Amiga
IoctlSocket() apparently wants a pointer to a long, passed as a char *
in its third parameter. This bug was introduced already back in commit
c5fdeef41d from October 1 2001!

Bug: http://curl.haxx.se/mail/lib-2015-11/0088.html
Reported-by: Norbert Kett
2015-11-27 23:29:30 +01:00
Daniel Stenberg
19a8afb3c0 zsh install: fix DESTDIR support
Reported-by: Mohammad AlSaleh
2015-11-27 23:24:07 +01:00
Dan Fandrich
78c25c854a lib: Only define curl_dofreeaddrinfo if struct addrinfo is available 2015-11-27 10:51:22 +01:00
Steve Holme
db05d7a731 tool_paramhlp: Fixed display of URL index in password prompt for --next
Commit f3bae6ed73 added the URL index to the password prompt when using
--next. Unfortunately, because the size_t specifier (%zu) is not
supported by all sprintf() implementations we use the curl_off_t format
specifier instead. The display of an incorrect value arises on platforms
where size_t and curl_off_t are of a different size.
2015-11-27 06:59:02 +00:00
Daniel Stenberg
cd2b73b3ed timecond: do not add if-modified-since without timecondition
The RTSP code path didn't skip adding the if-modified-since for certain
RTSP code paths, even if CURLOPT_TIMECONDITION was set to
CURL_TIMECOND_NONE.

Also, an unknown non-zero CURLOPT_TIMECONDITION value no longer equals
CURL_TIMECOND_IFMODSINCE.

Bug: http://stackoverflow.com/questions/33903982/curl-timecond-none-doesnt-work-how-to-remove-if-modified-since-header
2015-11-25 11:38:10 +01:00
Daniel Stenberg
5b96b5e79e RELEASE-NOTES: synced with 99d17a5e2ba77e58 2015-11-25 11:29:00 +01:00
Daniel Stenberg
99d17a5e2b examples/README: cut out the incomplete list
... and add a generic explanation for them instead. Each example file
should contain its own description these days.
2015-11-25 10:49:22 +01:00
Daniel Stenberg
facf2925c7 test1513: make sure the callback is only called once 2015-11-24 23:33:37 +01:00
Daniel Shahaf
be0d4141af build: Install zsh completion
Fixes #534
Closes #537
2015-11-24 22:22:01 +01:00
Daniel Stenberg
40c349ada9 done: make sure the final progress update is made
It would previously be skipped if an existing error was returned, but
would lead to a previous value being left there and later used.
CURLINFO_TOTAL_TIME for example.

Still it avoids that final progress update if we reached DONE as the
result of a callback abort to avoid another callback to be called after
an abort-by-callback.

Reported-by: Lukas Ruzicka

Closes #538
2015-11-24 20:49:04 +01:00
Daniel Stenberg
bb9ec5ebb2 curl: expanded the -XHEAD warning text
... to also mention the specific options used.
2015-11-24 10:11:06 +01:00
Daniel Stenberg
c341311a0e Revert "cleanup: general removal of TODO (and similar) comments"
This reverts commit 64e959ffe37c436503f9fed1ce2d6ee6ae50bd9a.

Feedback-by: Dan Fandrich
URL: http://curl.haxx.se/mail/lib-2015-11/0062.html
2015-11-24 09:36:45 +01:00
Daniel Stenberg
fc5d783589 CURLOPT_HEADERFUNCTION.3: fix typo
Refer to _HEADERDATA not _WRITEDATA.

Reported-by: Michał Piechowski
2015-11-23 16:11:57 +01:00
Daniel Stenberg
98acebb526 TODO: TCP Fast Open 2015-11-23 10:58:12 +01:00
Steve Holme
06b288a72d examples: Added website parse-able descriptions to the e-mail examples 2015-11-22 11:55:10 +00:00
Steve Holme
d55f9071fb TODO: Added another 'multi-interface' idea 2015-11-21 17:59:14 +00:00
Steve Holme
b7f3f1b68f smb.c: Fixed compilation warnings
smb.c:134:3: warning: conversion to 'short unsigned int' from 'int' may
             alter its value
smb.c:146:42: warning: conversion to 'unsigned int' from 'long long
              unsigned int' may alter its value
smb.c:146:65: warning: conversion to 'unsigned int' from 'long long
              unsigned int' may alter its value
2015-11-21 11:41:20 +00:00
Steve Holme
c2f1730e17 schannel: Corrected copy/paste error in commit 8d17117683 2015-11-21 02:54:44 +00:00
Steve Holme
8d17117683 schannel: Use GetVersionEx() when VerifyVersionInfo() isn't available
Regression from commit 7a8e861a5 as highlighted in the msys autobuilds.
2015-11-21 02:43:17 +00:00
Steve Holme
c90e348579 examples: Fixed compilation warnings
pop3-multi.c:96:5: warning: implicit declaration of function 'memset'
imap-multi.c:96:5: warning: implicit declaration of function 'memset'
http2-download.c:226:5: warning: implicit declaration of function 'memset'
http2-upload.c:290:5: warning: implicit declaration of function 'memset'
http2-upload.c:290:5: warning: implicit declaration of function 'memset'
2015-11-21 01:47:02 +00:00
Steve Holme
f024ece8c7 Makefile.inc: Fixed test run error
test845 not present in tests/data/Makefile.inc
2015-11-21 00:04:57 +00:00
Daniel Stenberg
ad6f6e17d3 TODO: remove duplicated title 2015-11-20 09:37:11 +01:00
Daniel Stenberg
0ddc59be0a TODO: added two more libcurl ideas
Moved some ideas from "next major" to just ordinary ideas since we can
always add new things while keeping the old without doing a "next
major".
2015-11-20 08:39:59 +01:00
Steve Holme
bbb34b6f15 tests: Re-enabled tests 889 and 890 following POP3 fix 2015-11-20 07:04:19 +00:00
Steve Holme
41efdadf09 pop3: Differentiate between success and continuation responses 2015-11-20 07:01:01 +00:00
Steve Holme
6af80afe49 pop3: Added clarity on some server response codes 2015-11-20 06:41:53 +00:00
Daniel Shahaf
80562083da build: Fix theoretical infinite loops
Add error-checking to 'cd' in a few cases where omitting the checks
might result in an infinite loop.

Closes #535
2015-11-20 00:25:42 +01:00
Patrick Monnerat
ff8d352ae9 curl.h: s/#defien/#define/ 2015-11-19 13:53:47 +01:00
Patrick Monnerat
250d786bd2 os400: synchronize ILE/RPG header file 2015-11-19 13:52:06 +01:00
Patrick Monnerat
0cf80c05ea os400: Provide options for libssh2 use in compile scripts. Adjust README. 2015-11-19 13:37:51 +01:00
danielsh@apache.org
b27893d15c zsh completion: Preserve single quotes in output
When an option's help string contains literal single quotes, those
single quotes would be stripped from the option's description in the
completion output (unless the zsh RC_QUOTES option were set while the
completion function was being sourced, which is not the default).  This
patch makes the completion output contain single quotes where the --help
output does.

Closes #532
2015-11-19 12:10:31 +01:00
MaxGiting
05cd55f229 FAQ: Grammar changes
Closes https://github.com/bagder/curl/pull/533
2015-11-18 23:00:50 -05:00
Daniel Stenberg
b4c39010b5 http2: http_done: don't free already-freed push headers
The push headers are freed after the push callback has been invoked,
meaning this code should only free the headers if the callback was never
invoked and thus the headers weren't freed at that time.

Reported-by: Davey Shafik
2015-11-17 09:47:58 +01:00
Anders Bakken
a72207ecf0 getconnectinfo: Don't call recv(2) if socket == -1
Closes #528
2015-11-16 22:42:13 +01:00
Daniel Stenberg
6c5f4303fe CURLMOPT_PUSHFUNCTION.3: *_byname() returns only the first header
... if there are more than one using the same name
2015-11-16 08:26:48 +01:00
Daniel Stenberg
39904d6f7d http2: minor comment typo 2015-11-16 08:22:08 +01:00
Daniel Stenberg
88f585c3a1 sasl; fix checksrc warnings 2015-11-15 23:15:00 +01:00
Steve Holme
051485d9e0 RELEASE-NOTES: Adjusted for the recent OAuth 2.0 activity 2015-11-15 20:18:44 +00:00
Steve Holme
3c4065f402 tests: Disabled 889 and 890 until we support POP3 continuation responses
As POP3 final and continuation responses both begin with a + character,
and both the finalcode and contcode variables in SASLprotoc are set as
such, we cannot tell the difference between them when we are expecting
an optional continuation from the server such as the following:

+ something else from the server
+OK final response

Disabled these tests until such a time we can tell the responses apart.
2015-11-15 20:14:46 +00:00
Steve Holme
d0ddfe2216 tests: Corrected typos from commit ba4d8f7eba 2015-11-15 20:11:55 +00:00
Steve Holme
ca770d87e2 tests: Added OAUTHBEARER failure response tests 2015-11-15 20:11:54 +00:00
Steve Holme
ee04bee82b oauth2: Support OAUTHBEARER failures sent as continuation responses
According to RFC7628 a failure message may be sent by the server in a
base64 encoded JSON string as a continuation response.

Currently only implemented for OAUTHBEARER and not XAUTH2.
2015-11-15 20:11:53 +00:00
Daniel Stenberg
6cfd646f58 RELEASE-NOTES: synced with 808a17ee675 2015-11-15 19:12:06 +01:00
Steve Holme
808a17ee67 tests: Renamed existing OAuth 2.0 (XOAUTH) tests 2015-11-14 11:19:57 +00:00
Steve Holme
ba4d8f7eba tests: Added OAuth 2.0 (OAUTHBEARER) tests 2015-11-14 11:16:04 +00:00
Steve Holme
febda2f305 oauth2: Added support for OAUTHBEARER SASL mechanism to IMAP, POP3 and SNMP
OAUTHBEARER is now the official "registered" SASL mechanism name for
OAuth 2.0. However, we don't want to drop support for XOAUTH2 as some
servers won't support the new mechanism yet.
2015-11-14 10:28:05 +00:00
Daniel Stenberg
ceb396c54a RELEASE-NOTES: recounted curl_easy_setopt() options 2015-11-13 23:40:40 +01:00
Daniel Stenberg
796c6ef02b typecheck-gcc.h: add missing slist-using options
CURLOPT_RESOLVE and CURLOPT_PROXYHEADER were missing

Also sorted the list.
2015-11-13 23:19:19 +01:00
Daniel Stenberg
60cf8157c7 typecheck-gcc.h: added CURLOPT_CLOSESOCKETDATA
... and sorted curl_is_cb_data_option alphabetically
2015-11-13 23:12:48 +01:00
Sebastian Pohlschmidt
ad2d517545 openssl: Free modules on cleanup
Curl_ossl_init calls OPENSSL_load_builtin_modules() but
Curl_ossl_cleanup doesn't make a call to free these modules.

Bug: https://github.com/bagder/curl/issues/526
2015-11-13 16:11:41 -05:00
Steve Holme
1ee0aded89 symbols-in-versions: Added new CURLOPTTYPE_STRINGPOINT alias
...following commit aba281e762 to fix test 1119.
2015-11-13 20:42:35 +00:00
Daniel Stenberg
f322ca7765 curl: mark two more options strings for --libcurl output 2015-11-13 16:59:09 +01:00
Daniel Stenberg
fd0c678e21 typecheck-gcc.h: add some missing string types
Also sorted that list alphabetically
2015-11-13 16:53:17 +01:00
Daniel Stenberg
aba281e762 curl.h: introducing the STRINGPOINT alias
As an alias for OBJECTPOINT. Provided to allow us to grep for all string
options easier.
2015-11-13 16:50:10 +01:00
Daniel Stenberg
64e959ffe3 cleanup: general removal of TODO (and similar) comments
They tend to never get updated anyway so they're frequently inaccurate
and we never go back to revisit them anyway. We document issues to work
on properly in KNOWN_BUGS and TODO instead.
2015-11-13 16:15:26 +01:00
Daniel Stenberg
86e2197337 ftplistparser: remove empty function 2015-11-13 16:12:18 +01:00
Daniel Stenberg
6c20a87105 openssl: remove #if check for 0.9.7 for ENGINE_load_private_key 2015-11-13 15:55:52 +01:00
Daniel Stenberg
b430d94fb2 openssl: all supported versions have X509_STORE_set_flags
Simplify by removing #ifdefs and macros
2015-11-13 15:52:39 +01:00
Daniel Stenberg
0755308a6a openssl: remove 0.9.3 check 2015-11-13 15:51:46 +01:00
Daniel Stenberg
53b13d0c71 openssl: remove #ifdefs for < 0.9.5 support
We only support >= 0.9.7
2015-11-13 15:49:49 +01:00
Daniel Stenberg
431ba85829 lib/vtls/openssl: remove unused traces of yassl ifdefs 2015-11-13 15:48:04 +01:00
dfandrich
eb3703f052 unit1603: Demote hash mismatch failure to a warning
The hashes can vary between architectures (e.g. Sparc differs from x86_64).
This is not a fatal problem but just reduces the coverage of these white-box
tests, as the assumptions about into which hash bucket each key falls are no
longer valid.
2015-11-12 23:50:18 +01:00
dfandrich
d7e352402c unit1603: Added unit tests for hash functions 2015-11-12 22:49:32 +01:00
dfandrich
278ea24a7a unit1602: Fixed failure in torture test 2015-11-12 22:47:37 +01:00
Steve Holme
1f82df9146 sasl: Re-introduced XOAUTH2 in the default enabled authentication mechanism
Following the fix in commit d6d58dd558 it is necessary to re-introduce
XOAUTH2 in the default enabled authentication mechanism, which was
removed in commit 7b2012f262, otherwise users will have to specify
AUTH=XOAUTH2 in the URL.

Note: OAuth 2.0 will only be used when the bearer is specified.
2015-11-12 19:45:24 +00:00
Stefan Bühler
077fd8f1fa sasl_sspi: fix identity memory leak in digest authentication 2015-11-12 19:11:40 +00:00
Stefan Bühler
b6baa108fa sasl_sspi: fixed unicode build for digest authentication
Closes #525
2015-11-12 19:11:40 +00:00
Steve Holme
88702ebb31 oauth2: Re-factored OAuth 2.0 state variable 2015-11-12 18:25:33 +00:00
Steve Holme
d6d58dd558 sasl: Don't choose OAuth 2.0 if mechanism not advertised
Regression from commit 9e8ced9890 which meant if --oauth2-bearer was
specified but the SASL mechanism wasn't supported by the server then
the mechanism would be chosen.
2015-11-12 18:25:33 +00:00
Daniel Stenberg
a7c4bcd971 runtests: more compact "System characteristics" output
- no point in repeating curl features that is already listed as features
  from the curl -V output

- remove the port numbers/unix domain path from the output unless
  verbose is used, as that is rarely interesting to users.
2015-11-12 15:32:48 +01:00
Daniel Stenberg
3c24400636 runtests: rename conditional curl-features to $has_[name] 2015-11-12 14:50:13 +01:00
Steve Holme
dcf5b614ca oauth2: Introduced support for host and port details
Added support to the OAuth 2.0 message function for host and port, in
order to accommodate the official OAUTHBEARER SASL mechanism which is
to be added shortly.
2015-11-11 22:26:21 +00:00
Steve Holme
6479f5a076 curl_setup.h: Removed duplicate CURL_DISABLE_RTSP when HTTP_ONLY defined 2015-11-11 22:19:39 +00:00
Steve Holme
d64add3c71 cmake: Add missing feature macros in config header (Part 2)
In addition to commit a215381c94 added the RTSP, RTMP and SMB protocols.
2015-11-11 22:18:24 +00:00
Douglas Creager
a215381c94 cmake: Add missing feature macros in config header
The curl_config.h file can be generated either from curl_config.h.cmake
or curl_config.h.in, depending on whether you're building using CMake or
the autotools.  The CMake template header doesn't include entries for
all of the protocols that you can disable, which (I think) means that
you can't actually disable those protocols when building via CMake.

Closes #523
2015-11-10 22:38:52 +01:00
Douglas Creager
3e0d64d075 BoringSSL: Work with stricter BIO_get_mem_data()
BoringSSL implements `BIO_get_mem_data` as a function, instead of a
macro, and expects the output pointer to be a `char **`.  We have to add
an explicit cast to grab the pointer as a `const char **`.

Closes #524
2015-11-10 22:34:07 +01:00
Daniel Stenberg
01b7d8274c http2: rectify the http2 version #if check
We need 1.0.0 or later. Also verified by configure.
2015-11-10 09:10:46 +01:00
Steve Holme
7023d8aa37 oauth2: Don't use XAUTH2 in OAuth 2.0 function name 2015-11-09 22:25:09 +00:00
Steve Holme
eaa98cef8d oauth2: Don't use XOAUTH2 in OAuth 2.0 variables 2015-11-09 22:25:08 +00:00
Steve Holme
4e3d396900 oauth2: Use OAuth 2.0 rather than XOAUTH2 in comments
When referring to OAuth 2.0 we should use the official name rather the
SASL mechanism name.
2015-11-09 22:25:08 +00:00
Daniel Stenberg
f54a4aa9a3 imap: avoid freeing constant string
The fix in 1a614c6c3 was wrong and would leed to free() of a fixed
string.

Pointed-out-by: Kamil Dudka
2015-11-09 10:54:55 +01:00
Daniel Stenberg
6225c48a03 ROADMAP: remove two items already done 2015-11-09 09:05:43 +01:00
Daniel Stenberg
9b7f8ab21b RELEASE-NOTES: synced with 2200bf62054 2015-11-09 09:00:39 +01:00
Jay Satiro
2200bf6205 acinclude: Remove check for 16-bit curl_off_t
Because it's illogical to check for a 16-bit curl_off_t.

Ref: https://github.com/bagder/curl/issues/425#issuecomment-154964205
2015-11-09 02:56:40 -05:00
Dan Fandrich
729b92afbe tool: Fixed a memory leak on OOM introduced in 19cb0c4a 2015-11-08 16:50:25 +01:00
Justin Ehlert
23b8fc15c8 imap: Don't check for continuation when executing a CUSTOMREQUEST
Bug: https://github.com/bagder/curl/issues/486
Closes https://github.com/bagder/curl/pull/487
2015-11-08 12:12:33 +00:00
Daniel Stenberg
e3c85405d0 imap: checksrc: remove space after while before paren 2015-11-07 23:21:29 +01:00
Daniel Stenberg
2581585961 checksrc.whitelist: "missing space after close paren"
... when it was within a string!
2015-11-07 23:20:50 +01:00
Steve Holme
007f3e0971 opts: Corrected TLS protocols list to include POP3S rather than POP3 2015-11-07 22:11:04 +00:00
Steve Holme
23c4090fd3 imap: Quote other 'atom-specials' and not just the space character
Closes #517
2015-11-07 11:59:32 +00:00
Steve Holme
50bff12ac8 imap: Fixed double quote in LIST command when mailbox contains spaces 2015-11-07 11:20:34 +00:00
Daniel Stenberg
1a614c6c37 imap: fix compiler warning
imap.c:657:13: error: assignment discards 'const' qualifier from pointer
target type [-Werror=discarded-qualifiers]
2015-11-06 23:44:27 +01:00
Steve Holme
505d966850 imap: Don't call imap_atom() when no mailbox specified in LIST command 2015-11-06 21:49:26 +00:00
Daniel Stenberg
748ffc77c6 curl.1: remove the overlap --range example
... it is just weird to include by default even if it still works.
2015-11-06 15:03:00 +01:00
Daniel Stenberg
60c86297bf tftp tests: verify sent options too
The tftpd test server now logs all received options and thus all TFTP
test cases need to match them exactly.

Extended test 283 to use and verify --tftp-blksize.
2015-11-06 10:55:30 +01:00
Jay Satiro
cd3aba1a5c getinfo: CURLINFO_ACTIVESOCKET: fix bad socket value
- Set user info param to the socket returned by Curl_getconnectinfo,
regardless of if the socket is bad. Effectively this means the user info
param now will receive CURL_SOCKET_BAD instead of -1 on bad socket.

- Remove incorrect comments.

CURLINFO_ACTIVESOCKET is documented to write CURL_SOCKET_BAD to user
info param but prior to this change it wrote -1.

Bug: https://github.com/bagder/curl/pull/518
Reported-by: Marcel Raad
2015-11-06 00:30:16 -05:00
Patrick Monnerat
f6fbbd6dc3 curl_ntlm_core: fix 2 curl_off_t constant overflows. 2015-11-05 15:20:43 +01:00
Patrick Monnerat
210fc95c0f os400: adjust specific code to support new options. 2015-11-05 14:41:22 +01:00
Lauri Kasanen
3bd7f28000 rawstr: Speed up Curl_raw_toupper by 40%
Rationale: when starting up a curl-using app, all cookies from the jar
are checked against each other. This was causing a startup delay in the
Fifth browser.

All tests pass.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
2015-11-02 22:57:13 +01:00
Daniel Stenberg
3f7b1bb89f http redirects: %-encode bytes outside of ascii range
Apparently there are sites out there that do redirects to URLs they
provide in plain UTF-8 or similar. Browsers and wget %-encode such
headers when doing a subsequent request. Now libcurl does too.

Added test 1138 to verify.

Closes #473
2015-11-02 12:48:03 +01:00
Daniel Stenberg
1ea3a7d5e4 RELEASE-NOTES: synced with cba5bc585410 2015-11-02 10:16:21 +01:00
Daniel Stenberg
cba5bc5854 symbols-in-version: add all CURL_HTTPPOST_* symbols 2015-11-02 08:41:53 +01:00
Daniel Stenberg
ca5f9341ef formadd: support >2GB files on windows
Closes #425
2015-11-02 08:41:46 +01:00
Daniel Stenberg
49a991346e curl.h: s/HTTPPOST_/CURL_HTTPOST_
Fixes a name space pollution at the cost of programs using one of these
defines will no longer compile. However, the vast majority of libcurl
programs that do multipart formposts use curl_formadd() to build this
list.

Closes #506
2015-10-31 22:51:20 +01:00
Daniel Stenberg
fbf09b7775 mbedtls: fix "Structurally dead code"
CID 1332129
2015-10-29 22:59:27 +01:00
Daniel Stenberg
f6ce8c9abb mbedtls: fix "Logically dead code"
CID 1332128
2015-10-29 22:57:09 +01:00
Daniel Stenberg
4c62066cec Revert "openssl: engine: remove double-free"
This reverts commit 370ee919b37cc9a46c36428b2bb1527eae5db2bd.

Issue #509 has all the details but it was confirmed that the crash was
not due to this, so the previous commit was wrong.
2015-10-29 14:59:11 +01:00
Daniel Stenberg
9b87078d55 curl.1: -E: s/private certificate/client certificate
... as the certificate is strictly speaking not private.

Reported-by: John Levon
2015-10-28 13:17:54 +01:00
Daniel Stenberg
370ee919b3 openssl: engine: remove double-free
After a successful call to SSL_CTX_use_PrivateKey(), we must not call
EVP_PKEY_free() on the key.

Reported-by: nased0
Closes #509
2015-10-27 13:45:25 +01:00
Jay Satiro
e2f430c74a socks: Fix incorrect port numbers in failed connect messages 2015-10-27 02:39:00 -04:00
Daniel Stenberg
ea2c959db4 DISTRO-DILEMMA: removed
Out of date and not kept accurate. It was sort of a problem of the past
anyway.
2015-10-26 16:31:03 +01:00
xiangbin li
ca20ca54b2 MacOSX-Framework: sdk regex fix for sdk 10.10 and later
closes #507
2015-10-25 12:35:49 +01:00
Jay Satiro
d9a1776b32 build: Fix support for PKG_CONFIG
- Allow the user to use PKG_CONFIG but not PKGCONFIG.

Background:

Last week in 14d5a86 a change was made to allow the user to set the
PKGCONFIG variable. Today in 72d99f2 I supplemented that to allow the
more common PKG_CONFIG as an alternative if PKGCONFIG is not set.

Neither of those changes worked as expected because PKGCONFIG is
occasionally reset in configure and by the CURL_CHECK_PKGCONFIG macro.
Instead in this commit I take the approach that the user may set
PKG_CONFIG only.
2015-10-24 03:31:57 -04:00
Jay Satiro
72d99f2e7b build: Fix mingw ssl gdi32 order
- If mingw ssl make sure -lgdi32 comes after ssl libs

- Allow PKG_CONFIG to set pkg-config location and options

Bug: https://github.com/bagder/curl/pull/501
Reported-by: Kang Lin
2015-10-23 17:17:54 -04:00
Daniel Stenberg
2f4f4108d6 RELEASE-NOTES: synced with 03b6e078163f 2015-10-23 16:40:44 +02:00
Daniel Stenberg
03b6e07816 polarssl/mbedtls: fix name space pollution
Global private symbols MUST start with Curl_!
2015-10-23 16:14:29 +02:00
Dmitry S. Baikov
6288cb9304 mbedTLS: THREADING_SUPPORT compilation fix
Closes #505
2015-10-23 16:05:25 +02:00
Daniel Stenberg
eefd5a95af test1137: verify --ignore-content-length for FTP 2015-10-23 15:24:56 +02:00
Daniel Stenberg
b1fc8c0e97 curl.1: --ignore-content-length now works for FTP too 2015-10-23 15:24:31 +02:00
Kurt Fankhauser
529f9310b1 ftp: allow CURLOPT_IGNORE_CONTENT_LENGTH to ignore size
This allows FTP transfers with growing (or shrinking) files without
causing a transfer error.

Closes #480
2015-10-23 14:57:30 +02:00
Daniel Stenberg
b1199def8c CURLOPT_STREAM_WEIGHT.3: call argument 'weight' too
... and add a little example of what the weight actually means. "Relative
proportion of bandwidth".
2015-10-23 09:23:46 +02:00
Daniel Stenberg
b7d894d808 http2: add stream options to dist and curl_easy_setopt.3 2015-10-23 09:16:00 +02:00
Daniel Stenberg
d31ed6ac71 http2: s/priority/weight 2015-10-23 08:22:38 +02:00
Daniel Stenberg
419d410ca0 http2: on_frame_recv: trust the conn/data input
Removed wrong assert()s

The 'conn' passed in as userdata can be used and there can be other
sessionhandles ('data') than the single one this checked for.
2015-10-23 08:22:38 +02:00
Daniel Stenberg
3042cb5043 http2: added three stream prio/deps options
CURLOPT_STREAM_DEPENDS

CURLOPT_STREAM_DEPENDS_E

CURLOPT_STREAM_PRIORITY
2015-10-23 08:22:38 +02:00
Daniel Stenberg
23cc0c00d4 RELEASE-NOTES: synced with ace68fdc0cfed83d 2015-10-22 18:40:53 +02:00
m-gardet
ace68fdc0c mbedtls:new profile with RSA min key len = 1024.
Closes #502
2015-10-22 15:28:57 +02:00
Daniel Stenberg
9744ef2289 checksrc: add crude // detection 2015-10-21 23:18:04 +02:00
Gisle Vanem
c238d4da1b build: fix for MSDOS/djgpp
- Add a VPATH-statement for the vtls/*.c files.

- Due to 'vtls/*.c', remove that subdir part from $(OBJECTS).
2015-10-21 13:00:52 -04:00
Daniel Stenberg
5fecdc26f7 copyrights: update Gisle Vanem's email 2015-10-20 13:33:01 +02:00
Daniel Stenberg
257a1c0d14 vtls: fix compiler warning for TLS backends without sha256
... noticed with mbedTLS.
2015-10-20 08:12:44 +02:00
Jonas Minnberg
fe7590f729 vtls: added support for mbedTLS
closes #496
2015-10-20 07:57:24 +02:00
Javier G. Sogo
72646c2e48 cmake: Fix for add_subdirectory(curl) use-case
- Use CURL_BINARY_DIR instead of CMAKE_BINARY_DIR.

When including CURL using add_subdirectory the variables
CMAKE_BINARY_DIR and CURL_BINARY_DIR hold different paths.

Closes https://github.com/bagder/curl/pull/488
Closes https://github.com/bagder/curl/pull/498
2015-10-19 12:49:56 -04:00
Daniel Stenberg
4201e4a9ac RELEASE-NOTES: synced with 4c773bcb474e 2015-10-18 23:48:07 +02:00
Daniel Stenberg
4c773bcb47 tests/FILEFORMAT: mention PSL as a valid feture to check for
For example in test 1136
2015-10-18 23:25:26 +02:00
Daniel Stenberg
cb922d47d6 teste1136: only run when PSL is enabled 2015-10-18 23:20:08 +02:00
Daniel Stenberg
06b5fd8fde curl: slist_wc: remove curl_memory.h inclusion
... that's for the library only.
2015-10-18 00:43:37 +02:00
Daniel Stenberg
5cf0166636 configure: add PSL to the list of features
... to make test 1014 work again after e77b5b7453.
2015-10-18 00:11:13 +02:00
Daniel Hwang
19cb0c4a88 tool: Generate easysrc with last cache linked-list
Using a last cache linked-list improves the performance of easysrc
generation.

Bug: https://github.com/bagder/curl/issues/444
Ref: https://github.com/bagder/curl/issues/429

Closes #452
2015-10-18 00:00:50 +02:00
Tim Rühsen
e77b5b7453 cookies: Add support for Mozilla's Publix Suffix List
Use libpsl to check the domain value of Set-Cookie headers (and cookie
jar entries) for not being a Publix Suffix.

The configure script checks for "libpsl" by default. Disable the check
with --without-libpsl.

Ref: https://publicsuffix.org/
Ref: https://github.com/publicsuffix/list
Ref: https://github.com/rockdaboot/libpsl
2015-10-17 16:37:49 +02:00
Richard Hosking
684816cd9b curlbuild.h: Fix non-configure compiling to mips and sh4 targets 2015-10-16 23:57:44 +02:00
Anders Bakken
2b98cb57c4 http2: Don't pass unitialized name+len pairs to nghttp2_submit_request
bug introduced by 18691642931e5c7ac8af83ac3a84fbcb36000f96.

Closes #493
2015-10-16 23:46:03 +02:00
Dan Fandrich
3fde8a4971 test1601: fix compilation with --enable-debug and --disable-crypto-auth 2015-10-16 23:04:54 +02:00
Daniel Stenberg
443e81ea47 multi: fix off-by-one finit[] array size
introduced in c6aedf680f6. It needs to be CURLM_STATE_LAST big since it
must hande the range 0 .. CURLM_STATE_MSGSENT (18) and CURLM_STATE_LAST
is 19 right now.

Reported-by: Dan Fandrich
Bug: http://curl.haxx.se/mail/lib-2015-10/0069.html
2015-10-16 22:42:56 +02:00
Daniel Stenberg
c6aedf680f fread_func: move callback pointer from set to state struct
... and assign it from the set.fread_func_set pointer in the
Curl_init_CONNECT function. This A) avoids that we have code that
assigns fields in the 'set' struct (which we always knew was bad) and
more importantly B) it makes it impossibly to accidentally leave the
wrong value for when the handle is re-used etc.

Introducing a state-init functionality in multi.c, so that we can set a
specific function to get called when we enter a state. The
Curl_init_CONNECT is thus called when switching to the CONNECT state.

Bug: https://github.com/bagder/curl/issues/346

Closes #346
2015-10-15 23:32:19 +02:00
Dan Fandrich
854976ad7b test1531: case the size to fix the test on non-largefile builds 2015-10-14 22:00:09 +02:00
Daniel Stenberg
14d5a86b3e acinclude: remove PKGCONFIG override
... and allow it to get set by a caller easier.

Reported-by: Rainer Jung
Bug: http://curl.haxx.se/mail/lib-2015-10/0035.html
2015-10-13 12:58:52 +02:00
Dan Fandrich
db532eff1e docs/INSTALL: Updated example minimal binary sizes 2015-10-12 23:47:10 +02:00
Erik Johansson
3ad83bc3a6 openssl: Fix set up of pkcs12 certificate verification chain
sk_X509_pop will decrease the size of the stack which means that the loop would
end after having added only half of the certificates.

Also make sure that the X509 certificate is freed in case
SSL_CTX_add_extra_chain_cert fails.
2015-10-11 23:14:04 +02:00
Daniel Stenberg
13ddb9e54a ntlm: error out without 64bit support as the code needs it
It makes it a clearer message for developers reaching that point without
the necessary support.

Thanks-by: Jay Satiro

Closes #78
2015-10-09 23:51:54 +02:00
Daniel Stenberg
7715a70ba2 curl_global_init: set the memory function pointers correct
follow-up from 6f8ecea0
2015-10-09 16:13:54 +02:00
Daniel Stenberg
6f8ecea059 curl_global_init_mem: set function pointers before doing init
... as in the polarssl TLS backend for example it uses memory functions.
2015-10-09 16:04:11 +02:00
Jay Satiro
048f84637f http2: Fix http2_recv to return -1 if recv returned -1
If the underlying recv called by http2_recv returns -1 then that is the
value http2_recv returns to the caller.
2015-10-09 00:29:25 -04:00
Svyatoslav Mishyn
d30ad55c59 curl_easy_recv.3: CURLINFO_LASTSOCKET => CURLINFO_ACTIVESOCKET
Closes #479
2015-10-08 22:50:49 +02:00
Svyatoslav Mishyn
08e5fb4465 curl_easy_send.3: CURLINFO_LASTSOCKET => CURLINFO_ACTIVESOCKET 2015-10-08 22:50:42 +02:00
Svyatoslav Mishyn
2e373f4a6f CURLOPT_CONNECT_ONLY.3: CURLINFO_LASTSOCKET => CURLINFO_ACTIVESOCKET 2015-10-08 22:50:42 +02:00
Daniel Stenberg
bce689605d CURLOPT_CERTINFO.3: fix reference to CURLINFO_CERTINFO 2015-10-08 13:47:52 +02:00
Daniel Stenberg
8256b44e5a ntlm: get rid of unconditional use of long long
... since some compilers don't have it and instead use other types, such
as __int64.

Reported by: gkinseyhpw
Closes #478
2015-10-08 12:31:06 +02:00
Anders Bakken
da2d3b5805 des: Fix header conditional for Curl_des_set_odd_parity
Follow up to 613e502.
2015-10-08 02:07:12 -04:00
Daniel Stenberg
3771da335b configure: build silently by default
'make V=1' will make the build verbose like before
2015-10-07 14:56:07 +02:00
Daniel Stenberg
8bb43ecd05 bump: start climbing toward 7.46.0 2015-10-07 14:52:32 +02:00
Daniel Stenberg
645fc44764 RELEASE-PROCEDURE: add the github HTTPS download step 2015-10-07 14:46:49 +02:00
Daniel Stenberg
2c000d91f3 THANKS: 19 new contributors from the 7.45.0 announcement 2015-10-07 10:12:39 +02:00
Daniel Stenberg
aed57fdc95 RELEASE-NOTES: synced with 69ea57970080 2015-10-05 19:36:31 +02:00
Jay Satiro
69ea579700 getinfo: Fix return code for unknown CURLINFO options
- If a CURLINFO option is unknown return CURLE_UNKNOWN_OPTION.

Prior to this change CURLE_BAD_FUNCTION_ARGUMENT was returned on
unknown. That return value is contradicted by the CURLINFO option
documentation which specifies a return of CURLE_UNKNOWN_OPTION on
unknown.
2015-10-04 17:29:43 -04:00
rouzier
b1d55997e5 hiperfifo: fix the pointer passed to WRITEDATA
Closes https://github.com/bagder/curl/pull/471
2015-10-04 17:16:14 -04:00
Maksim Stsepanenka
2eb4f5efe9 tool_setopt: fix c_escape truncated octal
Closes https://github.com/bagder/curl/pull/469
2015-10-02 02:45:28 -04:00
Orange Tsai
5bf36ea30d gopher: don't send NUL byte
Closes #466
2015-10-01 18:15:11 +02:00
Jay Satiro
c6ff538ebd runtests: Fix pid check in checkdied
Because the 'not' operator has a very low precedence and as a result the
entire statement was erroneously negated and could never be true.
2015-09-29 22:08:57 -04:00
Thorsten Schöning
8fd190c04f win32: make recent Borland compilers use long long 2015-09-30 00:03:35 +02:00
Daniel Stenberg
ec9cbb1757 RELEASE-NOTES: synced with 69b89050d4 2015-09-29 10:57:42 +02:00
Michael Kalinin
69b89050d4 openssl: Fix algorithm init
- Change algorithm init to happen after OpenSSL config load.

Additional algorithms may be available due to the user's config so we
initialize the algorithms after the user's config is loaded.

Bug: https://github.com/bagder/curl/issues/447
Reported-by: Denis Feklushkin
2015-09-28 22:47:25 -04:00
Svyatoslav Mishyn
963b7bd4f7 docs: fix unescaped '\n' in man pages
Closes https://github.com/bagder/curl/pull/459
2015-09-27 23:45:41 -04:00
Daniel Stenberg
af90becf4b http2: set TCP_NODELAY unconditionally
For a single-stream download from localhost, we managed to increase
transfer speed from 1.6MB/sec to around 400MB/sec, mostly because of
this single fix.
2015-09-27 23:23:58 +02:00
Daniel Stenberg
46ad4f7f93 http2: avoid superfluous Curl_expire() calls
... only call it when there is data arriving for another handle than the
one that is currently driving it.

Improves single-stream download performance quite a lot.

Thanks-to: Tatsuhiro Tsujikawa
Bug: http://curl.haxx.se/mail/lib-2015-09/0097.html
2015-09-27 23:23:33 +02:00
Daniel Stenberg
790d6de485 readwrite_data: set a max number of loops
... as otherwise a really fast pipe can "lock" one transfer for some
protocols, like with HTTP/2.
2015-09-27 20:48:35 +02:00
Sergei Nikulov
4f037367ed CI: Added AppVeyor-CI for curl
Closes #439
2015-09-26 23:57:36 +02:00
Daniel Stenberg
32fc638ddf FTP: fix uploading ASCII with unknown size
... don't try to increase the supposed file size on newlines if we don't
know what file size it is!

Patch-by: lzsiga
2015-09-26 23:36:25 +02:00
Tatsuhiro Tsujikawa
119037325d build: fix failures with -Wcast-align and -Werror
Closes #457
2015-09-26 23:10:20 +02:00
Tatsuhiro Tsujikawa
710bb89cf3 curl-confopts.m4: Add missing ')'
... for CURL_CHECK_OPTION_RT

Closes #456
2015-09-26 23:09:40 +02:00
Jay Satiro
095fe60e27 curl_easy_getinfo.3: Add brief description for each CURLINFO 2015-09-25 02:37:42 -04:00
Jakub Zakrzewski
4d60e125de CMake: Ensure discovered include dirs are considered
...during header checks. Otherwise some following header tests
(incorrectly) fail.

Closes #436
2015-09-23 15:19:54 +02:00
Jakub Zakrzewski
7c478cad57 CMake: Put "winsock2.h" before "windows.h" during configure checks
"windows.h" includes "winsock.h" what causes many redefinition errors
if "winsock2.h" is included afterwards and can cause build to fail.
2015-09-23 15:18:38 +02:00
Daniel Stenberg
0110cced2a tests: disable 1510 due to CI-problems on github 2015-09-23 13:53:38 +02:00
Mike Crowe
5f87906e0e gnutls: Report actual GnuTLS error message for certificate errors
If GnuTLS fails to read the certificate then include whatever reason it
provides in the failure message reported to the client.

Signed-off-by: Mike Crowe <mac@mcrowe.com>
2015-09-23 13:44:40 +02:00
Daniel Stenberg
684bf30802 RELEASE-NOTES: synced with 6b56901b56e 2015-09-22 22:21:58 +02:00
Mike Crowe
6b56901b56 gnutls: Support CURLOPT_KEYPASSWD
The gnutls vtls back-end was previously ignoring any password set via
CURLOPT_KEYPASSWD. Presumably this was because
gnutls_certificate_set_x509_key_file did not support encrypted keys.

gnutls now has a gnutls_certificate_set_x509_key_file2 function that
does support encrypted keys. Let's determine at compile time whether the
available gnutls supports this new function. If it does then use it to
pass the password. If it does not then emit a helpful diagnostic if a
password is set. This is preferable to the previous behaviour of just
failing to read the certificate without giving a reason in that case.

Signed-off-by: Mike Crowe <mac@mcrowe.com>
2015-09-22 17:30:33 +02:00
Daniel Stenberg
7362008c1c CURLINFO_TLS_SESSION: always return backend info
... even for those that don't support providing anything in the
'internals' struct member since it offers a convenient way for
applications to figure this out.
2015-09-22 17:21:37 +02:00
Daniel Hwang
1467dec147 tool: remove redundant libcurl check
The easysrc generation is run only when --libcurl is initialized.

Ref: https://github.com/bagder/curl/issues/429

Closes #448
2015-09-22 17:06:28 +02:00
Richard van den Berg
0583ed3e48 CURLOPT_PROXY.3: A proxy given as env variable gets no special treatment
Closes #449
2015-09-22 16:54:28 +02:00
Daniel Stenberg
67ae07c2e0 TODO: 5.7 More compressions
Like for example brotli, as being implemented in Firefox now.
2015-09-22 10:53:55 +02:00
Jay Satiro
3f8d4e264d tool_operate: Don't call easysrc cleanup unless --libcurl
- Review of 4d95491.

The author changed it so easysrc only initializes when --libcurl but did
not do the same for the call to easysrc cleanup.

Ref: https://github.com/bagder/curl/issues/429
2015-09-21 02:21:38 -04:00
Viktor Szakats
bb72b9453d CURLOPT_PINNEDPUBLICKEY.3: replace test.com with example.com
closes #443
2015-09-20 18:41:23 +02:00
Daniel Stenberg
5fde69cdc3 KNOWN_BUGS: 91 "curl_easy_perform hangs with imap and PolarSSL"
Closes #334
2015-09-20 13:34:16 +02:00
Daniel Stenberg
443014e905 KNOWN_BUGS: add link to #85 2015-09-20 13:31:22 +02:00
Daniel Stenberg
37af1766e9 tests: disable 1801 until fixed
It is unreliable and causes CI problems on github

Closes #380
2015-09-20 13:12:44 +02:00
Daniel Stenberg
67dbf8aa9c RELEASE-NOTES: synced with 4d95491636ee 2015-09-20 13:00:19 +02:00
Daniel Lee Hwang
4d95491636 tool: generate easysrc only on --libcurl
Code should only be generated when --libcurl is used.

Bug: https://github.com/bagder/curl/issues/429
Reported-by: @greafhe, Jay Satiro

Closes #429
Closes #442
2015-09-20 12:54:18 +02:00
Jay Satiro
47b7d658b4 vtls: Change designator name for server's pubkey hash
- Change the designator name we use to show the base64 encoded sha256
hash of the server's public key from 'pinnedpubkey' to
'public key hash'.

Though the server's public key hash is only shown when comparing pinned
public key hashes, the server's hash may not match one of the pinned.
2015-09-19 22:40:40 -04:00
Isaac Boukris
f65e07ca59 NTLM: Reset auth-done when using a fresh connection
With NTLM a new connection will always require authentication.
Fixes #435
2015-09-19 23:21:05 +02:00
Daniel Hwang
30c131f51f ssl: add server cert's "sha256//" hash to verbose
Add a "pinnedpubkey" section to the "Server Certificate" verbose

Bug: https://github.com/bagder/curl/issues/410
Reported-by: W. Mark Kubacki

Closes #430
Closes #410
2015-09-19 23:17:39 +02:00
Jakub Zakrzewski
c979a3d0c4 openldap: only part of LDAP query results received
Introduced with commit 65d141e6da5c6003a1592bbc87ee550b0ad75c2f

Closes #440
2015-09-19 23:06:03 +02:00
Alessandro Ghedini
c184a5c6bc openssl: don't output certinfo data 2015-09-19 22:53:31 +02:00
Alessandro Ghedini
c00cec9864 openssl: refactor certificate parsing to use OpenSSL memory BIO
Fixes #427
2015-09-19 22:53:31 +02:00
Kamil Dudka
958d2ffb19 nss: prevent NSS from incorrectly re-using a session
Without this workaround, NSS re-uses a session cache entry despite the
server name does not match.  This causes SNI host name to differ from
the actual host name.  Consequently, certain servers (e.g. github.com)
respond by 400 to such requests.

Bug: https://bugzilla.mozilla.org/1202264
2015-09-18 17:38:51 +02:00
Kamil Dudka
a9fd53887b nss: check return values of NSS functions 2015-09-18 17:07:22 +02:00
Daniel Stenberg
65ca3b083c CURLOPT_PINNEDPUBLICKEY.3: mention error code 2015-09-17 08:54:32 +02:00
Daniel Stenberg
82e3e8e31f openssl: build with < 0.9.8
... without sha256 support and no define saying so.

Reported-by: Rajkumar Mandal
2015-09-17 08:54:04 +02:00
Daniel Stenberg
887a4a19aa libcurl-errors.3: add two missing error codes
CURLE_SSL_PINNEDPUBKEYNOTMATCH and CURLE_SSL_INVALIDCERTSTATUS
2015-09-17 08:49:06 +02:00
Jay Satiro
b550a1c067 CURLOPT_PINNEDPUBLICKEY.3: Improve pubkey extraction example
- Show how a certificate can be obtained using OpenSSL.

Bug: https://github.com/bagder/curl/pull/430
Reported-by: Daniel Hwang
2015-09-14 03:16:04 -04:00
Daniel Stenberg
202162daeb http2: removed unused function 2015-09-13 16:33:51 +02:00
Daniel Stenberg
a7cb6a28e2 CURLINFO_ACTIVESOCKET.3: mention it replaces *LASTSOCKET 2015-09-12 23:37:52 +02:00
Daniel Stenberg
3d4ffa71f7 opts: add CURLINFO_* man pages to dist 2015-09-12 23:22:33 +02:00
Daniel Stenberg
cdba82e1c2 opts: 19 more CURLINFO_* options made into stand-alone man pages 2015-09-12 23:13:47 +02:00
Daniel Stenberg
68c620fdc7 RELEASE-NOTES: synced with fad9604613 2015-09-12 12:54:58 +02:00
Daniel Stenberg
fad9604613 curl: customrequest_helper: deal with NULL custom method 2015-09-11 18:49:28 +02:00
Svyatoslav Mishyn
0e17369f5b CURLOPT_FNMATCH_FUNCTION.3: fix typo
s => is

Closes #428
2015-09-11 18:43:54 +02:00
Daniel Stenberg
481e0de00a curl: point out unnecessary uses of -X in verbose mode
It uses 'Note:' as a prefix as opposed to the common 'Warning:' to take
down the tone a bit.

It adds a warning for using -XHEAD on other methods becasue that may
lead to a hanging connection.
2015-09-11 08:53:53 +02:00
Jay Satiro
df6a4d3519 curl_sspi: fix possibly undefined CRYPT_E_REVOKED
Bug: https://github.com/bagder/curl/pull/411
Reported-by: Viktor Szakats
2015-09-10 02:17:33 -04:00
Jay Satiro
e30763c72e buildconf.bat: fix syntax error 2015-09-09 02:46:48 -04:00
Benjamin Kircher
6a0bd6ce8b winbuild: run buildconf.bat if necessary 2015-09-09 02:37:57 -04:00
Svyatoslav Mishyn
4e6f7aee64 docs: fix argument type for CURLINFO_SPEED_*, CURLINFO_SIZE_*
long => double
2015-09-08 21:19:34 -04:00
Sergei Nikulov
1b8a5afe78 cmake: IPv6 : disable Unix header check on Windows platform
Closes #409
2015-09-08 15:49:15 +02:00
Daniel Stenberg
87e533ace0 parse_proxy: reject illegal port numbers
If the port number in the proxy string ended weirdly or the number is
too large, skip it. Mostly as a means to bail out early if a "bare" IPv6
numerical address is used without enclosing brackets.

Also mention the bracket requirement for IPv6 numerical addresses to the
man page for CURLOPT_PROXY.

Closes #415

Reported-by: Marcel Raad
2015-09-08 15:17:00 +02:00
Daniel Stenberg
27620171ff FTP: do_more: add check for wait_data_conn in upload case
In some timing-dependnt cases when a 4xx response immediately followed
after a 150 when a STOR was issued, this function would wrongly return
'complete == true' while 'wait_data_conn' was still set.

Closes #405

Reported-by: Patricia Muscalu
2015-09-08 09:29:03 +02:00
Svyatoslav Mishyn
664398e43b CURLOPT_TLSAUTH_TYPE.3: update description
Closes #414
Closes #413
2015-09-06 23:12:17 +02:00
Svyatoslav Mishyn
3a4f42dd0c CURLOPT_PATH_AS_IS.3: fix typo
leavit => leaveit

closes #412
2015-09-05 23:19:49 +02:00
Svyatoslav Mishyn
5ea0004438 CURLINFO_SSL_VERIFYRESULT.3: add short description 2015-09-05 23:19:33 +02:00
Svyatoslav Mishyn
f1ccf68e8c CURLINFO_SSL_ENGINES.3: add short description 2015-09-05 23:19:33 +02:00
Svyatoslav Mishyn
d36d83ba4b CURLINFO_CONTENT_LENGTH_UPLOAD.3: replace "receive" with "get" for consistency 2015-09-05 23:19:33 +02:00
Svyatoslav Mishyn
5dc556031b CURLINFO_REDIRECT_TIME.3: remove redundant '!' 2015-09-05 23:19:33 +02:00
Kamil Dudka
0e91737615 Revert "has: generate the curl/has.h header"
This reverts commit a60bde79f9adeb135d5c642a07f0d783fbfbbc25 I have
pushed by mistake.  Apologies for my incompetent use of the git repo!
2015-09-04 16:12:26 +02:00
Kamil Dudka
7380433d6a nss: do not directly access SSL_ImplementedCiphers[]
It causes dynamic linking issues at run-time after an update of NSS.

Bug: https://lists.fedoraproject.org/pipermail/devel/2015-September/214117.html
2015-09-04 14:35:36 +02:00
Daniel Stenberg
a60bde79f9 has: generate the curl/has.h header
changed macro name, moved and renamed script to become docs/libcurl/has.pl,
generate code that is checksrc compliant
2015-09-04 10:41:43 +02:00
Daniel Stenberg
82db076d9f gitignore: ignore more generated VC Makefiles 2015-09-03 23:35:41 +02:00
Daniel Stenberg
25a2e8ebaf projects/Windows/.gitignore: ignore generated files for release 2015-09-03 23:34:53 +02:00
Daniel Stenberg
1869164293 http2: don't pass on Connection: headers
RFC 7540 section 8.1.2.2 states: "An endpoint MUST NOT generate an
HTTP/2 message containing connection-specific header fields; any message
containing connection-specific header fields MUST be treated as
malformed"

Closes #401
2015-09-03 22:23:50 +02:00
Daniel Stenberg
4ceddcf8ca curl.1: update RFC references 2015-09-03 19:52:23 +02:00
Daniel Stenberg
e1a4bab86a CURLOPT_POSTREDIR.3: update RFC number and section 2015-09-03 17:33:16 +02:00
Daniel Stenberg
8a0ff1e529 CURLOPT_FOLLOWLOCATION.3: mention methods for redirects
and some general cleaning up
2015-09-03 17:27:40 +02:00
Marcel Raad
668231c309 inet_pton.c: Fix MSVC run-time check failure (2)
This fixes another run-time check failure because of a narrowing cast on
Visual C++.

Closes #408
2015-09-03 11:37:50 +02:00
Jay Satiro
cb6a07fed0 docs: Warn about any-domain cookies and multiple transfers
- Warn that cookies without a domain are sent to any domain:
CURLOPT_COOKIELIST, CURLOPT_COOKIEFILE, --cookie

- Note that imported Set-Cookie cookies without a domain are no longer
exported:
CURLINFO_COOKIELIST, CURLOPT_COOKIEJAR, --cookie-jar
2015-09-03 02:35:11 -04:00
Steve Holme
b604b7f040 tool_sdecls.h: Fixed compilation warning from commit 4a889441d3
tool_sdecls.h:139 warning: comma at end of enumerator list
2015-09-02 06:52:12 +01:00
Daniel Stenberg
9bb198026e opts: 8 more CURLINFO* options as stand-alone man pages 2015-09-02 00:00:53 +02:00
Daniel Stenberg
749c0ca05b RELEASE-NOTES: synced with c764cb4add1a8 2015-08-31 23:17:53 +02:00
Daniel Stenberg
c764cb4add man-pages: more SEE ALSO links 2015-08-31 16:03:53 +02:00
Daniel Stenberg
6099f5fcac opts: more CURLINFO_* options as stand-alone man pages 2015-08-31 15:28:21 +02:00
Steve Holme
4963948089 sasl: Only define Curl_sasl_digest_get_pair() when CRYPTO_AUTH enabled
Introduced in commit 59f3f92ba6 this function is only implemented when
CURL_DISABLE_CRYPTO_AUTH is not defined. As such we shouldn't define
the function in the header file either.
2015-08-31 12:44:01 +01:00
Steve Holme
b850437991 sasl: Updated SPN variables and comments for consistency
In places the "host name" and "realm" variable was referred to as
"instance" whilst in others it was referred to as "host".
2015-08-31 12:43:58 +01:00
Daniel Stenberg
eb8283bb1a configure: check for HMAC_Update in openssl
Turns out HMAC_Init is now deprecated in openssl master (and I spelled
HMAC_Init_ex wrong in previous commit)
2015-08-30 23:21:30 +02:00
Steve Holme
415f0370ea win32: Use DES_set_odd_parity() from OpenSSL/BoringSSL by default
Set HAVE_DES_SET_ODD_PARITY when using OpenSSL/BoringSSL as native
Windows builds don't use the autoconf tools.
2015-08-30 22:06:10 +01:00
Steve Holme
347a6ee597 des: Fixed compilation warning from commit 613e5022fe
curl_ntlm_core.c:150: warning 'Curl_des_set_odd_parity' undefined;
                      assuming extern returning int
2015-08-30 21:45:30 +01:00
Steve Holme
2a59fb25cc buildconf.bat: Fixed double blank line in 'curl manual' warning output 2015-08-30 15:09:43 +01:00
Steve Holme
fb0825cb0a makefiles: Added our standard copyright header
But kept the original author, when they were specified in a comment, as
the initial copyright holder.
2015-08-30 14:51:13 +01:00
Jay Satiro
dfeb85a187 CURLOPT_FILETIME.3: CURLINFO_FILETIME has its own manpage now 2015-08-29 23:23:58 -04:00
Daniel Stenberg
96a3488eae CURLINFO_RESPONSE_CODE.3: added short description 2015-08-29 13:55:00 +02:00
Daniel Stenberg
45e918564a opts: 7 initial CURLINFO_* options as stand-alone man pages 2015-08-28 22:58:00 +02:00
Nikolai Kondrashov
1abb218fe0 libcurl.m4: Put braces around empty if body
Put braces around empty "if" body in libcurl.m4 check to avoid warning:

        suggest braces around empty body in an 'if' statement

and make it work with -Werror builds.

Closes #402
2015-08-28 22:51:55 +02:00
Svyatoslav Mishyn
ac7be02e69 curl_easy_escape.3: escape '\n'
Closes #398
2015-08-25 22:44:22 +02:00
Svyatoslav Mishyn
37f173cfd0 curl_easy_{escape,setopt}.3: fix example
remove redundant '}'
2015-08-25 22:44:14 +02:00
Sergei Nikulov
2132708ac2 cmake: added Windows SSL support
Closes #399
2015-08-25 22:42:28 +02:00
Daniel Stenberg
4a889441d3 curl: point out the conflicting HTTP methods if used
It isn't always clear to the user which options that cause the HTTP
methods to conflict so by spelling them out it should hopefully be
easier to understand why curl complains.
2015-08-25 09:20:56 +02:00
Daniel Stenberg
ce034356d2 curl: clarify that users can only specify one _METHOD_ 2015-08-25 00:04:03 +02:00
Svyatoslav Mishyn
f21408132a curl_easy_{escape,unescape}.3: "char *" vs. "const char *"
Closes #395
2015-08-24 23:58:57 +02:00
Patrick Monnerat
aec249f89f os400: include new options in wrappers and update ILE/RPG binding. 2015-08-24 14:20:34 +02:00
Daniel Stenberg
e7d171da6b KNOWN_BUGS: #2, not reading a HEAD response-body is not a bug
... since HTTP is forbidden to return any such.
2015-08-24 12:56:20 +02:00
Daniel Stenberg
874413b3e1 KNOWN_BUGS: #78 zero-length files is already fixed! 2015-08-24 12:53:38 +02:00
Razvan Cojocaru
62f306ff34 getinfo: added CURLINFO_ACTIVESOCKET
This patch addresses known bug #76, where on 64-bit Windows SOCKET is 64
bits wide, but long is only 32, making CURLINFO_LASTSOCKET unreliable.

Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
2015-08-24 12:34:17 +02:00
Daniel Stenberg
36f6f6f4f2 http2: remove dead code
Leftovers from when we removed the private socket hash.

Coverity CID 1317365, "Logically dead code"
2015-08-24 11:31:45 +02:00
Daniel Stenberg
a78534794e ntlm: mark deliberate switch case fall-through
Coverity CID 1317367, "Missing break in switch"
2015-08-24 11:29:22 +02:00
Daniel Stenberg
110d99c661 http2: on_frame_recv: get a proper 'conn' for the debug logging
"Explicit null dereferenced (FORWARD_NULL)"

Coverity CID 1317366
2015-08-24 11:26:30 +02:00
Daniel Stenberg
6d91b70d8b RELEASE-NOTES: synced with 2acaf3c804 2015-08-24 00:21:08 +02:00
Dan Fandrich
2acaf3c804 tool: fix memory leak with --proto-default option 2015-08-23 20:57:17 +02:00
Nathaniel Waisbrot
9756d1da76 CURLOPT_DEFAULT_PROTOCOL: added
- Add new option CURLOPT_DEFAULT_PROTOCOL to allow specifying a default
protocol for schemeless URLs.

- Add new tool option --proto-default to expose
CURLOPT_DEFAULT_PROTOCOL.

In the case of schemeless URLs libcurl will behave in this way:

When the option is used libcurl will use the supplied default.

When the option is not used, libcurl will follow its usual plan of
guessing from the hostname and falling back to 'http'.
2015-08-22 21:57:14 -04:00
Jay Satiro
22cb631198 runtests: Allow for spaces in server-verify curl custom path 2015-08-22 21:19:34 -04:00
Daniel Stenberg
613e5022fe NTLM: recent boringssl brought DES_set_odd_parity back
... so improve the #ifdefs for using our local implementation.
2015-08-22 23:59:18 +02:00
Daniel Stenberg
2c12ac8de2 configure: detect latest boringssl
Since boringssl brought back DES_set_odd_parity again, it cannot be used
to differentiate from boringssl. Using the OPENSSL_IS_BORINGSSL define
seems better anyway.

URL: f551028d5c%5E!/
Original-patch-by: Bertrand Simonnet

Closes #393
2015-08-22 00:08:03 +02:00
Daniel Stenberg
30aa38c818 configure: change functions to detect openssl (clones)
... since boringssl moved the former ones and the check started to fail.

URL: f551028d5c%5E!/
Original-patch-by: Bertrand Simonnet
2015-08-22 00:03:56 +02:00
Alessandro Ghedini
8363656cb4 openssl: handle lack of server cert when strict checking disabled
If strict certificate checking is disabled (CURLOPT_SSL_VERIFYPEER
and CURLOPT_SSL_VERIFYHOST are disabled) do not fail if the server
doesn't present a certificate at all.

Closes #392
2015-08-21 15:32:51 +02:00
Daniel Stenberg
38ef1b3e7f ftp: clear the do_more bit when the server has connected
The multi state machine would otherwise go into the DO_MORE state after
DO, even for the case when the FTP state machine had already performed
those duties, which caused libcurl to get stuck in that state and fail
miserably. This occured for for active ftp uploads.

Reported-by: Patricia Muscalu
2015-08-21 13:30:08 +02:00
Jactry Zeng
1d89fd983a travis.yml: Add OS X testbot. 2015-08-21 12:48:52 +02:00
Rémy Léone
b3c7f5159a travis: Upgrading to container based build
http://docs.travis-ci.com/user/migrating-from-legacy

Closes #388
2015-08-20 23:28:05 +02:00
Daniel Stenberg
1cea72bfde RELEASE-NOTES: synced with 14ff86256b13e 2015-08-20 23:12:21 +02:00
Erik Janssen
14ff86256b rtsp: stop reading empty DESCRIBE responses
Based-on-patch-by: Jim Hollinger
2015-08-20 23:07:03 +02:00
Erik Janssen
e4fb5f2f61 rtsp: support basic/digest authentication 2015-08-20 23:02:28 +02:00
Sam Roth
e67e71d62b CURLMOPT_PUSHFUNCTION.3: fix argument types
Closes #389
Closes #386
2015-08-19 10:35:24 +02:00
Marcel Raad
618dfd65e4 inet_pton.c: Fix MSVC run-time check failure
Visual Studio complains with a message box:

"Run-Time Check Failure #1 - A cast to a smaller data type has caused a
loss of data.  If this was intentional, you should mask the source of
the cast with the appropriate bitmask.

For example:
char c = (i & 0xFF);

Changing the code in this way will not affect the quality of the
resulting optimized code."

This is because only 'val' is cast to unsigned char, so the "& 0xff" has
no effect.

Closes #387
2015-08-19 09:31:45 +02:00
Jay Satiro
1f1f131e09 docs: Update the redirect protocols disabled by default
- Clarify that FILE and SCP are disabled by default since 7.19.4
- Add that SMB and SMBS are disabled by default since 7.40.0
- Add CURLPROTO_SMBS to the list of protocols
2015-08-18 01:38:07 -04:00
Jay Satiro
9518139c73 gitignore: Sort for readability
find . -name .gitignore -print0 | xargs -i -0 sort -o '{}' '{}'
2015-08-18 01:03:05 -04:00
Daniel Stenberg
5a136398ed curl_easy_getinfo.3: fix superfluous space
... and changed "oriented" to "related"

Closes #378
2015-08-15 23:56:28 +02:00
Daniel Stenberg
7166d91a03 CURLOPT_HTTP_VERSION.3: connection re-use goes before version 2015-08-15 23:36:28 +02:00
Daniel Kahn Gillmor
31673ff517 curl.1: Document weaknesses in SSLv2 and SSLv3
Acknowledge that SSLv3 is also widely considered to be insecure.

Also, provide references for people who want to know more about why it's
insecure.
2015-08-15 22:53:46 +02:00
Steve Holme
bedf0a588e generate.bat: Added support for generating only the prerequisite files 2015-08-14 20:59:48 +01:00
Steve Holme
6ba9a1b952 generate.bat: Only call buildconf.bat if it exists 2015-08-14 20:46:11 +01:00
Steve Holme
bc66c21c23 generate.bat: Fixed issues when ran in directories with special chars 2015-08-14 20:38:57 +01:00
Brad King
a9c97fba81 cmake: Fix CurlTests check for gethostbyname_r with 5 arguments
Fix the check code to pass 5 arguments instead of 6.  This typo was
introduced by commit aebfd4cfbf (cmake: fix gethostby{addr,name}_r in
CurlTests, 2014-10-31).
2015-08-14 16:12:27 +02:00
Steve Holme
1a85c8ef15 * buildconf.bat: Fixed issues when ran in directories with special chars
Bug: https://github.com/bagder/curl/pull/379
Reported-by: Daniel Seither
2015-08-14 07:34:37 +01:00
Jay Satiro
9e1b1ca606 curl_global_init_mem.3: Stronger thread safety warning
Bug: http://curl.haxx.se/mail/lib-2015-08/0016.html
Reported-by: Eric Ridge
2015-08-13 23:29:27 -04:00
Svyatoslav Mishyn
15da07d2f2 curl_multi_add_handle.3: fix a typo
"can not" => "cannot"

closes #377
2015-08-12 15:23:59 +02:00
Alessandro Ghedini
5be0c88297 docs: fix typos
closes #376
2015-08-12 11:29:55 +02:00
Daniel Stenberg
052a9dfdad bump: start working toward 7.45.0 2015-08-12 09:07:37 +02:00
Daniel Stenberg
7332ac565c THANKS: remove duplicate name 2015-08-12 08:34:55 +02:00
Daniel Stenberg
105828a309 THANKS-filter: merge Todd's names 2015-08-12 08:32:10 +02:00
Daniel Stenberg
2bcd3ef7b2 THANKS: 13 new contributors from the 7.44.0 RELEASE-NOTES 2015-08-12 08:21:44 +02:00
Daniel Stenberg
1a7f66a3de RELEASE-NOTES: synced with c75a1e775061 2015-08-11 20:13:01 +02:00
Svyatoslav Mishyn
c75a1e7750 curl_formget.3: correct return code
Closes #375
2015-08-11 20:08:33 +02:00
Svyatoslav Mishyn
daf7f98c11 libcurl-tutorial.3: fix formatting
Closes #374
2015-08-11 14:59:07 +02:00
Svyatoslav Mishyn
bb0acba67d curl_easy_recv.3: fix formatting 2015-08-11 14:58:54 +02:00
Anders Bakken
5778e6f526 http2: discard frames with no SessionHandle
Return 0 instead of NGHTTP2_ERR_CALLBACK_FAILURE if we can't locate the
SessionHandle. Apparently mod_h2 will sometimes send a frame for a
stream_id we're finished with.

Use nghttp2_session_get_stream_user_data and
nghttp2_session_set_stream_user_data to identify SessionHandles instead
of a hash.

Closes #372
2015-08-11 08:16:33 +02:00
Daniel Stenberg
c8a656d3c7 RELEASE-NOTES: synced with 9ee40ce2aba 2015-08-11 00:16:19 +02:00
Viktor Szakats
9ee40ce2ab build: refer to fixed libidn versions
closes #371
2015-08-10 23:20:18 +02:00
Daniel Stenberg
0b8e9c8522 Revert "configure: disable libidn by default"
This reverts commit e6749055d65398315fd77f5b5b8234c5552ac2d3.

... since libidn has since been fixed.
2015-08-10 14:54:41 +02:00
Jakub Zakrzewski
9a5574ca7b CMake: s/HAVE_GSS_API/HAVE_GSSAPI/ to match header define
Otherwise the build only pretended to use GSS-API

Closes #370
2015-08-10 13:39:35 +02:00
Daniel Stenberg
ade6682f8d SFTP: fix range request off-by-one in size check
Reported-by: Tim Stack

Closes #359
2015-08-10 09:18:19 +02:00
Daniel Stenberg
002d58f1e8 test46: update cookie expire time
... since it went old and thus was expired and caused the test to fail!
2015-08-10 00:12:12 +02:00
Steve Holme
cde447217f generate.bat: Use buildconf.bat for prerequisite file generation 2015-08-09 18:02:53 +01:00
Steve Holme
9d29afdfe3 buildconf.bat: Tidy up of comments after recent commits 2015-08-09 18:02:34 +01:00
Steve Holme
0cc0b7e268 buildconf.bat: Added full generation of src\tool_hugehelp.c
Added support for generating the full man page based on code from
generate.bat.
2015-08-09 17:54:09 +01:00
Steve Holme
aa9ead36a4 buildconf.bat: Added detection of groff, nroff, perl and gzip
To allow for the full generation of tool_hugehelp.c added detection of
the required programs - based on code from generate.bat.
2015-08-09 17:12:33 +01:00
Steve Holme
ecece2cfb5 buildconf.bat: Move DOS variable clean-up code to separate function
Rather than duplicate future variables, during clean-up of both success
and error conditions, use a common function that can be called by both.
2015-08-09 17:02:27 +01:00
Steve Holme
4d13b78aec RELEASE-NOTES: Synced with 39dcf352d2 2015-08-09 12:04:57 +01:00
Steve Holme
39dcf352d2 buildconf.bat: Added error messages on failure 2015-08-09 11:46:28 +01:00
Steve Holme
55a255ee9c buildconf.bat: Generate and clean files in the same order 2015-08-09 11:46:26 +01:00
Steve Holme
4c47cbf533 buildconf.bat: Maintain compatibility with DOS based systems
Commit f08e30d7bc broke compatibility with DOS and non Windows NT based
versions of Windows due to the use of the setlocal command.
2015-08-09 11:46:24 +01:00
Jay Satiro
c22fae7ccc CURLOPT_RESOLVE.3: Note removal support was added in 7.42
Bug: http://curl.haxx.se/mail/lib-2015-08/0019.html
Reported-by: Inca R
2015-08-09 02:33:25 -04:00
Steve Holme
d712da787e checksrc.bat: Fixed error when missing *.c and *.h files
File Not Found
2015-08-08 21:01:31 +01:00
Steve Holme
2b743dcf8e checksrc.bat: Fixed incorrect 'lib\vtls' path check in commit 333c36b276 2015-08-08 21:01:29 +01:00
Steve Holme
333c36b276 checksrc.bat: Fixed error when [directory] isn't a curl source directory
The system cannot find the file specified.
2015-08-08 11:36:47 +01:00
Steve Holme
1ab763acce checksrc.bat: Added check for unknown arguments 2015-08-08 11:36:47 +01:00
Steve Holme
a8e9e0c205 scripts: Added missing comments 2015-08-08 11:36:45 +01:00
Steve Holme
4a21346ef3 scripts: Always perform setlocal and endlocal calls in pairs
Ensure that there isn't a mismatch between setlocal and endlocal calls,
which could have happened due to setlocal being called after certain
error conditions were checked for.
2015-08-08 11:13:21 +01:00
Steve Holme
4aee1f9cf5 scripts: Allow -help to be specified in any argument
Allow the -help command line argument to be specified in any argument
and not just as the first.
2015-08-08 11:13:19 +01:00
juef
b9b7ccd04a curl_multi_remove_handle.3: fix formatting
closes #366
2015-08-06 23:37:26 +02:00
Steve Holme
84d122a8d6 README: Added notes about 'Running DLL based configurations'
...as well as a TODO for a future enhancement to the project files.

Thanks-to: Jay Satiro
2015-08-06 22:00:35 +01:00
Steve Holme
5b9151231d RELEASE-NOTES: Synced with cf8975387f 2015-08-06 19:00:36 +01:00
Steve Holme
cf8975387f buildconf.bat: Synchronise no repository error with generate.bat 2015-08-06 18:53:49 +01:00
Steve Holme
0342ada31f generate.bat: Added a check for the presence of a git repository 2015-08-06 18:53:30 +01:00
Jay Satiro
3f5f042e5d build: Added wolfSSL configurations to VC10+ project files
URL: https://github.com/bagder/curl/pull/174
2015-08-06 18:13:09 +01:00
Jay Satiro
bb6b521f69 build: Added wolfSSL build script for Visual Studio projects
Added the wolfSSL build script, based on build-openssl.bat, as well as
the property sheet and header file required for the upcoming additions
to the Visual Studio project files.
2015-08-06 18:02:19 +01:00
Daniel Stenberg
8279dd7d39 CHANGES: refer to the online changelog
Suggested-by: mc0e
2015-08-06 15:28:27 +02:00
Isaac Boukris
fe6049f04b NTLM: handle auth for only a single request
Currently when the server responds with 401 on NTLM authenticated
connection (re-used) we consider it to have failed.  However this is
legitimate and may happen when for example IIS is set configured to
'authPersistSingleRequest' or when the request goes thru a proxy (with
'via' header).

Implemented by imploying an additional state once a connection is
re-used to indicate that if we receive 401 we need to restart
authentication.

Closes #363
2015-08-06 14:39:26 +02:00
Steve Holme
7f11259eb7 RELEASE-NOTES: Synced with 473807b95f 2015-08-05 19:34:47 +01:00
Steve Holme
473807b95f generate.bat: Use buildconf.bat for prerequisite file clean-up 2015-08-05 19:15:46 +01:00
Steve Holme
f08e30d7bc buildconf.bat: Added support for file clean-up via -clean 2015-08-05 18:52:50 +01:00
Steve Holme
6428b8de42 buildconf.bat: Added progress output 2015-08-05 18:02:37 +01:00
Steve Holme
97c9d31884 buildconf.bat: Avoid using goto for file not in repository 2015-08-05 17:54:20 +01:00
Daniel Stenberg
9947f259bf curl_slist_append.3: add error checking to the example 2015-08-05 14:28:39 +02:00
Steve Holme
33de75ed63 buildconf.bat: Added display of usage text with -help 2015-08-05 06:47:47 +01:00
Steve Holme
df5965ebf4 buildconf.bat: Added exit codes for error handling 2015-08-05 06:45:21 +01:00
Steve Holme
6e566451ce buildconf.bat: Added our standard copyright header 2015-08-05 06:43:26 +01:00
Steve Holme
07f7cdc309 buildconf.bat: Use lower-case for commands and reserved keywords 2015-08-05 06:40:48 +01:00
Steve Holme
3725748599 generate.bat: Only clean prerequisite files when in ALL mode 2015-08-04 19:22:36 +01:00
Steve Holme
1e67bc5eaf generate.bat: Moved error messages out of sub-routines 2015-08-04 19:15:13 +01:00
Steve Holme
12f915ca2a generate.bat: More use of lower-case for commands and reserved keywords 2015-08-04 19:09:15 +01:00
Daniel Stenberg
4b96240d3f libcurl.3: fix a single typo
Closes #361
2015-08-03 23:28:31 +02:00
Daniel Stenberg
1b3d3f9237 RELEASE-NOTES: synced with c4eb10e2f06f 2015-08-03 14:50:18 +02:00
Daniel Stenberg
c4eb10e2f0 SSH: three state machine fixups
The SSH state machine didn't clear the 'rc' variable appropriately in a
two places which prevented it from looping the way it should. And it
lacked an 'else' statement that made it possible to erroneously get
stuck in the SSH_AUTH_AGENT state.

Reported-by: Tim Stack

Closes #357
2015-08-02 22:50:31 +02:00
Daniel Stenberg
3b4ee0d432 curl_gssapi: remove 'const' to fix compiler warnings
initialization discards 'const' qualifier from pointer target type
2015-08-02 00:24:38 +02:00
Daniel Stenberg
c092b0f0f3 docs: formpost needs the full size at start of upload
Closes #360
2015-08-02 00:15:39 +02:00
Steve Holme
f75b6065db sspi: Fix typo from left over from old code which referenced NTLM
References to NTLM in the identity generation should have been removed
in commit c469941293 but not all were.
2015-08-01 23:09:03 +01:00
Steve Holme
11ab3f8918 win32: Fix compilation warnings from commit 40c921f8b8
connect.c:953:5: warning: initializer element is not computable at load
                 time
connect.c:953:5: warning: missing initializer for field 'dwMinorVersion'
                 of 'OSVERSIONINFOEX'
curl_sspi.c:97:5: warning: initializer element is not computable at load
                  time
curl_sspi.c:97:5: warning: missing initializer for field 'szCSDVersion'
                  of 'OSVERSIONINFOEX'
2015-08-01 22:55:01 +01:00
Steve Holme
a1b2a6bd93 schannel: Fix compilation warning from commit 7a8e861a56
schannel.c:1125:5: warning: missing initializer for field 'dwMinorVersion'
                   of 'OSVERSIONINFOEX' [-Wmissing-field-initializers
2015-08-01 22:54:57 +01:00
Daniel Stenberg
c8331f515e libcurl-thread.3: minor reformatting 2015-07-31 23:19:02 +02:00
Jay Satiro
23b84e448f curl_global_init_mem.3: Warn threaded resolver needs thread safe funcs
Bug: http://curl.haxx.se/mail/lib-2015-07/0149.html
Reported-by: Eric Ridge
2015-07-31 02:38:44 -04:00
Jay Satiro
0da1f5dc5c libcurl-thread.3: Warn memory functions must be thread safe
Bug: http://curl.haxx.se/mail/lib-2015-07/0149.html
Reported-by: Eric Ridge
2015-07-31 01:58:03 -04:00
Steve Holme
909f0a82b0 RELEASE-NOTES: Synced with 8b1d00ac1a 2015-07-31 06:24:35 +01:00
Steve Holme
8b1d00ac1a INSTALL: Minor formatting correction in 'Legacy Windows and SSL' section
...as well as some rewording.
2015-07-30 16:59:55 +01:00
Kamil Dudka
f7dcc7c118 http: move HTTP/2 cleanup code off http_disconnect()
Otherwise it would never be called for an HTTP/2 connection, which has
its own disconnect handler.

I spotted this while debugging <https://bugzilla.redhat.com/1248389>
where the http_disconnect() handler was called on an FTP session handle
causing 'dnf' to crash.  conn->data->req.protop of type (struct FTP *)
was reinterpreted as type (struct HTTP *) which resulted in SIGSEGV in
Curl_add_buffer_free() after printing the "Connection cache is full,
closing the oldest one." message.

A previously working version of libcurl started to crash after it was
recompiled with the HTTP/2 support despite the HTTP/2 protocol was not
actually used.  This commit makes it work again although I suspect the
root cause (reinterpreting session handle data of incompatible protocol)
still has to be fixed.  Otherwise the same will happen when mixing FTP
and HTTP/2 connections and exceeding the connection cache limit.

Reported-by: Tomas Tomecek
Bug: https://bugzilla.redhat.com/1248389
2015-07-30 15:16:43 +02:00
Viktor Szakats
ecf7618e12 ABI doc: use secure URL 2015-07-30 15:02:44 +02:00
Daniel Stenberg
5b9a006b8f ABI: remove the ascii logo
and made the indent level to 1
2015-07-30 12:16:14 +02:00
Daniel Stenberg
fc69e2f7ec libcurl-multi.3: mention curl_multi_wait
... and some general rewordings to improve this docs.

Reported-by: Tim Stack

Closes #356
2015-07-30 10:18:45 +02:00
Steve Holme
bdd8cf4777 maketgz: Fixed some VC makefiles missing from the release tarball
VC7, VC11, VC12 and VC14 makefiles were missing from the release
tarball.
2015-07-30 06:34:03 +01:00
Steve Holme
dda81c1d5f RELEASE-NOTES: Synced with 2d7e165761 2015-07-29 19:17:18 +01:00
Steve Holme
2d7e165761 build: Added VC14 project files to Makefile.am 2015-07-29 19:07:08 +01:00
Steve Holme
8356022d17 build: Added VC14 project files
Updates to Makefile.am for the generation of the project files in
the tarball to follow.
2015-07-29 18:42:48 +01:00
Jay Satiro
467309406e libcurl-thread.3: Clarify CURLOPT_NOSIGNAL takes long value 1L 2015-07-29 02:05:32 -04:00
Steve Holme
b656715da3 generate.bat: Use lower-case for commands and reserved keywords
Whilst there are no coding standards for the batch files used in curl,
most tend to use lower-case for keywords and upper-case for variables.
2015-07-28 23:08:24 +01:00
Steve Holme
9b95306d4c build: Added initial VC14 support to generate.bat
Visual Studio project files and updates to makefile.am to follow.
2015-07-28 22:55:49 +01:00
Steve Holme
98e8b050ef build: Fixed missing .opensdf files from VC10+ .gitignore files 2015-07-28 20:46:56 +01:00
Steve Holme
d9efd36907 build: Use $(ProjectName) macro for curl.exe and curld.exe filenames
This wasn't possible with the old curlsrc project filenames, but like
commit 2a615a2b64 and 11397eb6dd for libcurl use the built in Visual
Studio macros for the output filenames.
2015-07-28 20:44:59 +01:00
Steve Holme
1627930177 build: Renamed curl src Visual Studio project files
Following commit 957fcd9049 and in preparation for adding the VC14
project files renamed the curl source project files.
2015-07-28 20:44:14 +01:00
Jay Satiro
299b74fcfc libcurl-thread.3: Revert to stricter handle wording
.. also update formatting and add WinSSL and wolfSSL to the SSL/TLS
handlers list.
2015-07-28 13:57:06 +02:00
Jay Satiro
279965c923 libcurl-thread.3: Consolidate thread safety info
This is a new document to consolidate our thread safety information from
several documents (curl-www:features, libcurl.3, libcurl-tutorial.3).
Each document's section on multi-threading will now point to this one.
2015-07-28 13:57:06 +02:00
Steve Holme
7db03e5c21 README: Corrected formatting for 'Legacy Windows and SSL' section
...as well as some wording.
2015-07-27 00:48:53 +01:00
Steve Holme
a728225a92 build-openssl.bat: Added support for VC14 2015-07-26 23:58:36 +01:00
Daniel Stenberg
29e5cf2a2d RELEASE-NOTES: synced with 0f645adc95390e8 2015-07-26 22:33:17 +02:00
Daniel Stenberg
0f645adc95 test1902: attempt to make the test more reliable
Closes #355
2015-07-26 22:20:26 +02:00
Daniel Stenberg
373b77bca2 comment: fix comment about adding new option support 2015-07-26 14:15:07 +02:00
Jay Satiro
6d62d2c55d build-openssl.bat: Show syntax if required args are missing 2015-07-25 19:03:20 -04:00
Daniel Stenberg
14b9e780d4 TODO: improve how curl works in a windows console window
Closes #322 for now
2015-07-26 00:48:55 +02:00
Daniel Stenberg
8204844f47 1.11 minimize dependencies with dynamicly loaded modules
Closes #349 for now
2015-07-26 00:45:22 +02:00
Jay Satiro
b46a7744bc tool_operate: Fix CURLOPT_SSL_OPTIONS for builds without HTTPS
- Set CURLOPT_SSL_OPTIONS only if the tool enabled an SSL option.

Broken by me several days ago in 172b2be.
https://github.com/bagder/curl/commit/172b2be#diff-70b44ee478e58d4e1ddcf9c9a73d257b

Bug: http://curl.haxx.se/mail/lib-2015-07/0119.html
Reported-by: Dan Fandrich
2015-07-25 16:32:15 -04:00
Daniel Stenberg
a284b0ebc4 configure: check if OpenSSL linking wants -ldl
To make it easier to link with static versions of OpenSSL, the configure
script now checks if -ldl is needed for linking.

Help-by: TJ Saunders
2015-07-25 10:52:49 +02:00
Michael Kaufmann
c5d060cab4 HTTP: ignore "Content-Encoding: compress"
Currently, libcurl rejects responses with "Content-Encoding: compress"
when CURLOPT_ACCEPT_ENCODING is set to "". I think that libcurl should
treat the Content-Encoding "compress" the same as other
Content-Encodings that it does not support, e.g. "bzip2". That means
just ignoring it.
2015-07-25 00:46:01 +02:00
Marcel Raad
98835eed29 openssl: work around MSVC warning
MSVC 12 complains:

lib\vtls\openssl.c(1554): warning C4701: potentially uninitialized local
variable 'verstr' used It's a false positive, but as it's normally not,
I have enabled warning-as-error for that warning.
2015-07-24 00:12:31 +02:00
Michał Fita
cee21eb6a7 configure: add --disable-rt option
This option disables any attempts in configure to create dependency on
stuff requiring linking to librt.so and libpthread.so, in this case this
means clock_gettime(CLOCK_MONOTONIC, &mt).

We were in need to build curl which doesn't link libpthread.so to avoid
the following bug:
https://sourceware.org/bugzilla/show_bug.cgi?id=16628.
2015-07-24 00:09:29 +02:00
Kamil Dudka
da650c1e54 http2: verify success of strchr() in http2_send()
Detected by Coverity.

Error: NULL_RETURNS:
lib/http2.c:1301: returned_null: "strchr" returns null (checked 103 out of 109 times).
lib/http2.c:1301: var_assigned: Assigning: "hdbuf" = null return value from "strchr".
lib/http2.c:1302: dereference: Incrementing a pointer which might be null: "hdbuf".
1300|
1301|     hdbuf = strchr(hdbuf, 0x0a);
1302|->   ++hdbuf;
1303|
1304|     authority_idx = 0;
2015-07-23 11:51:53 +02:00
Jay Satiro
40c921f8b8 Windows: Fix VerifyVersionInfo calls
- Fix the VerifyVersionInfo calls, which we use to test for the OS major
version, to also test for the minor version as well as the service pack
major and minor versions.

MSDN: "If you are testing the major version, you must also test the
minor version and the service pack major and minor versions."

https://msdn.microsoft.com/en-us/library/windows/desktop/ms725492.aspx

Bug: https://github.com/bagder/curl/pull/353#issuecomment-123493098
Reported-by: Marcel Raad <MarcelRaad@users.noreply.github.com>
2015-07-22 01:55:43 -04:00
Marcel Raad
7a8e861a56 schannel: Replace deprecated GetVersion with VerifyVersionInfo 2015-07-22 01:55:42 -04:00
Steve Holme
ad32457623 makefile: Added support for VC14 2015-07-21 18:52:43 +01:00
Patrick Monnerat
32d4260c2d os400: ebcdic wrappers for new functions. Upgrade ILE/RPG bindings. 2015-07-21 16:36:34 +02:00
Patrick Monnerat
1df8d28381 libcurl: VERSIONINFO update
Addition of new procedures curl_pushheader_bynum and curl_pushheader_byname
requires VERSIONINFO updating.
2015-07-21 14:01:19 +02:00
Patrick Monnerat
fa0eeedf35 http2: satisfy external references even if http2 is not compiled in. 2015-07-21 13:55:39 +02:00
Daniel Stenberg
68d17643f5 http2: add stream != NULL checks for reliability
They should not trigger, but in case of internal problems we at least
avoid crashes this way.
2015-07-20 21:35:15 +02:00
Jay Satiro
aab76af1fa symbols-in-versions: Add new CURLSSLOPT_NO_REVOKE symbol 2015-07-18 15:27:48 -04:00
Jay Satiro
172b2beba6 SSL: Add an option to disable certificate revocation checks
New tool option --ssl-no-revoke.
New value CURLSSLOPT_NO_REVOKE for CURLOPT_SSL_OPTIONS.

Currently this option applies only to WinSSL where we have automatic
certificate revocation checking by default. According to the
ssl-compared chart there are other backends that have automatic checking
(NSS, wolfSSL and DarwinSSL) so we could possibly accommodate them at
some later point.

Bug: https://github.com/bagder/curl/issues/264
Reported-by: zenden2k <zenden2k@gmail.com>
2015-07-17 02:40:16 -04:00
Jay Satiro
606b29fe0d runtests: Allow for spaces in curl custom path
.. also fix some typos in test's FILEFORMAT spec.
2015-07-16 22:21:07 -04:00
David Woodhouse
60b19630b0 ntlm_wb: Fix theoretical memory leak
Static analysis indicated that my commit 9008f3d564 ("ntlm_wb: Fix
hard-coded limit on NTLM auth packet size") introduced a potential
memory leak on an error path, because we forget to free the buffer
before returning an error.

Fix this.

Although actually, it never happens in practice because we never *get*
here with state == NTLMSTATE_TYPE1. The state is always zero. That
might want cleaning up in a separate patch.

Reported-by: Terri Oda
2015-07-16 14:22:45 -04:00
Jay Satiro
de74e856e6 strerror: Add CRYPT_E_REVOKED to SSPI error strings 2015-07-15 22:19:20 -04:00
Kamil Dudka
cd20e81e89 libtest: call PR_Cleanup() on exit if NSPR is used
This prevents valgrind from reporting possibly lost memory that NSPR
uses for file descriptor cache and other globally allocated internal
data structures.

Reported-by: Štefan Kremeň
2015-07-14 21:52:33 +02:00
John Malmberg
79416fb2d6 openssl: VMS support for SHA256
setup-vms.h: More symbols for SHA256, hacks for older VAX

openssl.h: Use OpenSSL OPENSSL_NO_SHA256 macro to allow building on VAX.

openssl.c: Use OpenSSL version checks and OPENSSL_NO_SHA256 macro to
allow building on VAX and 64 bit VMS.
2015-07-14 01:25:36 -04:00
Jay Satiro
8f0178a56b examples: Fix typo in multi-single.c 2015-07-11 02:32:53 -04:00
Tatsuhiro Tsujikawa
845b011614 http2: Fix memory leak in push header array 2015-07-07 12:33:41 +02:00
Dan Fandrich
ce1bf87a04 test2041: fixed line endings in protocol part 2015-07-02 08:32:18 +02:00
Dan Fandrich
5602ad721b cyassl: fixed mismatched sha256sum function prototype 2015-07-02 08:29:22 +02:00
moparisthebest
55b78c5ae9 SSL: Pinned public key hash support 2015-07-01 19:43:47 +02:00
Daniel Stenberg
c00b18d540 examples: provide <DESC> sections 2015-07-01 11:43:12 +02:00
John Malmberg
4ed8537be6 OpenVMS: VMS Software, Inc now the supplier.
setup-vms.h: Symbol case fixups submitted by Michael Steve

build_gnv_curl_pcsi_desc.com: VSI aka as VMS Software, is now the
supplier of new versions of VMS.  The install kit needs to accept
VSI as a producer.
2015-07-01 11:15:47 +02:00
Jay Satiro
66a5f76583 multi: Move http2 push function declarations to header end
This change necessary for binary compatibility.

Prior to this change test 1135 failed due to the order of functions.
2015-06-30 17:19:21 -04:00
Jay Satiro
616cecfdb6 symbols-in-versions: Add new http2 push symbols
Prior to this change test 1119 failed due to the missing symbols.
2015-06-30 17:03:08 -04:00
Daniel Stenberg
b59f296bf6 RELEASE-NOTES: synced with e6749055d653 2015-06-30 00:45:14 +02:00
Daniel Stenberg
e6749055d6 configure: disable libidn by default
For security reasons, until there is a fix.

Bug: http://curl.haxx.se/mail/lib-2015-06/0143.html
Reported-by: Gustavo Grieco, Feist Josselin
2015-06-29 23:17:30 +02:00
Daniel Stenberg
8208dd3b22 SSL-PROBLEMS: mention WinSSL problems in WinXP 2015-06-29 15:03:56 +02:00
Daniel Stenberg
0c46abd79a CODE_OF_CONDUCT.md: added
Just to underscore how we treat each other in this project. Nothing new
really, but could be useful for newcomers and outsiders to see our
values.
2015-06-29 11:35:13 +02:00
Daniel Stenberg
1f70cdef98 tool_header_cb: fflush the header stream
Flush the header stream when -D is used so that they are sent off
earlier.

Bug: https://github.com/bagder/curl/issues/324
Reported-by: Cédric Connes
2015-06-25 11:53:56 -07:00
Roger Leigh
e3e06e1aee tests: Distribute CMakeLists.txt files in subdirectories 2015-06-25 07:48:50 -07:00
Daniel Stenberg
37402b5eb8 CURLOPT_FAILONERROR.3: mention that it closes the connection
Reported-by: bemoody
Bug: https://github.com/bagder/curl/issues/325
2015-06-24 15:26:15 -07:00
Daniel Stenberg
69c77f69a5 curl_multi_setopt.3: alpha sort the options 2015-06-24 14:55:12 -07:00
Daniel Stenberg
dc2cbfda89 curl_multi_setopt.3: add the new push options 2015-06-24 14:52:58 -07:00
Tatsuhiro Tsujikawa
1b5eba8324 http2: Use nghttp2 library error code for error return value 2015-06-24 23:44:42 +02:00
Tatsuhiro Tsujikawa
ddb106d7f6 http2: Harden header validation for curl_pushheader_byname
Since we do prefix match using given header by application code
against header name pair in format "NAME:VALUE", and VALUE part can
contain ":", we have to careful about existence of ":" in header
parameter.  ":" should be allowed to match HTTP/2 pseudo-header field,
and other use of ":" in header must be treated as error, and
curl_pushheader_byname should return NULL.  This commit implements
this behaviour.
2015-06-24 23:44:42 +02:00
Tatsuhiro Tsujikawa
77044b53f7 CURLMOPT_PUSHFUNCTION.3: Remove unused variable 2015-06-24 23:44:42 +02:00
Daniel Stenberg
c712aa0ebe CURLMOPT_PUSHFUNCTION.3: added example 2015-06-24 23:44:42 +02:00
Daniel Stenberg
a384f28ca6 http2: curl_pushheader_byname now takes a const char * 2015-06-24 23:44:42 +02:00
Daniel Stenberg
bf445b6e12 http2-serverpush.c: example code 2015-06-24 23:44:42 +02:00
Daniel Stenberg
a3a55d80ec http2: free all header memory after the push callback 2015-06-24 23:44:42 +02:00
Daniel Stenberg
e9f0dd43bc http2: init the pushed transfer properly 2015-06-24 23:44:42 +02:00
Daniel Stenberg
f65ab8864e http2: fixed the header accessor functions for the push callback 2015-06-24 23:44:42 +02:00
Daniel Stenberg
feea9263e9 http2: setup the new pushed stream properly 2015-06-24 23:44:42 +02:00
Daniel Stenberg
ea7134ac87 http2: initial implementation of the push callback 2015-06-24 23:44:42 +02:00
Daniel Stenberg
70191958b5 http2: initial HTTP/2 server push types/docs 2015-06-24 23:44:42 +02:00
Daniel Stenberg
5156982377 test1531: verify POSTFIELDSIZE set after add_handle
Following the fix made in 903b6e05565bf.
2015-06-23 17:51:03 -07:00
Daniel Stenberg
903b6e0556 pretransfer: init state.infilesize here, not in add_handle
... to properly support that options are set to the handle after it is
added to the multi handle.

Bug: http://curl.haxx.se/mail/lib-2015-06/0122.html
Reported-by: Stefan Bühler
2015-06-23 17:48:37 -07:00
Lior Kaplan
f44b803f16 tool_help: fix --tlsv1 help text to use >= for TLSv1 2015-06-21 13:33:11 -04:00
Jay Satiro
6842afbf44 INSTALL: Advise use of non-native SSL for Windows <= XP
Advise that WinSSL in versions <= XP will not be able to connect to
servers that no longer support the legacy handshakes and algorithms used
by those versions, and to use an alternate backend like OpenSSL instead.

Bug: https://github.com/bagder/curl/issues/253
Reported-by: zenden2k <zenden2k@gmail.com>
2015-06-20 18:45:25 -04:00
Kamil Dudka
ea1eec8ea8 curl_easy_setopt.3: restore contents removed by mistake
... in commit curl-7_43_0-18-g570076e
2015-06-19 10:07:32 -04:00
Daniel Stenberg
570076e82c curl_easy_setopt.3: mention CURLOPT_PIPEWAIT 2015-06-19 15:47:27 +02:00
Jay Satiro
ef0fdb83b8 cookie: Fix bug in export if any-domain cookie is present
In 3013bb6 I had changed cookie export to ignore any-domain cookies,
however the logic I used to do so was incorrect, and would lead to a
busy loop in the case of exporting a cookie list that contained
any-domain cookies. The result of that is worse though, because in that
case the other cookies would not be written resulting in an empty file
once the application is terminated to stop the busy loop.
2015-06-18 19:37:20 -04:00
Dan Fandrich
1c3811f4fd FTP: fixed compiling with --disable-proxy, broken in b88f980a 2015-06-18 23:20:10 +02:00
Daniel Stenberg
afbee791d5 tool: always provide negotiate/kerberos options
libcurl can still be built with it, even if the tool is not. Maintain
independence!
2015-06-18 16:57:38 +02:00
Daniel Stenberg
2546134b97 TODO: Support IDNA2008 2015-06-18 16:32:47 +02:00
Viktor Szakats
93aacc3050 Makefile.m32: add support for CURL_LDFLAG_EXTRAS
It is similar to existing CURL_CFLAG_EXTRAS, but for
extra linker option.
2015-06-18 14:43:26 +02:00
Daniel Stenberg
307f212379 RTSP: removed another piece of dead code
Coverity CID 1306668
2015-06-18 14:29:57 +02:00
Daniel Stenberg
26ddc536b0 openssl: fix use of uninitialized buffer
Make sure that the error buffer is always initialized and simplify the
use of it to make the logic easier.

Bug: https://github.com/bagder/curl/issues/318
Reported-by: sneis
2015-06-18 14:20:31 +02:00
Daniel Stenberg
0e7d76d6a8 examples: more descriptions 2015-06-18 11:38:54 +02:00
Daniel Stenberg
26583a62ab examples: add descriptions with <DESC>
Using this fixed format for example descriptions, we can generate a
better list on the web site.
2015-06-18 10:17:02 +02:00
Daniel Stenberg
cf6ef2dc92 libcurl-errors.3: fix typo 2015-06-18 00:17:47 +02:00
Daniel Stenberg
3b93f1a3ec curl_easy_setopt.3: option order doesn't matter 2015-06-18 00:09:46 +02:00
Daniel Stenberg
46d0eba2e9 openssl: fix build with BoringSSL
OPENSSL_load_builtin_modules does not exist in BoringSSL. Regression
from cae43a1
2015-06-18 00:06:46 +02:00
Paul Howarth
4a2398627c openssl: Fix build with openssl < ~ 0.9.8f
The symbol SSL3_MT_NEWSESSION_TICKET appears to have been introduced at
around openssl 0.9.8f, and the use of it in lib/vtls/openssl.c breaks
builds with older openssls (certainly with 0.9.8b, which is the latest
older version I have to try with).
2015-06-17 16:53:34 +02:00
Daniel Stenberg
b88f980a74 FTP: do the HTTP CONNECT for data connection blocking
** WORK-AROUND **

The introduced non-blocking general behaviour for Curl_proxyCONNECT()
didn't work for the data connection establishment unless it was very
fast. The newly introduced function argument makes it operate in a more
blocking manner, more like it used to work in the past. This blocking
approach is only used when the FTP data connecting through HTTP proxy.

Blocking like this is bad. A better fix would make it work more
asynchronously.

Bug: https://github.com/bagder/curl/issues/278
2015-06-17 14:00:12 +02:00
Daniel Stenberg
85739723ba bump: start the journey toward 7.44.0 2015-06-17 13:59:33 +02:00
Jay Satiro
f72b30e6fb CURLOPT_ERRORBUFFER.3: Fix example, escape backslashes 2015-06-17 02:49:14 -04:00
Jay Satiro
52d83cb0c6 CURLOPT_ERRORBUFFER.3: Improve example 2015-06-17 02:25:51 -04:00
Daniel Stenberg
38e07886ed RELEASE-NOTES: 7.43.0 release 2015-06-17 07:44:53 +02:00
Daniel Stenberg
bdf89d80ca THANKS: updated with 7.43.0 names 2015-06-17 07:43:13 +02:00
Kamil Dudka
24a8359b25 http: do not leak basic auth credentials on re-used connections
CVE-2015-3236

This partially reverts commit curl-7_39_0-237-g87c4abb

Reported-by: Tomas Tomecek, Kamil Dudka
Bug: http://curl.haxx.se/docs/adv_20150617A.html
2015-06-17 07:43:13 +02:00
Kamil Dudka
24f0b6ebf7 test2040: verify basic auth on re-used connections 2015-06-17 07:43:13 +02:00
Daniel Stenberg
50c7f17e50 SMB: rangecheck values read off incoming packet
CVE-2015-3237

Detected by Coverity. CID 1299430.

Bug: http://curl.haxx.se/docs/adv_20150617B.html
2015-06-17 07:43:13 +02:00
Jay Satiro
3e7ec1e849 schannel: schannel_recv overhaul
This commit is several drafts squashed together. The changes from each
draft are noted below. If any changes are similar and possibly
contradictory the change in the latest draft takes precedence.

Bug: https://github.com/bagder/curl/issues/244
Reported-by: Chris Araman

%%
%% Draft 1
%%
- return 0 if len == 0. that will have to be documented.
- continue on and process the caches regardless of raw recv
- if decrypted data will be returned then set the error code to CURLE_OK
and return its count
- if decrypted data will not be returned and the connection has closed
(eg nread == 0) then return 0 and CURLE_OK
- if decrypted data will not be returned and the connection *hasn't*
closed then set the error code to CURLE_AGAIN --only if an error code
isn't already set-- and return -1
- narrow the Win2k workaround to only Win2k

%%
%% Draft 2
%%
- Trying out a change in flow to handle corner cases.

%%
%% Draft 3
%%
- Back out the lazier decryption change made in draft2.

%%
%% Draft 4
%%
- Some formatting and branching changes
- Decrypt all encrypted cached data when len == 0
- Save connection closed state
- Change special Win2k check to use connection closed state

%%
%% Draft 5
%%
- Default to CURLE_AGAIN in cleanup if an error code wasn't set and the
connection isn't closed.

%%
%% Draft 6
%%
- Save the last error only if it is an unrecoverable error.

Prior to this I saved the last error state in all cases; unfortunately
the logic to cover that in all cases would lead to some muddle and I'm
concerned that could then lead to a bug in the future so I've replaced
it by only recording an unrecoverable error and that state will persist.

- Do not recurse on renegotiation.

Instead we'll continue on to process any trailing encrypted data
received during the renegotiation only.

- Move the err checks in cleanup after the check for decrypted data.

In either case decrypted data is always returned but I think it's easier
to understand when those err checks come after the decrypted data check.

%%
%% Draft 7
%%
- Regardless of len value go directly to cleanup if there is an
unrecoverable error or a close_notify was already received. Prior to
this change we only acknowledged those two states if len != 0.

- Fix a bug in connection closed behavior: Set the error state in the
cleanup, because we don't know for sure it's an error until that time.

- (Related to above) In the case the connection is closed go "greedy"
with the decryption to make sure all remaining encrypted data has been
decrypted even if it is not needed at that time by the caller. This is
necessary because we can only tell if the connection closed gracefully
(close_notify) once all encrypted data has been decrypted.

- Do not renegotiate when an unrecoverable error is pending.

%%
%% Draft 8
%%
- Don't show 'server closed the connection' info message twice.

- Show an info message if server closed abruptly (missing close_notify).
2015-06-17 00:17:03 -04:00
Paul Oliver
28f4fc5272 Fix typo in docs
s/curret/current/
2015-06-16 12:16:55 +02:00
Viktor Szakats
45f21e0f37 docs: update URLs 2015-06-16 09:08:00 +02:00
Daniel Stenberg
f93da27756 RELEASE-NOTES: synced with f29f2cbd00dbe5f 2015-06-16 09:07:37 +02:00
Viktor Szakats
f29f2cbd00 README: use secure protocol for Git repository 2015-06-15 23:45:34 +02:00
Viktor Szakats
4fd187c677 HTTP2.md: use SSL/TLS IETF URLs 2015-06-15 11:39:41 +02:00
Viktor Szakats
496e96c242 LICENSE-MIXING: update URLs
* use SSL/TLS where available
* follow permanent redirects
2015-06-15 11:37:55 +02:00
Daniel Stenberg
bb5b29ec14 LICENSE-MIXING: refreshed 2015-06-15 10:57:43 +02:00
Daniel Stenberg
75ba107767 curl_easy_duphandle: see also *reset 2015-06-15 10:37:38 +02:00
Daniel Stenberg
b430cb2a58 rtsp_do: fix DEAD CODE
"At condition p_request, the value of p_request cannot be NULL."

Coverity CID 1306668.
2015-06-15 09:05:07 +02:00
Daniel Stenberg
99eafc49bb security:choose_mech fix DEAD CODE warning
... by removing the "do {} while (0)" block.

Coverity CID 1306669
2015-06-15 09:02:46 +02:00
Daniel Stenberg
45bad4ac97 curl.1: netrc is in man section 5 2015-06-15 08:28:42 +02:00
Daniel Stenberg
f3288196ff curl.1: small format fix
use \fI-style instead of .BR for references
2015-06-15 08:26:37 +02:00
Daniel Stenberg
ff7097f72c urldata: store POST size in state.infilesize too
... to simplify checking when PUT _or_ POST have completed.

Reported-by: Frank Meier
Bug: http://curl.haxx.se/mail/lib-2015-06/0019.html
2015-06-14 23:31:01 +02:00
Dan Fandrich
55fc47a401 test1530: added http to required features 2015-06-14 22:38:39 +02:00
Drake Arconis
d186be9510 build: Fix typo from OpenSSL 1.0.2 version detection fix 2015-06-14 16:01:18 -04:00
Drake Arconis
878c5757c0 build: Properly detect OpenSSL 1.0.2 when using configure 2015-06-14 15:15:36 -04:00
Jay Satiro
dd39a67101 curl_multi_info_read.3: fix example formatting 2015-06-13 23:25:53 -04:00
Daniel Stenberg
da08a204c2 BINDINGS: there's a new R binding in town! 2015-06-13 23:10:23 +02:00
Daniel Stenberg
a9ed0fd6cb BINDINGS: added the Xojo binding 2015-06-11 23:33:49 +02:00
Joel Depooter
a3e5a4371b schannel: Add support for optional client certificates
Some servers will request a client certificate, but not require one.
This change allows libcurl to connect to such servers when using
schannel as its ssl/tls backend. When a server requests a client
certificate, libcurl will now continue the handshake without one,
rather than terminating the handshake. The server can then decide
if that is acceptable or not. Prior to this change, libcurl would
terminate the handshake, reporting a SEC_I_INCOMPLETE_CREDENTIALS
error.
2015-06-11 15:53:01 -04:00
Daniel Stenberg
4a7feea31a curl_easy_cleanup.3: provide more SEE ALSO 2015-06-11 08:32:11 +02:00
Daniel Stenberg
8d0d688296 debug: remove http2 debug leftovers 2015-06-10 23:16:37 +02:00
Daniel Stenberg
a5fb9151ee VERSIONS: now using markdown 2015-06-10 00:21:06 +02:00
Daniel Stenberg
f348b2d3bc RELEASE-PROCEDURE: remove ascii logo at the top of file 2015-06-10 00:16:48 +02:00
Daniel Stenberg
1514f3506b INTERNALS: absorbed docs/LIBCURL-STRUCTS 2015-06-10 00:11:54 +02:00
Daniel Stenberg
55f3eb588d INTERNALS: cat lib/README* >> INTERNALS
and a conversion to markdown. Removed the lib/README.* files. The idea
being to move toward having INTERNALS as the one and only "book" of
internals documentation.

Added a TOC to top of the document.
2015-06-09 23:57:22 +02:00
Jay Satiro
cbf2920d02 openssl: LibreSSL and BoringSSL do not use TLS_client_method
Although OpenSSL 1.1.0+ deprecated SSLv23_client_method in favor of
TLS_client_method LibreSSL and BoringSSL didn't and still use
SSLv23_client_method.

Bug: https://github.com/bagder/curl/commit/49a6642#commitcomment-11578009
Reported-by: asavah@users.noreply.github.com
2015-06-08 23:45:26 -04:00
Daniel Stenberg
0fcfe4d7ac RELEASE-NOTES: synced with 20ac3458068 2015-06-09 00:33:23 +02:00
Daniel Stenberg
20ac345806 CURLOPT_OPENSOCKETFUNCTION: return error at once
When CURL_SOCKET_BAD is returned in the callback, it should be treated
as an error (CURLE_COULDNT_CONNECT) if no other socket is subsequently
created when trying to connect to a server.

Bug: http://curl.haxx.se/mail/lib-2015-06/0047.html
2015-06-09 00:22:02 +02:00
Daniel Stenberg
eaeeed2e8f fopen.c: fix a few compiler warnings 2015-06-08 13:47:33 +02:00
Ville Skyttä
56b7663f73 docs: Spelling fixes 2015-06-08 13:43:31 +02:00
Ville Skyttä
025dbe46df docs: man page indentation and syntax fixes 2015-06-08 13:37:14 +02:00
Linus Nielsen
1a8926d12f help: Add --proxy-service-name and --service-name to the --help output 2015-06-08 10:00:11 +02:00
Jay Satiro
b8673bb9f0 openssl: Fix verification of server-sent legacy intermediates
- Try building a chain using issuers in the trusted store first to avoid
problems with server-sent legacy intermediates.

Prior to this change server-sent legacy intermediates with missing
legacy issuers would cause verification to fail even if the client's CA
bundle contained a valid replacement for the intermediate and an
alternate chain could be constructed that would verify successfully.

https://rt.openssl.org/Ticket/Display.html?id=3621&user=guest&pass=guest
2015-06-07 23:33:32 -04:00
Daniel Stenberg
8f4791440a BINDINGS: update several URLs
Stop linking to the curl.haxx.se anchor pages, they are usually only
themselves pointers to the real page so better point there directly
instead.
2015-06-05 09:15:40 +02:00
Daniel Stenberg
6befade68f BINDINGS: the curl-rust binding 2015-06-05 08:55:19 +02:00
Daniel Stenberg
3587da9e7c curl.h: add CURL_HTTP_VERSION_2
The protocol is named "HTTP/2" after all. It is an alias for the
existing CURL_HTTP_VERSION_2_0 enum.
2015-06-05 08:26:47 +02:00
Daniel Stenberg
1ce14037c0 openssl: removed error string #ifdef
ERR_error_string_n() was introduced in 0.9.6, no need to #ifdef anymore
2015-06-05 00:12:56 +02:00
Daniel Stenberg
30bd59ba6e openssl: removed USERDATA_IN_PWD_CALLBACK kludge
Code for OpenSSL 0.9.4 serves no purpose anymore!
2015-06-05 00:11:32 +02:00
Daniel Stenberg
ccfdd5986c openssl: remove SSL_get_session()-using code
It was present for OpenSSL 0.9.5 code but we only support 0.9.7 or
later.
2015-06-05 00:09:25 +02:00
Daniel Stenberg
fc16d9cec8 openssl: remove dummy callback use from SSL_CTX_set_verify()
The existing callback served no purpose.
2015-06-05 00:02:17 +02:00
Daniel Stenberg
7c17b58eec LIBCURL-STRUCTS: clarify for multiplexing 2015-06-04 22:43:54 +02:00
Jay Satiro
3013bb6b1c cookie: Stop exporting any-domain cookies
Prior to this change any-domain cookies (cookies without a domain that
are sent to any domain) were exported with domain name "unknown".

Bug: https://github.com/bagder/curl/issues/292
2015-06-03 21:48:47 -04:00
Daniel Stenberg
001ab7d860 RELEASE-PROCEDURE: refreshed 'coming dates' 2015-06-03 14:44:04 +02:00
Jay Satiro
59432503c0 curl_setup: Change fopen text macros to use 't' for MSDOS
Bug: https://github.com/bagder/curl/pull/258#issuecomment-107915198
Reported-by: Gisle Vanem
2015-06-02 14:04:00 -04:00
Daniel Stenberg
f6af9aef7e curl_multi_timeout.3: added example 2015-06-02 12:18:10 +02:00
Daniel Stenberg
46a050e9f5 curl_multi_perform.3: added example 2015-06-02 12:13:23 +02:00
Daniel Stenberg
3cac8c9049 curl_multi_info_read.3: added example 2015-06-02 12:01:39 +02:00
Daniel Stenberg
33ee411848 checksrc: detect fopen() for text without the FOPEN_* macros
Follow-up to e8423f9ce150 with discussionis in
https://github.com/bagder/curl/pull/258

This check scans for fopen() with a mode string without 'b' present, as
it may indicate that an FOPEN_* define should rather be used.
2015-06-02 08:28:10 +02:00
Daniel Stenberg
3bbcb4b036 curl_getdate.3: update RFC reference 2015-06-01 15:04:40 +02:00
Jay Satiro
e8423f9ce1 curl_setup: Add macros for FOPEN_READTEXT, FOPEN_WRITETEXT
- Change fopen calls to use FOPEN_READTEXT instead of "r" or "rt"
- Change fopen calls to use FOPEN_WRITETEXT instead of "w" or "wt"

This change is to explicitly specify when we need to read/write text.
Unfortunately 't' is not part of POSIX fopen so we can't specify it
directly. Instead we now have FOPEN_READTEXT, FOPEN_WRITETEXT.

Prior to this change we had an issue on Windows if an application that
uses libcurl overrides the default file mode to binary. The default file
mode in Windows is normally text mode (translation mode) and that's what
libcurl expects.

Bug: https://github.com/bagder/curl/pull/258#issuecomment-107093055
Reported-by: Orgad Shaneh
2015-06-01 03:21:23 -04:00
Daniel Stenberg
9f5dcab83d http2-upload.c: use PIPEWAIT for playing HTTP/2 better 2015-06-01 08:46:18 +02:00
Daniel Stenberg
41db5aed7a http2-download: check for CURLPIPE_MULTIPLEX properly
Bug: http://curl.haxx.se/mail/lib-2015-06/0001.html
Reported-by: Rafayel Mkrtchyan
2015-06-01 08:45:30 +02:00
Isaac Boukris
4bb815a32e HTTP-NTLM: fail auth on connection close instead of looping
Bug: https://github.com/bagder/curl/issues/256
2015-05-31 23:21:15 +02:00
Daniel Stenberg
4e7c3c12d3 5.6 Refuse "downgrade" redirects 2015-05-31 00:39:19 +02:00
Daniel Stenberg
9a0a16a61c README.pingpong: removed 2015-05-31 00:20:22 +02:00
Daniel Stenberg
2f1eae0f27 ROADMAP: remove HTTP/2 multiplexing - its here now 2015-05-30 12:09:22 +02:00
Daniel Stenberg
3628a90852 HTTP2.md: formatted properly 2015-05-30 12:07:39 +02:00
Daniel Stenberg
a8904b39f3 HTTP2: moved docs into docs/ and make it markdown 2015-05-30 11:55:33 +02:00
Daniel Stenberg
8a7c1c76b3 README.http2: refreshed and added multiplexing info 2015-05-30 11:53:24 +02:00
Daniel Stenberg
f348a6b4ab dist: add the http2 examples 2015-05-28 16:04:13 +02:00
Daniel Stenberg
d1b1d782f5 http2 examples: clean up some comments 2015-05-28 16:04:00 +02:00
Daniel Stenberg
e57f08863a examples: added two programs doing multiplexed HTTP/2 2015-05-28 15:58:34 +02:00
Daniel Stenberg
44fe4b9029 scripts: moved contributors.sh and contrithanks.sh into subdir 2015-05-27 16:10:08 +02:00
Daniel Stenberg
9972666b47 RELEASE-NOTES: synced with c005790ff1c0a 2015-05-27 14:48:59 +02:00
Daniel Melani
c005790ff1 openssl: typo in comment 2015-05-27 11:31:48 +02:00
Jay Satiro
49a6642f01 openssl: Use TLS_client_method for OpenSSL 1.1.0+
SSLv23_client_method is deprecated starting in OpenSSL 1.1.0. The
equivalent is TLS_client_method.

https://github.com/openssl/openssl/commit/13c9bb3#diff-708d3ae0f2c2973b272b811315381557
2015-05-27 01:30:30 -04:00
Daniel Stenberg
f81d356c21 FAQ: How do I port libcurl to my OS? 2015-05-26 19:13:40 +02:00
Jay Satiro
b18a1654c1 CURLOPT_COOKIELIST.3: Explain Set-Cookie without a domain
Document that if Set-Cookie is used without a domain then the cookie is
sent for any domain and will not be modified.

Bug: http://curl.haxx.se/mail/lib-2015-05/0137.html
Reported-by: Alexander Dyagilev
2015-05-25 17:27:53 -04:00
Tatsuhiro Tsujikawa
02dfc930b5 http2: Copy data passed in Curl_http2_switched into HTTP/2 connection buffer
Previously, after seeing upgrade to HTTP/2, we feed data followed by
upgrade response headers directly to nghttp2_session_mem_recv() in
Curl_http2_switched().  But it turns out that passed buffer, mem, is
part of stream->mem, and callbacks called by
nghttp2_session_mem_recv() will write stream specific data into
stream->mem, overwriting input data.  This will corrupt input, and
most likely frame length error is detected by nghttp2 library.  The
fix is first copy the passed data to HTTP/2 connection buffer,
httpc->inbuf, and call nghttp2_session_mem_recv().
2015-05-25 23:07:49 +02:00
Jay Satiro
96c0164b88 CURLOPT_COOKIE.3: Explain that the cookies won't be modified
The CURLOPT_COOKIE doc says it "sets the cookie header explicitly in the
outgoing request(s)." However there seems to be some user confusion
about cookie modification. Document that the cookies set by this option
are not modified by the cookie engine.

Bug: http://curl.haxx.se/mail/lib-2015-05/0115.html
Reported-by: Alexander Dyagilev
2015-05-24 19:01:13 -04:00
Jay Satiro
4bef1c7bf4 CURLOPT_COOKIELIST.3: Add example 2015-05-24 15:39:49 -04:00
Dan Fandrich
4a79475b13 testcurl.pl: use rel2abs to make the source directory absolute
This function makes a platform-specific absolute path which uses
backslashes on Windows. This form works when passing it on the
command-line, as well as if the source is on another drive.
2015-05-24 12:09:34 +02:00
Dan Fandrich
b6e3da5f08 conncache: fixed memory leak on OOM (torture tests) 2015-05-24 11:19:07 +02:00
Daniel Stenberg
28cdc0d82c perl: remove subdir, not touched in 9 years 2015-05-24 00:54:55 +02:00
Daniel Stenberg
3a973517a9 log2changes.pl: moved to scripts/ 2015-05-24 00:09:23 +02:00
Alessandro Ghedini
f9f22b0d63 scripts: add zsh.pl for generating zsh completion 2015-05-24 00:03:14 +02:00
Dan Fandrich
ef02da3156 test1510: another flaky test 2015-05-23 16:28:09 +02:00
Daniel Stenberg
e582cd16ff security: fix "Unchecked return value" from sscanf()
By (void) prefixing it and adding a comment. Did some minor related
cleanups.

Coverity CID 1299423.
2015-05-22 16:52:41 +02:00
Daniel Stenberg
1514977bcd security: simplify choose_mech
Coverity CID 1299424 identified dead code because of checks that could
never equal true (if the mechanism's name was NULL).

Simplified the function by removing a level of pointers and removing the
loop and array that weren't used.
2015-05-22 16:46:01 +02:00
Daniel Stenberg
fda0e74c22 RTSP: catch attempted unsupported requests better
Replace use of assert with code that properly catches bad input at
run-time even in non-debug builds.

This flaw was sort of detected by Coverity CID 1299425 which claimed the
"case RTSPREQ_NONE" was dead code.
2015-05-22 16:32:42 +02:00
Daniel Stenberg
03e2a9b023 share_init: fix OOM crash
A failed calloc() would lead to NULL pointer use.

Coverity CID 1299427.
2015-05-22 16:26:14 +02:00
Daniel Stenberg
817323ed82 parse_proxy: switch off tunneling if non-HTTP proxy
non-HTTP proxy implies not using CURLOPT_HTTPPROXYTUNNEL

Bug: http://curl.haxx.se/mail/lib-2015-05/0056.html
Reported-by: Sean Boudreau
2015-05-22 16:19:53 +02:00
Daniel Stenberg
42ed88e70a curl: fix potential NULL dereference
Coverity CID 1299428: Dereference after null check (FORWARD_NULL)
2015-05-22 16:19:30 +02:00
Daniel Stenberg
84d811f6af http2: on_frame_recv: return early on stream 0
Coverity CID 1299426 warned about possible NULL dereference otherwise,
but that would only ever happen if we get invalid HTTP/2 data with
frames for stream 0. Avoid this risk by returning early when stream 0 is
used.
2015-05-22 15:17:16 +02:00
Daniel Stenberg
d04bab8873 http: removed self assignment
Follow-up fix from b0143a2a33f0

Detected by coverity. CID 1299429
2015-05-22 09:57:16 +02:00
Tatsuhiro Tsujikawa
640f283bbb http2: Make HTTP Upgrade work
This commit just add implicitly opened stream 1 to streams hash.
2015-05-22 09:31:19 +02:00
Jay Satiro
995c6006fe strerror: Change SEC_E_ILLEGAL_MESSAGE description
Prior to this change the description for SEC_E_ILLEGAL_MESSAGE was OS
and language specific, and invariably translated to something not very
helpful like: "The message received was unexpected or badly formatted."

Bug: https://github.com/bagder/curl/issues/267
Reported-by: Michael Osipov
2015-05-22 02:30:38 -04:00
Jay Satiro
78ac944dc2 telnet: Fix read-callback change for Windows builds
Refer to b0143a2 for more information on the read-callback change.
2015-05-21 23:26:32 -04:00
Daniel Stenberg
ee04c20b74 CURLOPT_HTTPPROXYTUNNEL.3: only works with a HTTP proxy! 2015-05-21 14:17:17 +02:00
Dan Fandrich
126e7f7253 testcurl.pl: allow source to be in an arbitrary directory
This way, the build directory can be located on an entirely different
filesystem from the source code (e.g. a tmpfs).
2015-05-21 09:14:40 +02:00
Daniel Stenberg
b0143a2a33 read_callback: move to SessionHandle from connectdata
With many easy handles using the same connection for multiplexing, it is
important we store and keep the transfer-oriented stuff in the
SessionHandle so that callbacks and callback data work fine even when
many easy handles share the same physical connection.
2015-05-20 23:06:45 +02:00
Daniel Stenberg
6a688976f0 http2: show stream IDs in decimal
It makes them easier to match output from the nghttpd test server.
2015-05-20 23:06:29 +02:00
Tatsuhiro Tsujikawa
c175d184a2 http2: Faster http2 upload
Previously, when we send all given buffer in data_source_callback, we
return NGHTTP2_ERR_DEFERRED, and nghttp2 library removes this stream
temporarily for writing.  This itself is good.  If this is the sole
stream in the session, nghttp2_session_want_write() returns zero,
which means that libcurl does not check writeability of the underlying
socket.  This leads to very slow upload, because it seems curl only
upload 16k something per 1 second.  To fix this, if we still have data
to send, call nghttp2_session_resume_data after nghttp2_session_send.
This makes nghttp2_session_want_write() returns nonzero (if connection
window still opens), and as a result, socket writeability is checked,
and upload speed becomes normal.
2015-05-20 22:43:37 +02:00
Dmitry Eremin-Solenikov
d5aab55b33 gtls: don't fail on non-fatal alerts during handshake
Stop curl from failing when non-fatal alert is received during
handshake.  This e.g. fixes lots of problems when working with https
sites through proxies.
2015-05-20 22:41:30 +02:00
Daniel Stenberg
0f6f7c100a curl_easy_unescape.3: update RFC reference
Reported-by: bsammon
Bug: https://github.com/bagder/curl/issues/282
2015-05-20 08:21:27 +02:00
Jay Satiro
db979fea73 CURLOPT_POSTFIELDS.3: Mention curl_easy_escape
.. also correct some variable naming in curl_easy_escape.3

Bug: https://github.com/bagder/curl/issues/281
Reported-by: bsammon@users.noreply.github.com
2015-05-20 01:48:31 -04:00
Brian Prodoehl
a393d64456 openssl: Use SSL_CTX_set_msg_callback and SSL_CTX_set_msg_callback_arg
BoringSSL removed support for direct callers of SSL_CTX_callback_ctrl
and SSL_CTX_ctrl, so move to a way that should work on BoringSSL and
OpenSSL.

re #275
2015-05-19 22:54:42 +02:00
Jay Satiro
265f83a9f0 curl.1: fix missing space in section --data 2015-05-19 15:43:40 -04:00
Daniel Stenberg
301ba7772c transfer: remove erroneous and misleading comment 2015-05-19 14:00:19 +02:00
Kamil Dudka
00a770b3f5 http: silence compile-time warnings without USE_NGHTTP2
Error: CLANG_WARNING:
lib/http.c:173:16: warning: Value stored to 'http' during its initialization is never read

Error: COMPILER_WARNING:
lib/http.c: scope_hint: In function ‘http_disconnect’
lib/http.c:173:16: warning: unused variable ‘http’ [-Wunused-variable]
2015-05-19 12:53:30 +02:00
Jay Satiro
dd23c49546 transfer: Replace __func__ instances with function name
.. also make __func__ replacement in multi.

Prior to this change debug builds would fail to build if the compiler
was building pre-c99 and didn't support __func__.
2015-05-19 02:23:55 -04:00
Viktor Szakats
3d38a38012 build: bump version in default nghttp2 paths 2015-05-19 07:42:16 +02:00
Daniel Stenberg
d4313b1f01 INTERNALS: we require nghttp2 1.0.0+ now 2015-05-19 07:42:16 +02:00
Jay Satiro
7da064fdd2 http: Add some include guards for the new HTTP/2 stuff 2015-05-18 20:53:58 -04:00
Daniel Stenberg
897a7b3a13 http2: store upload state per stream
Use a curl_off_t for upload left
2015-05-18 15:41:43 +02:00
Daniel Stenberg
155b1f5df9 http2: fix build when NOT h2-enabled 2015-05-18 14:09:32 +02:00
Daniel Stenberg
979670988a http2: switch to use Curl_hash_destroy()
as after 4883f7019d3, the *_clean() function only flushes the hash.
2015-05-18 11:41:16 +02:00
Daniel Stenberg
0b26b94bdc curlver: restore LIBCURL_VERSION_NUM defined as a full number
As it breaks configure, curl-config and test 1023 if not.
2015-05-18 11:29:06 +02:00
Anthony Avina
4883f7019d hostip: fix unintended destruction of hash table
.. and added unit1602 for hash.c
2015-05-18 11:15:43 +02:00
Daniel Stenberg
39b9bf60d1 curlver: introducing new version number (checking) macros 2015-05-18 11:09:13 +02:00
Daniel Stenberg
d69eee0964 runtests.pl: use 'h2c' now, no -14 anymore 2015-05-18 10:10:55 +02:00
Tatsuhiro Tsujikawa
7ff7e45405 http2: Ignore if we have stream ID not in hash in on_stream_close
We could get stream ID not in the hash in on_stream_close.  For
example, if we decided to reject stream (e.g., PUSH_PROMISE), then we
don't create stream and store it in hash with its stream ID.
2015-05-18 09:33:48 +02:00
Tatsuhiro Tsujikawa
4ac6cc3ebd Require nghttp2 v1.0.0
This commit requires nghttp2 v1.0.0 to compile, and migrate to v1.0.0,
and utilize recent version of nghttp2 to simplify the code,

First we use nghttp2_option_set_no_recv_client_magic function to
detect nghttp2 v1.0.0.  That function only exists since v1.0.0.

Since nghttp2 v0.7.5, nghttp2 ensures header field ordering, and
validates received header field.  If it found error, RST_STREAM with
PROTOCOL_ERROR is issued.  Since we require v1.0.0, we can utilize
this feature to simplify libcurl code.  This commit does this.

Migration from 0.7 series are done based on nghttp2 migration
document.  For libcurl, we removed the code sending first 24 bytes
client magic.  It is now done by nghttp2 library.
on_invalid_frame_recv callback signature changed, and is updated
accordingly.
2015-05-18 09:33:48 +02:00
Daniel Stenberg
077f12b0ae http2: infof length in on_frame_send() 2015-05-18 09:33:48 +02:00
Daniel Stenberg
d6f1c74330 pipeline: switch some code over to functions
... to "compartmentalize" a bit and make it easier to change behavior
when multiplexing is used instead of good old pipelining.
2015-05-18 09:33:47 +02:00
Daniel Stenberg
7d0df07e48 symbols-in-versions: add CURLOPT_PIPEWAIT 2015-05-18 09:33:47 +02:00
Daniel Stenberg
811443754a CURLOPT_PIPEWAIT: added
By setting this option to 1 libcurl will wait for a connection to reveal
if it is possible to pipeline/multiplex on before it continues.
2015-05-18 09:33:47 +02:00
Daniel Stenberg
df3a970cb4 Curl_http_readwrite_headers: minor code simplification 2015-05-18 09:33:47 +02:00
Daniel Stenberg
193251794a IsPipeliningPossible: fixed for http2 2015-05-18 09:33:47 +02:00
Daniel Stenberg
8b38fcf2f6 http2: bump the h2 buffer size to 32K for speed 2015-05-18 09:33:47 +02:00
Daniel Stenberg
5871affc7a http2: remove the stream from the hash in stream_close callback
... and suddenly things work much better!
2015-05-18 09:33:47 +02:00
Daniel Stenberg
3e8a5d88a5 http2: if there is paused data, do not clear the drain field 2015-05-18 09:33:47 +02:00
Daniel Stenberg
522ca8c035 http2: rename s/data/pausedata 2015-05-18 09:33:47 +02:00
Daniel Stenberg
a66ed407d2 http2: "stream %x" in all outputs to make it easier to search for 2015-05-18 09:33:47 +02:00
Daniel Stenberg
61a94d6f77 http2: Curl_expire() all handles with incoming traffic
... so that they'll get handled next in the multi loop.
2015-05-18 09:33:47 +02:00
Daniel Stenberg
56c362b1a7 http2: don't signal settings change for same values 2015-05-18 09:33:47 +02:00
Daniel Stenberg
72105ebf05 http2: set default concurrency, fix ConnectionExists for multiplex 2015-05-18 09:33:47 +02:00
Daniel Stenberg
38bd6bf0bb bundles: store no/default/pipeline/multiplex
to allow code to act differently on the situation.

Also added some more info message for the connection re-use function to
make it clearer when connections are not re-used.
2015-05-18 09:33:36 +02:00
Daniel Stenberg
be4c8fd1ef http2: lazy init header_recvbuf
It makes us use less memory when not doing HTTP/2 and subsequently also
makes us not have to cleanup HTTP/2 related data when not using HTTP/2!
2015-05-18 08:57:18 +02:00
Daniel Stenberg
783b3c7b42 http2: separate multiplex/pipelining + cleanup memory leaks 2015-05-18 08:57:18 +02:00
Daniel Stenberg
02ec1ced9b CURLMOPT_PIPELINE: bit 1 is for multiplexing 2015-05-18 08:57:18 +02:00
Tatsuhiro Tsujikawa
2ce2f03007 http2: Fix bug that data to be drained are overwritten by pending "paused" data 2015-05-18 08:57:18 +02:00
Tatsuhiro Tsujikawa
d722138f29 http2: Don't call nghttp2_session_mem_recv while it is paused by a stream 2015-05-18 08:57:18 +02:00
Tatsuhiro Tsujikawa
0dc0de0351 http2: Read data left in connection buffer after pause
Previously when we do pause because of out of buffer, we just throw
away unread data in connection buffer.  This just broke protocol
framing, and I saw occasional FRAME_SIZE_ERROR.  This commit fix this
issue by remembering how much data read, and in the next iteration, we
process remaining data.
2015-05-18 08:57:18 +02:00
Tatsuhiro Tsujikawa
d261652d42 http2: Fix streams get stuck
This commit fixes the bug that streams get stuck if stream gets some
DATA, and stream->closed becomes true at the same time.  Previously,
in this condition, after we processed DATA, we are going to try to
read data from underlying transport, but there is no data, and gets
EAGAIN.  There was no code path to evaludate stream->closed.
2015-05-18 08:57:18 +02:00
Daniel Stenberg
74a4bd5ecd http2: store incoming h2 SETTINGS 2015-05-18 08:57:18 +02:00
Daniel Stenberg
591a6933da pipeline: move function to pipeline.c and make static
... as it was only used from there.
2015-05-18 08:57:18 +02:00
Daniel Stenberg
e91aedd840 IsPipeliningPossible: http2 can always "pipeline" (multiplex) 2015-05-18 08:57:18 +02:00
Daniel Stenberg
ee3ad233a2 http2: remove debug logging from on_frame_recv 2015-05-18 08:57:18 +02:00
Daniel Stenberg
70b5b698b0 http2: remove the closed check in http2_recv
With the "drained" functionality we can get here slightly asynchronously
so the stream have have been closed but there is pending data left to
read.
2015-05-18 08:57:18 +02:00
Daniel Stenberg
a28734be09 http2: bump the h2 buffer to 8K 2015-05-18 08:57:18 +02:00
Daniel Stenberg
5252f13dfa http2: Curl_read should not use the single buffer
... as it does for pipelining when we're multiplexing, as we need the
different buffers to store incoming data correctly for all streams.
2015-05-18 08:57:18 +02:00
Daniel Stenberg
153f940198 http2: more debug outputs 2015-05-18 08:57:18 +02:00
Daniel Stenberg
f4b8b39881 http2: leave WAITPERFORM when conn is multiplexed
No need to wait for our "spot" like for pipelining
2015-05-18 08:57:18 +02:00
Daniel Stenberg
01e1bdb10c http2: force "drainage" of streams
... which is necessary since the socket won't be readable but there is
data waiting in the buffer.
2015-05-18 08:57:17 +02:00
Daniel Stenberg
7bbac214f5 http2: move the mem+len pair to the stream struct 2015-05-18 08:57:17 +02:00
Daniel Stenberg
84c6b6561f http2: more stream-oriented data, stream ID 0 is for connections 2015-05-18 08:57:17 +02:00
Daniel Stenberg
2c238ea1fc http2: move lots of state data to the 'stream' struct
... from the connection struct. The stream one being the 'struct HTTP'
which is kept in the SessionHandle struct (easy handle).

lookup streams for incoming frames in the stream hash, hashing is based
on the stream id and we get the SessionHandle for the incoming stream
that way.
2015-05-18 08:57:17 +02:00
Daniel Stenberg
5fe71975e4 HTTP: partial start at fixing up hash-lookups on http2 frame receival 2015-05-18 08:57:17 +02:00
Daniel Stenberg
77f1029ecd http: a stream hash for h2 multiplexing 2015-05-18 08:57:17 +02:00
Daniel Stenberg
7957d2eb92 http: a stream hash for h2 multiplexing 2015-05-18 08:57:17 +02:00
Daniel Stenberg
47caff7bdf http2: debug log when receiving unexpected stream_id 2015-05-18 08:54:54 +02:00
Daniel Stenberg
d6440d7366 http2: move stream_id to the HTTP struct (per-stream) 2015-05-18 08:54:54 +02:00
Daniel Stenberg
f858624052 Curl_http2_setup: only do it once and enable multiplex on the server
Once we know we are HTTP/2 enabled we know the server can multiplex.
2015-05-18 08:54:54 +02:00
Daniel Stenberg
6e6b02f398 http: switch on "pipelining" (multiplexing) for HTTP/2 servers
... and do not blacklist any.
2015-05-18 08:54:54 +02:00
Daniel Stenberg
5fa82ca56f README.pipelining: removed
All the details mentioned here are better documented in man pages
2015-05-15 22:34:12 +02:00
Dan Fandrich
1c01cee601 build: removed bundles.c from make files
This file was removed in commit fd137786
2015-05-14 14:55:48 +02:00
Daniel Stenberg
750d678c0e Curl_conncache_add_conn: fix memory leak on OOM 2015-05-14 14:06:44 +02:00
Daniel Stenberg
a6af3df660 CURLMOPT_MAX_HOST_CONNECTIONS: host = host name + port number 2015-05-12 23:47:01 +02:00
Daniel Stenberg
2a746f6c28 conncache: keep bundles on host+port bases, not only host names
Previously we counted all connections to a specific host name and that
would be used for the CURLMOPT_MAX_HOST_CONNECTIONS check for example,
while servers on different port numbers are normally considered
different "origins" on the web and should thus be considered different
hosts.
2015-05-12 23:40:10 +02:00
Daniel Stenberg
fd137786e5 bundles: merged into conncache.c
All the existing Curl_bundle* functions were only ever used from within
the conncache.c file, so I moved them over and made them static (and
removed the Curl_ prefix).
2015-05-12 23:21:33 +02:00
Daniel Stenberg
b419e7ae0c hostcache: made all host caches use structs, not pointers
This avoids unnecessary dynamic allocs and as this also removed the last
users of *hash_alloc() and *hash_destroy(), those two functions are now
removed.
2015-05-12 09:46:53 +02:00
Daniel Stenberg
d37e0160c2 multi: converted socket hash into non-allocated struct
avoids extra dynamic allocation
2015-05-12 09:28:37 +02:00
Daniel Stenberg
640296c95d connection cache: avoid Curl_hash_alloc()
... by using plain structs instead of pointers for the connection cache,
we can avoid several dynamic allocations that weren't necessary.
2015-05-12 09:15:02 +02:00
Daniel Stenberg
c4d6f9163a proxy: add newline to info message 2015-05-08 15:56:25 +02:00
Patrick Monnerat
c720cd6356 FTP: fix dangling conn->ip_addr dereference on verbose EPSV. 2015-05-08 15:28:48 +02:00
Patrick Monnerat
3377e692ee FTP: Make EPSV use the control IP address rather than the original host.
This ensures an alternate address is not used.
Does not apply to proxy tunnel.
2015-05-08 15:28:48 +02:00
Alessandro Ghedini
5bf472fd39 tool_help: fix formatting for --next option 2015-05-08 14:44:15 +02:00
Egon Eckert
8936a23f51 opts: improved the TCP keepalive examples 2015-05-08 08:27:19 +02:00
Jay Satiro
f010f3e3ca winbuild: Document the option used to statically link the CRT
- Document option RTLIBCFG (runtime library configuration).

Bug: https://github.com/bagder/curl/issues/254
Reported-by: Bert Huijben
2015-05-08 01:09:57 -04:00
Orgad Shaneh
33058a1dc3 netrc: Read in text mode when cygwin
Use text mode when cygwin to eliminate trailing carriage returns.

Bug: https://github.com/bagder/curl/pull/258
2015-05-06 02:34:31 -04:00
Patrick Monnerat
9fcc297ff3 OS400: Add SPNEGO service name options to ILE/RPG binding. 2015-05-05 14:05:41 +02:00
Daniel Stenberg
8a35211f3e curl_multi_info_read.3: fix typo
Reported-by: Liviu Chircu
2015-05-04 23:45:25 +02:00
Daniel Stenberg
fa08362a5f MANUAL: language fix
Reported-by: Fred Stluka
Bug: https://github.com/bagder/curl/issues/255
2015-05-04 14:17:28 +02:00
Alessandro Ghedini
a5e09e9eea gtls: properly retrieve certificate status
Also print the revocation reason if appropriate.
2015-05-04 13:42:45 +02:00
Daniel Stenberg
86bc654532 OpenSSL: conditional check for SSL3_RT_HEADER
The symbol is fairly new.

Reported-by: Kamil Dudka
2015-05-04 13:29:34 +02:00
Daniel Stenberg
690317aae2 openssl: skip trace outputs for ssl_ver == 0
The OpenSSL trace callback is wonderfully undocumented but given a
journey in the source code, it seems the cases were ssl_ver is zero
doesn't follow the same pattern and thus turned out confusing and
misleading. For now, we skip doing any CURLINFO_TEXT logging on those
but keep sending them as CURLINFO_SSL_DATA_OUT/IN.

Also, I added direction to the text info and I edited some functions
slightly.

Bug: https://github.com/bagder/curl/issues/219
Reported-by: Jay Satiro, Ashish Shukla
2015-05-04 12:27:59 +02:00
Marc Hoersken
3c104448d6 schannel.c: Small changes 2015-05-02 22:21:25 +02:00
Marc Hoersken
ae8387b91c schannel.c: Improve code path and readability 2015-05-02 20:14:53 +02:00
Marc Hoersken
d93619ca5d schannel.c: Improve error and return code handling upon aa99a63f03 2015-05-02 20:05:22 +02:00
Chris Araman
aa99a63f03 schannel: fix regression in schannel_recv
https://github.com/bagder/curl/issues/244

Commit 145c263 changed the behavior when Curl_read_plain returns
CURLE_AGAIN. We now handle CURLE_AGAIN and SEC_I_CONTEXT_EXPIRED
correctly.
2015-05-02 18:54:13 +02:00
Marc Hoersken
4bb8bad964 Bug born in changes made several days ago 9a91e80.
Commit: https://github.com/bagder/curl/commit/926cb9f
Reported-by: Ray Satiro
2015-05-01 09:39:34 +02:00
Michael Osipov
b6c9f5b7ae configure: remove missing and make it autogenerate
The missing file has not been autogenerated because a temporary fix was
employed in acinclude.m4 which blocked update. Removed that fix and a recent
version of missing is copied to build root.
2015-04-30 18:40:35 +02:00
Michael Osipov
4335b86a10 acinclude.m4: fix test for default CA cert bundle/path
test(1) on HP-UX requires a single equals sign and fails with two.
Let's use one and make every OS happy.
2015-04-30 18:36:27 +02:00
Daniel Stenberg
3f88d92e92 CONTRIBUTING.md: remove the sourceforge mention
Reported-By: Michael Osipov
2015-04-30 18:35:43 +02:00
Dan Fandrich
32606e4f0b http_negotiate_sspi: added missing data variable 2015-04-30 12:13:49 +02:00
Michael Osipov
693422b79b configure: remove --automake from libtoolize call
That option is not mentioned in the man page of libtoolize 2.4.4.19-fda4.
Moveover, a comment in line 2623 says "--automake is for 1.5 compatibility".

This option is redundant now.
2015-04-30 08:58:09 +02:00
Viktor Szakats
6a61285909 build: update depedency versions, urls, example makefiles
- update default versions of dependencies (except for rare/old platforms)
- update urls
- sync examples makefiles with main ones
- remove line ending space
2015-04-30 08:29:00 +02:00
Michael Osipov
4271695122 configure: remove autogenerated files by autoconf
* install-sh is always regenerated
* mkinstalldirs was already redudant years ago. Automake uses install for
  that. See: http://lists.gnu.org/archive/html/automake/2007-03/msg00015.html
2015-04-30 08:24:53 +02:00
Anders Bakken
b23fda76c1 curl_multi_add_handle: next is already NULL 2015-04-30 08:21:34 +02:00
Jay Satiro
926cb9ff65 schannel: Fix out of bounds array
Bug born in changes made several days ago 9a91e80.

Bug: http://curl.haxx.se/mail/lib-2015-04/0199.html
Reported-by: Brian Chrisman
2015-04-30 01:44:45 -04:00
Jay Satiro
55db5bdff7 docs/libcurl: gitignore libcurl-symbols.3
Bug: http://curl.haxx.se/mail/lib-2015-04/0191.html
Reported-by: Michael Osipov
2015-04-29 13:51:42 -04:00
Viktor Szakats
790d1a4816 lib/makefile.m32: add arch -m32/-m64 to LDFLAGS
This fixes using a multi-target mingw distro to build curl .dll for the
non-default target.
(mirroring the same patch present in src/makefile.m32)
2015-04-29 13:18:17 -04:00
Daniel Stenberg
1c0f70f534 RELEASE-NOTES: synced with cd39b944afc
I've not mentioned the bug fixes that were shipped in 7.42.1 from the
7_42 branch.
2015-04-29 08:38:04 +02:00
Daniel Stenberg
cd39b944af THANKS: merged from the 7.42.1 release 2015-04-29 08:25:12 +02:00
Daniel Stenberg
6ba2e88a64 CURLOPT_HEADEROPT: default to separate
Make the HTTP headers separated by default for improved security and
reduced risk for information leakage.

Bug: http://curl.haxx.se/docs/adv_20150429.html
Reported-by: Yehezkel Horowitz, Oren Souroujon
2015-04-28 21:02:37 +02:00
Linus Nielsen
1f8a337e41 docs/libcurl: Corrected a typo in the CURLOPT_PROXY_SERVICE_NAME documentation 2015-04-28 14:47:18 +02:00
Daniel Stenberg
b2ea1bfcd6 hash: simplify Curl_str_key_compare() 2015-04-28 13:10:53 +02:00
Daniel Stenberg
0741271198 dist: ship CURLOPT_PROXY_SERVICE_NAME and CURLOPT_SERVICE_NAME 2015-04-28 09:03:58 +02:00
Linus Nielsen
97c272e5d1 Negotiate: custom service names for SPNEGO.
* Add new options, CURLOPT_PROXY_SERVICE_NAME and CURLOPT_SERVICE_NAME.
* Add new curl options, --proxy-service-name and --service-name.
2015-04-28 08:29:56 +02:00
Daniel Stenberg
54c394699d http2: unify http_conn variable names to 'c' 2015-04-27 22:54:34 +02:00
Daniel Stenberg
09a31fabe4 ConnectionExists: call it multi-use instead of pipelining
So that it fits HTTP/2 as well
2015-04-27 22:54:34 +02:00
Paul Howarth
d4f62f6c5d nss: fix compilation failure with old versions of NSS
Bug: http://curl.haxx.se/mail/lib-2015-04/0095.html
2015-04-27 15:37:16 +02:00
Daniel Stenberg
1945f99d59 sws: init http2 state properly
It would otherwise cause problems when running tests after 1801 etc.
2015-04-27 08:38:52 +02:00
Daniel Stenberg
b55cb2eef2 curl_easy_getinfo.3: document 'internals' in CURLINFO_TLS_SESSION
... as it was previouly undocumented what the pointer was.
2015-04-27 00:29:18 +02:00
Daniel Stenberg
c0700e3c7f runtests: use a DISABLED.local file too
... and have git ignore that. Allows for a dev to add tests to ignore in
local tests and yet don't obstruct a normal git work flow.
2015-04-26 19:59:13 +02:00
Marc Hoersken
92e754de78 schannel.c: Fix typo introduced with 3447c973d0 2015-04-26 19:57:05 +02:00
Marc Hoersken
9a91e8059b schannel.c: Fix possible SEC_E_BUFFER_TOO_SMALL error
Reported-by: Brian Chrisman
2015-04-26 17:59:01 +02:00
Daniel Stenberg
3447c973d0 schannel: re-indented file to follow curl style better
white space changes only
2015-04-26 17:40:40 +02:00
Daniel Stenberg
cae43a10cb Curl_ossl_init: load builtin modules
To have engine modules work, we must tell openssl to load builtin
modules first.

Bug: https://github.com/bagder/curl/pull/206
2015-04-26 17:26:31 +02:00
Daniel Stenberg
aa8f613e98 configure: follow-up fix for krb5-config
commit 5b66860652 was incomplete so here's a follow-up fix

Reported-by: Dagobert Michelsen
Bug: 5b66860652 (commitcomment-10473445)
2015-04-26 17:04:18 +02:00
Daniel Stenberg
aff153f83a openssl: fix serial number output
The code extracting the cert serial number was broken and didn't display
it properly.

Bug: https://github.com/bagder/curl/issues/235
Reported-by: dkjjr89
2015-04-26 16:36:19 +02:00
Grant Pannell
59f3f92ba6 sasl_sspi: Populate domain from the realm in the challenge
Without this, SSPI based digest auth was broken.

Bug: https://github.com/bagder/curl/pull/141.patch
2015-04-26 16:12:23 +02:00
Anthony Avina
6a7261359b tool: New option --data-raw to HTTP POST data, '@' allowed.
Add new option --data-raw which is almost the same as --data but does
not have a special interpretation of the @ character.

Prior to this change there was no (easy) way to pass the @ character as
the first character in POST data without it being interpreted as a
special character.

Bug: https://github.com/bagder/curl/issues/198
Reported-by: Jens Rantil
2015-04-25 14:51:14 -04:00
Dan Fandrich
f1e0a0aae7 test2039: fixed line endings that caused a test failure 2015-04-25 10:17:46 +02:00
Viktor Szakats
047e6aa05c netrc: add unit tests for 'default' support 2015-04-24 23:57:55 +02:00
Viktor Szakats
48be87e5f0 netrc: support 'default' token
The 'default' token has no argument and means to match _any_ domain.
It must be placed last if there are 'machine <name>' tokens in the same file.

See full description here:
https://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-File.html
2015-04-24 23:57:37 +02:00
Daniel Stenberg
49726926c6 ROADMAP.md: extended the HTTP/2 section, reformatted
Elaborated on several of the remaining HTTP/2 parts and made document
use a format that ends up nicer on the web page:
http://curl.haxx.se/dev/roadmap.html
2015-04-24 10:49:31 +02:00
Kamil Dudka
710a2e99b5 curl -z: do not write empty file on unmet condition
This commit fixes a regression introduced in curl-7_41_0-186-g261a0fe.
It also introduces a regression test 1424 based on tests 78 and 1423.

Reported-by: Viktor Szakats
Bug: https://github.com/bagder/curl/issues/237
2015-04-23 14:42:07 +02:00
Dan Fandrich
79478fdb68 tool: fixed a comment typo 2015-04-23 00:09:49 +02:00
Dan Fandrich
81e25b0e25 README: convert to UTF-8 2015-04-23 00:02:49 +02:00
Jay Satiro
0675abbc75 cyassl: Implement public key pinning
Also add public key extraction example to CURLOPT_PINNEDPUBLICKEY doc.
2015-04-22 17:07:19 -04:00
Alessandro Ghedini
26cbd7a1d9 curl.1: fix typo 2015-04-22 21:47:32 +02:00
Kamil Dudka
ba4741842e docs: distribute the CURLOPT_PINNEDPUBLICKEY(3) man page, too 2015-04-22 14:52:16 +02:00
Kamil Dudka
27ace9893c tests/unit/.gitignore: hide unit1601 and above, too 2015-04-22 14:20:20 +02:00
Daniel Stenberg
85c45d153b connectionexists: follow-up to fd9d3a1ef1f
PROTOPT_CREDSPERREQUEST still needs to be checked even when NTLM is not
enabled.

Mistake-caught-by: Kamil Dudka
2015-04-22 13:59:04 +02:00
Daniel Stenberg
fd9d3a1ef1 connectionexists: fix build without NTLM
Do not access NTLM-specific struct fields when built without NTLM
enabled!

bug: http://curl.haxx.se/?i=231
Reported-by: Patrick Rapin
2015-04-22 13:32:45 +02:00
Daniel Stenberg
d409f094a5 bump: start working toward 7.43.0 2015-04-22 13:32:45 +02:00
Kamil Dudka
b47c17d67c nss: implement public key pinning for NSS backend
Bug: https://bugzilla.redhat.com/1195771
2015-04-22 13:21:31 +02:00
Daniel Stenberg
1fd33e3ec8 dist: include {src,lib}/checksrc.whitelist 2015-04-22 13:16:04 +02:00
Daniel Stenberg
22691f849a RELEASE-NOTES: updated for 7.42.0 2015-04-22 07:56:12 +02:00
Daniel Stenberg
00e01fc0a7 THANKS: added contributors from 7.42.0 release notes 2015-04-22 07:56:12 +02:00
Daniel Stenberg
aadda65f5e THANKS-filter: a few more alterations to squash 2015-04-22 07:56:12 +02:00
Daniel Stenberg
7166fd8a60 contrithanks.sh: helper script for maintaining THANKS 2015-04-22 07:56:12 +02:00
Daniel Stenberg
79b9d5f1a4 http_done: close Negotiate connections when done
When doing HTTP requests Negotiate authenticated, the entire connnection
may become authenticated and not just the specific HTTP request which is
otherwise how HTTP works, as Negotiate can basically use NTLM under the
hood. curl was not adhering to this fact but would assume that such
requests would also be authenticated per request.

CVE-2015-3148

Bug: http://curl.haxx.se/docs/adv_20150422B.html
Reported-by: Isaac Boukris
2015-04-21 23:20:37 +02:00
Daniel Stenberg
0583e87ada fix_hostname: zero length host name caused -1 index offset
If a URL is given with a zero-length host name, like in "http://:80" or
just ":80", `fix_hostname()` will index the host name pointer with a -1
offset (as it blindly assumes a non-zero length) and both read and
assign that address.

CVE-2015-3144

Bug: http://curl.haxx.se/docs/adv_20150422D.html
Reported-by: Hanno Böck
2015-04-21 23:20:36 +02:00
Daniel Stenberg
b5f947b8ac cookie: cookie parser out of boundary memory access
The internal libcurl function called sanitize_cookie_path() that cleans
up the path element as given to it from a remote site or when read from
a file, did not properly validate the input. If given a path that
consisted of a single double-quote, libcurl would index a newly
allocated memory area with index -1 and assign a zero to it, thus
destroying heap memory it wasn't supposed to.

CVE-2015-3145

Bug: http://curl.haxx.se/docs/adv_20150422C.html
Reported-by: Hanno Böck
2015-04-21 23:20:36 +02:00
Daniel Stenberg
31be461c6b ConnectionExists: for NTLM re-use, require credentials to match
CVE-2015-3143

Bug: http://curl.haxx.se/docs/adv_20150422A.html
Reported-by: Paras Sethia
2015-04-21 23:20:36 +02:00
byronhe
6088fbce06 openssl: add OPENSSL_NO_SSL3_METHOD check 2015-04-21 15:25:21 -04:00
Daniel Stenberg
cf2d21d86f CURLOPT_HEADERFUNCTION.3: match parameter name in synopsis and desc
Bug: https://github.com/bagder/curl/issues/229
Reported-by: bsammon
2015-04-20 23:40:40 +02:00
Mostyn Bramley-Moore
875a6d9324 configure --with-nss: remove unneeded libs from the fallback 2015-04-20 10:25:07 +02:00
Daniel Stenberg
1b8f9c95b6 contributors.sh: fix help output, filter out (-prefix from names 2015-04-20 10:15:31 +02:00
Daniel Stenberg
9d704b3df9 RELEASE-NOTES: synced with cc0e7ebc3be0 2015-04-20 10:05:46 +02:00
Michael Stapelberg
cc0e7ebc3b CURLMOPT_TIMERFUNCTION.3: Clarify, add an example 2015-04-19 23:29:51 +02:00
Viktor Szakáts
3a87bdebd1 vtls/openssl: use https in URLs and a comment typo fixed 2015-04-19 19:52:37 +02:00
Daniel Stenberg
63c64e05a4 curl_version_info.3: fixed the 'protocols' variable type
Reported-by: John Marshall
Bug: https://github.com/bagder/curl/issues/225
2015-04-18 22:46:52 +02:00
Dan Fandrich
1e6d0e06f7 test1423: added missing "file" to server section 2015-04-18 21:12:36 +02:00
Daniel Stenberg
b6e477890f TheArtOfHttpScripting: Multiple URLs + Multiple HTTP methods
... and some minor edits
2015-04-17 23:53:11 +02:00
Daniel Stenberg
2eb02480ef Revert "HTTP: don't abort connections with pending Negotiate authentication"
This reverts commit 5dc68dd6092a789bb5e0a67a1c1356ba87fdcbc6.

Bug: https://github.com/bagder/curl/issues/223
Reported-by: Michael Osipov
2015-04-17 23:23:42 +02:00
Jay Satiro
f70112522f cyassl: Fix include order
Prior to this change CyaSSL's build options could redefine some generic
build symbols.

http://curl.haxx.se/mail/lib-2015-04/0069.html
2015-04-17 15:24:04 -04:00
Kamil Dudka
8dc3bbf0f8 configure --with-nss: drop redundant if statement 2015-04-17 16:43:20 +02:00
Kamil Dudka
67a8bbb51a configure --with-nss=PATH: query pkg-config if available
Bug: https://github.com/bagder/curl/pull/171
2015-04-17 16:43:20 +02:00
Daniel Stenberg
691a07dac6 parsecfg: do not continue past a zero termination
When a config file line ends without newline, the parsing function could
continue reading beyond that point in memory.

Reported-by: Hanno Böck
2015-04-17 11:44:57 +02:00
Jay Satiro
05e4137d31 gitignore: Ignore Windows build output directories 2015-04-16 18:24:42 -04:00
Daniel Stenberg
82805b56b9 RELEASE-NOTES: synced with 1ba6e4c88e0 2015-04-15 23:21:49 +02:00
Daniel Stenberg
1ba6e4c88e TODO: 17.9 Choose the name of file in braces for complex URLs 2015-04-15 21:13:25 +02:00
Daniel Stenberg
8f78794fd5 TODO: a little caution that maybe not all ideas are still good 2015-04-15 20:56:43 +02:00
Daniel Stenberg
0cbbbbdc31 TODO: 17.8 offer color-coded HTTP header output 2015-04-15 14:29:30 +02:00
Daniel Stenberg
78843afb9f TODO: 17.7 warning when sending binary output to terminal 2015-04-15 14:27:32 +02:00
Daniel Stenberg
ad48b177c3 KNOWN_BUGS: #90 IMAP "SEARCH ALL" truncates output on large boxes 2015-04-15 02:48:20 +02:00
Jay Satiro
9430dd583e cyassl: Add support for TLS extension SNI 2015-04-14 02:05:25 -04:00
Matthew Hall
8df4b5af3f gitignore: ignore test-driver file 2015-04-13 22:25:04 +02:00
Matthew Hall
a471a9f3b6 vtls_openssl: improve PKCS#12 load failure error message 2015-04-13 22:25:04 +02:00
Matthew Hall
27ac643455 vtls_openssl: fix minor typo in PKCS#12 load routine 2015-04-13 22:25:04 +02:00
Matthew Hall
b3175a767d vtls_openssl: improve client certificate load failure error messages 2015-04-13 22:25:04 +02:00
Matthew Hall
58b0a8b059 vtls_openssl: remove ambiguous SSL_CLIENT_CERT_ERR constant 2015-04-13 22:25:04 +02:00
Daniel Stenberg
9e7125a1db BUGS: refer to the github issue tracker now as primary 2015-04-13 16:43:52 +02:00
Daniel Stenberg
7fe172d3b2 firefox-db2pem: fix wildcard to find Firefox default profile
At some point, Firefox has changed and generates different directory
names for the default profile that made this script fail to find them.

Bug: https://github.com/bagder/curl/issues/207
Reported-by: sneakyimp
2015-04-13 15:31:26 +02:00
Jay Satiro
72bea7cc65 cyassl: Include the CyaSSL build config
CyaSSL >= 2.6.0 may have an options.h that was generated during
its build by configure.
2015-04-11 23:58:42 -04:00
Jay Satiro
139141f8d7 build: Generate source prerequisites for Visual Studio in generate.bat
Prior to this change Visual Studio builds could fail due to missing
prerequisites src/tool_hugehelp.c and include/curl/curlbuild.h.

http://curl.haxx.se/mail/lib-2015-04/0034.html
2015-04-11 02:16:59 -04:00
Viktor Szakats
e44155156a lib/makefile.m32: add missing libs to build libcurl.dll
Add 'gdi32' and 'crypt32' Windows implibs to avoid failure
while building libcurl.dll using the mingw compiler.
The same logic is used in 'src/makefile.m32' when
building curl.exe.
2015-04-09 21:34:14 +02:00
Kamil Dudka
992a731116 test142[23]: verify that an empty file is stored on success 2015-04-08 09:43:13 +02:00
Kamil Dudka
261a0fedcf src/tool_operate: create output file on successful download
... of an empty file

Bug: https://github.com/bagder/curl/issues/183
2015-04-08 09:43:08 +02:00
Kamil Dudka
f251417d85 src/tool_cb_wrt: separate fnc for output file creation 2015-04-08 09:36:56 +02:00
Da-Yoon Chung
a9e46749b2 lib/transfer.c: Remove factor of 8 from sleep time calculation
The factor of 8 is a bytes-to-bits conversion factor, but pkt_size and
rate_bps are both in bytes. When using the rate limiting option, curl
waits 8 times too long, and then transfers very quickly until the
average rate reaches the limit. The average rate follows the limit over
time, but the actual traffic is bursty.

Thanks-to: Benjamin Gilbert
2015-04-07 21:55:23 +02:00
Jay Satiro
c3101ae287 x509asn1: Silence x64 loss-of-data warning on RSA key length assignment
The key length in bits will always fit in an unsigned long so the
loss-of-data warning assigning the result of x64 pointer arithmetic to
an unsigned long is unnecessary.
2015-04-06 17:55:48 +02:00
Jay Satiro
d363c07912 cyassl: Use CYASSL_MAX_ERROR_SZ for error buffer size
Also fix it so that all ERR_error_string calls use an error buffer.
CyaSSL's implementation of ERR_error_string only writes the error when
an error buffer is passed.

http://www.yassl.com/forums/topic599-openssl-compatibility-and-errerrorstring.html
2015-04-06 17:54:14 +02:00
Jay Satiro
a30be951d6 cyassl: Remove 'Connecting to' message from cyassl_connect_step2
Prior to this change libcurl could show multiple 'CyaSSL: Connecting to'
messages since cyassl_connect_step2 is called multiple times, typically.
The message is superfluous even once since libcurl already informs the
user elsewhere in code that it is connecting.
2015-04-05 18:18:11 +02:00
Viktor Szakats
f2a0b2164a checksrc.bat: quotes to support an SRC_DIR with spaces 2015-04-05 18:07:40 +02:00
Daniel Stenberg
81ee1e69fe hostip: fix compiler warnings
introduced in the previous mini-series of 3 commits
2015-04-03 23:41:58 +02:00
Stefan Bühler
846f492053 actually implement CURLOPT_RESOLVE removals
- also log when a CURLOPT_RESOLVE entry couldn't get parsed
2015-04-03 16:46:14 +02:00
Stefan Bühler
b4be97fb67 move Curl_share_lock and ref counting into Curl_fetch_addr 2015-04-03 16:46:14 +02:00
Stefan Bühler
0db831976e fix refreshing of obsolete dns cache entries
- cache entries must be also refreshed when they are in use
- have the cache count as inuse reference too, freeing timestamp == 0 special
  value
- use timestamp == 0 for CURLOPT_RESOLVE entries which don't get refreshed
- remove CURLOPT_RESOLVE special inuse reference (timestamp == 0 will prevent refresh)
- fix Curl_hostcache_clean - CURLOPT_RESOLVE entries don't have a special
  reference anymore, and it would also release non CURLOPT_RESOLVE references
- fix locking in Curl_hostcache_clean
- fix unit1305.c: hash now keeps a reference, need to set inuse = 1
2015-04-03 16:46:14 +02:00
Daniel Stenberg
369430cd17 RELEASE-NOTES: synced with abf6bddc14a 2015-04-03 11:03:21 +02:00
Jay Satiro
abf6bddc14 checksrc.bat: Check lib\vtls source 2015-04-03 10:53:31 +02:00
Jay Satiro
f203edc544 cyassl: Set minimum protocol version before CTX callback
This change is to allow the user's CTX callback to change the minimum
protocol version in the CTX without us later overriding it, as we did
prior to this change.
2015-04-03 10:51:58 +02:00
Jay Satiro
e2a9ebb321 build-openssl.bat: Fix mixed line endings
Use LF not CRLF, throughout.  msysgit will only convert a file to CRLF
on checkout if it's not mixed.
2015-04-02 17:21:09 +02:00
Jay Satiro
0b5efa57ad cyassl: Fix certificate load check
SSL_CTX_load_verify_locations can return negative values on fail,
therefore to check for failure we check if load is != 1 (success)
instead of if load is == 0 (failure), the latter being incorrect given
that behavior.
2015-04-02 17:18:42 +02:00
Tatsuhiro Tsujikawa
21e82bd635 http2: Fix missing nghttp2_session_send call in Curl_http2_switched
Previously in Curl_http2_switched, we called nghttp2_session_mem_recv to
parse incoming data which were already received while curl was handling
upgrade.  But we didn't call nghttp2_session_send, and it led to make
curl not send any response to the received frames.  Most likely, we
received SETTINGS from server at this point, so we missed opportunity to
send SETTINGS + ACK.  This commit adds missing nghttp2_session_send call
in Curl_http2_switched to fix this issue.

Bug: https://github.com/bagder/curl/issues/192
Reported-by: Stefan Eissing
2015-04-02 15:19:29 +02:00
Daniel Stenberg
2685041a5c cookie: handle spaces after the name in Set-Cookie
"name =value" is fine and the space should just be skipped.

Updated test 31 to also test for this.

Bug: https://github.com/bagder/curl/issues/195
Reported-by: cromestant
Help-by: Frank Gevaerts
2015-04-01 23:25:29 +02:00
Jay Satiro
b121633402 cyassl: Fix library initialization return value
(Curl_cyassl_init)
- Return 1 on success, 0 in failure.

Prior to this change the fail path returned an incorrect value and the
evaluation to determine whether CyaSSL_Init had succeeded was incorrect.
Ironically that combined with the way curl_global_init tests SSL library
initialization (!Curl_ssl_init()) meant that CyaSSL having been
successfully initialized would be seen as that even though the code path
and return value in Curl_cyassl_init were wrong.
2015-04-01 08:10:58 +02:00
Thomas Ruecker
c84f0250e3 CURLOPT_HTTP200ALIASES.3: Mainly SHOUTcast servers use "ICY 200"
Icecast versions 1.3.0 through 1.3.12 would reply with "ICY 200"
under certain conditions:

    client_wants_icy_headers (connection_t *con)
    {
            const char *val;

            if (!con)
                    return 1;

            val = get_user_agent (con);
            if (!val || !val[0] || strcmp (val, "(null)") == 0)
                    return 1;

            if (con->food.client->use_icy)
                    return 1;
            if (strncasecmp (val, "winamp", 6) == 0)
                    return 1;
            if (strncasecmp (val, "Shoutcast", 9) == 0)
                    return 1;

            return 0;
    }

So mainly if there is no 'user agent' or it is '(null)' or contains
'winamp' or 'Shoutcast'.

No mainstream distribution carries Icecast 1.3.x anymore, after all
it was released in 2002 and superseded by Icecast 2.x.
2015-03-31 23:53:56 +02:00
Dan Fandrich
049fe7fb53 axtls: add timeout within Curl_axtls_connect
This allows test 405 to pass on axTLS.
2015-03-31 02:04:22 +02:00
Jay Satiro
6419aee248 checksrc: Windows-specific input fixes
lib/config-win32ce.h
- Fix whitespace for checksrc compliance.

lib/checksrc.pl
- Remove trailing carriage returns from input.

projects/checksrc.bat
- Ignore tool_hugehelp.c.
2015-03-30 22:39:13 +02:00
Dagobert Michelsen
5b66860652 configure: Use KRB5CONFIG for krb5-config
Allows the user to easier override its path.

Bug: http://curl.haxx.se/bug/view.cgi?id=1486
2015-03-30 14:19:23 +02:00
Daniel Stenberg
787c2ae91b multi: remove_handle: move pending connections
If the handle removed from the multi handle happens to be the one
"owning" the pipeline other transfers will be waiting indefinitely. Now
we move such handles back to connect to have them race (again) for
getting the connection and thus avoid hanging.

Bug: http://curl.haxx.se/bug/view.cgi?id=1465
Reported-by: Jiri Dvorak
2015-03-29 23:49:12 +02:00
Daniel Stenberg
31987c340e KNOWN_BUGS: 89 is bug #1411
Disabling pipelining on multi handle with in-progress pipelined requests
leads to heap corruption and crash
2015-03-29 23:20:15 +02:00
Jay Satiro
fcdc597b1a cyassl: CTX callback cosmetic changes and doc fix
- More descriptive fail message for NO_FILESYSTEM builds.
- Cosmetic changes.
- Change more of CURLOPT_SSL_CTX_* doc to not be OpenSSL specific.
2015-03-28 16:41:51 +01:00
Daniel Stenberg
623d24f3ee RELEASE-NOTES: synced with d2feb71752f 2015-03-28 16:33:17 +01:00
Dan Fandrich
ae3c985060 tool_operate: only set SSL options if SSL is enabled 2015-03-28 11:57:16 +01:00
Dan Fandrich
9a743bc5fc runtests.pl: detect WolfSSL as yassl 2015-03-28 00:26:45 +01:00
Kyle L. Huff
d2feb71752 cyassl: add SSL context callback support for CyaSSL
Adds support for CURLOPT_SSL_CTX_FUNCTION when using CyaSSL, and better
handles CyaSSL instances using NO_FILESYSTEM.
2015-03-27 23:32:14 +01:00
Kyle L. Huff
211f1e3c6b cyassl: remove undefined reference to CyaSSL_no_filesystem_verify
CyaSSL_no_filesystem_verify is not (or no longer) defined by cURL or
CyaSSL. This reference causes build errors when compiling with
NO_FILESYSTEM.
2015-03-27 23:31:12 +01:00
Jay Satiro
dab4ff179f build: Fix libcurl.sln erroneous mixed configurations
Prior to this change some Release configurations had an active
configuration assignment to their Debug counterpart.
2015-03-27 23:10:42 +01:00
Jay Satiro
e7a289ebb9 vtls: Don't accept unknown CURLOPT_SSLVERSION values 2015-03-27 09:32:23 +01:00
Jay Satiro
488102fc17 url: Don't accept CURLOPT_SSLVERSION unless USE_SSL is defined 2015-03-27 09:31:30 +01:00
Paul Howarth
559e2cc921 build: link curl to openssl libraries when openssl support is enabled
This fixes a build failure where openssl and libmetalink are used
together and the system linker does not do implicit linking (e.g.
Fedora 13 and later releases). The MD5 functions required for
metalink support must be pulled in from the openssl crypto library.

This is similar to commit c6e7cbb94e669b85d3eb8e015ec51d0072112133,
which fixes the same sort of problem for NSS builds.
2015-03-26 13:23:37 +01:00
Daniel Stenberg
318ad8d767 multi: on a request completion, check all CONNECT_PEND transfers
... even if they don't have an associated connection anymore. It could
leave the waiting transfers pending with no active one on the
connection.

Bug: http://curl.haxx.se/bug/view.cgi?id=1465
Reported-by: Jiri Dvorak
2015-03-26 08:14:22 +01:00
Emil Lerner
83835f7185 globbing: fix url number calculation when using range with step
In function glob_range, the number of urls was multiplied by (max - min
+ 1), regardless of step. The correct formula is (max - min) / step + 1
2015-03-25 12:48:15 +01:00
Daniel Stenberg
eb2a6180fb README.http2: refreshed and added TODO items 2015-03-25 12:13:16 +01:00
Emil Lerner
7b223a3a21 globbing: fix step parsing for character globbing ranges
The glob_range function used wrong offset (3 instead of 4) for parsing
integer step inside character range specification, which led to 'bad
range' error when using character ranges with explicitly specified step
(such as '[a-z:2]')
2015-03-25 11:29:46 +01:00
Daniel Stenberg
5b58bface3 polarssl: called mbedTLS in 1.3.10 and later 2015-03-25 09:19:57 +01:00
Daniel Stenberg
83b29e43cd polarssl: remove dead code
and simplify code by changing if-elses to a switch()

CID 1291706: Logically dead code. Execution cannot reach this statement
2015-03-25 09:01:11 +01:00
Daniel Stenberg
24908c12d7 polarssl: remove superfluous for(;;) loop
"unreachable: Since the loop increment is unreachable, the loop body
will never execute more than once."

Coverity CID 1291707
2015-03-25 08:49:34 +01:00
Daniel Stenberg
4e299192ed Curl_ssl_md5sum: return CURLcode
... since the funciton can fail on OOM. Check this return code.

Coverity CID 1291705.
2015-03-25 08:32:12 +01:00
Jay Satiro
e35f2e61ec cyassl: default to highest possible TLS version
(cyassl_connect_step1)
- Use TLS 1.0-1.2 by default when available.

CyaSSL/wolfSSL >= v3.3.0 supports setting a minimum protocol downgrade
version.

cyassl/cyassl@322f79f
2015-03-25 08:10:24 +01:00
Jay Satiro
d29f8b460c cyassl: Check for invalid length parameter in Curl_cyassl_random 2015-03-25 08:08:12 +01:00
Jay Satiro
ec31962640 cyassl: If wolfSSL then identify as such in version string 2015-03-25 08:08:12 +01:00
Dan Fandrich
aa5808b504 symbols-in-versions: added CURLOPT_PATH_AS_IS 2015-03-24 23:47:02 +01:00
Dan Fandrich
a45146868b testcurl.pl: add the --notes option to supply more info about a build
Support for notes has been in place for a while, but it required
being added to the setup file manually.
2015-03-24 23:47:01 +01:00
Dan Fandrich
35648f2e79 curl_memory: make curl_memory.h the second-last header file loaded
This header file must be included after all header files except
memdebug.h, as it does similar memory function redefinitions and can be
similarly affected by conflicting definitions in system or dependent
library headers.
2015-03-24 23:47:01 +01:00
Daniel Stenberg
ac2827ac09 openssl: do the OCSP work-around for libressl too
I tested with libressl git master now (v2.1.4-27-g34bf96c) and it seems to
still require the work-around for stapling to work.
2015-03-24 23:39:52 +01:00
Daniel Stenberg
bd9ac3cff2 openssl: verifystatus: only use the OCSP work-around <= 1.0.2a
URL: http://curl.haxx.se/mail/lib-2015-03/0205.html
Reported-by: Alessandro Ghedini
2015-03-24 23:06:37 +01:00
Daniel Stenberg
7e6ca87a72 openssl: adapt to ASN1/X509 things gone opaque in 1.1 2015-03-24 22:59:33 +01:00
Jay Satiro
9edf28e12d curl_easy_setopt.3: Fix misspelling in CURLOPT_PATH_AS_IS description 2015-03-24 21:48:15 +01:00
Viktor Szakáts
bbd0dd3fe2 CURLOPT_HTTPHEADER.3: fix typo in recent commit 2015-03-24 21:48:02 +01:00
Viktor Szakáts
e438a9e2f0 CURLOPT_PATH_AS_IS.3: add type 'long' to prototype 2015-03-24 21:46:07 +01:00
Dan Fandrich
56ae66d518 vtls: fix compile with --disable-crypto-auth but with SSL
This is a strange combination of options, but is allowed.
2015-03-24 21:41:22 +01:00
Patrick Monnerat
ff4a4dd92e os400: define new options in ILE/RPG binding. 2015-03-24 12:18:31 +01:00
Daniel Stenberg
ab6e6edb9e RELEASE-NOTES: synced with f6878609361 2015-03-24 11:15:47 +01:00
Daniel Stenberg
f687860936 curl_easy_setopt.3: Add CURLOPT_PATH_AS_IS 2015-03-24 11:06:38 +01:00
Daniel Stenberg
5d23279299 CURLOPT_PATH_AS_IS: added
--path-as-is is the command line option

Added docs in curl.1 and CURLOPT_PATH_AS_IS.3

Added test in test 1241
2015-03-24 10:31:58 +01:00
Yamada Yasuharu
ecc4940df2 curl_easy_recv/send: make them work with the multi interface
By making sure Curl_getconnectinfo() uses the correct connection cache
to find the last connection.
2015-03-23 22:46:58 +01:00
Daniel Stenberg
4b02b84897 http2: move the init too for when its actually needed
... it would otherwise lead to memory leakage if we never actually do
the switch.
2015-03-23 10:26:04 +01:00
Dan Fandrich
145c4692ff dict: rename byte to avoid compiler shadowed declaration warning
This conflicted with a WolfSSL typedef.
2015-03-23 10:16:10 +01:00
Dan Fandrich
430006c5e2 cyassl: include version.h to ensure the version macros are defined 2015-03-23 10:10:03 +01:00
Dan Fandrich
148207e2d7 test1513: eliminated race condition in test run
It seems that some systems (e.g. fairly consistently in some recent
Solaris autobuilds) would manage to get to the connect phase before the
progress callback was called, resulting in a CURLE_COULDNT_CONNECT
error. Reworked the test to point at a test server that never returns a
full result so the progress callback always gets a chance to be called
before the transfer can complete in some other way.
2015-03-22 00:03:44 +01:00
Nick Zitzmann
7f5a170442 darwinsssl: add support for TLS False Start
TLS False Start support requires iOS 7.0 or later, or OS X 10.9 or later.
2015-03-21 12:22:56 -05:00
Daniel Stenberg
ed429b72d7 gtls: add check of return code
Coverity CID 1291167 pointed out that 'rc' was received but never used when
gnutls_credentials_set() was used. Added return code check now.
2015-03-21 16:53:43 +01:00
Daniel Stenberg
fea13a17d8 gtls: dereferencing NULL pointer
Coverity CID 1291165 pointed out 'chainp' could be dereferenced when
NULL if gnutls_certificate_get_peers() had previously failed.
2015-03-21 16:53:23 +01:00
Daniel Stenberg
5f6f9e8b59 gtls: avoid uninitialized variable.
Coverity CID 1291166 pointed out that we could read this variable
uninitialized.
2015-03-21 16:53:09 +01:00
Dan Fandrich
f9251a5c86 tests/certs: rebuild certificates with modified key usage bits
The certificates were missing the digitalSignature and keyAgreement
usage types, of which at least digitalSignature was checked by CyaSSL.
This caused the test server in test 310 (among others) to fail the
startup verification and therefore run (see
http://curl.haxx.se/mail/lib-2014-07/0303.html).
2015-03-21 16:33:58 +01:00
Dan Fandrich
38c304a58f tests/certs: added make target to rebuild certificates
The certificate generation scripts were also updated to better match the
format of the certificates currently checked in.
2015-03-21 16:33:58 +01:00
Daniel Stenberg
9cd4d6518f x509asn1: add /* fallthrough */ in switch() case 2015-03-21 16:29:58 +01:00
Daniel Stenberg
e6917d3b77 x509asn1: minor edit to unconfuse Coverity
CID 1202732 warns on the previous use, although I cannot fine any
problems with it. I'm doing this change only to make the code use a more
familiar approach to accomplish the same thing.
2015-03-21 16:21:01 +01:00
Dagobert Michelsen
57dc2f7e40 testcurl: Allow '=' in values given on command line 2015-03-21 15:57:08 +01:00
Daniel Stenberg
b734518371 nss: error: unused variable 'connssl' 2015-03-21 15:47:03 +01:00
Dan Fandrich
61ff197a27 test938: added missing closing tags 2015-03-21 01:27:44 +01:00
Dan Fandrich
6779c50e26 cyassl: use new library version macro when available 2015-03-20 23:49:53 +01:00
Alessandro Ghedini
1f651d1d4d curl: add --false-start option 2015-03-20 20:14:35 +01:00
Alessandro Ghedini
185914fd31 nss: add support for TLS False Start 2015-03-20 20:14:35 +01:00
Alessandro Ghedini
4dcd25e138 url: add CURLOPT_SSL_FALSESTART option
This option can be used to enable/disable TLS False Start defined in the RFC
draft-bmoeller-tls-falsestart.
2015-03-20 20:14:33 +01:00
Alessandro Ghedini
a332922a52 gtls: implement CURLOPT_CERTINFO 2015-03-20 19:03:53 +01:00
Alessandro Ghedini
8854f8d45a openssl: try to avoid accessing OCSP structs when possible 2015-03-20 15:36:05 +01:00
Daniel Stenberg
9e8f9dbdd3 CURLOPT_URL.3: spelling!
Reported-by: Frank Gevaerts
2015-03-20 13:49:45 +01:00
Daniel Stenberg
620e0b23c8 CURLOPT_URL.3: Added "SECURITY CONCERNS" 2015-03-20 12:14:40 +01:00
Daniel Stenberg
2b7ac4e710 CURLOPT_HTTPHEADER.3: add a "SECURITY CONCERNS" section 2015-03-20 12:03:09 +01:00
Dan Fandrich
7868dc7103 cyassl: detect the library as renamed wolfssl
This change was made in CyaSSL/WolfSSL ver. 3.4.0
2015-03-19 23:51:40 +01:00
Daniel Stenberg
abfab1786e HTTP: don't switch to HTTP/2 from 1.1 until we get the 101
We prematurely changed protocol handler to HTTP/2 which made things very
slow (and wrong).

Reported-by: Stefan Eissing
Bug: https://github.com/bagder/curl/issues/169
2015-03-19 13:44:18 +01:00
Dan Fandrich
9e66d3f4d3 axtls: version 1.5.2 now requires that config.h be manually included 2015-03-19 10:11:17 +01:00
Daniel Stenberg
1977ff811d metalink: fix resource leak in OOM
Coverity CID 1288826
2015-03-19 09:08:08 +01:00
Dan Fandrich
8ecfaad2cc docs/libcurl: clean up libcurl-symbols.3 2015-03-18 23:54:36 +01:00
Dan Fandrich
431c5261d2 docs/libcurl: check that all options with man pages are referenced
If a man page exists in the opts/ directory, it must also be referenced
either in curl_easy_setopt.3 or curl_multi_setopt.3
2015-03-18 23:44:45 +01:00
Dan Fandrich
d260a0aeeb curl_easy_setopt.3: added a few missing options 2015-03-18 23:20:49 +01:00
Kamil Dudka
e3fbdc7c8a nss: explicitly tell NSS to disable NPN/ALPN
... if disabled at libcurl level.  Otherwise, we would allow to
negotiate NPN despite curl was invoked with the --no-npn option.
2015-03-18 19:43:14 +01:00
Jay Satiro
28de58504e mkhelp: Remove trailing carriage return from every line of input
- Get rid of this flood of warnings in Windows mingw build:
warning: missing terminating " character

The warning is due to the carriage return. When msysgit checks out files
from the repo by default it converts the line endings to CRLF. Prior to
this change when mkhelp.pl processed the MANUAL and curl.1 in CRLF
format the trailing carriage returns caused unnecessary CR in the
output.
2015-03-18 13:48:36 +01:00
Daniel Stenberg
7e16aa936f RELEASE-NOTES: synced with e539f01567 2015-03-18 08:37:54 +01:00
Christian Weisgerber
e539f01567 docs/libcurl: make portability fix
Using $< in a non-suffix rule context is a GNU make idiom.  This bug was
introduced in 7.41.0.
2015-03-18 08:31:06 +01:00
Dan Fandrich
252e9acd50 checksrc: Fix whitelist on out-of-tree builds 2015-03-17 23:26:48 +01:00
Stefan Bühler
4d6e079dd2 Curl_sh_entry: remove unused 'timestamp' 2015-03-17 16:29:36 +01:00
Daniel Stenberg
ef1c3b4648 HTTP: don't use Expect: headers when on HTTP/2
Reported-by: Stefan Eissing
Bug: https://github.com/bagder/curl/issues/169
2015-03-17 15:09:34 +01:00
Daniel Stenberg
2dc1a5ce93 checksrc: detect and remove space before trailing semicolons 2015-03-17 14:06:48 +01:00
Daniel Stenberg
0037eb5805 checksrc: introduce a whitelisting concept 2015-03-17 13:57:37 +01:00
Daniel Stenberg
9395999543 checksrc: use space after comma 2015-03-17 13:57:37 +01:00
Daniel Stenberg
a6b8fe2a5f checksrc: use space before paren in "return (expr);" 2015-03-17 13:05:01 +01:00
Daniel Stenberg
3dbe12a1e9 CONTRIBUTE: refer to git log instead of deprecated CHANGES file 2015-03-17 09:09:41 +01:00
Daniel Stenberg
40914fd544 CURLOPT_*.3: more examples and edits 2015-03-17 08:57:31 +01:00
Daniel Stenberg
8c41f368f5 CURLOPT_*.3: added lots of small example sections 2015-03-17 08:03:46 +01:00
Daniel Stenberg
6105029b23 CURLOPT_PRIVATE.3: provide an example 2015-03-16 23:56:11 +01:00
Daniel Stenberg
9c518a7d95 CURLOPT_*TIMEOUT.3: provide examples 2015-03-16 23:51:22 +01:00
Daniel Stenberg
8644a88202 CURLOPT_USERAGENT.3: added an example 2015-03-16 23:41:45 +01:00
Daniel Stenberg
76afe14584 CURLOPT_STDERR.3: added an example 2015-03-16 23:40:52 +01:00
Daniel Stenberg
fe02d132e2 curl_easy_perform.3: remove superfluous close brace from example 2015-03-16 23:28:23 +01:00
Daniel Stenberg
0f4a03cbb6 free: instead of Curl_safefree()
Since we just started make use of free(NULL) in order to simplify code,
this change takes it a step further and:

- converts lots of Curl_safefree() calls to good old free()
- makes Curl_safefree() not check the pointer before free()

The (new) rule of thumb is: if you really want a function call that
frees a pointer and then assigns it to NULL, then use Curl_safefree().
But we will prefer just using free() from now on.
2015-03-16 15:01:15 +01:00
Markus Elfring
9e661601fe Bug #149: Deletion of unnecessary checks before a few calls of cURL functions
The following functions return immediately if a null pointer was passed.
* Curl_cookie_cleanup
* curl_formfree

It is therefore not needed that a function caller repeats a corresponding check.

This issue was fixed by using the software Coccinelle 1.0.0-rc24.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
2015-03-16 12:13:56 +01:00
Markus Elfring
29c655c0a6 Bug #149: Deletion of unnecessary checks before calls of the function "free"
The function "free" is documented in the way that no action shall occur for
a passed null pointer. It is therefore not needed that a function caller
repeats a corresponding check.
http://stackoverflow.com/questions/18775608/free-a-null-pointer-anyway-or-check-first

This issue was fixed by using the software Coccinelle 1.0.0-rc24.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
2015-03-16 12:13:56 +01:00
Jay Satiro
059b3a5770 connect: Fix happy eyeballs logic for IPv4-only builds
Bug: https://github.com/bagder/curl/pull/168

(trynextip)
- Don't try the "other" protocol family unless IPv6 is available. In an
IPv4-only build the other family can only be IPv6 which is unavailable.

This change essentially stops IPv4-only builds from attempting the
"happy eyeballs" secondary parallel connection that is supposed to be
used by the "other" address family.

Prior to this change in IPv4-only builds that secondary parallel
connection attempt could be erroneously used by the same family (IPv4)
which caused a bug where every address after the first for a host could
be tried twice, often in parallel. This change fixes that bug. An
example of the bug is shown below.

Assume MTEST resolves to 3 addresses 127.0.0.2, 127.0.0.3 and 127.0.0.4:

* STATE: INIT => CONNECT handle 0x64f4b0; line 1046 (connection #-5000)
* Rebuilt URL to: http://MTEST/
* Added connection 0. The cache now contains 1 members
* STATE: CONNECT => WAITRESOLVE handle 0x64f4b0; line 1083
(connection #0)
*   Trying 127.0.0.2...
* STATE: WAITRESOLVE => WAITCONNECT handle 0x64f4b0; line 1163
(connection #0)
*   Trying 127.0.0.3...
* connect to 127.0.0.2 port 80 failed: Connection refused
*   Trying 127.0.0.3...
* connect to 127.0.0.3 port 80 failed: Connection refused
*   Trying 127.0.0.4...
* connect to 127.0.0.3 port 80 failed: Connection refused
*   Trying 127.0.0.4...
* connect to 127.0.0.4 port 80 failed: Connection refused
* connect to 127.0.0.4 port 80 failed: Connection refused
* Failed to connect to MTEST port 80: Connection refused
* Closing connection 0
* The cache now contains 0 members
* Expire cleared
curl: (7) Failed to connect to MTEST port 80: Connection refused

The bug was born in commit bagder/curl@2d435c7.
2015-03-16 12:07:59 +01:00
Daniel Stenberg
918e040953 mksymbolsmanpage.pl: use std header and generate better nroff header 2015-03-15 23:23:20 +01:00
Frank Meier
9063a7f853 closesocket: call multi socket cb on close even with custom close
In function Curl_closesocket() in connect.c the call to
Curl_multi_closed() was wrongly omitted if a socket close function
(CURLOPT_CLOSESOCKETFUNCTION) is registered.

That would lead to not removing the socket from the internal hash table
and not calling the multi socket callback appropriately.

Bug: http://curl.haxx.se/bug/view.cgi?id=1493
2015-03-15 13:26:03 +01:00
Tobias Stoeckmann
851c29269b hostip: Fix signal race in Curl_resolv_timeout.
A signal handler for SIGALRM is installed in Curl_resolv_timeout. It is
configured to interrupt system calls and uses siglongjmp to return into
the function if alarm() goes off.

The signal handler is installed before curl_jmpenv is initialized.
This means that an already installed alarm timer could trigger the
newly installed signal handler, leading to undefined behavior when it
accesses the uninitialized curl_jmpenv.

Even if there is no previously installed alarm available, the code in
Curl_resolv_timeout itself installs an alarm before the environment is
fully set up. If the process is sent into suspend right after that, the
signal handler could be called too early as in previous scenario.

To fix this, the signal handler should only be installed and the alarm
timer only be set after sigsetjmp has been called.
2015-03-14 18:24:11 +01:00
Daniel Stenberg
0cf649d9cc http2: detect prematures close without data transfered
... by using the regular Curl_http_done() method which checks for
that. This makes test 1801 fail consistently with error 56 (which seems
fine) to that test is also updated here.

Reported-by: Ben Darnell
Bug: https://github.com/bagder/curl/issues/166
2015-03-14 18:19:51 +01:00
Dan Fandrich
0911b96399 test320: Expect the Host header to be the first header
Required for the test to work after a5d994941c2b.
2015-03-13 22:37:23 +01:00
Daniel Stenberg
983ccdcead RELEASE-NOTES: synced with 186e46d88dd 2015-03-12 23:40:38 +01:00
Daniel Stenberg
186e46d88d openssl: use colons properly in the ciphers list
While the previous string worked, this is the documented format.

Reported-by: Richard Moore
2015-03-12 23:29:46 +01:00
Daniel Stenberg
0d1060f21e openssl: sort the ciphers on strength
This makes curl pick better (stronger) ciphers by default. The strongest
available ciphers are fine according to the HTTP/2 spec so an OpenSSL
built curl is no longer rejected by string HTTP/2 servers.

Bug: http://curl.haxx.se/bug/view.cgi?id=1487
2015-03-12 23:16:28 +01:00
Fabian Keil
6d3260af64 test203[0-3]: Expect the Host header to be the first header
Required for the tests to work after a5d994941c2b.
2015-03-12 16:06:11 +01:00
Daniel Stenberg
1d3f1a80d0 openssl: show the cipher selection to use 2015-03-12 15:53:45 +01:00
Daniel Stenberg
a5d994941c http: always send Host: header as first header
...after the method line:

 "Since the Host field-value is critical information for handling a
 request, a user agent SHOULD generate Host as the first header field
 following the request-line." / RFC 7230 section 5.4

Additionally, this will also make libcurl ignore multiple specified
custom Host: headers and only use the first one. Test 1121 has been
updated accordingly

Bug: http://curl.haxx.se/bug/view.cgi?id=1491
Reported-by: Rainer Canavan
2015-03-12 12:15:24 +01:00
Alexander Pepper
143acd6222 mk-ca-bundle bugfix: Don't report SHA1 numbers with "-q".
Also unified printing to STDERR by creating the helper method "report".
2015-03-11 14:47:41 +01:00
Daniel Stenberg
852d35b6ea proxy: re-use proxy connections (regression)
When checking for a connection to re-use, a proxy-using request must
check for and use a proxy connection and not one based on the host
name!

Added test 1421 to verify

Bug: http://curl.haxx.se/bug/view.cgi?id=1492
2015-03-11 11:54:22 +01:00
Jay Satiro
f39b1c0801 memanalyze.pl: handle free(NULL) 2015-03-10 22:05:46 +01:00
Jay Satiro
e424a1b3e7 .travis.yml: Change CI make test to make test-full
- Change the continuous integration script to use 'make test-full'
instead of just 'make test' so that the diagnostic log output is
printed to stdout when a test fails.

- Change the continuous integration script to use
'./configure --enable-debug' instead of just './configure' so that the
memory analyzer will work during testing.

Prior to this change Travis used its default C test script:
./configure && make && make test
2015-03-10 20:37:17 +01:00
Alessandro Ghedini
fa895f2aa2 gtls: correctly align certificate status verification messages 2015-03-10 15:48:34 +01:00
Alessandro Ghedini
a6a264ef2c gtls: don't print double newline after certificate dates 2015-03-10 15:20:03 +01:00
Alessandro Ghedini
3a757fddbb gtls: print negotiated TLS version and full cipher suite name
Instead of priting cipher and MAC algorithms names separately, print the
whole cipher suite string which also includes the key exchange algorithm,
along with the negotiated TLS version.
2015-03-10 15:18:14 +01:00
Daniel Stenberg
d9973eaeb8 gtls: fix compiler warnings 2015-03-10 15:16:59 +01:00
Alessandro Ghedini
5a1614cecd gtls: add support for CURLOPT_CAPATH 2015-03-10 15:03:54 +01:00
stopiccot
0f24df6e54 MacOSX-Framework: use @rpath instead of @executable_path
Bug: https://github.com/bagder/curl/pull/157
2015-03-09 23:39:27 +01:00
Daniel Stenberg
e662ddff49 RELEASE-NOTES: synced with c19349951 2015-03-09 11:12:54 +01:00
Daniel Stenberg
c19349951d multi: fix *getsock() with CONNECT
The code used some happy eyeballs logic even _after_ CONNECT has been
sent to a proxy, while the happy eyeball phase is already (should be)
over by then.

This is solved by splitting the multi state into two separate states
introducing the new SENDPROTOCONNECT state.

Bug: http://curl.haxx.se/mail/lib-2015-01/0170.html
Reported-by: Peter Laser
2015-03-07 19:19:22 +01:00
Daniel Stenberg
9da14a96ab conncontrol: only log changes to the connection bit 2015-03-07 19:18:49 +01:00
Daniel Stenberg
00ea0e7db0 http2: use CURL_HTTP_VERSION_* symbols instead of NPN_*
Since they already exist and will make comparing easier
2015-03-07 11:10:30 +01:00
Daniel Stenberg
df28af8f39 http2: make the info-message about receiving HTTP2 headers debug-only 2015-03-07 10:55:37 +01:00
Alessandro Ghedini
44ffe27056 urldata: remove unused asked_for_h2 field 2015-03-07 10:36:10 +01:00
Alessandro Ghedini
adb4e41a1a polarssl: make it possible to enable ALPN/NPN without HTTP2 2015-03-07 10:36:10 +01:00
Alessandro Ghedini
42bc45be8e nss: make it possible to enable ALPN/NPN without HTTP2 2015-03-07 10:36:10 +01:00
Alessandro Ghedini
870a67e01f gtls: make it possible to enable ALPN/NPN without HTTP2 2015-03-07 10:36:10 +01:00
Alessandro Ghedini
2e9494b15d openssl: make it possible to enable ALPN/NPN without HTTP2 2015-03-07 10:36:10 +01:00
Daniel Stenberg
3ac3331e14 metalink: add some error checks
malloc() and strdup() calls without checking return codes.

Reported-by: Markus Elfring
Bug: https://github.com/bagder/curl/issues/150
2015-03-06 23:14:25 +01:00
Daniel Stenberg
163d29826d curl_easy_setopt.3: added CURLOPT_SSL_VERIFYSTATUS
Reported-by: Jonathan Cardoso
2015-03-06 17:07:28 +01:00
Daniel Stenberg
042526c19f urldata: fix gnutls build 2015-03-06 10:13:40 +01:00
Steve Holme
9fa1abe9fe openssl: Removed use of USE_SSLEAY from the Visual Studio project files
In addition to commit 709cf76f6b, removed the USE_SSLEAY preprocessor
variable from the Visual Studio project files as it isn't required
anymore.
2015-03-05 20:47:14 +00:00
Daniel Stenberg
492dfca65d multi: fix memory-leak on timeout (regression)
Since 1342a96ecfe0d44, a timeout detected in the multi state machine didn't
necesarily clear everything up, like formpost data.

Bug: https://github.com/bagder/curl/issues/147
Reported-by: Michel Promonet
Patched-by: Michel Promonet
2015-03-05 15:43:38 +01:00
Daniel Stenberg
64736dd1be configure: follow-up fix from 709cf76f6
OpenSSL handling was a little broken.
2015-03-05 15:43:38 +01:00
Daniel Stenberg
709cf76f6b openssl: remove all uses of USE_SSLEAY
SSLeay was the name of the library that was subsequently turned into
OpenSSL many moons ago (1999). curl does not work with the old SSLeay
library since years. This is now reflected by only using USE_OPENSSL in
code that depends on OpenSSL.
2015-03-05 10:57:52 +01:00
Sergei Nikulov
1a62b6e68c cmake: handle build definitions CURLDEBUG/DEBUGBUILD
Acked-by: Brad King
2015-03-05 09:26:08 +01:00
Daniel Stenberg
ae8235571f FAQ: 4.21 Why is there a HTTP/1.1 in my HTTP/2 request? 2015-03-04 18:24:46 +01:00
Daniel Stenberg
ac4d08b5e2 symbols.pl: handle '-' in the deprecated field
... which otherwise made the script skip the _LAST define for some
symbols.

Reported-by: Jeroen Ooms
Bug: http://curl.haxx.se/mail/lib-2015-03/0052.html
2015-03-04 08:36:38 +01:00
Daniel Stenberg
6bba85d500 curl.1: fix "The the" typo
Reported-by: Jon Seymour
2015-03-04 07:29:06 +01:00
Daniel Stenberg
8aabbf5f8c vtls: use curl_printf.h all over
No need to use _MPRINTF_REPLACE internally.
2015-03-03 23:17:43 +01:00
Daniel Stenberg
dcf23b0cfe tool: use ENABLE_CURLX_PRINTF instead of _MPRINTF_REPLACE 2015-03-03 23:08:02 +01:00
Daniel Stenberg
af838b7d7b tool_writeenv: remove _MPRINTF_REPLACE define, it wasn't used 2015-03-03 23:00:54 +01:00
Sergei Nikulov
43eb8b2874 libtest: fixed linker errors on msvc
Bug: https://github.com/bagder/curl/pull/144
2015-03-03 14:33:11 +01:00
Daniel Stenberg
df5578a7a3 mprintf.h: remove #ifdef CURLDEBUG
... and as a consequence, introduce curl_printf.h with that re-define
magic instead and make all libcurl code use that instead.
2015-03-03 12:36:18 +01:00
Daniel Stenberg
f2108ec34c tool_getpass: remove unused curl/mprintf.h include 2015-03-03 12:09:25 +01:00
Daniel Stenberg
a318e04419 CONTRIBUTING.md: file for advice on github 2015-03-03 00:38:41 +01:00
Viktor Szakáts
1cb227c1f1 BINDINGS: add link to Harbour bindings
And UTF8-fix a few names
2015-03-02 17:43:06 +01:00
Daniel Stenberg
f3f7d37c1d CURLOPT_HEADERFUNCTION.3: typo in error code name
Reported-by: Jonathan Cardoso
2015-03-02 17:25:39 +01:00
Daniel Stenberg
ca04681c3b BINDINGS: tclcurl moved
Reporte-by: Steve Havelka
2015-03-02 08:51:14 +01:00
Jay Satiro
e349a1bf74 opts: Fix pipelining examples 2015-03-02 08:38:43 +01:00
Jay Satiro
70523c690b curl_multi_setopt.3: Link to CURLMOPT_MAXCONNECTS 2015-03-02 08:38:30 +01:00
Daniel Stenberg
17abfd5a4b CONTRIBUTE: the new more github-friendly attitude! 2015-03-01 23:39:14 +01:00
Steve Holme
f6864697c3 RELEASE-NOTES: Synced with 921d195187 2015-02-28 11:20:59 +00:00
Kamil Dudka
921d195187 tool: wrap lines longer than 79 columns
... to avoid a build failure when configured with --enable-debug
2015-02-28 10:54:59 +01:00
Tatsuhiro Tsujikawa
48b5374e65 http2: Return error if stream was closed with other than NO_ERROR
Previously, we just ignored error code passed to
on_stream_close_callback and just return 0 (success) after stream
closure even if stream was reset with error.  This patch records error
code in on_stream_close_callback, and return -1 and use CURLE_HTTP2
error code on abnormal stream closure.
2015-02-27 21:17:27 +00:00
Steve Holme
c715fa0b60 tool: Updated the warnf() function to use the GlobalConfig structure
As the 'error' and 'mute' options are now part of the GlobalConfig,
rather than per Operation, updated the warnf() function to use this
structure rather than the OperationConfig.
2015-02-27 21:05:52 +00:00
Steve Holme
adf27bf60f build: Removed DataExecutionPrevention directive from VC9+ project files
Removed the DataExecutionPrevention directive from the project files for
Visual Studio 2008 and above. The XML value in the VC9 project files was
set to "0" (Default) whilst the VC10+ project files contained an empty
XML element.
2015-02-26 20:58:02 +00:00
Steve Holme
e71bcb659c build: Use default RandomizedBaseAddress directive in VC9+ project files
Visual Studio 2008 introduced support for the address space layout
randomization (ASLR) feature of Windows Vista. However, upgrading the
VC8 project files to VC9 and above disabled this feature.

Removed the RandomizedBaseAddress directive to enabled the default
setting (/DYNAMICBASE). Note: This doesn't appear to have any negative
impact when compiled and ran on Windows XP.
2015-02-26 20:57:19 +00:00
Steve Holme
0d04e859e1 build: Added support to Generate.bat for files in the upcoming vauth folder 2015-02-26 20:47:23 +00:00
Daniel Stenberg
bc3a44aebc http2: return recv error on unexpected EOF
Pointed-out-by: Tatsuhiro Tsujikawa
Bug: http://curl.haxx.se/bug/view.cgi?id=1487
2015-02-25 13:51:21 +01:00
Kamil Dudka
1514b718e3 dist: add symbol-scan.pl to the tarball
... in order to make test1135 succeed
2015-02-25 12:13:21 +01:00
Daniel Stenberg
b9c190ba77 http2: move lots of verbose output to be debug-only 2015-02-25 11:45:46 +01:00
Kamil Dudka
e47b8306db curl-config.in: eliminate double quotes around CURL_CA_BUNDLE
Otherwise it expands to:

    echo ""/etc/pki/tls/certs/ca-bundle.crt""

Detected by ShellCheck:

    curl-config:74:16: warning: The double quotes around this do
    nothing.  Remove or escape them. [SC2140]
2015-02-25 10:23:07 +01:00
Kamil Dudka
4909f7c795 nss: do not skip Curl_nss_seed() if data is NULL
In that case, we only skip writing the error message for failed NSS
initialization (while still returning the correct error code).
2015-02-25 10:23:07 +01:00
Kamil Dudka
7a1538d9cc nss: improve error handling in Curl_nss_random()
The vtls layer now checks the return value, so it is no longer necessary
to abort if a random number cannot be provided by NSS.  This also fixes
the following Coverity report:

Error: FORWARD_NULL (CWE-476):
lib/vtls/nss.c:1918: var_compare_op: Comparing "data" to null implies that "data" might be null.
lib/vtls/nss.c:1923: var_deref_model: Passing null pointer "data" to "Curl_failf", which dereferences it.
lib/sendf.c:154:3: deref_parm: Directly dereferencing parameter "data".
2015-02-25 10:23:06 +01:00
Daniel Stenberg
0409a7d969 RELEASE-PROCEDURE: add some more future release dates
... and remove some old ones
2015-02-25 10:05:41 +01:00
Daniel Stenberg
becff7da56 sws: timeout idle CONNECT connections 2015-02-25 09:54:30 +01:00
Daniel Stenberg
4aa9bb6b13 bump: start working toward 7.42.0 2015-02-25 09:08:13 +01:00
1517 changed files with 36486 additions and 15876 deletions

10
.dir-locals.el Normal file
View File

@ -0,0 +1,10 @@
;;; Directory Local Variables
;;; See Info node `(emacs) Directory Variables' for more information.
((nil . ((indent-tabs-mode . nil)
(show-trailing-whitespace . t)))
(c-mode . ((c-basic-offset . 2)
))
(c++-mode . ((c-basic-offset . 2)
))
)

23
.github/CONTRIBUTING.md vendored Normal file
View File

@ -0,0 +1,23 @@
How to contribute to curl
=========================
Join the community
------------------
1. Click 'watch' on the github repo
2. Subscribe to the suitable [mailing lists](https://curl.haxx.se/mail/)
Read [CONTRIBUTE](../docs/CONTRIBUTE)
---------------------------------------
Send your suggestions using one of these methods:
-------------------------------------------------
1. in a mail to the mailing list
2. as a [pull request](https://github.com/curl/curl/pulls)
3. as an [issue](https://github.com/curl/curl/issues)
/ The cURL team!

9
.github/ISSUE_TEMPLATE vendored Normal file
View File

@ -0,0 +1,9 @@
### I did this
### I expected the following
### curl/libcurl version
[curl -V output perhaps?]
### operating system

62
.gitignore vendored
View File

@ -1,48 +1,52 @@
.deps
.libs
*.lib
*.pdb
*.asc
*.dll
*.exe
*.obj
*.asc
.*.swp
Debug
Release
*.exp
*.la
*.lib
*.lo
*.o
*.obj
*.pdb
*~
.*.swp
.cproject
.deps
.dirstamp
.libs
.project
.settings
/build/
/builds/
CHANGES.dist
Debug
INSTALL
Makefile
Makefile.in
Release
TAGS
aclocal.m4
aclocal.m4.bak
autom4te.cache
compile
config.cache
config.guess
config.log
config.status
config.sub
configure
depcomp
libtool
ltmain.sh
compile
curl-config
libcurl.pc
missing
curl-*.tar.gz
curl-*.tar.bz2
curl-*.tar.gz
curl-*.tar.lzma
curl-*.zip
INSTALL
curl-config
depcomp
install-sh
*.o
*.lo
*.la
libcurl.pc
libtool
ltmain.sh
missing
mkinstalldirs
tags
TAGS
*~
aclocal.m4.bak
CHANGES.dist
.project
.cproject
.settings
.dirstamp
test-driver
scripts/_curl

View File

@ -1,8 +1,20 @@
os:
- linux
- osx
sudo: false
language: c
install:
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update > /dev/null; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install openssl libidn rtmpdump libssh2 c-ares libmetalink libressl nghttp2; fi
before_script:
- ./buildconf
script: ./configure --enable-debug && make && make test-full
compiler:
- clang
- gcc

14
CHANGES
View File

@ -1,15 +1,7 @@
_ _ ____ _
___| | | | _ \| |
/ __| | | | |_) | |
| (__| |_| | _ <| |___
\___|\___/|_| \_\_____|
See https://curl.haxx.se/changes.html for the edited and human readable online
version of what has changed over the years in different curl releases.
Changelog
This file no longer holds the changelog. Now you can generate it yourself
like this:
Generate a CHANGES file like the one present in evey release like this:
$ git log --pretty=fuller --no-color --date=short --decorate=full | \
./log2changes.pl
The older, manually edited, changelog is found in git named CHANGES.0

450
CHANGES.0

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@
*
* 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.
* are also available at https://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
@ -139,7 +139,7 @@ int main(void)
rc = gethostbyname_r(address, &h, &hdata);
#elif defined(HAVE_GETHOSTBYNAME_R_5) || \
defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT)
rc = gethostbyname_r(address, &h, buffer, 8192, 0, &h_errnop);
rc = gethostbyname_r(address, &h, buffer, 8192, &h_errnop);
(void)hp; /* not used for test */
#elif defined(HAVE_GETHOSTBYNAME_R_6) || \
defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT)

View File

@ -10,8 +10,8 @@ endmacro(add_header_include)
set(signature_call_conv)
if(HAVE_WINDOWS_H)
add_header_include(HAVE_WINDOWS_H "windows.h")
add_header_include(HAVE_WINSOCK2_H "winsock2.h")
add_header_include(HAVE_WINDOWS_H "windows.h")
add_header_include(HAVE_WINSOCK_H "winsock.h")
set(_source_epilogue
"${_source_epilogue}\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif")

View File

@ -9,7 +9,7 @@
#
# 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.
# are also available at https://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
@ -64,7 +64,7 @@ message(STATUS "curl version=[${CURL_VERSION}]")
# SET(PACKAGE_NAME "curl")
# SET(PACKAGE_VERSION "-")
# SET(PACKAGE_STRING "curl-")
# SET(PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/")
# SET(PACKAGE_BUGREPORT "a suitable curl mailing list => https://curl.haxx.se/mail/")
set(OPERATING_SYSTEM "${CMAKE_SYSTEM_NAME}")
set(OS "\"${CMAKE_SYSTEM_NAME}\"")
@ -76,6 +76,24 @@ 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(ENABLE_ARES "Set to ON to enable c-ares support" OFF)
option(ENABLE_THREADED_RESOLVER "Set to ON to enable POSIX threaded DNS lookup" OFF)
option(ENABLE_DEBUG "Set to ON to enable curl debug features" OFF)
option(ENABLE_CURLDEBUG "Set to ON to build with TrackMemory feature enabled" OFF)
if (ENABLE_DEBUG)
# DEBUGBUILD will be defined only for Debug builds
if(NOT CMAKE_VERSION VERSION_LESS 3.0)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:DEBUGBUILD>)
else()
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUGBUILD)
endif()
set(ENABLE_CURLDEBUG ON)
endif()
if (ENABLE_CURLDEBUG)
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS CURLDEBUG)
endif()
# initialize CURL_LIBS
set(CURL_LIBS "")
@ -104,11 +122,6 @@ endif()
option(CURL_HIDDEN_SYMBOLS "Set to ON to hide libcurl internal symbols (=hide all symbols that aren't officially external)." ON)
mark_as_advanced(CURL_HIDDEN_SYMBOLS)
# IF(WIN32)
# OPTION(CURL_WINDOWS_SSPI "Use windows libraries to allow NTLM authentication without openssl" ON)
# MARK_AS_ADVANCED(CURL_WINDOWS_SSPI)
# ENDIF()
option(HTTP_ONLY "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)" OFF)
mark_as_advanced(HTTP_ONLY)
option(CURL_DISABLE_FTP "disables FTP" OFF)
@ -168,7 +181,7 @@ option(DISABLED_THREADSAFE "Set to explicitly specify we don't want to use threa
mark_as_advanced(DISABLED_THREADSAFE)
option(ENABLE_IPV6 "Define if you want to enable IPv6 support" ON)
mark_as_advanced(ENABLE_IPV6)
if(ENABLE_IPV6)
if(ENABLE_IPV6 AND NOT WIN32)
include(CheckStructHasMember)
check_struct_has_member("struct sockaddr_in6" sin6_addr "netinet/in.h"
HAVE_SOCKADDR_IN6_SIN6_ADDR)
@ -235,6 +248,7 @@ include (CheckLibraryExists)
include (CheckSymbolExists)
include (CheckTypeSize)
include (CheckCSourceCompiles)
include (CMakeDependentOption)
# On windows preload settings
if(WIN32)
@ -272,15 +286,22 @@ endif(NOT NOT_NEED_LIBNSL)
check_function_exists(gethostname HAVE_GETHOSTNAME)
set(OPENSSL_DEFAULT ON)
if(WIN32)
set(OPENSSL_DEFAULT OFF)
check_library_exists_concat("ws2_32" getch HAVE_LIBWS2_32)
check_library_exists_concat("winmm" getch HAVE_LIBWINMM)
endif()
option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ON)
option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ${OPENSSL_DEFAULT})
mark_as_advanced(CMAKE_USE_OPENSSL)
set(USE_SSLEAY OFF)
if(WIN32)
CMAKE_DEPENDENT_OPTION(CURL_WINDOWS_SSPI "Use windows libraries to allow NTLM authentication without openssl" ON
"NOT CMAKE_USE_OPENSSL" OFF)
mark_as_advanced(CURL_WINDOWS_SSPI)
endif()
set(USE_OPENSSL OFF)
set(HAVE_LIBCRYPTO OFF)
set(HAVE_LIBSSL OFF)
@ -289,7 +310,6 @@ if(CMAKE_USE_OPENSSL)
find_package(OpenSSL)
if(OPENSSL_FOUND)
list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES})
set(USE_SSLEAY ON)
set(USE_OPENSSL ON)
set(HAVE_LIBCRYPTO ON)
set(HAVE_LIBSSL ON)
@ -304,6 +324,8 @@ if(CMAKE_USE_OPENSSL)
check_include_file("openssl/ssl.h" HAVE_OPENSSL_SSL_H)
check_include_file("openssl/x509.h" HAVE_OPENSSL_X509_H)
check_include_file("openssl/rand.h" HAVE_OPENSSL_RAND_H)
elseif(WIN32)
set(CURL_WINDOWS_SSPI ON)
endif()
endif()
@ -339,9 +361,10 @@ if(NOT CURL_DISABLE_LDAP)
check_include_file_concat("winber.h" HAVE_WINBER_H)
endif()
set(CMAKE_REQUIRED_INCLUDES_BAK ${CMAKE_REQUIRED_INCLUDES})
set(CMAKE_LDAP_INCLUDE_DIR "" CACHE STRING "Path to LDAP include directory")
if(CMAKE_LDAP_INCLUDE_DIR)
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_LDAP_INCLUDE_DIR})
list(APPEND CMAKE_REQUIRED_INCLUDES ${CMAKE_LDAP_INCLUDE_DIR})
endif()
check_include_file_concat("ldap.h" HAVE_LDAP_H)
check_include_file_concat("lber.h" HAVE_LBER_H)
@ -349,9 +372,11 @@ if(NOT CURL_DISABLE_LDAP)
if(NOT HAVE_LDAP_H)
message(STATUS "LDAP_H not found CURL_DISABLE_LDAP set ON")
set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE)
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_BAK}) #LDAP includes won't be used
elseif(NOT HAVE_LIBLDAP)
message(STATUS "LDAP library '${CMAKE_LDAP_LIB}' not found CURL_DISABLE_LDAP set ON")
set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE)
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_BAK}) #LDAP includes won't be used
else()
if(CMAKE_USE_OPENLDAP)
set(USE_OPENLDAP ON)
@ -432,6 +457,7 @@ if(CURL_ZLIB)
set(HAVE_LIBZ ON)
list(APPEND CURL_LIBS ${ZLIB_LIBRARIES})
include_directories(${ZLIB_INCLUDE_DIRS})
list(APPEND CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIRS})
endif()
endif()
@ -447,7 +473,7 @@ if(CMAKE_USE_LIBSSH2)
if(LIBSSH2_FOUND)
list(APPEND CURL_LIBS ${LIBSSH2_LIBRARY})
set(CMAKE_REQUIRED_LIBRARIES ${LIBSSH2_LIBRARY})
set(CMAKE_REQUIRED_INCLUDES "${LIBSSH2_INCLUDE_DIR}")
list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBSSH2_INCLUDE_DIR}")
include_directories("${LIBSSH2_INCLUDE_DIR}")
set(HAVE_LIBSSH2 ON)
set(USE_LIBSSH2 ON)
@ -475,12 +501,12 @@ mark_as_advanced(CMAKE_USE_GSSAPI)
if(CMAKE_USE_GSSAPI)
find_package(GSS)
set(HAVE_GSS_API ${GSS_FOUND})
set(HAVE_GSSAPI ${GSS_FOUND})
if(GSS_FOUND)
message(STATUS "Found ${GSS_FLAVOUR} GSSAPI version: \"${GSS_VERSION}\"")
set(CMAKE_REQUIRED_INCLUDES ${GSS_INCLUDE_DIR})
list(APPEND CMAKE_REQUIRED_INCLUDES ${GSS_INCLUDE_DIRECTORIES})
check_include_file_concat("gssapi/gssapi.h" HAVE_GSSAPI_GSSAPI_H)
check_include_file_concat("gssapi/gssapi_generic.h" HAVE_GSSAPI_GSSAPI_GENERIC_H)
check_include_file_concat("gssapi/gssapi_krb5.h" HAVE_GSSAPI_GSSAPI_KRB5_H)
@ -516,7 +542,7 @@ if(CMAKE_USE_GSSAPI)
endif()
include_directories(${GSS_INCLUDE_DIR})
include_directories(${GSS_INCLUDE_DIRECTORIES})
link_directories(${GSS_LINK_DIRECTORIES})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GSS_COMPILER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GSS_LINKER_FLAGS}")
@ -536,12 +562,25 @@ else()
unset(USE_UNIX_SOCKETS CACHE)
endif()
# Check for header files
if(NOT UNIX)
check_include_file_concat("windows.h" HAVE_WINDOWS_H)
check_include_file_concat("winsock.h" HAVE_WINSOCK_H)
check_include_file_concat("ws2tcpip.h" HAVE_WS2TCPIP_H)
check_include_file_concat("winsock2.h" HAVE_WINSOCK2_H)
if(CURL_WINDOWS_SSPI)
set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -DSECURITY_WIN32")
check_include_file_concat("sspi.h" HAVE_SSPI_H)
if(HAVE_SSPI_H)
check_include_file_concat("schannel.h" HAVE_SCHANNEL_H)
set(USE_WINDOWS_SSPI ON)
if(HAVE_SCHANNEL_H)
set(USE_SCHANNEL ON)
set(SSL_ENABLED ON)
endif()
endif()
endif()
endif(NOT UNIX)
check_include_file_concat("stdio.h" HAVE_STDIO_H)
@ -736,7 +775,6 @@ if(CMAKE_USE_OPENSSL)
HAVE_CRYPTO_CLEANUP_ALL_EX_DATA)
if(HAVE_LIBCRYPTO AND HAVE_LIBSSL)
set(USE_OPENSSL 1)
set(USE_SSLEAY 1)
endif(HAVE_LIBCRYPTO AND HAVE_LIBSSL)
endif(CMAKE_USE_OPENSSL)
check_symbol_exists(gmtime_r "${CURL_INCLUDES}" HAVE_GMTIME_R)
@ -1023,7 +1061,8 @@ endfunction()
# Clear list and try to detect available features
set(_items)
_add_if("SSL" SSL_ENABLED)
_add_if("WinSSL" SSL_ENABLED AND USE_WINDOWS_SSPI)
_add_if("OpenSSL" SSL_ENABLED AND USE_OPENSSL)
_add_if("IPv6" ENABLE_IPV6)
_add_if("unix-sockets" USE_UNIX_SOCKETS)
_add_if("libz" HAVE_LIBZ)
@ -1031,12 +1070,12 @@ _add_if("AsynchDNS" USE_ARES OR USE_THREADS_POSIX)
_add_if("IDN" HAVE_LIBIDN)
# TODO SSP1 (WinSSL) check is missing
_add_if("SSPI" USE_WINDOWS_SSPI)
_add_if("GSS-API" HAVE_GSS_API)
_add_if("GSS-API" HAVE_GSSAPI)
# TODO SSP1 missing for SPNEGO
_add_if("SPNEGO" NOT CURL_DISABLE_CRYPTO_AUTH AND
(HAVE_GSS_API OR USE_WINDOWS_SSPI))
(HAVE_GSSAPI OR USE_WINDOWS_SSPI))
_add_if("Kerberos" NOT CURL_DISABLE_CRYPTO_AUTH AND
(HAVE_GSS_API OR USE_WINDOWS_SSPI))
(HAVE_GSSAPI OR USE_WINDOWS_SSPI))
# NTLM support requires crypto function adaptions from various SSL libs
# TODO alternative SSL libs tests for SSP1, GNUTLS, NSS, DARWINSSL
if(NOT CURL_DISABLE_CRYPTO_AUTH AND (USE_OPENSSL OR
@ -1121,7 +1160,7 @@ set(VERSIONNUM "${CURL_VERSION_NUM}")
# Finally generate a "curl-config" matching this config
configure_file("${CURL_SOURCE_DIR}/curl-config.in"
"${CURL_BINARY_DIR}/curl-config" @ONLY)
install(FILES "${CMAKE_BINARY_DIR}/curl-config"
install(FILES "${CURL_BINARY_DIR}/curl-config"
DESTINATION bin
PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
@ -1131,7 +1170,7 @@ install(FILES "${CMAKE_BINARY_DIR}/curl-config"
# Finally generate a pkg-config file matching this config
configure_file("${CURL_SOURCE_DIR}/libcurl.pc.in"
"${CURL_BINARY_DIR}/libcurl.pc" @ONLY)
install(FILES "${CMAKE_BINARY_DIR}/libcurl.pc"
install(FILES "${CURL_BINARY_DIR}/libcurl.pc"
DESTINATION lib/pkgconfig)
# This needs to be run very last so other parts of the scripts can take advantage of this.

View File

@ -1,6 +1,7 @@
COPYRIGHT AND PERMISSION NOTICE
Copyright (c) 1996 - 2015, Daniel Stenberg, <daniel@haxx.se>.
Copyright (c) 1996 - 2016, Daniel Stenberg, <daniel@haxx.se>, and many
contributors, see the THANKS file.
All rights reserved.

View File

@ -65,7 +65,7 @@ else
ARCHES64='-arch x86_64'
#We "know" that 10.4 and earlier do not support 64bit
OLD_SDK64=`ls $SDK_PATH|egrep -v "10.[0-4]"|head -1`
NEW_SDK64=`ls -r $SDK_PATH|egrep -v "10.[0-4]"|head -1`
NEW_SDK64=`ls -r $SDK_PATH|egrep -v "10.[0-4][^0-9]" | head -1`
if test $USE_OLD -gt 0
then
SDK64=$OLD_SDK64
@ -94,7 +94,7 @@ if test ! -z $SDK32; then
rm -r libcurl.framework
mkdir -p libcurl.framework/${FRAMEWORK_VERSION}/Resources
cp lib/.libs/libcurl.dylib libcurl.framework/${FRAMEWORK_VERSION}/libcurl
install_name_tool -id @executable_path/../Frameworks/libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl
install_name_tool -id @rpath/libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl
/usr/bin/sed -e "s/7\.12\.3/$VERSION/" lib/libcurl.plist >libcurl.framework/${FRAMEWORK_VERSION}/Resources/Info.plist
mkdir -p libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl
cp include/curl/*.h libcurl.framework/${FRAMEWORK_VERSION}/Headers/curl
@ -121,7 +121,7 @@ if test ! -z $SDK32; then
echo "----Appending 64 bit framework to 32 bit framework..."
cp lib/.libs/libcurl.dylib libcurl.framework/${FRAMEWORK_VERSION}/libcurl64
install_name_tool -id @executable_path/../Frameworks/libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl64
install_name_tool -id @rpath/libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl64
cp libcurl.framework/${FRAMEWORK_VERSION}/libcurl libcurl.framework/${FRAMEWORK_VERSION}/libcurl32
pwd
lipo libcurl.framework/${FRAMEWORK_VERSION}/libcurl32 libcurl.framework/${FRAMEWORK_VERSION}/libcurl64 -create -output libcurl.framework/${FRAMEWORK_VERSION}/libcurl

View File

@ -5,11 +5,11 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 1998 - 2016, 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.
# are also available at https://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
@ -32,103 +32,124 @@ CMAKE_DIST = CMakeLists.txt CMake/CMakeConfigurableFile.in \
VC6_LIBTMPL = projects/Windows/VC6/lib/libcurl.tmpl
VC6_LIBDSP = projects/Windows/VC6/lib/libcurl.dsp.dist
VC6_LIBDSP_DEPS = $(VC6_LIBTMPL) Makefile.am lib/Makefile.inc
VC6_SRCTMPL = projects/Windows/VC6/src/curlsrc.tmpl
VC6_SRCDSP = projects/Windows/VC6/src/curlsrc.dsp.dist
VC6_SRCTMPL = projects/Windows/VC6/src/curl.tmpl
VC6_SRCDSP = projects/Windows/VC6/src/curl.dsp.dist
VC6_SRCDSP_DEPS = $(VC6_SRCTMPL) Makefile.am src/Makefile.inc
VC7_LIBTMPL = projects/Windows/VC7/lib/libcurl.tmpl
VC7_LIBVCPROJ = projects/Windows/VC7/lib/libcurl.vcproj.dist
VC7_LIBVCPROJ_DEPS = $(VC7_LIBTMPL) Makefile.am lib/Makefile.inc
VC7_SRCTMPL = projects/Windows/VC7/src/curlsrc.tmpl
VC7_SRCVCPROJ = projects/Windows/VC7/src/curlsrc.vcproj.dist
VC7_SRCTMPL = projects/Windows/VC7/src/curl.tmpl
VC7_SRCVCPROJ = projects/Windows/VC7/src/curl.vcproj.dist
VC7_SRCVCPROJ_DEPS = $(VC7_SRCTMPL) Makefile.am src/Makefile.inc
VC71_LIBTMPL = projects/Windows/VC7.1/lib/libcurl.tmpl
VC71_LIBVCPROJ = projects/Windows/VC7.1/lib/libcurl.vcproj.dist
VC71_LIBVCPROJ_DEPS = $(VC71_LIBTMPL) Makefile.am lib/Makefile.inc
VC71_SRCTMPL = projects/Windows/VC7.1/src/curlsrc.tmpl
VC71_SRCVCPROJ = projects/Windows/VC7.1/src/curlsrc.vcproj.dist
VC71_SRCTMPL = projects/Windows/VC7.1/src/curl.tmpl
VC71_SRCVCPROJ = projects/Windows/VC7.1/src/curl.vcproj.dist
VC71_SRCVCPROJ_DEPS = $(VC71_SRCTMPL) Makefile.am src/Makefile.inc
VC8_LIBTMPL = projects/Windows/VC8/lib/libcurl.tmpl
VC8_LIBVCPROJ = projects/Windows/VC8/lib/libcurl.vcproj.dist
VC8_LIBVCPROJ_DEPS = $(VC8_LIBTMPL) Makefile.am lib/Makefile.inc
VC8_SRCTMPL = projects/Windows/VC8/src/curlsrc.tmpl
VC8_SRCVCPROJ = projects/Windows/VC8/src/curlsrc.vcproj.dist
VC8_SRCTMPL = projects/Windows/VC8/src/curl.tmpl
VC8_SRCVCPROJ = projects/Windows/VC8/src/curl.vcproj.dist
VC8_SRCVCPROJ_DEPS = $(VC8_SRCTMPL) Makefile.am src/Makefile.inc
VC9_LIBTMPL = projects/Windows/VC9/lib/libcurl.tmpl
VC9_LIBVCPROJ = projects/Windows/VC9/lib/libcurl.vcproj.dist
VC9_LIBVCPROJ_DEPS = $(VC9_LIBTMPL) Makefile.am lib/Makefile.inc
VC9_SRCTMPL = projects/Windows/VC9/src/curlsrc.tmpl
VC9_SRCVCPROJ = projects/Windows/VC9/src/curlsrc.vcproj.dist
VC9_SRCTMPL = projects/Windows/VC9/src/curl.tmpl
VC9_SRCVCPROJ = projects/Windows/VC9/src/curl.vcproj.dist
VC9_SRCVCPROJ_DEPS = $(VC9_SRCTMPL) Makefile.am src/Makefile.inc
VC10_LIBTMPL = projects/Windows/VC10/lib/libcurl.tmpl
VC10_LIBVCXPROJ = projects/Windows/VC10/lib/libcurl.vcxproj.dist
VC10_LIBVCXPROJ_DEPS = $(VC10_LIBTMPL) Makefile.am lib/Makefile.inc
VC10_SRCTMPL = projects/Windows/VC10/src/curlsrc.tmpl
VC10_SRCVCXPROJ = projects/Windows/VC10/src/curlsrc.vcxproj.dist
VC10_SRCTMPL = projects/Windows/VC10/src/curl.tmpl
VC10_SRCVCXPROJ = projects/Windows/VC10/src/curl.vcxproj.dist
VC10_SRCVCXPROJ_DEPS = $(VC10_SRCTMPL) Makefile.am src/Makefile.inc
VC11_LIBTMPL = projects/Windows/VC11/lib/libcurl.tmpl
VC11_LIBVCXPROJ = projects/Windows/VC11/lib/libcurl.vcxproj.dist
VC11_LIBVCXPROJ_DEPS = $(VC11_LIBTMPL) Makefile.am lib/Makefile.inc
VC11_SRCTMPL = projects/Windows/VC11/src/curlsrc.tmpl
VC11_SRCVCXPROJ = projects/Windows/VC11/src/curlsrc.vcxproj.dist
VC11_SRCTMPL = projects/Windows/VC11/src/curl.tmpl
VC11_SRCVCXPROJ = projects/Windows/VC11/src/curl.vcxproj.dist
VC11_SRCVCXPROJ_DEPS = $(VC11_SRCTMPL) Makefile.am src/Makefile.inc
VC12_LIBTMPL = projects/Windows/VC12/lib/libcurl.tmpl
VC12_LIBVCXPROJ = projects/Windows/VC12/lib/libcurl.vcxproj.dist
VC12_LIBVCXPROJ_DEPS = $(VC12_LIBTMPL) Makefile.am lib/Makefile.inc
VC12_SRCTMPL = projects/Windows/VC12/src/curlsrc.tmpl
VC12_SRCVCXPROJ = projects/Windows/VC12/src/curlsrc.vcxproj.dist
VC12_SRCTMPL = projects/Windows/VC12/src/curl.tmpl
VC12_SRCVCXPROJ = projects/Windows/VC12/src/curl.vcxproj.dist
VC12_SRCVCXPROJ_DEPS = $(VC12_SRCTMPL) Makefile.am src/Makefile.inc
VC_DIST = projects/README \
projects/build-openssl.bat \
projects/checksrc.bat \
projects/Windows/VC6/curl-all.dsw \
projects/Windows/VC6/lib/libcurl.dsw \
projects/Windows/VC6/src/curlsrc.dsw \
projects/Windows/VC7/curl-all.sln \
projects/Windows/VC7/lib/libcurl.sln \
projects/Windows/VC7/src/curlsrc.sln \
projects/Windows/VC7.1/curl-all.sln \
projects/Windows/VC7.1/lib/libcurl.sln \
projects/Windows/VC7.1/src/curlsrc.sln \
projects/Windows/VC8/curl-all.sln \
projects/Windows/VC8/lib/libcurl.sln \
projects/Windows/VC8/src/curlsrc.sln \
projects/Windows/VC9/curl-all.sln \
projects/Windows/VC9/lib/libcurl.sln \
projects/Windows/VC9/src/curlsrc.sln \
projects/Windows/VC10/curl-all.sln \
projects/Windows/VC10/lib/libcurl.sln \
projects/Windows/VC10/src/curlsrc.sln \
projects/Windows/VC11/curl-all.sln \
projects/Windows/VC11/lib/libcurl.sln \
projects/Windows/VC11/src/curlsrc.sln \
projects/Windows/VC12/curl-all.sln \
projects/Windows/VC12/lib/libcurl.sln \
projects/Windows/VC12/src/curlsrc.sln
VC14_LIBTMPL = projects/Windows/VC14/lib/libcurl.tmpl
VC14_LIBVCXPROJ = projects/Windows/VC14/lib/libcurl.vcxproj.dist
VC14_LIBVCXPROJ_DEPS = $(VC14_LIBTMPL) Makefile.am lib/Makefile.inc
VC14_SRCTMPL = projects/Windows/VC14/src/curl.tmpl
VC14_SRCVCXPROJ = projects/Windows/VC14/src/curl.vcxproj.dist
VC14_SRCVCXPROJ_DEPS = $(VC14_SRCTMPL) Makefile.am src/Makefile.inc
VC_DIST = projects/README \
projects/build-openssl.bat \
projects/build-wolfssl.bat \
projects/checksrc.bat \
projects/Windows/VC6/curl-all.dsw \
projects/Windows/VC6/lib/libcurl.dsw \
projects/Windows/VC6/src/curl.dsw \
projects/Windows/VC7/curl-all.sln \
projects/Windows/VC7/lib/libcurl.sln \
projects/Windows/VC7/src/curl.sln \
projects/Windows/VC7.1/curl-all.sln \
projects/Windows/VC7.1/lib/libcurl.sln \
projects/Windows/VC7.1/src/curl.sln \
projects/Windows/VC8/curl-all.sln \
projects/Windows/VC8/lib/libcurl.sln \
projects/Windows/VC8/src/curl.sln \
projects/Windows/VC9/curl-all.sln \
projects/Windows/VC9/lib/libcurl.sln \
projects/Windows/VC9/src/curl.sln \
projects/Windows/VC10/curl-all.sln \
projects/Windows/VC10/lib/libcurl.sln \
projects/Windows/VC10/lib/libcurl.vcxproj.filters \
projects/Windows/VC10/src/curl.sln \
projects/Windows/VC10/src/curl.vcxproj.filters \
projects/Windows/VC11/curl-all.sln \
projects/Windows/VC11/lib/libcurl.sln \
projects/Windows/VC11/lib/libcurl.vcxproj.filters \
projects/Windows/VC11/src/curl.sln \
projects/Windows/VC11/src/curl.vcxproj.filters \
projects/Windows/VC12/curl-all.sln \
projects/Windows/VC12/lib/libcurl.sln \
projects/Windows/VC12/lib/libcurl.vcxproj.filters \
projects/Windows/VC12/src/curl.sln \
projects/Windows/VC12/src/curl.vcxproj.filters \
projects/Windows/VC14/curl-all.sln \
projects/Windows/VC14/lib/libcurl.sln \
projects/Windows/VC14/lib/libcurl.vcxproj.filters \
projects/Windows/VC14/src/curl.sln \
projects/Windows/VC14/src/curl.vcxproj.filters
WINBUILD_DIST = winbuild/BUILD.WINDOWS.txt winbuild/gen_resp_file.bat \
winbuild/MakefileBuild.vc winbuild/Makefile.vc \
winbuild/Makefile.msvc.names
EXTRA_DIST = CHANGES COPYING maketgz Makefile.dist curl-config.in \
RELEASE-NOTES buildconf libcurl.pc.in MacOSX-Framework \
$(CMAKE_DIST) $(VC_DIST) $(WINBUILD_DIST) lib/libcurl.vers.in
RELEASE-NOTES buildconf libcurl.pc.in MacOSX-Framework scripts/zsh.pl \
$(CMAKE_DIST) $(VC_DIST) $(WINBUILD_DIST) lib/libcurl.vers.in \
buildconf.bat
CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) $(VC7_LIBVCPROJ) $(VC7_SRCVCPROJ) \
$(VC71_LIBVCPROJ) $(VC71_SRCVCPROJ) $(VC8_LIBVCPROJ) $(VC8_SRCVCPROJ) \
$(VC9_LIBVCPROJ) $(VC9_SRCVCPROJ) $(VC10_LIBVCXPROJ) $(VC10_SRCVCXPROJ) \
$(VC11_LIBVCXPROJ) $(VC11_SRCVCXPROJ) $(VC12_LIBVCXPROJ) $(VC12_SRCVCXPROJ)
$(VC11_LIBVCXPROJ) $(VC11_SRCVCXPROJ) $(VC12_LIBVCXPROJ) $(VC12_SRCVCXPROJ) \
$(VC14_LIBVCXPROJ) $(VC14_SRCVCXPROJ)
bin_SCRIPTS = curl-config
SUBDIRS = lib src include
SUBDIRS = lib src include scripts
DIST_SUBDIRS = $(SUBDIRS) tests packages docs
pkgconfigdir = $(libdir)/pkgconfig
@ -148,12 +169,12 @@ dist-hook:
done)
html:
cd docs; make html
cd docs && make html
pdf:
cd docs; make pdf
cd docs && make pdf
check: test examples
check: test examples check-docs
if CROSSCOMPILING
test-full: test
@ -181,6 +202,9 @@ endif
examples:
@(cd docs/examples; $(MAKE) check)
check-docs:
@(cd docs/libcurl; $(MAKE) check)
# This is a hook to have 'make clean' also clean up the docs and the tests
# dir. The extra check for the Makefiles being present is necessary because
# 'make distcheck' will make clean first in these directories _before_ it runs
@ -266,7 +290,7 @@ vc-ide: $(VC6_LIBDSP_DEPS) $(VC6_SRCDSP_DEPS) $(VC7_LIBVCPROJ_DEPS) \
$(VC8_LIBVCPROJ_DEPS) $(VC8_SRCVCPROJ_DEPS) $(VC9_LIBVCPROJ_DEPS) \
$(VC9_SRCVCPROJ_DEPS) $(VC10_LIBVCXPROJ_DEPS) $(VC10_SRCVCXPROJ_DEPS) \
$(VC11_LIBVCXPROJ_DEPS) $(VC11_SRCVCXPROJ_DEPS) $(VC12_LIBVCXPROJ_DEPS) \
$(VC12_SRCVCXPROJ_DEPS)
$(VC12_SRCVCXPROJ_DEPS) $(VC14_LIBVCXPROJ_DEPS) $(VC14_SRCVCXPROJ_DEPS)
@(win32_lib_srcs='$(LIB_CFILES)'; \
win32_lib_hdrs='$(LIB_HFILES) config-win32.h'; \
win32_lib_rc='$(LIB_RCFILES)'; \
@ -527,4 +551,22 @@ function gen_element(type, dir, file)\
-v src_rc="$$win32_src_rc" \
-v src_x_srcs="$$sorted_src_x_srcs" \
-v src_x_hdrs="$$sorted_src_x_hdrs" \
"$$awk_code" $(srcdir)/$(VC12_SRCTMPL) > $(VC12_SRCVCXPROJ) || { exit 1; };)
"$$awk_code" $(srcdir)/$(VC12_SRCTMPL) > $(VC12_SRCVCXPROJ) || { exit 1; }; \
\
echo "generating '$(VC14_LIBVCXPROJ)'"; \
awk -v proj_type=vcxproj \
-v lib_srcs="$$sorted_lib_srcs" \
-v lib_hdrs="$$sorted_lib_hdrs" \
-v lib_rc="$$win32_lib_rc" \
-v lib_vtls_srcs="$$sorted_lib_vtls_srcs" \
-v lib_vtls_hdrs="$$sorted_lib_vtls_hdrs" \
"$$awk_code" $(srcdir)/$(VC14_LIBTMPL) > $(VC14_LIBVCXPROJ) || { exit 1; }; \
\
echo "generating '$(VC14_SRCVCXPROJ)'"; \
awk -v proj_type=vcxproj \
-v src_srcs="$$sorted_src_srcs" \
-v src_hdrs="$$sorted_src_hdrs" \
-v src_rc="$$win32_src_rc" \
-v src_x_srcs="$$sorted_src_x_srcs" \
-v src_x_hdrs="$$sorted_src_x_hdrs" \
"$$awk_code" $(srcdir)/$(VC14_SRCTMPL) > $(VC14_SRCVCXPROJ) || { exit 1; };)

View File

@ -5,11 +5,11 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 1998 - 2015, 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.
# are also available at https://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
@ -566,6 +566,17 @@ src/Makefile.vc12: src/Makefile.vc6
@echo "generate $@"
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/ws2_32.lib/ws2_32.lib/g" -e "s/vc6/vc12/g" -e "s/VC6/VC12/g" src/Makefile.vc6 > src/Makefile.vc12
# VC14 makefiles are for use with VS2015
vc14: lib/Makefile.vc14 src/Makefile.vc14
lib/Makefile.vc14: lib/Makefile.vc6
@echo "generate $@"
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/ws2_32.lib/ws2_32.lib/g" -e "s/vc6/vc14/g" -e "s/VC6/VC14/g" lib/Makefile.vc6 > lib/Makefile.vc14
src/Makefile.vc14: src/Makefile.vc6
@echo "generate $@"
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/ws2_32.lib/ws2_32.lib/g" -e "s/vc6/vc14/g" -e "s/VC6/VC14/g" src/Makefile.vc6 > src/Makefile.vc14
ca-bundle: lib/mk-ca-bundle.pl
@echo "generate a fresh ca-bundle.crt"
@perl $< -b -l -u lib/ca-bundle.crt

8
README
View File

@ -24,7 +24,7 @@ README
CONTACT
If you have problems, questions, ideas or suggestions, please contact us
by posting to a suitable mailing list. See http://curl.haxx.se/mail/
by posting to a suitable mailing list. See https://curl.haxx.se/mail/
All contributors to the project are listed in the THANKS document.
@ -32,18 +32,18 @@ WEB SITE
Visit the curl web site for the latest news and downloads:
http://curl.haxx.se/
https://curl.haxx.se/
GIT
To download the very latest source off the GIT server do this:
git clone git://github.com/bagder/curl.git
git clone https://github.com/curl/curl.git
(you'll get a directory named curl created, filled with the source code)
NOTICE
Curl contains pieces of source code that is Copyright (c) 1998, 1999
Kungliga Tekniska Högskolan. This notice is included here to comply with the
Kungliga Tekniska Högskolan. This notice is included here to comply with the
distribution terms.

45
README.md Normal file
View File

@ -0,0 +1,45 @@
Curl is a command line tool for transferring data specified with URL
syntax. Find out how to use curl by reading [the curl.1 man
page](https://curl.haxx.se/docs/manpage.html) or [the MANUAL
document](https://curl.haxx.se/docs/manual.html). Find out how to install Curl
by reading [the INSTALL document](https://curl.haxx.se/docs/install.html).
libcurl is the library curl is using to do its job. It is readily available to
be used by your software. Read [the libcurl.3 man
page](https://curl.haxx.se/libcurl/c/libcurl.html) to learn how!
You find answers to the most frequent questions we get in [the FAQ
document](https://curl.haxx.se/docs/faq.html).
Study [the COPYING file](https://curl.haxx.se/docs/copyright.html) for
distribution terms and similar. If you distribute curl binaries or other
binaries that involve libcurl, you might enjoy [the LICENSE-MIXING
document](https://curl.haxx.se/legal/licmix.html).
## CONTACT
If you have problems, questions, ideas or suggestions, please contact us by
posting to a suitable [mailing list](https://curl.haxx.se/mail/).
All contributors to the project are listed in [the THANKS
document](https://curl.haxx.se/docs/thanks.html).
## WEB SITE
Visit the [curl web site](https://curl.haxx.se/) for the latest news and
downloads.
## GIT
To download the very latest source off the GIT server do this:
git clone https://github.com/curl/curl.git
(you'll get a directory named curl created, filled with the source code)
## NOTICE
Curl contains pieces of source code that is Copyright (c) 1998, 1999 Kungliga
Tekniska Högskolan. This notice is included here to comply with the
distribution terms.

View File

@ -1,123 +1,159 @@
Curl and libcurl 7.41.0
Curl and libcurl 7.48.0
Public curl releases: 144
Command line options: 163
curl_easy_setopt() options: 209
Public functions in libcurl: 58
Contributors: 1233
Public curl releases: 153
Command line options: 179
curl_easy_setopt() options: 221
Public functions in libcurl: 61
Contributors: 1364
This release includes the following changes:
o NetWare build: added TLS-SRP enabled build
o winbuild: Added option to build with c-ares
o Added --cert-status [9]
o Added CURLOPT_SSL_VERIFYSTATUS [10]
o sasl: implement EXTERNAL authentication mechanism
o configure: --with-ca-fallback: use built-in TLS CA fallback [2]
o TFTP: add --tftp-no-options to expose CURLOPT_TFTP_NO_OPTIONS [22]
o getinfo: CURLINFO_TLS_SSL_PTR supersedes CURLINFO_TLS_SESSION [25]
o added CODE_STYLE.md [47]
This release includes the following bugfixes:
o sasl_gssapi: Fixed build on NetBSD with built-in GSS-API [1]
o FTP: fix IPv6 host using link-local address [2]
o FTP: if EPSV fails on IPV6 connections, bail out
o gssapi: Remove need for duplicated GSS_C_NT_HOSTBASED_SERVICE definitions
o NSS: fix compiler error when built http2-enabled
o mingw build: allow to pass custom CFLAGS [3]
o add -m64 CFLAGS when targeting mingw64, add -m32/-m64 to LDFLAGS [4]
o curl_schannel.c: mark session as removed from cache if not freed [5]
o Curl_pretransfer: reset expected transfer sizes [6]
o curl.h: remove extra space [7]
o curl_endian: Fixed build when 64-bit integers are not supported [8]
o checksrc.bat: Better detection of Perl installation
o build-openssl.bat: Added check for Perl installation
o http_negotiate: Return CURLcode in Curl_input_negotiate() instead of int
o http_negotiate: Added empty decoded challenge message info text
o vtls: Removed unimplemented overrides of curlssl_close_all()
o sasl_gssapi: Fixed memory leak with local SPN variable
o http_negotiate: Use dynamic buffer for SPN generation
o ldap: Renamed the CURL_LDAP_WIN definition to USE_WIN32_LDAP
o openssl: do public key pinning check independently [11]
o timeval: typecast for better type (on Amiga)
o ipv6: enclose AF_INET6 uses with proper #ifdefs for ipv6
o SASL: common URL option and auth capabilities decoders for all protocols
o BoringSSL: fix build
o BoringSSL: detected by configure, switches off NTLM
o openvms: Handle openssl/0.8.9zb version parsing
o configure: detect libresssl
o configure: remove detection of the old yassl emulation API
o curl_setup: Disable SMB/CIFS support when HTTP only
o imap: remove automatic password setting: it breaks external sasl authentication
o sasl: remove XOAUTH2 from default enabled authentication mechanism
o runtests: identify BoringSSL and libressl
o security: avoid compiler warning
o ldap: build with BoringSSL
o des: Added Curl_des_set_odd_parity()
o CURLOPT_SEEKFUNCTION.3: also when server closes a connection
o CURLOPT_HTTP_VERSION.3: CURL_HTTP_VERSION_2_0 added in 7.33.0
o build: Removed unused Visual Studio bscmake settings
o build: Enabled DEBUGBUILD in Visual Studio debug builds
o build: Renamed top level Visual Studio solution files
o build: Removed Visual Studio SuppressStartupBanner directive for VC8+
o libcurl-symbols: first basic shot for autogenerated docs
o Makefile.am: fix 'make distcheck'
o getpass_r: read from stdin, not stdout! [12]
o getpass: protect include with proper #ifdef
o opts: CURLOPT_CAINFO availability depends on SSL engine
o more cleanup of 'CURLcode result' return code
o MD4: replace implementation
o MD5: replace implementation
o openssl: SSL_SESSION->ssl_version no longer exist [13]
o md5: use axTLS's own MD5 functions when available
o schannel: Removed curl_ prefix from source files
o curl.1: add warning when using -H and redirects
o curl.1: clarify that -X is used for all requests
o gskit: Fix exclusive SSLv3 option
o polarssl: Fix exclusive SSL protocol version options [14]
o http2: Fix bug that associated stream canceled on PUSH_PROMISE
o ftp: accept all 2xx responses to the PORT command
o configure: allow both --with-ca-bundle and --with-ca-path [15]
o cmake: install the dll file to the correct directory
o nss: fix NPN/ALPN protocol negotiation
o polarssl: fix ALPN protocol negotiation
o cmake: Fix generation of tool_hugehelp.c on windows
o cmake: fix winsock2 detection on windows
o gnutls: fix build with HTTP2
o connect: fix a spurious connect failure on dual-stacked hosts [16]
o test: test 530 is now less timing dependent
o telnet: invalid use of custom read function if not set
o Proxy-Connection: stop sending this header by default [1]
o os400: sync ILE/RPG definitions with latest public header files
o cookies: allow spaces in cookie names, cut of trailing spaces [3]
o tool_urlglob: Allow reserved dos device names (Windows) [4]
o openssl: remove most BoringSSL #ifdefs [5]
o tool_doswin: Support for literal path prefix \\?\
o mbedtls: fix ALPN usage segfault [6]
o mbedtls: fix memory leak when destroying SSL connection data [7]
o nss: do not count enabled cipher-suites
o examples/cookie_interface.c: add cleanup call
o examples: adhere to curl code style
o curlx_tvdiff: handle 32bit time_t overflows [8]
o dist: ship buildconf.bat too
o curl.1: --disable-{eprt,epsv} are ignored for IPv6 hosts [9]
o generate.bat: Fix comment bug by removing old comments [10]
o test1604: Add to Makefile.inc so it gets run
o gtls: fix for builds lacking encrypted key file support [11]
o SCP: use libssh2_scp_recv2 to support > 2GB files on windows [12]
o CURLOPT_CONNECTTIMEOUT_MS.3: Fix example to use milliseconds option [13]
o cookie: do not refuse cookies to localhost [14]
o openssl: avoid direct PKEY access with OpenSSL 1.1.0 [15]
o http: Don't break the header into chunks if HTTP/2 [16]
o http2: don't decompress gzip decoding automatically [17]
o curlx.c: i2s_ASN1_IA5STRING() clashes with an openssl function
o curl.1: add a missing dash
o curl.1: HTTP headers for --cookie must be Set-Cookie style [18]
o CURLOPT_COOKIEFILE.3: HTTP headers must be Set-Cookie style [18]
o curl_sasl: Fix memory leak in digest parser [19]
o src/Makefile.m32: add CURL_{LD,C}FLAGS_EXTRAS support [20]
o CURLOPT_DEBUGFUNCTION.3: Fix example
o runtests: Fixed usage of %PWD on MinGW64 [21]
o tests/sshserver.pl: use RSA instead of DSA for host auth [23]
o multi_remove_handle: keep the timeout list until after disconnect [24]
o Curl_read: check for activated HTTP/1 pipelining, not only requested
o configure: warn on invalid ca bundle or path [26]
o file: try reading from files with no size [27]
o getinfo: Add support for mbedTLS TLS session info
o formpost: fix memory leaks in AddFormData error branches [28]
o makefile.m32: allow to pass .dll/.exe-specific LDFLAGS [29]
o url: if Curl_done is premature then pipeline not in use [30]
o cookie: remove redundant check [31]
o cookie: Don't expire session cookies in remove_expired [32]
o makefile.m32: fix to allow -ssh2-winssl combination [33]
o checksrc.bat: Fixed cannot find perl if installed but not in path
o build-openssl.bat: Fixed cannot find perl if installed but not in path
o mbedtls: fix user-specified SSL protocol version
o makefile.m32: add missing libs for static -winssl-ssh2 builds [34]
o test46: change cookie expiry date [35]
o pipeline: Sanity check pipeline pointer before accessing it [36]
o openssl: use the correct OpenSSL/BoringSSL/LibreSSL in messages
o ftp_done: clear tunnel_state when secondary socket closes [37]
o opt-docs: fix heading macros [38]
o imap/pop3/smtp: Fixed connections upgraded with TLS are not reused [39]
o curl_multi_wait: never return -1 in 'numfds' [40]
o url.c: fix clang warning: no newline at end of file
o krb5: improved type handling to avoid clang compiler warnings
o cookies: first n/v pair in Set-Cookie: is the cookie, then parameters [41]
o multi: avoid blocking during CURLM_STATE_WAITPROXYCONNECT [42]
o multi hash: ensure modulo performed on curl_socket_t [43]
o curl: glob_range: no need to check unsigned variable for negative
o easy: add check to malloc() when running event-based
o CURLOPT_SSLENGINE.3: Only for OpenSSL built with engine support [44]
o version: thread safety
o openssl: verbose: show matching SAN pattern
o openssl: adapt to OpenSSL 1.1.0 API breakage in ERR_remove_thread_state()
o formdata.c: Fixed compilation warning
o configure: use cpp -P when needed [45]
o imap.c: Fixed compilation warning with /Wall enabled
o config-w32.h: Fixed compilation warning when /Wall enabled
o ftp/imap/pop3/smtp: Fixed compilation warning when /Wall enabled
o build: Added missing Visual Studio filter files for VC10 onwards
o easy: Remove poll failure check in easy_transfer
o mbedtls: fix compiler warning
o build-wolfssl: Update VS properties for wolfSSL v3.9.0
o Fixed various compilation warnings when verbose strings disabled
This release includes the following known bugs:
o see docs/KNOWN_BUGS (http://curl.haxx.se/docs/knownbugs.html)
o see docs/KNOWN_BUGS (https://curl.haxx.se/docs/knownbugs.html)
This release would not have looked like this without help, code, reports and
advice from friends like these:
Alessandro Ghedini, Alexander Peslyak, Ben Boeckel, Brad King, Brad Spencer,
Chris Young, Dan Fandrich, Daniel Stenberg, Gisle Vanem, Guenter Knauf,
Jean-Francois Durand, Joe Mason, John E. Malmberg, Jon Seymour, Julian Ospald,
Kamil Dudka, Kyle J. McKay, Leith Bade, Marc Hoersken, Michael Kaufmann,
Michael Wallner, Mohammad AlSaleh, Nick Zitzmann, Patrick Monnerat,
Ray Satiro, Rich Burridge, Sam Schanken, Sergei Nikulov, Steve Holme,
Tatsuhiro Tsujikawa, Thomas Klausner, Viktor Szakats, Vojtěch Král,
Yun SangHo
Anders Bakken, Brad Fitzpatrick, Clint Clayton, Dan Fandrich,
Daniel Stenberg, David Benjamin, David Byron, Emil Lerner, Eric S. Raymond,
Gisle Vanem, Jaime Fullaondo, Jeffrey Walton, Jesse Tan, Justin Ehlert,
Kamil Dudka, Kazuho Oku, Ludwig Nussel, Maksim Kuzevanov, Michael König,
Oliver Graute, Patrick Monnerat, Rafael Antonio, Ray Satiro, Seth Mos,
Shine Fan, Steve Holme, Tatsuhiro Tsujikawa, Timotej Lazar, Tim Rühsen,
Viktor Szakáts,
(30 contributors)
Thanks! (and sorry if I forgot to mention someone)
References to bug reports and discussions on issues:
[1] = http://curl.haxx.se/bug/view.cgi?id=1469
[2] = http://curl.haxx.se/bug/view.cgi?id=1468
[3] = https://github.com/bagder/curl/pull/136
[4] = https://github.com/bagder/curl/pull/134
[5] = http://curl.haxx.se/mail/lib-2015-01/0036.html
[6] = http://curl.haxx.se/mail/lib-2015-01/0065.html
[7] = https://github.com/bagder/curl/pull/137
[8] = http://curl.haxx.se/mail/lib-2015-01/0094.html
[9] = http://curl.haxx.se/docs/manpage.html#--cert-status
[10] = http://curl.haxx.se/libcurl/c/CURLOPT_SSL_VERIFYSTATUS.html
[11] = http://curl.haxx.se/bug/view.cgi?id=1471
[12] = http://curl.haxx.se/bug/view.cgi?id=1476
[13] = http://curl.haxx.se/mail/lib-2015-02/0034.html
[14] = http://curl.haxx.se/mail/lib-2015-01/0002.html
[15] = https://github.com/bagder/curl/pull/139
[16] = https://bugzilla.redhat.com/1187531
[1] = https://curl.haxx.se/bug/?i=633
[2] = https://curl.haxx.se/bug/?i=569
[3] = https://curl.haxx.se/bug/?i=639
[4] = https://github.com/curl/curl/commit/4520534#commitcomment-15954863
[5] = https://curl.haxx.se/bug/?i=640
[6] = https://curl.haxx.se/bug/?i=642
[7] = https://curl.haxx.se/bug/?i=626
[8] = https://curl.haxx.se/bug/?i=646
[9] = https://bugzilla.redhat.com/1305970
[10] = https://curl.haxx.se/bug/?i=649
[11] = https://curl.haxx.se/bug/?i=651
[12] = https://curl.haxx.se/bug/?i=451
[13] = https://curl.haxx.se/bug/?i=653
[14] = https://curl.haxx.se/bug/?i=658
[15] = https://curl.haxx.se/bug/?i=650
[16] = https://curl.haxx.se/bug/?i=659
[17] = https://curl.haxx.se/bug/?i=661
[18] = https://curl.haxx.se/bug/?i=666
[19] = https://curl.haxx.se/bug/?i=667
[20] = https://curl.haxx.se/bug/?i=670
[21] = https://curl.haxx.se/bug/?i=672
[22] = https://curl.haxx.se/bug/?i=481
[23] = https://curl.haxx.se/bug/?i=676
[24] = https://curl.haxx.se/mail/lib-2016-02/0097.html
[25] = https://curl.haxx.se/libcurl/c/CURLINFO_TLS_SSL_PTR.html
[26] = https://curl.haxx.se/bug/?i=404
[27] = https://curl.haxx.se/bug/?i=681
[28] = https://curl.haxx.se/bug/?i=688
[29] = https://curl.haxx.se/bug/?i=689
[30] = https://curl.haxx.se/bug/?i=690
[31] = https://curl.haxx.se/bug/?i=695
[32] = https://curl.haxx.se/bug/?i=697
[33] = https://curl.haxx.se/bug/?i=692
[34] = https://curl.haxx.se/bug/?i=693
[35] = https://curl.haxx.se/bug/?i=697
[36] = https://curl.haxx.se/bug/?i=704
[37] = https://curl.haxx.se/bug/?i=701
[38] = https://curl.haxx.se/bug/?i=705
[39] = https://curl.haxx.se/bug/?i=422
[40] = https://curl.haxx.se/bug/?i=707
[41] = https://curl.haxx.se/bug/?i=709
[42] = https://curl.haxx.se/bug/?i=703
[43] = https://curl.haxx.se/bug/?i=712
[44] = https://curl.haxx.se/mail/lib-2016-03/0150.html
[45] = https://curl.haxx.se/bug/?i=719
[47] = https://curl.haxx.se/dev/code-style.html

View File

@ -5,11 +5,11 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 1998 - 2015, 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.
# are also available at https://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
@ -20,7 +20,6 @@
#
#***************************************************************************
dnl CURL_CHECK_DEF (SYMBOL, [INCLUDES], [SILENT])
dnl -------------------------------------------------
dnl Use the C preprocessor to find out if the given object-style symbol
@ -31,6 +30,10 @@ dnl result in a set of double-quoted strings the returned expansion will
dnl actually be a single double-quoted string concatenating all them.
AC_DEFUN([CURL_CHECK_DEF], [
AC_REQUIRE([CURL_CPP_P])dnl
OLDCPPFLAGS=$CPPFLAGS
# CPPPFLAGS comes from CURL_CPP_P
CPPFLAGS="$CPPPFLAGS"
AS_VAR_PUSHDEF([ac_HaveDef], [curl_cv_have_def_$1])dnl
AS_VAR_PUSHDEF([ac_Def], [curl_cv_def_$1])dnl
if test -z "$SED"; then
@ -67,6 +70,7 @@ CURL_DEF_TOKEN $1
fi
AS_VAR_POPDEF([ac_Def])dnl
AS_VAR_POPDEF([ac_HaveDef])dnl
CPPFLAGS=$OLDCPPFLAGS
])
@ -1851,8 +1855,10 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC], [
AC_REQUIRE([AC_HEADER_TIME])dnl
AC_CHECK_HEADERS(sys/types.h sys/time.h time.h)
AC_MSG_CHECKING([for monotonic clock_gettime])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#
if test "x$dontwant_rt" == "xno" ; then
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
@ -1866,17 +1872,18 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOCK_GETTIME_MONOTONIC], [
#include <time.h>
#endif
#endif
]],[[
struct timespec ts;
(void)clock_gettime(CLOCK_MONOTONIC, &ts);
]])
],[
AC_MSG_RESULT([yes])
ac_cv_func_clock_gettime="yes"
],[
AC_MSG_RESULT([no])
ac_cv_func_clock_gettime="no"
])
]],[[
struct timespec ts;
(void)clock_gettime(CLOCK_MONOTONIC, &ts);
]])
],[
AC_MSG_RESULT([yes])
ac_cv_func_clock_gettime="yes"
],[
AC_MSG_RESULT([no])
ac_cv_func_clock_gettime="no"
])
fi
dnl Definition of HAVE_CLOCK_GETTIME_MONOTONIC is intentionally postponed
dnl until library linking and run-time checks for clock_gettime succeed.
])
@ -2452,23 +2459,6 @@ AC_DEFUN([CURL_CHECK_FUNC_SELECT], [
])
# This is only a temporary fix. This macro is here to replace the broken one
# delivered by the automake project (including the 1.9.6 release). As soon as
# they ship a working version we SHOULD remove this work-around.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
test x"${MISSING+set}" = xset || MISSING="\${SHELL} \"$am_aux_dir/missing\""
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
AC_MSG_WARN([`missing' script is too old or missing])
fi
])
dnl CURL_VERIFY_RUNTIMELIBS
dnl -------------------------------------------------
dnl Verify that the shared libs found so far can be used when running
@ -2584,7 +2574,8 @@ AC_DEFUN([CURL_CHECK_CA_BUNDLE], [
AC_MSG_CHECKING([default CA cert bundle/path])
AC_ARG_WITH(ca-bundle,
AC_HELP_STRING([--with-ca-bundle=FILE], [File name to use as CA bundle])
AC_HELP_STRING([--with-ca-bundle=FILE],
[Path to a file containing CA certificates (example: /etc/ca-bundle.crt)])
AC_HELP_STRING([--without-ca-bundle], [Don't use a default CA bundle]),
[
want_ca="$withval"
@ -2594,7 +2585,11 @@ AC_HELP_STRING([--without-ca-bundle], [Don't use a default CA bundle]),
],
[ want_ca="unset" ])
AC_ARG_WITH(ca-path,
AC_HELP_STRING([--with-ca-path=DIRECTORY], [Directory to use as CA path])
AC_HELP_STRING([--with-ca-path=DIRECTORY],
[Path to a directory containing CA certificates stored individually, with \
their filenames in a hash format. This option can be used with OpenSSL, \
GnuTLS and PolarSSL backends. Refer to OpenSSL c_rehash for details. \
(example: /etc/certificates)])
AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
[
want_capath="$withval"
@ -2604,6 +2599,10 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
],
[ want_capath="unset"])
ca_warning=" (warning: certs not found)"
capath_warning=" (warning: certs not found)"
check_capath=""
if test "x$want_ca" != "xno" -a "x$want_ca" != "xunset" -a \
"x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then
dnl both given
@ -2615,8 +2614,8 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
capath="no"
elif test "x$want_capath" != "xno" -a "x$want_capath" != "xunset"; then
dnl --with-ca-path given
if test "x$OPENSSL_ENABLED" != "x1" -a "x$POLARSSL_ENABLED" != "x1"; then
AC_MSG_ERROR([--with-ca-path only works with openSSL or PolarSSL])
if test "x$OPENSSL_ENABLED" != "x1" -a "x$GNUTLS_ENABLED" != "x1" -a "x$POLARSSL_ENABLED" != "x1"; then
AC_MSG_ERROR([--with-ca-path only works with OpenSSL, GnuTLS or PolarSSL])
fi
capath="$want_capath"
ca="no"
@ -2652,12 +2651,7 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
fi
if test "x$want_capath" = "xunset" -a "x$ca" = "xno" -a \
"x$OPENSSL_ENABLED" = "x1"; then
for a in /etc/ssl/certs/; do
if test -d "$a" && ls "$a"/[[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]].0 >/dev/null 2>/dev/null; then
capath="$a"
break
fi
done
check_capath="/etc/ssl/certs/"
fi
else
dnl no option given and cross-compiling
@ -2665,6 +2659,30 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
fi
fi
if test "x$ca" = "xno" || test -f "$ca"; then
ca_warning=""
fi
if test "x$capath" != "xno"; then
check_capath="$capath"
fi
if test ! -z "$check_capath"; then
for a in "$check_capath"; do
if test -d "$a" && ls "$a"/[[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]].0 >/dev/null 2>/dev/null; then
if test "x$capath" = "xno"; then
capath="$a"
fi
capath_warning=""
break
fi
done
fi
if test "x$capath" = "xno"; then
capath_warning=""
fi
if test "x$ca" != "xno"; then
CURL_CA_BUNDLE='"'$ca'"'
AC_DEFINE_UNQUOTED(CURL_CA_BUNDLE, "$ca", [Location of default ca bundle])
@ -2676,9 +2694,27 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
AC_DEFINE_UNQUOTED(CURL_CA_PATH, "$capath", [Location of default ca path])
AC_MSG_RESULT([$capath (capath)])
fi
if test "x$ca" == "xno" && test "x$capath" == "xno"; then
if test "x$ca" = "xno" && test "x$capath" = "xno"; then
AC_MSG_RESULT([no])
fi
AC_MSG_CHECKING([whether to use builtin CA store of SSL library])
AC_ARG_WITH(ca-fallback,
AC_HELP_STRING([--with-ca-fallback], [Use the built in CA store of the SSL library])
AC_HELP_STRING([--without-ca-fallback], [Don't use the built in CA store of the SSL library]),
[
if test "x$with_ca_fallback" != "xyes" -a "x$with_ca_fallback" != "xno"; then
AC_MSG_ERROR([--with-ca-fallback only allows yes or no as parameter])
fi
],
[ with_ca_fallback="no"])
AC_MSG_RESULT([$with_ca_fallback])
if test "x$with_ca_fallback" = "xyes"; then
if test "x$OPENSSL_ENABLED" != "x1" -a "x$GNUTLS_ENABLED" != "x1"; then
AC_MSG_ERROR([--with-ca-fallback only works with OpenSSL or GnuTLS])
fi
AC_DEFINE_UNQUOTED(CURL_CA_FALLBACK, 1, [define "1" to use built in CA store of SSL library ])
fi
])
@ -2851,7 +2887,6 @@ AC_DEFUN([CURL_CONFIGURE_CURL_OFF_T], [
#
x_LP64_long=""
x_LP32_long=""
x_LP16_long=""
#
if test "$ac_cv_sizeof_long" -eq "8" &&
test "$ac_cv_sizeof_voidp" -ge "8"; then
@ -2859,9 +2894,6 @@ AC_DEFUN([CURL_CONFIGURE_CURL_OFF_T], [
elif test "$ac_cv_sizeof_long" -eq "4" &&
test "$ac_cv_sizeof_voidp" -ge "4"; then
x_LP32_long="long"
elif test "$ac_cv_sizeof_long" -eq "2" &&
test "$ac_cv_sizeof_voidp" -ge "2"; then
x_LP16_long="long"
fi
#
dnl DO_CURL_OFF_T_CHECK results are stored in next 3 vars
@ -2895,17 +2927,6 @@ AC_DEFUN([CURL_CONFIGURE_CURL_OFF_T], [
done
AC_MSG_RESULT([$curl_typeof_curl_off_t])
fi
if test "$curl_typeof_curl_off_t" = "unknown"; then
AC_MSG_CHECKING([for 16-bit curl_off_t data type])
for t2 in \
"$x_LP16_long" \
'int16_t' \
'__int16' \
'int' ; do
DO_CURL_OFF_T_CHECK([$t2], [2])
done
AC_MSG_RESULT([$curl_typeof_curl_off_t])
fi
if test "$curl_typeof_curl_off_t" = "unknown"; then
AC_MSG_ERROR([cannot find data type for curl_off_t.])
fi
@ -3066,12 +3087,14 @@ dnl Optionally PKG_CONFIG_LIBDIR may be given as $pcdir.
dnl
AC_DEFUN([CURL_CHECK_PKGCONFIG], [
if test -n "$PKG_CONFIG"; then
PKGCONFIG="$PKG_CONFIG"
else
AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no],
[$PATH:/usr/bin:/usr/local/bin])
fi
PKGCONFIG="no"
AC_PATH_TOOL( PKGCONFIG, pkg-config, no, $PATH:/usr/bin:/usr/local/bin)
if test x$PKGCONFIG != xno; then
if test "x$PKGCONFIG" != "xno"; then
AC_MSG_CHECKING([for $1 options with pkg-config])
dnl ask pkg-config about $1
itexists=`CURL_EXPORT_PCDIR([$2]) dnl
@ -3128,3 +3151,48 @@ use vars qw(
1;
_EOF
])
dnl CURL_CPP_P
dnl
dnl Check if $cpp -P should be used for extract define values due to gcc 5
dnl splitting up strings and defines between line outputs. gcc by default
dnl (without -P) will show TEST EINVAL TEST as
dnl
dnl # 13 "conftest.c"
dnl TEST
dnl # 13 "conftest.c" 3 4
dnl 22
dnl # 13 "conftest.c"
dnl TEST
AC_DEFUN([CURL_CPP_P], [
AC_MSG_CHECKING([if cpp -P is needed])
AC_EGREP_CPP([TEST.*TEST], [
#include <errno.h>
TEST EINVAL TEST
], [cpp=no], [cpp=yes])
AC_MSG_RESULT([$cpp])
dnl we need cpp -P so check if it works then
if test "x$cpp" = "xyes"; then
AC_MSG_CHECKING([if cpp -P works])
OLDCPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -P"
AC_EGREP_CPP([TEST.*TEST], [
#include <errno.h>
TEST EINVAL TEST
], [cpp_p=yes], [cpp_p=no])
AC_MSG_RESULT([$cpp_p])
if test "x$cpp_p" = "xno"; then
AC_MSG_WARN([failed to figure out cpp -P alternative])
# without -P
CPPPFLAGS=$OLDCPPFLAGS
else
# with -P
CPPPFLAGS=$CPPFLAGS
fi
dnl restore CPPFLAGS
CPPFLAGS=$OLDCPPFLAGS
fi
])

35
appveyor.yml Normal file
View File

@ -0,0 +1,35 @@
version: 7.47.0.{build}
environment:
matrix:
- PRJ_GEN: "Visual Studio 11 2012 Win64"
BDIR: msvc2012
PRJ_CFG: Release
OPENSSL: OFF
- PRJ_GEN: "Visual Studio 12 2013 Win64"
BDIR: msvc2013
PRJ_CFG: Release
OPENSSL: OFF
- PRJ_GEN: "Visual Studio 14 2015 Win64"
BDIR: msvc2015
PRJ_CFG: Release
OPENSSL: OFF
- PRJ_GEN: "Visual Studio 11 2012 Win64"
BDIR: msvc2012
PRJ_CFG: Release
OPENSSL: ON
- PRJ_GEN: "Visual Studio 12 2013 Win64"
BDIR: msvc2013
PRJ_CFG: Release
OPENSSL: ON
- PRJ_GEN: "Visual Studio 14 2015 Win64"
BDIR: msvc2015
PRJ_CFG: Release
OPENSSL: ON
build_script:
- mkdir build.%BDIR%
- cd build.%BDIR%
- cmake .. -G"%PRJ_GEN%" -DCMAKE_USE_OPENSSL=%OPENSSL%
- cmake --build . --config %PRJ_CFG% --clean-first

View File

@ -10,7 +10,7 @@
#
# 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.
# are also available at https://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
@ -318,6 +318,8 @@ for fname in .deps \
ltsugar.m4 \
ltversion.m4 \
lt~obsolete.m4 \
missing \
install-sh \
stamp-h1 \
stamp-h2 \
stamp-h3 ; do
@ -329,7 +331,7 @@ done
#
echo "buildconf: running libtoolize"
${libtoolize} --copy --automake --force || die "libtoolize command failed"
${libtoolize} --copy --force || die "libtoolize command failed"
# When using libtool 1.5.X (X < 26) we copy libtool.m4 to our local m4
# subdirectory and this local copy is patched to fix some warnings that

View File

@ -1,38 +1,350 @@
@echo off
REM
REM
REM This batch file must be used to set up a git tree to build on
REM systems where there is no autotools support (i.e. Microsoft).
REM
REM This file is not included nor needed for curl's release
REM archives, neither for curl's daily snapshot archives.
rem ***************************************************************************
rem * _ _ ____ _
rem * Project ___| | | | _ \| |
rem * / __| | | | |_) | |
rem * | (__| |_| | _ <| |___
rem * \___|\___/|_| \_\_____|
rem *
rem * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
rem *
rem * This software is licensed as described in the file COPYING, which
rem * you should have received as part of this distribution. The terms
rem * are also available at https://curl.haxx.se/docs/copyright.html.
rem *
rem * You may opt to use, copy, modify, merge, publish, distribute and/or sell
rem * copies of the Software, and permit persons to whom the Software is
rem * furnished to do so, under the terms of the COPYING file.
rem *
rem * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
rem * KIND, either express or implied.
rem *
rem ***************************************************************************
if exist GIT-INFO goto start_doing
ECHO ERROR: This file shall only be used with a curl git tree checkout.
goto end_all
:start_doing
rem NOTES
rem
rem This batch file must be used to set up a git tree to build on systems where
rem there is no autotools support (i.e. DOS and Windows).
rem
REM create tool_hugehelp.c
if not exist src\tool_hugehelp.c.cvs goto end_hugehelp_c
copy /Y src\tool_hugehelp.c.cvs src\tool_hugehelp.c
:end_hugehelp_c
:begin
rem Set our variables
if "%OS%" == "Windows_NT" setlocal
set MODE=GENERATE
REM create Makefile
if not exist Makefile.dist goto end_makefile
copy /Y Makefile.dist Makefile
:end_makefile
rem Switch to this batch file's directory
cd /d "%~0\.." 1>NUL 2>&1
REM create curlbuild.h
if not exist include\curl\curlbuild.h.dist goto end_curlbuild_h
copy /Y include\curl\curlbuild.h.dist include\curl\curlbuild.h
:end_curlbuild_h
rem Check we are running from a curl git repository
if not exist GIT-INFO goto norepo
REM setup c-ares git tree
if not exist ares\buildconf.bat goto end_c_ares
cd ares
call buildconf.bat
cd ..
:end_c_ares
rem Detect programs. HAVE_<PROGNAME>
rem When not found the variable is set undefined. The undefined pattern
rem allows for statements like "if not defined HAVE_PERL (command)"
groff --version <NUL 1>NUL 2>&1
if errorlevel 1 (set HAVE_GROFF=) else (set HAVE_GROFF=Y)
nroff --version <NUL 1>NUL 2>&1
if errorlevel 1 (set HAVE_NROFF=) else (set HAVE_NROFF=Y)
perl --version <NUL 1>NUL 2>&1
if errorlevel 1 (set HAVE_PERL=) else (set HAVE_PERL=Y)
gzip --version <NUL 1>NUL 2>&1
if errorlevel 1 (set HAVE_GZIP=) else (set HAVE_GZIP=Y)
:end_all
:parseArgs
if "%~1" == "" goto start
if /i "%~1" == "-clean" (
set MODE=CLEAN
) else if /i "%~1" == "-?" (
goto syntax
) else if /i "%~1" == "-h" (
goto syntax
) else if /i "%~1" == "-help" (
goto syntax
) else (
goto unknown
)
shift & goto parseArgs
:start
if "%MODE%" == "GENERATE" (
echo.
echo Generating prerequisite files
call :generate
if errorlevel 4 goto nogencurlbuild
if errorlevel 3 goto nogenhugehelp
if errorlevel 2 goto nogenmakefile
if errorlevel 1 goto warning
) else (
echo.
echo Removing prerequisite files
call :clean
if errorlevel 3 goto nocleancurlbuild
if errorlevel 2 goto nocleanhugehelp
if errorlevel 1 goto nocleanmakefile
)
goto success
rem Main generate function.
rem
rem Returns:
rem
rem 0 - success
rem 1 - success with simplified tool_hugehelp.c
rem 2 - failed to generate Makefile
rem 3 - failed to generate tool_hugehelp.c
rem 4 - failed to generate curlbuild.h
rem
:generate
if "%OS%" == "Windows_NT" setlocal
set BASIC_HUGEHELP=0
rem Create Makefile
echo * %CD%\Makefile
if exist Makefile.dist (
copy /Y Makefile.dist Makefile 1>NUL 2>&1
if errorlevel 1 (
if "%OS%" == "Windows_NT" endlocal
exit /B 2
)
)
rem Create tool_hugehelp.c
echo * %CD%\src\tool_hugehelp.c
call :genHugeHelp
if errorlevel 2 (
if "%OS%" == "Windows_NT" endlocal
exit /B 3
)
if errorlevel 1 (
set BASIC_HUGEHELP=1
)
cmd /c exit 0
rem Create curlbuild.h
echo * %CD%\include\curl\curlbuild.h
if exist include\curl\curlbuild.h.dist (
copy /Y include\curl\curlbuild.h.dist include\curl\curlbuild.h 1>NUL 2>&1
if errorlevel 1 (
if "%OS%" == "Windows_NT" endlocal
exit /B 4
)
)
rem Setup c-ares git tree
if exist ares\buildconf.bat (
echo.
echo Configuring c-ares build environment
cd ares
call buildconf.bat
cd ..
)
if "%BASIC_HUGEHELP%" == "1" (
if "%OS%" == "Windows_NT" endlocal
exit /B 1
)
if "%OS%" == "Windows_NT" endlocal
exit /B 0
rem Main clean function.
rem
rem Returns:
rem
rem 0 - success
rem 1 - failed to clean Makefile
rem 2 - failed to clean tool_hugehelp.c
rem 3 - failed to clean curlbuild.h
rem
:clean
rem Remove Makefile
echo * %CD%\Makefile
if exist Makefile (
del Makefile 2>NUL
if exist Makefile (
exit /B 1
)
)
rem Remove tool_hugehelp.c
echo * %CD%\src\tool_hugehelp.c
if exist src\tool_hugehelp.c (
del src\tool_hugehelp.c 2>NUL
if exist src\tool_hugehelp.c (
exit /B 2
)
)
rem Remove curlbuild.h
echo * %CD%\include\curl\curlbuild.h
if exist include\curl\curlbuild.h (
del include\curl\curlbuild.h 2>NUL
if exist include\curl\curlbuild.h (
exit /B 3
)
)
exit /B
rem Function to generate src\tool_hugehelp.c
rem
rem Returns:
rem
rem 0 - full tool_hugehelp.c generated
rem 1 - simplified tool_hugehelp.c
rem 2 - failure
rem
:genHugeHelp
if "%OS%" == "Windows_NT" setlocal
set LC_ALL=C
set ROFFCMD=
set BASIC=1
if defined HAVE_PERL (
if defined HAVE_GROFF (
set ROFFCMD=groff -mtty-char -Tascii -P-c -man
) else if defined HAVE_NROFF (
set ROFFCMD=nroff -c -Tascii -man
)
)
if defined ROFFCMD (
echo #include "tool_setup.h"> src\tool_hugehelp.c
echo #include "tool_hugehelp.h">> src\tool_hugehelp.c
if defined HAVE_GZIP (
echo #ifndef HAVE_LIBZ>> src\tool_hugehelp.c
)
%ROFFCMD% docs\curl.1 2>NUL | perl src\mkhelp.pl docs\MANUAL >> src\tool_hugehelp.c
if defined HAVE_GZIP (
echo #else>> src\tool_hugehelp.c
%ROFFCMD% docs\curl.1 2>NUL | perl src\mkhelp.pl -c docs\MANUAL >> src\tool_hugehelp.c
echo #endif /^* HAVE_LIBZ ^*/>> src\tool_hugehelp.c
)
set BASIC=0
) else (
if exist src\tool_hugehelp.c.cvs (
copy /Y src\tool_hugehelp.c.cvs src\tool_hugehelp.c 1>NUL 2>&1
) else (
echo #include "tool_setup.h"> src\tool_hugehelp.c
echo #include "tool_hugehelp.hd">> src\tool_hugehelp.c
echo.>> src\tool_hugehelp.c
echo void hugehelp(void^)>> src\tool_hugehelp.c
echo {>> src\tool_hugehelp.c
echo #ifdef USE_MANUAL>> src\tool_hugehelp.c
echo fputs("Built-in manual not included\n", stdout^);>> src\tool_hugehelp.c
echo #endif>> src\tool_hugehelp.c
echo }>> src\tool_hugehelp.c
)
)
findstr "/C:void hugehelp(void)" src\tool_hugehelp.c 1>NUL 2>&1
if errorlevel 1 (
if "%OS%" == "Windows_NT" endlocal
exit /B 2
)
if "%BASIC%" == "1" (
if "%OS%" == "Windows_NT" endlocal
exit /B 1
)
if "%OS%" == "Windows_NT" endlocal
exit /B 0
rem Function to clean-up local variables under DOS, Windows 3.x and
rem Windows 9x as setlocal isn't available until Windows NT
rem
:dosCleanup
set MODE=
set HAVE_GROFF=
set HAVE_NROFF=
set HAVE_PERL=
set HAVE_GZIP=
set BASIC_HUGEHELP=
set LC_ALL
set ROFFCMD=
set BASIC=
exit /B
:syntax
rem Display the help
echo.
echo Usage: buildconf [-clean]
echo.
echo -clean - Removes the files
goto error
:unknown
echo.
echo Error: Unknown argument '%1'
goto error
:norepo
echo.
echo Error: This batch file should only be used with a curl git repository
goto error
:nogenmakefile
echo.
echo Error: Unable to generate Makefile
goto error
:nogenhugehelp
echo.
echo Error: Unable to generate src\tool_hugehelp.c
goto error
:nogencurlbuild
echo.
echo Error: Unable to generate include\curl\curlbuild.h
goto error
:nocleanmakefile
echo.
echo Error: Unable to clean Makefile
goto error
:nocleanhugehelp
echo.
echo Error: Unable to clean src\tool_hugehelp.c
goto error
:nocleancurlbuild
echo.
echo Error: Unable to clean include\curl\curlbuild.h
goto error
:warning
echo.
echo Warning: The curl manual could not be integrated in the source. This means when
echo you build curl the manual will not be available (curl --man^). Integration of
echo the manual is not required and a summary of the options will still be available
echo (curl --help^). To integrate the manual your PATH is required to have
echo groff/nroff, perl and optionally gzip for compression.
goto success
:error
if "%OS%" == "Windows_NT" (
endlocal
) else (
call :dosCleanup
)
exit /B 1
:success
if "%OS%" == "Windows_NT" (
endlocal
) else (
call :dosCleanup
)
exit /B 0

View File

@ -5,11 +5,11 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 1998 - 2016, 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.
# are also available at https://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
@ -24,14 +24,14 @@ dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
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: https://curl.haxx.se/mail/])
XC_OVR_ZZ50
XC_OVR_ZZ60
CURL_OVERRIDE_AUTOCONF
dnl configure script copyright
AC_COPYRIGHT([Copyright (c) 1998 - 2014 Daniel Stenberg, <daniel@haxx.se>
AC_COPYRIGHT([Copyright (c) 1998 - 2016 Daniel Stenberg, <daniel@haxx.se>
This configure script may be copied, distributed and modified under the
terms of the curl license; see COPYING for more details])
@ -39,6 +39,7 @@ AC_CONFIG_SRCDIR([lib/urldata.h])
AC_CONFIG_HEADERS(lib/curl_config.h include/curl/curlbuild.h)
AC_CONFIG_MACRO_DIR([m4])
AM_MAINTAINER_MODE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
CURL_CHECK_OPTION_DEBUG
CURL_CHECK_OPTION_OPTIMIZE
@ -47,6 +48,7 @@ CURL_CHECK_OPTION_WERROR
CURL_CHECK_OPTION_CURLDEBUG
CURL_CHECK_OPTION_SYMBOL_HIDING
CURL_CHECK_OPTION_ARES
CURL_CHECK_OPTION_RT
XC_CHECK_PATH_SEPARATOR
@ -147,7 +149,7 @@ AC_SUBST(PKGADD_VENDOR)
dnl
dnl initialize all the info variables
curl_ssl_msg="no (--with-{ssl,gnutls,nss,polarssl,cyassl,axtls,winssl,darwinssl} )"
curl_ssl_msg="no (--with-{ssl,gnutls,nss,polarssl,mbedtls,cyassl,axtls,winssl,darwinssl} )"
curl_ssh_msg="no (--with-libssh2)"
curl_zlib_msg="no (--with-zlib)"
curl_gss_msg="no (--with-gssapi)"
@ -165,6 +167,7 @@ curl_verbose_msg="enabled (--disable-verbose)"
curl_rtsp_msg="no (--enable-rtsp)"
curl_rtmp_msg="no (--with-librtmp)"
curl_mtlnk_msg="no (--with-libmetalink)"
curl_psl_msg="no (--with-libpsl)"
init_ssl_msg=${curl_ssl_msg}
@ -1080,7 +1083,11 @@ AC_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
AC_TRY_RUN([ /* is AF_INET6 available? */
#include <sys/types.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#else
#include <sys/socket.h>
#endif
#include <stdlib.h> /* for exit() */
main()
{
@ -1094,8 +1101,8 @@ main()
ipv6=yes,
AC_MSG_RESULT(no)
ipv6=no,
AC_MSG_RESULT(no)
ipv6=no
AC_MSG_RESULT(yes)
ipv6=yes
))
if test "$ipv6" = "yes"; then
@ -1107,7 +1114,12 @@ if test "$ipv6" = yes; then
AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
AC_TRY_COMPILE([
#include <sys/types.h>
#include <netinet/in.h>] ,
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <netinet/in.h>
#endif] ,
struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes)
if test "$have_sin6_scope_id" = yes; then
AC_MSG_RESULT([yes])
@ -1184,6 +1196,8 @@ AC_ARG_WITH(gssapi,
fi
])
: ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"}
save_CPPFLAGS="$CPPFLAGS"
AC_MSG_CHECKING([if GSS-API support is requested])
if test x"$want_gss" = xyes; then
@ -1192,8 +1206,8 @@ if test x"$want_gss" = xyes; then
if test -z "$GSSAPI_INCS"; then
if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi`
elif test -f "$GSSAPI_ROOT/bin/krb5-config"; then
GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
elif test -f "$KRB5CONFIG"; then
GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi`
elif test "$GSSAPI_ROOT" != "yes"; then
GSSAPI_INCS="-I$GSSAPI_ROOT/include"
fi
@ -1283,10 +1297,10 @@ if test x"$want_gss" = xyes; then
dnl into LIBS
gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi`
LIBS="$gss_libs $LIBS"
elif test -f "$GSSAPI_ROOT/bin/krb5-config"; then
elif test -f "$KRB5CONFIG"; then
dnl krb5-config doesn't have --libs-only-L or similar, put everything
dnl into LIBS
gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
gss_libs=`$KRB5CONFIG --libs gssapi`
LIBS="$gss_libs $LIBS"
else
case $host in
@ -1394,6 +1408,24 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
CLEANCPPFLAGS="$CPPFLAGS"
CLEANLIBS="$LIBS"
dnl This is for Msys/Mingw
case $host in
*-*-msys* | *-*-mingw*)
AC_MSG_CHECKING([for gdi32])
my_ac_save_LIBS=$LIBS
LIBS="-lgdi32 $LIBS"
AC_TRY_LINK([#include <windef.h>
#include <wingdi.h>],
[GdiFlush();],
[ dnl worked!
AC_MSG_RESULT([yes])],
[ dnl failed, restore LIBS
LIBS=$my_ac_save_LIBS
AC_MSG_RESULT(no)]
)
;;
esac
case "$OPT_SSL" in
yes)
dnl --with-ssl (without path) used
@ -1451,6 +1483,7 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
SSL_CPPFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
$PKGCONFIG --cflags-only-I openssl 2>/dev/null`
AC_SUBST(SSL_LIBS)
AC_MSG_NOTICE([pkg-config: SSL_LIBS: "$SSL_LIBS"])
AC_MSG_NOTICE([pkg-config: SSL_LDFLAGS: "$SSL_LDFLAGS"])
AC_MSG_NOTICE([pkg-config: SSL_CPPFLAGS: "$SSL_CPPFLAGS"])
@ -1471,31 +1504,13 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
dnl This is for Msys/Mingw
case $host in
*-*-msys* | *-*-mingw*)
AC_MSG_CHECKING([for gdi32])
my_ac_save_LIBS=$LIBS
LIBS="-lgdi32 $LIBS"
AC_TRY_LINK([#include <windef.h>
#include <wingdi.h>],
[GdiFlush();],
[ dnl worked!
AC_MSG_RESULT([yes])],
[ dnl failed, restore LIBS
LIBS=$my_ac_save_LIBS
AC_MSG_RESULT(no)]
)
;;
esac
AC_CHECK_LIB(crypto, CRYPTO_lock,[
AC_CHECK_LIB(crypto, HMAC_Update,[
HAVECRYPTO="yes"
LIBS="-lcrypto $LIBS"
],[
LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
AC_CHECK_LIB(crypto, CRYPTO_add_lock,[
AC_CHECK_LIB(crypto, HMAC_Init_ex,[
HAVECRYPTO="yes"
LIBS="-lcrypto $LIBS"], [
LDFLAGS="$CLEANLDFLAGS"
@ -1505,6 +1520,46 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
])
if test X"$HAVECRYPTO" = X"yes"; then
AC_MSG_CHECKING([OpenSSL linking without -ldl])
saved_libs=$LIBS
AC_TRY_LINK(
[
#include <openssl/evp.h>
],
[
SSLeay_add_all_algorithms();
],
[
AC_MSG_RESULT(yes)
LIBS="$saved_libs"
],
[
AC_MSG_RESULT(no)
AC_MSG_CHECKING([OpenSSL linking with -ldl])
LIBS="-ldl $LIBS"
AC_TRY_LINK(
[
#include <openssl/evp.h>
],
[
SSLeay_add_all_algorithms();
],
[
AC_MSG_RESULT(yes)
LIBS="$saved_libs -ldl"
],
[
AC_MSG_RESULT(no)
LIBS="$saved_libs"
]
)
]
)
fi
if test X"$HAVECRYPTO" = X"yes"; then
dnl This is only reasonable to do if crypto actually is there: check for
dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
@ -1527,7 +1582,7 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
else
dnl Have the libraries--check for SSLeay/OpenSSL headers
dnl Have the libraries--check for OpenSSL headers
AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
openssl/pem.h openssl/ssl.h openssl/err.h,
curl_ssl_msg="enabled (OpenSSL)"
@ -1551,17 +1606,11 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
fi
if test X"$OPENSSL_ENABLED" = X"1"; then
AC_DEFINE(USE_SSLEAY, 1, [if SSL is enabled])
dnl is there a pkcs12.h header present?
AC_CHECK_HEADERS(openssl/pkcs12.h)
else
LIBS="$CLEANLIBS"
fi
dnl USE_SSLEAY is the historical name for what configure calls
dnl OPENSSL_ENABLED; the names should really be unified
USE_SSLEAY="$OPENSSL_ENABLED"
AC_SUBST(USE_SSLEAY)
if test X"$OPT_SSL" != Xoff &&
test "$OPENSSL_ENABLED" != "1"; then
@ -1578,9 +1627,10 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
AC_CHECK_FUNCS( ENGINE_load_builtin_engines )
])
dnl these can only exist if openssl exists
dnl Cyassl doesn't have SSL_get_shutdown
dnl BoringSSL doesn't have DES_set_odd_parity
dnl These can only exist if OpenSSL exists
dnl Older versions of Cyassl (some time before 2.9.4) don't have
dnl SSL_get_shutdown (but this check won't actually detect it there
dnl as it's a macro that needs the header files be included)
AC_CHECK_FUNCS( RAND_status \
RAND_screen \
@ -1588,18 +1638,26 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
ENGINE_cleanup \
CRYPTO_cleanup_all_ex_data \
SSL_get_shutdown \
SSLv2_client_method \
DES_set_odd_parity )
SSLv2_client_method )
AC_MSG_CHECKING([for BoringSSL])
if test "x$ac_cv_func_DES_set_odd_parity" != "xyes"; then
curl_ssl_msg="enabled (BoringSSL)"
AC_DEFINE_UNQUOTED(HAVE_BORINGSSL, 1,
[Define to 1 if using BoringSSL.])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#include <openssl/base.h>
]],[[
#ifndef OPENSSL_IS_BORINGSSL
#error not boringssl
#endif
]])
],[
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_BORINGSSL, 1,
[Define to 1 if using BoringSSL.])
curl_ssl_msg="enabled (BoringSSL)"
],[
AC_MSG_RESULT([no])
])
AC_MSG_CHECKING([for libressl])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
@ -1675,8 +1733,8 @@ dnl ---
if test "$OPENSSL_ENABLED" = "1"; then
AC_CHECK_LIB(crypto, SRP_Calc_client_key,
[
AC_DEFINE(HAVE_SSLEAY_SRP, 1, [if you have the function SRP_Calc_client_key])
AC_SUBST(HAVE_SSLEAY_SRP, [1])
AC_DEFINE(HAVE_OPENSSL_SRP, 1, [if you have the function SRP_Calc_client_key])
AC_SUBST(HAVE_OPENSSL_SRP, [1])
])
fi
@ -1787,6 +1845,7 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
AC_MSG_NOTICE([Added $gtlslib to LD_LIBRARY_PATH])
fi
fi
AC_CHECK_FUNCS(gnutls_certificate_set_x509_key_file2)
fi
fi
@ -1924,6 +1983,93 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
fi
dnl ----------------------------------------------------
dnl check for mbedTLS
dnl ----------------------------------------------------
OPT_MBEDTLS=no
_cppflags=$CPPFLAGS
_ldflags=$LDFLAGS
AC_ARG_WITH(mbedtls,dnl
AC_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root])
AC_HELP_STRING([--without-mbedtls], [disable mbedTLS detection]),
OPT_MBEDTLS=$withval)
if test "$curl_ssl_msg" = "$init_ssl_msg"; then
if test X"$OPT_MBEDTLS" != Xno; then
if test "$OPT_MBEDTLS" = "yes"; then
OPT_MBEDTLS=""
fi
if test -z "$OPT_MBEDTLS" ; then
dnl check for lib first without setting any new path
AC_CHECK_LIB(mbedtls, mbedtls_havege_init,
dnl libmbedtls found, set the variable
[
AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled])
AC_SUBST(USE_MBEDTLS, [1])
MBEDTLS_ENABLED=1
USE_MBEDTLS="yes"
curl_ssl_msg="enabled (mbedTLS)"
], [], -lmbedx509 -lmbedcrypto)
fi
addld=""
addlib=""
addcflags=""
mbedtlslib=""
if test "x$USE_MBEDTLS" != "xyes"; then
dnl add the path and test again
addld=-L$OPT_MBEDTLS/lib$libsuff
addcflags=-I$OPT_MBEDTLS/include
mbedtlslib=$OPT_MBEDTLS/lib$libsuff
LDFLAGS="$LDFLAGS $addld"
if test "$addcflags" != "-I/usr/include"; then
CPPFLAGS="$CPPFLAGS $addcflags"
fi
AC_CHECK_LIB(mbedtls, mbedtls_ssl_init,
[
AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled])
AC_SUBST(USE_MBEDTLS, [1])
MBEDTLS_ENABLED=1
USE_MBEDTLS="yes"
curl_ssl_msg="enabled (mbedTLS)"
],
[
CPPFLAGS=$_cppflags
LDFLAGS=$_ldflags
], -lmbedx509 -lmbedcrypto)
fi
if test "x$USE_MBEDTLS" = "xyes"; then
AC_MSG_NOTICE([detected mbedTLS])
LIBS="-lmbedtls -lmbedx509 -lmbedcrypto $LIBS"
if test -n "$mbedtlslib"; then
dnl when shared libs were found in a path that the run-time
dnl linker doesn't search through, we need to add it to
dnl LD_LIBRARY_PATH to prevent further configure tests to fail
dnl due to this
if test "x$cross_compiling" != "xyes"; then
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$mbedtlslib"
export LD_LIBRARY_PATH
AC_MSG_NOTICE([Added $mbedtlslib to LD_LIBRARY_PATH])
fi
fi
fi
fi dnl mbedTLS not disabled
fi
dnl ----------------------------------------------------
dnl check for CyaSSL
dnl ----------------------------------------------------
@ -1946,6 +2092,10 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
OPT_CYASSL=""
fi
dnl This should be reworked to use pkg-config instead
cyassllibname=cyassl
if test -z "$OPT_CYASSL" ; then
dnl check for lib in system default first
@ -1987,19 +2137,80 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
[
CPPFLAGS=$_cppflags
LDFLAGS=$_ldflags
cyassllib=""
])
fi
addld=""
addlib=""
addcflags=""
if test "x$USE_CYASSL" != "xyes"; then
dnl libcyassl renamed to libwolfssl as of 3.4.0
addld=-L$OPT_CYASSL/lib$libsuff
addcflags=-I$OPT_CYASSL/include
cyassllib=$OPT_CYASSL/lib$libsuff
LDFLAGS="$LDFLAGS $addld"
if test "$addcflags" != "-I/usr/include"; then
CPPFLAGS="$CPPFLAGS $addcflags"
fi
cyassllibname=wolfssl
my_ac_save_LIBS="$LIBS"
LIBS="-l$cyassllibname -lm $LIBS"
AC_MSG_CHECKING([for CyaSSL_Init in -lwolfssl])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
/* These aren't needed for detection and confuse WolfSSL.
They are set up properly later if it is detected. */
#undef SIZEOF_LONG
#undef SIZEOF_LONG_LONG
#include <cyassl/ssl.h>
]],[[
return CyaSSL_Init();
]])
],[
AC_MSG_RESULT(yes)
AC_DEFINE(USE_CYASSL, 1, [if CyaSSL/WolfSSL is enabled])
AC_SUBST(USE_CYASSL, [1])
CYASSL_ENABLED=1
USE_CYASSL="yes"
curl_ssl_msg="enabled (WolfSSL)"
],
[
AC_MSG_RESULT(no)
CPPFLAGS=$_cppflags
LDFLAGS=$_ldflags
cyassllib=""
])
LIBS="$my_ac_save_LIBS"
fi
if test "x$USE_CYASSL" = "xyes"; then
AC_MSG_NOTICE([detected CyaSSL])
AC_MSG_NOTICE([detected $cyassllibname])
dnl cyassl/ctaocrypt/types.h needs SIZEOF_LONG_LONG defined!
AC_CHECK_SIZEOF(long long)
dnl Versions since at least 2.6.0 may have options.h
AC_CHECK_HEADERS(cyassl/options.h)
dnl Versions since at least 2.9.4 renamed error.h to error-ssl.h
AC_CHECK_HEADERS(cyassl/error-ssl.h)
LIBS="-lcyassl -lm $LIBS"
LIBS="-l$cyassllibname -lm $LIBS"
if test "x$cyassllibname" = "xwolfssl"; then
dnl Recent WolfSSL versions build without SSLv3 by default
dnl WolfSSL needs configure --enable-opensslextra to have *get_peer*
AC_CHECK_FUNCS(wolfSSLv3_client_method \
wolfSSL_get_peer_certificate)
else
dnl Cyassl needs configure --enable-opensslextra to have *get_peer*
AC_CHECK_FUNCS(CyaSSL_get_peer_certificate)
fi
if test -n "$cyassllib"; then
dnl when shared libs were found in a path that the run-time
@ -2066,57 +2277,73 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
fi
fi
else
# Without pkg-config, we'll kludge in some defaults
addlib="-L$OPT_NSS/lib -lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl"
addcflags="-I$OPT_NSS/include"
version="unknown"
nssprefix=$OPT_NSS
fi
if test -n "$addlib"; then
CLEANLIBS="$LIBS"
CLEANCPPFLAGS="$CPPFLAGS"
LIBS="$addlib $LIBS"
if test "$addcflags" != "-I/usr/include"; then
CPPFLAGS="$CPPFLAGS $addcflags"
fi
dnl The function SSL_VersionRangeSet() is needed to enable TLS > 1.0
AC_CHECK_LIB(nss3, SSL_VersionRangeSet,
[
AC_DEFINE(USE_NSS, 1, [if NSS is enabled])
AC_SUBST(USE_NSS, [1])
USE_NSS="yes"
NSS_ENABLED=1
curl_ssl_msg="enabled (NSS)"
],
[
LIBS="$CLEANLIBS"
CPPFLAGS="$CLEANCPPFLAGS"
])
if test "x$USE_NSS" = "xyes"; then
AC_MSG_NOTICE([detected NSS version $version])
dnl needed when linking the curl tool without USE_EXPLICIT_LIB_DEPS
NSS_LIBS=$addlib
AC_SUBST([NSS_LIBS])
dnl when shared libs were found in a path that the run-time
dnl linker doesn't search through, we need to add it to
dnl LD_LIBRARY_PATH to prevent further configure tests to fail
dnl due to this
if test "x$cross_compiling" != "xyes"; then
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff"
export LD_LIBRARY_PATH
AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH])
NSS_PCDIR="$OPT_NSS/lib/pkgconfig"
if test -f "$NSS_PCDIR/nss.pc"; then
CURL_CHECK_PKGCONFIG(nss, [$NSS_PCDIR])
if test "$PKGCONFIG" != "no" ; then
addld=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --libs-only-L nss`
addlib=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --libs-only-l nss`
addcflags=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --cflags nss`
version=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --modversion nss`
nssprefix=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --variable=prefix nss`
fi
fi
fi
if test -z "$addlib"; then
# Without pkg-config, we'll kludge in some defaults
AC_MSG_WARN([Using hard-wired libraries and compilation flags for NSS.])
addld="-L$OPT_NSS/lib"
addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4"
addcflags="-I$OPT_NSS/include"
version="unknown"
nssprefix=$OPT_NSS
fi
CLEANLDFLAGS="$LDFLAGS"
CLEANLIBS="$LIBS"
CLEANCPPFLAGS="$CPPFLAGS"
LDFLAGS="$addld $LDFLAGS"
LIBS="$addlib $LIBS"
if test "$addcflags" != "-I/usr/include"; then
CPPFLAGS="$CPPFLAGS $addcflags"
fi
dnl The function SSL_VersionRangeSet() is needed to enable TLS > 1.0
AC_CHECK_LIB(nss3, SSL_VersionRangeSet,
[
AC_DEFINE(USE_NSS, 1, [if NSS is enabled])
AC_SUBST(USE_NSS, [1])
USE_NSS="yes"
NSS_ENABLED=1
curl_ssl_msg="enabled (NSS)"
],
[
LDFLAGS="$CLEANLDFLAGS"
LIBS="$CLEANLIBS"
CPPFLAGS="$CLEANCPPFLAGS"
])
if test "x$USE_NSS" = "xyes"; then
AC_MSG_NOTICE([detected NSS version $version])
dnl needed when linking the curl tool without USE_EXPLICIT_LIB_DEPS
NSS_LIBS=$addlib
AC_SUBST([NSS_LIBS])
dnl when shared libs were found in a path that the run-time
dnl linker doesn't search through, we need to add it to
dnl LD_LIBRARY_PATH to prevent further configure tests to fail
dnl due to this
if test "x$cross_compiling" != "xyes"; then
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff"
export LD_LIBRARY_PATH
AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH])
fi
fi dnl NSS found
fi dnl NSS not disabled
fi dnl curl_ssl_msg = init_ssl_msg
@ -2177,7 +2404,7 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
fi
fi
if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$POLARSSL_ENABLED$AXTLS_ENABLED$CYASSL_ENABLED$WINSSL_ENABLED$DARWINSSL_ENABLED" = "x"; then
if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$POLARSSL_ENABLED$MBEDTLS_ENABLED$AXTLS_ENABLED$CYASSL_ENABLED$WINSSL_ENABLED$DARWINSSL_ENABLED" = "x"; then
AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
AC_MSG_WARN([Use --with-ssl, --with-gnutls, --with-polarssl, --with-cyassl, --with-nss, --with-axtls, --with-winssl, or --with-darwinssl to address this.])
else
@ -2192,6 +2419,27 @@ dnl **********************************************************************
CURL_CHECK_CA_BUNDLE
dnl **********************************************************************
dnl Check for libpsl
dnl **********************************************************************
AC_ARG_WITH(libpsl,
AS_HELP_STRING([--without-libpsl],
[disable support for libpsl cookie checking]),
with_libpsl=$withval,
with_libpsl=yes)
if test $with_libpsl != "no"; then
AC_SEARCH_LIBS(psl_builtin, psl,
[curl_psl_msg="yes";
AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled])
],
[curl_psl_msg="no (libpsl not found)";
AC_MSG_WARN([libpsl was not found])
]
)
fi
AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "yes"])
dnl **********************************************************************
dnl Check for libmetalink
dnl **********************************************************************
@ -2771,7 +3019,9 @@ if test X"$want_h2" != Xno; then
CPPFLAGS="$CPPFLAGS $CPP_H2"
LIBS="$LIB_H2 $LIBS"
AC_CHECK_LIB(nghttp2, nghttp2_session_callbacks_set_send_callback,
# use nghttp2_option_set_no_recv_client_magic to require nghttp2
# >= 1.0.0
AC_CHECK_LIB(nghttp2, nghttp2_option_set_no_recv_client_magic,
[
AC_CHECK_HEADERS(nghttp2/nghttp2.h,
curl_h2_msg="enabled (nghttp2)"
@ -2797,6 +3047,31 @@ if test X"$want_h2" != Xno; then
fi
dnl **********************************************************************
dnl Check for zsh completion path
dnl **********************************************************************
OPT_ZSH_FPATH=default
AC_ARG_WITH(zsh-functions-dir,
AC_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH])
AC_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]),
[OPT_ZSH_FPATH=$withval])
case "$OPT_ZSH_FPATH" in
no)
dnl --without-zsh-functions-dir option used
;;
default|yes)
dnl --with-zsh-functions-dir option used without path
ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions"
AC_SUBST(ZSH_FUNCTIONS_DIR)
;;
*)
dnl --with-zsh-functions-dir option used with path
ZSH_FUNCTIONS_DIR="$withval"
AC_SUBST(ZSH_FUNCTIONS_DIR)
;;
esac
dnl **********************************************************************
dnl Back to "normal" configuring
dnl **********************************************************************
@ -3145,7 +3420,7 @@ if test "x$want_thres" = xyes && test "x$want_ares" = xyes; then
[Options --enable-threaded-resolver and --enable-ares are mutually exclusive])
fi
if test "$want_thres" = "yes"; then
if test "$want_thres" = "yes" && test "$dontwant_rt" = "no"; then
AC_CHECK_HEADER(pthread.h,
[ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
save_CFLAGS="$CFLAGS"
@ -3271,7 +3546,7 @@ AC_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]),
want_tls_srp=yes
)
if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_SSLEAY_SRP" = "x1") ; then
if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then
AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication])
USE_TLS_SRP=1
curl_tls_srp_msg="enabled"
@ -3385,7 +3660,7 @@ dnl For keeping supported features and protocols also in pkg-config file
dnl since it is more cross-compile friendly than curl-config
dnl
if test "x$USE_SSLEAY" = "x1"; then
if test "x$OPENSSL_ENABLED" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
elif test -n "$SSL_ENABLED"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
@ -3413,6 +3688,10 @@ if test "x$HAVE_GSSAPI" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API"
fi
if test "x$curl_psl_msg" = "xyes"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES PSL"
fi
if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
\( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO"
@ -3424,7 +3703,7 @@ if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
fi
if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1"; then
if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
if test "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
-o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1" \
-o "x$DARWINSSL_ENABLED" = "x1"; then
SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
@ -3497,7 +3776,7 @@ if test "x$CURL_DISABLE_IMAP" != "x1"; then
fi
if test "x$CURL_DISABLE_SMB" != "x1" \
-a "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" \
-a \( "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
-a \( "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
-o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1" \
-o "x$DARWINSSL_ENABLED" = "x1" \); then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB"
@ -3560,6 +3839,7 @@ AC_CONFIG_FILES([Makefile \
include/curl/Makefile \
src/Makefile \
lib/Makefile \
scripts/Makefile \
lib/libcurl.vers \
tests/Makefile \
tests/certs/Makefile \
@ -3611,13 +3891,15 @@ AC_MSG_NOTICE([Configured to build curl/libcurl:
--libcurl option: ${curl_libcurl_msg}
Verbose errors: ${curl_verbose_msg}
SSPI support: ${curl_sspi_msg}
ca cert bundle: ${ca}
ca cert path: ${capath}
ca cert bundle: ${ca}${ca_warning}
ca cert path: ${capath}${capath_warning}
ca fallback: ${with_ca_fallback}
LDAP support: ${curl_ldap_msg}
LDAPS support: ${curl_ldaps_msg}
RTSP support: ${curl_rtsp_msg}
RTMP support: ${curl_rtmp_msg}
metalink support: ${curl_mtlnk_msg}
PSL support: ${curl_psl_msg}
HTTP2 support: ${curl_h2_msg}
Protocols: ${SUPPORT_PROTOCOLS}
])

View File

@ -10,7 +10,7 @@
#
# 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.
# are also available at https://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
@ -71,7 +71,7 @@ while test $# -gt 0; do
;;
--ca)
echo "@CURL_CA_BUNDLE@"
echo @CURL_CA_BUNDLE@
;;
--cc)

View File

@ -27,7 +27,7 @@ Basic
C
libcurl is a C library in itself!
http://curl.haxx.se/libcurl/
https://curl.haxx.se/libcurl/
C++
@ -50,7 +50,7 @@ Cocoa
D
Written by Kenneth Bogert
http://curl.haxx.se/libcurl/d/
http://dlang.org/library/std/net/curl.html
Dylan
@ -60,7 +60,7 @@ Dylan
Eiffel
Written by Eiffel Software
http://curl.haxx.se/libcurl/eiffel/
https://room.eiffel.com/library/curl
Euphoria
@ -78,7 +78,7 @@ Ferite
Gambas
http://gambas.sourceforge.net
http://gambas.sourceforge.net/
glib/GTK+
@ -90,6 +90,11 @@ Guile:
Written by Michael L. Gran
http://www.lonelycactus.com/guile-curl.html
Harbour
Written by Viktor Szakáts
https://github.com/vszakats/harbour-core/tree/master/contrib/hbcurl
Haskell
Written by Galois, Inc
@ -97,8 +102,7 @@ Haskell
Java
Maintained by [blank]
http://curl.haxx.se/libcurl/java/
https://github.com/pjlegato/curl-java
Julia
@ -115,7 +119,7 @@ Lua
luacurl by Alexander Marinov
http://luacurl.luaforge.net/
Lua-cURL by Jürgen Hötzel
Lua-cURL by Jürgen Hötzel
http://luaforge.net/projects/lua-curl/
Mono
@ -126,7 +130,7 @@ Mono
.NET
libcurl-net by Jeffrey Phillips
http://sourceforge.net/projects/libcurl-net/
https://sourceforge.net/projects/libcurl-net/
node.js
@ -141,7 +145,7 @@ Object-Pascal
O'Caml
Written by Lars Nilsson
http://sourceforge.net/projects/ocurl/
https://sourceforge.net/projects/ocurl/
Pascal
@ -150,13 +154,13 @@ Pascal
Perl
Maintained by Cris Bailiff
http://curl.haxx.se/libcurl/perl/
Maintained by Cris Bailiff and Bálint Szilakszi
https://github.com/szbalint/WWW--Curl
PHP
Written by Sterling Hughes
http://curl.haxx.se/libcurl/php/
https://php.net/curl
PostgreSQL
@ -170,8 +174,7 @@ Python
R
RCurl by Duncan Temple Lang
http://www.omegahat.org/RCurl/
http://cran.r-project.org/package=curl
Rexx
@ -181,7 +184,7 @@ Rexx
RPG
Support for ILE/RPG on OS/400 is included in source distribution
http://curl.haxx.se/libcurl/
https://curl.haxx.se/libcurl/
See packages/OS400/README.OS400 and packages/OS400/curl.inc.in
Ruby
@ -192,10 +195,15 @@ Ruby
ruby-curl-multi - written by Kristjan Petursson and Keith Rarick
http://curl-multi.rubyforge.org/
Rust
curl-rust - by Carl Lerche
https://github.com/carllerche/curl-rust
Scheme
Bigloo binding by Kirill Lisovsky
http://curl.haxx.se/libcurl/scheme/
http://www.metapaper.net/lisovsky/web/curl/
S-Lang
@ -219,13 +227,13 @@ SPL
Tcl
Tclcurl by Andrés García
http://personal1.iddeo.es/andresgarci/tclcurl/english/docs.html
Tclcurl by Andrés García
http://mirror.yellow5.com/tclcurl/
Visual Basic
libcurl-vb by Jeffrey Phillips
http://sourceforge.net/projects/libcurl-vb/
https://sourceforge.net/projects/libcurl-vb/
Visual Foxpro
@ -245,3 +253,8 @@ XBLite
Written by David Szafranski
http://perso.wanadoo.fr/xblite/libraries.html
Xojo
Written by Andrew Lambert
https://github.com/charonn0/RB-libcURL

View File

@ -35,14 +35,12 @@ BUGS
have a go at a solution. You can optionally also post your bug/problem at
curl's bug tracking system over at
https://sourceforge.net/p/curl/bugs/
https://github.com/curl/curl/issues
Please read the rest of this document below first before doing that! Also,
you need to login to your sourceforge account before being able to submit a
bug report (necessary evil done to avoid spam).
Please read the rest of this document below first before doing that!
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 https://curl.haxx.se/mail/
1.3 What to report

32
docs/CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1,32 @@
Contributor Code of Conduct
===========================
As contributors and maintainers of this project, we pledge to respect all
people who contribute through reporting issues, posting feature requests,
updating documentation, submitting pull requests or patches, and other
activities.
We are committed to making participation in this project a harassment-free
experience for everyone, regardless of level of experience, gender, gender
identity and expression, sexual orientation, disability, personal appearance,
body size, race, ethnicity, age, or religion.
Examples of unacceptable behavior by participants include the use of sexual
language or imagery, derogatory comments or personal attacks, trolling, public
or private harassment, insults, or other unprofessional conduct.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct. Project maintainers who do not
follow the Code of Conduct may be removed from the project team.
This code of conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community.
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by opening an issue or contacting one or more of the project
maintainers.
This Code of Conduct is adapted from the [Contributor
Covenant](http://contributor-covenant.org), version 1.1.0, available at
[http://contributor-covenant.org/version/1/1/0/](http://contributor-covenant.org/version/1/1/0/)

185
docs/CODE_STYLE.md Normal file
View File

@ -0,0 +1,185 @@
# cURL C code style
Source code that has a common style is easier to read than code that uses
different styles in different places. It helps making the code feel like one
single code base. Easy-to-read is a very important property of code and helps
making it easier to review when new things are added and it helps debugging
code when developers are trying to figure out why things go wrong. A unified
style is more important than individual contributors having their own personal
tastes satisfied.
Our C code has a few style rules. Most of them are verified and upheld by the
lib/checksrc.pl script. Invoked with `make checksrc` or even by default by the
build system when built after `./configure --enable-debug` has been used.
It is normally not a problem for anyone to follow the guidelines, as you just
need to copy the style already used in the source code and there are no
particularly unusual rules in our set of rules.
We also work hard on writing code that are warning-free on all the major
platforms and in general on as many platforms as possible. Code that obviously
will cause warnings will not be accepted as-is.
## Naming
Try using a non-confusing naming scheme for your new functions and variable
names. It doesn't necessarily have to mean that you should use the same as in
other places of the code, just that the names should be logical,
understandable and be named according to what they're used for. File-local
functions should be made static. We like lower case names.
See the INTERNALS document on how we name non-exported library-global symbols.
## Indenting
We use only spaces for indentation, never TABs. We use two spaces for each new
open brace.
if(something_is_true) {
while(second_statement == fine) {
moo();
}
}
## Comments
Since we write C89 code, `//` comments are not allowed. They weren't
introduced in the C standard until C99. We use only `/*` and `*/` comments:
/* this is a comment */
## Long lines
Source code in curl may never be wider than 80 columns and there are two
reasons for maintaining this even in the modern era of very large and high
resolution screens:
1. Narrower columns are easier to read than very wide ones. There's a reason
newspapers have used columns for decades or centuries.
2. Narrower columns allow developers to easier show multiple pieces of code
next to each other in different windows. I often have two or three source
code windows next to each other on the same screen - as well as multiple
terminal and debugging windows.
## Braces
In if/while/do/for expressions, we write the open brace on the same line as
the keyword and we then set the closing brace on the same indentation level as
the initial keyword. Like this:
if(age < 40) {
/* clearly a youngster */
}
When we write functions however, the opening brace should be in the first
column of the first line:
int main(int argc, char **argv)
{
return 1;
}
## 'else' on the following line
When adding an `else` clause to a conditional expression using braces, we add
it on a new line after the closing brace. Like this:
if(age < 40) {
/* clearly a youngster */
}
else {
/* probably grumpy */
}
## No space before parentheses
When writing expressions using if/while/do/for, there shall be no space
between the keyword and the open parenthesis. Like this:
while(1) {
/* loop forever */
}
## Use boolean conditions
Rather than test a conditional value such as a bool against TRUE or FALSE, a
pointer against NULL or != NULL and an int against zero or not zero in
if/while conditions we prefer:
result = do_something();
if(!result) {
/* something went wrong */
return result;
}
## No assignments in conditions
To increase readability and reduce complexity of conditionals, we avoid
assigning variables within if/while conditions. We frown upon this style:
if((ptr = malloc(100)) == NULL)
return NULL;
and instead we encourage the above version to be spelled out more clearly:
ptr = malloc(100);
if(!ptr)
return NULL;
## New block on a new line
We never write multiple statements on the same source line, even for very
short if() conditions.
if(a)
return TRUE;
else if(b)
return FALSE;
and NEVER:
if(a) return TRUE;
else if(b) return FALSE;
## Space around operators
Please use spaces on both sides of operators in C expressions. Postfix `(),
[], ->, ., ++, --` and Unary `+, - !, ~, &` operators excluded they should
have no space.
Examples:
bla = func();
who = name[0];
age += 1;
true = !false;
size += -2 + 3 * (a + b);
ptr->member = a++;
struct.field = b--;
ptr = &address;
contents = *pointer;
complement = ~bits;
## Platform dependent code
Use `#ifdef HAVE_FEATURE` to do conditional code. We avoid checking for
particular operating systems or hardware in the #ifdef lines. The HAVE_FEATURE
shall be generated by the configure script for unix-like systems and they are
hard-coded in the config-[system].h files for the others.
We also encourage use of macros/functions that possibly are empty or defined
to constants when libcurl is built without that feature, to make the code
seamless. Like this style where the `magic()` function works differently
depending on a build-time conditional:
#ifdef HAVE_MAGIC
void magic(int a)
{
return a + 2;
}
#else
#define magic(x) 1
#endif
int content = magic(3);

View File

@ -15,18 +15,13 @@
1.2 License
1.3 What To Read
2. cURL Coding Standards
2.1 Naming
2.2 Indenting
2.3 Commenting
2.4 Line Lengths
2.5 General Style
2.6 Non-clobbering All Over
2.7 Platform Dependent Code
2.8 Write Separate Patches
2.9 Patch Against Recent Sources
2.10 Document
2.11 Test Cases
2. Write a good patch
2.1 Follow code style
2.2 Non-clobbering All Over
2.3 Write Separate Patches
2.4 Patch Against Recent Sources
2.5 Document
2.6 Test Cases
3. Pushing Out Your Changes
3.1 Write Access to git Repository
@ -34,7 +29,7 @@
3.3 How To Make a Patch without git
3.4 How to get your changes into the main sources
3.5 Write good commit messages
3.6 Please don't send pull requests
3.6 About pull requests
==============================================================================
@ -42,16 +37,20 @@
1.1 Join the Community
Skip over to http://curl.haxx.se/mail/ and join the appropriate mailing
Skip over to https://curl.haxx.se/mail/ and join the appropriate mailing
list(s). Read up on details before you post questions. Read this file before
you start sending patches! We prefer patches and discussions being held on
the mailing list(s), not sent to individuals.
Before posting to one of the curl mailing lists, please read up on the mailing
list etiquette: http://curl.haxx.se/mail/etiquette.html
list etiquette: https://curl.haxx.se/mail/etiquette.html
We also hang out on IRC in #curl on irc.freenode.net
If you're at all interested in the code side of things, consider clicking
'watch' on the curl repo at github to get notified on pull requests and new
issues posted there.
1.2. License
When contributing with code, you agree to put your changes and new code under
@ -78,53 +77,20 @@
1.3 What To Read
Source code, the man pages, the INTERNALS document, TODO, KNOWN_BUGS, the
most recent CHANGES. Just lurking on the curl-library mailing list is gonna
give you a lot of insights on what's going on right now. Asking there is a
good idea too.
Source code, the man pages, the INTERNALS document, TODO, KNOWN_BUGS and the
most recent changes in the git log. Just lurking on the curl-library mailing
list is gonna give you a lot of insights on what's going on right now. Asking
there is a good idea too.
2. cURL Coding Standards
2. Write a good patch
2.1 Naming
2.1 Follow code style
Try using a non-confusing naming scheme for your new functions and variable
names. It doesn't necessarily have to mean that you should use the same as in
other places of the code, just that the names should be logical,
understandable and be named according to what they're used for. File-local
functions should be made static. We like lower case names.
When writing C code, follow the CODE_STYLE already established in the
project. Consistent style makes code easier to read and mistakes less likely
to happen.
See the INTERNALS document on how we name non-exported library-global
symbols.
2.2 Indenting
Use the same indenting levels and bracing method as all the other code
already does. It makes the source code easier to follow if all of it is
written using the same style. We don't ask you to like it, we just ask you to
follow the tradition! ;-) This mainly means: 2-level indents, using spaces
only (no tabs) and having the opening brace ({) on the same line as the if()
or while().
Also note that we use if() and while() with no space before the parenthesis.
2.3 Commenting
Comment your source code extensively using C comments (/* comment */), DO NOT
use C++ comments (// this style). Commented code is quality code and enables
future modifications much more. Uncommented code risk having to be completely
replaced when someone wants to extend things, since other persons' source
code can get quite hard to read.
2.4 Line Lengths
We write source lines shorter than 80 columns.
2.5 General Style
Keep your functions small. If they're small you avoid a lot of mistakes and
you don't accidentally mix up variables etc.
2.6 Non-clobbering All Over
2.2 Non-clobbering All Over
When you write new functionality or fix bugs, it is important that you don't
fiddle all over the source files and functions. Remember that it is likely
@ -133,14 +99,7 @@
functionality, try writing it in a new source file. If you fix bugs, try to
fix one bug at a time and send them as separate patches.
2.7 Platform Dependent Code
Use #ifdef HAVE_FEATURE to do conditional code. We avoid checking for
particular operating systems or hardware in the #ifdef lines. The
HAVE_FEATURE shall be generated by the configure script for unix-like systems
and they are hard-coded in the config-[system].h files for the others.
2.8 Write Separate Patches
2.3 Write Separate Patches
It is annoying when you get a huge patch from someone that is said to fix 511
odd problems, but discussions and opinions don't agree with 510 of them - or
@ -154,14 +113,14 @@
Also, separate patches enable bisecting much better when we track problems in
the future.
2.9 Patch Against Recent Sources
2.4 Patch Against Recent Sources
Please try to get the latest available sources to make your patches
against. It makes the life of the developers so much easier. The very best is
if you get the most up-to-date sources from the git repository, but the
latest release archive is quite OK as well!
2.10 Document
2.5 Document
Writing docs is dead boring and one of the big problems with many open source
projects. Someone's gotta do it. It makes it a lot easier if you submit a
@ -172,7 +131,7 @@
ASCII files. All HTML files on the web site and in the release archives are
generated from the nroff/ASCII versions.
2.11 Test Cases
2.6 Test Cases
Since the introduction of the test suite, we can quickly verify that the main
features are working as they're supposed to. To maintain this situation and
@ -199,7 +158,7 @@
You need to first checkout the repository:
git clone git://github.com/bagder/curl.git
git clone https://github.com/curl/curl.git
You then proceed and edit all the files you like and you commit them to your
local repository:
@ -241,8 +200,8 @@
For unix-like operating systems:
http://www.gnu.org/software/patch/patch.html
http://www.gnu.org/directory/diffutils.html
https://savannah.gnu.org/projects/patch/
https://www.gnu.org/software/diffutils/
For Windows:
@ -288,27 +247,15 @@
and make sure that you have your own user and email setup correctly in git
before you commit
3.6 Please don't send pull requests
3.6 About pull requests
With git (and especially 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.
request to 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:
We used to dislike this but we're trying to change that and accept that this
is a frictionless way for people to contribute to the project. We now welcome
pull requests!
- 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 seldom 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.
We will continue to avoid using github's merge tools to make the history
linear and to make sure commits follow our style guidelines.

View File

@ -1,176 +0,0 @@
Date: February 11, 2007
Author: Daniel Stenberg <daniel@haxx.se>
URL: http://curl.haxx.se/legal/distro-dilemma.html
Condition
This document is written to describe the situation as it is right now.
libcurl 7.16.1 is currently the latest version available. Things may of
course change in the future.
This document reflects my view and understanding of these things. Please tell
me where and how you think I'm wrong, and I'll try to correct my mistakes.
Background
The Free Software Foundation has deemed the Original BSD license[1] to be
"incompatible"[2] with GPL[3]. I'd rather say it is the other way around, but
the point is the same: if you distribute a binary version of a GPL program,
it MUST NOT be linked with any Original BSD-licensed parts or libraries.
Doing so will violate the GPL license. For a long time, very many GPL
licensed programs have avoided this license mess by adding an exception[8] to
their license. And many others have just closed their eyes for this problem.
libcurl is MIT-style[4] licensed - how on earth did this dilemma fall onto
our plates?
libcurl is only a little library. libcurl can be built to use OpenSSL for its
SSL/TLS capabilities. OpenSSL is basically Original BSD licensed[5].
If libcurl built to use OpenSSL is used by a GPL-licensed application and you
decide to distribute a binary version of it (Linux distros - for example -
tend to), you have a clash. GPL vs Original BSD.
This dilemma is not libcurl-specific nor is it specific to any particular
Linux distro. (This article mentions and refers to Debian several times, but
only because Debian seems to be the only Linux distro to have faced this
issue yet since no other distro is shipping libcurl built with two SSL
libraries.)
Part of the Operating System
This would not be a problem if the used lib would be considered part of the
underlying operating system, as then the GPL license has an exception
clause[6] that allows applications to use such libs without having to be
allowed to distribute it or its sources. Possibly some distros will claim
that OpenSSL is part of their operating system.
Debian does however not take this stance and has officially(?) claimed that
OpenSSL is not a required part of the Debian operating system
Some people claim that this paragraph cannot be exploited this way by a Linux
distro, but I am not a lawyer and that is a discussion left outside of this
document.
GnuTLS
Since May 2005 libcurl can get built to use GnuTLS instead of OpenSSL. GnuTLS
is an LGPL[7] licensed library that offers a matching set of features as
OpenSSL does. Now, you can build and distribute an TLS/SSL capable libcurl
without including any Original BSD licensed code.
I believe Debian is the first (only?) distro that provides libcurl/GnuTLS
packages.
yassl
libcurl can get also get built to use yassl for the TLS/SSL layer. yassl is a
GPL[3] licensed library.
GnuTLS vs OpenSSL vs yassl
While these three libraries offer similar features, they are not equal.
libcurl does not (yet) offer a standardized stable ABI if you decide to
switch from using libcurl-openssl to libcurl-gnutls or vice-versa. The GnuTLS
and yassl support is very recent in libcurl and it has not been tested nor
used very extensively, while the OpenSSL equivalent code has been used and
thus matured since 1999.
GnuTLS
- LGPL licensed
- supports SRP
- lacks SSLv2 support
- lacks MD2 support (used by at least some CA certs)
- lacks the crypto functions libcurl uses for NTLM
OpenSSL
- Original BSD licensed
- lacks SRP
- supports SSLv2
- older and more widely used
- provides crypto functions libcurl uses for NTLM
- libcurl can do non-blocking connects with it in 7.15.4 and later
yassl
- GPL licensed
- much untested and unproven in the real work by (lib)curl users so we don't
know a lot about restrictions or benefits from using this
The Better License, Original BSD, GPL or LGPL?
It isn't obvious or without debate to any objective interested party that
either of these licenses are the "better" or even the "preferred" one in a
generic situation.
Instead, I think we should accept the fact that the SSL/TLS libraries and
their different licenses will fit different applications and their authors
differently depending on the applications' licenses and their general usage
pattern (considering how GPL and LGPL libraries for example can be burdensome
for embedded systems usage).
In Debian land, there seems to be a common opinion that LGPL is "maximally
compatible" with apps while Original BSD is not. Like this:
http://lists.debian.org/debian-devel/2005/09/msg01417.html
More SSL Libraries
In libcurl, there's no stopping us here. There are more Open Source/Free
SSL/TLS libraries out there and we would very much like to support them as
well, to offer application authors an even wider scope of choice.
Application Angle of this Problem
libcurl is built to use one SSL/TLS library. It uses a single fixed name (by
default) on the built/created lib file, and applications are built/linked to
use that single lib. Replacing one libcurl instance with another one that
uses the other SSL/TLS library might break one or more applications (due to
ABI differences and/or different feature set). You want your application to
use the libcurl it was built for.
Project cURL Angle of this Problem
We distribute libcurl and everyone may build libcurl with either library at
their choice. This problem is not directly a problem of ours. It merely
affects users - GPL application authors only - of our lib as it comes
included and delivered on some distros.
libcurl has different ABI when built with different SSL/TLS libraries due to
these reasons:
1. No one has worked on fixing this. The mutex/lock callbacks should be set
with a generic libcurl function that should use the proper underlying
functions.
2. The CURLOPT_SSL_CTX_FUNCTION option is not possible to "emulate" on GnuTLS
but simply requires OpenSSL.
3. There might be some other subtle differences just because nobody has yet
tried to make a fixed ABI like this.
Distro Angle of this Problem
To my knowledge there is only one distro that ships libcurl built with either
OpenSSL or GnuTLS.
Debian Linux is now (since mid September 2005) providing two different
libcurl packages, one for libcurl built with OpenSSL and one built with
GnuTLS. They use different .so names and can this both be installed in a
single system simultaneously. This has been said to be a transitional system
not desired to keep in the long run.
Footnotes
[1] = http://www.xfree86.org/3.3.6/COPYRIGHT2.html#6
[2] = http://www.fsf.org/licensing/essays/bsd.html
[3] = http://www.fsf.org/licensing/licenses/gpl.html
[4] = http://curl.haxx.se/docs/copyright.html
[5] = http://www.openssl.org/source/license.html
[6] = http://www.fsf.org/licensing/licenses/gpl.html end of section 3
[7] = http://www.fsf.org/licensing/licenses/lgpl.html
[8] = http://en.wikipedia.org/wiki/OpenSSL_exception
Feedback/Updates provided by
Eric Cooper

117
docs/FAQ
View File

@ -21,6 +21,7 @@ FAQ
1.12 I have a problem who can I chat with?
1.13 curl's ECCN number?
1.14 How do I submit my patch?
1.15 How do I port libcurl to my OS?
2. Install Related Problems
2.1 configure doesn't find OpenSSL even when it is installed
@ -29,6 +30,7 @@ FAQ
2.2 Does curl work/build with other SSL libraries?
2.3 Where can I find a copy of LIBEAY32.DLL?
2.4 Does curl support SOCKS (RFC 1928) ?
2.5 Install libcurl for both 32bit and 64bit?
3. Usage Problems
3.1 curl: (1) SSL is disabled, https: not supported
@ -81,6 +83,7 @@ FAQ
4.18 file:// URLs containing drive letters (Windows, NetWare)
4.19 Why doesn't cURL return an error when the network cable is unplugged?
4.20 curl doesn't return error for HTTP non-200 responses!
4.21 Why is there a HTTP/1.1 in my HTTP/2 request?
5. libcurl Issues
5.1 Is libcurl thread-safe?
@ -223,7 +226,9 @@ FAQ
implement it for you, that is not a very friendly attitude. We spend a
considerable time already on maintaining and developing curl. In order to
get more out of us, you should consider trading in some of your time and
efforts in return.
efforts in return. Simply go to the GitHub repo which resides at
https://github.com/curl/curl, fork the project, and create pull requests
with your proposed changes.
If you write the code, chances are bigger that it will get into curl faster.
@ -249,9 +254,10 @@ FAQ
We still get help from companies. Haxx provides web site, bandwidth, mailing
lists etc, sourceforge.net hosts project services we take advantage from,
like the bug tracker and github hosts the primary git repository. Also
again, some companies have sponsored certain parts of the development in the
past and I hope some will continue to do so in the future.
like the bug tracker, and GitHub hosts the primary git repository at
https://github.com/curl/curl. Also again, some companies have sponsored
certain parts of the development in the past and I hope some will continue to
do so in the future.
If you want to support our project, consider a donation or a banner-program
or even better: by helping us coding, documenting, testing etc.
@ -276,7 +282,7 @@ FAQ
Please do not mail any single individual unless you really need to. Keep
curl-related questions on a suitable mailing list. All available mailing
lists are listed in the MANUAL document and online at
http://curl.haxx.se/mail/
https://curl.haxx.se/mail/
Keeping curl-related questions and discussions on mailing lists allows
others to join in and help, to share their ideas, contribute their
@ -297,7 +303,7 @@ FAQ
your curl-related problems.
We list available alternatives on the curl web site:
http://curl.haxx.se/support.html
https://curl.haxx.se/support.html
1.10 How many are using curl?
@ -314,7 +320,7 @@ FAQ
In May 2012 Daniel did a counting game and came up with a number that may
be completely wrong or somewhat accurate. Over 500 million!
See http://daniel.haxx.se/blog/2012/05/16/300m-users/
See https://daniel.haxx.se/blog/2012/05/16/300m-users/
1.11 Why don't you update ca-bundle.crt
@ -336,7 +342,7 @@ FAQ
If you want the most recent collection of ca certs that Mozilla Firefox
uses, we recommend that you extract the collection yourself from Mozilla
Firefox (by running 'make ca-bundle), or by using our online service setup
for this purpose: http://curl.haxx.se/docs/caextract.html
for this purpose: https://curl.haxx.se/docs/caextract.html
1.12 I have a problem who can I chat with?
@ -350,13 +356,15 @@ FAQ
cryptography. When doing so, the Export Control Classification Number (ECCN)
is used to identify the level of export control etc.
ASF gives a good explanation at http://www.apache.org/dev/crypto.html
Apache Software Foundation gives a good explanation of ECCNs at
https://www.apache.org/dev/crypto.html
We believe curl's number might be ECCN 5D002, another possibility is
5D992. It seems necessary to write them, asking to confirm.
5D992. It seems necessary to write them (the authority that administers ECCN
numbers), asking to confirm.
Comprehensible explanations of the meaning of such numbers and how to
obtain them (resp.) are here
Comprehensible explanations of the meaning of such numbers and how to obtain
them (resp.) are here
http://www.bis.doc.gov/licensing/exportingbasics.htm
http://www.bis.doc.gov/licensing/do_i_needaneccn.html
@ -379,6 +387,19 @@ FAQ
Lots of more details are found in the CONTRIBUTE and INTERNALS docs.
1.15 How do I port libcurl to my OS?
Here's a rough step-by-step:
1. copy a suitable lib/config-*.h file as a start to lib/config-[youros].h
2. edit lib/config-[youros].h to match your OS and setup
3. edit lib/curl_setup.h to include config-[youros].h when your OS is
detected by the preprocessor, in the style others already exist
4. compile lib/*.c and make them into a library
2. Install Related Problems
@ -429,7 +450,7 @@ FAQ
GnuTLS, yassl, NSS, PolarSSL, axTLS, Secure Transport (native iOS/OS X),
WinSSL (native Windows) or GSKit (native IBM i). They all have their pros
and cons, and we try to maintain a comparison of them here:
http://curl.haxx.se/docs/ssl-compared.html
https://curl.haxx.se/docs/ssl-compared.html
2.3 Where can I find a copy of LIBEAY32.DLL?
@ -444,6 +465,32 @@ FAQ
Yes, SOCKS 4 and 5 are supported.
2.5 Install libcurl for both 32bit and 64bit?
In curl's configure procedure one of the regular include files get created
with platform specific information. The file 'curl/curlbuild.h' in the
installed libcurl file tree is therefore somewhat tied to that particular
platform.
To allow applications to get built for either 32bit or 64bit you need to
install libcurl headers for both setups and unfortunately curl doesn't do
this automatically.
A commonly used procedure is this:
$ ./configure [32bit platform]
$ mv curl/curlbuild.h curl/curlbuild-32bit.h
$ ./configure [64bit platform]
$ mv curl/curlbuild.h curl/curlbuild-64bit.h
Then you make a toplevel curl/curlbuild.h replacement that only does this:
#ifdef IS_32BIT
#include "curlbuild-32bit.h"
else
#include "curlbuild-64bit.h"
#endif
3. Usage problems
@ -541,7 +588,7 @@ FAQ
Find out more about which languages that support curl directly, and how to
install and use them, in the libcurl section of the curl web site:
http://curl.haxx.se/libcurl/
https://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
@ -674,7 +721,7 @@ FAQ
certificate. Server certificate verification is enabled by default in curl
and libcurl and is often the reason for problems as explained in FAQ entry
4.12 and the SSLCERTS document
(http://curl.haxx.se/docs/sslcerts.html). Server certificates that are
(https://curl.haxx.se/docs/sslcerts.html). Server certificates that are
"self-signed" or otherwise signed by a CA that you do not have a CA cert
for, cannot be verified. If the verification during a connect fails, you are
refused access. You then need to explicitly disable the verification to
@ -965,7 +1012,7 @@ FAQ
this check.
Details are also in the SSLCERTS file in the release archives, found online
here: http://curl.haxx.se/docs/sslcerts.html
here: https://curl.haxx.se/docs/sslcerts.html
4.13 Why is curl -R on Windows one hour off?
@ -1027,7 +1074,7 @@ FAQ
timeout is set.
See option TcpMaxConnectRetransmissions on this page:
http://support.microsoft.com/?scid=kb%3Ben-us%3B175523&x=6&y=7
https://support.microsoft.com/en-us/kb/175523/en-us
Also, even on non-Windows systems there may run a firewall or anti-virus
software or similar that accepts the connection but does not actually do
@ -1044,7 +1091,7 @@ FAQ
You'll find that even if D:\blah.txt does exist, cURL returns a 'file
not found' error.
According to RFC 1738 (http://www.faqs.org/rfcs/rfc1738.html),
According to RFC 1738 (https://www.ietf.org/rfc/rfc1738.txt),
file:// URLs must contain a host component, but it is ignored by
most implementations. In the above example, 'D:' is treated as the
host component, and is taken away. Thus, cURL tries to open '/blah.txt'.
@ -1072,7 +1119,7 @@ FAQ
In such cases, the TCP/IP stack is responsible for detecting when the
network connection is irrevocably lost. Since with some protocols it is
perfectly legal for the client wait indefinitely for data, the stack may
perfectly legal for the client to wait indefinitely for data, the stack may
never report a problem, and even when it does, it can take up to 20 minutes
for it to detect an issue. The curl option --keepalive-time enables
keep-alive support in the TCP/IP stack which makes it periodically probe the
@ -1116,6 +1163,16 @@ FAQ
You can also use the -w option and the variable %{response_code} to extract
the exact response code that was return in the response.
4.21 Why is there a HTTP/1.1 in my HTTP/2 request?
If you use verbose to see the HTTP request when you send off a HTTP/2
request, it will still say 1.1.
The reason for this is that we first generate the request to send using the
old 1.1 style and show that request in the verbose output, and then we
convert it over to the binary header-compressed HTTP/2 style. The actual
"1.1" part from that request is then not actually used in the transfer. The
binary HTTP/2 headers are not human readable.
5. libcurl Issues
@ -1138,13 +1195,13 @@ FAQ
If you use a OpenSSL-powered libcurl in a multi-threaded environment, you
need to provide one or two locking functions:
http://www.openssl.org/docs/crypto/threads.html
https://www.openssl.org/docs/crypto/threads.html
If you use a GnuTLS-powered libcurl in a multi-threaded environment, you
need to provide locking function(s) for libgcrypt (which is used by GnuTLS
for the crypto functions).
http://www.gnu.org/software/gnutls/manual/html_node/Multi_002dthreaded-applications.html
https://web.archive.org/web/20111103083330/http://www.gnu.org/software/gnutls/manual/html_node/Multi_002dthreaded-applications.html
No special locking is needed with a NSS-powered libcurl. NSS is thread-safe.
@ -1320,7 +1377,7 @@ FAQ
Also note that on many networks NATs or other IP-munging techniques are used
that makes you see and use a different IP address locally than what the
remote server will see you coming from. You may also consider using
http://www.torproject.org .
https://www.torproject.org/ .
5.13 How do I stop an ongoing transfer?
@ -1372,7 +1429,7 @@ FAQ
to do "LIST -a" or similar to see them.
The application thus needs to parse the LIST output. One such existing
list parser is available at http://cr.yp.to/ftpparse.html Versions of
list parser is available at https://cr.yp.to/ftpparse.html Versions of
libcurl since 7.21.0 also provide the ability to specify a wildcard to
download multiple files from one FTP directory.
@ -1491,7 +1548,7 @@ FAQ
notice" somewhere. Most probably like in the documentation or in the section
where other third party dependencies already are mentioned and acknowledged.
As can be seen here: http://curl.haxx.se/docs/companies.html and elsewhere,
As can be seen here: https://curl.haxx.se/docs/companies.html and elsewhere,
more and more companies are discovering the power of libcurl and take
advantage of it even in commercial environments.
@ -1511,9 +1568,7 @@ FAQ
7.2 Who wrote PHP/CURL?
PHP/CURL is a module that comes with the regular PHP package. It depends and
uses libcurl, so you need to have libcurl installed properly first before
PHP/CURL can be used. PHP/CURL was initially written by Sterling Hughes.
PHP/CURL was initially written by Sterling Hughes.
7.3 Can I perform multiple requests using the same handle?
@ -1522,4 +1577,10 @@ FAQ
unknown to me).
After a transfer, you just set new options in the handle and make another
transfer. This will make libcurl to re-use the same connection if it can.
transfer. This will make libcurl re-use the same connection if it can.
7.4 Does PHP/CURL have dependencies?
PHP/CURL is a module that comes with the regular PHP package. It depends on
and uses libcurl, so you need to have libcurl installed properly before
PHP/CURL can be used.

View File

@ -65,7 +65,7 @@ OpenSSL took over where SSLeay was abandoned.
May, first Debian package.
August, LDAP:// and FILE:// support added. The curl web site gets 1300 visits
weekly.
weekly. Moved site to curl.haxx.nu.
Released curl 6.0 in September. 15000 lines of code.
@ -81,6 +81,8 @@ the easy interface and turned out to be the beginning of actually getting
other software and programs to get based on and powered by libcurl. Almost
20000 lines of code.
June 2000: the curl site moves to "curl.haxx.se"
August, the curl web site gets 4000 visits weekly.
The PHP guys adopted libcurl already the same month, when the first ever third

View File

@ -1,4 +1,4 @@
Updated: July 3, 2012 (http://curl.haxx.se/docs/http-cookies.html)
Updated: July 3, 2012 (https://curl.haxx.se/docs/http-cookies.html)
_ _ ____ _
___| | | | _ \| |
/ __| | | | |_) | |
@ -34,9 +34,9 @@ HTTP Cookies
servers with the Cookie: header.
For a very long time, the only spec explaining how to use cookies was the
original Netscape spec from 1994: http://curl.haxx.se/rfc/cookie_spec.html
original Netscape spec from 1994: https://curl.haxx.se/rfc/cookie_spec.html
In 2011, RFC6265 (http://www.ietf.org/rfc/rfc6265.txt) was finally published
In 2011, RFC6265 (https://www.ietf.org/rfc/rfc6265.txt) was finally published
and details how cookies work within HTTP.
1.2 Cookies saved to disk

111
docs/HTTP2.md Normal file
View File

@ -0,0 +1,111 @@
HTTP/2 with curl
================
[HTTP/2 Spec](https://www.rfc-editor.org/rfc/rfc7540.txt)
[http2 explained](https://daniel.haxx.se/http2/)
Build prerequisites
-------------------
- nghttp2
- OpenSSL, NSS, GnutTLS or PolarSSL with a new enough version
[nghttp2](https://nghttp2.org/)
-------------------------------
libcurl uses this 3rd party library for the low level protocol handling
parts. The reason for this is that HTTP/2 is much more complex at that layer
than HTTP/1.1 (which we implement on our own) and that nghttp2 is an already
existing and well functional library.
We require at least version 1.0.0.
Over an http:// URL
-------------------
If `CURLOPT_HTTP_VERSION` is set to `CURL_HTTP_VERSION_2_0`, libcurl will
include an upgrade header in the initial request to the host to allow
upgrading to HTTP/2.
Possibly we can later introduce an option that will cause libcurl to fail if
not possible to upgrade. Possibly we introduce an option that makes libcurl
use HTTP/2 at once over http://
Over an https:// URL
--------------------
If `CURLOPT_HTTP_VERSION` is set to `CURL_HTTP_VERSION_2_0`, libcurl will use
ALPN (or NPN) to negotiate which protocol to continue with. Possibly introduce
an option that will cause libcurl to fail if not possible to use HTTP/2.
`CURL_HTTP_VERSION_2TLS` was added in 7.47.0 as a way to ask libcurl to prefer
HTTP/2 for HTTPS but stick to 1.1 by default for plain old HTTP connections.
ALPN is the TLS extension that HTTP/2 is expected to use. The NPN extension is
for a similar purpose, was made prior to ALPN and is used for SPDY so early
HTTP/2 servers are implemented using NPN before ALPN support is widespread.
`CURLOPT_SSL_ENABLE_ALPN` and `CURLOPT_SSL_ENABLE_NPN` are offered to allow
applications to explicitly disable ALPN or NPN.
SSL libs
--------
The challenge is the ALPN and NPN support and all our different SSL
backends. You may need a fairly updated SSL library version for it to
provide the necessary TLS features. Right now we support:
- OpenSSL: ALPN and NPN
- NSS: ALPN and NPN
- GnuTLS: ALPN
- PolarSSL: ALPN
Multiplexing
------------
Starting in 7.43.0, libcurl fully supports HTTP/2 multiplexing, which is the
term for doing multiple independent transfers over the same physical TCP
connection.
To take advantage of multiplexing, you need to use the multi interface and set
`CURLMOPT_PIPELINING` to `CURLPIPE_MULTIPLEX`. With that bit set, libcurl will
attempt to re-use existing HTTP/2 connections and just add a new stream over
that when doing subsequent parallel requests.
While libcurl sets up a connection to a HTTP server there is a period during
which it doesn't know if it can pipeline or do multiplexing and if you add new
transfers in that period, libcurl will default to start new connections for
those transfers. With the new option `CURLOPT_PIPEWAIT` (added in 7.43.0), you
can ask that a transfer should rather wait and see in case there's a
connection for the same host in progress that might end up being possible to
multiplex on. It favours keeping the number of connections low to the cost of
slightly longer time to first byte transferred.
Applications
------------
We hide HTTP/2's binary nature and convert received HTTP/2 traffic to headers
in HTTP 1.1 style. This allows applications to work unmodified.
curl tool
---------
curl offers the `--http2` command line option to enable use of HTTP/2.
Since 7.47.0, the curl tool enables HTTP/2 by default for HTTPS connections.
HTTP Alternative Services
-------------------------
Alt-Svc is a suggested extension with a corresponding frame (ALTSVC) in HTTP/2
that tells the client about an alternative "route" to the same content for the
same origin server that you get the response from. A browser or long-living
client can use that hint to create a new connection asynchronously. For
libcurl, we may introduce a way to bring such clues to the applicaton and/or
let a subsequent request use the alternate route
automatically. [Spec](https://tools.ietf.org/html/draft-ietf-httpbis-alt-svc-14)
TODO
----
- Implement "prior-knowledge" HTTP/2 connections over clear text so that
curl can connect with HTTP/2 at once without 1.1+Upgrade.

View File

@ -173,13 +173,13 @@ Win32
advice given above.
KB94248 - How To Use the C Run-Time
http://support.microsoft.com/kb/94248/en-us
https://support.microsoft.com/kb/94248/en-us
KB140584 - How to link with the correct C Run-Time (CRT) library
http://support.microsoft.com/kb/140584/en-us
https://support.microsoft.com/kb/140584/en-us
KB190799 - Potential Errors Passing CRT Objects Across DLL Boundaries
http://msdn.microsoft.com/en-us/library/ms235460
https://msdn.microsoft.com/en-us/library/ms235460
If your app is misbehaving in some strange way, or it is suffering
from memory corruption, before asking for further help, please try
@ -209,8 +209,8 @@ Win32
environment variables, for example:
set ZLIB_PATH=c:\zlib-1.2.8
set OPENSSL_PATH=c:\openssl-0.9.8zc
set LIBSSH2_PATH=c:\libssh2-1.4.3
set OPENSSL_PATH=c:\openssl-1.0.2c
set LIBSSH2_PATH=c:\libssh2-1.6.0
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!
@ -232,7 +232,7 @@ Win32
- optional MingW32-built OpenLDAP SDK available from:
http://www.gknw.net/mirror/openldap/
- optional recent Novell CLDAP SDK available from:
http://developer.novell.com/ndk/cldap.htm
https://www.novell.com/developer/ndk/ldap_libraries_for_c.html
Cygwin
------
@ -254,7 +254,7 @@ Win32
If you use MSVC 6 it is required that you use the February 2003 edition of
the 'Platform SDK' which can be downloaded from:
http://www.microsoft.com/en-us/download/details.aspx?id=12261
https://www.microsoft.com/en-us/download/details.aspx?id=12261
Building any software with MSVC 6 without having PSDK installed is just
asking for trouble down the road once you have released it, you might notice
@ -263,7 +263,7 @@ Win32
software built in such way will at some point regret having done so.
If the compiler has been updated with the installation of a service pack as
those mentioned in http://support.microsoft.com/kb/194022 the compiler can be
those mentioned in https://support.microsoft.com/kb/194022 the compiler can be
safely used to read source code, translate and make it object code.
But, even with the service packs mentioned above installed, the resulting
@ -299,7 +299,7 @@ Win32
Then run 'nmake vc' in curl's root directory.
If you want to compile with zlib support, you will need to build
zlib (http://www.gzip.org/zlib/) as well. Please read the zlib
zlib (http://www.zlib.net/) as well. Please read the zlib
documentation on how to compile zlib. Define the ZLIB_PATH environment
variable to the location of zlib.h and zlib.lib, for example:
@ -471,6 +471,15 @@ Win32
add '-DCURL_STATICLIB' to your CFLAGS. Otherwise the linker will look for
dynamic import symbols.
Legacy Windows and SSL
----------------------
WinSSL (specifically SChannel from Windows SSPI), is the native SSL library
in Windows. However, WinSSL in Windows <= XP is unable to connect to servers
that no longer support the legacy handshakes and algorithms used by those
versions. If you will be using curl in one of those earlier versions of
Windows you should choose another SSL backend such as OpenSSL.
Apple iOS and Mac OS X
======================
@ -665,12 +674,10 @@ NetWare
- gnu make and awk running on the platform you compile on;
native Win32 versions can be downloaded from:
http://www.gknw.net/development/prgtools/
- recent Novell LibC SDK available from:
http://developer.novell.com/ndk/libc.htm
- or recent Novell CLib SDK available from:
http://developer.novell.com/ndk/clib.htm
- recent Novell LibC or Novell CLib SDK available from:
https://www.novell.com/developer/ndk/
- optional recent Novell CLDAP SDK available from:
http://developer.novell.com/ndk/cldap.htm
https://www.novell.com/developer/ndk/ldap_libraries_for_c.html
- optional zlib sources (static or dynamic linking with zlib.imp);
sources with NetWare Makefile can be obtained from:
http://www.gknw.net/mirror/zlib/
@ -699,7 +706,7 @@ NetWare
Builds automatically created 8 times a day from current git are here:
http://www.gknw.net/mirror/curl/autobuilds/
the status of these builds can be viewed at the autobuild table:
http://curl.haxx.se/dev/builds.html
https://curl.haxx.se/dev/builds.html
eCos
====
@ -825,7 +832,7 @@ VxWorks
To build libcurl for VxWorks you need:
- CYGWIN (free, http://cygwin.com/)
- CYGWIN (free, https://cygwin.com/)
- Wind River Workbench (commercial)
If you have CYGWIN and Workbench installed on you machine
@ -943,9 +950,10 @@ REDUCING SIZE
important factor. First, be sure to set the CFLAGS variable when
configuring with any relevant compiler optimization flags to reduce the
size of the binary. For gcc, this would mean at minimum the -Os option,
and potentially the -march=X and -mdynamic-no-pic options as well, e.g.
and potentially the -march=X, -mdynamic-no-pic and -flto options as well,
e.g.
./configure CFLAGS='-Os' ...
./configure CFLAGS='-Os' LDFLAGS='-Wl,-Bsymbolic'...
Note that newer compilers often produce smaller code than older versions
due to improved optimization.
@ -963,7 +971,9 @@ REDUCING SIZE
--disable-ipv6 (disables support for IPv6)
--disable-manual (disables support for the built-in documentation)
--disable-proxy (disables support for HTTP and SOCKS proxies)
--disable-unix-sockets (disables support for UNIX sockets)
--disable-verbose (eliminates debugging strings and error code strings)
--disable-versioned-symbols (disables support for versioned symbols)
--enable-hidden-symbols (eliminates unneeded symbols in the shared library)
--without-libidn (disables support for the libidn DNS library)
--without-librtmp (disables support for RTMP)
@ -976,7 +986,7 @@ REDUCING SIZE
configure command-line, e.g.
CFLAGS="-Os -ffunction-sections -fdata-sections \
-fno-unwind-tables -fno-asynchronous-unwind-tables" \
-fno-unwind-tables -fno-asynchronous-unwind-tables -flto" \
LDFLAGS="-Wl,-s -Wl,-Bsymbolic -Wl,--gc-sections"
Be sure also to strip debugging symbols from your binaries after
@ -986,9 +996,9 @@ REDUCING SIZE
.comment section).
Using these techniques it is possible to create a basic HTTP-only shared
libcurl library for i386 Linux platforms that is only 114 KiB in size, and
an FTP-only library that is 115 KiB in size (as of libcurl version 7.35.0,
using gcc 4.8.2).
libcurl library for i386 Linux platforms that is only 109 KiB in size, and
an FTP-only library that is 109 KiB in size (as of libcurl version 7.45.0,
using gcc 4.9.2).
You may find that statically linking libcurl to your application will
result in a lower total size than dynamically linking.
@ -1086,18 +1096,18 @@ Useful URLs
axTLS http://axtls.sourceforge.net/
c-ares http://c-ares.haxx.se/
GNU GSS http://www.gnu.org/software/gss/
GnuTLS http://www.gnu.org/software/gnutls/
Heimdal http://www.pdc.kth.se/heimdal/
libidn http://www.gnu.org/software/libidn/
GNU GSS https://www.gnu.org/software/gss/
GnuTLS https://www.gnu.org/software/gnutls/
Heimdal http://www.h5l.org/
libidn https://www.gnu.org/software/libidn/
libmetalink https://launchpad.net/libmetalink/
libssh2 http://www.libssh2.org/
MIT Kerberos http://web.mit.edu/kerberos/www/dist/
NSS http://www.mozilla.org/projects/security/pki/nss/
NSS https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS
OpenLDAP http://www.openldap.org/
OpenSSL http://www.openssl.org/
PolarSSL http://polarssl.org/
yassl http://www.yassl.com/
OpenSSL https://www.openssl.org/
PolarSSL https://tls.mbed.org/
wolfSSL https://www.wolfssl.com/wolfSSL/
Zlib http://www.zlib.net/
MingW http://www.mingw.org/

View File

@ -95,7 +95,7 @@ install instructions may produce erratic behaviour in DevCpp. For further info
check the following sites
http://aditsu.freeunixhost.com/dev-cpp-faq.html
http://sourceforge.net/forum/message.php?msg_id=3252213
https://sourceforge.net/p/dev-cpp/discussion/48211/thread/2a85ea46
As I have mentioned before I will confine this to the SSL Library compilations
but the process is very similar for compilation of the executable - curl.exe;
@ -248,7 +248,7 @@ SSL Files
openssl-0.9.7e-win32-bin.zip for the minimalist package of the openssl-0.9.7e
binaries ported to MS Windows 95/98/NT/XP using the MingW32/GCC-3.1
development environment. The file may be downloaded at
http://curl.haxx.se/download/.
https://curl.haxx.se/download/.
2- Open the above zip file. You will find two files - SDL.dll,
SDL_mixer.dll. Install them in the directory C:\WINDOWS\SYSTEM32 for Win 9x

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,36 @@ join in and help us correct one or more of these! Also be sure to check the
changelog of the current development status, as one or more of these problems
may have been fixed since this was written!
93. It is not possible to pass a 64-bit value using CURLFORM_CONTENTLEN with
CURLFORM_ARRAY, when compiled on 32-bit platforms that support 64-bit
integers. This is because the underlying structure 'curl_forms' uses a dual
purpose char* for storing these values in via casting. For more information
see the now closed related issue:
https://github.com/curl/curl/issues/608
92. curl tool 7.47.1 in Windows will not --output to literal paths \\?\ or to
reserved dos device names unless the device prefix \\.\ is used. To send
output to a device that has a reserved dos device name you can use the
Windows device prefix (eg: --output \\.\NUL). You can also use the
redirection operator to send output to a literal path or a reserved device
name (eg: > NUL).
The next release of curl will support --output in Windows to literal paths
and to reserved device names without the device prefix.
https://github.com/curl/curl/commit/c3aac48
https://github.com/curl/curl/commit/4fc80f3
91. "curl_easy_perform hangs with imap and PolarSSL"
https://github.com/curl/curl/issues/334
90. IMAP "SEARCH ALL" truncates output on large boxes. "A quick search of the
code reveals that pingpong.c contains some truncation code, at line 408,
when it deems the server response to be too large truncating it to 40
characters"
https://curl.haxx.se/bug/view.cgi?id=1366
89. Disabling HTTP Pipelining when there are ongoing transfers can lead to
heap corruption and crash. https://curl.haxx.se/bug/view.cgi?id=1411
88. libcurl doesn't support CURLINFO_FILETIME for SFTP transfers and thus
curl's -R option also doesn't work then.
@ -12,7 +42,7 @@ may have been fixed since this was written!
mention that decoding also means that we need to check for nastiness that is
attempted, like "../" sequences and the like. Probably everything to the left
of any embedded slashes should be cut off.
http://curl.haxx.se/bug/view.cgi?id=1294
https://curl.haxx.se/bug/view.cgi?id=1294
86. The disconnect commands (LOGOUT and QUIT) may not be sent by IMAP, POP3
and SMTP if a failure occurs during the authentication phase of a
@ -23,7 +53,8 @@ may have been fixed since this was written!
CURLINFO_STARTTRANSFER_TIME is wrong. While using POST
CURLINFO_STARTTRANSFER_TIME minus CURLINFO_PRETRANSFER_TIME is near to zero
every time.
http://curl.haxx.se/bug/view.cgi?id=1213
https://github.com/curl/curl/issues/218
https://curl.haxx.se/bug/view.cgi?id=1213
84. CURLINFO_SSL_VERIFYRESULT is only implemented for the OpenSSL and NSS
backends, so relying on this information in a generic app is flaky.
@ -31,67 +62,57 @@ may have been fixed since this was written!
82. When building with the Windows Borland compiler, it fails because the
"tlib" tool doesn't support hyphens (minus signs) in file names and we have
such in the build.
http://curl.haxx.se/bug/view.cgi?id=1222
https://curl.haxx.se/bug/view.cgi?id=1222
81. When using -J (with -O), automatically resumed downloading together with
"-C -" fails. Without -J the same command line works! This happens because
the resume logic is worked out before the target file name (and thus its
pre-transfer size) has been figured out!
http://curl.haxx.se/bug/view.cgi?id=1169
https://curl.haxx.se/bug/view.cgi?id=1169
80. Curl doesn't recognize certificates in DER format in keychain, but it
works with PEM.
http://curl.haxx.se/bug/view.cgi?id=1065
https://curl.haxx.se/bug/view.cgi?id=1065
79. SMTP. When sending data to multiple recipients, curl will abort and return
failure if one of the recipients indicate failure (on the "RCPT TO"
command). Ordinary mail programs would proceed and still send to the ones
that can receive data. This is subject for change in the future.
http://curl.haxx.se/bug/view.cgi?id=1116
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=1063
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
curl_easy_getinfo() to return a socket properly with the CURLINFO_LASTSOCKET
option as for all other operating systems.
https://curl.haxx.se/bug/view.cgi?id=1116
75. NTLM authentication involving unicode user name or password only works
properly if built with UNICODE defined together with the WinSSL/schannel
backend. The original problem was mentioned in:
http://curl.haxx.se/mail/lib-2009-10/0024.html
http://curl.haxx.se/bug/view.cgi?id=896
https://curl.haxx.se/mail/lib-2009-10/0024.html
https://curl.haxx.se/bug/view.cgi?id=896
The WinSSL/schannel version verified to work as mentioned in
http://curl.haxx.se/mail/lib-2012-07/0073.html
https://curl.haxx.se/mail/lib-2012-07/0073.html
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
acknowledge the connection timeout during that phase but only the "real"
timeout - which may surprise users as it is probably considered to be the
connect phase to most people. Brought up (and is being misunderstood) in:
http://curl.haxx.se/bug/view.cgi?id=856
https://curl.haxx.se/bug/view.cgi?id=856
72. "Pausing pipeline problems."
http://curl.haxx.se/mail/lib-2009-07/0214.html
https://curl.haxx.se/mail/lib-2009-07/0214.html
70. Problem re-using easy handle after call to curl_multi_remove_handle
http://curl.haxx.se/mail/lib-2009-07/0249.html
https://curl.haxx.se/mail/lib-2009-07/0249.html
68. "More questions about ares behavior".
http://curl.haxx.se/mail/lib-2009-08/0012.html
https://curl.haxx.se/mail/lib-2009-08/0012.html
67. When creating multipart formposts. The file name part can be encoded with
something beyond ascii but currently libcurl will only pass in the verbatim
string the app provides. There are several browsers that already do this
encoding. The key seems to be the updated draft to RFC2231:
http://tools.ietf.org/html/draft-reschke-rfc2231-in-http-02
https://tools.ietf.org/html/draft-reschke-rfc2231-in-http-02
66. When using telnet, the time limitation options don't work.
http://curl.haxx.se/bug/view.cgi?id=846
https://curl.haxx.se/bug/view.cgi?id=846
65. When doing FTP over a socks proxy or CONNECT through HTTP proxy and the
multi interface is used, libcurl will fail if the (passive) TCP connection
@ -102,27 +123,27 @@ may have been fixed since this was written!
63. When CURLOPT_CONNECT_ONLY is used, the handle cannot reliably be re-used
for any further requests or transfers. The work-around is then to close that
handle with curl_easy_cleanup() and create a new. Some more details:
http://curl.haxx.se/mail/lib-2009-04/0300.html
https://curl.haxx.se/mail/lib-2009-04/0300.html
61. If an upload using Expect: 100-continue receives an HTTP 417 response,
it ought to be automatically resent without the Expect:. A workaround is
for the client application to redo the transfer after disabling Expect:.
http://curl.haxx.se/mail/archive-2008-02/0043.html
https://curl.haxx.se/mail/archive-2008-02/0043.html
60. libcurl closes the connection if an HTTP 401 reply is received while it
is waiting for the the 100-continue response.
http://curl.haxx.se/mail/lib-2008-08/0462.html
https://curl.haxx.se/mail/lib-2008-08/0462.html
58. It seems sensible to be able to use CURLOPT_NOBODY and
CURLOPT_FAILONERROR with FTP to detect if a file exists or not, but it is
not working: http://curl.haxx.se/mail/lib-2008-07/0295.html
not working: https://curl.haxx.se/mail/lib-2008-07/0295.html
56. When libcurl sends CURLOPT_POSTQUOTE commands when connected to a SFTP
server using the multi interface, the commands are not being sent correctly
and instead the connection is "cancelled" (the operation is considered done)
prematurely. There is a half-baked (busy-looping) patch provided in the bug
report but it cannot be accepted as-is. See
http://curl.haxx.se/bug/view.cgi?id=748
https://curl.haxx.se/bug/view.cgi?id=748
55. libcurl fails to build with MIT Kerberos for Windows (KfW) due to KfW's
library header files exporting symbols/macros that should be kept private
@ -131,13 +152,13 @@ may have been fixed since this was written!
52. Gautam Kachroo's issue that identifies a problem with the multi interface
where a connection can be re-used without actually being properly
SSL-negotiated:
http://curl.haxx.se/mail/lib-2008-01/0277.html
https://curl.haxx.se/mail/lib-2008-01/0277.html
49. If using --retry and the transfer timeouts (possibly due to using -m or
-y/-Y) the next attempt doesn't resume the transfer properly from what was
downloaded in the previous attempt but will truncate and restart at the
original position where it was at before the previous failed attempt. See
http://curl.haxx.se/mail/lib-2008-01/0080.html and Mandriva bug report
https://curl.haxx.se/mail/lib-2008-01/0080.html and Mandriva bug report
https://qa.mandriva.com/show_bug.cgi?id=22565
48. If a CONNECT response-headers are larger than BUFSIZE (16KB) when the
@ -146,25 +167,25 @@ may have been fixed since this was written!
protocol code. This should be very rare.
43. There seems to be a problem when connecting to the Microsoft telnet server.
http://curl.haxx.se/bug/view.cgi?id=649
https://curl.haxx.se/bug/view.cgi?id=649
41. When doing an operation over FTP that requires the ACCT command (but not
when logging in), the operation will fail since libcurl doesn't detect this
and thus fails to issue the correct command:
http://curl.haxx.se/bug/view.cgi?id=635
https://curl.haxx.se/bug/view.cgi?id=635
39. Steffen Rumler's Race Condition in Curl_proxyCONNECT:
http://curl.haxx.se/mail/lib-2007-01/0045.html
https://curl.haxx.se/mail/lib-2007-01/0045.html
38. Kumar Swamy Bhatt's problem in ftp/ssl "LIST" operation:
http://curl.haxx.se/mail/lib-2007-01/0103.html
https://curl.haxx.se/mail/lib-2007-01/0103.html
35. Both SOCKS5 and SOCKS4 proxy connections are done blocking, which is very
bad when used with the multi interface.
34. The SOCKS4 connection codes don't properly acknowledge (connect) timeouts.
Also see #12. According to bug #1556528, even the SOCKS5 connect code does
not do it right: http://curl.haxx.se/bug/view.cgi?id=604
not do it right: https://curl.haxx.se/bug/view.cgi?id=604
31. "curl-config --libs" will include details set in LDFLAGS when configure is
run that might be needed only for building libcurl. Further, curl-config
@ -172,7 +193,7 @@ may have been fixed since this was written!
26. NTLM authentication using SSPI (on Windows) when (lib)curl is running in
"system context" will make it use wrong(?) user name - at least when compared
to what winhttp does. See http://curl.haxx.se/bug/view.cgi?id=535
to what winhttp does. See https://curl.haxx.se/bug/view.cgi?id=535
23. SOCKS-related problems:
B) libcurl doesn't support FTPS over a SOCKS proxy.
@ -218,8 +239,8 @@ may have been fixed since this was written!
10. To get HTTP Negotiate (SPNEGO) authentication to work fine, you need to
provide a (fake) user name (this concerns both curl and the lib) because the
code wrongly only considers authentication if there's a user name provided.
http://curl.haxx.se/bug/view.cgi?id=440 How?
http://curl.haxx.se/mail/lib-2004-08/0182.html
https://curl.haxx.se/bug/view.cgi?id=440 How?
https://curl.haxx.se/mail/lib-2004-08/0182.html
8. Doing resumed upload over HTTP does not work with '-C -', because curl
doesn't do a HEAD first to get the initial size. This needs to be done
@ -235,14 +256,4 @@ may have been fixed since this was written!
5. libcurl doesn't treat the content-length of compressed data properly, as
it seems HTTP servers send the *uncompressed* length in that header and
libcurl thinks of it as the *compressed* length. Some explanations are here:
http://curl.haxx.se/mail/lib-2003-06/0146.html
2. If a HTTP server responds to a HEAD request and includes a body (thus
violating the RFC2616), curl won't wait to read the response but just stop
reading and return back. If a second request (let's assume a GET) is then
immediately made to the same server again, the connection will be re-used
fine of course, and the second request will be sent off but when the
response is to get read, the previous response-body is what curl will read
and havoc is what happens.
More details on this is found in this libcurl mailing list thread:
http://curl.haxx.se/mail/lib-2002-08/0000.html
https://curl.haxx.se/mail/lib-2003-06/0146.html

View File

@ -1,245 +0,0 @@
_ _ ____ _
___| | | | _ \| |
/ __| | | | |_) | |
| (__| |_| | _ <| |___
\___|\___/|_| \_\_____|
Structs in libcurl
This document should cover 7.32.0 pretty accurately, but will make sense even
for older and later versions as things don't change drastically that often.
1. The main structs in libcurl
1.1 SessionHandle
1.2 connectdata
1.3 Curl_multi
1.4 Curl_handler
1.5 conncache
1.6 Curl_share
1.7 CookieInfo
==============================================================================
1. The main structs in libcurl
1.1 SessionHandle
The SessionHandle handle struct is the one returned to the outside in the
external API as a "CURL *". This is usually known as an easy handle in API
documentations and examples.
Information and state that is related to the actual connection is in the
'connectdata' struct. When a transfer is about to be made, libcurl will
either create a new connection or re-use an existing one. The particular
connectdata that is used by this handle is pointed out by
SessionHandle->easy_conn.
Data and information that regard this particular single transfer is put in
the SingleRequest sub-struct.
When the SessionHandle struct is added to a multi handle, as it must be in
order to do any transfer, the ->multi member will point to the Curl_multi
struct it belongs to. The ->prev and ->next members will then be used by the
multi code to keep a linked list of SessionHandle structs that are added to
that same multi handle. libcurl always uses multi so ->multi *will* point to
a Curl_multi when a transfer is in progress.
->mstate is the multi state of this particular SessionHandle. When
multi_runsingle() is called, it will act on this handle according to which
state it is in. The mstate is also what tells which sockets to return for a
specific SessionHandle when curl_multi_fdset() is called etc.
The libcurl source code generally use the name 'data' for the variable that
points to the SessionHandle.
1.2 connectdata
A general idea in libcurl is to keep connections around in a connection
"cache" after they have been used in case they will be used again and then
re-use an existing one instead of creating a new as it creates a significant
performance boost.
Each 'connectdata' identifies a single physical connection to a server. If
the connection can't be kept alive, the connection will be closed after use
and then this struct can be removed from the cache and freed.
Thus, the same SessionHandle can be used multiple times and each time select
another connectdata struct to use for the connection. Keep this in mind, as
it is then important to consider if options or choices are based on the
connection or the SessionHandle.
Functions in libcurl will assume that connectdata->data points to the
SessionHandle that uses this connection.
As a special complexity, some protocols supported by libcurl require a
special disconnect procedure that is more than just shutting down the
socket. It can involve sending one or more commands to the server before
doing so. Since connections are kept in the connection cache after use, the
original SessionHandle may no longer be around when the time comes to shut
down a particular connection. For this purpose, libcurl holds a special
dummy 'closure_handle' SessionHandle in the Curl_multi struct to
FTP uses two TCP connections for a typical transfer but it keeps both in
this single struct and thus can be considered a single connection for most
internal concerns.
The libcurl source code generally use the name 'conn' for the variable that
points to the connectdata.
1.3 Curl_multi
Internally, the easy interface is implemented as a wrapper around multi
interface functions. This makes everything multi interface.
Curl_multi is the multi handle struct exposed as "CURLM *" in external APIs.
This struct holds a list of SessionHandle structs that have been added to
this handle with curl_multi_add_handle(). The start of the list is ->easyp
and ->num_easy is a counter of added SessionHandles.
->msglist is a linked list of messages to send back when
curl_multi_info_read() is called. Basically a node is added to that list
when an individual SessionHandle's transfer has completed.
->hostcache points to the name cache. It is a hash table for looking up name
to IP. The nodes have a limited life time in there and this cache is meant
to reduce the time for when the same name is wanted within a short period of
time.
->timetree points to a tree of SessionHandles, sorted by the remaining time
until it should be checked - normally some sort of timeout. Each
SessionHandle has one node in the tree.
->sockhash is a hash table to allow fast lookups of socket descriptor to
which SessionHandle that uses that descriptor. This is necessary for the
multi_socket API.
->conn_cache points to the connection cache. It keeps track of all
connections that are kept after use. The cache has a maximum size.
->closure_handle is described in the 'connectdata' section.
The libcurl source code generally use the name 'multi' for the variable that
points to the Curl_multi struct.
1.4 Curl_handler
Each unique protocol that is supported by libcurl needs to provide at least
one Curl_handler struct. It defines what the protocol is called and what
functions the main code should call to deal with protocol specific issues.
In general, there's a source file named [protocol].c in which there's a
"struct Curl_handler Curl_handler_[protocol]" declared. In url.c there's
then the main array with all individual Curl_handler structs pointed to from
a single array which is scanned through when a URL is given to libcurl to
work with.
->scheme is the URL scheme name, usually spelled out in uppercase. That's
"HTTP" or "FTP" etc. SSL versions of the protcol need its own Curl_handler
setup so HTTPS separate from HTTP.
->setup_connection is called to allow the protocol code to allocate protocol
specific data that then gets associated with that SessionHandle for the rest
of this transfer. It gets freed again at the end of the transfer. It will be
called before the 'connectdata' for the transfer has been selected/created.
Most protocols will allocate its private 'struct [PROTOCOL]' here and assign
SessionHandle->req.protop to point to it.
->connect_it allows a protocol to do some specific actions after the TCP
connect is done, that can still be considered part of the connection phase.
Some protocols will alter the connectdata->recv[] and connectdata->send[]
function pointers in this function.
->connecting is similarly a function that keeps getting called as long as the
protocol considers itself still in the connecting phase.
->do_it is the function called to issue the transfer request. What we call
the DO action internally. If the DO is not enough and things need to be kept
getting done for the entire DO sequence to complete, ->doing is then usually
also provided. Each protocol that needs to do multiple commands or similar
for do/doing need to implement their own state machines (see SCP, SFTP,
FTP). Some protocols (only FTP and only due to historical reasons) has a
separate piece of the DO state called DO_MORE.
->doing keeps getting called while issuing the transfer request command(s)
->done gets called when the transfer is complete and DONE. That's after the
main data has been transferred.
->do_more gets called during the DO_MORE state. The FTP protocol uses this
state when setting up the second connection.
->proto_getsock
->doing_getsock
->domore_getsock
->perform_getsock
Functions that return socket information. Which socket(s) to wait for which
action(s) during the particular multi state.
->disconnect is called immediately before the TCP connection is shutdown.
->readwrite gets called during transfer to allow the protocol to do extra
reads/writes
->defport is the default report TCP or UDP port this protocol uses
->protocol is one or more bits in the CURLPROTO_* set. The SSL versions have
their "base" protocol set and then the SSL variation. Like "HTTP|HTTPS".
->flags is a bitmask with additional information about the protocol that will
make it get treated differently by the generic engine:
PROTOPT_SSL - will make it connect and negotiate SSL
PROTOPT_DUAL - this protocol uses two connections
PROTOPT_CLOSEACTION - this protocol has actions to do before closing the
connection. This flag is no longer used by code, yet still set for a bunch
protocol handlers.
PROTOPT_DIRLOCK - "direction lock". The SSH protocols set this bit to
limit which "direction" of socket actions that the main engine will
concern itself about.
PROTOPT_NONETWORK - a protocol that doesn't use network (read file:)
PROTOPT_NEEDSPWD - this protocol needs a password and will use a default
one unless one is provided
PROTOPT_NOURLQUERY - this protocol can't handle a query part on the URL
(?foo=bar)
1.5 conncache
Is a hash table with connections for later re-use. Each SessionHandle has
a pointer to its connection cache. Each multi handle sets up a connection
cache that all added SessionHandles share by default.
1.6 Curl_share
The libcurl share API allocates a Curl_share struct, exposed to the external
API as "CURLSH *".
The idea is that the struct can have a set of own versions of caches and
pools and then by providing this struct in the CURLOPT_SHARE option, those
specific SessionHandles will use the caches/pools that this share handle
holds.
Then individual SessionHandle structs can be made to share specific things
that they otherwise wouldn't, such as cookies.
The Curl_share struct can currently hold cookies, DNS cache and the SSL
session cache.
1.7 CookieInfo
This is the main cookie struct. It holds all known cookies and related
information. Each SessionHandle has its own private CookieInfo even when
they are added to a multi handle. They can be made to share cookies by using
the share API.

View File

@ -18,34 +18,34 @@ accompany your license with an exception[2]. This particular problem was
addressed when the Modified BSD license was created, which does not have the
announcement clause that collides with GPL.
libcurl http://curl.haxx.se/docs/copyright.html
libcurl https://curl.haxx.se/docs/copyright.html
Uses an MIT (or Modified BSD)-style license that is as liberal as
possible.
OpenSSL http://www.openssl.org/source/license.html
OpenSSL https://www.openssl.org/source/license.html
(May be used for SSL/TLS support) Uses an Original BSD-style license
with an announcement clause that makes it "incompatible" with GPL. You
are not allowed to ship binaries that link with OpenSSL that includes
GPL code (unless that specific GPL code includes an exception for
OpenSSL - a habit that is growing more and more common). If OpenSSL's
licensing is a problem for you, consider using GnuTLS or yassl
instead.
licensing is a problem for you, consider using another TLS library.
GnuTLS http://www.gnutls.org/
(May be used for SSL/TLS support) Uses the LGPL[3] license. If this is
a problem for you, consider using OpenSSL instead. Also note that
a problem for you, consider using another TLS library. Also note that
GnuTLS itself depends on and uses other libs (libgcrypt and
libgpg-error) and they too are LGPL- or GPL-licensed.
yassl http://www.yassl.com/
WolfSSL https://www.wolfssl.com/
(May be used for SSL/TLS support) Uses the GPL[1] license. If this is
a problem for you, consider using OpenSSL or GnuTLS instead.
(May be used for SSL/TLS support) Uses the GPL[1] license or a
propietary license. If this is a problem for you, consider using
another TLS library.
NSS http://www.mozilla.org/projects/security/pki/nss/
NSS https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS
(May be used for SSL/TLS support) Is covered by the MPL[4] license,
the GPL[1] license and the LGPL[3] license. You may choose to license
@ -57,13 +57,29 @@ axTLS http://axtls.sourceforge.net/
(May be used for SSL/TLS support) Uses a Modified BSD-style license.
c-ares http://daniel.haxx.se/projects/c-ares/license.html
mbedTLS https://tls.mbed.org/
(May be used for SSL/TLS support) Uses the GPL[1] license or a
propietary license. If this is a problem for you, consider using
another TLS library.
BoringSSL https://boringssl.googlesource.com/
(May be used for SSL/TLS support) As an OpenSSL fork, it has the same
license as that.
libressl http://www.libressl.org/
(May be used for SSL/TLS support) As an OpenSSL fork, it has the same
license as that.
c-ares https://daniel.haxx.se/projects/c-ares/license.html
(Used for asynchronous name resolves) Uses an MIT license that is very
liberal and imposes no restrictions on any other library or part you
may link with.
zlib http://www.gzip.org/zlib/zlib_license.html
zlib http://www.zlib.net/zlib_license.html
(Used for compressed Transfer-Encoding support) Uses an MIT-style
license that shouldn't collide with any other library.
@ -73,12 +89,12 @@ MIT Kerberos http://web.mit.edu/kerberos/www/dist/
(May be used for GSS support) MIT licensed, that shouldn't collide
with any other parts.
Heimdal http://www.pdc.kth.se/heimdal/
Heimdal http://www.h5l.org
(May be used for GSS support) Heimdal is Original BSD licensed with
the announcement clause.
GNU GSS http://www.gnu.org/software/gss/
GNU GSS https://www.gnu.org/software/gss/
(May be used for GSS support) GNU GSS is GPL licensed. Note that you
may not distribute binary curl packages that uses this if you build
@ -105,10 +121,10 @@ libssh2 http://www.libssh2.org/
(Used for scp and sftp support) libssh2 uses a Modified BSD-style
license.
[1] = GPL - GNU General Public License: http://www.gnu.org/licenses/gpl.html
[2] = http://www.fsf.org/licenses/gpl-faq.html#GPLIncompatibleLibs details on
[1] = GPL - GNU General Public License: https://www.gnu.org/licenses/gpl.html
[2] = https://www.gnu.org/licenses/gpl-faq.html#GPLIncompatibleLibs details on
how to write such an exception to the GPL
[3] = LGPL - GNU Lesser General Public License:
http://www.gnu.org/licenses/lgpl.html
https://www.gnu.org/licenses/lgpl.html
[4] = MPL - Mozilla Public License:
http://www.mozilla.org/MPL/
https://www.mozilla.org/MPL/

View File

@ -33,7 +33,7 @@ MAIL ETIQUETTE
1.1 Mailing Lists
The mailing lists we have are all listed and described at
http://curl.haxx.se/mail/
https://curl.haxx.se/mail/
Each mailing list is targeted to a specific set of users and subjects,
please use the one or the ones that suit you the most.
@ -230,7 +230,7 @@ MAIL ETIQUETTE
Quote as little as possible. Just enough to provide the context you cannot
leave out. A lengthy description can be found here:
http://www.netmeister.org/news/learn2quote.html
https://www.netmeister.org/news/learn2quote.html
2.7 Digest

View File

@ -3,7 +3,7 @@ LATEST VERSION
You always find news about what's going on as well as the latest versions
from the curl web pages, located at:
http://curl.haxx.se
https://curl.haxx.se
SIMPLE USAGE
@ -470,8 +470,8 @@ COOKIES
stored cookies which match the request as it follows the location. The
file "empty.txt" may be a nonexistent file.
Alas, to both read and write cookies from a netscape cookie file, you can
set both -b and -c to use the same file:
To read and write cookies from a netscape cookie file, you can set both -b
and -c to use the same file:
curl -b cookies.txt -c cookies.txt www.example.com
@ -824,7 +824,7 @@ LDAP
Working with LDAP URLs":
http://developer.netscape.com/docs/manuals/dirsdk/csdk30/url.htm
RFC 2255, "The LDAP URL Format" http://curl.haxx.se/rfc/rfc2255.txt
RFC 2255, "The LDAP URL Format" https://curl.haxx.se/rfc/rfc2255.txt
To show you an example, this is how I can get all people from my local LDAP
server that has a certain sub-domain in their email address:
@ -1011,7 +1011,7 @@ MAILING LISTS
For your convenience, we have several open mailing lists to discuss curl,
its development and things relevant to this. Get all info at
http://curl.haxx.se/mail/. Some of the lists available are:
https://curl.haxx.se/mail/. Some of the lists available are:
curl-users

View File

@ -5,11 +5,11 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 1998 - 2016, 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.
# are also available at https://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
@ -33,22 +33,22 @@ SUBDIRS = examples libcurl
CLEANFILES = $(GENHTMLPAGES) $(PDFPAGES)
EXTRA_DIST = MANUAL BUGS CONTRIBUTE FAQ FEATURES INTERNALS SSLCERTS \
README.win32 RESOURCES TODO TheArtOfHttpScripting THANKS VERSIONS \
KNOWN_BUGS BINDINGS $(man_MANS) $(HTMLPAGES) HISTORY INSTALL \
$(PDFPAGES) LICENSE-MIXING README.netware DISTRO-DILEMMA INSTALL.devcpp \
MAIL-ETIQUETTE HTTP-COOKIES LIBCURL-STRUCTS SECURITY RELEASE-PROCEDURE \
SSL-PROBLEMS
EXTRA_DIST = MANUAL BUGS CONTRIBUTE FAQ FEATURES INTERNALS SSLCERTS \
README.win32 RESOURCES TODO TheArtOfHttpScripting THANKS VERSIONS \
KNOWN_BUGS BINDINGS $(man_MANS) $(HTMLPAGES) HISTORY INSTALL \
$(PDFPAGES) LICENSE-MIXING README.netware INSTALL.devcpp \
MAIL-ETIQUETTE HTTP-COOKIES SECURITY RELEASE-PROCEDURE SSL-PROBLEMS \
HTTP2.md ROADMAP.md CODE_OF_CONDUCT.md CODE_STYLE.md
MAN2HTML= roffit < $< >$@
SUFFIXES = .1 .html .pdf
html: $(HTMLPAGES)
cd libcurl; make html
cd libcurl && make html
pdf: $(PDFPAGES)
cd libcurl; make pdf
cd libcurl && make pdf
.1.html:
$(MAN2HTML)

View File

@ -1,9 +1,3 @@
_ _ ____ _
___| | | | _ \| |
/ __| | | | |_) | |
| (__| |_| | _ <| |___
\___|\___/|_| \_\_____|
curl release procedure - how to do a release
============================================
@ -17,8 +11,8 @@ in the source code repo
- make sure all relevant changes are committed on the master branch
- tag the git repo in this style: `git tag -a curl-7_34_0`. -a annotates the
tag and we use underscores instead of dots in the version number.
tag and we use underscores instead of dots in the version number.
- run "./maketgz 7.34.0" to build the release tarballs. It is important that
you run this on a machine with the correct set of autotools etc installed
as this is what then will be shipped and used by most users on *nix like
@ -84,11 +78,10 @@ Coming dates
Based on the description above, here are some planned release dates (at the
time of this writing):
- November 5, 2014 (version 7.39.0)
- December 31, 2014
- February 25, 2015
- April 22, 2015
- June 17, 2015
- August 12, 2015
- October 7, 2015
- October 7, 2015 (version 7.45.0)
- December 2, 2015
- January 27, 2016
- March 23, 2016
- May 18, 2016
- July 13, 2016
- September 7, 2016

View File

@ -36,7 +36,7 @@ This document lists documents and standards used by curl.
RFC 2109 - HTTP State Management Mechanism (cookie stuff)
- Also, read Netscape's specification at
http://curl.haxx.se/rfc/cookie_spec.html
https://curl.haxx.se/rfc/cookie_spec.html
RFC 2183 - The Content-Disposition Header Field

View File

@ -5,44 +5,94 @@ Roadmap of things Daniel Stenberg and Steve Holme want to work on next. It is
intended to serve as a guideline for others for information, feedback and
possible participation.
New stuff - libcurl
HTTP/2
------
- test suite
Base this on existing nghttp2 server to start with to make functional
tests. Later on we can adopt that code or work with nghttp2 to provide ways
to have the http2 server respond with broken responses to make sure we deal
with that nicely as well.
To decide: if we need to bundle parts of the nghttp2 stuff that probably
won't be shipped by many distros.
- provide option for HTTP/2 "prior knowledge" over clear text
As it would avoid the roundtrip-heavy Upgrade: procedures when you _know_
it speaks HTTP/2.
HTTP cookies
------------
Two cookie drafts have been adopted by the httpwg in IETF and we should
support them as the popular browsers will as well:
[Deprecate modification of 'secure' cookies from non-secure
origins](https://tools.ietf.org/html/draft-ietf-httpbis-cookie-alone-00)
[Cookie Prefixes](https://tools.ietf.org/html/draft-ietf-httpbis-cookie-prefixes-00)
[Firefox bug report about secure cookies](https://bugzilla.mozilla.org/show_bug.cgi?id=976073)
SRV records
-----------
How to find services for specific domains/hosts.
HTTPS to proxy
--------------
To avoid network traffic to/from the proxy getting snooped on. There's a git
branch in the public git repository for this that we need to make sure works
for all TLS backends and then merge!
curl_formadd()
--------------
make sure there's an easy handle passed in to `curl_formadd()`,
`curl_formget()` and `curl_formfree()` by adding replacement functions and
deprecating the old ones to allow custom mallocs and more
third-party SASL
----------------
add support for third-party SASL libraries such as Cyrus SASL - may need to
move existing native and SSPI based authentication into vsasl folder after
reworking HTTP and SASL code
SASL authentication in LDAP
---------------------------
...
Simplify the SMTP email
-----------------------
Simplify the SMTP email interface so that programmers don't have to
construct the body of an email that contains all the headers, alternative
content, images and attachments - maintain raw interface so that
programmers that want to do this can
email capabilities
------------------
Allow the email protocols to return the capabilities before
authenticating. This will allow an application to decide on the best
authentication mechanism
Win32 pthreads
--------------
Allow Windows threading model to be replaced by Win32 pthreads port
dynamic buffer size
-------------------
1. HTTP/2
- test suite
- http2 multiplexing/pipelining
- provide option for HTTP/2 "prior knowledge" over clear text
- provide option to allow curl to default to HTTP/2 only when using HTTPS
2. SRV records
3. HTTPS to proxy
4. make sure there's an easy handle passed in to `curl_formadd()`,
`curl_formget()` and `curl_formfree()` by adding replacement functions and
deprecating the old ones to allow custom mallocs and more
5. add support for third-party SASL libraries such as Cyrus SASL - may need to
move existing native and SSPI based authentication into vsasl folder after
reworking HTTP and SASL code
6. SASL authentication in LDAP
7. Simplify the SMTP email interface so that programmers don't have to
construct the body of an email that contains all the headers, alternative
content, images and attachments - maintain raw interface so that
programmers that want to do this can
8. Allow the email protocols to return the capabilities before
authenticating. This will allow an application to decide on the best
authentication mechanism
9. Allow Windows threading model to be replaced by Win32 pthreads port
10. Implement a dynamic buffer size to allow SFTP to use much larger buffers
and possibly allow the size to be customizable by applications. Use less
memory when handles are not in use?
Implement a dynamic buffer size to allow SFTP to use much larger buffers and
possibly allow the size to be customizable by applications. Use less memory
when handles are not in use?
New stuff - curl
----------------
@ -61,7 +111,7 @@ Improve
2. curl -h output (considered overwhelming to users)
3. we have > 160 command line options, is there a way to redo things to
3. we have > 170 command line options, is there a way to redo things to
simplify or improve the situation as we are likely to keep adding
features/options in the future too

View File

@ -14,7 +14,7 @@ Publishing Information
----------------------
All known and public curl or libcurl related vulnerabilities are listed on
[the curl web site security page](http://curl.haxx.se/docs/security.html).
[the curl web site security page](https://curl.haxx.se/docs/security.html).
Security vulnerabilities should not be entered in the project's public bug
tracker unless the necessary configuration is in place to limit access to the

View File

@ -26,7 +26,7 @@ CA bundle missing intermediate certificates
problems if your CA cert does not have the certificates for the
intermediates in the whole trust chain.
SSL version
Protocol version
Some broken servers fail to support the protocol negotiation properly that
SSL servers are supposed to handle. This may cause the connection to fail
@ -36,7 +36,9 @@ SSL version
An additional complication can be that modern SSL libraries sometimes are
built with support for older SSL and TLS versions disabled!
SSL ciphers
All versions of SSL are considered insecure and should be avoided. Use TLS.
Ciphers
Clients give servers a list of ciphers to select from. If the list doesn't
include any ciphers the server wants/can use, the connection handshake
@ -51,10 +53,14 @@ SSL ciphers
Note that these weak ciphers are identified as flawed. For example, this
includes symmetric ciphers with less than 128 bit keys and RC4.
WinSSL in Windows XP is not able to connect to servers that no longer
support the legacy handshakes and algorithms used by those versions, so we
advice against building curl to use WinSSL on really old Windows versions.
References:
http://tools.ietf.org/html/draft-popov-tls-prohibiting-rc4-01
https://tools.ietf.org/html/draft-popov-tls-prohibiting-rc4-01
Allow BEAST
BEAST is the name of a TLS 1.0 attack that surfaced 2011. When adding means
@ -65,3 +71,17 @@ Allow BEAST
introduced. Exactly as it sounds, it re-introduces the BEAST vulnerability
but on the other hand it allows curl to connect to that kind of strange
servers.
Disabling certificate revocation checks
Some SSL backends may do certificate revocation checks (CRL, OCSP, etc)
depending on the OS or build configuration. The --ssl-no-revoke option was
introduced in 7.44.0 to disable revocation checking but currently is only
supported for WinSSL (the native Windows SSL library), with an exception in
the case of Windows' Untrusted Publishers blacklist which it seems can't be
bypassed. This option may have broader support to accommodate other SSL
backends in the future.
References:
https://curl.haxx.se/docs/ssl-compared.html

View File

@ -20,8 +20,8 @@ support.
It is about trust
-----------------
This system is about trust. In your local CA cert bundle you have certs from
*trusted* Certificate Authorities that you then can use to verify that the
This system is about trust. In your local CA certificate store you have certs
from *trusted* Certificate Authorities that you then can use to verify that the
server certificates you see are valid. They're signed by one of the CAs you
trust.
@ -35,16 +35,16 @@ Certificate Verification
------------------------
libcurl performs peer SSL certificate verification by default. This is done
by using CA cert bundle that the SSL library can use to make sure the peer's
server certificate is valid.
by using a CA certificate store that the SSL library can use to make sure the
peer's server certificate is valid.
If you communicate with HTTPS, FTPS or other TLS-using servers using
certificates that are signed by CAs present in the bundle, you can be sure
certificates that are signed by CAs present in the store, you can be sure
that the remote server really is the one it claims to be.
If the remote server uses a self-signed certificate, if you don't install a CA
cert bundle, if the server uses a certificate signed by a CA that isn't
included in the bundle you use or if the remote host is an impostor
cert store, if the server uses a certificate signed by a CA that isn't
included in the store you use or if the remote host is an impostor
impersonating your favorite site, and you want to transfer files from this
server, do one of the following:
@ -59,12 +59,22 @@ server, do one of the following:
With the curl command line tool: --cacert [file]
3. Add the CA cert for your server to the existing default CA cert bundle.
The default path of the CA bundle used can be changed by running configure
with the --with-ca-bundle option pointing out the path of your choice.
3. Add the CA cert for your server to the existing default CA certificate
store. The default CA certificate store can changed at compile time with the
following configure options:
To do this, you need to get the CA cert for your server in PEM format and
then append that to your CA cert bundle.
--with-ca-bundle=FILE: use the specified file as CA certificate store. CA
certificates need to be concatenated in PEM format into this file.
--with-ca-path=PATH: use the specified path as CA certificate store. CA
certificates need to be stored as individual PEM files in this directory.
You may need to run c_rehash after adding files there.
If neither of the two options is specified, configure will try to auto-detect
a setting. It's also possible to explicitly not hardcode any default store
but rely on the built in default the crypto library may provide instead.
You can achieve that by passing both --without-ca-bundle and
--without-ca-path to the configure script.
If you use Internet Explorer, this is one way to get extract the CA cert
for a particular server:
@ -76,7 +86,7 @@ server, do one of the following:
- Convert it from crt to PEM using the openssl tool:
openssl x509 -inform DES -in yourdownloaded.crt \
-out outcert.pem -text
- Append the 'outcert.pem' to the CA cert bundle or use it stand-alone
- Add the 'outcert.pem' to the CA certificate store or use it stand-alone
as described below.
If you use the 'openssl' tool, this is one way to get extract the CA cert
@ -89,9 +99,9 @@ server, do one of the following:
- If you want to see the data in the certificate, you can do: "openssl
x509 -inform PEM -in certfile -text -out certdata" where certfile is
the cert you extracted from logfile. Look in certdata.
- If you want to trust the certificate, you can append it to your
cert bundle or use it stand-alone as described. Just remember that the
security is no better than the way you obtained the certificate.
- If you want to trust the certificate, you can add it to your CA
certificate store or use it stand-alone as described. Just remember that
the security is no better than the way you obtained the certificate.
4. If you're using the curl command line tool, you can specify your own CA
cert path by setting the environment variable `CURL_CA_BUNDLE` to the path
@ -109,13 +119,13 @@ server, do one of the following:
5. Get a better/different/newer CA cert bundle! One option is to extract the
one a recent Firefox browser uses by running 'make ca-bundle' in the curl
build tree root, or possibly download a version that was generated this
way for you: [CA Extract](http://curl.haxx.se/docs/caextract.html)
way for you: [CA Extract](https://curl.haxx.se/docs/caextract.html)
Neglecting to use one of the above methods when dealing with a server using a
certificate that isn't signed by one of the certificates in the installed CA
cert bundle, will cause SSL to report an error ("certificate verify failed")
during the handshake and SSL will then refuse further communication with that
server.
certificate store, will cause SSL to report an error ("certificate verify
failed") during the handshake and SSL will then refuse further communication
with that server.
Certificate Verification with NSS
---------------------------------
@ -123,8 +133,8 @@ Certificate Verification with NSS
If libcurl was built with NSS support, then depending on the OS distribution,
it is probably required to take some additional steps to use the system-wide
CA cert db. RedHat ships with an additional module, libnsspem.so, which
enables NSS to read the OpenSSL PEM CA bundle. This library is missing in
OpenSuSE, and without it, NSS can only work with its own internal formats. NSS
enables NSS to read the OpenSSL PEM CA bundle. On openSUSE you can install
p11-kit-nss-trust which makes NSS use the system wide CA certificate store. NSS
also has a new [database format](https://wiki.mozilla.org/NSS_Shared_DB).
Starting with version 7.19.7, libcurl automatically adds the 'sql:' prefix to

View File

@ -36,10 +36,13 @@ Alex Suykov
Alex Vinnik
Alex aka WindEagle
Alexander Beedie
Alexander Dyagilev
Alexander Elgert
Alexander Klauer
Alexander Kourakos
Alexander Krasnostavsky
Alexander Lazic
Alexander Pepper
Alexander Peslyak
Alexander Zhuravlev
Alexey Borzov
@ -53,6 +56,7 @@ Alona Rossen
Amol Pattekar
Amr Shahin
Anatoli Tubman
Anders Bakken
Anders Gustafsson
Anders Havn
Andi Jahja
@ -88,6 +92,7 @@ Andy Serpa
Andy Tsouladze
Angus Mackay
Anthon Pang
Anthony Avina
Anthony Bryan
Anthony G. Basile
Antoine Calando
@ -102,6 +107,7 @@ Arnaud Ebalard
Arthur Murray
Arve Knudsen
Arvid Norberg
Ashish Shukla
Ask Bjørn Hansen
Askar Safin
Ates Goral
@ -125,11 +131,15 @@ Benbuck Nason
Benjamin Gerard
Benjamin Gilbert
Benjamin Johnson
Benjamin Kircher
Benoit Neil
Benoit Sigoure
Bernard Leak
Bernard Spil
Bernhard Reutner-Fischer
Bert Huijben
Bertrand Demiddelaer
Bertrand Simonnet
Bill Doyle
Bill Egert
Bill Hoffman
@ -145,6 +155,7 @@ Bob Richmond
Bob Schader
Bogdan Nicula
Brad Burdick
Brad Fitzpatrick
Brad Harder
Brad Hards
Brad King
@ -155,8 +166,10 @@ Brandon Wang
Brendan Jurd
Brent Beardsley
Brian Akins
Brian Chrisman
Brian Dessent
Brian J. Murrell
Brian Prodoehl
Brian R Duffy
Brian Ulm
Brock Noland
@ -176,9 +189,11 @@ Catalin Patulea
Chad Monroe
Chandrakant Bagul
Charles Kerr
Charles Romestant
Chen Prog
Chih-Chung Chang
Chris "Bob Bob"
Chris Araman
Chris Combes
Chris Conlon
Chris Deidun
@ -194,6 +209,7 @@ Christian Krause
Christian Kurz
Christian Robottom Reis
Christian Schmitz
Christian Stewart
Christian Vogt
Christian Weisgerber
Christophe Demory
@ -207,6 +223,7 @@ Claes Jakobsson
Clarence Gardner
Clemens Gruber
Clifford Wolf
Clint Clayton
Cody Jones
Cody Mack
Colby Ranger
@ -223,8 +240,10 @@ Cris Bailiff
Cristian Rodríguez
Curt Bogmine
Cyrill Osterwalder
Cédric Connes
Cédric Deltheil
D. Flinkmann
Da-Yoon Chung
Dag Ekengren
Dagobert Michelsen
Damian Dixon
@ -240,8 +259,15 @@ Dan Zitter
Daniel Black
Daniel Cater
Daniel Egger
Daniel Hwang
Daniel Johnson
Daniel Kahn Gillmor
Daniel Lee Hwang
Daniel Melani
Daniel Mentz
Daniel Schauenberg
Daniel Seither
Daniel Shahaf
Daniel Steinberg
Daniel Stenberg
Daniel Theron
@ -255,7 +281,9 @@ Dave May
Dave Reisner
Dave Thompson
Dave Vasilevsky
Davey Shafik
David Bau
David Benjamin
David Binderman
David Blaikie
David Byron
@ -284,6 +312,7 @@ David Woodhouse
David Wright
David Yan
Dengminwen
Denis Feklushkin
Dennis Clarke
Derek Higgins
Detlef Schmier
@ -302,21 +331,25 @@ Dirk Manske
Dmitri Shubin
Dmitriy Sergeyev
Dmitry Bartsevich
Dmitry Eremin-Solenikov
Dmitry Falko
Dmitry Kurochkin
Dmitry Popov
Dmitry Rechkin
Dmitry S. Baikov
Dolbneff A.V
Domenico Andreoli
Dominick Meglio
Dominique Leuenberger
Doug Kaufman
Doug Porter
Douglas Creager
Douglas E. Wegscheid
Douglas Kilpatrick
Douglas R. Horner
Douglas Steinwand
Dov Murik
Drake Arconis
Duane Cathey
Duncan Mac-Vicar Prett
Dustin Boswell
@ -331,10 +364,12 @@ Edward Rudd
Edward Sheldrake
Eelco Dolstra
Eetu Ojanen
Egon Eckert
Eldar Zaitov
Ellis Pritchard
Elmira A Semenova
Emanuele Bovisio
Emil Lerner
Emil Romanus
Emiliano Ida
Enrico Scholz
@ -347,12 +382,14 @@ Eric Lubin
Eric Melville
Eric Mertens
Eric Rautman
Eric Ridge
Eric S. Raymond
Eric Thelin
Eric Vergnaud
Eric Wong
Eric Young
Erick Nuwendam
Erik Janssen
Erik Johansson
Ernest Beinrohr
Erwan Legrand
@ -367,12 +404,15 @@ Fabian Hiernaux
Fabian Keil
Fabrizio Ammollo
Fedor Karpelevitch
Feist Josselin
Felix Yan
Felix von Leitner
Feng Tu
Flavio Medeiros
Florian Schoppmann
Florian Weimer
Forrest Cahoon
Francisco Moraes
Frank Gevaerts
Frank Hempel
Frank Keeney
@ -385,6 +425,7 @@ François Charlier
Fred Machado
Fred New
Fred Noz
Fred Stluka
Frederic Lepied
Fredrik Thulin
Gabriel Kuri
@ -419,9 +460,11 @@ Glen A Johnson Jr.
Glen Nakamura
Glen Scott
Glenn Sheridan
Google Inc.
Gordon Marler
Gorilla Maguila
Grant Erickson
Grant Pannell
Greg Hewgill
Greg Morse
Greg Onufer
@ -434,12 +477,14 @@ Guido Berhoerster
Guillaume Arluison
Gunter Knauf
Gustaf Hui
Gustavo Grieco
Gwenole Beauchesne
Gökhan Şengün
Götz Babin-Ebell
Hamish Mackenzie
Hang Kin Lau
Hang Su
Hanno Böck
Hanno Kranzhoff
Hans Steegers
Hans-Jurgen May
@ -477,16 +522,20 @@ Iida Yosiaki
Ilguiz Latypov
Ilja van Sprundel
Immanuel Gregoire
Inca R
Ingmar Runge
Ingo Ralf Blum
Ingo Wilken
Isaac Boukris
Ishan SinghLevett
Ivo Bellin Salarin
Jack Zhang
Jacky Lam
Jacob Meuser
Jacob Moshenko
Jactry Zeng
Jad Chamcham
Jaime Fullaondo
Jakub Zakrzewski
James Bursa
James Cheng
@ -514,6 +563,7 @@ Jason Liu
Jason McDonald
Jason S. Priebe
Javier Barroso
Javier G. Sogo
Jay Austin
Jayesh A Shah
Jaz Fresh
@ -533,10 +583,13 @@ Jeff Lawson
Jeff Phillips
Jeff Pohlmeyer
Jeff Weber
Jeffrey Walton
Jens Rantil
Jeremy Friesner
Jeremy Huddleston
Jeremy Lin
Jeroen Koekkoek
Jeroen Ooms
Jerome Muffat-Meridol
Jerome Robert
Jerome Vouillon
@ -545,11 +598,13 @@ Jerry Wu
Jes Badwal
Jesper Jensen
Jesse Noller
Jesse Tan
Jie He
Jim Drash
Jim Freeman
Jim Hollinger
Jim Meyering
Jiri Dvorak
Jiri Hruska
Jiri Jaburek
Jiri Malak
@ -558,6 +613,7 @@ Joe Halpin
Joe Malicki
Joe Mason
Joel Chen
Joel Depooter
Jofell Gallardo
Johan Anderson
Johan Lantz
@ -565,6 +621,7 @@ Johan Nilsson
Johan van Selst
Johannes Bauer
Johannes Ernst
Johannes Schindelin
John Bradshaw
John Coffey
John Crow
@ -575,9 +632,12 @@ John Gardiner Myers
John Janssen
John Joseph Bachir
John Kelly
John Kohl
John Lask
John Levon
John Lightsey
John Marino
John Marshall
John McGowan
John P. McCaskey
John Suprock
@ -593,10 +653,12 @@ Jon Torrey
Jon Travis
Jon Turner
Jonas Forsman
Jonas Minnberg
Jonas Schnelli
Jonatan Lander
Jonatan Vela
Jonathan Cardoso Machado
Jonathan Cardoso Machado Machado
Jonathan Hseu
Jonathan Nieder
Jongki Suwandi
@ -620,6 +682,7 @@ Julien Nabet
Julien Royer
Jun-ichiro itojun Hagino
Jurij Smakov
Justin Ehlert
Justin Fletcher
Justin Karneges
Justin Maggard
@ -631,11 +694,13 @@ Kai Sommerfeld
Kai-Uwe Rommel
Kalle Vahlman
Kamil Dudka
Kang Lin
Kang-Jin Lee
Karl Moerder
Karol Pietrzak
Kaspar Brand
Katie Wang
Kazuho Oku
Kees Cook
Keith MacDonald
Keith McGuigan
@ -662,6 +727,7 @@ Krishnendu Majumdar
Krister Johansen
Kristian Gunstone
Kristian Köhntopp
Kurt Fankhauser
Kyle J. McKay
Kyle L. Huff
Kyle Sallee
@ -678,6 +744,7 @@ Lars Nilsson
Lars Torben Wilson
Lau Hang Kin
Laurent Rabret
Lauri Kasanen
Legoff Vincent
Lehel Bernadt
Leif W
@ -693,7 +760,9 @@ Linas Vepstas
Lindley French
Ling Thio
Linus Nielsen Feltzing
Lior Kaplan
Lisa Xu
Liviu Chircu
Liza Alenchery
Lluís Batlle i Rossell
Loic Dachary
@ -704,6 +773,8 @@ Lucas Adamski
Lucas Pardue
Ludek Finstrle
Ludovico Cavedon
Ludwig Nussel
Lukas Ruzicka
Lukasz Czekierda
Luke Amery
Luke Call
@ -714,6 +785,8 @@ Maciej Karpiuk
Maciej Puzio
Maciej W. Rozycki
Maks Naumov
Maksim Kuzevanov
Maksim Stsepanenka
Mamoru Tasaka
Mandy Wu
Manfred Schwarb
@ -747,6 +820,7 @@ Mark Salisbury
Mark Snelling
Mark Tully
Markus Duft
Markus Elfring
Markus Koetter
Markus Moeller
Markus Oberhumer
@ -775,6 +849,7 @@ Matt Wixson
Matteo Rocco
Matthew Blain
Matthew Clarke
Matthew Hall
Matthias Bolte
Maurice Barnum
Mauro Iorio
@ -795,17 +870,23 @@ Michael Day
Michael Goffioul
Michael Jahn
Michael Jerris
Michael Kalinin
Michael Kaufmann
Michael König
Michael Mealling
Michael Mueller
Michael Osipov
Michael Smith
Michael Stapelberg
Michael Stillwell
Michael Wallner
Michal Bonino
Michal Marek
Michał Fita
Michał Górny
Michał Kowalczyk
Michał Piechowski
Michel Promonet
Michele Bini
Miguel Angel
Miguel Diaz
@ -829,12 +910,14 @@ Mitz Wark
Mohamed Lrhazi
Mohammad AlSaleh
Mohun Biswas
Mostyn Bramley-Moore
Myk Taylor
Nach M. S.
Nagai H
Nathan Coulter
Nathan O'Sullivan
Nathanael Nerode
Nathaniel Waisbrot
Naveen Chandran
Naveen Noel
Neil Bowers
@ -861,16 +944,22 @@ Nis Jorgensen
Nobuhiro Ban
Nodak Sodak
Norbert Frese
Norbert Kett
Norbert Novotny
Octavio Schroeder
Ofer
Ola Mork
Olaf Flebbe
Olaf Stüben
Oliver Gondža
Oliver Graute
Oliver Kuckertz
Oliver Schindler
Olivier Berger
Orange Tsai
Oren Souroujon
Oren Tirosh
Orgad Shaneh
Ori Avtalion
Oscar Koeroo
Oscar Norlander
@ -886,6 +975,7 @@ Patricia Muscalu
Patrick Bihan-Faou
Patrick McManus
Patrick Monnerat
Patrick Rapin
Patrick Scott
Patrick Smith
Patrick Watson
@ -898,6 +988,7 @@ Paul Marks
Paul Marquis
Paul Moore
Paul Nolan
Paul Oliver
Paul Querna
Paul Saab
Pavel Cenek
@ -914,6 +1005,7 @@ Peter Heuchert
Peter Hjalmarsson
Peter Korsgaard
Peter Lamberg
Peter Laser
Peter O'Gorman
Peter Pentchev
Peter Silva
@ -953,12 +1045,15 @@ Quanah Gibson-Mount
Quinn Slack
Radu Simionescu
Rafa Muyo
Rafael Antonio
Rafael Sagula
Rafayel Mkrtchyan
Rafaël Carré
Rainer Canavan
Rainer Jung
Rainer Koenig
Rajesh Naganathan
Rajkumar Mandal
Ralf S. Engelschall
Ralph Beckmann
Ralph Mitchell
@ -968,6 +1063,7 @@ Ravi Pratap
Ray Dassen
Ray Pekowski
Ray Satiro
Razvan Cojocaru
Reinout van Schouwen
Remi Gacogne
Renato Botelho
@ -988,10 +1084,12 @@ Richard Bramante
Richard Clayton
Richard Cooper
Richard Gorton
Richard Hosking
Richard Michael
Richard Moore
Richard Prescott
Richard Silverman
Richard van den Berg
Rick Jones
Rick Richardson
Rob Crittenden
@ -1015,6 +1113,7 @@ Robson Braga Araujo
Rodney Simmons
Rodric Glaser
Rodrigo Silva
Roger Leigh
Roland Blom
Roland Krikava
Roland Zimmermann
@ -1039,6 +1138,7 @@ Salvador Dávila
Salvatore Sorrentino
Sam Deane
Sam Hurst
Sam Roth
Sam Schanken
Sampo Kellomaki
Samuel Díaz García
@ -1057,18 +1157,22 @@ Scott Barrett
Scott Cantor
Scott Davis
Scott McCreary
Sean Boudreau
Sebastian Pohlschmidt
Sebastian Rasmussen
Senthil Raja Velu
Sergei Nikulov
Sergey Tatarincev
Sergio Ballestrero
Seshubabu Pasam
Seth Mos
Sh Diao
Shao Shuchao
Sharad Gupta
Shard
Shawn Landden
Shawn Poulson
Shine Fan
Shmulik Regev
Siddhartha Prakash Jain
Sidney San Martin
@ -1085,6 +1189,7 @@ Stadler Stephan
Stan van de Burgt
Stanislav Ivochkin
Stefan Bühler
Stefan Eissing
Stefan Esser
Stefan Krause
Stefan Neis
@ -1099,6 +1204,7 @@ Stephen More
Sterling Hughes
Steve Green
Steve H Truong
Steve Havelka
Steve Holme
Steve Lhomme
Steve Little
@ -1115,22 +1221,28 @@ Sune Ahlgren
Sven Anders
Sven Neuhaus
Sven Wegener
Svyatoslav Mishyn
Symeon Paraschoudis
Sébastien Willemijns
T. Bharath
T. Yamada
TJ Saunders
Tae Hyoung Ahn
Taneli Vahakangas
Tanguy Fautre
Tatsuhiro Tsujikawa
Temprimus
Terri Oda
Thomas Braun
Thomas Glanzmann
Thomas J. Moore
Thomas Klausner
Thomas L. Shinnick
Thomas Lopatic
Thomas Ruecker
Thomas Schwinge
Thomas Tonino
Thorsten Schöning
Tiit Pikma
Till Maas
Tim Ansell
@ -1141,17 +1253,19 @@ Tim Costello
Tim Harder
Tim Heckman
Tim Newsome
Tim Ruehsen
Tim Rühsen
Tim Sneddon
Tim Stack
Tim Starling
Timo Sirainen
Timotej Lazar
Tinus van den Berg
Tobias Markus
Tobias Rundström
Tobias Stoeckmann
Toby Peterson
Todd A Ouska
Todd Kulesza
Todd Ouska
Todd Vierling
Tom Benoist
Tom Donovan
@ -1168,6 +1282,7 @@ Tomas Hoger
Tomas Mlcoch
Tomas Pospisek
Tomas Szepe
Tomas Tomecek
Tomasz Kojm
Tomasz Lacki
Tommie Gannert
@ -1195,6 +1310,7 @@ Victor Snezhko
Vijay Panghal
Vikram Saxena
Viktor Szakáts
Ville Skyttä
Vilmos Nebehaj
Vincent Bronner
Vincent Le Normand
@ -1209,6 +1325,7 @@ Vojtech Janota
Vojtech Minarik
Vojtěch Král
Vsevolod Novikov
W. Mark Kubacki
Waldek Kozba
Walter J. Mack
Ward Willats
@ -1226,7 +1343,9 @@ Wojciech Zwiefka
Wouter Van Rooy
Wu Yongzheng
Xavier Bouchoux
Xiangbin Li
Yaakov Selkowitz
Yamada Yasuharu
Yang Tse
Yarram Sunil
Yasuharu Yamada
@ -1247,4 +1366,5 @@ Zvi Har'El
nk
swalkaus at yahoo.com
tommink[at]post.pl
Štefan Kremeň
Никита Дорохин

View File

@ -33,7 +33,8 @@ s/Nick Zitzmann (originally)/Nick Zitzmann/
s/product-security at Apple//
s/IT DOES NOT WORK//
s/Albert Chin/Albert Chin-A-Young/
s/Paras S/Paras Sethia/
s/Paras S\z/Paras Sethia/
s/Paras Sethiaethia/Paras Sethia/
s/Дмитрий Фалько/Dmitry Falko/
s/byte_bucket in the #curl IRC channel//
s/Michal Górny and Anthony G. Basile//
@ -47,3 +48,8 @@ s/Rodrigo Silva (MestreLion)/Rodrigo Silva/
s/tetetest tetetest//
s/Jiří Hruška/Jiri Hruska/
s/Viktor Szakats/Viktor Szakáts/
s/Jonathan Cardoso/Jonathan Cardoso Machado/
s/Linus Nielsen/Linus Nielsen Feltzing/
s/Todd Ouska$/Todd A Ouska/
s/Tim Ruehsen/Tim Rühsen/
s/Michael Koenig/Michael König/

270
docs/TODO
View File

@ -9,6 +9,11 @@
Things to do in project cURL. Please tell us what you think, contribute and
send us patches that improve things!
Be aware that these are things that we could do, or have once been considered
things we could do. If you want to work on any of these areas, please
consider bringing it up for discussions first on the mailing list so that we
all agree it is still a good idea for the project!
All bugs documented in the KNOWN_BUGS document are subject for fixing!
1. libcurl
@ -20,11 +25,19 @@
1.7 Detect when called from within callbacks
1.8 Allow SSL (HTTPS) to proxy
1.9 Cache negative name resolves
1.10 Support IDNA2008
1.11 minimize dependencies with dynamicly loaded modules
1.12 have form functions use CURL handle argument
1.13 Add CURLOPT_MAIL_CLIENT option
1.14 Typesafe curl_easy_setopt()
1.15 TCP Fast Open
1.16 Try to URL encode given URL
2. libcurl - multi interface
2.1 More non-blocking
2.2 Fix HTTP Pipelining for PUT
2.3 Better support for same name resolves
2.2 Better support for same name resolves
2.3 Non-blocking curl_multi_remove_handle()
2.4 Split connect and authentication process
3. Documentation
3.1 Update date and version in man pages
@ -44,6 +57,8 @@
5.3 Rearrange request header order
5.4 SPDY
5.5 auth= in URLs
5.6 Refuse "downgrade" redirects
5.7 More compressions
6. TELNET
6.1 ditch stdin
@ -54,22 +69,23 @@
7. SMTP
7.1 Pipelining
7.2 Enhanced capability support
8. POP3
8.1 Pipelining
8.2 Enhanced capability support
9. IMAP
9.1 Enhanced capability support
10. LDAP
10.1 SASL based authentication mechanisms
11. SMB
11.1 File listing support
11.2 Honor file timestamps
11.3 Use NTLMv2
11.4 Create remote directories
12. New protocols
12.1 RSYNC
@ -95,14 +111,20 @@
16. SASL
16.1 Other authentication mechanisms
16.2 Add QOP support to GSSAPI authentication
17. Client
17. Command line tool
17.1 sync
17.2 glob posts
17.3 prevent file overwriting
17.4 simultaneous parallel transfers
17.5 provide formpost headers
17.6 warning when setting an option
17.7 warning when sending binary output to terminal
17.8 offer color-coded HTTP header output
17.9 Choose the name of file in braces for complex URLs
17.10 improve how curl works in a windows console window
17.11 -w output to stderr
17.12 keep running, read instructions from pipe/socket
18. Build
18.1 roffit
@ -113,6 +135,7 @@
19.3 more protocols supported
19.4 more platforms supported
19.5 Add support for concurrent connections
19.6 Use the RFC6265 test suite
20. Next SONAME bump
20.1 http-style HEAD output for FTP
@ -128,8 +151,6 @@
21.6 remove CURLOPT_DNS_USE_GLOBAL_CACHE
21.7 remove progress meter from libcurl
21.8 remove 'curl_httppost' from public
21.9 have form functions use CURL handle argument
21.10 Add CURLOPT_MAIL_CLIENT option
==============================================================================
@ -154,7 +175,7 @@
signal handler back into the library with a sigsetjmp, which effectively
causes libcurl to continue running within the signal handler. This is
non-portable and could cause problems on some platforms. A discussion on the
problem is available at http://curl.haxx.se/mail/lib-2008-09/0197.html
problem is available at https://curl.haxx.se/mail/lib-2008-09/0197.html
Also, alarm() provides timeout resolution only to the nearest second. alarm
ought to be replaced by setitimer on systems that support it.
@ -199,7 +220,7 @@
To prevent local users from snooping on your traffic to the proxy. Supported
by Chrome already:
http://www.chromium.org/developers/design-documents/secure-web-proxy
https://www.chromium.org/developers/design-documents/secure-web-proxy
...and by Firefox soon:
https://bugzilla.mozilla.org/show_bug.cgi?id=378637
@ -209,6 +230,72 @@
A name resolve that has failed is likely to fail when made again within a
short period of time. Currently we only cache positive responses.
1.10 Support IDNA2008
International Domain Names are supported in libcurl since years back, powered
by libidn. libidn implements IDNA2003 which has been superseded by IDNA2008.
libidn2 is an existing library offering support for IDNA2008.
1.11 minimize dependencies with dynamicly loaded modules
We can create a system with loadable modules/plug-ins, where these modules
would be the ones that link to 3rd party libs. That would allow us to avoid
having to load ALL dependencies since only the necessary ones for this
app/invoke/used protocols would be necessary to load. See
https://github.com/curl/curl/issues/349
1.12 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.
The curl_formadd() design can probably also be reconsidered to make it easier
to use and less error-prone. Probably easiest by splitting it into several
function calls.
1.13 Add CURLOPT_MAIL_CLIENT option
Rather than use the URL to specify the mail client string to present in the
HELO and EHLO commands, libcurl should support a new CURLOPT specifically for
specifying this data as the URL is non-standard and to be honest a bit of a
hack ;-)
Please see the following thread for more information:
https://curl.haxx.se/mail/lib-2012-05/0178.html
1.14 Typesafe curl_easy_setopt()
One of the most common problems in libcurl using applications is the lack of
type checks for curl_easy_setopt() which happens because it accepts varargs
and thus can take any type.
One possible solution to this is to introduce a few different versions of the
setopt version for the different kinds of data you can set.
curl_easy_set_num() - sets a long value
curl_easy_set_large() - sets a curl_off_t value
curl_easy_set_ptr() - sets a pointer
curl_easy_set_cb() - sets a callback PLUS its callback data
1.15 TCP Fast Open
RFC 7413 defines how to include data already in the TCP SYN handshake to
reduce latency.
1.16 Try to URL encode given URL
Given a URL that for example contains spaces, libcurl could have an option
that would try somewhat harder than it does now and convert spaces to %20 and
perhaps URL encoded byte values over 128 etc (basically do what the redirect
following code already does).
https://github.com/curl/curl/issues/514
2. libcurl - multi interface
@ -226,13 +313,7 @@
- The "DONE" operation (post transfer protocol-specific actions) for the
protocols SFTP, SMTP, FTP. Fixing Curl_done() for this is a worthy task.
2.2 Fix HTTP Pipelining for PUT
HTTP Pipelining can be a way to greatly enhance performance for multiple
serial requests and currently libcurl only supports that for HEAD and GET
requests but it should also be possible for PUT.
2.3 Better support for same name resolves
2.2 Better support for same name resolves
If a name resolve has been initiated for name NN and a second easy handle
wants to resolve that name as well, make it wait for the first resolve to end
@ -240,6 +321,20 @@
especially needed when adding many simultaneous handles using the same host
name when the DNS resolver can get flooded.
2.3 Non-blocking curl_multi_remove_handle()
The multi interface has a few API calls that assume a blocking behavior, like
add_handle() and remove_handle() which limits what we can do internally. The
multi API need to be moved even more into a single function that "drives"
everything in a non-blocking manner and signals when something is done. A
remove or add would then only ask for the action to get started and then
multi_perform() etc still be called until the add/remove is completed.
2.4 Split connect and authentication process
The multi interface treats the authentication process as part of the connect
phase. As such any failures during authentication won't trigger the relevant
QUIT or LOGOFF for protocols such as IMAP, POP3 and SMTP.
3. Documentation
@ -256,14 +351,14 @@
HOST is a command for a client to tell which host name to use, to offer FTP
servers named-based virtual hosting:
http://tools.ietf.org/html/rfc7151
https://tools.ietf.org/html/rfc7151
4.2 Alter passive/active on failure and retry
When trying to connect passively to a server which only supports active
connections, libcurl returns CURLE_FTP_WEIRD_PASV_REPLY and closes the
connection. There could be a way to fallback to an active connection (and
vice versa). http://curl.haxx.se/bug/feature.cgi?id=1754793
vice versa). https://curl.haxx.se/bug/feature.cgi?id=1754793
4.3 Earlier bad letter detection
@ -300,13 +395,13 @@ This is not detailed in any FTP specification.
5.1 Better persistency for HTTP 1.0
"Better" support for persistent connections over HTTP 1.0
http://curl.haxx.se/bug/feature.cgi?id=1089001
https://curl.haxx.se/bug/feature.cgi?id=1089001
5.2 support FF3 sqlite cookie files
Firefox 3 is changing from its former format to a a sqlite database instead.
We should consider how (lib)curl can/should support this.
http://curl.haxx.se/bug/feature.cgi?id=1871388
https://curl.haxx.se/bug/feature.cgi?id=1871388
5.3 Rearrange request header order
@ -336,10 +431,26 @@ This is not detailed in any FTP specification.
For example:
http://test:pass;auth=NTLM@example.com would be equivalent to specifying --user
test:pass;auth=NTLM or --user test:pass --ntlm from the command line.
test:pass;auth=NTLM or --user test:pass --ntlm from the command line.
Additionally this should be implemented for proxy base URLs as well.
5.6 Refuse "downgrade" redirects
See https://github.com/curl/curl/issues/226
Consider a way to tell curl to refuse to "downgrade" protocol with a redirect
and/or possibly a bit that refuses redirect to change protocol completely.
5.7 More compressions
Compression algorithms that perform better than gzip are being considered for
use and inclusion in existing browsers. For example 'brotli'. If servers
follow along it is a good reason for us to also allow users to take advantage
of this. The algorithm: https://github.com/google/brotli The Firefox bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=366559
6. TELNET
6.1 ditch stdin
@ -412,12 +523,17 @@ be the same as/similar to FTP.
11.2 Honor file timestamps
The timestamp of the transfered file should reflect that of the original file.
The timestamp of the transferred file should reflect that of the original file.
11.3 Use NTLMv2
Currently the SMB authentication uses NTLMv1.
11.4 Create remote directories
Support for creating remote directories when uploading a file to a directory
that doesn't exist on the server, just like --ftp-create-dirs.
12. New protocols
12.1 RSYNC
@ -430,7 +546,7 @@ Currently the SMB authentication uses NTLMv1.
13.1 Disable specific versions
Provide an option that allows for disabling specific SSL versions, such as
SSLv2 http://curl.haxx.se/bug/feature.cgi?id=1767276
SSLv2 https://curl.haxx.se/bug/feature.cgi?id=1767276
13.2 Provide mutex locking API
@ -441,7 +557,7 @@ Currently the SMB authentication uses NTLMv1.
13.3 Evaluate SSL patches
Evaluate/apply Gertjan van Wingerde's SSL patches:
http://curl.haxx.se/mail/lib-2004-03/0087.html
https://curl.haxx.se/mail/lib-2004-03/0087.html
13.4 Cache OpenSSL contexts
@ -476,12 +592,12 @@ Currently the SMB authentication uses NTLMv1.
DNS-Based Authentication of Named Entities (DANE) is a way to provide SSL
keys and certs over DNS using DNSSEC as an alternative to the CA model.
http://www.rfc-editor.org/rfc/rfc6698.txt
https://www.rfc-editor.org/rfc/rfc6698.txt
An initial patch was posted by Suresh Krishnaswamy on March 7th 2013
(http://curl.haxx.se/mail/lib-2013-03/0075.html) but it was a too simple
(https://curl.haxx.se/mail/lib-2013-03/0075.html) but it was a too simple
approach. See Daniel's comments:
http://curl.haxx.se/mail/lib-2013-03/0103.html . libunbound may be the
https://curl.haxx.se/mail/lib-2013-03/0103.html . libunbound may be the
correct library to base this development on.
14. GnuTLS
@ -506,7 +622,7 @@ Currently the SMB authentication uses NTLMv1.
Therefore support for the existing -E/--cert and --key options should be
implemented by supplying a custom certificate to the SChannel APIs, see:
- Getting a Certificate for Schannel
http://msdn.microsoft.com/en-us/library/windows/desktop/aa375447.aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/aa375447.aspx
15.2 Add support for custom server certificate validation
@ -517,7 +633,7 @@ Currently the SMB authentication uses NTLMv1.
Therefore support for the existing --cacert or --capath options should be
implemented by supplying a custom certificate to the SChannel APIs, see:
- Getting a Certificate for Schannel
http://msdn.microsoft.com/en-us/library/windows/desktop/aa375447.aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/aa375447.aspx
15.3 Add support for the --ciphers option
@ -528,7 +644,7 @@ Currently the SMB authentication uses NTLMv1.
Therefore support for the existing --ciphers option should be implemented
by mapping the OpenSSL/GnuTLS cipher suites to the SChannel APIs, see
- Specifying Schannel Ciphers and Cipher Strengths
http://msdn.microsoft.com/en-us/library/windows/desktop/aa380161.aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/aa380161.aspx
16. SASL
@ -536,7 +652,7 @@ Currently the SMB authentication uses NTLMv1.
Add support for other authentication mechanisms such as OLP,
GSS-SPNEGO and others.
16.2 Add QOP support to GSSAPI authentication
Currently the GSSAPI authentication only supports the default QOP of auth
@ -544,7 +660,7 @@ Currently the SMB authentication uses NTLMv1.
with integrity protection) and auth-conf (Authentication with integrity and
privacy protection).
17. Client
17. Command line tool
17.1 sync
@ -573,7 +689,7 @@ Currently the SMB authentication uses NTLMv1.
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
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. https://curl.haxx.se/bug/feature.cgi?id=1558595
17.5 provide formpost headers
@ -591,9 +707,54 @@ Currently the SMB authentication uses NTLMv1.
17.6 warning when setting an option
Display a warning when libcurl returns an error when setting an option.
This can be useful to tell when support for a particular feature hasn't been
compiled into the library.
Display a warning when libcurl returns an error when setting an option.
This can be useful to tell when support for a particular feature hasn't been
compiled into the library.
17.7 warning when sending binary output to terminal
Provide a way that prompts the user for confirmation before binary data is
sent to the terminal, much in the style 'less' does it.
17.8 offer color-coded HTTP header output
By offering different color output on the header name and the header
contents, they could be made more readable and thus help users working on
HTTP services.
17.9 Choose the name of file in braces for complex URLs
When using braces to download a list of URLs and you use complicated names
in the list of alternatives, it could be handy to allow curl to use other
names when saving.
Consider a way to offer that. Possibly like
{partURL1:name1,partURL2:name2,partURL3:name3} where the name following the
colon is the output name.
See https://github.com/curl/curl/issues/221
17.10 improve how curl works in a windows console window
If you pull the scrollbar when transferring with curl in a Windows console
window, the transfer is interrupted and can get disconnected. This can
probably be improved. See https://github.com/curl/curl/issues/322
17.11 -w output to stderr
-w is quite useful, but not to those of us who use curl without -o or -O
(such as for scripting through a higher level language). It would be nice to
have an option that is exactly like -w but sends it to stderr
instead. Proposed name: --write-stderr. See
https://github.com/curl/curl/issues/613
17.12 keep running, read instructions from pipe/socket
Provide an option that makes curl not exit after the last URL (or even work
without a given URL), and then make it read instructions passed on a pipe or
over a socket to make further instructions so that a second subsequent curl
invoke can talk to the still running instance and ask for transfers to get
done, and thus maintain its connection pool, DNS cache and more.
18. Build
@ -639,6 +800,16 @@ Currently the SMB authentication uses NTLMv1.
and thus the wait for connections loop is never entered to receive the second
connection.
19.6 Use the RFC6265 test suite
A test suite made for HTTP cookies (RFC 6265) by Adam Barth is available at
https://github.com/abarth/http-state/tree/master/tests
It'd be really awesome if someone would write a script/setup that would run
curl with that test suite and detect deviances. Ideally, that would even be
incorporated into our regular test suite.
20. Next SONAME bump
20.1 http-style HEAD output for FTP
@ -743,22 +914,3 @@ Currently the SMB authentication uses NTLMv1.
Changing them to return a private handle will benefit the implementation and
allow us much greater freedoms while still maintaining a solid API and ABI.
21.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.
21.10 Add CURLOPT_MAIL_CLIENT option
Rather than use the URL to specify the mail client string to present in the
HELO and EHLO commands, libcurl should support a new CURLOPT specifically for
specifying this data as the URL is non-standard and to be honest a bit of a
hack ;-)
Please see the following thread for more information:
http://curl.haxx.se/mail/lib-2012-05/0178.html

View File

@ -22,6 +22,8 @@ The Art Of Scripting HTTP Requests Using Curl
3. Fetch a page
3.1 GET
3.2 HEAD
3.3 Multiple URLs in a single command line
3.4 Multiple HTTP methods in a single command line
4. HTML forms
4.1 Forms explained
4.2 GET
@ -134,8 +136,8 @@ The Art Of Scripting HTTP Requests Using Curl
The Uniform Resource Locator format is how you specify the address of a
particular resource on the Internet. You know these, you've seen URLs like
http://curl.haxx.se or https://yourbank.com a million times. RFC 3986 is the
canonical spec.
https://curl.haxx.se or https://yourbank.com a million times. RFC 3986 is the
canonical spec. And yeah, the formal name is not URL, it is URI.
2.2 Host
@ -192,7 +194,6 @@ The Art Of Scripting HTTP Requests Using Curl
the associated response. The path is what is to the right side of the slash
that follows the host name and possibly port number.
3. Fetch a page
3.1 GET
@ -202,7 +203,7 @@ The Art Of Scripting HTTP Requests Using Curl
issues a GET request to the server and receives the document it asked for.
If you issue the command line
curl http://curl.haxx.se
curl https://curl.haxx.se
you get a web page returned in your terminal window. The entire HTML document
that that URL holds.
@ -223,6 +224,46 @@ The Art Of Scripting HTTP Requests Using Curl
may see a Content-Length: in the response headers, but there must not be an
actual body in the HEAD response.
3.3 Multiple URLs in a single command line
A single curl command line may involve one or many URLs. The most common case
is probably to just use one, but you can specify any amount of URLs. Yes
any. No limits. You'll then get requests repeated over and over for all the
given URLs.
Example, send two GETs:
curl http://url1.example.com http://url2.example.com
If you use --data to POST to the URL, using multiple URLs means that you send
that same POST to all the given URLs.
Example, send two POSTs:
curl --data name=curl http://url1.example.com http://url2.example.com
3.4 Multiple HTTP methods in a single command line
Sometimes you need to operate on several URLs in a single command line and do
different HTTP methods on each. For this, you'll enjoy the --next option. It
is basically a separator that separates a bunch of options from the next. All
the URLs before --next will get the same method and will get all the POST
data merged into one.
When curl reaches the --next on the command line, it'll sort of reset the
method and the POST data and allow a new set.
Perhaps this is best shown with a few examples. To send first a HEAD and then
a GET:
curl -I http://example.com --next http://example.com
To first send a POST and then a GET:
curl -d score=10 http://example.com/post.cgi --next http://example.com/results.html
4. HTML forms
4.1 Forms explained
@ -301,6 +342,10 @@ The Art Of Scripting HTTP Requests Using Curl
curl --data-urlencode "name=I am Daniel" http://www.example.com
If you repeat --data several times on the command line, curl will
concatenate all the given data pieces - and put a '&' symbol between each
data segment.
4.4 File Upload POST
Back in late 1995 they defined an additional way to post data over HTTP. It
@ -583,7 +628,13 @@ The Art Of Scripting HTTP Requests Using Curl
More about server certificate verification and ca cert bundles can be read
in the SSLCERTS document, available online here:
http://curl.haxx.se/docs/sslcerts.html
https://curl.haxx.se/docs/sslcerts.html
At times you may end up with your own CA cert store and then you can tell
curl to use that to verify the server's certificate:
curl --cacert ca-bundle.pem https://example.com/
11. Custom Request Elements
@ -693,7 +744,7 @@ The Art Of Scripting HTTP Requests Using Curl
14.1 Standards
RFC 2616 is a must to read if you want in-depth understanding of the HTTP
RFC 7230 is a must to read if you want in-depth understanding of the HTTP
protocol
RFC 3986 explains the URL syntax
@ -704,4 +755,4 @@ The Art Of Scripting HTTP Requests Using Curl
14.2 Sites
http://curl.haxx.se is the home of the cURL project
https://curl.haxx.se is the home of the cURL project

View File

@ -1,22 +1,18 @@
_ _ ____ _
___| | | | _ \| |
/ __| | | | |_) | |
| (__| |_| | _ <| |___
\___|\___/|_| \_\_____|
Version Numbers and Releases
============================
Curl is not only curl. Curl is also libcurl. They're actually individually
versioned, but they mostly follow each other rather closely.
The version numbering is always built up using the same system:
X.Y[.Z]
X.Y.Z
Where
X is main version number
Y is release number
Z is patch number
- X is main version number
- Y is release number
- Z is patch number
## Bumping numbers
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
@ -57,4 +53,4 @@ Version Numbers and Releases
release. It makes comparisons with greater than and less than work.
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

@ -9,7 +9,7 @@
.\" *
.\" * 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.
.\" * are also available at https://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

View File

@ -5,11 +5,11 @@
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" * Copyright (C) 1998 - 2016, 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.
.\" * are also available at https://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
@ -39,8 +39,7 @@ resume, Metalink, and more. As you will see below, the number of features will
make your head spin!
curl is powered by libcurl for all transfer-related features. See
.BR libcurl (3)
for details.
\fIlibcurl(3)\fP for details.
.SH URL
The URL syntax is protocol-dependent. You'll find a detailed description in
RFC 3986.
@ -172,10 +171,11 @@ a level of control).
.IP "-2, --sslv2"
(SSL) Forces curl to use SSL version 2 when negotiating with a remote SSL
server. Sometimes curl is built without SSLv2 support. SSLv2 is widely
considered insecure.
considered insecure (see RFC 6176).
.IP "-3, --sslv3"
(SSL) Forces curl to use SSL version 3 when negotiating with a remote SSL
server. Sometimes curl is built without SSLv3 support.
server. Sometimes curl is built without SSLv3 support. SSLv3 is widely
considered insecure (see RFC 7568).
.IP "-4, --ipv4"
This option tells curl to resolve names to IPv4 addresses only, and not for
example try IPv6.
@ -213,16 +213,25 @@ be in the format "NAME1=VALUE1; NAME2=VALUE2".
If no '=' symbol is used in the line, it is treated as a filename to use to
read previously stored cookie lines from, which should be used in this session
if they match. Using this method also activates the "cookie parser" which will
if they match. Using this method also activates the cookie engine which will
make curl record incoming cookies too, which may be handy if you're using this
in combination with the \fI-L, --location\fP option. The file format of the
file to read cookies from should be plain HTTP headers or the Netscape/Mozilla
cookie file format.
file to read cookies from should be plain HTTP headers (Set-Cookie style) or
the Netscape/Mozilla cookie file format.
The file specified with \fI-b, --cookie\fP is only used as input. No cookies
will be written to the file. To store cookies, use the \fI-c, --cookie-jar\fP
option.
Exercise caution if you are using this option and multiple transfers may occur.
If you use the NAME1=VALUE1; format, or in a file use the Set-Cookie format and
don't specify a domain, then the cookie is sent for any domain (even after
redirects are followed) and cannot be modified by a server-set cookie. If the
cookie engine is enabled and a server sets a cookie of the same name then both
will be sent on a future transfer to that server, likely not what you intended.
To address these issues set a domain in Set-Cookie (doing that will include
sub-domains) or use the Netscape format.
If this option is used several times, the last one will be used.
.IP "-B, --use-ascii"
(FTP/LDAP) Enable ASCII transfer. For FTP, this can also be enforced by using
@ -254,6 +263,9 @@ won't fail or even report an error clearly. Using -v will get a warning
displayed, but that is the only visible feedback you get about this possibly
lethal situation.
Since 7.43.0 cookies that were imported in the Set-Cookie format without a
domain name are not exported by this option.
If this option is used several times, the last specified file name will be
used.
.IP "-C, --continue-at <offset>"
@ -269,11 +281,11 @@ If this option is used several times, the last one will be used.
.IP "--ciphers <list of ciphers>"
(SSL) Specifies which ciphers to use in the connection. The list of ciphers
must specify valid ciphers. Read up on SSL cipher list details on this URL:
\fIhttp://www.openssl.org/docs/apps/ciphers.html\fP
\fIhttps://www.openssl.org/docs/apps/ciphers.html\fP
NSS ciphers are done differently than OpenSSL and GnuTLS. The full list of NSS
ciphers is in the NSSCipherSuite entry at this URL:
\fIhttp://git.fedorahosted.org/cgit/mod_nss.git/plain/docs/mod_nss.html#Directives\fP
\fIhttps://git.fedorahosted.org/cgit/mod_nss.git/plain/docs/mod_nss.html#Directives\fP
If this option is used several times, the last one will be used.
.IP "--compressed"
@ -315,9 +327,10 @@ presses the submit button. This will cause curl to pass the data to the server
using the content-type application/x-www-form-urlencoded. Compare to
\fI-F, --form\fP.
\fI-d, --data\fP is the same as \fI--data-ascii\fP. To post data purely binary,
you should instead use the \fI--data-binary\fP option. To URL-encode the value
of a form field you may use \fI--data-urlencode\fP.
\fI-d, --data\fP is the same as \fI--data-ascii\fP. \fI--data-raw\fP is almost
the same but does not have a special interpretation of the @ character. To
post data purely binary, you should instead use the \fI--data-binary\fP option.
To URL-encode the value of a form field you may use \fI--data-urlencode\fP.
If any of these options is used more than once on the same command line, the
data pieces specified will be merged together with a separating
@ -329,7 +342,8 @@ read the data from, or - if you want curl to read the data from
stdin. Multiple files can also be specified. Posting data from a file
named 'foobar' would thus be done with \fI--data\fP @foobar. When --data is
told to read from a file like that, carriage returns and newlines will be
stripped out.
stripped out. If you don't want the @ character to have a special
interpretation use \fI--data-raw\fP instead.
.IP "-D, --dump-header <file>"
Write the protocol headers to the specified file.
@ -354,6 +368,10 @@ and carriage returns are preserved and conversions are never done.
If this option is used several times, the ones following the first will append
data as described in \fI-d, --data\fP.
.IP "--data-raw <data>"
(HTTP) This posts data similarly to \fI--data\fP but without the special
interpretation of the @ character. See \fI-d, --data\fP.
(Added in 7.43.0)
.IP "--data-urlencode <data>"
(HTTP) This posts data, similar to the other --data options with the exception
that this performs URL-encoding. (Added in 7.18.0)
@ -412,6 +430,9 @@ the traditional PORT command.
\fB--eprt\fP can be used to explicitly enable EPRT again and \fB--no-eprt\fP
is an alias for \fB--disable-eprt\fP.
If the server is an IPv6 host, this option will have no effect as EPRT is
necessary then.
Disabling EPRT only changes the active behavior. If you want to switch to
passive mode you need to not use \fI-P, --ftp-port\fP or force it with
\fI--ftp-pasv\fP.
@ -423,6 +444,9 @@ but with this option, it will not try using EPSV.
\fB--epsv\fP can be used to explicitly enable EPSV again and \fB--no-epsv\fP
is an alias for \fB--disable-epsv\fP.
If the server is an IPv6 host, this option will have no effect as EPSV is
necessary then.
Disabling EPSV only changes the passive behavior. If you want to switch to
active mode you need to use \fI-P, --ftp-port\fP.
.IP "--dns-interface <interface>"
@ -470,10 +494,10 @@ If this option is used several times, the last one will be used.
(SSL) Tells curl to use the specified client certificate file when getting a
file with HTTPS, FTPS or another SSL-based protocol. The certificate must be
in PKCS#12 format if using Secure Transport, or PEM format if using any other
engine. If the optional password isn't specified, it will be queried
for on the terminal. Note that this option assumes a \&"certificate" file that
is the private key and the private certificate concatenated! See \fI--cert\fP
and \fI--key\fP to specify them independently.
engine. If the optional password isn't specified, it will be queried for on
the terminal. Note that this option assumes a \&"certificate" file that is the
private key and the client certificate concatenated! See \fI--cert\fP and
\fI--key\fP to specify them independently.
If curl is built against the NSS SSL library then this option can tell
curl the nickname of the certificate to use within the NSS database defined
@ -505,6 +529,13 @@ after having run curl.
(SSL) Specify the path name to the Entropy Gathering Daemon socket. The socket
is used to seed the random engine for SSL connections. See also the
\fI--random-file\fP option.
.IP "--expect100-timeout <seconds>"
(HTTP) Maximum time in seconds that you allow curl to wait for a 100-continue
response when curl emits an Expects: 100-continue header in its request. By
default curl will wait one second. This option accepts decimal values! When
curl stops waiting, it will continue as if the response has been received.
(Added in 7.47.0)
.IP "--cert-type <type>"
(SSL) Tells curl what certificate type the provided certificate is in. PEM,
DER and ENG are recognized types. If not specified, PEM is assumed.
@ -539,19 +570,22 @@ OpenSSL-powered curl to make SSL-connections much more efficiently than using
If this option is set, the default capath value will be ignored, and if it is
used several times, the last one will be used.
.IP "--pinnedpubkey <pinned public key>"
(SSL) Tells curl to use the specified public key file to verify the peer. The
file must contain a single public key in PEM or DER format.
.IP "--pinnedpubkey <pinned public key (hashes)>"
(SSL) Tells curl to use the specified public key file (or hashes) to verify the
peer. This can be a path to a file which contains a single public key in PEM or
DER format, or any number of base64 encoded sha256 hashes preceded by
\'sha256//\' and separated by \';\'
When negotiating a TLS or SSL connection, the server sends a certificate
indicating its identity. A public key is extracted from this certificate and
if it does not exactly match the public key provided to this option, curl will
abort the connection before sending or receiving any data.
This is currently only implemented in the OpenSSL, GnuTLS and GSKit backends.
Added in 7.39.0 for OpenSSL, GnuTLS and GSKit. Added in 7.43.0 for NSS and
wolfSSL/CyaSSL. sha256 support added in 7.44.0 for OpenSSL,
GnuTLS, NSS and wolfSSL/CyaSSL. Other SSL backends not supported.
If this option is used several times, the last one will be used.
(Added in 7.39.0)
.IP "--cert-status"
(SSL) Tells curl to verify the status of the server certificate by using the
Certificate Status Request (aka. OCSP stapling) TLS extension.
@ -560,8 +594,18 @@ If this option is enabled and the server sends an invalid (e.g. expired)
response, if the response suggests that the server certificate has been revoked,
or no response at all is received, the verification fails.
This is currently only implemented in the OpenSSL, GnuTLS and NSS backends.
This is currently only implemented in the OpenSSL, GnuTLS and NSS backends.
(Added in 7.41.0)
.IP "--false-start"
(SSL) Tells curl to use false start during the TLS handshake. False start is a
mode where a TLS client will start sending application data before verifying
the server's Finished message, thus saving a round trip when performing a full
handshake.
This is currently only implemented in the NSS and Secure Transport (on iOS 7.0
or later, or OS X 10.9 or later) backends.
(Added in 7.42.0)
.IP "-f, --fail"
(HTTP) Fail silently (no output at all) on server errors. This is mostly done
to better enable scripts etc to better deal with failed attempts. In normal
@ -589,7 +633,9 @@ input:
\fBcurl\fP -F password=@/etc/passwd www.mypasswords.com
To read content from stdin instead of a file, use - as the filename. This goes
for both @ and < constructs.
for both @ and < constructs. Unfortunately it does not support reading the
file from a named pipe or similar, as it needs the full size before the
transfer starts.
You can also tell curl what Content-Type to use by using 'type=', in a manner
similar to:
@ -651,6 +697,7 @@ curl does one CWD with the full target directory and then operates on the file
\&"normally" (like in the multicwd case). This is somewhat more standards
compliant than 'nocwd' but without the full penalty of 'multicwd'.
.RE
.IP
(Added in 7.15.1)
.IP "--ftp-pasv"
(FTP) Use passive mode for the data connection. Passive is the internal default
@ -755,10 +802,12 @@ This option can be used multiple times to add/replace/remove multiple headers.
be the 128 bit MD5 checksum of the remote host's public key, curl will refuse
the connection with the host unless the md5sums match. (Added in 7.17.1)
.IP "--ignore-content-length"
(HTTP)
Ignore the Content-Length header. This is particularly useful for servers
running Apache 1.x, which will report incorrect Content-Length for files
larger than 2 gigabytes.
For HTTP, Ignore the Content-Length header. This is particularly useful for
servers running Apache 1.x, which will report incorrect Content-Length for
files larger than 2 gigabytes.
For FTP (since 7.46.0), skip the RETR command to figure out the size before
downloading a file.
.IP "-i, --include"
(HTTP) Include the HTTP-header in the output. The HTTP-header includes things
like server-name, date of the document, HTTP-version and more...
@ -785,8 +834,17 @@ cookies when they're closed down.
server-specified Content-Disposition filename instead of extracting a filename
from the URL.
If the server specifies a file name and a file with that name already exists
in the current working directory it will not be overwritten and an error will
occur. If the server doesn't specify a file name then this option has no
effect.
There's no attempt to decode %-sequences (yet) in the provided file name, so
this option may provide you with rather unexpected file names.
\fBWARNING\fP: Exercise judicious use of this option, especially on Windows. A
rogue server could send you the name of a DLL or other file that could possibly
be loaded automatically by Windows or some third party software.
.IP "-k, --insecure"
(SSL) This option explicitly allows curl to perform "insecure" SSL connections
and transfers. All SSL connections are attempted to be made secure by using
@ -794,7 +852,7 @@ the CA certificate bundle installed by default. This makes all connections
considered "insecure" fail unless \fI-k, --insecure\fP is used.
See this online resource for further details:
\fBhttp://curl.haxx.se/docs/sslcerts.html\fP
\fBhttps://curl.haxx.se/docs/sslcerts.html\fP
.IP "-K, --config <config file>"
Specify which config file to read curl arguments from. The config file is a
text file in which command line arguments can be written which then will be
@ -821,7 +879,7 @@ Note that to be able to specify a URL in the config file, you need to specify
it using the \fI--url\fP option, and not by simply writing the URL on its own
line. So, it could look similar to this:
url = "http://curl.haxx.se/docs/"
url = "https://curl.haxx.se/docs/"
When curl is invoked, it always (unless \fI-q\fP is used) checks for a default
config file and uses it if found. The default config file is checked for in
@ -919,7 +977,7 @@ re-send the following request using the same unmodified method.
You can tell curl to not change the non-GET request method to GET after a 30x
response by using the dedicated options for that: \fI--post301\fP,
\fI--post302\fP and \fI-post303\fP.
\fI--post302\fP and \fI--post303\fP.
.IP "--libcurl <file>"
Append this option to any ordinary curl command line, and you will get a
libcurl-using C source code written to the file that does the equivalent
@ -1043,13 +1101,10 @@ in Metalink file, hash check will fail.
Makes curl scan the \fI.netrc\fP (\fI_netrc\fP on Windows) file in the user's
home directory for login name and password. This is typically used for FTP on
Unix. If used with HTTP, curl will enable user authentication. See
.BR netrc(4)
or
.BR ftp(1)
for details on the file format. Curl will not complain if that file
doesn't have the right permissions (it should not be either world- or
group-readable). The environment variable "HOME" is used to find the home
directory.
\fInetrc(5)\fP \fIftp(1)\fP for details on the file format. Curl will not
complain if that file doesn't have the right permissions (it should not be
either world- or group-readable). The environment variable "HOME" is used to
find the home directory.
A quick and very simple example of how to setup a \fI.netrc\fP to allow curl
to FTP to the machine host.domain.com with user name \&'myself' and password
@ -1150,12 +1205,15 @@ output to be done to stdout.
Write output to a local file named like the remote file we get. (Only the file
part of the remote file is used, the path is cut off.)
The remote file name to use for saving is extracted from the given URL,
nothing else.
The file will be saved in the current working directory. If you want the file
saved in a different directory, make sure you change the current working
directory before invoking curl with this option.
Consequentially, the file will be saved in the current working directory. If
you want the file saved in a different directory, make sure you change current
working directory before you invoke curl with the \fB-O, --remote-name\fP flag!
The remote file name to use for saving is extracted from the given URL, nothing
else, and if it already exists it will be overwritten. If you want the server
to be able to choose the file name refer to \fI-J, --remote-header-name\fP
which can be used in addition to this option. If the server chooses a file name
and that name already exists it will not be overwritten.
There is no URL decoding done on the file name. If it has %20 or other URL
encoded parts of the name, they will end up as-is as file name.
@ -1211,7 +1269,7 @@ i.e "my.host.domain" to specify the machine
make curl pick the same IP address that is already used for the control
connection
.RE
.IP
If this option is used several times, the last one will be used. Disable the
use of PORT with \fI--ftp-pasv\fP. Disable the attempt to use the EPRT command
instead of PORT by using \fI--disable-eprt\fP. EPRT is really PORT++.
@ -1225,22 +1283,28 @@ available.
(SSL/SSH) Passphrase for the private key
If this option is used several times, the last one will be used.
.IP "--path-as-is"
Tell curl to not handle sequences of /../ or /./ in the given URL
path. Normally curl will squash or merge them according to standards but with
this option set you tell it not to do that.
(Added in 7.42.0)
.IP "--post301"
(HTTP) Tells curl to respect RFC 2616/10.3.2 and not convert POST requests
(HTTP) Tells curl to respect RFC 7230/6.4.2 and not convert POST requests
into GET requests when following a 301 redirection. The non-RFC behaviour is
ubiquitous in web browsers, so curl does the conversion by default to maintain
consistency. However, a server may require a POST to remain a POST after such
a redirection. This option is meaningful only when using \fI-L, --location\fP
(Added in 7.17.1)
.IP "--post302"
(HTTP) Tells curl to respect RFC 2616/10.3.2 and not convert POST requests
(HTTP) Tells curl to respect RFC 7230/6.4.3 and not convert POST requests
into GET requests when following a 302 redirection. The non-RFC behaviour is
ubiquitous in web browsers, so curl does the conversion by default to maintain
consistency. However, a server may require a POST to remain a POST after such
a redirection. This option is meaningful only when using \fI-L, --location\fP
(Added in 7.19.1)
.IP "--post303"
(HTTP) Tells curl to respect RFC 2616/10.3.2 and not convert POST requests
(HTTP) Tells curl to respect RFC 7230/6.4.4 and not convert POST requests
into GET requests when following a 303 redirection. The non-RFC behaviour is
ubiquitous in web browsers, so curl does the conversion by default to maintain
consistency. However, a server may require a POST to remain a POST after such
@ -1287,9 +1351,40 @@ This option can be used multiple times, in which case the effect is the same
as concatenating the protocols into one instance of the option.
(Added in 7.20.2)
.IP "--proto-default <protocol>"
Tells curl to use \fIprotocol\fP for any URL missing a scheme name.
Example:
.RS
.IP "--proto-default https ftp.mozilla.org"
https://ftp.mozilla.org
.RE
An unknown or unsupported protocol causes error
\fICURLE_UNSUPPORTED_PROTOCOL\fP.
This option does not change the default proxy protocol (http).
Without this option curl would make a guess based on the host, see \fI--url\fP
for details.
(Added in 7.45.0)
.IP "--proto-redir <protocols>"
Tells curl to use the listed protocols after a redirect. See --proto for
how protocols are represented.
Tells curl to use the listed protocols on redirect. See --proto for how
protocols are represented.
Example:
.RS
.IP "--proto-redir -all,http,https"
Allow only HTTP and HTTPS on redirect.
.RE
By default curl will allow all protocols on redirect except several disabled
for security reasons: Since 7.19.4 FILE and SCP are disabled, and since 7.40.0
SMB and SMBS are also disabled. Specifying \fIall\fP or \fI+all\fP enables all
protocols on redirect, including those disabled for security.
(Added in 7.20.2)
.IP "--proxy-anyauth"
@ -1310,6 +1405,11 @@ with a remote host. (Added in 7.17.1)
.IP "--proxy-ntlm"
Tells curl to use HTTP NTLM authentication when communicating with the given
proxy. Use \fI--ntlm\fP for enabling NTLM with a remote host.
.IP "--proxy-service-name <servicename>"
This option allows you to change the service name for proxy negotiation.
Examples: --proxy-negotiate proxy-name \fI--proxy-service-name\fP sockd would use
sockd/proxy-name. (Added in 7.43.0).
.IP "--proxy1.0 <proxyhost[:port]>"
Use the specified HTTP 1.0 proxy. If the port number is not specified, it is
assumed at port 1080.
@ -1399,15 +1499,12 @@ specifies the last 500 bytes
specifies the bytes from offset 9500 and forward
.TP
.B 0-0,-1
specifies the first and last byte only(*)(H)
.TP
.B 500-700,600-799
specifies 300 bytes from offset 500(H)
specifies the first and last byte only(*)(HTTP)
.TP
.B 100-199,500-599
specifies two separate 100-byte ranges(*)(H)
specifies two separate 100-byte ranges(*) (HTTP)
.RE
.IP
(*) = NOTE that this will cause the server to reply with a multipart
response!
@ -1491,6 +1588,11 @@ terminal/stdout unless you redirect it.
.IP "--sasl-ir"
Enable initial response in SASL authentication.
(Added in 7.31.0)
.IP "--service-name <servicename>"
This option allows you to change the service name for SPNEGO.
Examples: --negotiate \fI--service-name\fP sockd would use
sockd/server-name. (Added in 7.43.0).
.IP "-S, --show-error"
When used with \fI-s\fP it makes curl show an error message if it fails.
.IP "--ssl"
@ -1513,6 +1615,10 @@ and TLS1.0 protocols known as BEAST. If this option isn't used, the SSL layer
may use workarounds known to cause interoperability problems with some older
SSL implementations. WARNING: this option loosens the SSL security, and by
using this flag you ask for exactly that. (Added in 7.25.0)
.IP "--ssl-no-revoke"
(WinSSL) This option tells curl to disable certificate revocation checks.
WARNING: this option loosens the SSL security, and by using this flag you ask
for exactly that. (Added in 7.44.0)
.IP "--socks4 <host[:port]>"
Use the specified SOCKS4 proxy. If the port number is not specified, it is
assumed at port 1080. (Added in 7.15.2)
@ -1624,6 +1730,14 @@ default 512 bytes will be used.
If this option is used several times, the last one will be used.
(Added in 7.20.0)
.IP "--tftp-no-options"
(TFTP) Tells curl not to send TFTP options requests.
This option improves interop with some legacy servers that do not acknowledge
or properly implement TFTP options. When this option is used
\fI--tftp-blksize\fP is ignored.
(Added in 7.48.0)
.IP "--tlsauthtype <authtype>"
Set TLS authentication type. Currently, the only supported option is "SRP",
for TLS-SRP (RFC 5054). If \fI--tlsuser\fP and \fI--tlspassword\fP are
@ -1692,7 +1806,7 @@ impossible to use a colon in the user name with this option. The password can,
still.
When using Kerberos V5 with a Windows based server you should include the
Windows domain name in the user name, in order for the server to succesfully
Windows domain name in the user name, in order for the server to successfully
obtain a Kerberos Ticket. If you don't then the initial authentication
handshake may fail.
@ -1722,6 +1836,12 @@ If this option is used several times, the last one will be used.
Specify a URL to fetch. This option is mostly handy when you want to specify
URL(s) in a config file.
If the given URL is missing a scheme name (such as "http://" or "ftp://" etc)
then curl will make a guess based on the host. If the outermost sub-domain name
matches DICT, FTP, IMAP, LDAP, POP3 or SMTP then that protocol will be used,
otherwise HTTP will be used. Since 7.45.0 guessing can be disabled by setting a
default protocol, see \fI--proto-default\fP for details.
This option may be used any number of times. To control where this URL is
written, use the \fI-o, --output\fP or the \fI-O, --remote-name\fP options.
.IP "-v, --verbose"
@ -1866,7 +1986,7 @@ displayed with millisecond resolution.
The URL that was fetched last. This is most meaningful if you've told curl
to follow location: headers.
.RE
.IP
If this option is used several times, the last one will be used.
.IP "-x, --proxy <[protocol://][user:password@]proxyhost[:port]>"
Use the specified proxy.
@ -1914,10 +2034,10 @@ alter the way curl behaves. So for example if you want to make a proper HEAD
request, using -X HEAD will not suffice. You need to use the \fI-I, --head\fP
option.
The the method string you set with -X will be used for all requests, which if
you for example use \fB-L, --location\fP may cause unintended side-effects
when curl doesn't change request method according to the HTTP 30x response
codes - and similar.
The method string you set with -X will be used for all requests, which if you
for example use \fB-L, --location\fP may cause unintended side-effects when
curl doesn't change request method according to the HTTP 30x response codes -
and similar.
(FTP)
Specifies a custom FTP command to use instead of LIST when doing file lists
@ -2241,7 +2361,7 @@ are meant to never change.
Daniel Stenberg is the main author, but the whole list of contributors is
found in the separate THANKS file.
.SH WWW
http://curl.haxx.se
https://curl.haxx.se
.SH FTP
ftp://ftp.sunet.se/pub/www/utilities/curl/
.SH "SEE ALSO"

View File

@ -73,3 +73,7 @@ smtp-vrfy
url2file
usercertinmem
xmlstream
http2-download
http2-serverpush
http2-upload
imap-lsub

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2016, 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.
* are also available at https://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
@ -19,9 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/* Example application source code using the multi interface to download many
* files, but with a capped maximum amount of simultaneous transfers.
*
/* <DESC>
* Source code using the multi interface to download many
* files, with a capped maximum amount of simultaneous transfers.
* </DESC>
* Written by Michael Wallner
*/
@ -126,41 +127,42 @@ int main(void)
uses */
curl_multi_setopt(cm, CURLMOPT_MAXCONNECTS, (long)MAX);
for (C = 0; C < MAX; ++C) {
for(C = 0; C < MAX; ++C) {
init(cm, C);
}
while (U) {
while(U) {
curl_multi_perform(cm, &U);
if (U) {
if(U) {
FD_ZERO(&R);
FD_ZERO(&W);
FD_ZERO(&E);
if (curl_multi_fdset(cm, &R, &W, &E, &M)) {
if(curl_multi_fdset(cm, &R, &W, &E, &M)) {
fprintf(stderr, "E: curl_multi_fdset\n");
return EXIT_FAILURE;
}
if (curl_multi_timeout(cm, &L)) {
if(curl_multi_timeout(cm, &L)) {
fprintf(stderr, "E: curl_multi_timeout\n");
return EXIT_FAILURE;
}
if (L == -1)
if(L == -1)
L = 100;
if (M == -1) {
if(M == -1) {
#ifdef WIN32
Sleep(L);
#else
sleep(L / 1000);
sleep((unsigned int)L / 1000);
#endif
} else {
}
else {
T.tv_sec = L/1000;
T.tv_usec = (L%1000)*1000;
if (0 > select(M+1, &R, &W, &E, &T)) {
if(0 > select(M+1, &R, &W, &E, &T)) {
fprintf(stderr, "E: select(%i,,,,%li): %i: %s\n",
M+1, L, errno, strerror(errno));
return EXIT_FAILURE;
@ -168,8 +170,8 @@ int main(void)
}
}
while ((msg = curl_multi_info_read(cm, &Q))) {
if (msg->msg == CURLMSG_DONE) {
while((msg = curl_multi_info_read(cm, &Q))) {
if(msg->msg == CURLMSG_DONE) {
char *url;
CURL *e = msg->easy_handle;
curl_easy_getinfo(msg->easy_handle, CURLINFO_PRIVATE, &url);
@ -181,7 +183,7 @@ int main(void)
else {
fprintf(stderr, "E: CURLMsg (%d)\n", msg->msg);
}
if (C < CNT) {
if(C < CNT) {
init(cm, C++);
U++; /* just to prevent it from remaining at 0 if there are more
URLs to get */

View File

@ -5,11 +5,11 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 1998 - 2016, 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.
# are also available at https://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
@ -61,3 +61,6 @@ endif
include Makefile.inc
all: $(check_PROGRAMS)
checksrc:
@@PERL@ $(top_srcdir)/lib/checksrc.pl -D$(top_srcdir)/docs/examples *.c

View File

@ -9,7 +9,7 @@
#
# 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.
# are also available at https://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

View File

@ -5,11 +5,11 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 1998 - 2016, 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.
# are also available at https://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
@ -31,7 +31,8 @@ check_PROGRAMS = 10-at-a-time anyauthput cookie_interface debug fileupload \
pop3-dele pop3-top pop3-stat pop3-noop pop3-ssl pop3-tls pop3-multi \
imap-list imap-lsub imap-fetch imap-store imap-append imap-examine \
imap-search imap-create imap-delete imap-copy imap-noop imap-ssl \
imap-tls imap-multi url2file sftpget ftpsget postinmemory
imap-tls imap-multi url2file sftpget ftpsget postinmemory http2-download \
http2-upload http2-serverpush getredirect
# These examples require external dependencies that may not be commonly
# available on POSIX systems, so don't bother attempting to compile them here.

View File

@ -5,11 +5,11 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 1998 - 2015, 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.
# are also available at https://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
@ -21,7 +21,7 @@
###########################################################################
#
## Makefile for building curl examples with MingW (GCC-3.2 or later)
## and optionally OpenSSL (0.9.8), libssh2 (1.3), zlib (1.2.5), librtmp (2.3)
## and optionally OpenSSL (1.0.2a), libssh2 (1.5), zlib (1.2.8), librtmp (2.4)
##
## Usage: mingw32-make -f Makefile.m32 CFG=-feature1[-feature2][-feature3][...]
## Example: mingw32-make -f Makefile.m32 CFG=-zlib-ssl-spi-winidn
@ -38,23 +38,23 @@ ZLIB_PATH = ../../../zlib-1.2.8
endif
# Edit the path below to point to the base of your OpenSSL package.
ifndef OPENSSL_PATH
OPENSSL_PATH = ../../../openssl-0.9.8zc
OPENSSL_PATH = ../../../openssl-1.0.2a
endif
# Edit the path below to point to the base of your LibSSH2 package.
ifndef LIBSSH2_PATH
LIBSSH2_PATH = ../../../libssh2-1.4.3
LIBSSH2_PATH = ../../../libssh2-1.5.0
endif
# Edit the path below to point to the base of your librtmp package.
ifndef LIBRTMP_PATH
LIBRTMP_PATH = ../../../librtmp-2.3
LIBRTMP_PATH = ../../../librtmp-2.4
endif
# Edit the path below to point to the base of your libidn package.
ifndef LIBIDN_PATH
LIBIDN_PATH = ../../../libidn-1.18
LIBIDN_PATH = ../../../libidn-1.32
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
# https://www.microsoft.com/en-us/download/details.aspx?id=734
ifndef WINIDN_PATH
WINIDN_PATH = ../../../Microsoft IDN Mitigation APIs
endif
@ -62,6 +62,10 @@ endif
ifndef LDAP_SDK
LDAP_SDK = c:/novell/ndk/cldapsdk/win32
endif
# Edit the path below to point to the base of your nghttp2 package.
ifndef NGHTTP2_PATH
NGHTTP2_PATH = ../../../nghttp2-1.0.0
endif
PROOT = ../..
@ -72,14 +76,24 @@ endif
# Edit the var below to set to your architecture or set environment var.
ifndef ARCH
ARCH = w32
ifeq ($(findstring x86_64,$(shell $(CC) -dumpmachine)),x86_64)
ARCH = w64
else
ARCH = w32
endif
endif
CC = $(CROSSPREFIX)gcc
CFLAGS = -g -O2 -Wall
CFLAGS += -fno-strict-aliasing
ifeq ($(ARCH),w64)
CFLAGS += -D_AMD64_
CFLAGS += -m64 -D_AMD64_
LDFLAGS += -m64
RCFLAGS += -F pe-x86-64
else
CFLAGS += -m32
LDFLAGS += -m32
RCFLAGS += -F pe-i386
endif
# comment LDFLAGS below to keep debug info
LDFLAGS = -s
@ -158,9 +172,12 @@ ifeq ($(findstring -metalink,$(CFG)),-metalink)
METALINK = 1
endif
ifeq ($(findstring -winssl,$(CFG)),-winssl)
SCHANNEL = 1
WINSSL = 1
SSPI = 1
endif
ifeq ($(findstring -nghttp2,$(CFG)),-nghttp2)
NGHTTP2 = 1
endif
INCLUDES = -I. -I$(PROOT) -I$(PROOT)/include -I$(PROOT)/lib
@ -184,6 +201,10 @@ ifdef RTMP
CFLAGS += -DUSE_LIBRTMP
curl_LDADD += -L"$(LIBRTMP_PATH)/librtmp" -lrtmp -lwinmm
endif
ifdef NGHTTP2
CFLAGS += -DUSE_NGHTTP2
curl_LDADD += -L"$(NGHTTP2_PATH)/lib" -lnghttp2
endif
ifdef SSH2
CFLAGS += -DUSE_LIBSSH2 -DHAVE_LIBSSH2_H
curl_LDADD += -L"$(LIBSSH2_PATH)/win32" -lssh2
@ -204,7 +225,7 @@ ifdef SSL
ifndef DYN
OPENSSL_LIBS += -lgdi32 -lcrypt32
endif
CFLAGS += -DUSE_SSLEAY
CFLAGS += -DUSE_OPENSSL
curl_LDADD += -L"$(OPENSSL_LIBPATH)" $(OPENSSL_LIBS)
endif
ifdef ZLIB
@ -223,7 +244,7 @@ endif
endif
ifdef SSPI
CFLAGS += -DUSE_WINDOWS_SSPI
ifdef SCHANNEL
ifdef WINSSL
CFLAGS += -DUSE_SCHANNEL
endif
endif

View File

@ -19,12 +19,12 @@ endif
# Edit the path below to point to the base of your OpenSSL package.
ifndef OPENSSL_PATH
OPENSSL_PATH = ../../../openssl-0.9.8zc
OPENSSL_PATH = ../../../openssl-1.0.2a
endif
# Edit the path below to point to the base of your LibSSH2 package.
ifndef LIBSSH2_PATH
LIBSSH2_PATH = ../../../libssh2-1.4.3
LIBSSH2_PATH = ../../../libssh2-1.5.0
endif
# Edit the path below to point to the base of your axTLS package.
@ -34,12 +34,12 @@ endif
# Edit the path below to point to the base of your libidn package.
ifndef LIBIDN_PATH
LIBIDN_PATH = ../../../libidn-1.18
LIBIDN_PATH = ../../../libidn-1.32
endif
# Edit the path below to point to the base of your librtmp package.
ifndef LIBRTMP_PATH
LIBRTMP_PATH = ../../../librtmp-2.3
LIBRTMP_PATH = ../../../librtmp-2.4
endif
# Edit the path below to point to the base of your fbopenssl package.

View File

@ -32,51 +32,7 @@ actually torture our web site with your tests! Thanks.
EXAMPLES
anyauthput.c - HTTP PUT using "any" authentication method
cacertinmem.c - Use a built-in PEM certificate to retrieve a https page
cookie_interface.c - shows usage of simple cookie interface
curlgtk.c - download using a GTK progress bar
curlx.c - getting file info from the remote cert data
debug.c - showing how to use the debug callback
fileupload.c - uploading to a file:// URL
fopen.c - fopen() layer that supports opening URLs and files
ftpget.c - simple getting a file from FTP
ftpgetresp.c - get the response strings from the FTP server
ftpupload.c - upload a file to an FTP server
ftpuploadresume.c - resume an upload to an FTP server
getinfo.c - get the Content-Type from the recent transfer
getinmemory.c - download a file to memory only
ghiper.c - curl_multi_socket() using code with glib-2
hiperfifo.c - downloads all URLs written to the fifo, using
curl_multi_socket() and libevent
htmltidy.c - download a document and use libtidy to parse the HTML
htmltitle.cc - download a HTML file and extract the <title> tag from a HTML
page using libxml
http-post.c - HTTP POST
httpput.c - HTTP PUT a local file
https.c - simple HTTPS transfer
imap.c - simple IMAP transfer
multi-app.c - a multi-interface app
multi-debugcallback.c - a multi-interface app using the debug callback
multi-double.c - a multi-interface app doing two simultaneous transfers
multi-post.c - a multi-interface app doing a multipart formpost
multi-single.c - a multi-interface app getting a single file
multi-uv.c - a multi-interface app using libuv
multithread.c - an example using multi-treading transferring multiple files
opensslthreadlock.c - show how to do locking when using OpenSSL multi-threaded
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
postit2.c - send a HTTP multipart formpost
sampleconv.c - showing how a program on a non-ASCII platform would invoke
callbacks to do its own codeset conversions instead of using
the built-in iconv functions in libcurl
sepheaders.c - download headers to a separate file
simple.c - the most simple download a URL source
simplepost.c - HTTP POST
simplessl.c - HTTPS example with certificates many options set
synctime.c - Sync local time by extracting date from remote HTTP servers
url2file.c - download a document and store it in a file
xmlstream.c - Stream-parse a document using the streaming Expat parser
10-at-a-time.c - Download many files simultaneously, 10 at a time.
Each example source code file is designed to be and work stand-alone and
rather self-explanatory. The examples may at times lack the level of error
checks you need in a real world, but that is then only for the sake of
readability: to make the code smaller and easier to follow.

View File

@ -2,7 +2,7 @@
# pass files as argument(s)
my $docroot="http://curl.haxx.se/libcurl/c";
my $docroot="https://curl.haxx.se/libcurl/c";
for $f (@ARGV) {
open(NEW, ">$f.new");

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2016, 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.
* are also available at https://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
@ -19,6 +19,11 @@
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* HTTP PUT upload with authentiction using "any" method. libcurl picks the
* one the server supports/wants.
* </DESC>
*/
#include <stdio.h>
#include <fcntl.h>
#ifdef WIN32
@ -73,7 +78,8 @@
/* ioctl callback function */
static curlioerr my_ioctl(CURL *handle, curliocmd cmd, void *userp)
{
intptr_t fd = (intptr_t)userp;
int *fdp = (int *)userp;
int fd = *fdp;
(void)handle; /* not used in here */
@ -95,10 +101,11 @@ static curlioerr my_ioctl(CURL *handle, curliocmd cmd, void *userp)
/* read callback function, fread() look alike */
static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream)
{
size_t retcode;
ssize_t retcode;
curl_off_t nread;
intptr_t fd = (intptr_t)stream;
int *fdp = (int *)stream;
int fd = *fdp;
retcode = read(fd, ptr, size * nmemb);
@ -114,7 +121,7 @@ int main(int argc, char **argv)
{
CURL *curl;
CURLcode res;
intptr_t hd ;
int hd;
struct stat file_info;
char *file;
@ -127,7 +134,7 @@ int main(int argc, char **argv)
url = argv[2];
/* get the file size of the local file */
hd = open(file, O_RDONLY) ;
hd = open(file, O_RDONLY);
fstat(hd, &file_info);
/* In windows, this will init the winsock stuff */
@ -140,20 +147,20 @@ int main(int argc, char **argv)
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
/* which file to upload */
curl_easy_setopt(curl, CURLOPT_READDATA, (void*)hd);
curl_easy_setopt(curl, CURLOPT_READDATA, (void*)&hd);
/* set the ioctl function */
curl_easy_setopt(curl, CURLOPT_IOCTLFUNCTION, my_ioctl);
/* pass the file descriptor to the ioctl callback as well */
curl_easy_setopt(curl, CURLOPT_IOCTLDATA, (void*)hd);
curl_easy_setopt(curl, CURLOPT_IOCTLDATA, (void*)&hd);
/* enable "uploading" (which means PUT when doing HTTP) */
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L) ;
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
/* specify target URL, and note that this URL should also include a file
name, not only a directory (as you can do with GTP uploads) */
curl_easy_setopt(curl,CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_URL, url);
/* and give the size of the upload, this supports large file sizes
on systems that have general support for it */

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 2012 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 2012 - 2015, 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.
* are also available at https://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
@ -20,11 +20,11 @@
*
***************************************************************************/
/* <DESC>
* demonstrate the use of multi socket interface with boost::asio
* </DESC>
*/
/*
* file: asiohiper.cpp
* Example program to demonstrate the use of multi socket interface
* with boost::asio
*
* This program is in c++ and uses boost::asio instead of libevent/libev.
* Requires boost::asio, boost::bind and boost::system
*
@ -48,6 +48,7 @@
#include <curl/curl.h>
#include <boost/asio.hpp>
#include <boost/bind.hpp>
#include <iostream>
#define MSG_OUT stdout /* Send info to stdout, change to stderr if you want */
@ -378,9 +379,9 @@ static curl_socket_t opensocket(void *clientp, curlsocktype purpose,
}
/* CURLOPT_CLOSESOCKETFUNCTION */
static int closesocket(void *clientp, curl_socket_t item)
static int close_socket(void *clientp, curl_socket_t item)
{
fprintf(MSG_OUT, "\nclosesocket : %d", item);
fprintf(MSG_OUT, "\nclose_socket : %d", item);
std::map<curl_socket_t, boost::asio::ip::tcp::socket *>::iterator it = socket_map.find(item);
@ -427,7 +428,7 @@ static void new_conn(char *url, GlobalInfo *g)
curl_easy_setopt(conn->easy, CURLOPT_OPENSOCKETFUNCTION, opensocket);
/* call this function to close a socket */
curl_easy_setopt(conn->easy, CURLOPT_CLOSESOCKETFUNCTION, closesocket);
curl_easy_setopt(conn->easy, CURLOPT_CLOSESOCKETFUNCTION, close_socket);
fprintf(MSG_OUT,
"\nAdding easy %p to multi %p (%s)", conn->easy, g->multi, url);
@ -441,7 +442,6 @@ static void new_conn(char *url, GlobalInfo *g)
int main(int argc, char **argv)
{
GlobalInfo g;
CURLMcode rc;
(void)argc;
(void)argv;

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2016, 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.
* are also available at https://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
@ -19,25 +19,19 @@
* KIND, either express or implied.
*
***************************************************************************/
/* Example using a "in core" PEM certificate to retrieve a https page.
* Written by Theo Borm
/* <DESC>
* CA cert in memory with OpenSSL to get a HTTPS page.
* </DESC>
*/
/* on a netBSD system with OPENSSL& LIBCURL installed from
* pkgsrc (using default paths) this program can be compiled using:
* gcc -I/usr/pkg/include -L/usr/pkg/lib -lcurl -Wl,-R/usr/pkg/lib -lssl
* -lcrypto -lz -o curlcacerttest curlcacerttest.c
* on other operating systems you may want to change paths to headers
* and libraries
*/
#include <openssl/ssl.h>
#include <curl/curl.h>
#include <stdio.h>
size_t writefunction( void *ptr, size_t size, size_t nmemb, void *stream)
{
fwrite(ptr,size,nmemb,stream);
return(nmemb*size);
fwrite(ptr, size, nmemb, stream);
return (nmemb*size);
}
static CURLcode sslctx_function(CURL * curl, void * sslctx, void * parm)
@ -93,14 +87,14 @@ static CURLcode sslctx_function(CURL * curl, void * sslctx, void * parm)
* structure that SSL can use
*/
PEM_read_bio_X509(bio, &cert, 0, NULL);
if (cert == NULL)
if(cert == NULL)
printf("PEM_read_bio_X509 failed...\n");
/* get a pointer to the X509 certificate store (which may be empty!) */
store=SSL_CTX_get_cert_store((SSL_CTX *)sslctx);
/* add our certificate to this store */
if (X509_STORE_add_cert(store, cert)==0)
if(X509_STORE_add_cert(store, cert)==0)
printf("error adding certificate\n");
/* decrease reference counts */
@ -108,7 +102,7 @@ static CURLcode sslctx_function(CURL * curl, void * sslctx, void * parm)
BIO_free(bio);
/* all set to go */
return CURLE_OK ;
return CURLE_OK;
}
int main(void)
@ -118,22 +112,22 @@ int main(void)
rv=curl_global_init(CURL_GLOBAL_ALL);
ch=curl_easy_init();
rv=curl_easy_setopt(ch,CURLOPT_VERBOSE, 0L);
rv=curl_easy_setopt(ch,CURLOPT_HEADER, 0L);
rv=curl_easy_setopt(ch,CURLOPT_NOPROGRESS, 1L);
rv=curl_easy_setopt(ch,CURLOPT_NOSIGNAL, 1L);
rv=curl_easy_setopt(ch,CURLOPT_WRITEFUNCTION, *writefunction);
rv=curl_easy_setopt(ch,CURLOPT_WRITEDATA, stdout);
rv=curl_easy_setopt(ch,CURLOPT_HEADERFUNCTION, *writefunction);
rv=curl_easy_setopt(ch,CURLOPT_HEADERDATA, stderr);
rv=curl_easy_setopt(ch,CURLOPT_SSLCERTTYPE,"PEM");
rv=curl_easy_setopt(ch,CURLOPT_SSL_VERIFYPEER,1L);
rv=curl_easy_setopt(ch, CURLOPT_VERBOSE, 0L);
rv=curl_easy_setopt(ch, CURLOPT_HEADER, 0L);
rv=curl_easy_setopt(ch, CURLOPT_NOPROGRESS, 1L);
rv=curl_easy_setopt(ch, CURLOPT_NOSIGNAL, 1L);
rv=curl_easy_setopt(ch, CURLOPT_WRITEFUNCTION, *writefunction);
rv=curl_easy_setopt(ch, CURLOPT_WRITEDATA, stdout);
rv=curl_easy_setopt(ch, CURLOPT_HEADERFUNCTION, *writefunction);
rv=curl_easy_setopt(ch, CURLOPT_HEADERDATA, stderr);
rv=curl_easy_setopt(ch, CURLOPT_SSLCERTTYPE, "PEM");
rv=curl_easy_setopt(ch, CURLOPT_SSL_VERIFYPEER, 1L);
rv=curl_easy_setopt(ch, CURLOPT_URL, "https://www.example.com/");
/* first try: retrieve page without cacerts' certificate -> will fail
*/
rv=curl_easy_perform(ch);
if (rv==CURLE_OK)
if(rv==CURLE_OK)
printf("*** transfer succeeded ***\n");
else
printf("*** transfer failed ***\n");
@ -142,9 +136,9 @@ int main(void)
* load the certificate by installing a function doing the nescessary
* "modifications" to the SSL CONTEXT just before link init
*/
rv=curl_easy_setopt(ch,CURLOPT_SSL_CTX_FUNCTION, *sslctx_function);
rv=curl_easy_setopt(ch, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function);
rv=curl_easy_perform(ch);
if (rv==CURLE_OK)
if(rv==CURLE_OK)
printf("*** transfer succeeded ***\n");
else
printf("*** transfer failed ***\n");

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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.
* are also available at https://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
@ -19,6 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* Extract lots of TLS certificate info.
* </DESC>
*/
#include <stdio.h>
#include <curl/curl.h>

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2016, 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.
* are also available at https://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
@ -19,6 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* Show transfer timing info after download completes.
* </DESC>
*/
/* Example source code to show how the callback function can be used to
* download data into a chunk of memory instead of storing it in a file.
* After successful download we use curl_easy_getinfo() calls to get the
@ -64,63 +68,78 @@ int main(int argc, char *argv[])
const char *url = URL_1M;
char *appname = argv[0];
if (argc > 1) {
if(argc > 1) {
/* parse input parameters */
for (argc--, argv++; *argv; argc--, argv++) {
if (strncasecmp(*argv, "-", 1) == 0) {
if (strncasecmp(*argv, "-H", 2) == 0) {
for(argc--, argv++; *argv; argc--, argv++) {
if(strncasecmp(*argv, "-", 1) == 0) {
if(strncasecmp(*argv, "-H", 2) == 0) {
fprintf(stderr,
"\rUsage: %s [-m=1|2|5|10|20|50|100] [-t] [-x] [url]\n",
appname);
exit(1);
} else if (strncasecmp(*argv, "-V", 2) == 0) {
}
else if(strncasecmp(*argv, "-V", 2) == 0) {
fprintf(stderr, "\r%s %s - %s\n",
appname, CHKSPEED_VERSION, curl_version());
exit(1);
} else if (strncasecmp(*argv, "-A", 2) == 0) {
}
else if(strncasecmp(*argv, "-A", 2) == 0) {
prtall = 1;
} else if (strncasecmp(*argv, "-X", 2) == 0) {
}
else if(strncasecmp(*argv, "-X", 2) == 0) {
prtsep = 1;
} else if (strncasecmp(*argv, "-T", 2) == 0) {
}
else if(strncasecmp(*argv, "-T", 2) == 0) {
prttime = 1;
} else if (strncasecmp(*argv, "-M=", 3) == 0) {
}
else if(strncasecmp(*argv, "-M=", 3) == 0) {
long m = strtol((*argv)+3, NULL, 10);
switch(m) {
case 1: url = URL_1M;
break;
case 2: url = URL_2M;
break;
case 5: url = URL_5M;
break;
case 10: url = URL_10M;
break;
case 20: url = URL_20M;
break;
case 50: url = URL_50M;
break;
case 100: url = URL_100M;
break;
default: fprintf(stderr, "\r%s: invalid parameter %s\n",
appname, *argv + 3);
exit(1);
case 1:
url = URL_1M;
break;
case 2:
url = URL_2M;
break;
case 5:
url = URL_5M;
break;
case 10:
url = URL_10M;
break;
case 20:
url = URL_20M;
break;
case 50:
url = URL_50M;
break;
case 100:
url = URL_100M;
break;
default:
fprintf(stderr, "\r%s: invalid parameter %s\n",
appname, *argv + 3);
exit(1);
}
} else {
}
else {
fprintf(stderr, "\r%s: invalid or unknown option %s\n",
appname, *argv);
exit(1);
}
} else {
}
else {
url = *argv;
}
}
}
/* print separator line */
if (prtsep) {
if(prtsep) {
printf("-------------------------------------------------\n");
}
/* print localtime */
if (prttime) {
if(prttime) {
time_t t = time(NULL);
printf("Localtime: %s", ctime(&t));
}
@ -163,7 +182,7 @@ int main(int argc, char *argv[])
if((CURLE_OK == res) && (val>0))
printf("Average download speed: %0.3f kbyte/sec.\n", val / 1024);
if (prtall) {
if(prtall) {
/* check for name resolution time */
res = curl_easy_getinfo(curl_handle, CURLINFO_NAMELOOKUP_TIME, &val);
if((CURLE_OK == res) && (val>0))
@ -174,8 +193,8 @@ int main(int argc, char *argv[])
if((CURLE_OK == res) && (val>0))
printf("Connect time: %0.3f sec.\n", val);
}
} else {
}
else {
fprintf(stderr, "Error while fetching '%s' : %s\n",
url, curl_easy_strerror(res));
}

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2016, 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.
* are also available at https://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
@ -19,7 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/* This example shows usage of simple cookie interface. */
/* <DESC>
* Import and export cookies with COOKIELIST.
* </DESC>
*/
#include <stdio.h>
#include <string.h>
@ -39,17 +42,18 @@ print_cookies(CURL *curl)
printf("Cookies, curl knows:\n");
res = curl_easy_getinfo(curl, CURLINFO_COOKIELIST, &cookies);
if (res != CURLE_OK) {
fprintf(stderr, "Curl curl_easy_getinfo failed: %s\n", curl_easy_strerror(res));
if(res != CURLE_OK) {
fprintf(stderr, "Curl curl_easy_getinfo failed: %s\n",
curl_easy_strerror(res));
exit(1);
}
nc = cookies, i = 1;
while (nc) {
while(nc) {
printf("[%d]: %s\n", i, nc->data);
nc = nc->next;
i++;
}
if (i == 1) {
if(i == 1) {
printf("(none)\n");
}
curl_slist_free_all(cookies);
@ -63,14 +67,14 @@ main(void)
curl_global_init(CURL_GLOBAL_ALL);
curl = curl_easy_init();
if (curl) {
if(curl) {
char nline[256];
curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/");
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); /* just to start the cookie engine */
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); /* start cookie engine */
res = curl_easy_perform(curl);
if (res != CURLE_OK) {
if(res != CURLE_OK) {
fprintf(stderr, "Curl perform failed: %s\n", curl_easy_strerror(res));
return 1;
}
@ -89,30 +93,41 @@ main(void)
#endif
/* Netscape format cookie */
snprintf(nline, sizeof(nline), "%s\t%s\t%s\t%s\t%lu\t%s\t%s",
".google.com", "TRUE", "/", "FALSE", (unsigned long)time(NULL) + 31337UL, "PREF", "hello google, i like you very much!");
".google.com", "TRUE", "/", "FALSE",
(unsigned long)time(NULL) + 31337UL,
"PREF", "hello google, i like you very much!");
res = curl_easy_setopt(curl, CURLOPT_COOKIELIST, nline);
if (res != CURLE_OK) {
fprintf(stderr, "Curl curl_easy_setopt failed: %s\n", curl_easy_strerror(res));
if(res != CURLE_OK) {
fprintf(stderr, "Curl curl_easy_setopt failed: %s\n",
curl_easy_strerror(res));
return 1;
}
/* HTTP-header style cookie */
/* HTTP-header style cookie. If you use the Set-Cookie format and don't
specify a domain then the cookie is sent for any domain and will not be
modified, likely not what you intended. Starting in 7.43.0 any-domain
cookies will not be exported either. For more information refer to the
CURLOPT_COOKIELIST documentation.
*/
snprintf(nline, sizeof(nline),
"Set-Cookie: OLD_PREF=3d141414bf4209321; "
"expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.google.com");
res = curl_easy_setopt(curl, CURLOPT_COOKIELIST, nline);
if (res != CURLE_OK) {
fprintf(stderr, "Curl curl_easy_setopt failed: %s\n", curl_easy_strerror(res));
if(res != CURLE_OK) {
fprintf(stderr, "Curl curl_easy_setopt failed: %s\n",
curl_easy_strerror(res));
return 1;
}
print_cookies(curl);
res = curl_easy_perform(curl);
if (res != CURLE_OK) {
if(res != CURLE_OK) {
fprintf(stderr, "Curl perform failed: %s\n", curl_easy_strerror(res));
return 1;
}
curl_easy_cleanup(curl);
}
else {
fprintf(stderr, "Curl init failed!\n");

View File

@ -5,9 +5,12 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (c) 2000 David Odin (aka DindinX) for MandrakeSoft
*/
/* <DESC>
* use the libcurl in a gtk-threaded application
* </DESC>
*/
/* Copyright (c) 2000 David Odin (aka DindinX) for MandrakeSoft */
/* an attempt to use the curl library in concert with a gtk-threaded application */
#include <stdio.h>
#include <gtk/gtk.h>
@ -47,9 +50,9 @@ void *my_thread(void *ptr)
gchar *url = ptr;
curl = curl_easy_init();
if(curl)
{
outfile = fopen("test.curl", "w");
if(curl) {
const char *filename = "test.curl";
outfile = fopen(filename, "wb");
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile);
@ -94,7 +97,7 @@ int main(int argc, char **argv)
gtk_container_add(GTK_CONTAINER(Frame2), Bar);
gtk_widget_show_all(Window);
if (!g_thread_create(&my_thread, argv[1], FALSE, NULL) != 0)
if(!g_thread_create(&my_thread, argv[1], FALSE, NULL) != 0)
g_warning("can't create the thread");

View File

@ -9,7 +9,10 @@
certificate presented during ssl session establishment.
*/
/* <DESC>
* demonstrates use of SSL context callback, requires OpenSSL
* </DESC>
*/
/*
* Copyright (c) 2003 The OpenEvidence Project. All rights reserved.
@ -33,7 +36,7 @@
* "This product includes software developed by the Openevidence Project
* for use in the OpenEvidence Toolkit. (http://www.openevidence.org/)"
* This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
* for use in the OpenSSL Toolkit (https://www.openssl.org/)"
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com)."
@ -52,7 +55,7 @@
* "This product includes software developed by the OpenEvidence Project
* for use in the OpenEvidence Toolkit (http://www.openevidence.org/)
* This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
* for use in the OpenSSL Toolkit (https://www.openssl.org/)"
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com)."
@ -72,7 +75,7 @@
* ====================================================================
*
* This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)
* for use in the OpenSSL Toolkit (https://www.openssl.org/)
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
@ -98,13 +101,18 @@
static const char *curlx_usage[]={
"usage: curlx args\n",
" -p12 arg - tia file ",
" -envpass arg - environement variable which content the tia private key password",
" -envpass arg - environement variable which content the tia private"
" key password",
" -out arg - output file (response)- default stdout",
" -in arg - input file (request)- default stdin",
" -connect arg - URL of the server for the connection ex: www.openevidence.org",
" -mimetype arg - MIME type for data in ex : application/timestamp-query or application/dvcs -default application/timestamp-query",
" -acceptmime arg - MIME type acceptable for the response ex : application/timestamp-response or application/dvcs -default none",
" -accesstype arg - an Object identifier in an AIA/SIA method, e.g. AD_DVCS or ad_timestamping",
" -connect arg - URL of the server for the connection ex:"
" www.openevidence.org",
" -mimetype arg - MIME type for data in ex : application/timestamp-query"
" or application/dvcs -default application/timestamp-query",
" -acceptmime arg - MIME type acceptable for the response ex : "
"application/timestamp-response or application/dvcs -default none",
" -accesstype arg - an Object identifier in an AIA/SIA method, e.g."
" AD_DVCS or ad_timestamping",
NULL
};
@ -125,22 +133,22 @@ static const char *curlx_usage[]={
/* This is a context that we pass to all callbacks */
typedef struct sslctxparm_st {
unsigned char * p12file ;
const char * pst ;
PKCS12 * p12 ;
EVP_PKEY * pkey ;
X509 * usercert ;
STACK_OF(X509) * ca ;
unsigned char * p12file;
const char * pst;
PKCS12 * p12;
EVP_PKEY * pkey;
X509 * usercert;
STACK_OF(X509) * ca;
CURL * curl;
BIO * errorbio;
int accesstype ;
int accesstype;
int verbose;
} sslctxparm;
/* some helper function. */
static char *i2s_ASN1_IA5STRING( ASN1_IA5STRING *ia5)
static char *ia5string(ASN1_IA5STRING *ia5)
{
char *tmp;
if(!ia5 || !ia5->length)
@ -152,20 +160,20 @@ static char *i2s_ASN1_IA5STRING( ASN1_IA5STRING *ia5)
}
/* A conveniance routine to get an access URI. */
static unsigned char *my_get_ext(X509 * cert, const int type, int extensiontype) {
static unsigned char *my_get_ext(X509 *cert, const int type,
int extensiontype)
{
int i;
STACK_OF(ACCESS_DESCRIPTION) * accessinfo ;
accessinfo = X509_get_ext_d2i(cert, extensiontype, NULL, NULL) ;
STACK_OF(ACCESS_DESCRIPTION) * accessinfo;
accessinfo = X509_get_ext_d2i(cert, extensiontype, NULL, NULL);
if (!sk_ACCESS_DESCRIPTION_num(accessinfo))
if(!sk_ACCESS_DESCRIPTION_num(accessinfo))
return NULL;
for (i = 0; i < sk_ACCESS_DESCRIPTION_num(accessinfo); i++) {
for(i = 0; i < sk_ACCESS_DESCRIPTION_num(accessinfo); i++) {
ACCESS_DESCRIPTION * ad = sk_ACCESS_DESCRIPTION_value(accessinfo, i);
if (OBJ_obj2nid(ad->method) == type) {
if (ad->location->type == GEN_URI) {
return i2s_ASN1_IA5STRING(ad->location->d.ia5);
if(OBJ_obj2nid(ad->method) == type) {
if(ad->location->type == GEN_URI) {
return ia5string(ad->location->d.ia5);
}
return NULL;
}
@ -184,84 +192,86 @@ static int ssl_app_verify_callback(X509_STORE_CTX *ctx, void *arg)
sslctxparm * p = (sslctxparm *) arg;
int ok;
if (p->verbose > 2)
BIO_printf(p->errorbio,"entering ssl_app_verify_callback\n");
if(p->verbose > 2)
BIO_printf(p->errorbio, "entering ssl_app_verify_callback\n");
if ((ok= X509_verify_cert(ctx)) && ctx->cert) {
unsigned char * accessinfo ;
if (p->verbose > 1)
X509_print_ex(p->errorbio,ctx->cert,0,0);
if((ok= X509_verify_cert(ctx)) && ctx->cert) {
unsigned char * accessinfo;
if(p->verbose > 1)
X509_print_ex(p->errorbio, ctx->cert, 0, 0);
if (accessinfo = my_get_ext(ctx->cert,p->accesstype ,NID_sinfo_access)) {
if (p->verbose)
BIO_printf(p->errorbio,"Setting URL from SIA to: %s\n", accessinfo);
if(accessinfo = my_get_ext(ctx->cert, p->accesstype, NID_sinfo_access)) {
if(p->verbose)
BIO_printf(p->errorbio, "Setting URL from SIA to: %s\n", accessinfo);
curl_easy_setopt(p->curl, CURLOPT_URL,accessinfo);
curl_easy_setopt(p->curl, CURLOPT_URL, accessinfo);
}
else if (accessinfo = my_get_ext(ctx->cert,p->accesstype,
NID_info_access)) {
if (p->verbose)
BIO_printf(p->errorbio,"Setting URL from AIA to: %s\n", accessinfo);
else if(accessinfo = my_get_ext(ctx->cert, p->accesstype,
NID_info_access)) {
if(p->verbose)
BIO_printf(p->errorbio, "Setting URL from AIA to: %s\n", accessinfo);
curl_easy_setopt(p->curl, CURLOPT_URL,accessinfo);
curl_easy_setopt(p->curl, CURLOPT_URL, accessinfo);
}
}
if (p->verbose > 2)
BIO_printf(p->errorbio,"leaving ssl_app_verify_callback with %d\n", ok);
return(ok);
if(p->verbose > 2)
BIO_printf(p->errorbio, "leaving ssl_app_verify_callback with %d\n", ok);
return ok;
}
/* This is an example of an curl SSL initialisation call back. The callback sets:
/* The SSL initialisation callback. The callback sets:
- a private key and certificate
- a trusted ca certificate
- a preferred cipherlist
- an application verification callback (the function above)
*/
static CURLcode sslctxfun(CURL * curl, void * sslctx, void * parm) {
static CURLcode sslctxfun(CURL * curl, void * sslctx, void * parm)
{
sslctxparm * p = (sslctxparm *) parm;
SSL_CTX * ctx = (SSL_CTX *) sslctx ;
SSL_CTX * ctx = (SSL_CTX *) sslctx;
if (!SSL_CTX_use_certificate(ctx,p->usercert)) {
BIO_printf(p->errorbio, "SSL_CTX_use_certificate problem\n"); goto err;
if(!SSL_CTX_use_certificate(ctx, p->usercert)) {
BIO_printf(p->errorbio, "SSL_CTX_use_certificate problem\n");
goto err;
}
if (!SSL_CTX_use_PrivateKey(ctx,p->pkey)) {
BIO_printf(p->errorbio, "SSL_CTX_use_PrivateKey\n"); goto err;
if(!SSL_CTX_use_PrivateKey(ctx, p->pkey)) {
BIO_printf(p->errorbio, "SSL_CTX_use_PrivateKey\n");
goto err;
}
if (!SSL_CTX_check_private_key(ctx)) {
BIO_printf(p->errorbio, "SSL_CTX_check_private_key\n"); goto err;
if(!SSL_CTX_check_private_key(ctx)) {
BIO_printf(p->errorbio, "SSL_CTX_check_private_key\n");
goto err;
}
SSL_CTX_set_quiet_shutdown(ctx,1);
SSL_CTX_set_cipher_list(ctx,"RC4-MD5");
SSL_CTX_set_quiet_shutdown(ctx, 1);
SSL_CTX_set_cipher_list(ctx, "RC4-MD5");
SSL_CTX_set_mode(ctx, SSL_MODE_AUTO_RETRY);
X509_STORE_add_cert(SSL_CTX_get_cert_store(ctx), sk_X509_value(p->ca, sk_X509_num(p->ca)-1));
SSL_CTX_set_verify_depth(ctx,2);
SSL_CTX_set_verify(ctx,SSL_VERIFY_PEER,ZERO_NULL);
X509_STORE_add_cert(SSL_CTX_get_cert_store(ctx),
sk_X509_value(p->ca, sk_X509_num(p->ca)-1));
SSL_CTX_set_verify_depth(ctx, 2);
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, ZERO_NULL);
SSL_CTX_set_cert_verify_callback(ctx, ssl_app_verify_callback, parm);
return CURLE_OK ;
return CURLE_OK;
err:
ERR_print_errors(p->errorbio);
return CURLE_SSL_CERTPROBLEM;
}
int main(int argc, char **argv) {
int main(int argc, char **argv)
{
BIO* in=NULL;
BIO* out=NULL;
char * outfile = NULL;
char * infile = NULL ;
char * infile = NULL;
int tabLength=100;
char *binaryptr;
@ -270,7 +280,7 @@ int main(int argc, char **argv) {
char* contenttype;
const char** pp;
unsigned char* hostporturl = NULL;
BIO * p12bio ;
BIO * p12bio;
char **args = argv + 1;
unsigned char * serverurl;
sslctxparm p;
@ -293,66 +303,91 @@ int main(int argc, char **argv) {
OpenSSL_add_all_digests();
ERR_load_crypto_strings();
while (*args && *args[0] == '-') {
if (!strcmp (*args, "-in")) {
if (args[1]) {
while(*args && *args[0] == '-') {
if(!strcmp (*args, "-in")) {
if(args[1]) {
infile=*(++args);
} else badarg=1;
} else if (!strcmp (*args, "-out")) {
if (args[1]) {
}
else
badarg=1;
}
else if(!strcmp (*args, "-out")) {
if(args[1]) {
outfile=*(++args);
} else badarg=1;
} else if (!strcmp (*args, "-p12")) {
if (args[1]) {
}
else
badarg=1;
}
else if(!strcmp (*args, "-p12")) {
if(args[1]) {
p.p12file = *(++args);
} else badarg=1;
} else if (strcmp(*args,"-envpass") == 0) {
if (args[1]) {
}
else
badarg=1;
}
else if(strcmp(*args, "-envpass") == 0) {
if(args[1]) {
p.pst = getenv(*(++args));
} else badarg=1;
} else if (strcmp(*args,"-connect") == 0) {
if (args[1]) {
}
else
badarg=1;
}
else if(strcmp(*args, "-connect") == 0) {
if(args[1]) {
hostporturl = *(++args);
} else badarg=1;
} else if (strcmp(*args,"-mimetype") == 0) {
if (args[1]) {
}
else
badarg=1;
}
else if(strcmp(*args, "-mimetype") == 0) {
if(args[1]) {
mimetype = *(++args);
} else badarg=1;
} else if (strcmp(*args,"-acceptmime") == 0) {
if (args[1]) {
}
else
badarg=1;
}
else if(strcmp(*args, "-acceptmime") == 0) {
if(args[1]) {
mimetypeaccept = *(++args);
} else badarg=1;
} else if (strcmp(*args,"-accesstype") == 0) {
if (args[1]) {
if ((p.accesstype = OBJ_obj2nid(OBJ_txt2obj(*++args,0))) == 0) badarg=1;
} else badarg=1;
} else if (strcmp(*args,"-verbose") == 0) {
}
else
badarg=1;
}
else if(strcmp(*args, "-accesstype") == 0) {
if(args[1]) {
if((p.accesstype = OBJ_obj2nid(OBJ_txt2obj(*++args, 0))) == 0)
badarg=1;
}
else
badarg=1;
}
else if(strcmp(*args, "-verbose") == 0) {
p.verbose++;
} else badarg=1;
}
else
badarg=1;
args++;
}
if (mimetype==NULL || mimetypeaccept == NULL) badarg = 1;
if(mimetype==NULL || mimetypeaccept == NULL)
badarg = 1;
if (badarg) {
for (pp=curlx_usage; (*pp != NULL); pp++)
BIO_printf(p.errorbio,"%s\n",*pp);
BIO_printf(p.errorbio,"\n");
if(badarg) {
for(pp=curlx_usage; (*pp != NULL); pp++)
BIO_printf(p.errorbio, "%s\n", *pp);
BIO_printf(p.errorbio, "\n");
goto err;
}
/* set input */
if ((in=BIO_new(BIO_s_file())) == NULL) {
if((in=BIO_new(BIO_s_file())) == NULL) {
BIO_printf(p.errorbio, "Error setting input bio\n");
goto err;
} else if (infile == NULL)
BIO_set_fp(in,stdin,BIO_NOCLOSE|BIO_FP_TEXT);
else if (BIO_read_filename(in,infile) <= 0) {
}
else if(infile == NULL)
BIO_set_fp(in, stdin, BIO_NOCLOSE|BIO_FP_TEXT);
else if(BIO_read_filename(in, infile) <= 0) {
BIO_printf(p.errorbio, "Error opening input file %s\n", infile);
BIO_free(in);
goto err;
@ -360,12 +395,13 @@ int main(int argc, char **argv) {
/* set output */
if ((out=BIO_new(BIO_s_file())) == NULL) {
if((out=BIO_new(BIO_s_file())) == NULL) {
BIO_printf(p.errorbio, "Error setting output bio.\n");
goto err;
} else if (outfile == NULL)
BIO_set_fp(out,stdout,BIO_NOCLOSE|BIO_FP_TEXT);
else if (BIO_write_filename(out,outfile) <= 0) {
}
else if(outfile == NULL)
BIO_set_fp(out, stdout, BIO_NOCLOSE|BIO_FP_TEXT);
else if(BIO_write_filename(out, outfile) <= 0) {
BIO_printf(p.errorbio, "Error opening output file %s\n", outfile);
BIO_free(out);
goto err;
@ -374,62 +410,66 @@ int main(int argc, char **argv) {
p.errorbio = BIO_new_fp (stderr, BIO_NOCLOSE);
if (!(p.curl = curl_easy_init())) {
if(!(p.curl = curl_easy_init())) {
BIO_printf(p.errorbio, "Cannot init curl lib\n");
goto err;
}
if (!(p12bio = BIO_new_file(p.p12file , "rb"))) {
BIO_printf(p.errorbio, "Error opening P12 file %s\n", p.p12file); goto err;
if(!(p12bio = BIO_new_file(p.p12file , "rb"))) {
BIO_printf(p.errorbio, "Error opening P12 file %s\n", p.p12file);
goto err;
}
if (!(p.p12 = d2i_PKCS12_bio (p12bio, NULL))) {
BIO_printf(p.errorbio, "Cannot decode P12 structure %s\n", p.p12file); goto err;
if(!(p.p12 = d2i_PKCS12_bio (p12bio, NULL))) {
BIO_printf(p.errorbio, "Cannot decode P12 structure %s\n", p.p12file);
goto err;
}
p.ca= NULL;
if (!(PKCS12_parse (p.p12, p.pst, &(p.pkey), &(p.usercert), &(p.ca) ) )) {
BIO_printf(p.errorbio,"Invalid P12 structure in %s\n", p.p12file); goto err;
if(!(PKCS12_parse (p.p12, p.pst, &(p.pkey), &(p.usercert), &(p.ca) ) )) {
BIO_printf(p.errorbio, "Invalid P12 structure in %s\n", p.p12file);
goto err;
}
if (sk_X509_num(p.ca) <= 0) {
BIO_printf(p.errorbio,"No trustworthy CA given.%s\n", p.p12file); goto err;
if(sk_X509_num(p.ca) <= 0) {
BIO_printf(p.errorbio, "No trustworthy CA given.%s\n", p.p12file);
goto err;
}
if (p.verbose > 1)
X509_print_ex(p.errorbio,p.usercert,0,0);
if(p.verbose > 1)
X509_print_ex(p.errorbio, p.usercert, 0, 0);
/* determine URL to go */
if (hostporturl) {
serverurl = malloc(9+strlen(hostporturl));
sprintf(serverurl,"https://%s",hostporturl);
if(hostporturl) {
size_t len = strlen(hostporturl) + 9;
serverurl = malloc(len);
snprintf(serverurl, len, "https://%s", hostporturl);
}
else if (p.accesstype != 0) { /* see whether we can find an AIA or SIA for a given access type */
if (!(serverurl = my_get_ext(p.usercert,p.accesstype,NID_info_access))) {
else if(p.accesstype != 0) { /* see whether we can find an AIA or SIA for a
given access type */
if(!(serverurl = my_get_ext(p.usercert, p.accesstype, NID_info_access))) {
int j=0;
BIO_printf(p.errorbio,"no service URL in user cert "
BIO_printf(p.errorbio, "no service URL in user cert "
"cherching in others certificats\n");
for (j=0;j<sk_X509_num(p.ca);j++) {
if ((serverurl = my_get_ext(sk_X509_value(p.ca,j),p.accesstype,
for(j=0; j<sk_X509_num(p.ca); j++) {
if((serverurl = my_get_ext(sk_X509_value(p.ca, j), p.accesstype,
NID_info_access)))
break;
if ((serverurl = my_get_ext(sk_X509_value(p.ca,j),p.accesstype,
if((serverurl = my_get_ext(sk_X509_value(p.ca, j), p.accesstype,
NID_sinfo_access)))
break;
}
}
}
if (!serverurl) {
if(!serverurl) {
BIO_printf(p.errorbio, "no service URL in certificats,"
" check '-accesstype (AD_DVCS | ad_timestamping)'"
" or use '-connect'\n");
goto err;
}
if (p.verbose)
if(p.verbose)
BIO_printf(p.errorbio, "Service URL: <%s>\n", serverurl);
curl_easy_setopt(p.curl, CURLOPT_URL, serverurl);
@ -437,38 +477,39 @@ int main(int argc, char **argv) {
/* Now specify the POST binary data */
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDS, binaryptr);
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDSIZE,(long)tabLength);
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDSIZE, (long)tabLength);
/* pass our list of custom made headers */
contenttype = malloc(15+strlen(mimetype));
sprintf(contenttype,"Content-type: %s",mimetype);
headers = curl_slist_append(headers,contenttype);
snprintf(contenttype, 15+strlen(mimetype), "Content-type: %s", mimetype);
headers = curl_slist_append(headers, contenttype);
curl_easy_setopt(p.curl, CURLOPT_HTTPHEADER, headers);
if (p.verbose)
if(p.verbose)
BIO_printf(p.errorbio, "Service URL: <%s>\n", serverurl);
{
FILE *outfp;
BIO_get_fp(out,&outfp);
BIO_get_fp(out, &outfp);
curl_easy_setopt(p.curl, CURLOPT_WRITEDATA, outfp);
}
res = curl_easy_setopt(p.curl, CURLOPT_SSL_CTX_FUNCTION, sslctxfun) ;
res = curl_easy_setopt(p.curl, CURLOPT_SSL_CTX_FUNCTION, sslctxfun);
if (res != CURLE_OK)
BIO_printf(p.errorbio,"%d %s=%d %d\n", __LINE__, "CURLOPT_SSL_CTX_FUNCTION",CURLOPT_SSL_CTX_FUNCTION,res);
if(res != CURLE_OK)
BIO_printf(p.errorbio, "%d %s=%d %d\n", __LINE__,
"CURLOPT_SSL_CTX_FUNCTION", CURLOPT_SSL_CTX_FUNCTION, res);
curl_easy_setopt(p.curl, CURLOPT_SSL_CTX_DATA, &p);
{
int lu; int i=0;
while ((lu = BIO_read (in,&binaryptr[i],tabLength-i)) >0 ) {
while((lu = BIO_read (in, &binaryptr[i], tabLength-i)) >0 ) {
i+=lu;
if (i== tabLength) {
if(i== tabLength) {
tabLength+=100;
binaryptr=realloc(binaryptr,tabLength); /* should be more careful */
binaryptr=realloc(binaryptr, tabLength); /* should be more careful */
}
}
tabLength = i;
@ -476,23 +517,23 @@ int main(int argc, char **argv) {
/* Now specify the POST binary data */
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDS, binaryptr);
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDSIZE,(long)tabLength);
curl_easy_setopt(p.curl, CURLOPT_POSTFIELDSIZE, (long)tabLength);
/* Perform the request, res will get the return code */
BIO_printf(p.errorbio,"%d %s %d\n", __LINE__, "curl_easy_perform",
BIO_printf(p.errorbio, "%d %s %d\n", __LINE__, "curl_easy_perform",
res = curl_easy_perform(p.curl));
{
int result =curl_easy_getinfo(p.curl,CURLINFO_CONTENT_TYPE,&response);
if( mimetypeaccept && p.verbose)
if(!strcmp(mimetypeaccept,response))
BIO_printf(p.errorbio,"the response has a correct mimetype : %s\n",
int result =curl_easy_getinfo(p.curl, CURLINFO_CONTENT_TYPE, &response);
if(mimetypeaccept && p.verbose)
if(!strcmp(mimetypeaccept, response))
BIO_printf(p.errorbio, "the response has a correct mimetype : %s\n",
response);
else
BIO_printf(p.errorbio,"the reponse doesn\'t has an acceptable "
BIO_printf(p.errorbio, "the response doesn\'t have an acceptable "
"mime type, it is %s instead of %s\n",
response,mimetypeaccept);
response, mimetypeaccept);
}
/*** code d'erreur si accept mime ***, egalement code return HTTP != 200 ***/
@ -508,6 +549,6 @@ int main(int argc, char **argv) {
BIO_free(out);
return (EXIT_SUCCESS);
err: BIO_printf(p.errorbio,"error");
err: BIO_printf(p.errorbio, "error");
exit(1);
}

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2016, 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.
* are also available at https://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
@ -19,6 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* Show how CURLOPT_DEBUGFUNCTION can be used.
* </DESC>
*/
#include <stdio.h>
#include <curl/curl.h>
@ -58,14 +62,14 @@ void dump(const char *text,
for(c = 0; (c < width) && (i+c < size); c++) {
/* check for 0D0A; if found, skip past and start a new line of output */
if (nohex && (i+c+1 < size) && ptr[i+c]==0x0D && ptr[i+c+1]==0x0A) {
if(nohex && (i+c+1 < size) && ptr[i+c]==0x0D && ptr[i+c+1]==0x0A) {
i+=(c+2-width);
break;
}
fprintf(stream, "%c",
(ptr[i+c]>=0x20) && (ptr[i+c]<0x80)?ptr[i+c]:'.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
if (nohex && (i+c+2 < size) && ptr[i+c+1]==0x0D && ptr[i+c+2]==0x0A) {
if(nohex && (i+c+2 < size) && ptr[i+c+1]==0x0D && ptr[i+c+2]==0x0A) {
i+=(c+3-width);
break;
}

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2016, 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.
* are also available at https://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
@ -19,6 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* multi socket interface together with libev
* </DESC>
*/
/* Example application source code using the multi socket interface to
* download many files at once.
*
@ -115,12 +119,12 @@ static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
{
DPRINT("%s %li\n", __PRETTY_FUNCTION__, timeout_ms);
ev_timer_stop(g->loop, &g->timer_event);
if (timeout_ms > 0)
{
if(timeout_ms > 0) {
double t = timeout_ms / 1000;
ev_timer_init(&g->timer_event, timer_cb, t, 0.);
ev_timer_start(g->loop, &g->timer_event);
}else
}
else
timer_cb(g->loop, &g->timer_event, 0);
return 0;
}
@ -128,20 +132,32 @@ static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
/* Die if we get a bad CURLMcode somewhere */
static void mcode_or_die(const char *where, CURLMcode code)
{
if ( CURLM_OK != code )
{
if(CURLM_OK != code) {
const char *s;
switch ( code )
{
case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break;
case CURLM_BAD_EASY_HANDLE: s="CURLM_BAD_EASY_HANDLE"; break;
case CURLM_OUT_OF_MEMORY: s="CURLM_OUT_OF_MEMORY"; break;
case CURLM_INTERNAL_ERROR: s="CURLM_INTERNAL_ERROR"; break;
case CURLM_UNKNOWN_OPTION: s="CURLM_UNKNOWN_OPTION"; break;
case CURLM_LAST: s="CURLM_LAST"; break;
default: s="CURLM_unknown";
switch (code) {
case CURLM_BAD_HANDLE:
s="CURLM_BAD_HANDLE";
break;
case CURLM_BAD_SOCKET: s="CURLM_BAD_SOCKET";
case CURLM_BAD_EASY_HANDLE:
s="CURLM_BAD_EASY_HANDLE";
break;
case CURLM_OUT_OF_MEMORY:
s="CURLM_OUT_OF_MEMORY";
break;
case CURLM_INTERNAL_ERROR:
s="CURLM_INTERNAL_ERROR";
break;
case CURLM_UNKNOWN_OPTION:
s="CURLM_UNKNOWN_OPTION";
break;
case CURLM_LAST:
s="CURLM_LAST";
break;
default:
s="CURLM_unknown";
break;
case CURLM_BAD_SOCKET:
s="CURLM_BAD_SOCKET";
fprintf(MSG_OUT, "ERROR: %s returns %s\n", where, s);
/* ignore this error */
return;
@ -164,8 +180,8 @@ static void check_multi_info(GlobalInfo *g)
CURLcode res;
fprintf(MSG_OUT, "REMAINING: %d\n", g->still_running);
while ((msg = curl_multi_info_read(g->multi, &msgs_left))) {
if (msg->msg == CURLMSG_DONE) {
while((msg = curl_multi_info_read(g->multi, &msgs_left))) {
if(msg->msg == CURLMSG_DONE) {
easy = msg->easy_handle;
res = msg->data.result;
curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn);
@ -193,8 +209,7 @@ static void event_cb(EV_P_ struct ev_io *w, int revents)
rc = curl_multi_socket_action(g->multi, w->fd, action, &g->still_running);
mcode_or_die("event_cb: curl_multi_socket_action", rc);
check_multi_info(g);
if ( g->still_running <= 0 )
{
if(g->still_running <= 0) {
fprintf(MSG_OUT, "last transfer done, kill timeout\n");
ev_timer_stop(g->loop, &g->timer_event);
}
@ -208,7 +223,8 @@ static void timer_cb(EV_P_ struct ev_timer *w, int revents)
GlobalInfo *g = (GlobalInfo *)w->data;
CURLMcode rc;
rc = curl_multi_socket_action(g->multi, CURL_SOCKET_TIMEOUT, 0, &g->still_running);
rc = curl_multi_socket_action(g->multi, CURL_SOCKET_TIMEOUT, 0,
&g->still_running);
mcode_or_die("timer_cb: curl_multi_socket_action", rc);
check_multi_info(g);
}
@ -217,9 +233,8 @@ static void timer_cb(EV_P_ struct ev_timer *w, int revents)
static void remsock(SockInfo *f, GlobalInfo *g)
{
printf("%s \n", __PRETTY_FUNCTION__);
if ( f )
{
if ( f->evset )
if(f) {
if(f->evset)
ev_io_stop(g->loop, &f->ev);
free(f);
}
@ -237,7 +252,7 @@ static void setsock(SockInfo*f, curl_socket_t s, CURL*e, int act, GlobalInfo*g)
f->sockfd = s;
f->action = act;
f->easy = e;
if ( f->evset )
if(f->evset)
ev_io_stop(g->loop, &f->ev);
ev_io_init(&f->ev, event_cb, f->sockfd, kind);
f->ev.data = g;
@ -269,18 +284,16 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
fprintf(MSG_OUT,
"socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]);
if ( what == CURL_POLL_REMOVE )
{
if(what == CURL_POLL_REMOVE) {
fprintf(MSG_OUT, "\n");
remsock(fdp, g);
} else
{
if ( !fdp )
{
}
else {
if(!fdp) {
fprintf(MSG_OUT, "Adding data: %s\n", whatstr[what]);
addsock(s, e, what, g);
} else
{
}
else {
fprintf(MSG_OUT,
"Changing action from %s to %s\n",
whatstr[fdp->action], whatstr[what]);
@ -326,8 +339,7 @@ static void new_conn(char *url, GlobalInfo *g )
conn->error[0]='\0';
conn->easy = curl_easy_init();
if ( !conn->easy )
{
if(!conn->easy) {
fprintf(MSG_OUT, "curl_easy_init() failed, exiting!\n");
exit(2);
}
@ -362,16 +374,16 @@ static void fifo_cb(EV_P_ struct ev_io *w, int revents)
int n=0;
GlobalInfo *g = (GlobalInfo *)w->data;
do
{
do {
s[0]='\0';
rv=fscanf(g->input, "%1023s%n", s, &n);
s[n]='\0';
if ( n && s[0] )
{
new_conn(s,g); /* if we read a URL, go get it! */
} else break;
} while ( rv != EOF );
if(n && s[0]) {
new_conn(s, g); /* if we read a URL, go get it! */
}
else
break;
} while(rv != EOF);
}
/* Create a named pipe and tell libevent to monitor it */
@ -382,24 +394,20 @@ static int init_fifo (GlobalInfo *g)
curl_socket_t sockfd;
fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo);
if ( lstat (fifo, &st) == 0 )
{
if ( (st.st_mode & S_IFMT) == S_IFREG )
{
if(lstat (fifo, &st) == 0) {
if((st.st_mode & S_IFMT) == S_IFREG) {
errno = EEXIST;
perror("lstat");
exit (1);
}
}
unlink(fifo);
if ( mkfifo (fifo, 0600) == -1 )
{
if(mkfifo (fifo, 0600) == -1) {
perror("mkfifo");
exit (1);
}
sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0);
if ( sockfd == -1 )
{
if(sockfd == -1) {
perror("open");
exit (1);
}
@ -408,7 +416,7 @@ static int init_fifo (GlobalInfo *g)
fprintf(MSG_OUT, "Now, pipe some URL's into > %s\n", fifo);
ev_io_init(&g->fifo_event, fifo_cb, sockfd, EV_READ);
ev_io_start(g->loop, &g->fifo_event);
return(0);
return (0);
}
int main(int argc, char **argv)

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2016, 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.
* are also available at https://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
@ -19,9 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/*
* This is an example demonstrating how an application can pass in a custom
/* <DESC>
* An example demonstrating how an application can pass in a custom
* socket to libcurl to use. This example also handles the connect itself.
* </DESC>
*/
#include <stdio.h>
#include <string.h>
@ -53,7 +54,7 @@
static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream)
{
int written = fwrite(ptr, size, nmemb, (FILE *)stream);
size_t written = fwrite(ptr, size, nmemb, (FILE *)stream);
return written;
}
@ -91,7 +92,7 @@ int main(void)
WSADATA wsaData;
int initwsa;
if((initwsa = WSAStartup(MAKEWORD(2,0), &wsaData)) != 0) {
if((initwsa = WSAStartup(MAKEWORD(2, 0), &wsaData)) != 0) {
printf("WSAStartup failed: %d\n", initwsa);
return 1;
}
@ -106,7 +107,7 @@ int main(void)
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 ) {
if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == CURL_SOCKET_BAD ) {
printf("Error creating listening socket.\n");
return 3;
}
@ -115,10 +116,10 @@ int main(void)
servaddr.sin_family = AF_INET;
servaddr.sin_port = htons(PORTNUM);
if (INADDR_NONE == (servaddr.sin_addr.s_addr = inet_addr(IPADDR)))
if(INADDR_NONE == (servaddr.sin_addr.s_addr = inet_addr(IPADDR)))
return 2;
if(connect(sockfd,(struct sockaddr *) &servaddr, sizeof(servaddr)) ==
if(connect(sockfd, (struct sockaddr *) &servaddr, sizeof(servaddr)) ==
-1) {
close(sockfd);
printf("client error: connect: %s\n", strerror(errno));

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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.
* are also available at https://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
@ -19,6 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* Upload to a file:// URL
* </DESC>
*/
#include <stdio.h>
#include <curl/curl.h>
#include <sys/stat.h>

View File

@ -42,6 +42,10 @@
*
* This example requires libcurl 7.9.7 or later.
*/
/* <DESC>
* implements an fopen() abstraction allowing reading from URLs
* </DESC>
*/
#include <stdio.h>
#include <string.h>
@ -76,7 +80,7 @@ struct fcurl_data
typedef struct fcurl_data URL_FILE;
/* exported functions */
URL_FILE *url_fopen(const char *url,const char *operation);
URL_FILE *url_fopen(const char *url, const char *operation);
int url_fclose(URL_FILE *file);
int url_feof(URL_FILE *file);
size_t url_fread(void *ptr, size_t size, size_t nmemb, URL_FILE *file);
@ -102,13 +106,13 @@ static size_t write_callback(char *buffer,
if(size > rembuff) {
/* not enough space in buffer */
newbuff=realloc(url->buffer,url->buffer_len + (size - rembuff));
newbuff=realloc(url->buffer, url->buffer_len + (size - rembuff));
if(newbuff==NULL) {
fprintf(stderr,"callback buffer grow failed\n");
fprintf(stderr, "callback buffer grow failed\n");
size=rembuff;
}
else {
/* realloc suceeded increase buffer size*/
/* realloc succeeded increase buffer size*/
url->buffer_len+=size - rembuff;
url->buffer=newbuff;
}
@ -131,7 +135,7 @@ static int fill_buffer(URL_FILE *file, size_t want)
CURLMcode mc; /* curl_multi_fdset() return code */
/* only attempt to fill buffer if transactions still running and buffer
* doesnt exceed required size already
* doesn't exceed required size already
*/
if((!file->still_running) || (file->buffer_pos > want))
return 0;
@ -161,8 +165,7 @@ static int fill_buffer(URL_FILE *file, size_t want)
/* get file descriptors from the transfers */
mc = curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
if(mc != CURLM_OK)
{
if(mc != CURLM_OK) {
fprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mc);
break;
}
@ -205,14 +208,12 @@ static int fill_buffer(URL_FILE *file, size_t want)
}
/* use to remove want bytes from the front of a files buffer */
static int use_buffer(URL_FILE *file,int want)
static int use_buffer(URL_FILE *file, size_t want)
{
/* sort out buffer */
if((file->buffer_pos - want) <=0) {
/* ditch buffer - write will recreate */
if(file->buffer)
free(file->buffer);
free(file->buffer);
file->buffer=NULL;
file->buffer_pos=0;
file->buffer_len=0;
@ -228,10 +229,10 @@ static int use_buffer(URL_FILE *file,int want)
return 0;
}
URL_FILE *url_fopen(const char *url,const char *operation)
URL_FILE *url_fopen(const char *url, const char *operation)
{
/* this code could check for URLs or types in the 'url' and
basicly use the real fopen() for standard files */
basically use the real fopen() for standard files */
URL_FILE *file;
(void)operation;
@ -242,7 +243,7 @@ URL_FILE *url_fopen(const char *url,const char *operation)
memset(file, 0, sizeof(URL_FILE));
if((file->handle.file=fopen(url,operation)))
if((file->handle.file=fopen(url, operation)))
file->type = CFTYPE_FILE; /* marked as URL */
else {
@ -302,9 +303,7 @@ int url_fclose(URL_FILE *file)
break;
}
if(file->buffer)
free(file->buffer);/* free any allocated buffer space */
free(file->buffer);/* free any allocated buffer space */
free(file);
return ret;
@ -338,13 +337,13 @@ size_t url_fread(void *ptr, size_t size, size_t nmemb, URL_FILE *file)
switch(file->type) {
case CFTYPE_FILE:
want=fread(ptr,size,nmemb,file->handle.file);
want=fread(ptr, size, nmemb, file->handle.file);
break;
case CFTYPE_CURL:
want = nmemb * size;
fill_buffer(file,want);
fill_buffer(file, want);
/* check if theres data in the buffer - if not fill_buffer()
* either errored or EOF */
@ -358,7 +357,7 @@ size_t url_fread(void *ptr, size_t size, size_t nmemb, URL_FILE *file)
/* xfer data to caller */
memcpy(ptr, file->buffer, want);
use_buffer(file,want);
use_buffer(file, want);
want = want / size; /* number of items */
break;
@ -379,11 +378,11 @@ char *url_fgets(char *ptr, size_t size, URL_FILE *file)
switch(file->type) {
case CFTYPE_FILE:
ptr = fgets(ptr,size,file->handle.file);
ptr = fgets(ptr, (int)size, file->handle.file);
break;
case CFTYPE_CURL:
fill_buffer(file,want);
fill_buffer(file, want);
/* check if theres data in the buffer - if not fill either errored or
* EOF */
@ -407,7 +406,7 @@ char *url_fgets(char *ptr, size_t size, URL_FILE *file)
memcpy(ptr, file->buffer, want);
ptr[want]=0;/* allways null terminate */
use_buffer(file,want);
use_buffer(file, want);
break;
@ -435,9 +434,7 @@ void url_rewind(URL_FILE *file)
curl_multi_add_handle(multi_handle, file->handle.curl);
/* ditch buffer - write will recreate - resets stream pos*/
if(file->buffer)
free(file->buffer);
free(file->buffer);
file->buffer=NULL;
file->buffer_pos=0;
file->buffer_len=0;
@ -449,6 +446,10 @@ void url_rewind(URL_FILE *file)
}
}
#define FGETSFILE "fgets.test"
#define FREADFILE "fread.test"
#define REWINDFILE "rewind.test"
/* Small main program to retrive from a url using fgets and fread saving the
* output to two test files (note the fgets method will corrupt binary files if
* they contain 0 chars */
@ -457,7 +458,7 @@ int main(int argc, char *argv[])
URL_FILE *handle;
FILE *outf;
int nread;
size_t nread;
char buffer[256];
const char *url;
@ -467,7 +468,7 @@ int main(int argc, char *argv[])
url=argv[1];/* use passed url */
/* copy from url line by line with fgets */
outf=fopen("fgets.test","w+");
outf=fopen(FGETSFILE, "wb+");
if(!outf) {
perror("couldn't open fgets output file\n");
return 1;
@ -481,8 +482,8 @@ int main(int argc, char *argv[])
}
while(!url_feof(handle)) {
url_fgets(buffer,sizeof(buffer),handle);
fwrite(buffer,1,strlen(buffer),outf);
url_fgets(buffer, sizeof(buffer), handle);
fwrite(buffer, 1, strlen(buffer), outf);
}
url_fclose(handle);
@ -491,7 +492,7 @@ int main(int argc, char *argv[])
/* Copy from url with fread */
outf=fopen("fread.test","w+");
outf=fopen(FREADFILE, "wb+");
if(!outf) {
perror("couldn't open fread output file\n");
return 1;
@ -505,8 +506,8 @@ int main(int argc, char *argv[])
}
do {
nread = url_fread(buffer, 1,sizeof(buffer), handle);
fwrite(buffer,1,nread,outf);
nread = url_fread(buffer, 1, sizeof(buffer), handle);
fwrite(buffer, 1, nread, outf);
} while(nread);
url_fclose(handle);
@ -515,7 +516,7 @@ int main(int argc, char *argv[])
/* Test rewind */
outf=fopen("rewind.test","w+");
outf=fopen(REWINDFILE, "wb+");
if(!outf) {
perror("couldn't open fread output file\n");
return 1;
@ -528,21 +529,19 @@ int main(int argc, char *argv[])
return 2;
}
nread = url_fread(buffer, 1,sizeof(buffer), handle);
fwrite(buffer,1,nread,outf);
nread = url_fread(buffer, 1, sizeof(buffer), handle);
fwrite(buffer, 1, nread, outf);
url_rewind(handle);
buffer[0]='\n';
fwrite(buffer,1,1,outf);
nread = url_fread(buffer, 1,sizeof(buffer), handle);
fwrite(buffer,1,nread,outf);
fwrite(buffer, 1, 1, outf);
nread = url_fread(buffer, 1, sizeof(buffer), handle);
fwrite(buffer, 1, nread, outf);
url_fclose(handle);
fclose(outf);
return 0;/* all done */
}

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2016, 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.
* are also available at https://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
@ -19,6 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* FTP wildcard pattern matching
* </DESC>
*/
#include <curl/curl.h>
#include <stdio.h>
@ -115,7 +119,7 @@ static long file_is_coming(struct curl_fileinfo *finfo,
return CURL_CHUNK_BGN_FUNC_SKIP;
}
data->output = fopen(finfo->filename, "w");
data->output = fopen(finfo->filename, "wb");
if(!data->output) {
return CURL_CHUNK_BGN_FUNC_FAIL;
}

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2016, 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.
* are also available at https://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
@ -23,11 +23,9 @@
#include <curl/curl.h>
/*
* This is an example showing how to get a single file from an FTP server.
* It delays the actual destination file creation until the first write
* callback so that it won't create an empty file in case the remote file
* doesn't exist or something else fails.
/* <DESC>
* Get a single file from an FTP server.
* </DESC>
*/
struct FtpFile {
@ -53,7 +51,7 @@ int main(void)
CURL *curl;
CURLcode res;
struct FtpFile ftpfile={
"curl.tar.gz", /* name to store the file as if succesful */
"curl.tar.gz", /* name to store the file as if successful */
NULL
};
@ -65,7 +63,7 @@ int main(void)
* You better replace the URL with one that works!
*/
curl_easy_setopt(curl, CURLOPT_URL,
"ftp://ftp.example.com/pub/www/utilities/curl/curl-7.9.2.tar.gz");
"ftp://ftp.example.com/curl/curl-7.9.2.tar.gz");
/* Define our callback to get called when there's data to be written */
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite);
/* Set a pointer to our struct to pass to the callback */

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2016, 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.
* are also available at https://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
@ -24,9 +24,9 @@
#include <curl/curl.h>
/*
* This is an example showing how to check a single file's size and mtime
* from an FTP server.
/* <DESC>
* Checks a single file's size and mtime from an FTP server.
* </DESC>
*/
static size_t throw_away(void *ptr, size_t size, size_t nmemb, void *data)
@ -65,16 +65,18 @@ int main(void)
res = curl_easy_perform(curl);
if(CURLE_OK == res) {
/* http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html */
/* https://curl.haxx.se/libcurl/c/curl_easy_getinfo.html */
res = curl_easy_getinfo(curl, CURLINFO_FILETIME, &filetime);
if((CURLE_OK == res) && (filetime >= 0)) {
time_t file_time = (time_t)filetime;
printf("filetime %s: %s", filename, ctime(&file_time));
}
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &filesize);
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD,
&filesize);
if((CURLE_OK == res) && (filesize>0.0))
printf("filesize %s: %0.0f bytes\n", filename, filesize);
} else {
}
else {
/* we failed */
fprintf(stderr, "curl told us %d\n", res);
}

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2016, 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.
* are also available at https://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
@ -23,13 +23,11 @@
#include <curl/curl.h>
/*
* Similar to ftpget.c but this also stores the received response-lines
/* <DESC>
* Similar to ftpget.c but also stores the received response-lines
* in a separate file using our own callback!
*
* This functionality was introduced in libcurl 7.9.3.
* </DESC>
*/
static size_t
write_response(void *ptr, size_t size, size_t nmemb, void *data)
{
@ -37,6 +35,9 @@ write_response(void *ptr, size_t size, size_t nmemb, void *data)
return fwrite(ptr, size, nmemb, writehere);
}
#define FTPBODY "ftp-list"
#define FTPHEADERS "ftp-responses"
int main(void)
{
CURL *curl;
@ -45,10 +46,10 @@ int main(void)
FILE *respfile;
/* local file name to store the file as */
ftpfile = fopen("ftp-list", "wb"); /* b is binary, needed on win32 */
ftpfile = fopen(FTPBODY, "wb"); /* b is binary, needed on win32 */
/* local file name to store the FTP server's response lines in */
respfile = fopen("ftp-responses", "wb"); /* b is binary, needed on win32 */
respfile = fopen(FTPHEADERS, "wb"); /* b is binary, needed on win32 */
curl = curl_easy_init();
if(curl) {

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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.
* are also available at https://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
@ -24,11 +24,9 @@
#include <curl/curl.h>
/*
* This is an example showing how to get a single file from an FTPS server.
* It delays the actual destination file creation until the first write
* callback so that it won't create an empty file in case the remote file
* doesn't exist or something else fails.
/* <DESC>
* Get a single file from an FTPS server.
* </DESC>
*/
struct FtpFile {
@ -55,7 +53,7 @@ int main(void)
CURL *curl;
CURLcode res;
struct FtpFile ftpfile={
"yourfile.bin", /* name to store the file as if succesful */
"yourfile.bin", /* name to store the file as if successful */
NULL
};

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2016, 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.
* are also available at https://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
@ -33,11 +33,10 @@
#include <unistd.h>
#endif
/*
* This example shows an FTP upload, with a rename of the file just after
* a successful upload.
*
* Example based on source code provided by Erick Nuwendam. Thanks!
/* <DESC>
* Performs an FTP upload and renames the file just after a successful
* transfer.
* </DESC>
*/
#define LOCAL_FILE "/tmp/uploadthis.txt"
@ -105,7 +104,7 @@ int main(void)
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
/* specify target */
curl_easy_setopt(curl,CURLOPT_URL, REMOTE_URL);
curl_easy_setopt(curl, CURLOPT_URL, REMOTE_URL);
/* pass in that last of FTP commands to run after the transfer */
curl_easy_setopt(curl, CURLOPT_POSTQUOTE, headerlist);

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2016, 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.
* are also available at https://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
@ -19,13 +19,9 @@
* KIND, either express or implied.
*
***************************************************************************/
/* Upload to FTP, resuming failed transfers
*
* Compile for MinGW like this:
* gcc -Wall -pedantic -std=c99 ftpuploadwithresume.c -o ftpuploadresume.exe
* -lcurl -lmsvcr70
*
* Written by Philip Bock
/* <DESC>
* Upload to FTP, resuming failed transfers.
* </DESC>
*/
#include <stdlib.h>
@ -40,7 +36,8 @@
/* The MinGW headers are missing a few Win32 function definitions,
you shouldn't need this if you use VC++ */
#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
@ -53,7 +50,7 @@ size_t getcontentlengthfunc(void *ptr, size_t size, size_t nmemb, void *stream)
/* _snscanf() is Win32 specific */
r = _snscanf(ptr, size * nmemb, "Content-Length: %ld\n", &len);
if (r) /* Microsoft: we don't read the specs */
if(r) /* Microsoft: we don't read the specs */
*((long *) stream) = len;
return size * nmemb;
@ -71,7 +68,7 @@ size_t readfunc(void *ptr, size_t size, size_t nmemb, void *stream)
FILE *f = stream;
size_t n;
if (ferror(f))
if(ferror(f))
return CURL_READFUNC_ABORT;
n = fread(ptr, size, nmemb, f) * size;
@ -89,7 +86,7 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
int c;
f = fopen(localpath, "rb");
if (f == NULL) {
if(!f) {
perror(NULL);
return 0;
}
@ -98,7 +95,7 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
curl_easy_setopt(curlhandle, CURLOPT_URL, remotepath);
if (timeout)
if(timeout)
curl_easy_setopt(curlhandle, CURLOPT_FTP_RESPONSE_TIMEOUT, timeout);
curl_easy_setopt(curlhandle, CURLOPT_HEADERFUNCTION, getcontentlengthfunc);
@ -109,14 +106,15 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
curl_easy_setopt(curlhandle, CURLOPT_READFUNCTION, readfunc);
curl_easy_setopt(curlhandle, CURLOPT_READDATA, f);
curl_easy_setopt(curlhandle, CURLOPT_FTPPORT, "-"); /* disable passive mode */
/* disable passive mode */
curl_easy_setopt(curlhandle, CURLOPT_FTPPORT, "-");
curl_easy_setopt(curlhandle, CURLOPT_FTP_CREATE_MISSING_DIRS, 1L);
curl_easy_setopt(curlhandle, CURLOPT_VERBOSE, 1L);
for (c = 0; (r != CURLE_OK) && (c < tries); c++) {
for(c = 0; (r != CURLE_OK) && (c < tries); c++) {
/* are we resuming? */
if (c) { /* yes */
if(c) { /* yes */
/* determine the length of the file already written */
/*
@ -131,7 +129,7 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
curl_easy_setopt(curlhandle, CURLOPT_HEADER, 1L);
r = curl_easy_perform(curlhandle);
if (r != CURLE_OK)
if(r != CURLE_OK)
continue;
curl_easy_setopt(curlhandle, CURLOPT_NOBODY, 0L);
@ -150,7 +148,7 @@ int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
fclose(f);
if (r == CURLE_OK)
if(r == CURLE_OK)
return 1;
else {
fprintf(stderr, "%s\n", curl_easy_strerror(r));
@ -165,7 +163,8 @@ int main(int c, char **argv)
curl_global_init(CURL_GLOBAL_ALL);
curlhandle = curl_easy_init();
upload(curlhandle, "ftp://user:pass@example.com/path/file", "C:\\file", 0, 3);
upload(curlhandle, "ftp://user:pass@example.com/path/file", "C:\\file",
0, 3);
curl_easy_cleanup(curlhandle);
curl_global_cleanup();

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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.
* are also available at https://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
@ -19,6 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* Use getinfo to get content-type after completed transfer.
* </DESC>
*/
#include <stdio.h>
#include <curl/curl.h>
@ -27,18 +31,14 @@ int main(void)
CURL *curl;
CURLcode res;
/* http://curl.haxx.se/libcurl/c/curl_easy_init.html */
curl = curl_easy_init();
if(curl) {
/* http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTURL */
curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/");
/* http://curl.haxx.se/libcurl/c/curl_easy_perform.html */
res = curl_easy_perform(curl);
if(CURLE_OK == res) {
char *ct;
/* ask for the content-type */
/* http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html */
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &ct);
if((CURLE_OK == res) && ct)
@ -46,7 +46,6 @@ int main(void)
}
/* always cleanup */
/* http://curl.haxx.se/libcurl/c/curl_easy_cleanup.html */
curl_easy_cleanup(curl);
}
return 0;

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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.
* are also available at https://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
@ -19,8 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/* Example source code to show how the callback function can be used to
* download data into a chunk of memory instead of storing it in a file.
/* <DESC>
* Shows how the write callback function can be used to download data into a
* chunk of memory instead of storing it in a file.
* </DESC>
*/
#include <stdio.h>
@ -34,7 +36,6 @@ struct MemoryStruct {
size_t size;
};
static size_t
WriteMemoryCallback(void *contents, size_t size, size_t nmemb, void *userp)
{
@ -55,7 +56,6 @@ WriteMemoryCallback(void *contents, size_t size, size_t nmemb, void *userp)
return realsize;
}
int main(void)
{
CURL *curl_handle;
@ -106,8 +106,7 @@ int main(void)
/* cleanup curl stuff */
curl_easy_cleanup(curl_handle);
if(chunk.memory)
free(chunk.memory);
free(chunk.memory);
/* we're done with libcurl, so clean it up */
curl_global_cleanup();

View File

@ -0,0 +1,70 @@
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2016, 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 https://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.
*
***************************************************************************/
/* <DESC>
* Show how to extract Location: header and URL to redirect to.
* </DESC>
*/
#include <stdio.h>
#include <curl/curl.h>
int main(void)
{
CURL *curl;
CURLcode res;
char *location;
long response_code;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
/* example.com is redirected, figure out the redirection! */
/* Perform the request, res will get the return code */
res = curl_easy_perform(curl);
/* Check for errors */
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
else {
res = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
if((res == CURLE_OK) &&
((response_code / 100) != 3)) {
/* a redirect implies a 3xx response code */
fprintf(stderr, "Not a redirect.\n");
}
else {
res = curl_easy_getinfo(curl, CURLINFO_REDIRECT_URL, &location);
if((res == CURLE_OK) && location) {
/* This is the new absolute URL that you could redirect to, even if
* the Location: response header may have been a relative URL. */
printf("Redirected to: %s\n", location);
}
}
}
/* always cleanup */
curl_easy_cleanup(curl);
}
return 0;
}

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2016, 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.
* are also available at https://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
@ -19,38 +19,41 @@
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* multi socket API usage together with with glib2
* </DESC>
*/
/* Example application source code using the multi socket interface to
* download many files at once.
*
* Written by Jeff Pohlmeyer
Requires glib-2.x and a (POSIX?) system that has mkfifo().
Requires glib-2.x and a (POSIX?) system that has mkfifo().
This is an adaptation of libcurl's "hipev.c" and libevent's "event-test.c"
sample programs, adapted to use glib's g_io_channel in place of libevent.
This is an adaptation of libcurl's "hipev.c" and libevent's "event-test.c"
sample programs, adapted to use glib's g_io_channel in place of libevent.
When running, the program creates the named pipe "hiper.fifo"
When running, the program creates the named pipe "hiper.fifo"
Whenever there is input into the fifo, the program reads the input as a list
of URL's and creates some new easy handles to fetch each URL via the
curl_multi "hiper" API.
Whenever there is input into the fifo, the program reads the input as a list
of URL's and creates some new easy handles to fetch each URL via the
curl_multi "hiper" API.
Thus, you can try a single URL:
% echo http://www.yahoo.com > hiper.fifo
Thus, you can try a single URL:
% echo http://www.yahoo.com > hiper.fifo
Or a whole bunch of them:
% cat my-url-list > hiper.fifo
Or a whole bunch of them:
% cat my-url-list > hiper.fifo
The fifo buffer is handled almost instantly, so you can even add more URL's
while the previous requests are still being downloaded.
The fifo buffer is handled almost instantly, so you can even add more URL's
while the previous requests are still being downloaded.
This is purely a demo app, all retrieved data is simply discarded by the write
callback.
This is purely a demo app, all retrieved data is simply discarded by the write
callback.
*/
#include <glib.h>
#include <sys/stat.h>
#include <unistd.h>
@ -60,13 +63,10 @@ callback.
#include <errno.h>
#include <curl/curl.h>
#define MSG_OUT g_print /* Change to "g_error" to write to stderr */
#define SHOW_VERBOSE 0 /* Set to non-zero for libcurl messages */
#define SHOW_PROGRESS 0 /* Set to non-zero to enable progress callback */
/* Global information, common to all connections */
typedef struct _GlobalInfo {
CURLM *multi;
@ -74,8 +74,6 @@ typedef struct _GlobalInfo {
int still_running;
} GlobalInfo;
/* Information associated with a specific easy handle */
typedef struct _ConnInfo {
CURL *easy;
@ -84,7 +82,6 @@ typedef struct _ConnInfo {
char error[CURL_ERROR_SIZE];
} ConnInfo;
/* Information associated with a specific socket */
typedef struct _SockInfo {
curl_socket_t sockfd;
@ -96,30 +93,25 @@ typedef struct _SockInfo {
GlobalInfo *global;
} SockInfo;
/* Die if we get a bad CURLMcode somewhere */
static void mcode_or_die(const char *where, CURLMcode code) {
if ( CURLM_OK != code ) {
if(CURLM_OK != code) {
const char *s;
switch (code) {
case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break;
case CURLM_BAD_EASY_HANDLE: s="CURLM_BAD_EASY_HANDLE"; break;
case CURLM_OUT_OF_MEMORY: s="CURLM_OUT_OF_MEMORY"; break;
case CURLM_INTERNAL_ERROR: s="CURLM_INTERNAL_ERROR"; break;
case CURLM_BAD_SOCKET: s="CURLM_BAD_SOCKET"; break;
case CURLM_UNKNOWN_OPTION: s="CURLM_UNKNOWN_OPTION"; break;
case CURLM_LAST: s="CURLM_LAST"; break;
default: s="CURLM_unknown";
case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break;
case CURLM_BAD_EASY_HANDLE: s="CURLM_BAD_EASY_HANDLE"; break;
case CURLM_OUT_OF_MEMORY: s="CURLM_OUT_OF_MEMORY"; break;
case CURLM_INTERNAL_ERROR: s="CURLM_INTERNAL_ERROR"; break;
case CURLM_BAD_SOCKET: s="CURLM_BAD_SOCKET"; break;
case CURLM_UNKNOWN_OPTION: s="CURLM_UNKNOWN_OPTION"; break;
case CURLM_LAST: s="CURLM_LAST"; break;
default: s="CURLM_unknown";
}
MSG_OUT("ERROR: %s returns %s\n", where, s);
exit(code);
}
}
/* Check for completed transfers, and remove their easy handles */
static void check_multi_info(GlobalInfo *g)
{
@ -131,8 +123,8 @@ static void check_multi_info(GlobalInfo *g)
CURLcode res;
MSG_OUT("REMAINING: %d\n", g->still_running);
while ((msg = curl_multi_info_read(g->multi, &msgs_left))) {
if (msg->msg == CURLMSG_DONE) {
while((msg = curl_multi_info_read(g->multi, &msgs_left))) {
if(msg->msg == CURLMSG_DONE) {
easy = msg->easy_handle;
res = msg->data.result;
curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn);
@ -146,8 +138,6 @@ static void check_multi_info(GlobalInfo *g)
}
}
/* Called by glib when our timeout expires */
static gboolean timer_cb(gpointer data)
{
@ -155,14 +145,12 @@ static gboolean timer_cb(gpointer data)
CURLMcode rc;
rc = curl_multi_socket_action(g->multi,
CURL_SOCKET_TIMEOUT, 0, &g->still_running);
CURL_SOCKET_TIMEOUT, 0, &g->still_running);
mcode_or_die("timer_cb: curl_multi_socket_action", rc);
check_multi_info(g);
return FALSE;
}
/* Update the event timer after curl_multi library calls */
static int update_timeout_cb(CURLM *multi, long timeout_ms, void *userp)
{
@ -172,15 +160,12 @@ static int update_timeout_cb(CURLM *multi, long timeout_ms, void *userp)
timeout.tv_usec = (timeout_ms%1000)*1000;
MSG_OUT("*** update_timeout_cb %ld => %ld:%ld ***\n",
timeout_ms, timeout.tv_sec, timeout.tv_usec);
timeout_ms, timeout.tv_sec, timeout.tv_usec);
g->timer_event = g_timeout_add(timeout_ms, timer_cb, g);
return 0;
}
/* Called by glib when we get action on a multi socket */
static gboolean event_cb(GIOChannel *ch, GIOCondition condition, gpointer data)
{
@ -198,41 +183,43 @@ static gboolean event_cb(GIOChannel *ch, GIOCondition condition, gpointer data)
check_multi_info(g);
if(g->still_running) {
return TRUE;
} else {
}
else {
MSG_OUT("last transfer done, kill timeout\n");
if (g->timer_event) { g_source_remove(g->timer_event); }
if(g->timer_event) {
g_source_remove(g->timer_event);
}
return FALSE;
}
}
/* Clean up the SockInfo structure */
static void remsock(SockInfo *f)
{
if (!f) { return; }
if (f->ev) { g_source_remove(f->ev); }
if(!f) {
return;
}
if(f->ev) {
g_source_remove(f->ev);
}
g_free(f);
}
/* Assign information to a SockInfo structure */
static void setsock(SockInfo*f, curl_socket_t s, CURL*e, int act, GlobalInfo*g)
{
GIOCondition kind =
(act&CURL_POLL_IN?G_IO_IN:0)|(act&CURL_POLL_OUT?G_IO_OUT:0);
(act&CURL_POLL_IN?G_IO_IN:0)|(act&CURL_POLL_OUT?G_IO_OUT:0);
f->sockfd = s;
f->action = act;
f->easy = e;
if (f->ev) { g_source_remove(f->ev); }
f->ev=g_io_add_watch(f->ch, kind, event_cb,g);
if(f->ev) {
g_source_remove(f->ev);
}
f->ev=g_io_add_watch(f->ch, kind, event_cb, g);
}
/* Initialize a new SockInfo structure */
static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g)
{
@ -244,8 +231,6 @@ static void addsock(curl_socket_t s, CURL *easy, int action, GlobalInfo *g)
curl_multi_assign(g->multi, s, fdp);
}
/* CURLMOPT_SOCKETFUNCTION */
static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
{
@ -254,14 +239,15 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
static const char *whatstr[]={ "none", "IN", "OUT", "INOUT", "REMOVE" };
MSG_OUT("socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]);
if (what == CURL_POLL_REMOVE) {
if(what == CURL_POLL_REMOVE) {
MSG_OUT("\n");
remsock(fdp);
} else {
if (!fdp) {
}
else {
if(!fdp) {
MSG_OUT("Adding data: %s%s\n",
what&CURL_POLL_IN?"READ":"",
what&CURL_POLL_OUT?"WRITE":"" );
what&CURL_POLL_IN?"READ":"",
what&CURL_POLL_OUT?"WRITE":"" );
addsock(s, e, what, g);
}
else {
@ -273,8 +259,6 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
return 0;
}
/* CURLOPT_WRITEFUNCTION */
static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data)
{
@ -285,18 +269,15 @@ static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data)
return realsize;
}
/* CURLOPT_PROGRESSFUNCTION */
static int prog_cb (void *p, double dltotal, double dlnow, double ult, double uln)
static int prog_cb (void *p, double dltotal, double dlnow, double ult,
double uln)
{
ConnInfo *conn = (ConnInfo *)p;
MSG_OUT("Progress: %s (%g/%g)\n", conn->url, dlnow, dltotal);
return 0;
}
/* Create a new easy handle, and add it to the global curl_multi */
static void new_conn(char *url, GlobalInfo *g )
{
@ -304,11 +285,9 @@ static void new_conn(char *url, GlobalInfo *g )
CURLMcode rc;
conn = g_malloc0(sizeof(ConnInfo));
conn->error[0]='\0';
conn->easy = curl_easy_init();
if (!conn->easy) {
if(!conn->easy) {
MSG_OUT("curl_easy_init() failed, exiting!\n");
exit(2);
}
@ -336,93 +315,90 @@ static void new_conn(char *url, GlobalInfo *g )
that the necessary socket_action() call will be called by this app */
}
/* This gets called by glib whenever data is received from the fifo */
static gboolean fifo_cb (GIOChannel *ch, GIOCondition condition, gpointer data)
{
#define BUF_SIZE 1024
#define BUF_SIZE 1024
gsize len, tp;
gchar *buf, *tmp, *all=NULL;
GIOStatus rv;
do {
GError *err=NULL;
rv = g_io_channel_read_line (ch,&buf,&len,&tp,&err);
if ( buf ) {
if (tp) { buf[tp]='\0'; }
new_conn(buf,(GlobalInfo*)data);
rv = g_io_channel_read_line(ch, &buf, &len, &tp, &err);
if(buf) {
if(tp) {
buf[tp]='\0';
}
new_conn(buf, (GlobalInfo*)data);
g_free(buf);
} else {
}
else {
buf = g_malloc(BUF_SIZE+1);
while (TRUE) {
while(TRUE) {
buf[BUF_SIZE]='\0';
g_io_channel_read_chars(ch,buf,BUF_SIZE,&len,&err);
if (len) {
g_io_channel_read_chars(ch, buf, BUF_SIZE, &len, &err);
if(len) {
buf[len]='\0';
if (all) {
if(all) {
tmp=all;
all=g_strdup_printf("%s%s", tmp, buf);
g_free(tmp);
} else {
}
else {
all = g_strdup(buf);
}
} else {
break;
}
else {
break;
}
}
if (all) {
new_conn(all,(GlobalInfo*)data);
if(all) {
new_conn(all, (GlobalInfo*)data);
g_free(all);
}
g_free(buf);
}
if ( err ) {
if(err) {
g_error("fifo_cb: %s", err->message);
g_free(err);
break;
}
} while ( (len) && (rv == G_IO_STATUS_NORMAL) );
} while((len) && (rv == G_IO_STATUS_NORMAL));
return TRUE;
}
int init_fifo(void)
{
struct stat st;
const char *fifo = "hiper.fifo";
int socket;
struct stat st;
const char *fifo = "hiper.fifo";
int socket;
if (lstat (fifo, &st) == 0) {
if ((st.st_mode & S_IFMT) == S_IFREG) {
errno = EEXIST;
perror("lstat");
exit (1);
if(lstat (fifo, &st) == 0) {
if((st.st_mode & S_IFMT) == S_IFREG) {
errno = EEXIST;
perror("lstat");
exit (1);
}
}
}
unlink (fifo);
if (mkfifo (fifo, 0600) == -1) {
perror("mkfifo");
exit (1);
}
unlink (fifo);
if(mkfifo (fifo, 0600) == -1) {
perror("mkfifo");
exit (1);
}
socket = open (fifo, O_RDWR | O_NONBLOCK, 0);
socket = open (fifo, O_RDWR | O_NONBLOCK, 0);
if (socket == -1) {
perror("open");
exit (1);
}
MSG_OUT("Now, pipe some URL's into > %s\n", fifo);
return socket;
if(socket == -1) {
perror("open");
exit (1);
}
MSG_OUT("Now, pipe some URL's into > %s\n", fifo);
return socket;
}
int main(int argc, char **argv)
{
GlobalInfo *g;
@ -434,8 +410,8 @@ int main(int argc, char **argv)
fd=init_fifo();
ch=g_io_channel_unix_new(fd);
g_io_add_watch(ch,G_IO_IN,fifo_cb,g);
gmain=g_main_loop_new(NULL,FALSE);
g_io_add_watch(ch, G_IO_IN, fifo_cb, g);
gmain=g_main_loop_new(NULL, FALSE);
g->multi = curl_multi_init();
curl_multi_setopt(g->multi, CURLMOPT_SOCKETFUNCTION, sock_cb);
curl_multi_setopt(g->multi, CURLMOPT_SOCKETDATA, g);

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2016, 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.
* are also available at https://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
@ -19,6 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* multi socket API usage with libevent 2
* </DESC>
*/
/* Example application source code using the multi socket interface to
download many files at once.
@ -122,7 +126,7 @@ static int multi_timer_cb(CURLM *multi, long timeout_ms, GlobalInfo *g)
/* Die if we get a bad CURLMcode somewhere */
static void mcode_or_die(const char *where, CURLMcode code)
{
if ( CURLM_OK != code ) {
if(CURLM_OK != code) {
const char *s;
switch (code) {
case CURLM_BAD_HANDLE: s="CURLM_BAD_HANDLE"; break;
@ -156,8 +160,8 @@ static void check_multi_info(GlobalInfo *g)
CURLcode res;
fprintf(MSG_OUT, "REMAINING: %d\n", g->still_running);
while ((msg = curl_multi_info_read(g->multi, &msgs_left))) {
if (msg->msg == CURLMSG_DONE) {
while((msg = curl_multi_info_read(g->multi, &msgs_left))) {
if(msg->msg == CURLMSG_DONE) {
easy = msg->easy_handle;
res = msg->data.result;
curl_easy_getinfo(easy, CURLINFO_PRIVATE, &conn);
@ -187,9 +191,9 @@ static void event_cb(int fd, short kind, void *userp)
mcode_or_die("event_cb: curl_multi_socket_action", rc);
check_multi_info(g);
if ( g->still_running <= 0 ) {
if(g->still_running <= 0 ) {
fprintf(MSG_OUT, "last transfer done, kill timeout\n");
if (evtimer_pending(g->timer_event, NULL)) {
if(evtimer_pending(g->timer_event, NULL)) {
evtimer_del(g->timer_event);
}
}
@ -216,8 +220,8 @@ static void timer_cb(int fd, short kind, void *userp)
/* Clean up the SockInfo structure */
static void remsock(SockInfo *f)
{
if (f) {
if (f->evset)
if(f) {
if(f->evset)
event_free(f->ev);
free(f);
}
@ -234,7 +238,7 @@ static void setsock(SockInfo*f, curl_socket_t s, CURL*e, int act, GlobalInfo*g)
f->sockfd = s;
f->action = act;
f->easy = e;
if (f->evset)
if(f->evset)
event_free(f->ev);
f->ev = event_new(g->evbase, f->sockfd, kind, event_cb, g);
f->evset = 1;
@ -262,12 +266,12 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
fprintf(MSG_OUT,
"socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]);
if (what == CURL_POLL_REMOVE) {
if(what == CURL_POLL_REMOVE) {
fprintf(MSG_OUT, "\n");
remsock(fdp);
}
else {
if (!fdp) {
if(!fdp) {
fprintf(MSG_OUT, "Adding data: %s\n", whatstr[what]);
addsock(s, e, what, g);
}
@ -318,7 +322,7 @@ static void new_conn(char *url, GlobalInfo *g )
conn->error[0]='\0';
conn->easy = curl_easy_init();
if (!conn->easy) {
if(!conn->easy) {
fprintf(MSG_OUT, "curl_easy_init() failed, exiting!\n");
exit(2);
}
@ -326,7 +330,7 @@ static void new_conn(char *url, GlobalInfo *g )
conn->url = strdup(url);
curl_easy_setopt(conn->easy, CURLOPT_URL, conn->url);
curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, &conn);
curl_easy_setopt(conn->easy, CURLOPT_WRITEDATA, conn);
curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error);
curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn);
@ -356,10 +360,12 @@ static void fifo_cb(int fd, short event, void *arg)
s[0]='\0';
rv=fscanf(g->input, "%1023s%n", s, &n);
s[n]='\0';
if ( n && s[0] ) {
new_conn(s,arg); /* if we read a URL, go get it! */
} else break;
} while ( rv != EOF);
if(n && s[0] ) {
new_conn(s, arg); /* if we read a URL, go get it! */
}
else
break;
} while(rv != EOF);
}
/* Create a named pipe and tell libevent to monitor it */
@ -370,20 +376,20 @@ static int init_fifo (GlobalInfo *g)
curl_socket_t sockfd;
fprintf(MSG_OUT, "Creating named pipe \"%s\"\n", fifo);
if (lstat (fifo, &st) == 0) {
if ((st.st_mode & S_IFMT) == S_IFREG) {
if(lstat (fifo, &st) == 0) {
if((st.st_mode & S_IFMT) == S_IFREG) {
errno = EEXIST;
perror("lstat");
exit (1);
}
}
unlink(fifo);
if (mkfifo (fifo, 0600) == -1) {
if(mkfifo (fifo, 0600) == -1) {
perror("mkfifo");
exit (1);
}
sockfd = open(fifo, O_RDWR | O_NONBLOCK, 0);
if (sockfd == -1) {
if(sockfd == -1) {
perror("open");
exit (1);
}

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 2012 - 2016, 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.
* are also available at https://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
@ -20,13 +20,13 @@
*
***************************************************************************/
/* <DESC>
* Uses the "Streaming HTML parser" to extract the href pieces in a streaming
* manner from a downloaded HTML.
* </DESC>
*/
/*
* This example uses the "Streaming HTML parser" to extract the href pieces in
* a streaming manner from a downloaded HTML. Kindly donated by Michał
* Kowalczyk.
*
* The parser is found at
* http://code.google.com/p/htmlstreamparser/
* The HTML parser is found at http://code.google.com/p/htmlstreamparser/
*/
#include <stdio.h>
@ -38,11 +38,11 @@ static size_t write_callback(void *buffer, size_t size, size_t nmemb,
void *hsp)
{
size_t realsize = size * nmemb, p;
for (p = 0; p < realsize; p++) {
for(p = 0; p < realsize; p++) {
html_parser_char_parse(hsp, ((char *)buffer)[p]);
if (html_parser_cmp_tag(hsp, "a", 1))
if (html_parser_cmp_attr(hsp, "href", 4))
if (html_parser_is_in(hsp, HTML_VALUE_ENDED)) {
if(html_parser_cmp_tag(hsp, "a", 1))
if(html_parser_cmp_attr(hsp, "href", 4))
if(html_parser_is_in(hsp, HTML_VALUE_ENDED)) {
html_parser_val(hsp)[html_parser_val_length(hsp)] = '\0';
printf("%s\n", html_parser_val(hsp));
}
@ -56,7 +56,7 @@ int main(int argc, char *argv[])
CURL *curl;
HTMLSTREAMPARSER *hsp;
if (argc != 2) {
if(argc != 2) {
printf("Usage: %s URL\n", argv[0]);
return EXIT_FAILURE;
}

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2016, 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.
* are also available at https://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
@ -19,13 +19,12 @@
* KIND, either express or implied.
*
***************************************************************************/
/* Download a document and use libtidy to parse the HTML.
* Written by Jeff Pohlmeyer
*
/* <DESC>
* Download a document and use libtidy to parse the HTML.
* </DESC>
*/
/*
* LibTidy => http://tidy.sourceforge.net
*
* gcc -Wall -I/usr/local/include tidycurl.c -lcurl -ltidy -o tidycurl
*
*/
#include <stdio.h>
@ -39,23 +38,21 @@ uint write_cb(char *in, uint size, uint nmemb, TidyBuffer *out)
uint r;
r = size * nmemb;
tidyBufAppend( out, in, r );
return(r);
return r;
}
/* Traverse the document tree */
void dumpNode(TidyDoc doc, TidyNode tnod, int indent )
{
TidyNode child;
for ( child = tidyGetChild(tnod); child; child = tidyGetNext(child) )
{
for(child = tidyGetChild(tnod); child; child = tidyGetNext(child) ) {
ctmbstr name = tidyNodeGetName( child );
if ( name )
{
if(name) {
/* if it has a name, then it's an HTML tag ... */
TidyAttr attr;
printf( "%*.*s%s ", indent, indent, "<", name);
/* walk the attribute list */
for ( attr=tidyAttrFirst(child); attr; attr=tidyAttrNext(attr) ) {
for(attr=tidyAttrFirst(child); attr; attr=tidyAttrNext(attr) ) {
printf(tidyAttrName(attr));
tidyAttrValue(attr)?printf("=\"%s\" ",
tidyAttrValue(attr)):printf(" ");
@ -83,7 +80,7 @@ int main(int argc, char **argv )
TidyBuffer docbuf = {0};
TidyBuffer tidy_errbuf = {0};
int err;
if ( argc == 2) {
if(argc == 2) {
curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_errbuf);
@ -99,13 +96,13 @@ int main(int argc, char **argv )
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &docbuf);
err=curl_easy_perform(curl);
if ( !err ) {
if(!err) {
err = tidyParseBuffer(tdoc, &docbuf); /* parse the input */
if ( err >= 0 ) {
if(err >= 0) {
err = tidyCleanAndRepair(tdoc); /* fix any problems */
if ( err >= 0 ) {
if(err >= 0) {
err = tidyRunDiagnostics(tdoc); /* load tidy error buffer */
if ( err >= 0 ) {
if(err >= 0) {
dumpNode( tdoc, tidyGetRoot(tdoc), 0 ); /* walk the tree */
fprintf(stderr, "%s\n", tidy_errbuf.bp); /* show errors */
}
@ -120,11 +117,11 @@ int main(int argc, char **argv )
tidyBufFree(&docbuf);
tidyBufFree(&tidy_errbuf);
tidyRelease(tdoc);
return(err);
return err;
}
else
printf( "usage: %s <url>\n", argv[0] );
return(0);
return 0;
}

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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.
* are also available at https://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
@ -19,8 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
// Get a web page, parse it with libxml.
//
/* <DESC>
* Get a web page, extract the title with libxml.
* </DESC>
*/
// Written by Lars Nilsson
//
// GNU C++ compile command line suggestion (edit paths accordingly):
@ -40,7 +42,7 @@
//
#ifdef _MSC_VER
#define COMPARE(a, b) (!stricmp((a), (b)))
#define COMPARE(a, b) (!_stricmp((a), (b)))
#else
#define COMPARE(a, b) (!strcasecmp((a), (b)))
#endif

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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.
* are also available at https://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
@ -19,6 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* simple HTTP POST using the easy interface
* </DESC>
*/
#include <stdio.h>
#include <curl/curl.h>

View File

@ -0,0 +1,292 @@
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2016, 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 https://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.
*
***************************************************************************/
/* <DESC>
* Multiplexed HTTP/2 downloads over a single connection
* </DESC>
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* somewhat unix-specific */
#include <sys/time.h>
#include <unistd.h>
/* curl stuff */
#include <curl/curl.h>
#ifndef CURLPIPE_MULTIPLEX
/* This little trick will just make sure that we don't enable pipelining for
libcurls old enough to not have this symbol. It is _not_ defined to zero in
a recent libcurl header. */
#define CURLPIPE_MULTIPLEX 0
#endif
#define NUM_HANDLES 1000
void *curl_hnd[NUM_HANDLES];
int num_transfers;
/* a handle to number lookup, highly ineffective when we do many
transfers... */
static int hnd2num(CURL *hnd)
{
int i;
for(i=0; i< num_transfers; i++) {
if(curl_hnd[i] == hnd)
return i;
}
return 0; /* weird, but just a fail-safe */
}
static
void dump(const char *text, int num, unsigned char *ptr, size_t size,
char nohex)
{
size_t i;
size_t c;
unsigned int width=0x10;
if(nohex)
/* without the hex output, we can fit more on screen */
width = 0x40;
fprintf(stderr, "%d %s, %ld bytes (0x%lx)\n",
num, text, (long)size, (long)size);
for(i=0; i<size; i+= width) {
fprintf(stderr, "%4.4lx: ", (long)i);
if(!nohex) {
/* hex not disabled, show it */
for(c = 0; c < width; c++)
if(i+c < size)
fprintf(stderr, "%02x ", ptr[i+c]);
else
fputs(" ", stderr);
}
for(c = 0; (c < width) && (i+c < size); c++) {
/* check for 0D0A; if found, skip past and start a new line of output */
if(nohex && (i+c+1 < size) && ptr[i+c]==0x0D && ptr[i+c+1]==0x0A) {
i+=(c+2-width);
break;
}
fprintf(stderr, "%c",
(ptr[i+c]>=0x20) && (ptr[i+c]<0x80)?ptr[i+c]:'.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
if(nohex && (i+c+2 < size) && ptr[i+c+1]==0x0D && ptr[i+c+2]==0x0A) {
i+=(c+3-width);
break;
}
}
fputc('\n', stderr); /* newline */
}
}
static
int my_trace(CURL *handle, curl_infotype type,
char *data, size_t size,
void *userp)
{
const char *text;
int num = hnd2num(handle);
(void)handle; /* prevent compiler warning */
(void)userp;
switch (type) {
case CURLINFO_TEXT:
fprintf(stderr, "== %d Info: %s", num, data);
default: /* in case a new one is introduced to shock us */
return 0;
case CURLINFO_HEADER_OUT:
text = "=> Send header";
break;
case CURLINFO_DATA_OUT:
text = "=> Send data";
break;
case CURLINFO_SSL_DATA_OUT:
text = "=> Send SSL data";
break;
case CURLINFO_HEADER_IN:
text = "<= Recv header";
break;
case CURLINFO_DATA_IN:
text = "<= Recv data";
break;
case CURLINFO_SSL_DATA_IN:
text = "<= Recv SSL data";
break;
}
dump(text, num, (unsigned char *)data, size, 1);
return 0;
}
static void setup(CURL *hnd, int num)
{
FILE *out;
char filename[128];
snprintf(filename, 128, "dl-%d", num);
out = fopen(filename, "wb");
/* write to this file */
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, out);
/* set the same URL */
curl_easy_setopt(hnd, CURLOPT_URL, "https://localhost:8443/index.html");
/* send it verbose for max debuggaility */
curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(hnd, CURLOPT_DEBUGFUNCTION, my_trace);
/* HTTP/2 please */
curl_easy_setopt(hnd, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
/* we use a self-signed test server, skip verification during debugging */
curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYHOST, 0L);
#if (CURLPIPE_MULTIPLEX > 0)
/* wait for pipe connection to confirm */
curl_easy_setopt(hnd, CURLOPT_PIPEWAIT, 1L);
#endif
curl_hnd[num] = hnd;
}
/*
* Simply download two files over HTTP/2, using the same physical connection!
*/
int main(int argc, char **argv)
{
CURL *easy[NUM_HANDLES];
CURLM *multi_handle;
int i;
int still_running; /* keep number of running handles */
if(argc > 1)
/* if given a number, do that many transfers */
num_transfers = atoi(argv[1]);
if(!num_transfers || (num_transfers > NUM_HANDLES))
num_transfers = 3; /* a suitable low default */
/* init a multi stack */
multi_handle = curl_multi_init();
for(i=0; i<num_transfers; i++) {
easy[i] = curl_easy_init();
/* set options */
setup(easy[i], i);
/* add the individual transfer */
curl_multi_add_handle(multi_handle, easy[i]);
}
curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX);
/* we start some action by calling perform right away */
curl_multi_perform(multi_handle, &still_running);
do {
struct timeval timeout;
int rc; /* select() return code */
CURLMcode mc; /* curl_multi_fdset() return code */
fd_set fdread;
fd_set fdwrite;
fd_set fdexcep;
int maxfd = -1;
long curl_timeo = -1;
FD_ZERO(&fdread);
FD_ZERO(&fdwrite);
FD_ZERO(&fdexcep);
/* set a suitable timeout to play around with */
timeout.tv_sec = 1;
timeout.tv_usec = 0;
curl_multi_timeout(multi_handle, &curl_timeo);
if(curl_timeo >= 0) {
timeout.tv_sec = curl_timeo / 1000;
if(timeout.tv_sec > 1)
timeout.tv_sec = 1;
else
timeout.tv_usec = (curl_timeo % 1000) * 1000;
}
/* get file descriptors from the transfers */
mc = curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
if(mc != CURLM_OK) {
fprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mc);
break;
}
/* On success the value of maxfd is guaranteed to be >= -1. We call
select(maxfd + 1, ...); specially in case of (maxfd == -1) there are
no fds ready yet so we call select(0, ...) --or Sleep() on Windows--
to sleep 100ms, which is the minimum suggested value in the
curl_multi_fdset() doc. */
if(maxfd == -1) {
#ifdef _WIN32
Sleep(100);
rc = 0;
#else
/* Portable sleep for platforms other than Windows. */
struct timeval wait = { 0, 100 * 1000 }; /* 100ms */
rc = select(0, NULL, NULL, NULL, &wait);
#endif
}
else {
/* Note that on some platforms 'timeout' may be modified by select().
If you need access to the original value save a copy beforehand. */
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
}
switch(rc) {
case -1:
/* select error */
break;
case 0:
default:
/* timeout or readable/writable sockets */
curl_multi_perform(multi_handle, &still_running);
break;
}
} while(still_running);
curl_multi_cleanup(multi_handle);
for(i=0; i<num_transfers; i++)
curl_easy_cleanup(easy[i]);
return 0;
}

View File

@ -0,0 +1,320 @@
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2016, 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 https://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.
*
***************************************************************************/
/* <DESC>
* HTTP/2 server push
* </DESC>
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* somewhat unix-specific */
#include <sys/time.h>
#include <unistd.h>
/* curl stuff */
#include <curl/curl.h>
#ifndef CURLPIPE_MULTIPLEX
#error "too old libcurl, can't do HTTP/2 server push!"
#endif
static
void dump(const char *text, unsigned char *ptr, size_t size,
char nohex)
{
size_t i;
size_t c;
unsigned int width=0x10;
if(nohex)
/* without the hex output, we can fit more on screen */
width = 0x40;
fprintf(stderr, "%s, %ld bytes (0x%lx)\n",
text, (long)size, (long)size);
for(i=0; i<size; i+= width) {
fprintf(stderr, "%4.4lx: ", (long)i);
if(!nohex) {
/* hex not disabled, show it */
for(c = 0; c < width; c++)
if(i+c < size)
fprintf(stderr, "%02x ", ptr[i+c]);
else
fputs(" ", stderr);
}
for(c = 0; (c < width) && (i+c < size); c++) {
/* check for 0D0A; if found, skip past and start a new line of output */
if(nohex && (i+c+1 < size) && ptr[i+c]==0x0D && ptr[i+c+1]==0x0A) {
i+=(c+2-width);
break;
}
fprintf(stderr, "%c",
(ptr[i+c]>=0x20) && (ptr[i+c]<0x80)?ptr[i+c]:'.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
if(nohex && (i+c+2 < size) && ptr[i+c+1]==0x0D && ptr[i+c+2]==0x0A) {
i+=(c+3-width);
break;
}
}
fputc('\n', stderr); /* newline */
}
}
static
int my_trace(CURL *handle, curl_infotype type,
char *data, size_t size,
void *userp)
{
const char *text;
(void)handle; /* prevent compiler warning */
(void)userp;
switch (type) {
case CURLINFO_TEXT:
fprintf(stderr, "== Info: %s", data);
default: /* in case a new one is introduced to shock us */
return 0;
case CURLINFO_HEADER_OUT:
text = "=> Send header";
break;
case CURLINFO_DATA_OUT:
text = "=> Send data";
break;
case CURLINFO_SSL_DATA_OUT:
text = "=> Send SSL data";
break;
case CURLINFO_HEADER_IN:
text = "<= Recv header";
break;
case CURLINFO_DATA_IN:
text = "<= Recv data";
break;
case CURLINFO_SSL_DATA_IN:
text = "<= Recv SSL data";
break;
}
dump(text, (unsigned char *)data, size, 1);
return 0;
}
#define OUTPUTFILE "dl"
static void setup(CURL *hnd)
{
FILE *out = fopen(OUTPUTFILE, "wb");
/* write to this file */
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, out);
/* set the same URL */
curl_easy_setopt(hnd, CURLOPT_URL, "https://localhost:8443/index.html");
/* send it verbose for max debuggaility */
curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(hnd, CURLOPT_DEBUGFUNCTION, my_trace);
/* HTTP/2 please */
curl_easy_setopt(hnd, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
/* we use a self-signed test server, skip verification during debugging */
curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYHOST, 0L);
#if (CURLPIPE_MULTIPLEX > 0)
/* wait for pipe connection to confirm */
curl_easy_setopt(hnd, CURLOPT_PIPEWAIT, 1L);
#endif
}
/* called when there's an incoming push */
static int server_push_callback(CURL *parent,
CURL *easy,
size_t num_headers,
struct curl_pushheaders *headers,
void *userp)
{
char *headp;
size_t i;
int *transfers = (int *)userp;
char filename[128];
FILE *out;
static unsigned int count = 0;
(void)parent; /* we have no use for this */
snprintf(filename, 128, "push%u", count++);
/* here's a new stream, save it in a new file for each new push */
out = fopen(filename, "wb");
/* write to this file */
curl_easy_setopt(easy, CURLOPT_WRITEDATA, out);
fprintf(stderr, "**** push callback approves stream %u, got %d headers!\n",
count, (int)num_headers);
for(i=0; i<num_headers; i++) {
headp = curl_pushheader_bynum(headers, i);
fprintf(stderr, "**** header %u: %s\n", (int)i, headp);
}
headp = curl_pushheader_byname(headers, ":path");
if(headp) {
fprintf(stderr, "**** The PATH is %s\n", headp /* skip :path + colon */ );
}
(*transfers)++; /* one more */
return CURL_PUSH_OK;
}
/*
* Download a file over HTTP/2, take care of server push.
*/
int main(void)
{
CURL *easy;
CURLM *multi_handle;
int still_running; /* keep number of running handles */
int transfers=1; /* we start with one */
struct CURLMsg *m;
/* init a multi stack */
multi_handle = curl_multi_init();
easy = curl_easy_init();
/* set options */
setup(easy);
/* add the easy transfer */
curl_multi_add_handle(multi_handle, easy);
curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX);
curl_multi_setopt(multi_handle, CURLMOPT_PUSHFUNCTION, server_push_callback);
curl_multi_setopt(multi_handle, CURLMOPT_PUSHDATA, &transfers);
/* we start some action by calling perform right away */
curl_multi_perform(multi_handle, &still_running);
do {
struct timeval timeout;
int rc; /* select() return code */
CURLMcode mc; /* curl_multi_fdset() return code */
fd_set fdread;
fd_set fdwrite;
fd_set fdexcep;
int maxfd = -1;
long curl_timeo = -1;
FD_ZERO(&fdread);
FD_ZERO(&fdwrite);
FD_ZERO(&fdexcep);
/* set a suitable timeout to play around with */
timeout.tv_sec = 1;
timeout.tv_usec = 0;
curl_multi_timeout(multi_handle, &curl_timeo);
if(curl_timeo >= 0) {
timeout.tv_sec = curl_timeo / 1000;
if(timeout.tv_sec > 1)
timeout.tv_sec = 1;
else
timeout.tv_usec = (curl_timeo % 1000) * 1000;
}
/* get file descriptors from the transfers */
mc = curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
if(mc != CURLM_OK) {
fprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mc);
break;
}
/* On success the value of maxfd is guaranteed to be >= -1. We call
select(maxfd + 1, ...); specially in case of (maxfd == -1) there are
no fds ready yet so we call select(0, ...) --or Sleep() on Windows--
to sleep 100ms, which is the minimum suggested value in the
curl_multi_fdset() doc. */
if(maxfd == -1) {
#ifdef _WIN32
Sleep(100);
rc = 0;
#else
/* Portable sleep for platforms other than Windows. */
struct timeval wait = { 0, 100 * 1000 }; /* 100ms */
rc = select(0, NULL, NULL, NULL, &wait);
#endif
}
else {
/* Note that on some platforms 'timeout' may be modified by select().
If you need access to the original value save a copy beforehand. */
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
}
switch(rc) {
case -1:
/* select error */
break;
case 0:
default:
/* timeout or readable/writable sockets */
curl_multi_perform(multi_handle, &still_running);
break;
}
/*
* A little caution when doing server push is that libcurl itself has
* created and added one or more easy handles but we need to clean them up
* when we are done.
*/
do {
int msgq = 0;;
m = curl_multi_info_read(multi_handle, &msgq);
if(m && (m->msg == CURLMSG_DONE)) {
CURL *e = m->easy_handle;
transfers--;
curl_multi_remove_handle(multi_handle, e);
curl_easy_cleanup(e);
}
} while(m);
} while(transfers); /* as long as we have transfers going */
curl_multi_cleanup(multi_handle);
return 0;
}

View File

@ -0,0 +1,356 @@
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2016, 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 https://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.
*
***************************************************************************/
/* <DESC>
* Multiplexed HTTP/2 uploads over a single connection
* </DESC>
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <sys/stat.h>
/* somewhat unix-specific */
#include <sys/time.h>
#include <unistd.h>
/* curl stuff */
#include <curl/curl.h>
#ifndef CURLPIPE_MULTIPLEX
/* This little trick will just make sure that we don't enable pipelining for
libcurls old enough to not have this symbol. It is _not_ defined to zero in
a recent libcurl header. */
#define CURLPIPE_MULTIPLEX 0
#endif
#define NUM_HANDLES 1000
void *curl_hnd[NUM_HANDLES];
int num_transfers;
/* a handle to number lookup, highly ineffective when we do many
transfers... */
static int hnd2num(CURL *hnd)
{
int i;
for(i=0; i< num_transfers; i++) {
if(curl_hnd[i] == hnd)
return i;
}
return 0; /* weird, but just a fail-safe */
}
static
void dump(const char *text, int num, unsigned char *ptr, size_t size,
char nohex)
{
size_t i;
size_t c;
unsigned int width=0x10;
if(nohex)
/* without the hex output, we can fit more on screen */
width = 0x40;
fprintf(stderr, "%d %s, %ld bytes (0x%lx)\n",
num, text, (long)size, (long)size);
for(i=0; i<size; i+= width) {
fprintf(stderr, "%4.4lx: ", (long)i);
if(!nohex) {
/* hex not disabled, show it */
for(c = 0; c < width; c++)
if(i+c < size)
fprintf(stderr, "%02x ", ptr[i+c]);
else
fputs(" ", stderr);
}
for(c = 0; (c < width) && (i+c < size); c++) {
/* check for 0D0A; if found, skip past and start a new line of output */
if(nohex && (i+c+1 < size) && ptr[i+c]==0x0D && ptr[i+c+1]==0x0A) {
i+=(c+2-width);
break;
}
fprintf(stderr, "%c",
(ptr[i+c]>=0x20) && (ptr[i+c]<0x80)?ptr[i+c]:'.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
if(nohex && (i+c+2 < size) && ptr[i+c+1]==0x0D && ptr[i+c+2]==0x0A) {
i+=(c+3-width);
break;
}
}
fputc('\n', stderr); /* newline */
}
}
static
int my_trace(CURL *handle, curl_infotype type,
char *data, size_t size,
void *userp)
{
char timebuf[20];
const char *text;
int num = hnd2num(handle);
static time_t epoch_offset;
static int known_offset;
struct timeval tv;
time_t secs;
struct tm *now;
(void)handle; /* prevent compiler warning */
(void)userp;
gettimeofday(&tv, NULL);
if(!known_offset) {
epoch_offset = time(NULL) - tv.tv_sec;
known_offset = 1;
}
secs = epoch_offset + tv.tv_sec;
now = localtime(&secs); /* not thread safe but we don't care */
snprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%06ld",
now->tm_hour, now->tm_min, now->tm_sec, (long)tv.tv_usec);
switch (type) {
case CURLINFO_TEXT:
fprintf(stderr, "%s [%d] Info: %s", timebuf, num, data);
default: /* in case a new one is introduced to shock us */
return 0;
case CURLINFO_HEADER_OUT:
text = "=> Send header";
break;
case CURLINFO_DATA_OUT:
text = "=> Send data";
break;
case CURLINFO_SSL_DATA_OUT:
text = "=> Send SSL data";
break;
case CURLINFO_HEADER_IN:
text = "<= Recv header";
break;
case CURLINFO_DATA_IN:
text = "<= Recv data";
break;
case CURLINFO_SSL_DATA_IN:
text = "<= Recv SSL data";
break;
}
dump(text, num, (unsigned char *)data, size, 1);
return 0;
}
struct input {
FILE *in;
size_t bytes_read; /* count up */
CURL *hnd;
};
static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *userp)
{
struct input *i = userp;
size_t retcode = fread(ptr, size, nmemb, i->in);
i->bytes_read += retcode;
return retcode;
}
struct input indata[NUM_HANDLES];
static void setup(CURL *hnd, int num, const char *upload)
{
FILE *out;
char url[256];
char filename[128];
struct stat file_info;
curl_off_t uploadsize;
snprintf(filename, 128, "dl-%d", num);
out = fopen(filename, "wb");
snprintf(url, 256, "https://localhost:8443/upload-%d", num);
/* get the file size of the local file */
stat(upload, &file_info);
uploadsize = file_info.st_size;
indata[num].in = fopen(upload, "rb");
indata[num].hnd = hnd;
/* write to this file */
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, out);
/* we want to use our own read function */
curl_easy_setopt(hnd, CURLOPT_READFUNCTION, read_callback);
/* read from this file */
curl_easy_setopt(hnd, CURLOPT_READDATA, &indata[num]);
/* provide the size of the upload */
curl_easy_setopt(hnd, CURLOPT_INFILESIZE_LARGE, uploadsize);
/* send in the URL to store the upload as */
curl_easy_setopt(hnd, CURLOPT_URL, url);
/* upload please */
curl_easy_setopt(hnd, CURLOPT_UPLOAD, 1L);
/* send it verbose for max debuggaility */
curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(hnd, CURLOPT_DEBUGFUNCTION, my_trace);
/* HTTP/2 please */
curl_easy_setopt(hnd, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
/* we use a self-signed test server, skip verification during debugging */
curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(hnd, CURLOPT_SSL_VERIFYHOST, 0L);
#if (CURLPIPE_MULTIPLEX > 0)
/* wait for pipe connection to confirm */
curl_easy_setopt(hnd, CURLOPT_PIPEWAIT, 1L);
#endif
curl_hnd[num] = hnd;
}
/*
* Upload all files over HTTP/2, using the same physical connection!
*/
int main(int argc, char **argv)
{
CURL *easy[NUM_HANDLES];
CURLM *multi_handle;
int i;
int still_running; /* keep number of running handles */
const char *filename = "index.html";
if(argc > 1)
/* if given a number, do that many transfers */
num_transfers = atoi(argv[1]);
if(argc > 2)
/* if given a file name, upload this! */
filename = argv[2];
if(!num_transfers || (num_transfers > NUM_HANDLES))
num_transfers = 3; /* a suitable low default */
/* init a multi stack */
multi_handle = curl_multi_init();
for(i=0; i<num_transfers; i++) {
easy[i] = curl_easy_init();
/* set options */
setup(easy[i], i, filename);
/* add the individual transfer */
curl_multi_add_handle(multi_handle, easy[i]);
}
curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX);
/* We do HTTP/2 so let's stick to one connection per host */
curl_multi_setopt(multi_handle, CURLMOPT_MAX_HOST_CONNECTIONS, 1L);
/* we start some action by calling perform right away */
curl_multi_perform(multi_handle, &still_running);
do {
struct timeval timeout;
int rc; /* select() return code */
CURLMcode mc; /* curl_multi_fdset() return code */
fd_set fdread;
fd_set fdwrite;
fd_set fdexcep;
int maxfd = -1;
long curl_timeo = -1;
FD_ZERO(&fdread);
FD_ZERO(&fdwrite);
FD_ZERO(&fdexcep);
/* set a suitable timeout to play around with */
timeout.tv_sec = 1;
timeout.tv_usec = 0;
curl_multi_timeout(multi_handle, &curl_timeo);
if(curl_timeo >= 0) {
timeout.tv_sec = curl_timeo / 1000;
if(timeout.tv_sec > 1)
timeout.tv_sec = 1;
else
timeout.tv_usec = (curl_timeo % 1000) * 1000;
}
/* get file descriptors from the transfers */
mc = curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
if(mc != CURLM_OK) {
fprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mc);
break;
}
/* On success the value of maxfd is guaranteed to be >= -1. We call
select(maxfd + 1, ...); specially in case of (maxfd == -1) there are
no fds ready yet so we call select(0, ...) --or Sleep() on Windows--
to sleep 100ms, which is the minimum suggested value in the
curl_multi_fdset() doc. */
if(maxfd == -1) {
#ifdef _WIN32
Sleep(100);
rc = 0;
#else
/* Portable sleep for platforms other than Windows. */
struct timeval wait = { 0, 100 * 1000 }; /* 100ms */
rc = select(0, NULL, NULL, NULL, &wait);
#endif
}
else {
/* Note that on some platforms 'timeout' may be modified by select().
If you need access to the original value save a copy beforehand. */
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
}
switch(rc) {
case -1:
/* select error */
break;
case 0:
default:
/* timeout or readable/writable sockets */
curl_multi_perform(multi_handle, &still_running);
break;
}
} while(still_running);
curl_multi_cleanup(multi_handle);
for(i=0; i<num_transfers; i++)
curl_easy_cleanup(easy[i]);
return 0;
}

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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.
* are also available at https://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
@ -19,6 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* HTTP request with custom modified, removed and added headers
* </DESC>
*/
#include <stdio.h>
#include <curl/curl.h>

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2016, 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.
* are also available at https://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
@ -19,6 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* HTTP PUT with easy interface and read callback
* </DESC>
*/
#include <stdio.h>
#include <fcntl.h>
#include <sys/stat.h>
@ -56,7 +60,7 @@ int main(int argc, char **argv)
{
CURL *curl;
CURLcode res;
FILE * hd_src ;
FILE * hd_src;
struct stat file_info;
char *file;

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2015, 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.
* are also available at https://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
@ -19,6 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* Simple HTTPS GET
* </DESC>
*/
#include <stdio.h>
#include <curl/curl.h>

View File

@ -5,11 +5,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2016, 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.
* are also available at https://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
@ -19,6 +19,12 @@
* KIND, either express or implied.
*
***************************************************************************/
/* <DESC>
* IMAP example showing how to send e-mails
* </DESC>
*/
#include <stdio.h>
#include <string.h>
#include <curl/curl.h>
@ -38,7 +44,8 @@ static const char *payload_text[] = {
"To: " TO "\r\n",
"From: " FROM "(Example User)\r\n",
"Cc: " CC "(Another example User)\r\n",
"Message-ID: <dcd7cb36-11db-487a-9f3a-e652a9458efd@rfcpedant.example.org>\r\n",
"Message-ID: "
"<dcd7cb36-11db-487a-9f3a-e652a9458efd@rfcpedant.example.org>\r\n",
"Subject: IMAP example message\r\n",
"\r\n", /* empty line to divide headers from body, see RFC5322 */
"The body of the message starts here.\r\n",

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