]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 years agoimap: Provide method to disable SASL if it is advertised 10041/head
Chris Talbot [Mon, 5 Dec 2022 23:05:01 +0000 (18:05 -0500)] 
imap: Provide method to disable SASL if it is advertised

- Implement AUTH=+LOGIN for CURLOPT_LOGIN_OPTIONS to prefer plaintext
  LOGIN over SASL auth.

Prior to this change there was no method to be able to fall back to
LOGIN if an IMAP server advertises SASL capabilities. However, this may
be desirable for e.g. a misconfigured server.

Per: https://www.ietf.org/rfc/rfc5092.html#section-3.2

";AUTH=<enc-auth-type>" looks to be the correct way to specify what
authenication method to use, regardless of SASL or not.

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

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 15 Jun 2023 13:59:06 +0000 (15:59 +0200)] 
RELEASE-NOTES: synced

2 years agoexamples/multi-debugcallback.c: avoid the bool typedef
Daniel Stenberg [Thu, 15 Jun 2023 07:39:09 +0000 (09:39 +0200)] 
examples/multi-debugcallback.c: avoid the bool typedef

Apparently this cannot be done in c23

Reported-by: Cristian Rodríguez
Fixes #11299
Closes #11319

2 years agodocs/libcurl/libcurl.3: cleanups and improvements
Daniel Stenberg [Wed, 14 Jun 2023 13:37:53 +0000 (15:37 +0200)] 
docs/libcurl/libcurl.3: cleanups and improvements

Closes #11317

2 years agolibcurl-ws.3: fix typo
Daniel Stenberg [Wed, 14 Jun 2023 21:38:22 +0000 (23:38 +0200)] 
libcurl-ws.3: fix typo

2 years agocurl_ws_*.3: enhance
Daniel Stenberg [Wed, 14 Jun 2023 13:50:13 +0000 (15:50 +0200)] 
curl_ws_*.3: enhance

- all: SEE ALSO the libcurl-ws man page
- send: add example and return value information
- meta: mention that the returned data is read-only

Closes #11318

2 years agodocs/libcurl/libcurl-ws.3: see also CURLOPT_WS_OPTIONS
Daniel Stenberg [Wed, 14 Jun 2023 11:36:38 +0000 (13:36 +0200)] 
docs/libcurl/libcurl-ws.3: see also CURLOPT_WS_OPTIONS

2 years agodocs/libcurl/libcurl-ws.3: minor polish
Daniel Stenberg [Wed, 14 Jun 2023 11:30:50 +0000 (13:30 +0200)] 
docs/libcurl/libcurl-ws.3: minor polish

2 years agolibcurl-ws.3. WebSocket API overview
Daniel Stenberg [Wed, 14 Jun 2023 08:57:50 +0000 (10:57 +0200)] 
libcurl-ws.3. WebSocket API overview

Closes #11314

2 years agolibcurl-url.3: also mention CURLUPART_ZONEID
Daniel Stenberg [Wed, 14 Jun 2023 08:18:14 +0000 (10:18 +0200)] 
libcurl-url.3: also mention CURLUPART_ZONEID

... and sort the two part-using lists alphabetically

2 years agofopen: fix conversion warning on 32-bit Android
Marcel Raad [Tue, 13 Jun 2023 09:13:59 +0000 (11:13 +0200)] 
fopen: fix conversion warning on 32-bit Android

When building for 32-bit ARM or x86 Android, `st_mode` is defined as
`unsigned int` instead of `mode_t`, resulting in a
-Wimplicit-int-conversion clang warning because `mode_t` is
`unsigned short`. Add a cast to silence the warning.

Ref: https://android.googlesource.com/platform/bionic/+/refs/tags/ndk-r25c/libc/include/sys/stat.h#86
Closes https://github.com/curl/curl/pull/11313

2 years agohttp2: fix variable type
Marcel Raad [Mon, 12 Jun 2023 14:02:00 +0000 (16:02 +0200)] 
http2: fix variable type

`max_recv_speed` is `curl_off_t`, so using `size_t` might result in
-Wconversion GCC warnings for 32-bit `size_t`. Visible in the NetBSD
ARM autobuilds.

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

2 years agovtls: fix potentially uninitialized local variable warnings
Daniel Stenberg [Mon, 12 Jun 2023 21:17:33 +0000 (23:17 +0200)] 
vtls: fix potentially uninitialized local variable warnings

Follow-up from a4a5e438ae533c

Closes #11310

2 years agotimeval: use CLOCK_MONOTONIC_RAW if available
Daniel Stenberg [Fri, 9 Jun 2023 18:42:51 +0000 (20:42 +0200)] 
timeval: use CLOCK_MONOTONIC_RAW if available

Reported-by: Harry Sintonen
Ref: #11288
Closes #11291

2 years agotool: add curl command line option `--trace-ids`
Stefan Eissing [Sun, 11 Jun 2023 09:02:29 +0000 (11:02 +0200)] 
tool: add curl command line option `--trace-ids`

- added and documented --trace-ids to prepend (after the timestamp)
  the transfer and connection identifiers to each verbose log line
