Compare commits

...

211 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
1195 changed files with 5929 additions and 3816 deletions

View File

@ -6,9 +6,9 @@ Join the community
1. Click 'watch' on the github repo
2. Subscribe to the suitable [mailing lists](http://curl.haxx.se/mail/)
2. Subscribe to the suitable [mailing lists](https://curl.haxx.se/mail/)
Read [docs/CONTRIBUTE](docs/CONTRIBUTE)
Read [CONTRIBUTE](../docs/CONTRIBUTE)
---------------------------------------
Send your suggestions using one of these methods:
@ -16,10 +16,8 @@ Send your suggestions using one of these methods:
1. in a mail to the mailing list
2. as a pull request on github
2. as a [pull request](https://github.com/curl/curl/pulls)
3. as an issue on github
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

View File

@ -1,4 +1,4 @@
See http://curl.haxx.se/changes.html for the edited and human readable online
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.
Generate a CHANGES file like the one present in evey release like this:

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

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}\"")
@ -122,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)
@ -253,6 +248,7 @@ include (CheckLibraryExists)
include (CheckSymbolExists)
include (CheckTypeSize)
include (CheckCSourceCompiles)
include (CMakeDependentOption)
# On windows preload settings
if(WIN32)
@ -290,14 +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)
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)
@ -320,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()
@ -1055,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)

View File

@ -1,6 +1,7 @@
COPYRIGHT AND PERMISSION NOTICE
Copyright (c) 1996 - 2016, 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

@ -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
@ -92,37 +92,45 @@ 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/src/curl.sln \
projects/Windows/VC11/curl-all.sln \
projects/Windows/VC11/lib/libcurl.sln \
projects/Windows/VC11/src/curl.sln \
projects/Windows/VC12/curl-all.sln \
projects/Windows/VC12/lib/libcurl.sln \
projects/Windows/VC12/src/curl.sln \
projects/Windows/VC14/curl-all.sln \
projects/Windows/VC14/lib/libcurl.sln \
projects/Windows/VC14/src/curl.sln
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 \
@ -130,7 +138,8 @@ WINBUILD_DIST = winbuild/BUILD.WINDOWS.txt winbuild/gen_resp_file.bat \
EXTRA_DIST = CHANGES COPYING maketgz Makefile.dist curl-config.in \
RELEASE-NOTES buildconf libcurl.pc.in MacOSX-Framework scripts/zsh.pl \
$(CMAKE_DIST) $(VC_DIST) $(WINBUILD_DIST) lib/libcurl.vers.in
$(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) \

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

