]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 years agoconfig: remove the check for and use of SIZEOF_SHORT
Daniel Stenberg [Thu, 11 Aug 2022 07:07:06 +0000 (09:07 +0200)] 
config: remove the check for and use of SIZEOF_SHORT

shorts are 2 bytes on all platforms curl runs and have ever run on.

Closes #9291

2 years agoconfigure: introduce CURL_SIZEOF
Daniel Stenberg [Thu, 11 Aug 2022 07:07:02 +0000 (09:07 +0200)] 
configure: introduce CURL_SIZEOF

This is a rewrite of the previously used GPLv3+exception licensed
file. With this change, there is no more reference to GPL so we can
remove that from LICENSES/.

Ref: #9220
Closes #9291

2 years agohyper: customize test1274 to how hyper unfolds headers
Sean McArthur [Thu, 28 Jul 2022 01:15:22 +0000 (18:15 -0700)] 
hyper: customize test1274 to how hyper unfolds headers

Closes #9217

2 years agocurl-config: quote directories with potential space
Orgad Shaneh [Fri, 5 Aug 2022 09:46:32 +0000 (12:46 +0300)] 
curl-config: quote directories with potential space

On Windows (at least with CMake), the default prefix is
C:/Program Files (x86)/CURL.

Closes #9253

2 years agoamigaos: fix threaded resolver on AmigaOS 4.x
Futaura [Sun, 7 Aug 2022 13:42:19 +0000 (14:42 +0100)] 
amigaos: fix threaded resolver on AmigaOS 4.x

Replace ip4 resolution function on AmigaOS 4.x, as it requires runtime
feature detection and extra code to make it thread safe.

Closes #9265

2 years agoimap: use ISALNUM() for alphanumeric checks
Emil Engler [Wed, 10 Aug 2022 07:35:38 +0000 (09:35 +0200)] 
imap: use ISALNUM() for alphanumeric checks

This commit replaces a self-made character check for alphanumeric
characters within imap_is_bchar() with the ISALNUM() macro, as it is
reduces the size of the code and makes the performance better, due to
ASCII arithmetic.

Closes #9289

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 10 Aug 2022 06:46:05 +0000 (08:46 +0200)] 
RELEASE-NOTES: synced

2 years agoconnect: add quic connection information
Cering [Wed, 10 Aug 2022 04:27:09 +0000 (12:27 +0800)] 
connect: add quic connection information

Fixes #9286
Closes #9287

2 years agocirrus/freebsd-ci: bootstrap the pip installer
Philip H [Tue, 26 Jul 2022 20:37:56 +0000 (22:37 +0200)] 
cirrus/freebsd-ci: bootstrap the pip installer

Signed-off-by: Philip H <47042125+pheiduck@users.noreply.github.com>
Closes #9213

2 years agourldata: move smaller fields down in connectdata struct
Daniel Stenberg [Mon, 8 Aug 2022 12:41:01 +0000 (14:41 +0200)] 
urldata: move smaller fields down in connectdata struct

By (almost) sorting the struct fields in connectdata in a decending size
order, having the single char ones last, we reduce the number of holes
in the struct and thus the amount of storage needed.

Closes #9280

2 years agoldap: adapt to conn->port now being an 'int'
Daniel Stenberg [Mon, 8 Aug 2022 14:23:03 +0000 (16:23 +0200)] 
ldap: adapt to conn->port now being an 'int'

Remove typecasts. Fix printf() formats.

Follow-up from 764c6bd3bf.
Pointed out by Coverity CID 1507858.

Closes #9281

2 years agoKNOWN_BUGS: Negotiate authentication against Hadoop HDFS
Daniel Stenberg [Mon, 8 Aug 2022 14:45:51 +0000 (16:45 +0200)] 
KNOWN_BUGS: Negotiate authentication against Hadoop HDFS

Closes #8264

2 years agofile: add handling of native AmigaOS paths
Futaura [Fri, 5 Aug 2022 11:38:30 +0000 (12:38 +0100)] 
file: add handling of native AmigaOS paths

On AmigaOS 4.x, handle native absolute paths, whilst blocking relative
paths. Also allow unix style paths if feature enabled at link time.

Inspiration-from: Michael Trebilcock

Closes #9259

2 years agoKNOWN_BUGS: cmake build is not thread-safe
Daniel Stenberg [Mon, 8 Aug 2022 14:00:17 +0000 (16:00 +0200)] 
KNOWN_BUGS: cmake build is not thread-safe

The cmake build does not check for and verify presence of a working
Atomic type, which then makes curl_global_init() to not build
thread-safe on non-Windows platforms.

Closes https://github.com/curl/curl/issues/8973
Closes https://github.com/curl/curl/pull/8982

2 years agoconfigure: fixup bsdsocket detection code for AmigaOS 4.x
Futaura [Sun, 7 Aug 2022 16:15:16 +0000 (17:15 +0100)] 
configure: fixup bsdsocket detection code for AmigaOS 4.x

The code that detects bsdsocket.library for AmigaOS did not work
for AmigaOS 4.x. This has been fixed and also cleaned up a little
to reduce duplication. Wasn't technically necessary before, but is
required when building with AmiSSL instead of OpenSSL.

Closes #9268

2 years agotool: reintroduce set file comment code for AmigaOS
Futaura [Fri, 5 Aug 2022 09:48:24 +0000 (10:48 +0100)] 
tool: reintroduce set file comment code for AmigaOS

