aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2020-06-06WIP: Add support for gemini meta headersgemini-metaBen Burwell
2020-05-21Add gemini protocol supportBen Burwell
The gemini protocol's "speculative specification" is documented at the following URLs: https://gemini.circumlunar.space/docs/spec-spec.txt gopher://gemini.circumlunar.space/1/docs/spec-spec.txt gemini://gemini.circumlunar.space/docs/spec-spec.txt This patch introduces preliminary support for version 0.11.0 of the specification, as of March 1st 2020.
2020-05-19tool_paramhlp: fixup C89 mistakeDaniel Stenberg
Follow-up to c5f0a9db22.
2020-05-19tool_paramhlp: fixed potentially uninitialized strtol() variableSiva Sivaraman
Seems highly unlikely to actually be possible, but better safe than sorry. Closes #5417
2020-05-19tool_operate: fixed potentially uninitialized variablesSiva Sivaraman
... in curl_easy_getinfo() calls. They're harmless but clearing the variables makes the code safer and comforts the reader. Closes #5416
2020-05-15setopt: support certificate options in memory with struct curl_blobGilles Vollant
This change introduces a generic way to provide binary data in setopt options, called BLOBs. This change introduces these new setopts: CURLOPT_ISSUERCERT_BLOB, CURLOPT_PROXY_SSLCERT_BLOB, CURLOPT_PROXY_SSLKEY_BLOB, CURLOPT_SSLCERT_BLOB and CURLOPT_SSLKEY_BLOB. Reviewed-by: Daniel Stenberg Closes #5357
2020-05-15source cleanup: remove all custom typedef structsDaniel Stenberg
- Stick to a single unified way to use structs - Make checksrc complain on 'typedef struct {' - Allow them in tests, public headers and examples - Let MD4_CTX, MD5_CTX, and SHA256_CTX typedefs remain as they actually typedef different types/structs depending on build conditions. Closes #5338
2020-05-14tool: support UTF-16 command line on WindowsMarcel Raad
- use `wmain` instead of `main` when `_UNICODE` is defined [0] - define `argv_item_t` as `wchar_t *` in this case - use the curl_multibyte gear to convert the command-line arguments to UTF-8 This makes it possible to pass parameters with characters outside of the current locale on Windows, which is required for some tests, e.g. the IDN tests. Out of the box, this currently only works with the Visual Studio project files, which default to Unicode, and winbuild with the `ENABLE_UNICODE` option. [0] https://devblogs.microsoft.com/oldnewthing/?p=40643 Ref: https://github.com/curl/curl/issues/3747 Closes https://github.com/curl/curl/pull/3784
2020-05-14curl_multibyte: add to curlxMarcel Raad
This will also be needed in the tool and tests. Ref: https://github.com/curl/curl/pull/3758#issuecomment-482197512 Closes https://github.com/curl/curl/pull/3784
2020-05-14checksrc: enhance the ASTERISKSPACE and update code accordinglyDaniel Stenberg
Fine: "struct hello *world" Not fine: "struct hello* world" (and variations) Closes #5386
2020-05-13tool: shorten 3 --help descriptionsDaniel Stenberg
--happy-eyeballs-timeout-ms, --resolve and --ssl-revoke-best-effort gen.pl already warned about these lines but we didn't listen Closes #5379
2020-05-12retry-all-errors.d: Shorten the summary lineJay Satiro
Follow-up to b995bb5 from a few moments ago. Reported-by: Daniel Stenberg Ref: https://github.com/curl/curl/commit/b995bb5#r39108929
2020-05-12tool: Add option --retry-all-errors to retry on any errorJay Satiro
The "sledgehammer" of retrying. Closes https://github.com/curl/curl/pull/5185
2020-05-10tool_operate: only set CURLOPT_SSL_OPTIONS if SSL support is presentDaniel Stenberg
Reported-by: Marcel Raad Follow-up to 148534db5 Fixes #5367 Closes #5369
2020-05-08CURLOPT_SSL_OPTIONS: add *_NATIVE_CA to use Windows CA store (with openssl)Gilles Vollant
Closes #4346
2020-04-14tool: do not declare functions with Curl_ prefixDaniel Stenberg
To avoid collision risks with private libcurl symbols when linked with static versions (or just versions not hiding internal symbols). Reported-by: hydra3333 on github Fixes #5219 Closes #5234
2020-04-13cmake: add aliases so exported target names are available in treeNathaniel R. Lewis
Reviewed-by: Brad King Closes #5206
2020-04-05curl: allow both --etag-compare and --etag-save with same file nameKwon-Young Choi
This change inverse the order of processing for the --etag-compare and --etag-save option to process first --etag-compare. This in turn allows to use the same file name to compare and save an etag. The original behavior of not failing if the etag file does not exists is conserved. Fixes #5179 Closes #5180
2020-03-31misc: copyright year updatesDaniel Stenberg
Follow-up to 7a71965e9
2020-03-31build: fixed build for systems with select() in unistd.hHarry Sintonen
Closes #5169
2020-03-30cleanup: insert newline after if() conditionsDaniel Stenberg
Our code style mandates we put the conditional block on a separate line. These mistakes are now detected by the updated checksrc.
2020-03-29curl.h: remnove CURL_VERSION_ESNI. Never supported nor documentedDaniel Stenberg
Considered experimental and therefore we can do this. Closes #5157
2020-03-27writeout_json: Fix data type issuesMichael Kaufmann
Load long values correctly (e.g. for http_code). Use curl_off_t (not long) for: - size_download (CURLINFO_SIZE_DOWNLOAD_T) - size_upload (CURLINFO_SIZE_UPLOAD_T) The unit for these values is bytes/second, not microseconds: - speed_download (CURLINFO_SPEED_DOWNLOAD_T) - speed_upload (CURLINFO_SPEED_UPLOAD_T) Fixes #5131 Closes #5152
2020-03-26docs/make: generate curl.1 from listed files onlyDaniel Stenberg
Previously it rendered the page from files matching "*.d" in the correct directory, which worked fine in git builds when the files were added but made it easy to forget adding the files to the dist. Now, only man page sections listed in DPAGES in Makefile.inc will be used, thus "forcing" us to update this to get the man page right and get it included in the dist at the same time. Ref: #5146 Closes #5149
2020-03-24copyright: fix out-of-date copyright ranges and missing headersDaniel Stenberg
Reported by the new script 'scripts/copyright.pl'. The script has a regex whitelist for the files that don't need copyright headers. Removed three (mostly usesless) README files from docs/ Closes #5141
2020-03-20cmdline: fix handling of OperationConfig linked list (--next)Rici Lake
Ensures that -K/--config inserts new items at the end of the list instead of overwriting the second item, and that after a -K/--config option has been parsed, the option parser's view of the current config is update. Fixes #5120 Closes #5123
2020-03-18writeout_json: use curl_off_t printf() option for the time outputDaniel Stenberg
Follow-up to: 04c03416e68fd635a15 Closes #5115
2020-03-18tool_setopt: correct the copyright year rangeDaniel Stenberg
Follow-up to 5450428491
2020-03-18schannel: add "best effort" revocation check optionJohannes Schindelin
- Implement new option CURLSSLOPT_REVOKE_BEST_EFFORT and --ssl-revoke-best-effort to allow a "best effort" revocation check. A best effort revocation check ignores errors that the revocation check was unable to take place. The reasoning is described in detail below and discussed further in the PR. --- When running e.g. with Fiddler, the schannel backend fails with an unhelpful error message: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate. Sadly, many enterprise users who are stuck behind MITM proxies suffer the very same problem. This has been discussed in plenty of issues: https://github.com/curl/curl/issues/3727, https://github.com/curl/curl/issues/264, for example. In the latter, a Microsoft Edge developer even made the case that the common behavior is to ignore issues when a certificate has no recorded distribution point for revocation lists, or when the server is offline. This is also known as "best effort" strategy and addresses the Fiddler issue. Unfortunately, this strategy was not chosen as the default for schannel (and is therefore a backend-specific behavior: OpenSSL seems to happily ignore the offline servers and missing distribution points). To maintain backward-compatibility, we therefore add a new flag (`CURLSSLOPT_REVOKE_BEST_EFFORT`) and a new option (`--ssl-revoke-best-effort`) to select the new behavior. Due to the many related issues Git for Windows and GitHub Desktop, the plan is to make this behavior the default in these software packages. The test 2070 was added to verify this behavior, adapted from 310. Based-on-work-by: georgeok <giorgos.n.oikonomou@gmail.com> Co-authored-by: Markus Olsson <j.markus.olsson@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Closes https://github.com/curl/curl/pull/4981
2020-03-17windows: suppress UI in all CryptAcquireContext() callsViktor Szakats
Ref: https://docs.microsoft.com/windows/win32/api/wincrypt/nf-wincrypt-cryptacquirecontexta#parameters Reviewed-by: Marc Hörsken Closes https://github.com/curl/curl/pull/5088
2020-03-17writeout_json: add missing comma to fix the HTTP versionDaniel Stenberg
Follow-up to 04c03416e68fd635a15
2020-03-17writeout: support to generate JSON outputMathias Gumz
This commit adds support to generate JSON via the writeout feature: -w "%{json}" It leverages the existing infrastructure as much as possible. Thus, generating the JSON on STDERR is possible by: -w "%{stderr}%{json}" This implements a variant of https://github.com/curl/curl/wiki/JSON#--write-out-json. Closes #4870
2020-03-16tool_operate: fix add_parallel_transfers when more are in queueDaniel Stenberg
Trying to return early from the function if no new transfers were added would break the "morep" argument and cause issues. This could lead to zero content "transfers" (within quotes since they would never be started) when parallel-max was reduced. Reported-by: Gavin Wong Analyzed-by: Jay Satiro Fixes #4937 Closes #5112
2020-03-14Makefile.m32: Improve windres parameter compatibilityJay Satiro
- s/COFF/coff/ Some versions of windres do not recognize uppercase COFF as a valid way to specify the COFF output format. Reported-by: Steven Penny Fixes https://github.com/curl/curl/issues/5099 Closes https://github.com/curl/curl/pull/5101
2020-03-07tool_cb_see: set correct copyright year rangeDaniel Stenberg
Follow-up to a39e5bfb9
2020-03-07seek: fix fallback for missing ftruncate on WindowsMarc Hoersken
This fixes test 198 on versions of MinGW-w64 without ftruncate Reviewed-By: Daniel Stenberg Reviewed-By: Marcel Raad Closes #5055
2020-03-01polarssl: Additional removalSteve Holme
Follow up to 6357a19f. Reviewed-by: Daniel Stenberg Closes #5004
2020-02-21cleanup: comment typosDaniel Stenberg
Spotted by 'codespell' Closes #4957
2020-02-20win32: USE_WIN32_CRYPTO to enable Win32 based MD4, MD5 and SHA256 functionsSteve Holme
Whilst lib\md4.c used this pre-processor, lib\md5.c and src\tool_metalink.c did not and simply relied on the WIN32 pre-processor directive. Reviewed-by: Marcel Raad Closes #4955
2020-02-19nit: Copyright year out of dateDaniel Stenberg
Follow-up to 1fc0617dcc
2020-02-18tool_util: Improve Windows version of tvnow()Jay Satiro
- Change tool_util.c tvnow() for Windows to match more closely to timeval.c Curl_now(). - Create a win32 init function for the tool, since some initialization is required for the tvnow() changes. Prior to this change the monotonic time function used by curl in Windows was determined at build-time and not runtime. That was a problem because when curl was built targeted for compatibility with old versions of Windows (eg _WIN32_WINNT < 0x0600) it would use GetTickCount which wraps every 49.7 days that Windows has been running. This change makes curl behave similar to libcurl's tvnow function, which determines at runtime whether the OS is Vista+ and if so calls QueryPerformanceCounter instead. (Note QueryPerformanceCounter is used because it has higher resolution than the more obvious candidate GetTickCount64). The changes to tvnow are basically a copy and paste but the types in some cases are different. Ref: https://github.com/curl/curl/issues/3309 Closes https://github.com/curl/curl/pull/4847
2020-02-13tool_home: Fix the copyright year being out of dateSteve Holme
Follow up to 9dc350b6.
2020-02-12tool_homedir: Change GetEnv() to use libcurl's curl_getenv()Jay Satiro
- Deduplicate GetEnv() code. - On Windows change ultimate call to use Windows API GetEnvironmentVariable() instead of C runtime getenv(). Prior to this change both libcurl and the tool had their own GetEnv which over time diverged. Now the tool's GetEnv is a wrapper around curl_getenv (libcurl API function which is itself a wrapper around libcurl's GetEnv). Furthermore this change fixes a bug in that Windows API GetEnvironmentVariable() is called instead of C runtime getenv() to get the environment variable since some changes aren't always visible to the latter. Reported-by: Christoph M. Becker Fixes https://github.com/curl/curl/issues/4774 Closes https://github.com/curl/curl/pull/4863
2020-02-05curl: error on --alt-svc use w/o supportDaniel Stenberg
Make the tool check for alt-svc support at run-time and return error accordingly if not present when the option is used. Reported-by: Harry Sintonen Closes #4878
2020-02-04tool_operhlp: Copyright year out of date, should be 2020Daniel Stenberg
Follow-up from 2bc373740a3
2020-02-04curl: avoid using strlen for testing if a string is emptyOrgad Shaneh
Closes #4873
2020-01-26curl: make the -# spaceship bar not wrap the lineDaniel Stenberg
The fixed-point math made us lose precision and thus a too high index value could be used for outputting the hashtags which could overwrite the newline. The fix increases the precision in the sine table (*100) and the associated position math. Reported-by: Andrew Potter Fixes #4849 Closes #4850
2020-01-21smtp: Allow RCPT TO command to fail for some recipientsPavel Volgarev
Introduces CURLOPT_MAIL_RCPT_ALLLOWFAILS. Verified with the new tests 3002-3007 Closes #4816
2020-01-21curl: Let -D merge headers in one file againEmil Engler
Closes #4762 Fixes #4753
2020-01-16curl:progressbarinit: ignore column width from terminals < 20Daniel Stenberg
To avoid division by zero - or other issues. Reported-by: Daniel Marjamäki Closes #4818