6
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,13 +32,13 @@ 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 https://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)

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,128 +1,159 @@
Curl and libcurl 7.47.0
Curl and libcurl 7.48.0
Public curl releases: 151
Public curl releases: 153
Command line options: 179
curl_easy_setopt() options: 221
Public functions in libcurl: 61
Contributors: 1340
Contributors: 1364
This release includes the following changes:
o version: Add flag CURL_VERSION_PSL for libpsl
o http: added CURL_HTTP_VERSION_2TLS to do HTTP/2 for HTTPS only [8]
o curl: use 2TLS by default
o curl --expect100-timeout: added [10]
o Add .dir-locals and set c-basic-offset to 2 (for emacs) [16]
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 curl: avoid local drive traversal when saving file on Windows [33]
o NTLM: do not resuse proxy connections without diff proxy credentials [34]
o tests: Disable the OAUTHBEARER tests when using a non-default port number [1]
o curl: remove keepalive #ifdef checks done on libcurl's behalf
o formdata: Check if length is too large for memory [2]
o lwip: Fix compatibility issues with later versions [3]
o openssl: BoringSSL doesn't have CONF_modules_free
o config-win32: Fix warning HAVE_WINSOCK2_H undefined
o build: fix compilation error with CURL_DISABLE_VERBOSE_STRINGS [4]
o http2: Fix hanging paused stream [5]
o scripts/Makefile: fix GNUism and survive no perl [6]
o openssl: adapt to 1.1.0+ name changes
o openssl: adapt to openssl >= 1.1.0 X509 opaque structs [7]
o HTTP2.md: spell fix and remove TODO now implemented
o setstropt: const-correctness [9]
o cyassl: fix compiler warning on type conversion
o gskit: Fix host subject altname verification [11]
o http2: Support trailer fields [12]
o wolfssl: handle builds without SSLv3 support
o cyassl: deal with lack of *get_peer_certificate [13]
o sockfilt: do not wait on unreliable file or pipe handle
o make: build zsh script even in an out-of-tree build
o test 1326: fix getting stuck on Windows
o test 87: fix file check on Windows
o configure: allow static builds on mingw [14]
o configure: detect IPv6 support on Windows [15]
o ConnectionExists: with *PIPEWAIT, wait for connections [17]
o Makefile.inc: s/curl_SOURCES/CURL_FILES [18]
o test 16: fixed for Windows
o test 252-255: use datacheck mode text for ASCII-mode LISTings
o tftpd server: add Windows support by writing files in binary mode
o ftplistparser: fix handling of file LISTings using Windows EOL
o tests first.c: fix calculation of sleep timeout on Windows
o tests (several): use datacheck mode text for ASCII-mode LISTings
o CURLOPT_RANGE.3: for HTTP servers, range support is optional
o test 1515: add MSYS support by passing a relative path
o curl_global_init.3: Add Windows-specific info for init via DLL [19]
o http2: Fix client write for trailers on stream close [20]
o mbedtls: Fix ALPN support
o connection reuse: IDN host names fixed [21]
o http2: Fix PUSH_PROMISE headers being treated as trailers [22]
o http2: handle the received SETTINGS frame [23]
o http2: Ensure that http2_handle_stream_close is called [24]
o mbedtls: implement CURLOPT_PINNEDPUBLICKEY
o runtests: Add mbedTLS to the SSL backends
o IDN host names: Remove the port number before converting to ACE [25]
o zsh.pl: fail if no curl is found
o scripts: fix zsh completion generation
o scripts: don't generate and install zsh completion when cross-compiling [26]
o lib: Prefix URLs with lower-case protocol names/schemes [27]
o ConnectionExists: only do pipelining/multiplexing when asked [28]
o configure: assume IPv6 works when cross-compiled [29]
o openssl: for 1.1.0+ they now provide a SSLeay() macro of their own
o openssl: improved error detection/reporting
o ssh: CURLOPT_SSH_PUBLIC_KEYFILE now treats "" as NULL again [30]
o mbedtls: Fix pinned key return value on fail [31]
o maketgz: generate date stamp with LC_TIME=C [32]
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, Anders Bakken, Christian Stewart, Dan Fandrich,
Daniel Schauenberg, Daniel Stenberg, Francisco Moraes, Gisle Vanem,
Isaac Boukris, Johannes Schindelin, John Kohl, Kamil Dudka, Marc Hoersken,
Michael Kaufmann, Mohammad AlSaleh, Patrick Monnerat, Ray Satiro, Steve Holme,
Tatsuhiro Tsujikawa, Thomas Glanzmann, Thomas Klausner,
(21 contributors)
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/mail/lib-2015-12/0003.html
[2] = https://github.com/bagder/curl/issues/425#issuecomment-154518679
[3] = http://curl.haxx.se/mail/lib-2015-12/0023.html
[4] = http://curl.haxx.se/bug/?i=558
[5] = http://curl.haxx.se/mail/lib-2015-11/0103.html
[6] = http://curl.haxx.se/bug/?i=555
[7] = http://curl.haxx.se/bug/?i=491
[8] = http://curl.haxx.se/libcurl/c/CURLOPT_HTTP_VERSION.html
[9] = http://curl.haxx.se/bug/?i=565
[10] = http://curl.haxx.se/docs/manpage.html#--expect100-timeout
[11] = http://curl.haxx.se/mail/lib-2015-12/0062.html
[12] = http://curl.haxx.se/bug/?i=564
[13] = http://curl.haxx.se/bug/?i=565
[14] = https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-curl
[15] = https://github.com/Alexpux/MINGW-packages/commit/9253d0bf58a1486e91f7efb5316e7fdb48fa4007
[16] = http://curl.haxx.se/bug/?i=574
[17] = http://curl.haxx.se/bug/?i=575
[18] = http://curl.haxx.se/bug/?i=577
[19] = http://curl.haxx.se/bug/?i=586
[20] = http://curl.haxx.se/bug/?i=564
[21] = http://curl.haxx.se/bug/?i=592
[22] = http://curl.haxx.se/bug/?i=564
[23] = http://curl.haxx.se/mail/lib-2016-01/0031.html
[24] = http://curl.haxx.se/bug/?i=564
[25] = http://curl.haxx.se/bug/?i=596
[26] = http://curl.haxx.se/bug/?i=582
[27] = http://curl.haxx.se/bug/?i=597
[28] = http://curl.haxx.se/bug/?i=584
[29] = http://curl.haxx.se/bug/?i=594
[30] = http://curl.haxx.se/mail/lib-2016-01/0072.html
[31] = http://curl.haxx.se/bug/?i=601
[32] = http://curl.haxx.se/mail/lib-2016-01/0123.html
[33] = http://curl.haxx.se/docs/adv_20160127B.html
[34] = http://curl.haxx.se/docs/adv_20160127A.html
[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

@ -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
@ -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
])
@ -2570,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"
@ -2580,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"
@ -2590,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
@ -2638,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
@ -2651,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])
@ -2665,6 +2697,24 @@ AC_HELP_STRING([--without-ca-path], [Don't use a default CA path]),
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
])
@ -3101,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
])