Amiga specific code which put the URL in the file comment was perhaps
accidentally removed in b88940850002a3f1c25bc6488b95ad30eb80d696 having
originally been added in 5c215bdbdfde8b2350cdcbac82aae0c914da5314.
Reworked to fit the code changes and added it back in.

Reported-by: Michael Trebilcock
Originally-added-by: Chris Young
Closes #9258

2 years agourldata: make 'negnpn' use less storage
Daniel Stenberg [Mon, 8 Aug 2022 11:21:01 +0000 (13:21 +0200)] 
urldata: make 'negnpn' use less storage

The connectdata struct field 'negnpn' never holds a value larger than
30, so an unsigned char saves 3 bytes struct space.

Closes #9279

2 years agourldata: make three *_proto struct fields smaller
Daniel Stenberg [Mon, 8 Aug 2022 11:16:52 +0000 (13:16 +0200)] 
urldata: make three *_proto struct fields smaller

Use 'unsigned char' for storage instead of the enum, for three GSSAPI
related fields in the connectdata struct.

Closes #9278

2 years agoconnect: set socktype/protocol correctly
Daniel Stenberg [Mon, 8 Aug 2022 10:36:41 +0000 (12:36 +0200)] 
connect: set socktype/protocol correctly

So that an address used from the DNS cache that was previously used for
QUIC can be reused for TCP and vice versa.

To make this possible, set conn->transport to "unix" for unix domain
connections ... and store the transport struct field in an unsigned char
to use less space.

Reported-by: ウさん
Fixes #9274
Closes #9276

2 years agoamissl: allow AmiSSL to be used with AmigaOS 4.x builds
Futaura [Sun, 7 Aug 2022 16:04:47 +0000 (17:04 +0100)] 
amissl: allow AmiSSL to be used with AmigaOS 4.x builds

Enable AmiSSL to be used instead of static OpenSSL link libraries.
for AmigaOS 4.x, as it already is in the AmigaOS 3.x build.

Closes #9269

2 years agoopenssl: add details to "unable to set client certificate" error
opensignature [Sat, 30 Jul 2022 13:14:06 +0000 (15:14 +0200)] 
openssl: add details to "unable to set client certificate" error

from: "curl: (58) unable to set client certificate"

to: curl: (58) unable to set client certificate [error:0A00018F:SSL
routines::ee key too small]

Closes #9228

2 years agoamissl: make AmiSSL v5 a minimum requirement
Futaura [Sun, 7 Aug 2022 14:03:32 +0000 (15:03 +0100)] 
amissl: make AmiSSL v5 a minimum requirement

AmiSSL v5 is the latest version, featuring a port of OpenSSL 3.0.
Support for previous OpenSSL 1.1.x versions has been dropped, so
makes sense to enforce v5 as the minimum requirement. This also
allows all the AmiSSL stub workarounds to be removed as they are
now provided in a link library in the AmiSSL SDK.

Closes #9267

2 years agoconfigure: -pthread not available on AmigaOS 4.x
Futaura [Sun, 7 Aug 2022 14:42:35 +0000 (15:42 +0100)] 
configure: -pthread not available on AmigaOS 4.x

The most recent GCC builds for AmigaOS 4.x do not allow -pthread and
exit with an error. Instead, need to explictly specify -lpthread.

Closes #9266

2 years agodigest: pass over leading spaces in qop values
Daniel Stenberg [Sun, 7 Aug 2022 22:30:58 +0000 (00:30 +0200)] 
digest: pass over leading spaces in qop values

When parsing the "qop=" parameter of the digest authentication, and the
value is provided within quotes, the list of values can have leading
white space which the parser previously did not handle correctly.

Add test case 388 to verify.

Reported-by: vlubart on github
Fixes #9264
Closes #9270

2 years agodigest: reject broken header with session protocol but without qop
Evgeny Grin (Karlson2k) [Thu, 30 Jun 2022 15:30:21 +0000 (18:30 +0300)] 
digest: reject broken header with session protocol but without qop

Closes #9077

2 years agoCURLINFO_SPEED_UPLOAD/DOWNLOAD.3: fix examples
Daniel Stenberg [Tue, 2 Aug 2022 14:15:55 +0000 (16:15 +0200)] 
CURLINFO_SPEED_UPLOAD/DOWNLOAD.3: fix examples

Reported-by: jvvprasad78 on github
Assisted-by: Jay Satiro
Fixes #9239
Closes #9241

2 years agotest44[2-4]: add '--resolve' to the keywords
Fabian Keil [Tue, 2 Aug 2022 18:33:11 +0000 (20:33 +0200)] 
test44[2-4]: add '--resolve' to the keywords

... so the tests can be automatically skipped when
using an external proxy like Privoxy.

Closes #9250

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 7 Aug 2022 12:14:42 +0000 (14:14 +0200)] 
RELEASE-NOTES: synced

2 years agoCURLOPT_CONNECT_ONLY.3: clarify multi API use
Daniel Stenberg [Sat, 6 Aug 2022 22:25:30 +0000 (00:25 +0200)] 
CURLOPT_CONNECT_ONLY.3: clarify multi API use

Reported-by: Maxim Ivanov
Fixes #9244
Closes #9262

2 years agocurl_easy_header: Add CURLH_PSEUDO to sanity check
Andrew Lambert [Sun, 31 Jul 2022 21:21:09 +0000 (14:21 -0700)] 
curl_easy_header: Add CURLH_PSEUDO to sanity check

