Commit Graph

27926 Commits

Author SHA1 Message Date
Erik Stenlund
a24e895912
mime: mention CURL_DISABLE_MIME in comment
CURL_DISABLE_MIME is not mentioned in the comment describing the if else
preprocessor directive.

Closes #7882
2021-10-20 00:11:08 +02:00
Daniel Stenberg
54aa9c48b2
tls: remove newline from three infof() calls
Follow-up to e7416cf

Reported-by: billionai on github
Fixes #7879
Closes #7880
2021-10-19 23:03:57 +02:00
Daniel Stenberg
275e543133
RELEASE-NOTES: synced 2021-10-19 10:39:40 +02:00
Daniel Stenberg
de0bd8547e
curl_gssapi: fix build warnings by removing const
Follow-up to 20e980f85b

In #7875 these inits were modified but I get two warnings that these new
typecasts are necessary for.

Closes #7876
2021-10-19 10:34:20 +02:00
Bo Anderson
20e980f85b
curl_gssapi: fix link error on macOS Monterey
Fixes #7657
Closes #7875
2021-10-19 09:34:21 +02:00
Daniel Stenberg
c75f14cb9d
test1185: verify checksrc
Closes #7866
2021-10-18 23:52:30 +02:00
Daniel Stenberg
3da8b4dabf
checksrc: improve the SPACESEMICOLON error message
and adjust the MULTISPACE one to use plural

Closes #7866
2021-10-18 23:52:30 +02:00
Daniel Stenberg
bffe90cf2e
url: set "k->size" -1 at start of request
The size of the transfer is unknown at that point.

Fixes #7871
Closes #7872
2021-10-18 16:27:02 +02:00
Daniel Gustafsson
f06280eb53 doh: remove experimental code for DoH with GET
The code for sending DoH requests with GET was never enabled in a way
such that it could be used or tested. As there haven't been requests
for this feature, and since it at this is effectively dead, remove it
and favor reimplementing the feature in case anyone is interested.

Closes #7870
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2021-10-18 13:25:57 +02:00
Daniel Stenberg
a265ce4371
cirrus: remove FreeBSD 11.4 from the matrix
It has reached End-Of-Life and causes some LDAP CI issues.

Closes #7869
2021-10-18 10:41:24 +02:00
Daniel Stenberg
fc746cd340
cirrus: switch to openldap24-client
... as it seems openldap-client doesn't exist anymore.

Reported-by: Jay Satiro
Fixes #7868
Closes #7869
2021-10-18 10:41:15 +02:00
Daniel Stenberg
53418dbc84
checksrc: ignore preprocessor lines
In order to check the actual code better, checksrc now ignores
everything that look like preprocessor instructions. It also means
that code in macros are now longer checked.

Note that some rules then still don't need to be followed when code is
exactly below a cpp instruction.

Removes two checksrc exceptions we needed previously because of
preprocessor lines being checked.

Reported-by: Marcel Raad
Fixes #7863
Closes #7864
2021-10-17 11:19:49 +02:00
Daniel Stenberg
efffa66f65
urlapi: skip a strlen(), pass in zero
... to let curl_easy_escape() itself do the strlen. This avoids a (false
positive) Coverity warning and it avoids us having to store the strlen()
return value in an int variable.

Reviewed-by: Daniel Gustafsson
Closes #7862
2021-10-15 23:22:14 +02:00
Daniel Stenberg
ccb466fd36
misc: update copyright years 2021-10-15 17:07:19 +02:00
Daniel Stenberg
b75045aa12
examples/htmltidy: correct wrong printf() use
... and update the includes to match how current htmltidy wants them
used.

Reported-by: Stathis Kapnidis
Fixes #7860
Closes #7861
2021-10-15 10:00:11 +02:00
Jay Satiro
b1d08d295f http: set content length earlier
- Make content length (ie download size) accessible to the user in the
  header callback, but only after all headers have been processed (ie
  only in the final call to the header callback).

Background:

For a long time the content length could be retrieved in the header
callback via CURLINFO_CONTENT_LENGTH_DOWNLOAD_T as soon as it was parsed
by curl.

Changes were made in 8a16e54 (precedes 7.79.0) to ignore content length
if any transfer encoding is used. A side effect of that was that
content length was not set by libcurl until after the header callback
was called the final time, because until all headers are processed it
cannot be determined if content length is valid.

This change keeps the same intention --all headers must be processed--
but now the content length is available before the final call to the
header function that indicates all headers have been processed (ie
a blank header).

Bug: https://github.com/curl/curl/commit/8a16e54#r57374914
Reported-by: sergio-nsk@users.noreply.github.com

Co-authored-by: Daniel Stenberg