View File

@ -1,19 +1,35 @@
version: 7.45.0.{build}
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%"
- 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

View File

@ -6,11 +6,11 @@ rem * / __| | | | |_) | |
rem * | (__| |_| | _ <| |___
rem * \___|\___/|_| \_\_____|
rem *
rem * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
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 http://curl.haxx.se/docs/copyright.html.
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
@ -26,8 +26,6 @@ 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 This file is not included or required for curl's release archives or daily
rem snapshot archives.
:begin
rem Set our variables

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
@ -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])
@ -1631,8 +1631,6 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
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)
dnl BoringSSL didn't have DES_set_odd_parity for a while but now it is
dnl back again.
AC_CHECK_FUNCS( RAND_status \
RAND_screen \
@ -1640,8 +1638,7 @@ 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])
AC_COMPILE_IFELSE([
@ -1656,6 +1653,7 @@ if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
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])
])
@ -3893,8 +3891,9 @@ 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}

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

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++
@ -184,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

View File

@ -35,12 +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://github.com/bagder/curl/issues
https://github.com/curl/curl/issues
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

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
@ -42,13 +37,13 @@
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
@ -87,48 +82,15 @@
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
@ -137,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
@ -158,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
@ -176,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
@ -203,7 +158,7 @@
You need to first checkout the repository:
git clone https://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:

View File