Fixes #9235
Closes #9236

2 years agodocs: add dns category to --resolve
Emil Engler [Sat, 30 Jul 2022 19:55:04 +0000 (21:55 +0200)] 
docs: add dns category to --resolve

This commit adds the dns category to the --resolve command line option,
because it can be interpreted as both: a low-level connection option and
an option related to the resolving of a hostname.

It is also not common for dns options to belong to the connection
category and vice versa.  --ipv4 and --ipv6 are both good examples.

Closes #9229

3 years agoschannel: Add TLS 1.3 support
Wyatt O'Day [Fri, 22 Jul 2022 14:45:28 +0000 (10:45 -0400)] 
schannel: Add TLS 1.3 support

- Support TLS 1.3 as the default max TLS version for Windows Server 2022
  and Windows 11.

- Support specifying TLS 1.3 ciphers via existing option
  CURLOPT_TLS13_CIPHERS (tool: --tls13-ciphers).

Closes https://github.com/curl/curl/pull/8419

3 years agocmdline-opts/gen.pl: improve performance
Emil Engler [Sat, 30 Jul 2022 20:36:55 +0000 (22:36 +0200)] 
cmdline-opts/gen.pl: improve performance

On some systems, the gen.pl script takes nearly two minutes for the
generation of the main-page, which is a completely unacceptable time.

The slow performance has two causes:
1. Use of a regex locale operator
2. Useless invokations of loops

The commit addresses the first issue by replacing the "\W" wiht
[^a-zA-Z0-9_], which is, according to regex101.com, functionally
equivalent to the previous operation, except that it is obviously
limited to ASCII only, which is fine, as the curl project is
English-only anyway.

The second issue is being addressed by only running the loop if the line
contains a "--" in it. The loop may be completeley removed in the
future.

Co-authored-by: Emanuele Torre <torreemanuele6@gmail.com>
See #8299
Fixes #9230
Closes #9232

3 years agodocs/cmdline: mark fail and fail-with-body as mutually exclusive
Daniel Stenberg [Thu, 28 Jul 2022 19:02:45 +0000 (21:02 +0200)] 
docs/cmdline: mark fail and fail-with-body as mutually exclusive

Reported-by: Andreas Sommer
Fixes #9221
Closes #9222

3 years agoquiche: fix build failure
Nao Yonashiro [Fri, 29 Jul 2022 08:43:01 +0000 (17:43 +0900)] 
quiche: fix build failure

Reviewed-by: Alessandro Ghedini
Closes #9223

3 years agoconfigure.ac: drop references to deleted functions
Viktor Szakats [Tue, 2 Aug 2022 12:20:20 +0000 (12:20 +0000)] 
configure.ac: drop references to deleted functions

follow-up from 4d73854462f30948acab12984b611e9e33ee41e6

Reported-by: Oliver Roberts
Fixes #9238
Closes #9240

3 years agohyper: enable obs-folded multiline headers
Sean McArthur [Wed, 27 Jul 2022 15:23:41 +0000 (08:23 -0700)] 
hyper: enable obs-folded multiline headers

Closes #9216

3 years agoconnect: revert the use of IP*_RECVERR
Daniel Stenberg [Tue, 26 Jul 2022 22:42:42 +0000 (00:42 +0200)] 
connect: revert the use of IP*_RECVERR

The options were added in #6341 and d13179d, but cause problems: Lots of
POLLIN event occurs but recvfrom read nothing.

Reported-by: Tatsuhiro Tsujikawa
Fixes #9209
Closes #9215

3 years agodocs: remove him/her/he/she from documentation
Marco Kamner [Wed, 27 Jul 2022 11:52:53 +0000 (13:52 +0200)] 
docs: remove him/her/he/she from documentation

Closes #9208

3 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 27 Jul 2022 10:34:31 +0000 (12:34 +0200)] 
RELEASE-NOTES: synced

3 years agotool_getparam: make --doh-url "" switch it off
Daniel Stenberg [Tue, 26 Jul 2022 09:00:31 +0000 (11:00 +0200)] 
tool_getparam: make --doh-url "" switch it off

A possible future addition could be to parse the URL first too to verify
that it is valid before trying to use it.

Assisted-by: Jay Satiro
Closes #9207

3 years agomailmap: add rzrymiak on github
Daniel Stenberg [Tue, 26 Jul 2022 21:15:45 +0000 (23:15 +0200)] 
mailmap: add rzrymiak on github

3 years agongtcp2: Fix build error due to change in nghttp3 prototypes
Jay Satiro [Mon, 25 Jul 2022 17:53:39 +0000 (13:53 -0400)] 
ngtcp2: Fix build error due to change in nghttp3 prototypes

ngtcp2/nghttp3@4a066b2 changed nghttp3_conn_block_stream and
nghttp3_conn_shutdown_stream_write return from int to void.

Reported-by: jurisuk@users.noreply.github.com
Fixes https://github.com/curl/curl/issues/9204
Closes https://github.com/curl/curl/pull/9200

3 years agoBUGS.md: improve language
rzrymiak [Tue, 26 Jul 2022 04:39:57 +0000 (21:39 -0700)] 
BUGS.md: improve language

Closes #9205

3 years agocirrus.yml: replace py38-pip with py39-pip
Philip H [Mon, 25 Jul 2022 20:08:24 +0000 (22:08 +0200)] 
cirrus.yml: replace py38-pip with py39-pip

Reported-by: Jay Satiro
Fixes #9201
Closes #9202