Fixes https://github.com/curl/curl/issues/7804
Closes https://github.com/curl/curl/pull/7803
2021-10-15 03:40:16 -04:00
Abhinav Singh
8c6f126279
aws-sigv4: make signature work when post data is binary
User sets the post fields size for binary data.  Hence, we should not be
using strlen on it.

Added test 1937 and 1938 to verify.

Closes #7844
2021-10-15 08:46:23 +02:00
a1346054
7759552b80
MacOSX-Framework: remove redundant ';'
Closes #7859
2021-10-15 08:08:14 +02:00
Daniel Stenberg
d79a2664ae
RELEASE-NOTES: synced 2021-10-14 23:04:27 +02:00
Daniel Stenberg
f3c215e18a
openssl: with OpenSSL 1.1.0+ a failed RAND_status means goaway
One reason we know it can fail is if a provider is used that doesn't do
a proper job or is wrongly configured.

Reported-by: Michael Baentsch
Fixes #7840
Closes #7856
2021-10-14 22:44:58 +02:00
Ryan Mast
a132b927d7
cmake: add CURL_ENABLE_SSL option and make CMAKE_USE_* SSL backend options depend on it
Closes https://github.com/curl/curl/pull/7822
2021-10-14 16:47:04 +02:00
Daniel Stenberg
d36fded576
http: remove assert that breaks hyper
Reported-by: Jay Satiro
Fixes #7852
Closes #7855
2021-10-14 11:16:37 +02:00
Daniel Stenberg
975a54dd86
http_proxy: fix one more result assign for hyper
and remove the bad assert again, since it was run even with no error!

Closes #7854
2021-10-14 11:15:40 +02:00
Jay Satiro
afd489885e sws: fix memory leak on exit
- Free the allocated http request struct on cleanup.

Prior to this change if sws was built with leak sanitizer it would
report a memory leak error during testing.

Closes https://github.com/curl/curl/pull/7849
2021-10-14 03:24:18 -04:00
Daniel Stenberg
a3030b7db6
c-hyper: make Curl_http propagate errors better
Pass on better return codes when errors occur within Curl_http instead
of insisting that CURLE_OUT_OF_MEMORY is the only possible one.

Pointed-out-by: Jay Satiro
Closes #7851
2021-10-14 07:49:09 +02:00
Daniel Stenberg
95c6abe135
http_proxy: make hyper CONNECT() return the correct error code
For every 'goto error', make sure the result variable holds the error
code for what went wrong.

Reported-by: Rafał Mikrut
Fixes #7825
Closes #7846
2021-10-14 07:47:29 +02:00
Daniel Stenberg
f9174a5073
docs/Makefile.am: repair 'make html'
by removing index.html which isn't around anymore

Closes #7853
2021-10-14 07:46:13 +02:00
Борис Верховский
3aead057a1
curl: correct grammar in generated libcurl code
Closes #7802
2021-10-13 00:33:20 +02:00
Daniel Stenberg
3723ba62a5
tests: disable test 2043
It uses revoked.badssl.com which now is expired and therefor this now
permafails. We should not use external sites for tests, this test should
be converted to use our own infra.

Closes #7845
2021-10-13 00:02:30 +02:00
Daniel Stenberg
8a534f8838
runtests: split out ignored tests
Report ignore tests separately from the actual fails.

Don't exit non-zero if test servers couldn't get killed.

Assisted-by: Jay Satiro

Fixes #7818
Closes #7841
2021-10-12 17:00:50 +02:00
Daniel Stenberg
1fed8feaf1
http2: make getsock not wait for write if there's no remote window
While uploading, check for remote window availability in the getsock
function so that we don't wait for a writable socket if no data can be
sent.

Reported-by: Steini2000 on github
Fixes #7821
Closes #7839
2021-10-12 11:19:22 +02:00
Daniel Stenberg
e38d2e5a50
test368: verify dash is appended for "-r [num]"
Follow-up to 8758a26f88
2021-10-11 22:52:30 +02:00
Борис Верховский
8758a26f88
curl: actually append "-" to --range without number only
Closes #7837
2021-10-11 22:51:13 +02:00
Daniel Stenberg
1edc423883
RELEASE-NOTES: synced 2021-10-11 17:14:16 +02:00
Daniel Stenberg
9a8564a920
urlapi: URL decode percent-encoded host names
The host name is stored decoded and can be encoded when used to extract
the full URL. By default when extracting the URL, the host name will not
be URL encoded to work as similar as possible as before. When not URL
encoding the host name, the '%' character will however still be encoded.

Getting the URL with the CURLU_URLENCODE flag set will percent encode
the host name part.

As a bonus, setting the host name part with curl_url_set() no longer
accepts a name that contains space, CR or LF.