- format is [n-m] with `n` being the transfer id and `m` being the
  connection id. In case there is not valid connection id, print 'x'.
- Log calls with a handle that has no transfer id yet, are written
  without any ids.

Closes #11185

2 years agolib: add CURLINFO_CONN_ID and CURLINFO_XFER_ID
Stefan Eissing [Tue, 23 May 2023 10:48:58 +0000 (12:48 +0200)] 
lib: add CURLINFO_CONN_ID and CURLINFO_XFER_ID

- add an `id` long to Curl_easy, -1 on init
- once added to a multi (or its own multi), it gets
  a non-negative number assigned by the connection cache
- `id` is unique among all transfers using the same
  cache until reaching LONG_MAX where it will wrap
  around. So, not unique eternally.
- CURLINFO_CONN_ID returns the connection id attached to
  data or, if none present, data->state.lastconnect_id
- variables and type declared in tool for write out

Closes #11185

2 years agoCURLOPT_INFILESIZE.3: mention -1 triggers chunked
Daniel Stenberg [Mon, 12 Jun 2023 07:25:48 +0000 (09:25 +0200)] 
CURLOPT_INFILESIZE.3: mention -1 triggers chunked

Ref: #11300
Closes #11304

2 years agoCI: openssl-3.0.9+quic
Philip H [Sun, 16 Apr 2023 19:44:09 +0000 (21:44 +0200)] 
CI: openssl-3.0.9+quic

Closes #11296

2 years agoHTTP3.md: update openssl version
Karthikdasari0423 [Sun, 11 Jun 2023 06:21:55 +0000 (11:51 +0530)] 
HTTP3.md: update openssl version

Closes #11297

2 years agovtls: avoid memory leak if sha256 call fails
Daniel Stenberg [Mon, 12 Jun 2023 12:10:37 +0000 (14:10 +0200)] 
vtls: avoid memory leak if sha256 call fails

... in the pinned public key handling function.

Reported-by: lizhuang0630 on github
Fixes #11306
Closes #11307

2 years agoexamples/ipv6: disable on win32
Daniel Stenberg [Mon, 12 Jun 2023 07:46:22 +0000 (09:46 +0200)] 
examples/ipv6: disable on win32

I can't make if_nametoindex() work there

Follow-up to c23dc42f3997acf23

Closes #11305

2 years agotool_operate: allow cookie lines up to 8200 bytes
Daniel Stenberg [Mon, 12 Jun 2023 07:01:30 +0000 (09:01 +0200)] 
tool_operate: allow cookie lines up to 8200 bytes

Since this option might set multiple cookies in the same line, it does
not make total sense to cap this at 4096 bytes, which is the limit for a
single cookie name or value.

Closes #11303

2 years agotest427: verify sending more cookies than fit in a 8190 bytes line
Daniel Stenberg [Mon, 12 Jun 2023 07:00:21 +0000 (09:00 +0200)] 
test427: verify sending more cookies than fit in a 8190 bytes line

curl will then only populate the header with cookies that fit, dropping
ones that otherwise would have been sent

Ref: https://curl.se/mail/lib-2023-06/0020.html

Closes #11303

2 years agotestutil: allow multiple %-operators on the same line
Daniel Stenberg [Mon, 12 Jun 2023 06:59:11 +0000 (08:59 +0200)] 
testutil: allow multiple %-operators on the same line

Closes #11303

2 years agodocs: update CURLOPT_UPLOAD.3
Oleg Jukovec [Sun, 11 Jun 2023 20:25:44 +0000 (23:25 +0300)] 
docs: update CURLOPT_UPLOAD.3

The behavior of CURLOPT_UPLOAD differs from what is described in the
documentation. The option automatically adds the 'Transfer-Encoding:
chunked' header if the upload size is unknown.

Closes #11300

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 12 Jun 2023 07:16:55 +0000 (09:16 +0200)] 
RELEASE-NOTES: synced

2 years agoCURLOPT_AWS_SIGV4.3: remove unused variable from example
Daniel Stenberg [Mon, 12 Jun 2023 06:19:58 +0000 (08:19 +0200)] 
CURLOPT_AWS_SIGV4.3: remove unused variable from example

Closes #11302

2 years agoexamples/https.c: use CURLOPT_CA_CACHE_TIMEOUT
Daniel Stenberg [Fri, 9 Jun 2023 17:37:31 +0000 (19:37 +0200)] 
examples/https.c: use CURLOPT_CA_CACHE_TIMEOUT

for demonstration purposes

Closes #11290

2 years agoexample/ipv6: feature CURLOPT_ADDRESS_SCOPE in use
Daniel Stenberg [Fri, 9 Jun 2023 08:00:12 +0000 (10:00 +0200)] 
example/ipv6: feature CURLOPT_ADDRESS_SCOPE in use

Closes #11282

2 years agodocs: Update HTTP3.md for newer ngtcp2 and nghttp3
Karthikdasari0423 [Sat, 10 Jun 2023 16:52:37 +0000 (22:22 +0530)] 
docs: Update HTTP3.md for newer ngtcp2 and nghttp3

Follow-up to fb9b9b58

Ref: #11184
Closes #11295