3 years agotool_getparam: fix cleanarg() for unicode builds
Daniel Stenberg [Sat, 23 Jul 2022 11:33:57 +0000 (13:33 +0200)] 
tool_getparam: fix cleanarg() for unicode builds

Use the correct type, and make cleanarg an empty macro if the cleaning
ability is absent.

Fixes #9195
Closes #9196

Reviewed-by: Jay Satiro
Reviewed-by: Marcel Raad
3 years agotest3026: add support for Windows using native Win32 threads 9212/head
Marc Hoersken [Tue, 14 Jun 2022 19:55:15 +0000 (21:55 +0200)] 
test3026: add support for Windows using native Win32 threads

Reviewed-by: Viktor Szakats
Reviewed-by: Jay Satiro
Reviewed-by: Daniel Stenberg
Follow up to 7ade9c50b35d95d47a43880c3097bebab7a7e690
Closes #9012

3 years agodigest: fix memory leak, fix not quoted 'opaque'
Evgeny Grin (Karlson2k) [Mon, 25 Jul 2022 11:36:16 +0000 (14:36 +0300)] 
digest: fix memory leak, fix not quoted 'opaque'

Fix leak regression introduced by 3a6fe0c.

Closes https://github.com/curl/curl/pull/9199

3 years agotests: several enumerated type cleanups
Daniel Stenberg [Wed, 20 Jul 2022 23:04:39 +0000 (01:04 +0200)] 
tests: several enumerated type cleanups

To please icc

Closes #9179

3 years agotool_paramhlp: fix "enumerated type mixed with another type"
Daniel Stenberg [Wed, 20 Jul 2022 22:26:29 +0000 (00:26 +0200)] 
tool_paramhlp: fix "enumerated type mixed with another type"

Warning by icc

Closes #9179

3 years agotool_writeout: fix enumerated type mixed with another type
Daniel Stenberg [Wed, 20 Jul 2022 22:05:25 +0000 (00:05 +0200)] 
tool_writeout: fix enumerated type mixed with another type

Closes #9179

3 years agotool_cfgable: make 'synthetic_error' a plain bool
Daniel Stenberg [Wed, 20 Jul 2022 21:53:34 +0000 (23:53 +0200)] 
tool_cfgable: make 'synthetic_error' a plain bool

The specific reason was not used.

Closes #9179

3 years agotool_paramhlp: make check_protocol return ParameterError
Daniel Stenberg [Wed, 20 Jul 2022 21:41:41 +0000 (23:41 +0200)] 
tool_paramhlp: make check_protocol return ParameterError

"enumerated type mixed with another type"

Closes #9179

3 years agotool_formparse: fix variable may be used before its value is set
Daniel Stenberg [Wed, 20 Jul 2022 21:33:59 +0000 (23:33 +0200)] 
tool_formparse: fix variable may be used before its value is set

Warning by icc

Closes #9179

3 years agosendf: skip storing HTTP headers if HTTP disabled
Daniel Stenberg [Wed, 20 Jul 2022 21:29:09 +0000 (23:29 +0200)] 
sendf: skip storing HTTP headers if HTTP disabled

Closes #9179

3 years agourl: enumerated type mixed with another type
Daniel Stenberg [Wed, 20 Jul 2022 21:24:17 +0000 (23:24 +0200)] 
url: enumerated type mixed with another type

Follow-up to 1c58e7ae99ce2030213f28b

Closes #9179

3 years agourldata: change second proxytype field to unsigned char to match
Daniel Stenberg [Wed, 20 Jul 2022 21:13:35 +0000 (23:13 +0200)] 
urldata: change second proxytype field to unsigned char to match

To avoid "enumerated type mixed with another type"

Closes #9179

3 years agohttp: typecast the httpreq assignment to avoid icc compiler warning
Daniel Stenberg [Wed, 20 Jul 2022 20:40:30 +0000 (22:40 +0200)] 
http: typecast the httpreq assignment to avoid icc compiler warning

 error #188: enumerated type mixed with another type

Closes #9179

3 years agourldata: make state.httpreq an unsigned char
Daniel Stenberg [Wed, 20 Jul 2022 11:57:34 +0000 (13:57 +0200)] 
urldata: make state.httpreq an unsigned char

To match set.method used for the same purpose.

Closes #9179

3 years agosplay: avoid using -1 in unsigned variable
Daniel Stenberg [Wed, 20 Jul 2022 11:44:37 +0000 (13:44 +0200)] 
splay: avoid using -1 in unsigned variable

To fix icc compiler warning integer conversion resulted in a change of sign

Closes #9179

3 years agosendf: store the header type in an usigned char to avoid icc warnings
Daniel Stenberg [Wed, 20 Jul 2022 10:48:49 +0000 (12:48 +0200)] 
sendf: store the header type in an usigned char to avoid icc warnings

Closes #9179

3 years agomulti: fix the return code from Curl_pgrsDone()
Daniel Stenberg [Wed, 20 Jul 2022 10:13:02 +0000 (12:13 +0200)] 
multi: fix the return code from Curl_pgrsDone()

It does not return a CURLcode. Detected by the icc compiler warning
"enumerated type mixed with another type"

Closes #9179

3 years agosendf: make Curl_debug a void function
Daniel Stenberg [Wed, 20 Jul 2022 09:15:25 +0000 (11:15 +0200)] 
sendf: make Curl_debug a void function