Test 1560 has been extended to verify percent encodings.

Reported-by: Noam Moshe
Reported-by: Sharon Brizinov
Reported-by: Raul Onitza-Klugman
Reported-by: Kirill Efimov
Fixes #7830
Closes #7834
2021-10-11 17:04:14 +02:00
Marc Hoersken
ab1671cafe
CI/makefiles: introduce dedicated test target
Make it easy to use the same set of test flags
throughout all current and future CI builds.

Reviewed-by: Jay Satiro

Follow up to #7690
Closes #7785
2021-10-08 20:16:15 +02:00
Daniel Stenberg
aceff6088c
maketgz: redirect updatemanpages.pl output to /dev/null 2021-10-08 15:16:34 +02:00
Daniel Stenberg
33882a066e
CURLOPT_HTTPHEADER.3: add descripion for specific headers
Settting Host: or Transfer-Encoding: chunked actually have special
meanings to libcurl. This change tries to document them

Closes #7829
2021-10-08 15:15:30 +02:00
Daniel Stenberg
4e0c28923a
c-hyper: use hyper_request_set_uri_parts to make h2 better
and make sure to not send Host: over h2.

Fixes #7679
Reported-by: David Cook
Closes #7827
2021-10-08 15:14:29 +02:00
Michael Afanasiev
9597d2def7
curl-openssl.m4: modify library order for openssl linking
lcrypto may depend on lz, and configure corrently fails with when
statically linking as the order is "-lz -lcrypto". This commit switches
the order to "-lcrypto -lz".

Closes #7826
2021-10-08 10:50:57 +02:00
Marcel Raad
94696e1b51 sha256: use high-level EVP interface for OpenSSL
Available since OpenSSL 0.9.7. The low-level SHA256 interface is
deprecated in OpenSSL v3, and its usage was discouraged even before.

Closes https://github.com/curl/curl/pull/7808
2021-10-07 18:41:27 +02:00
Marcel Raad
802d864450 curl_ntlm_core: use OpenSSL only if DES is available
This selects another SSL backend then if available, or otherwise at
least gives a meaningful error message.

Closes https://github.com/curl/curl/pull/7808
2021-10-07 18:41:23 +02:00
Marcel Raad
b352e03ec8 md5: fix compilation with OpenSSL 3.0 API
Only use OpenSSL's MD5 code if it's available.

Also fix wolfSSL build with `NO_MD5`, in which case neither the
wolfSSL/OpenSSL implementation nor the fallback implementation was
used.

Closes https://github.com/curl/curl/pull/7808
2021-10-07 18:40:03 +02:00
Daniel Stenberg
8dd0f1aa46
print_category: printf %*s needs an int argument
... not a size_t!

Detected by Coverity: CID 1492331.
Closes #7823
2021-10-07 11:15:12 +02:00
Jay Satiro
5044909ca2 version_win32: use actual version instead of manifested version
- Use RtlVerifyVersionInfo instead of VerifyVersionInfo, when possible.

Later versions of Windows have normal version functions that compare and
return versions based on the way the application is manifested, instead
of the actual version of Windows the application is running on. We
prefer the actual version of Windows so we'll now call the Rtl variant
of version functions (RtlVerifyVersionInfo) which does a proper
comparison of the actual version.

Reported-by: Wyatt O'Day

Ref: https://github.com/curl/curl/pull/7727

Fixes https://github.com/curl/curl/issues/7742
Closes https://github.com/curl/curl/pull/7810
2021-10-07 03:18:22 -04:00
Daniel Stenberg
a031614a84
RELEASE-NOTES: synced 2021-10-06 22:52:09 +02:00
Daniel Stenberg
87907d56f0
http: fix Basic auth with empty name field in URL
Add test 367 to verify.

Reported-by: Rick Lane
Fixes #7819
Closes #7820
2021-10-06 22:45:52 +02:00
Jeffrey Tolar
5f563495f1
CURLOPT_MAXLIFETIME_CONN: maximum allowed lifetime for conn reuse
... and close connections that are too old instead of reusing them.

By default, this behavior is disabled.

Bug: https://curl.se/mail/lib-2021-09/0058.html
Closes #7751
2021-10-06 14:38:59 +02:00
Daniel Gustafsson
013cb2ff7d docs/examples: add missing binaries to gitignore
Commit f65d7889b added getreferrer, and commit ae8e11ed5 multi-legacy,
both of which missed adding .gitignore clauses for the built binaries.

Closes #7817
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2021-10-06 10:46:00 +02:00
Josip Medved
2ac10a9ea0
HTTP3: fix the HTTP/3 Explained book link
Closes #7813
2021-10-05 08:40:24 +02:00