2 years agodocs: update the supported ngtcp2 and nghttp3 versions
Dan Fandrich [Sat, 10 Jun 2023 15:06:08 +0000 (08:06 -0700)] 
docs: update the supported ngtcp2 and nghttp3 versions

Follow-up to cae9d10b

Ref: #11184
Closes #11294

2 years agotests: fix error messages & handling around sockets
Dan Fandrich [Wed, 7 Jun 2023 16:56:49 +0000 (09:56 -0700)] 
tests: fix error messages & handling around sockets

The wrong error code was checked on Windows on UNIX socket failures,
which could have caused all UNIX sockets to be reported as having
errored and the tests therefore skipped. Also, a useless error message
was displayed on socket errors in many test servers on Windows because
strerror() doesn't work on WinSock error codes; perror() is overridden
there to work on all errors and is used instead.

Ref #11258
Closes #11265

2 years agoCURLOPT_SSH_PRIVATE_KEYFILE.3: expand on the file search
Daniel Stenberg [Fri, 9 Jun 2023 17:10:30 +0000 (19:10 +0200)] 
CURLOPT_SSH_PRIVATE_KEYFILE.3: expand on the file search

Reported-by: atjg on github
Ref: #11287
Closes #11289

2 years agongtcp2: use ever increasing timestamp in io
Stefan Eissing [Fri, 9 Jun 2023 14:32:14 +0000 (16:32 +0200)] 
ngtcp2: use ever increasing timestamp in io

- ngtcp2 v0.16.0 asserts that timestamps passed to its function
  will only ever increase.
- Use a context shared between ingress/egress operations that
  uses a shared timestamp, regularly updated during calls.

Closes #11288

2 years agoGHA: use nghttp2 1.54.0 for the ngtcp2 jobs
Daniel Stenberg [Wed, 7 Jun 2023 11:59:50 +0000 (13:59 +0200)] 
GHA: use nghttp2 1.54.0 for the ngtcp2 jobs

2 years agoGHA: ngtcp2: use 0.16.0 and nghttp3 0.12.0
Philip H [Sun, 4 Jun 2023 11:47:23 +0000 (13:47 +0200)] 
GHA: ngtcp2: use 0.16.0 and nghttp3 0.12.0

2 years agongtcp2: build with 0.16.0 and nghttp3 0.12.0
Daniel Stenberg [Sun, 4 Jun 2023 21:14:41 +0000 (23:14 +0200)] 
ngtcp2: build with 0.16.0 and nghttp3 0.12.0

- moved to qlog_write
- crypto => encryption
- CRYPTO => ENCRYPTION
- removed "_is_"
- ngtcp2_conn_shutdown_stream_read and
  ngtcp2_conn_shutdown_stream_write got flag arguments
- the nghttp3_callbacks struct got a recv_settings callback

Closes #11184

2 years agoexample/http2-download: set CURLOPT_BUFFERSIZE
Daniel Stenberg [Fri, 9 Jun 2023 08:07:10 +0000 (10:07 +0200)] 
example/http2-download: set CURLOPT_BUFFERSIZE

Primarily because no other example sets it, and remove the disabling of
the certificate check because we should not recommend that.

Closes #11284

2 years agoexample/crawler: also set CURLOPT_AUTOREFERER
Daniel Stenberg [Fri, 9 Jun 2023 08:03:28 +0000 (10:03 +0200)] 
example/crawler: also set CURLOPT_AUTOREFERER

Could make sense, and it was not used in any example before.

Closes #11283

2 years agotls13-ciphers.d: include Schannel
Wyatt OʼDay [Thu, 8 Jun 2023 10:13:17 +0000 (03:13 -0700)] 
tls13-ciphers.d: include Schannel

Closes #11271

2 years agocurl_pushheader_byname/bynum.3: document in their own man pages
Daniel Stenberg [Fri, 9 Jun 2023 10:38:25 +0000 (12:38 +0200)] 
curl_pushheader_byname/bynum.3: document in their own man pages

These two functions were added in 7.44.0 when CURLMOPT_PUSHFUNCTION was
introduced but always lived a life in the shadows, embedded in the
CURLMOPT_PUSHFUNCTION man page. Until now.

It makes better sense and gives more visibility to document them in
their own stand-alone man pages.

Closes #11286

2 years agocurl_mprintf.3: minor fix of the example
Daniel Stenberg [Fri, 9 Jun 2023 09:29:41 +0000 (11:29 +0200)] 
curl_mprintf.3: minor fix of the example

2 years agocurl_url_set: enforce the max string length check for all parts
Daniel Stenberg [Thu, 8 Jun 2023 11:40:52 +0000 (13:40 +0200)] 
curl_url_set: enforce the max string length check for all parts

Update the docs and test 1559 accordingly

Closes #11273

2 years agoexamples/ftpuploadresume.c: add use of CURLOPT_ACCEPTTIMEOUT_MS
Daniel Stenberg [Thu, 8 Jun 2023 14:30:31 +0000 (16:30 +0200)] 
examples/ftpuploadresume.c: add use of CURLOPT_ACCEPTTIMEOUT_MS

For show

Closes #11277