As virtually no called checked the return code, and those that did
wrongly treated it as a CURLcode. Detected by the icc compiler warning:
enumerated type mixed with another type

Closes #9179

3 years agohttp_chunks: remove an assign + typecast
Daniel Stenberg [Wed, 20 Jul 2022 09:05:50 +0000 (11:05 +0200)] 
http_chunks: remove an assign + typecast

As it caused icc to complain: "pointer cast involving 64-bit pointed-to
type"

Closes #9179

3 years agovtls: make Curl_ssl_backend() return the enum type curl_sslbackend
Daniel Stenberg [Wed, 20 Jul 2022 08:58:16 +0000 (10:58 +0200)] 
vtls: make Curl_ssl_backend() return the enum type curl_sslbackend

To fix the icc warning enumerated type mixed with another type

Closes #9179

3 years agocurl-compilers.m4: make icc use -diag* options and disable two warnings
Daniel Stenberg [Wed, 20 Jul 2022 11:22:09 +0000 (13:22 +0200)] 
curl-compilers.m4: make icc use -diag* options and disable two warnings

-wd and -we are deprecated and are now -diag-disable and -diag-error

Disable warning 1024 and 2259

Closes #9179

3 years agoGHA: add two Intel compiler CI jobs
Matthew Thompson [Fri, 22 Jul 2022 22:29:37 +0000 (00:29 +0200)] 
GHA: add two Intel compiler CI jobs

Closes #9179

3 years agocurl-functions.m4: check whether atomics can link rather than just compile
Daniel Katz [Thu, 21 Jul 2022 00:20:42 +0000 (20:20 -0400)] 
curl-functions.m4: check whether atomics can link rather than just compile

Some build toolchains support C11 atomics (i.e., _Atomic types), but
will not link the associated atomics runtime unless a flag is passed. In
such an environment, linking an application with libcurl.a can fail due
to undefined symbols for atomic load/store functions.

I encountered this behavior when upgrading curl to 7.84.0 and attempting
to build with Solaris Studio 12.6. Solaris provides the flag
-xatomic=[gcc | studio], allowing users to link to one of two atomics
runtime implementations. However, if the user does not provide this
flag, then neither runtime is linked. This led to builds failing in CI.

Closes #9190

3 years agocurl-wolfssl.m4: add options header when building test code
Rosen Penev [Wed, 20 Jul 2022 02:22:20 +0000 (19:22 -0700)] 
curl-wolfssl.m4: add options header when building test code

Needed for certain configurations of wolfSSL. Otherwise, missing header
error may occur.

Tested with OpenWrt.

Closes #9187

3 years agoftp: use a correct expire ID for timer expiry
Daniel Stenberg [Tue, 19 Jul 2022 19:03:48 +0000 (21:03 +0200)] 
ftp: use a correct expire ID for timer expiry

This was an accurate error pointed out by the icc warning: enumerated
type mixed with another type

Ref: #9179
Closes #9184

3 years agosendf: fix paused header writes since after the header API
Daniel Stenberg [Tue, 19 Jul 2022 15:54:23 +0000 (17:54 +0200)] 
sendf: fix paused header writes since after the header API

Regression since d1e4a67

Reported-by: Sergey Ogryzkov
Fixes #9180
Closes #9182

3 years agomprintf: fix *dyn_vprintf() when out-of-memory
Daniel Stenberg [Tue, 19 Jul 2022 20:32:12 +0000 (22:32 +0200)] 
mprintf: fix *dyn_vprintf() when out-of-memory

Follow-up to 0e48ac1f99a. Torture-testing 1455 would lead to a memory
leak otherwise.

Closes #9185

3 years agocurl-confopts: remove leftover AC_REQUIREs
Daniel Stenberg [Tue, 19 Jul 2022 16:12:31 +0000 (18:12 +0200)] 
curl-confopts: remove leftover AC_REQUIREs

configure.ac:3488: warning: CURL_CHECK_FUNC_IOCTL is m4_require'd but not m4_defun'd
configure.ac:3488: warning: CURL_CHECK_FUNC_SETSOCKOPT is m4_require'd but not m4_defun'd

follow-up from 4d73854462f30

Closes #9183

3 years agofile: fix icc enumerated type mixed with another type warning
Daniel Stenberg [Tue, 19 Jul 2022 14:45:30 +0000 (16:45 +0200)] 
file: fix icc enumerated type mixed with another type warning

Ref: #9179
Closes #9181

3 years agotidy-up: delete unused build configuration macros
Viktor Szakats [Tue, 19 Jul 2022 15:06:26 +0000 (15:06 +0000)] 
tidy-up: delete unused build configuration macros

Most of them feature guards:

- `CURL_INCLUDES_SYS_UIO` [1]
- `HAVE_ALLOCA_H` [2]
- `HAVE_CRYPTO_CLEANUP_ALL_EX_DATA` (unused since de71e68000c8624ea13f90b136f8734dd0fb1bdc)
- `HAVE_DLFCN_H`
- `HAVE_DLOPEN`
- `HAVE_DOPRNT`
- `HAVE_FCNTL`
- `HAVE_GETHOSTBYNAME` [3]
- `HAVE_GETOPT_H`
- `HAVE_GETPASS`
- `HAVE_GETPROTOBYNAME`
- `HAVE_GETSERVBYNAME`
- `HAVE_IDN_FREE*`
- `HAVE_INET_ADDR`
- `HAVE_IOCTL`
- `HAVE_KRB4`
- `HAVE_KRB_GET_OUR_IP_FOR_REALM`
- `HAVE_KRB_H`
- `HAVE_LDAPSSL_H`
- `HAVE_LDAP_INIT_FD`
- `HAVE_LIBDL`
- `HAVE_LIBNSL`
- `HAVE_LIBRESOLV*`
- `HAVE_LIBUCB`
- `HAVE_LL`
- `HAVE_LOCALTIME_R`
- `HAVE_MALLOC_H`
- `HAVE_MEMCPY`
- `HAVE_MEMORY_H`
- `HAVE_NETINET_IF_ETHER_H`
- `HAVE_NI_WITHSCOPEID`
- `HAVE_OPENSSL_CRYPTO_H`
- `HAVE_OPENSSL_ERR_H`
- `HAVE_OPENSSL_PEM_H`
- `HAVE_OPENSSL_PKCS12_H`
- `HAVE_OPENSSL_RAND_H`
- `HAVE_OPENSSL_RSA_H`
- `HAVE_OPENSSL_SSL_H`
- `HAVE_OPENSSL_X509_H`
- `HAVE_PEM_H`
- `HAVE_POLL`
- `HAVE_RAND_SCREEN`
- `HAVE_RAND_STATUS`
- `HAVE_RECVFROM`
- `HAVE_SETSOCKOPT`
- `HAVE_SETVBUF`
- `HAVE_SIZEOF_LONG_DOUBLE`
- `HAVE_SOCKIO_H`
- `HAVE_SOCK_OPTS`
- `HAVE_STDIO_H`
- `HAVE_STRCASESTR`
- `HAVE_STRFTIME`
- `HAVE_STRLCAT`
- `HAVE_STRNCMPI`
- `HAVE_STRNICMP`
- `HAVE_STRSTR`
- `HAVE_STRUCT_IN6_ADDR`
- `HAVE_TLD_H`
- `HAVE_TLD_STRERROR`
- `HAVE_UNAME`
- `HAVE_USLEEP`
- `HAVE_WINBER_H`
- `HAVE_WRITEV`
- `HAVE_X509_H`
- `LT_OBJDIR`
- `NEED_BASENAME_PROTO`
- `NOT_NEED_LIBNSL`
- `OPENSSL_NO_KRB5`
- `RECVFROM_TYPE*`
- `SIZEOF_LONG_DOUBLE`
- `STRERROR_R_TYPE_ARG3`
- `USE_YASSLEMUL`
- `_USRDLL` (from CMake) [4]

[1] Related parts in `m4/curl-functions.m4` and `configure.ac` might
    also be deleted.

[2] Related comment can possibly be deleted in
    `packages/vms/generate_config_vms_h_curl.com`.

[3] There are more instances of this in autotools, but I did not dare to
    touch those. Looked like it's used to detect socket support.

[4] This is necessary for MFC (Microsoft Foundation Class) DLLs to
    force linking MFC components statically to the DLL. `libcurl.dll`
    does not use MFC, so we can delete this define.
    Ref: https://docs.microsoft.com/cpp/build/regular-dlls-statically-linked-to-mfc

Script that can help finding unused settings like above:
```shell

autoheader configure.ac  # generate lib/curl_config.h.in

{
  grep -o -E    'set\([A-Z][A-Z0-9_]{3,}'          CMake/Platforms/WindowsCache.cmake | sed -E 's|set\(||g'
  grep -o -E -h '#define +[A-Z][A-Z0-9_]{3,}'      lib/config-*.h                     | sed -E 's|#define +||g'
  grep -o -E    '#cmakedefine +[A-Z][A-Z0-9_]{3,}' lib/curl_config.h.cmake            | sed -E 's|#cmakedefine +||g'
  grep -o -E    '#undef +[A-Z][A-Z0-9_]{3,}'       lib/curl_config.h.in               | sed -E 's|#undef +||g'
} | sort -u | grep -v -F 'HEADER_CURL_' | while read -r def; do
  c="$(git grep -w -F "${def}" | grep -v -E -c '(/libcurl\.tmpl|^lib/config-|^lib/curl_config\.h\.cmake|^CMakeLists\.txt|^CMake/Platforms/WindowsCache\.cmake|^packages/vms/config_h\.com|^m4/curl-functions\.m4|^acinclude\.m4|^configure\.ac)')"
  if [ "${c}" = '0' ]; then
    echo "${def}"
  fi
done
```

Reviewed-by: Daniel Stenberg
Closes #9044

3 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 19 Jul 2022 13:03:02 +0000 (15:03 +0200)] 
RELEASE-NOTES: synced

3 years agocookie: treat a blank domain in Set-Cookie: as non-existing
Daniel Stenberg [Mon, 18 Jul 2022 22:05:43 +0000 (00:05 +0200)] 
cookie: treat a blank domain in Set-Cookie: as non-existing

This matches what RFC 6265 section 5.2.3 says.

Extended test 31 to verify.

Fixes #9164
Reported-by: Gwen Shapira
Closes #9177

3 years agobase64: base64url encoding has no padding
Patrick Monnerat [Tue, 12 Jul 2022 17:03:45 +0000 (19:03 +0200)] 
base64: base64url encoding has no padding

See RFC4648 section 5 and RFC7540 section 3.2.1.

Suppress generation of '=' padding of base64url encoding. This is
accomplished by considering the string beginning at offset 64 in the
character table as the padding: this is "=" for base64, "" for base64url.