@ -30,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
@ -226,7 +227,7 @@ FAQ
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. Simply go to the GitHub repo which resides at
https://github.com/bagder/curl, fork the project, and create pull requests
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.
@ -254,7 +255,7 @@ 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 at
https://github.com/bagder/curl. Also again, some companies have sponsored
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.
@ -281,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
@ -302,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?
@ -319,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
@ -341,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?
@ -449,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?
@ -464,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
@ -561,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
@ -694,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
@ -985,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?
@ -1402,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.
@ -1521,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.

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,7 +34,7 @@ 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 (https://www.ietf.org/rfc/rfc6265.txt) was finally published
and details how cookies work within HTTP.

View File

@ -2,7 +2,7 @@ HTTP/2 with curl
================
[HTTP/2 Spec](https://www.rfc-editor.org/rfc/rfc7540.txt)
[http2 explained](http://daniel.haxx.se/http2/)
[http2 explained](https://daniel.haxx.se/http2/)
Build prerequisites
-------------------
@ -36,12 +36,17 @@ 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.
Consider options to explicitly disable ALPN and/or NPN.
`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
--------
@ -84,7 +89,9 @@ 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
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
-------------------------
@ -95,7 +102,7 @@ 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-05)
automatically. [Spec](https://tools.ietf.org/html/draft-ietf-httpbis-alt-svc-14)
TODO
----

View File

@ -706,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
====

View File

@ -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

View File

@ -1079,17 +1079,17 @@ for older and later versions as things don't change drastically that often.
the share API.
[1]: http://curl.haxx.se/libcurl/c/curl_easy_setopt.html
[2]: http://curl.haxx.se/libcurl/c/curl_easy_init.html
[1]: https://curl.haxx.se/libcurl/c/curl_easy_setopt.html
[2]: https://curl.haxx.se/libcurl/c/curl_easy_init.html
[3]: http://c-ares.haxx.se/
[4]: https://tools.ietf.org/html/rfc7230 "RFC 7230"
[5]: http://curl.haxx.se/libcurl/c/CURLOPT_ACCEPT_ENCODING.html
[6]: http://curl.haxx.se/docs/manpage.html#--compressed
[7]: http://curl.haxx.se/libcurl/c/curl_multi_socket_action.html
[8]: http://curl.haxx.se/libcurl/c/curl_multi_timeout.html
[9]: http://curl.haxx.se/libcurl/c/curl_multi_setopt.html
[10]: http://curl.haxx.se/libcurl/c/CURLMOPT_TIMERFUNCTION.html
[11]: http://curl.haxx.se/libcurl/c/curl_multi_perform.html
[12]: http://curl.haxx.se/libcurl/c/curl_multi_fdset.html
[13]: http://curl.haxx.se/libcurl/c/curl_multi_add_handle.html
[14]: http://curl.haxx.se/libcurl/c/curl_multi_info_read.html
[5]: https://curl.haxx.se/libcurl/c/CURLOPT_ACCEPT_ENCODING.html
[6]: https://curl.haxx.se/docs/manpage.html#--compressed
[7]: https://curl.haxx.se/libcurl/c/curl_multi_socket_action.html
[8]: https://curl.haxx.se/libcurl/c/curl_multi_timeout.html
[9]: https://curl.haxx.se/libcurl/c/curl_multi_setopt.html
[10]: https://curl.haxx.se/libcurl/c/CURLMOPT_TIMERFUNCTION.html
[11]: https://curl.haxx.se/libcurl/c/curl_multi_perform.html
[12]: https://curl.haxx.se/libcurl/c/curl_multi_fdset.html
[13]: https://curl.haxx.se/libcurl/c/curl_multi_add_handle.html
[14]: https://curl.haxx.se/libcurl/c/curl_multi_info_read.html

View File

@ -3,17 +3,35 @@ 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/bagder/curl/issues/334
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"
http://curl.haxx.se/bug/view.cgi?id=1366
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. http://curl.haxx.se/bug/view.cgi?id=1411
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.
@ -24,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
@ -35,8 +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.
https://github.com/bagder/curl/issues/218
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.
@ -44,48 +62,48 @@ 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
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
@ -94,7 +112,7 @@ may have been fixed since this was written!
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
@ -105,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
@ -134,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
@ -149,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
@ -175,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.
@ -221,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
@ -238,4 +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
https://curl.haxx.se/mail/lib-2003-06/0146.html

View File

@ -18,7 +18,7 @@ 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.
@ -73,7 +73,7 @@ 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 http://daniel.haxx.se/projects/c-ares/license.html
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

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.

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
@ -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 - 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
@ -38,7 +38,7 @@ EXTRA_DIST = MANUAL BUGS CONTRIBUTE FAQ FEATURES INTERNALS SSLCERTS \
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
HTTP2.md ROADMAP.md CODE_OF_CONDUCT.md CODE_STYLE.md
MAN2HTML= roffit < $< >$@

View File

@ -11,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
@ -24,8 +24,6 @@ in the source code repo
- upload the 8 resulting files to the primary download directory
- upload the 4 tarballs to github for the HTTPS download
in the curl-www repo
--------------------

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

@ -23,6 +23,19 @@ HTTP/2
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
-----------
@ -31,7 +44,9 @@ How to find services for specific domains/hosts.
HTTPS to proxy
--------------
To avoid network traffic to/from the proxy getting snooped on.
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()
--------------

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

@ -60,7 +60,7 @@ Ciphers
References:
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
@ -84,4 +84,4 @@ Disabling certificate revocation checks
References:
http://curl.haxx.se/docs/ssl-compared.html
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

@ -135,6 +135,7 @@ Benjamin Kircher
Benoit Neil
Benoit Sigoure
Bernard Leak
Bernard Spil
Bernhard Reutner-Fischer
Bert Huijben
Bertrand Demiddelaer
@ -154,6 +155,7 @@ Bob Richmond
Bob Schader
Bogdan Nicula
Brad Burdick
Brad Fitzpatrick
Brad Harder
Brad Hards
Brad King
@ -221,6 +223,7 @@ Claes Jakobsson
Clarence Gardner
Clemens Gruber
Clifford Wolf
Clint Clayton
Cody Jones
Cody Mack
Colby Ranger
@ -280,6 +283,7 @@ Dave Thompson
Dave Vasilevsky
Davey Shafik
David Bau
David Benjamin
David Binderman
David Blaikie
David Byron
@ -456,6 +460,7 @@ Glen A Johnson Jr.
Glen Nakamura
Glen Scott
Glenn Sheridan
Google Inc.
Gordon Marler
Gorilla Maguila
Grant Erickson
@ -530,6 +535,7 @@ Jacob Meuser
Jacob Moshenko
Jactry Zeng
Jad Chamcham
Jaime Fullaondo
Jakub Zakrzewski
James Bursa
James Cheng
@ -577,6 +583,7 @@ Jeff Lawson
Jeff Phillips
Jeff Pohlmeyer
Jeff Weber
Jeffrey Walton
Jens Rantil
Jeremy Friesner
Jeremy Huddleston
@ -591,6 +598,7 @@ Jerry Wu
Jes Badwal
Jesper Jensen
Jesse Noller
Jesse Tan
Jie He
Jim Drash
Jim Freeman
@ -692,6 +700,7 @@ Karl Moerder
Karol Pietrzak
Kaspar Brand
Katie Wang
Kazuho Oku
Kees Cook
Keith MacDonald
Keith McGuigan
@ -764,6 +773,7 @@ Lucas Adamski
Lucas Pardue
Ludek Finstrle
Ludovico Cavedon
Ludwig Nussel
Lukas Ruzicka
Lukasz Czekierda
Luke Amery
@ -775,6 +785,7 @@ Maciej Karpiuk
Maciej Puzio
Maciej W. Rozycki
Maks Naumov
Maksim Kuzevanov
Maksim Stsepanenka
Mamoru Tasaka
Mandy Wu
@ -861,6 +872,7 @@ Michael Jahn
Michael Jerris
Michael Kalinin
Michael Kaufmann
Michael König
Michael Mealling
Michael Mueller
Michael Osipov
@ -934,11 +946,13 @@ 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
@ -1031,6 +1045,7 @@ Quanah Gibson-Mount
Quinn Slack
Radu Simionescu
Rafa Muyo
Rafael Antonio
Rafael Sagula
Rafayel Mkrtchyan
Rafaël Carré
@ -1150,12 +1165,14 @@ 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
@ -1241,6 +1258,7 @@ Tim Sneddon
Tim Stack
Tim Starling
Timo Sirainen
Timotej Lazar
Tinus van den Berg
Tobias Markus
Tobias Rundström

View File

@ -52,3 +52,4 @@ 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/

View File

@ -69,23 +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
@ -111,8 +111,8 @@
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
@ -123,6 +123,8 @@
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
@ -133,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
@ -172,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.
@ -239,7 +242,7 @@
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/bagder/curl/issues/349
https://github.com/curl/curl/issues/349
1.12 have form functions use CURL handle argument
@ -261,7 +264,7 @@
hack ;-)
Please see the following thread for more information:
http://curl.haxx.se/mail/lib-2012-05/0178.html
https://curl.haxx.se/mail/lib-2012-05/0178.html
1.14 Typesafe curl_easy_setopt()
@ -292,7 +295,7 @@
perhaps URL encoded byte values over 128 etc (basically do what the redirect
following code already does).
https://github.com/bagder/curl/issues/514
https://github.com/curl/curl/issues/514
2. libcurl - multi interface
@ -355,7 +358,7 @@
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
@ -392,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
@ -428,13 +431,13 @@ 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/bagder/curl/issues/226
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.
@ -543,7 +546,7 @@ that doesn't exist on the server, just like --ftp-create-dirs.
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
@ -554,7 +557,7 @@ that doesn't exist on the server, just like --ftp-create-dirs.
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
@ -592,9 +595,9 @@ that doesn't exist on the server, just like --ftp-create-dirs.
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
@ -649,7 +652,7 @@ that doesn't exist on the server, just like --ftp-create-dirs.
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
@ -657,7 +660,7 @@ that doesn't exist on the server, just like --ftp-create-dirs.
with integrity protection) and auth-conf (Authentication with integrity and
privacy protection).
17. Client
17. Command line tool
17.1 sync
@ -686,7 +689,7 @@ that doesn't exist on the server, just like --ftp-create-dirs.
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
@ -729,14 +732,29 @@ that doesn't exist on the server, just like --ftp-create-dirs.
{partURL1:name1,partURL2:name2,partURL3:name3} where the name following the
colon is the output name.
See https://github.com/bagder/curl/issues/221
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/bagder/curl/issues/322
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
@ -782,6 +800,16 @@ that doesn't exist on the server, just like --ftp-create-dirs.
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

View File

@ -136,7 +136,7 @@ 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
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
@ -203,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.
@ -628,7 +628,7 @@ 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:
@ -755,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

@ -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
@ -216,8 +216,8 @@ read previously stored cookie lines from, which should be used in this session
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
@ -430,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.
@ -441,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>"
@ -828,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
@ -837,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
@ -864,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
@ -962,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
@ -1190,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.
@ -1712,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
@ -2335,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

@ -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
@ -127,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;
@ -169,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);
@ -182,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

@ -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

@ -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

@ -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 - 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
@ -78,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 */
@ -100,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);
@ -119,7 +121,7 @@ int main(int argc, char **argv)
{
CURL *curl;
CURLcode res;
intptr_t hd ;
int hd;
struct stat file_info;
char *file;
@ -132,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 */
@ -145,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

@ -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
@ -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 - 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
@ -30,8 +30,8 @@
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)
@ -87,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 */
@ -102,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)
@ -112,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");
@ -136,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

@ -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
@ -68,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));
}
@ -167,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))
@ -178,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 - 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
@ -42,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);
@ -66,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;
}
@ -92,10 +93,13 @@ 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;
}
@ -109,18 +113,21 @@ main(void)
"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

@ -50,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);
@ -97,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

@ -36,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)."
@ -55,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)."
@ -75,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).
@ -101,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
};
@ -128,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)
@ -155,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;
}
@ -187,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;
@ -273,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;
@ -296,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;
@ -363,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;
@ -377,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);
@ -440,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;
@ -479,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 response doesn\'t have 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 ***/
@ -511,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 - 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
@ -62,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 - 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
@ -119,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;
}
@ -132,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;
@ -168,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);
@ -197,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);
}
@ -212,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);
}
@ -221,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);
}
@ -241,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;
@ -273,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]);
@ -330,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);
}
@ -366,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 */
@ -386,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);
}
@ -412,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 - 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
@ -54,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;
}
@ -92,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;
}
@ -107,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;
}
@ -116,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

@ -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

@ -80,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);
@ -106,9 +106,9 @@ 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 {
@ -165,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;
}
@ -230,7 +229,7 @@ static int use_buffer(URL_FILE *file, size_t 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
basically use the real fopen() for standard files */
@ -244,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 {
@ -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;
@ -383,7 +382,7 @@ char *url_fgets(char *ptr, size_t size, URL_FILE *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;
@ -447,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 */
@ -465,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;
@ -479,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);
@ -489,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;
@ -504,7 +507,7 @@ int main(int argc, char *argv[])
do {
nread = url_fread(buffer, 1, sizeof(buffer), handle);
fwrite(buffer,1,nread,outf);
fwrite(buffer, 1, nread, outf);
} while(nread);
url_fclose(handle);
@ -513,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;
@ -526,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 - 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
@ -119,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 - 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
@ -63,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 - 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
@ -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 - 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
@ -35,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;
@ -43,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

@ -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
@ -104,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 - 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
@ -36,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
@ -49,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;
@ -67,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;
@ -85,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;
}
@ -94,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);
@ -105,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 */
/*
@ -127,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);
@ -146,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));
@ -161,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

@ -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

@ -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

@ -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
@ -48,7 +48,7 @@ int main(void)
else {
res = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
if((res == CURLE_OK) &&
((code / 100) != 3)) {
((response_code / 100) != 3)) {
/* a redirect implies a 3xx response code */
fprintf(stderr, "Not a redirect.\n");
}

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
@ -28,33 +28,32 @@
*
* 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>
@ -64,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;
@ -78,8 +74,6 @@ typedef struct _GlobalInfo {
int still_running;
} GlobalInfo;
/* Information associated with a specific easy handle */
typedef struct _ConnInfo {
CURL *easy;
@ -88,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;
@ -100,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)
{
@ -135,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);
@ -150,8 +138,6 @@ static void check_multi_info(GlobalInfo *g)
}
}
/* Called by glib when our timeout expires */
static gboolean timer_cb(gpointer data)
{
@ -159,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)
{
@ -176,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)
{
@ -202,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)
{
@ -248,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)
{
@ -258,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 {
@ -277,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)
{
@ -289,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 )
{
@ -308,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);
}
@ -340,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;
@ -438,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 - 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
@ -126,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;
@ -160,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);
@ -191,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);
}
}
@ -220,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);
}
@ -238,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;
@ -266,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);
}
@ -322,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);
}
@ -360,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 */
@ -374,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 - 2015, 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
@ -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 - 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
@ -38,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(" ");
@ -82,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);
@ -98,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 */
}
@ -119,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

@ -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
@ -42,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

@ -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
@ -89,14 +89,14 @@ void dump(const char *text, int num, unsigned char *ptr, size_t size,
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(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) {
if(nohex && (i+c+2 < size) && ptr[i+c+1]==0x0D && ptr[i+c+2]==0x0A) {
i+=(c+3-width);
break;
}
@ -149,7 +149,7 @@ static void setup(CURL *hnd, int num)
FILE *out;
char filename[128];
sprintf(filename, "dl-%d", num);
snprintf(filename, 128, "dl-%d", num);
out = fopen(filename, "wb");
@ -244,8 +244,7 @@ int main(int argc, char **argv)
/* 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;
}

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
@ -69,14 +69,14 @@ void dump(const char *text, unsigned char *ptr, size_t size,
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(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) {
if(nohex && (i+c+2 < size) && ptr[i+c+1]==0x0D && ptr[i+c+2]==0x0A) {
i+=(c+3-width);
break;
}
@ -123,9 +123,11 @@ int my_trace(CURL *handle, curl_infotype type,
return 0;
}
#define OUTPUTFILE "dl"
static void setup(CURL *hnd)
{
FILE *out = fopen("dl", "wb");
FILE *out = fopen(OUTPUTFILE, "wb");
/* write to this file */
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, out);
@ -167,7 +169,7 @@ static int server_push_callback(CURL *parent,
(void)parent; /* we have no use for this */
sprintf(filename, "push%u", count++);
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");

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
@ -90,14 +90,14 @@ void dump(const char *text, int num, unsigned char *ptr, size_t size,
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(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) {
if(nohex && (i+c+2 < size) && ptr[i+c+1]==0x0D && ptr[i+c+2]==0x0A) {
i+=(c+3-width);
break;
}
@ -187,10 +187,10 @@ static void setup(CURL *hnd, int num, const char *upload)
struct stat file_info;
curl_off_t uploadsize;
sprintf(filename, "dl-%d", num);
snprintf(filename, 128, "dl-%d", num);
out = fopen(filename, "wb");
sprintf(url, "https://localhost:8443/upload-%d", num);
snprintf(url, 256, "https://localhost:8443/upload-%d", num);
/* get the file size of the local file */
stat(upload, &file_info);
@ -308,8 +308,7 @@ int main(int argc, char **argv)
/* 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;
}

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
@ -60,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

@ -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
@ -44,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",

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

@ -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

@ -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

@ -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
@ -46,7 +46,8 @@ int main(void)
curl_easy_setopt(curl, CURLOPT_PASSWORD, "secret");
/* This will fetch message 1 from the user's inbox */
curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com/INBOX/;UID=1");
curl_easy_setopt(curl, CURLOPT_URL,
"imap://imap.example.com/INBOX/;UID=1");
/* Perform the fetch */
res = curl_easy_perform(curl);

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

@ -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
@ -120,8 +120,7 @@ int main(void)
/* get file descriptors from the transfers */
mc = curl_multi_fdset(mcurl, &fdread, &fdwrite, &fdexcep, &maxfd);
if(mc != CURLM_OK)
{
if(mc != CURLM_OK) {
fprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mc);
break;
}

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

@ -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
@ -48,7 +48,8 @@ int main(void)
/* This will fetch message 1 from the user's inbox. Note the use of
* imaps:// rather than imap:// to request a SSL based connection. */
curl_easy_setopt(curl, CURLOPT_URL, "imaps://imap.example.com/INBOX/;UID=1");
curl_easy_setopt(curl, CURLOPT_URL,
"imaps://imap.example.com/INBOX/;UID=1");
/* If you want to connect to a site who isn't using a certificate that is
* signed by one of the certs in the CA bundle you have, you can skip the

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

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