2 years agoexamples/unixsocket.c: example using CURLOPT_UNIX_SOCKET_PATH
Daniel Stenberg [Thu, 8 Jun 2023 14:25:14 +0000 (16:25 +0200)] 
examples/unixsocket.c: example using CURLOPT_UNIX_SOCKET_PATH

and alternatively CURLOPT_ABSTRACT_UNIX_SOCKET

Closes #11276

2 years agodocs: fix missing parameter names in examples
Anssi Kolehmainen [Thu, 8 Jun 2023 15:57:19 +0000 (18:57 +0300)] 
docs: fix missing parameter names in examples

Closes #11278

2 years agourlapi: have *set(PATH) prepend a slash if one is missing
Daniel Stenberg [Thu, 8 Jun 2023 11:15:09 +0000 (13:15 +0200)] 
urlapi: have *set(PATH) prepend a slash if one is missing

Previously the code would just do that for the path when extracting the
full URL, which made a subsequent curl_url_get() of the path to
(unexpectedly) still return it without the leading path.

Amend lib1560 to verify this. Clarify the curl_url_set() docs about it.

Bug: https://curl.se/mail/lib-2023-06/0015.html
Closes #11272
Reported-by: Pedro Henrique
2 years agoruntests; give each server a unique log lock file
Dan Fandrich [Mon, 5 Jun 2023 21:50:15 +0000 (14:50 -0700)] 
runtests; give each server a unique log lock file

Logs are written by several servers and all of them must be finished
writing before the test results can be determined. This means each
server must have its own lock file rather than sharing a single one,
which is how it was done up to now. Previously, the first server to
complete a test would clear the lock before the other server was done,
which caused flaky tests.

Lock files are now all found in their own directory, so counting locks
equals counting the files in that directory.  The result is that the
proxy logs are now reliably written which actually changes the expected
output for two tests.

Fixes #11231
Closes #11259

2 years agoruntests: make test file directories in log/N 11267/head
Dan Fandrich [Wed, 7 Jun 2023 22:06:11 +0000 (15:06 -0700)] 
runtests: make test file directories in log/N

Test files in subdirectories were not created after parallel test log
directories were moved down a level due to a now-bad comparison.

Follow-up to 92d7dd39

Ref #11264
Closes #11267

2 years agows: make the curl_ws_meta() return pointer a const
Daniel Stenberg [Wed, 7 Jun 2023 08:17:48 +0000 (10:17 +0200)] 
ws: make the curl_ws_meta() return pointer a const

The returned info is read-only for the user.

Closes #11261

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 7 Jun 2023 21:35:51 +0000 (23:35 +0200)] 
RELEASE-NOTES: synced

2 years agoruntests: move parallel log dirs from logN to log/N
Daniel Stenberg [Wed, 7 Jun 2023 12:47:25 +0000 (14:47 +0200)] 
runtests: move parallel log dirs from logN to log/N

Having several hundreds of them in there gets annoying.

Closes #11264

2 years agotest447: move the test file into %LOGDIR
Dan Fandrich [Wed, 7 Jun 2023 20:53:08 +0000 (13:53 -0700)] 
test447: move the test file into %LOGDIR

2 years agocmake: add support for "unity" builds
Viktor Szakats [Tue, 9 May 2023 10:10:40 +0000 (10:10 +0000)] 
cmake: add support for "unity" builds

Aka "jumbo" or "amalgamation" builds. It means to compile all sources
per target as a single C source. This is experimental.

You can enable it by passing `-DCMAKE_UNITY_BUILD=ON` to cmake.
It requires CMake 3.16 or newer.

It makes builds (much) faster, allows for better optimizations and tends
to promote less ambiguous code.

Also add a new AppVeyor CI job and convert an existing one to use
"unity" mode (one MSVC, one MinGW), and enable it for one macOS CI job.

Fix related issues:
- add missing include guard to `easy_lock.h`.
- rename static variables and functions (and a macro) with names reused
  across sources, or shadowed by local variables.
- add an `#undef` after use.
- add a missing `#undef` before use.
- move internal definitions from `ftp.h` to `ftp.c`.
- `curl_memory.h` fixes to make it work when included repeatedly.
- stop building/linking curlx bits twice for a static-mode curl tool.
  These caused doubly defined symbols in unity builds.
- silence missing extern declarations compiler warning for ` _CRT_glob`.
- fix extern declarations for `tool_freq` and `tool_isVistaOrGreater`.
- fix colliding static symbols in debug mode: `debugtime()` and
  `statename`.
- rename `ssl_backend_data` structure to unique names for each
  TLS-backend, along with the `ssl_connect_data` struct member
  referencing them. This required adding casts for each access.
- add workaround for missing `[P]UNICODE_STRING` types in certain Windows
  builds when compiling `lib/ldap.c`. To support "unity" builds, we had
  to enable `SCHANNEL_USE_BLACKLISTS` for Schannel (a Windows
  `schannel.h` option) _globally_. This caused an indirect inclusion of
  Windows `schannel.h` from `ldap.c` via `winldap.h` to have it enabled
  as well. This requires `[P]UNICODE_STRING` types, which is apperantly
  not defined automatically (as seen with both MSVS and mingw-w64).
  This patch includes `<subauth.h>` to fix it.
  Ref: https://github.com/curl/curl/runs/13987772013
  Ref: https://dev.azure.com/daniel0244/curl/_build/results?buildId=15827&view=logs&jobId=2c9f582d-e278-56b6-4354-f38a4d851906&j=2c9f582d-e278-56b6-4354-f38a4d851906&t=90509b00-34fa-5a81-35d7-5ed9569d331c