Also use strchr() to replace character search loops where possible.

Suppress erroneous comments about empty encoding results.

Adjust unit test 1302 to unpadded base64url encoding and add tests for
empty results.

Closes #9139

3 years agoeasyoptions: fix icc warning
Daniel Stenberg [Mon, 18 Jul 2022 21:38:36 +0000 (23:38 +0200)] 
easyoptions: fix icc warning

    easyoptions.c(360): error #188: enumerated type mixed with another type

Ref: #9156
Reported-by: Matthew Thompson
Closes #9176

3 years agoh2h3: fix overriding the 'TE: Trailers' header
lwthiker [Sun, 17 Jul 2022 16:11:33 +0000 (19:11 +0300)] 
h2h3: fix overriding the 'TE: Trailers' header

A 'TE: Trailers' header is explicitly replaced by 'te: trailers'
(lowercase) in Curl_pseudo_headers() when building the list of HTTP/2 or
HTTP/3 headers. However, this is then replaced again by the original
value due to a bug, resulting in the uppercased version being sent. Some
HTTP/2 servers reject the whole HTTP/2 stream when this is the case.

Closes #9170

3 years agolib3026: reduce the number of threads to 100
Daniel Stenberg [Sun, 17 Jul 2022 21:48:22 +0000 (23:48 +0200)] 
lib3026: reduce the number of threads to 100

Down from 1000, to make it run and work in more systems.

Fixes #9172
Reported-by: Érico Nogueira Rolim
Closes #9173

3 years agodoh: move doh related struct definitions to doh.h
Daniel Stenberg [Sun, 17 Jul 2022 21:58:43 +0000 (23:58 +0200)] 
doh: move doh related struct definitions to doh.h

and make 'dnstype' in 'struct dnsprobe' use the DNStype to fix the icc compiler warning:

  doh.c(924): error #188: enumerated type mixed with another type

Reported-by: Matthew Thompson
Ref #9156
Closes #9174

3 years agoMakefile.m32: stop trying to build libcares.a [ci skip]
Viktor Szakats [Sun, 17 Jul 2022 21:45:34 +0000 (21:45 +0000)] 
Makefile.m32: stop trying to build libcares.a [ci skip]

Before this patch, `lib/Makefile.m32` had a rule to build `libcares.a` in
`-cares`-enabled builds, via c-ares's own `Makefile.m32`. Committed in
2007 [1]. The commit message doesn't specifically address this particular
change. This logic comes from the times when c-ares was part of the curl
source tree, hence the special treatment.

This feature creates problems when building c-ares first, using CMake
and pointing `LIBCARES_PATH` to its install prefix, where `Makefile.m32`
is missing in such case. A sub-build for c-ares is undesired also when
c-ares had already been build via its own `Makefile.m32`.

To avoid the sub-build, this patch deletes its Makefile rule. After this
patch `libcares.a` needs to be manually built before using it in
`Makefile.m32`. Aligning it with the rest of dependencies.

[1] 46c92c0b806da041d7a5c6fb64dbcdc474d99b31

Reviewed-by: Daniel Stenberg
Closes #9169

3 years agocurl: writeout: fix repeated header outputs
Daniel Stenberg [Wed, 13 Jul 2022 21:53:05 +0000 (23:53 +0200)] 
curl: writeout: fix repeated header outputs

The function stored a terminating zero into the buffer for convenience,
but when on repeated calls that would cause problems. Starting now, the
passed in buffer is not modified.

Reported-by: highmtworks on github
Fixes #9150
Closes #9152

3 years agocurl_multi_timeout.3: clarify usage
Daniel Stenberg [Thu, 14 Jul 2022 21:37:13 +0000 (23:37 +0200)] 
curl_multi_timeout.3: clarify usage

Fixes #9155
Closes #9157
Reported-by: jvvprasad78 on github
3 years agomprintf: make dprintf_formatf never return negative
Daniel Stenberg [Wed, 13 Jul 2022 21:46:16 +0000 (23:46 +0200)] 
mprintf: make dprintf_formatf never return negative

This function no longer returns a negative value if the formatting
string is bad since the return value would sometimes be propagated as a
return code from the mprintf* functions and they are documented to
return the length of the output. Which cannot be negative.

Fixes #9149
Closes #9151
Reported-by: yiyuaner on github
3 years agotrace: 0x7F character is non-printable
Viktor Szakats [Sun, 17 Jul 2022 10:10:35 +0000 (10:10 +0000)] 
trace: 0x7F character is non-printable

`0x7F` is `DEL`, a non-printable symbol, so print it as
`UNPRINTABLE_CHAR`.

Reported-by: MasterInQuestion on github
Fixes #9162
Closes #9166

3 years agodoh: use https protocol by default
Viktor Szakats [Sat, 16 Jul 2022 14:10:39 +0000 (14:10 +0000)] 
doh: use https protocol by default

The only allowed protocol is https, so it makes sense to use that
by default if not passed explicitly by the user.

Reported-by: MasterInQuestion on github
Reviewed-by: Jay Satiro
Fixes #9163
Closes #9165

3 years agoopenssl: fix BoringSSL symbol conflicts with LDAP and Schannel
Viktor Szakats [Thu, 14 Jul 2022 07:14:22 +0000 (07:14 +0000)] 
openssl: fix BoringSSL symbol conflicts with LDAP and Schannel

Same issue as here [1], but this time when building curl with BoringSSL
for Windows with LDAP(S) or Schannel support enabled.