- tweak unity builds to compile `lib/memdebug.c` separately in memory
  trace builds to avoid PP confusion.
- force-disable unity for test programs.
- do not compile and link libcurl sources to libtests _twice_ when libcurl
  is built in static mode.

KNOWN ISSUES:
- running tests with unity builds may fail in cases.
- some build configurations/env may not compile in unity mode. E.g.:
  https://ci.appveyor.com/project/curlorg/curl/builds/47230972/job/51wfesgnfuauwl8q#L250

Ref: https://github.com/libssh2/libssh2/issues/1034
Ref: https://cmake.org/cmake/help/latest/prop_tgt/UNITY_BUILD.html
Ref: https://en.wikipedia.org/wiki/Unity_build

Closes #11095

2 years agoexamples/websocket.c: websocket example using CONNECT_ONLY
Daniel Stenberg [Wed, 7 Jun 2023 09:03:32 +0000 (11:03 +0200)] 
examples/websocket.c: websocket example using CONNECT_ONLY

Closes #11262

2 years agowebsocket-cb: example doing WebSocket download using callback
Daniel Stenberg [Wed, 7 Jun 2023 08:00:14 +0000 (10:00 +0200)] 
websocket-cb: example doing WebSocket download using callback

Very basic

Closes #11260

2 years agotest/.gitignore: ignore log*
Daniel Stenberg [Wed, 7 Jun 2023 12:42:20 +0000 (14:42 +0200)] 
test/.gitignore: ignore log*

2 years agoruntests: document the -j parallel testing option 11255/head
Dan Fandrich [Mon, 5 Jun 2023 20:31:03 +0000 (13:31 -0700)] 
runtests: document the -j parallel testing option

Reported-by: Daniel Stenberg
Ref: #10818
Closes #11255

2 years agoruntests: create multiple test runners when requested
Dan Fandrich [Fri, 19 May 2023 02:35:54 +0000 (19:35 -0700)] 
runtests: create multiple test runners when requested

Parallel testing is enabled by using a nonzero value for the -j option
to runtests.pl. Performant values seem to be about 7*num CPU cores, or
1.3*num CPU cores if Valgrind is in use.

Flaky tests due to improper log locking (bug #11231) are exacerbated
while parallel testing, so it is not enabled by default yet.

Fixes #10818
Closes #11246

2 years agoruntests: handle repeating tests in multiprocess mode
Dan Fandrich [Tue, 23 May 2023 04:47:46 +0000 (21:47 -0700)] 
runtests: handle repeating tests in multiprocess mode

Such as what happens with the --repeat option.  Some functions are
changed to pass the runner ID instead of relying on the non-unique test
number.

Ref: #10818

2 years agoruntests: buffer logmsg while running singletest()
Dan Fandrich [Fri, 19 May 2023 23:43:01 +0000 (16:43 -0700)] 
runtests: buffer logmsg while running singletest()

This allows all messages relating to a single test case to be displayed
together at the end of the test.

Ref: #10818

2 years agoruntests: call initserverconfig() in the runner
Dan Fandrich [Fri, 19 May 2023 04:45:59 +0000 (21:45 -0700)] 
runtests: call initserverconfig() in the runner

This must be done so variables pick up the runner's unique $LOGDIR.

Ref: #10818

2 years agoruntests: use a per-runner random seed
Dan Fandrich [Fri, 19 May 2023 04:40:05 +0000 (21:40 -0700)] 
runtests: use a per-runner random seed

Each runner needs a unique random seed to reduce the chance of port
number collisions. The new scheme uses a consistent per-runner source of
randomness which results in deterministic behaviour, as it did before.

Ref: #10818

2 years agoruntests: complete main test loop refactor for multiple runners
Dan Fandrich [Thu, 18 May 2023 18:20:15 +0000 (11:20 -0700)] 
runtests: complete main test loop refactor for multiple runners

The main test loop is now able to handle multiple runners, or no
additional runner processes at all. At most one process is still
created, however.

Ref: #10818

2 years agoruntests: prepare main test loop for multiple runners
Dan Fandrich [Tue, 16 May 2023 21:25:32 +0000 (14:25 -0700)] 
runtests: prepare main test loop for multiple runners

Some variables are expanded to arrays and hashes so that multiple
runners can be used for running tests.

Ref: #10818

2 years agobufq: make write/pass methods more robust
Stefan Eissing [Sun, 4 Jun 2023 10:43:14 +0000 (12:43 +0200)] 
bufq: make write/pass methods more robust

- related to #11242 where curl enters busy loop when
  sending http2 data to the server

Closes #11247

2 years agotool_getparam: fix comment
Boris Verkhovskiy [Mon, 5 Jun 2023 16:48:37 +0000 (17:48 +0100)] 
tool_getparam: fix comment

Closes #11253

2 years agohaproxy: add --haproxy-clientip flag to spoof client IPs
Raito Bezarius [Thu, 16 Mar 2023 13:20:11 +0000 (14:20 +0100)] 
haproxy: add --haproxy-clientip flag to spoof client IPs

CURLOPT_HAPROXY_CLIENT_IP in the library

Closes #10779

2 years agocurl: add --ca-native and --proxy-ca-native
Daniel Stenberg [Sat, 3 Jun 2023 21:48:37 +0000 (23:48 +0200)] 
curl: add --ca-native and --proxy-ca-native

These are two boolean options to ask curl to use the native OS's CA
store when verifying TLS servers. For peers and for proxies
respectively.

They currently only have an effect for curl on Windows when built to use
OpenSSL for TLS.

Closes #11049

2 years agobuild: drop unused/redundant `HAVE_WINLDAP_H`
Viktor Szakats [Fri, 19 May 2023 14:24:25 +0000 (14:24 +0000)] 
build: drop unused/redundant `HAVE_WINLDAP_H`

Sources did not use it. Autotools used it when checking for the
`winldap` library, which is redundant.

With CMake, detection was broken:
```
Run Build Command(s):/usr/local/Cellar/cmake/3.26.3/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_2d8fe/fast && /Library/Developer/CommandLineTools/usr/bin/make  -f CMakeFiles/cmTC_2d8fe.dir/build.make CMakeFiles/cmTC_2d8fe.dir/build
Building C object CMakeFiles/cmTC_2d8fe.dir/HAVE_WINLDAP_H.c.obj
/usr/local/opt/llvm/bin/clang --target=x86_64-w64-mingw32 --sysroot=/usr/local/opt/mingw-w64/toolchain-x86_64 -D_WINSOCKAPI_="" -I/my/quictls/x64-ucrt/usr/include -I/my/zlib/x64-ucrt/usr/include -I/my/brotli/x64-ucrt/usr/include -Wno-unused-command-line-argument   -D_UCRT -DCURL_HIDDEN_SYMBOLS -DHAVE_SSL_SET0_WBIO -DHAS_ALPN -DNGHTTP2_STATICLIB -DNGHTTP3_STATICLIB -DNGTCP2_STATICLIB -DUSE_MANUAL=1  -fuse-ld=lld -Wl,-s -static-libgcc  -lucrt  -Wextra -Wall -pedantic -Wbad-function-cast -Wconversion -Winline -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-long-long -Wno-multichar -Wpointer-arith -Wshadow -Wsign-compare -Wundef -Wunused -Wwrite-strings -Wcast-align -Wdeclaration-after-statement -Wempty-body -Wendif-labels -Wfloat-equal -Wignored-qualifiers -Wno-format-nonliteral -Wno-sign-conversion -Wno-system-headers -Wstrict-prototypes -Wtype-limits -Wvla -Wshift-sign-overflow -Wshorten-64-to-32 -Wdouble-promotion -Wenum-conversion -Wunused-const-variable -Wcomma -Wmissing-variable-declarations -Wassign-enum -Wextra-semi-stmt  -MD -MT CMakeFiles/cmTC_2d8fe.dir/HAVE_WINLDAP_H.c.obj -MF CMakeFiles/cmTC_2d8fe.dir/HAVE_WINLDAP_H.c.obj.d -o CMakeFiles/cmTC_2d8fe.dir/HAVE_WINLDAP_H.c.obj -c /my/curl/bld-cmake-llvm-x64-shared/CMakeFiles/CMakeScratch/TryCompile-3JP6dR/HAVE_WINLDAP_H.c
In file included from /my/curl/bld-cmake-llvm-x64-shared/CMakeFiles/CMakeScratch/TryCompile-3JP6dR/HAVE_WINLDAP_H.c:2:
In file included from /usr/local/opt/mingw-w64/toolchain-x86_64/x86_64-w64-mingw32/include/winldap.h:17:
In file included from /usr/local/opt/mingw-w64/toolchain-x86_64/x86_64-w64-mingw32/include/schnlsp.h:9:
In file included from /usr/local/opt/mingw-w64/toolchain-x86_64/x86_64-w64-mingw32/include/schannel.h:10:
/usr/local/opt/mingw-w64/toolchain-x86_64/x86_64-w64-mingw32/include/wincrypt.h:5041:254: error: unknown type name 'PSYSTEMTIME'
  WINIMPM PCCERT_CONTEXT WINAPI CertCreateSelfSignCertificate (HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProvOrNCryptKey, PCERT_NAME_BLOB pSubjectIssuerBlob, DWORD dwFlags, PCRYPT_KEY_PROV_INFO pKeyProvInfo, PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm, PSYSTEMTIME pStartTime, PSYSTEMTIME pEndTime, PCERT_EXTENSIONS pExtensions);
                                                                                                                                                                                                                                                             ^
/usr/local/opt/mingw-w64/toolchain-x86_64/x86_64-w64-mingw32/include/wincrypt.h:5041:278: error: unknown type name 'PSYSTEMTIME'
  WINIMPM PCCERT_CONTEXT WINAPI CertCreateSelfSignCertificate (HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProvOrNCryptKey, PCERT_NAME_BLOB pSubjectIssuerBlob, DWORD dwFlags, PCRYPT_KEY_PROV_INFO pKeyProvInfo, PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm, PSYSTEMTIME pStartTime, PSYSTEMTIME pEndTime, PCERT_EXTENSIONS pExtensions);
                                                                                                                                                                                                                                                                                     ^
2 errors generated.
make[1]: *** [CMakeFiles/cmTC_2d8fe.dir/HAVE_WINLDAP_H.c.obj] Error 1
make: *** [cmTC_2d8fe/fast] Error 2
exitCode: 2
```

Cherry-picked from #11095 88e4a21ff70ccef391cf99c8165281ff81374503
Reviewed-by: Daniel Stenberg
Closes #11245

2 years agourlapi: scheme starts with alpha
Daniel Stenberg [Mon, 5 Jun 2023 06:28:27 +0000 (08:28 +0200)] 
urlapi: scheme starts with alpha

Add multiple tests to lib1560 to verify

Fixes #11249
Reported-by: ad0p on github
Closes #11250

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 3 Jun 2023 21:52:39 +0000 (23:52 +0200)] 
RELEASE-NOTES: synced