Apply the same fix [2] for these source files as well.

This can also be fixed by moving `#include "urldata.h"` _before_
including `winldap.h` and `schnlsp.h` respectively. This seems like
a cleaner fix, though I'm not sure why it works and if it has any
downside.

[1] https://github.com/curl/curl/issues/5669
[2] https://github.com/curl/curl/commit/fbe07c6829ba8c5793c84c2856526e19e9029ab9

Co-authored-by: Jay Satiro
Closes #9110

3 years agoasyn-thread: make getaddrinfo_complete return CURLcode
Daniel Stenberg [Tue, 12 Jul 2022 21:06:01 +0000 (23:06 +0200)] 
asyn-thread: make getaddrinfo_complete return CURLcode

... as the only caller that cares about what it returns assumes that
anyway. This caused icc to warn:

asyn-thread.c(505): error #188: enumerated type mixed with another type
        result = getaddrinfo_complete(data);

Repoorted-by: Matthew Thompson
Bug: https://github.com/curl/curl/issues/9081#issuecomment-1182143076
Closes #9146

3 years agoeasy_lock: fix build with icc
Daniel Stenberg [Tue, 12 Jul 2022 13:57:02 +0000 (15:57 +0200)] 
easy_lock: fix build with icc

The Intel compiler tries to look like GCC *and* clang *and* it lies in
its __has_builtin() function (returns true when it should return false),
so override it.

Reported-by: Matthew Thompson
Fixes #9081
Closes #9144

3 years agoconfigure: fix --disable-headers-api
Daniel Stenberg [Tue, 12 Jul 2022 13:53:11 +0000 (15:53 +0200)] 
configure: fix --disable-headers-api

Reported-by: Michał Antoniak
Fixes #9134
Closes #9143

3 years agotest3026: require 'threadsafe'
Daniel Stenberg [Tue, 12 Jul 2022 13:37:21 +0000 (15:37 +0200)] 
test3026: require 'threadsafe'

Reported-by: Sukanya Hanumanthu
Fixes #9141
Closes #9142

3 years agoCMake: link curl to its dependencies with PRIVATE
Even Rouault [Fri, 8 Jul 2022 11:30:57 +0000 (13:30 +0200)] 
CMake: link curl to its dependencies with PRIVATE

The current PUBLIC visibility causes issues for downstream users.
Cf https://github.com/OSGeo/PROJ/pull/3172#issuecomment-1157942986

Reviewed-by: Jakub Zakrzewski
Closes #9125

3 years agoCMake: remove APPEND in export(TARGETS)
Even Rouault [Fri, 8 Jul 2022 11:25:14 +0000 (13:25 +0200)] 
CMake: remove APPEND in export(TARGETS)

When running cmake several times, new content was appended to already
existing generated files, which is not appropriate

Reviewed-by: Jakub Zakrzewski
Closes #9124

3 years agongtcp2: implement cb_h3_stop_sending and cb_h3_reset_stream callbacks
Tatsuhiro Tsujikawa [Sat, 9 Jul 2022 07:25:14 +0000 (16:25 +0900)] 
ngtcp2: implement cb_h3_stop_sending and cb_h3_reset_stream callbacks

Closes #9135

3 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 11 Jul 2022 21:38:02 +0000 (23:38 +0200)] 
RELEASE-NOTES: synced

3 years agobuild: improve OS string in CMake and `config-win32.h`
Viktor Szakats [Mon, 11 Jul 2022 19:41:31 +0000 (19:41 +0000)] 
build: improve OS string in CMake and `config-win32.h`

This patch makes CMake fill the "OS string" with the value of
`CMAKE_C_COMPILER_TARGET`, if passed. This typically contains a triplet,
the same we can pass to `./configure` via `--host=`.

For non-CMake, non-autotools, Windows builds, this patch adds the ability
to override the default `OS` value in `lib/config-win32.h`.

With these its possible to get the same OS string across the three build
systems.

This patch supersedes the earlier, partial, CMake-only solution:
435f395f3f8c11eebfcc243ca55ebcc11a19b8b8, thus retiring the
`CURL_OS_SUFFIX` CMake option.

Reviewed-by: Jay Satiro
Closes #9117

3 years agoMakefile.m32: add `CURL_RC` and `CURL_STRIP` variables [ci skip]
Viktor Szakats [Sun, 10 Jul 2022 22:28:14 +0000 (22:28 +0000)] 
Makefile.m32: add `CURL_RC` and `CURL_STRIP` variables [ci skip]

They allow to override the hardcoded values for the `windres` and `strip`
tools, complementing the existing set of `CURL_{CC,AR,RANLIB}` variables.

`CURL_RC` comes handy when using LLVM tools with `CROSSPREFIX=llvm-` and
`CURL_CC=clang` set on current latest debian:unstable or earlier, where
`llvm-windres` is missing, and a `CURL_RC=<triplet>-windres` fixes it.
Hopefully this will be fixed in the llvm package. FWIW `llvm-windres`
does exist in Homebrew llvm, MSYS2 llvm and llvm-mingw.

Reviewed-by: Daniel Stenberg
Closes #9132

3 years agongtcp2: fix stall or busy loop on STOP_SENDING with upload data
Tatsuhiro Tsujikawa [Fri, 8 Jul 2022 09:48:09 +0000 (18:48 +0900)] 
ngtcp2: fix stall or busy loop on STOP_SENDING with upload data

Fixes #9122
Closes #9123