2 years agoCURLOPT_MAIL_RCPT_ALLOWFAILS: replace CURLOPT_MAIL_RCPT_ALLLOWFAILS
Daniel Stenberg [Mon, 29 May 2023 13:25:26 +0000 (15:25 +0200)] 
CURLOPT_MAIL_RCPT_ALLOWFAILS: replace CURLOPT_MAIL_RCPT_ALLLOWFAILS

Deprecate the name using three Ls and prefer the name with two.

Replaces #10047
Closes #11218

2 years agotests/servers: generate temp names in /tmp for unix domain sockets
Daniel Stenberg [Sat, 20 May 2023 15:56:37 +0000 (17:56 +0200)] 
tests/servers: generate temp names in /tmp for unix domain sockets

... instead of putting them in the regular pid directories because
systems generally have strict length requirements for the path name to
be shorter than 107 bytes and we easily hit that boundary otherwise.

The new concept generates two random names: one for the socks daemon and
one for http.

Reported-by: Andy Fiddaman
Fixes #11152
Closes #11166

2 years agohttp2: better support for --limit-rate
Stefan Eissing [Mon, 15 May 2023 14:45:27 +0000 (16:45 +0200)] 
http2: better support for --limit-rate

- leave transfer loop when --limit-rate is in effect and has
  been received
- adjust stream window size to --limit-rate plus some slack
  to make the server observe the pacing we want
- add test case to confirm behaviour

Closes #11115

2 years agocurl_log: evaluate log statement only when transfer is verbose
Stefan Eissing [Fri, 2 Jun 2023 13:57:46 +0000 (15:57 +0200)] 
curl_log: evaluate log statement only when transfer is verbose

Closes #11238

2 years agolibssh2: provide error message when setting host key type fails
Daniel Stenberg [Fri, 2 Jun 2023 16:08:23 +0000 (18:08 +0200)] 
libssh2: provide error message when setting host key type fails

Ref: https://curl.se/mail/archive-2023-06/0001.html

Closes #11240

2 years agosystem.h: remove __IBMC__/__IBMCPP__ guards and apply to all z/OS compiles
Igor Todorovski [Fri, 2 Jun 2023 17:26:22 +0000 (13:26 -0400)] 
system.h: remove __IBMC__/__IBMCPP__ guards and apply to all z/OS compiles

Closes #11241

2 years agodocs/SECURITY-PROCESS.md: link to example of previous critical flaw
Daniel Stenberg [Fri, 2 Jun 2023 16:05:22 +0000 (18:05 +0200)] 
docs/SECURITY-PROCESS.md: link to example of previous critical flaw

2 years agoREADME.md: updated link to opencollective
Mark Seuffert [Wed, 31 May 2023 20:20:18 +0000 (20:20 +0000)] 
README.md: updated link to opencollective

Closes #11232

2 years agolibssh2: use custom memory functions
Daniel Stenberg [Thu, 1 Jun 2023 09:25:38 +0000 (11:25 +0200)] 
libssh2: use custom memory functions

Because of how libssh2_userauth_keyboard_interactive_ex() works: the
libcurl callback allocates memory that is later free()d by libssh2, we
must set the custom memory functions.

Reverts 8b5f100db388ee60118c08aa28

Ref: https://github.com/libssh2/libssh2/issues/1078
Closes #11235

2 years agotest447: test PUTting a file that grows
Daniel Stenberg [Tue, 30 May 2023 12:45:47 +0000 (14:45 +0200)] 
test447: test PUTting a file that grows

... and have curl trim the end when it reaches the expected total amount
of bytes instead of over-sending.

Reported-by: JustAnotherArchivist on github
Closes #11223

2 years agocurl: count uploaded data to stop at the originally given size
Daniel Stenberg [Tue, 30 May 2023 11:59:17 +0000 (13:59 +0200)] 
curl: count uploaded data to stop at the originally given size

Closes #11223
Fixes #11222
Reported-by: JustAnotherArchivist on github
2 years agotool: remove exclamation marks from error/warning messages
Daniel Stenberg [Wed, 31 May 2023 11:47:01 +0000 (13:47 +0200)] 
tool: remove exclamation marks from error/warning messages

2 years agotool: use errorf() for error output
Daniel Stenberg [Wed, 31 May 2023 07:34:02 +0000 (09:34 +0200)] 
tool: use errorf() for error output

Convert a number of fprintf() calls.

2 years agotool: remove newlines from all helpf/notef/warnf/errorf calls
Daniel Stenberg [Tue, 30 May 2023 12:44:56 +0000 (14:44 +0200)] 
tool: remove newlines from all helpf/notef/warnf/errorf calls

Make voutf() always add one.

Closes #11226

2 years agotests/servers.pm: pick unused port number with a server socket
Daniel Stenberg [Mon, 29 May 2023 18:25:09 +0000 (20:25 +0200)] 
tests/servers.pm: pick unused port number with a server socket

This change replaces the previous method of picking a port number at
random to try to start servers on, then retrying up to ten times with
new random numbers each time, with a function that creates a server
socket on port zero, thereby getting a suitable random port set by the
kernel. That server socket is then closed and that port number is used
to setup the actual test server on.

There is a risk that *another* server can be started on the machine in
the time gap, but the server verification feature will detect that.

Closes #11220

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 31 May 2023 06:59:48 +0000 (08:59 +0200)] 
RELEASE-NOTES: synced

bump to 8.2.0

2 years agoconfigure: fix run-compiler for old /bin/sh
Alejandro R. Sedeño [Tue, 30 May 2023 21:56:58 +0000 (17:56 -0400)] 
configure: fix run-compiler for old /bin/sh

If you try to assign and export on the same line on some older /bin/sh
implementations, it complains:

```
$ export "NAME=value"
NAME=value: is not an identifier
```

This commit rewrites run-compiler's assignments and exports to work with
old /bin/sh, splitting assignment and export into two separate
statements, and only quote the value. So now we have:

```
NAME="value"
export NAME
```

While we're here, make the same change to the two supporting
assign+export lines preceeding the script to be consistent with how
exports work throughout the rest of configure.ac.

Closes #11228

2 years agocircleci: install impacket & wolfssl 5.6.0
Philip H [Sun, 16 Apr 2023 19:42:38 +0000 (21:42 +0200)] 
circleci: install impacket & wolfssl 5.6.0

Closes #11221

2 years agotool_urlglob: use curl_off_t instead of longs
Daniel Stenberg [Tue, 30 May 2023 12:06:15 +0000 (14:06 +0200)] 
tool_urlglob: use curl_off_t instead of longs

To handle more globs better (especially on Windows)

Closes #11224

2 years agoscripts: Fix GHA matrix job detection in cijobs.pl
Dan Fandrich [Mon, 1 May 2023 18:57:54 +0000 (11:57 -0700)] 
scripts: Fix GHA matrix job detection in cijobs.pl

The parsing is pretty brittle and it broke detecting some jobs at some
point. Also, detect if Windows is used in GHA.

2 years agoruntests: abort test run after failure without -a 11227/head
Dan Fandrich [Tue, 30 May 2023 20:42:46 +0000 (13:42 -0700)] 
runtests: abort test run after failure without -a

This was broken in a recent refactor and test runs would not stop.

Follow-up to d4a1b5b6

Reported-by: Daniel Stenberg
Fixes #11225
Closes #11227

2 years agoRELEASE-NOTES: synced curl-8_1_2
Daniel Stenberg [Tue, 30 May 2023 06:11:47 +0000 (08:11 +0200)] 
RELEASE-NOTES: synced

8.1.2 release

2 years agoTHANKS: contributors from 8.1.2
Daniel Stenberg [Tue, 30 May 2023 06:13:06 +0000 (08:13 +0200)] 
THANKS: contributors from 8.1.2

2 years agolib1560: verify more scheme guessing
Daniel Stenberg [Mon, 29 May 2023 15:27:22 +0000 (17:27 +0200)] 
lib1560: verify more scheme guessing

- on 2nd level domains
- on names without dots

As mentioned in #11161, "imap.com" will be guessed IMAP

Closes #11219

2 years agopage-header: minor wording polish in the URL segment
Daniel Stenberg [Mon, 29 May 2023 09:44:55 +0000 (11:44 +0200)] 
page-header: minor wording polish in the URL segment

Closes #11217

2 years agopage-header: mention curl version and how to figure out current release
Daniel Stenberg [Mon, 29 May 2023 09:24:57 +0000 (11:24 +0200)] 
page-header: mention curl version and how to figure out current release

Closes #11216

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 28 May 2023 08:29:15 +0000 (10:29 +0200)] 
RELEASE-NOTES: synced

2 years agoconfigure: without pkg-config and no custom path, use -lnghttp2
Daniel Stenberg [Fri, 26 May 2023 08:03:51 +0000 (10:03 +0200)] 
configure: without pkg-config and no custom path, use -lnghttp2

Reported-by: correctmost on github
Fixes #11186
Closes #11210