Граф коммитов

12667 Коммитов

Автор SHA1 Сообщение Дата
Daniel Stenberg 660cf3d4ed
lib: the number four in a sequence is the "fourth"
Spelling is hard

Closes #9535
2022-09-19 08:48:49 +02:00
John Bampton a46e412464
misc: fix spelling in two source files
Closes #9529
2022-09-19 08:47:55 +02:00
Viktor Szakats 6de7322c03
windows: add .rc support to autotools builds
After this update autotools builds will compile and link `.rc` resources
to Windows executables. Bringing this feature on par with CMake and
Makefile.m32 builds. And also making it unnecessary to improvise these
steps manually, while monkey patching build files, e.g. [0].

You can customize the resource compiler via the `RC` envvar, and its
options via `RCFLAGS`.

This harmless warning may appear throughout the build, even though the
autotools manual documents [1] `RC` as a valid tag, and it fails when
omitting one:
`libtool:   error: ignoring unknown tag RC`

[0] 535f19060d/curl-autotools.sh (L376-L382)
[1] https://www.gnu.org/software/libtool/manual/html_node/Tags.html

Closes #9521
2022-09-18 12:05:35 +00:00
Daniel Stenberg 307b7543ea
misc: null-terminate
Make use of this term consistently.

Closes #9527
2022-09-17 23:19:29 +02:00
Patrick Monnerat 9d51329047
setopt: use the handler table for protocol name to number conversions
This also returns error CURLE_UNSUPPORTED_PROTOCOL rather than
CURLE_BAD_FUNCTION_ARGUMENT when a listed protocol name is not found.

A new schemelen parameter is added to Curl_builtin_scheme() to support
this extended use.

Note that disabled protocols are not recognized anymore.

Tests adapted accordingly.

Closes #9472
2022-09-16 23:29:01 +02:00
Daniel Stenberg 1bbffa0833
altsvc: use 'h3' for h3
Since the official and real version has been out for a while now and servers
are deployed out there using it, there is no point in sticking to h3-29.

Reported-by: ウさん
Fixes #9515
Closes #9516
2022-09-16 22:31:25 +02:00
Daniel Stenberg ec51f00480
ws: the infof() flags should be %zu
Follow-up to e5e9e0c5e4

Closes #9518
2022-09-16 21:35:15 +02:00
Daniel Stenberg a64e3e5993
setopt: when POST is set, reset the 'upload' field
Reported-by: RobBotic1 on github
Fixes #9507
Closes #9511
2022-09-15 23:44:15 +02:00
Daniel Stenberg 846678541b
urlapi: detect scheme better when not guessing
When the parser is not allowed to guess scheme, it should consider the
word ending at the first colon to be the scheme, independently of number
of slashes.

The parser now checks that the scheme is known before it counts slashes,
to improve the error messge for URLs with unknown schemes and maybe no
slashes.

When following redirects, no scheme guessing is allowed and therefore
this change effectively prevents redirects to unknown schemes such as
"data".

Fixes #9503
2022-09-15 09:31:40 +02:00
Daniel Stenberg 7f5fe74323
strerror: improve two URL API error messages 2022-09-15 09:31:29 +02:00
Daniel Stenberg 889c132c38
cmake: define BUILDING_LIBCURL in lib/CMakeLists, not config.h
Since the config file might also get included by the tool code at times.
This syncs with how other builds do it.

Closes #9498
2022-09-14 08:06:41 +02:00
Daniel Stenberg ddda4fdf3d
setopt: fix compiler warning
Follow-up to cd5ca80f00

closes #9502
2022-09-14 08:02:27 +02:00
Daniel Stenberg fd840cdead
formdata: typecast the va_arg return value
To avoid "enumerated type mixed with another type" warnings

Follow-up from 0f52dd5fd5

Closes #9499
2022-09-13 15:38:48 +02:00
Daniel Stenberg cd5ca80f00
urldata: use a curl_prot_t type for storing protocol bits
This internal-use-only storage type can be bumped to a curl_off_t once
we need to use bit 32 as the previous 'unsigned int' can no longer hold
them all then.

The websocket protocols take bit 30 and 31 so they are the last ones
that fit within 32 bits - but cannot properly be exported through APIs
since those use *signed* 32 bit types (long) in places.

Closes #9481
2022-09-13 11:26:49 +02:00
zhanghu 0f52dd5fd5
formdata: fix warning: 'CURLformoption' is promoted to 'int'
curl/lib/formdata.c: In function 'FormAdd':
curl/lib/formdata.c:249:31: warning: 'CURLformoption' is promoted to 'int' when passed through '...'
  249 |       option = va_arg(params, CURLformoption);
      |                               ^
curl/lib/formdata.c:249:31: note: (so you should pass 'int' not 'CURLformoption' to 'va_arg')
curl/lib/formdata.c:249:31: note: if this code is reached, the program will abort

Closes #9484
2022-09-13 11:24:40 +02:00
Hayden Roche d797339202
wolfSSL: fix session management bug.
Prior to this commit, non-persistent pointers were being used to store
sessions.  When a WOLFSSL object was then freed, that freed the session
it owned, and thus invalidated the pointer held in curl's cache. This
commit makes it so we get a persistent (deep copied) session pointer
that we then add to the cache.  Accordingly, wolfssl_session_free, which
was previously a no-op, now needs to actually call SSL_SESSION_free.

This bug was discovered by a wolfSSL customer.

Closes #9492
2022-09-13 10:15:40 +02:00
Marcel Raad 7740530ced
ws: fix build without `USE_WEBSOCKETS`
The curl.h include is required unconditionally.
2022-09-12 10:22:42 +02:00
Marcel Raad a0ff4dba8b
ws: add missing curl.h include
A conflict between commits 664249d095 and e5839f4ee7 broke the build.
2022-09-12 10:12:32 +02:00
Daniel Stenberg e5e9e0c5e4
ws: fix an infof() call to use %uz for size_t output
Detected by Coverity, CID 1514665.

Closes #9480
2022-09-12 10:02:38 +02:00
Marcel Raad e5839f4ee7
curl_setup: include only system.h instead of curl.h
As done before commit 9506d01ee5.

Ref: https://github.com/curl/curl/pull/9375#discussion_r957010158
Closes https://github.com/curl/curl/pull/9453
2022-09-12 09:41:55 +02:00
Marcel Raad b921a1676f
lib: add missing limits.h includes
Closes https://github.com/curl/curl/pull/9453
2022-09-12 09:41:50 +02:00
Marcel Raad d7dceb57d1
lib and tests: add missing curl.h includes
Closes https://github.com/curl/curl/pull/9453
2022-09-12 09:41:47 +02:00
Marcel Raad 4a7c10c6cc
curl_setup: include curl.h after platform setup headers
The platform setup headers might set definitions required for the
includes in curl.h.

Ref: https://github.com/curl/curl/pull/9375#discussion_r956998269
Closes https://github.com/curl/curl/pull/9453
2022-09-12 09:41:42 +02:00
Daniel Stenberg 9ac40bfcf0
setopt: make protocol2num use a curl_off_t for the protocol bit
... since WSS does not fit within 32 bit.

Bug: https://github.com/curl/curl/pull/9467#issuecomment-1243014887
Closes #9476
2022-09-12 08:35:51 +02:00
Patrick Monnerat 4399b0303a
content_encoding: use writer struct subclasses for different encodings
The variable-sized encoding-specific storage of a struct contenc_writer
currently relies on void * alignment that may be insufficient with
regards to the specific storage fields, although having not caused any
problems yet.

In addition, gcc 11.3 issues a warning on access to fields of partially
allocated structures that can occur when the specific storage size is 0:

  content_encoding.c: In function ‘Curl_build_unencoding_stack’:
  content_encoding.c:980:21: warning: array subscript ‘struct contenc_writer[0]’ is partly outside array bounds of ‘unsigned char[16]’ [-Warray-bounds]
    980 |     writer->handler = handler;
        |     ~~~~~~~~~~~~~~~~^~~~~~~~~
  In file included from content_encoding.c:49:
  memdebug.h:115:29: note: referencing an object of size 16 allocated by ‘curl_dbg_calloc’
    115 | #define calloc(nbelem,size) curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
        |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  content_encoding.c:977:60: note: in expansion of macro ‘calloc’
    977 |   struct contenc_writer *writer = (struct contenc_writer *)calloc(1, sz);

To solve both these problems, the current commit replaces the
contenc_writer/params structure pairs by "subclasses" of struct
contenc_writer. These are structures that contain a contenc_writer at
offset 0. Proper field alignment is therefore handled by the compiler and
full structure allocation is performed, silencing the warnings.

Closes #9455
2022-09-11 14:46:52 +02:00
Daniel Stenberg ce753e3c31
setopt: make protocols2num() work with websockets
So that CURLOPT_PROTOCOLS_STR and CURLOPT_REDIR_PROTOCOLS_STR can
specify those as well.

Reported-by: Patrick Monnerat
Bug: https://curl.se/mail/lib-2022-09/0016.html
Closes #9467
2022-09-10 23:11:47 +02:00
Orgad Shaneh 1c52e8a379
fix Cygwin/MSYS compilation
_getpid is Windows API. On Cygwin variants it should remain getpid.

Fixes #8220
Closes #9255
2022-09-10 16:34:13 +02:00
Daniel Stenberg eebfa3279d
curl_ws_meta: initial implementation 2022-09-09 15:11:14 +02:00
Daniel Stenberg 664249d095
ws: initial websockets support
Closes #8995
2022-09-09 15:11:14 +02:00
Daniel Stenberg 60a3b25dbf
version: add ws + wss 2022-09-09 15:11:14 +02:00
Daniel Stenberg 279f638b74
strtoofft: after space, there cannot be a control code
With the change from ISSPACE() to ISBLANK() this function no longer
deals with (ignores) control codes the same way, which could lead to
this function returning unexpected values like in the case of
"Content-Length: \r-12354".

Follow-up to 6f9fb7ec2d

Detected by OSS-fuzz
Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=51140
Assisted-by: Max Dymond
Closes #9458
2022-09-09 15:02:15 +02:00
Daniel Stenberg 9c9e83931e
headers: reset the requests counter at transfer start
If not, reusing an easy handle to do a subsequent transfer would
continue the counter from the previous invoke, which then would make use
of the header API difficult/impossible as the request counter
mismatched.

Add libtest 1947 to verify.

Reported-by: Andrew Lambert
Fixes #9424
Closes #9447
2022-09-09 14:46:06 +02:00
Daniel Stenberg eafc2b14ac
http2: make nghttp2 less picky about field whitespace
In nghttp2 1.49.0 it returns error on leading and trailing whitespace in
header fields according to language in the recently shipped RFC 9113.

nghttp2 1.50.0 introduces an option to switch off this strict check and
this change enables this option by default which should make curl behave
more similar to how it did with nghttp2 1.48.0 and earlier.

We might want to consider making this an option in the future.

Closes #9448
2022-09-08 14:52:45 +02:00
Michael Heimpold d668685657
ftp: ignore a 550 response to MDTM
The 550 is overused as a return code for multiple error case, e.g.
file not found and/or insufficient permissions to access the file.

So we cannot fail hard in this case.

Adjust test 511 since we now fail later.
Add new test 3027 which check that when MDTM failed, but the file could
actually be retrieved, that in this case no filetime is provided.

Reported-by: Michael Heimpold
Fixes #9357
Closes #9387
2022-09-07 10:26:55 +02:00
Daniel Stenberg f703cf971c
urlapi: leaner with fewer allocs
Slightly faster with more robust code. Uses fewer and smaller mallocs.

- remove two fields from the URL handle struct
- reduce copies and allocs
- use dynbuf buffers more instead of custom malloc + copies
- uses dynbuf to build the host name in reduces serial alloc+free within
  the same function.
- move dedotdotify into urlapi.c and make it static, not strdup the input
  and optimize it by checking for . and / before using strncmp
- remove a few strlen() calls
- add Curl_dyn_setlen() that can "trim" an existing dynbuf

Closes #9408
2022-09-07 10:21:45 +02:00
Jay Satiro 2ae81e680b setup-win32: no longer define UNICODE/_UNICODE implicitly
- If UNICODE or _UNICODE is defined but the other isn't then error
  instead of implicitly defining it.

As Marcel pointed out it is too late at this point to make such a define
because Windows headers may already be included, so likely it never
worked. We never noticed because build systems that can make Windows
Unicode builds always define both. If one is defined but not the other
then something went wrong during the build configuration.

Bug: https://github.com/curl/curl/pull/9375#discussion_r956545272
Reported-by: Marcel Raad

Closes https://github.com/curl/curl/pull/9384
2022-09-07 02:55:10 -04:00
Marc Hoersken 0c68e2545c
lib: add required Win32 setup definitions in setup-win32.h
Assisted-by: Jay Satiro
Reviewed-by: Marcel Raad

Follow up to #9312
Closes #9375
2022-09-06 19:29:44 +02:00
Daniel Stenberg 5e259d7b23
pingpong: extend the response reading error with errno
To help diagnosing the cause of the problem.

See #9380
Closes #9443
2022-09-06 18:48:57 +02:00
Emanuele Torre f1b76e53ae
curl_ctype: add space around <= operator in ISSPACE macro
Follow-up to f65f750

Closes #9441
2022-09-06 14:31:19 +02:00
Daniel Stenberg f65f750742
curl_ctype: convert to macros-only
This no longer provide functions, only macros. Runs faster and produces
smaller output.

The biggest precaution this change brings:

DO NOT use post/pre-increments when passing arguments to the macros.

Closes #9429
2022-09-06 08:36:33 +02:00
Daniel Stenberg 6f9fb7ec2d
misc: ISSPACE() => ISBLANK()
Instances of ISSPACE() use that should rather use ISBLANK(). I think
somewhat carelessly used because it sounds as if it checks for space or
whitespace, but also includes %0a to %0d.

For parsing purposes, we should only accept what we must and not be
overly liberal. It leads to surprises and surprises lead to bad things.

Closes #9432
2022-09-06 08:34:30 +02:00
Daniel Stenberg 8dd95da35b
ctype: remove all use of <ctype.h>, use our own versions
Except in the test servers.

Closes #9433
2022-09-06 08:32:36 +02:00
Daniel Stenberg 472f1cbe7e
NPN: remove support for and use of
Next Protocol Negotiation is a TLS extension that was created and used
for agreeing to use the SPDY protocol (the precursor to HTTP/2) for
HTTPS. In the early days of HTTP/2, before the spec was finalized and
shipped, the protocol could be enabled using this extension with some
servers.

curl supports the NPN extension with some TLS backends since then, with
a command line option `--npn` and in libcurl with
`CURLOPT_SSL_ENABLE_NPN`.

HTTP/2 proper is made to use the ALPN (Application-Layer Protocol
Negotiation) extension and the NPN extension has no purposes
anymore. The HTTP/2 spec was published in May 2015.

Today, use of NPN in the wild should be extremely rare and most likely
totally extinct. Chrome removed NPN support in Chrome 51, shipped in
June 2016. Removed in Firefox 53, April 2017.

Closes #9307
2022-09-05 07:39:02 +02:00
Viktor Szakats c9061f242b
misc: spelling fixes
Found using codespell 2.2.1.

Also delete the redundant protocol designator from an archive.org URL.

Reviewed-by: Daniel Stenberg
Closes #9403
2022-08-31 14:31:01 +00:00
Orgad Shaneh c40ec3178f
url: really use the user provided in the url when netrc entry exists
If the user is specified as part of the URL, and the same user exists
in .netrc, Authorization header was not sent at all.

The user and password fields were assigned in conn->user and password
but the user was not assigned to data->state.aptr, which is the field
that is used in output_auth_headers and friends.

Fix by assigning the user also to aptr.

Amends commit d1237ac906.

Fixes #9243
2022-08-29 17:25:29 +02:00
Orgad Shaneh 943fb2b26a
netrc: Use the password from lines without login
If netrc entry has password with empty login, use it for any username.

Example:
.netrc:
machine example.com password 123456

curl -vn http://user@example.com/

Fix it by initializing state_our_login to TRUE, and reset it only when
finding an entry with the same host and different login.

Closes #9248
2022-08-29 17:24:59 +02:00
Jay Satiro 8bd03516d6
url: treat missing usernames in netrc as empty
- If, after parsing netrc, there is a password with no username then
  set a blank username.

This used to be the case prior to 7d600ad (precedes 7.82). Note
parseurlandfillconn already does the same thing for URLs.

Reported-by: Raivis <standsed@users.noreply.github.com>
Testing-by: Domen Kožar

Fixes https://github.com/curl/curl/issues/8653
Closes #9334
Closes #9066
2022-08-29 17:24:22 +02:00
Daniel Stenberg 8dfc93e573
cookie: reject cookies with "control bytes"
Rejects 0x01 - 0x1f (except 0x09) plus 0x7f

Reported-by: Axel Chong

Bug: https://curl.se/docs/CVE-2022-35252.html

CVE-2022-35252

Closes #9381
2022-08-29 11:20:37 +02:00
Daniel Stenberg 74e156d00f
libssh: ignore deprecation warnings
libssh 0.10.0 marks all SCP functions as "deprecated" which causes
compiler warnings and errors in our CI jobs and elsewhere. Ignore
deprecation warnings if 0.10.0 or later is found in the build.

If they actually remove the functions at a later point, then someone can
deal with that pain and functionality break then.

Fixes #9382
Closes #9383
2022-08-29 10:54:39 +02:00
Daniel Stenberg aec8d30624
Revert "schannel: when importing PFX, disable key persistence"
This reverts commit 70d010d285.

Due to further reports in #9300 that indicate this commit might
introduce problems.
2022-08-29 08:16:20 +02:00
Daniel Stenberg 7632c0d25a
multi: use larger dns hash table for multi interface
Have curl_multi_init() use a much larger DNS hash table than used for
the easy interface to scale and perform better when used with _many_
host names.

curl_share_init() sets an in-between size.

Inspired-by: Ivan Tsybulin
See #9340
Closes #9376
2022-08-29 00:07:09 +02:00
Jacob Tolar 65bbb5e6f4
openssl: add cert path in error message
Closes #9349
2022-08-27 23:26:42 +02:00
Marc Hoersken 109e9730ee
cmake: add detection of threadsafe feature
Avoids failing test 1014 by replicating configure checks
for HAVE_ATOMIC and _WIN32_WINNT with custom CMake tests.

Reviewed-by: Marcel Raad

Follow up to #8680
Closes #9312
2022-08-26 21:09:32 +02:00
Marc Hoersken bc25c9e3ee
multi_wait: fix and improve Curl_poll error handling on Windows
First check for errors and return CURLM_UNRECOVERABLE_POLL
before moving forward and waiting on socket readiness events.

Reviewed-by: Jay Satiro
Reviewed-by: Marcel Raad

Reported-by: Daniel Stenberg
Ref: #9361

Follow up to #8961
Closes #9372
2022-08-26 11:36:42 +02:00
Marc Hoersken a71fe41d2f
multi_wait: fix skipping to populate revents for extra_fds
On Windows revents was not populated for extra_fds if
multi_wait had to wait due to the Curl_poll pre-check
not signalling any readiness. This commit fixes that.

Reviewed-by: Marcel Raad
Reviewed-by: Jay Satiro

Closes #9361
2022-08-25 23:31:24 +02:00
rcombs 07f80f968d
multi: use a pipe instead of a socketpair on apple platforms
Sockets may be shut down by the kernel when the app is moved to the
background, but pipes are not.

Removed from KNOWN_BUGS

Fixes #6132
Closes #9368
2022-08-25 17:43:08 +02:00
Somnath Kundu 89d204036a
libssh2: provide symlink name in SFTP dir listing
When reading the symbolic link name for a file, we need to add the file
name to base path name.

Closes #9369
2022-08-25 17:37:10 +02:00
Dustin Howett 70d010d285
schannel: when importing PFX, disable key persistence
By default, the PFXImportCertStore API persists the key in the user's
key store (as though the certificate was being imported for permanent,
ongoing use.)

The documentation specifies that keys that are not to be persisted
should be imported with the flag `PKCS12_NO_PERSIST_KEY`.
NOTE: this flag is only supported on versions of Windows newer than XP
and Server 2003.

Fixes #9300
Closes #9363
2022-08-25 13:47:27 +02:00
Daniel Stenberg 31a41d45b7
multi: have curl_multi_remove_handle close CONNECT_ONLY transfer
Ẃhen it has been used in the multi interface, it is otherwise left in
the connection cache, can't be reused and nothing will close them since
the easy handle loses the association with the multi handle and thus the
connection cache - until the multi handle is closed or it gets pruned
because the cache is full.

Reported-by: Dominik Thalhammer
Fixes #9335
Closes #9342
2022-08-23 13:44:11 +02:00
Emil Engler 2c86f1b345
url: output the maximum when rejecting a url
This commit changes the failf message to output the maximum length, when
curl refuses to process a URL because it is too long.

See: #9317
Closes: #9327
2022-08-22 23:36:02 +02:00
Daniel Stenberg f3c013d38c
libssh2: make atime/mtime date overflow return error
Closes #9328
2022-08-18 00:02:19 +02:00
Daniel Stenberg c988ec9f41
libssh: make atime/mtime date overflow return error
Closes #9328
2022-08-18 00:02:09 +02:00
Daniel Stenberg 8e88e52ed0
libssh2: setting atime or mtime >32bit on 4-bytes-long systems
Since the libssh2 API uses 'long' to store the timestamp, it cannot
transfer >32bit times on Windows and 32bit architecture builds.

Avoid nasty surprises by instead not setting such time.

Spotted by Coverity

Closes #9325
2022-08-16 23:16:53 +02:00
Daniel Stenberg 44a02d2532
libssh: setting atime or mtime > 32bit is now just skipped
The libssh API used caps the time to an unsigned 32bit variable. Avoid
nasty surprises by instead not setting such time.

Spotted by Coverity.

Closes #9324
2022-08-16 23:15:57 +02:00
Daniel Stenberg 14d9d79c87
asyn-ares: make a single alloc out of hostname + async data
This saves one alloc per name resolve and simplifies the exit path.

Closes #9310
2022-08-16 08:54:33 +02:00
Daniel Stenberg 37dbbbb6c1
Curl_close: call Curl_resolver_cancel to avoid memory-leak
There might be a pending (c-ares) resolve that isn't free'd up yet.

Closes #9310
2022-08-16 08:54:30 +02:00
Daniel Stenberg f236595ecc
asyn-thread: fix socket leak on OOM
Closes #9310
2022-08-16 08:54:25 +02:00
Daniel Stenberg 657101ec0c
url: reject URLs with hostnames longer than 65535 bytes
It *probably* causes other problems too since DNS can't resolve such
long names, but the SNI field in TLS is limited to 16 bits length.

Closes #9317
2022-08-15 10:52:26 +02:00
Daniel Stenberg e65187e188
ngtcp2: fix picky compiler warnings with wolfSSL for QUIC
Follow-up to 8a13be227e

Closes #9315
2022-08-15 09:39:09 +02:00
Daniel Stenberg c031ec53f8
ngtcp2: remove leftover variable
Mistake leftover from my edit before push.

Follow-up from 8a13be227e
Reported-by: Viktor Szakats
Bug: https://github.com/curl/curl/pull/9290#issuecomment-1214569167
2022-08-15 08:22:20 +02:00
Viktor Szakats 5fd7cd7302
Makefile.m32: allow -nghttp3/-ngtcp2 without -ssl [ci skip]
Before this patch `-nghttp3`/`-ngtcp2` had an effect only when `-ssl`
was also enabled. `-ssl` meaning OpenSSL (and its forks). After
8a13be227e nghttp3/ngtcp2 can also be
used together with wolfSSL. This patch adds the ability to enable
`-nghttp3`/`-ngtcp2` independently from `-ssl` (OpenSSL), allowing to
use it with wolfSSL or other, future TLS backends.

Before this patch, it was fine to enable `-nghttp3`/`-ngtcp2`
unconditionally. After this patch, this is no longer the case, and now
it's the user's responsibility to enable `-nghttp3`/`-ngtcp2` only
together with a compatible TLS backend.

When using a TLS backend other than OpenSSL, the TLS-specific ngtcp2
library must be configured manually, e.g.:
  `export CURL_LDFLAG_EXTRAS=-lngtcp2_crypto_wolfssl`

(or via `NGTCP2_LIBS`)

Closes #9314
2022-08-15 02:49:59 +00:00
Stefan Eissing 8a13be227e
quic: add support via wolfSSL
- based on ngtcp2 PR https://github.com/ngtcp2/ngtcp2/pull/505
- configure adapted to build against ngtcp2 wolfssl crypto lib
- quic code added for creation of WOLFSSL* instances

Closes #9290
2022-08-15 00:48:55 +02:00
David Carlier 6526b36271 memdebug: add annotation attributes
memory debug tracking annotates whether the returned pointer does not
`alias`, hints where the size required is, for Windows to be better
debugged via Visual Studio.

Closes https://github.com/curl/curl/pull/9306
2022-08-14 10:53:18 +02:00
Daniel Stenberg 011788f0b6
msh3: fix the QUIC disconnect function
And free request related memory better in 'done'. Fixes a memory-leak.

Reported-by: Gisle Vanem
Fixes #8915
Closes #9304
2022-08-13 00:19:29 +02:00
Daniel Stenberg ed6e0febe0
connect: close the happy eyeballs loser connection when using QUIC
Reviewed-by: Nick Banks

Closes #9303
2022-08-12 16:29:12 +02:00
Emil Engler 764c958c52
refactor: split resolve_server() into functions
This commit splits the branch-heavy resolve_server() function into
various sub-functions, in order to reduce the amount of nested
if/else-statements.

Beside this, it also removes many else-sequences, by returning in the
previous if-statement.

Closes #9283
2022-08-12 16:27:36 +02:00
Daniel Stenberg 193772084f
schannel: re-indent to use curl style better
Only white space changes

Closes #9301
2022-08-12 16:04:08 +02:00
Daniel Stenberg b5c0fe20e3
hostip: resolve *.localhost to 127.0.0.1/::1
Following the footsteps of other clients like Firefox/Chrome.  RFC 6761
says clients SHOULD do this.

Add test 389 to verify.

Reported-by: TheKnarf on github
Fixes #9192
Closes #9296
2022-08-11 14:01:37 +02:00
Daniel Stenberg d48dd1573c
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
2022-08-11 09:07:06 +02:00
Futaura 55a138acc4
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
2022-08-10 14:14:27 +02:00
Emil Engler 34886a444f
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
2022-08-10 14:12:22 +02:00
Cering 6ba3047378
connect: add quic connection information
Fixes #9286
Closes #9287
2022-08-10 08:41:50 +02:00
Daniel Stenberg 15f7feac22
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
2022-08-08 19:57:49 +02:00
Daniel Stenberg ca528d1de7
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
2022-08-08 19:56:14 +02:00
Futaura 23c708cdc8
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
2022-08-08 16:42:10 +02:00
Daniel Stenberg a29d34b0b7
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
2022-08-08 14:31:06 +02:00
Daniel Stenberg a550831023
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
2022-08-08 14:30:25 +02:00
Daniel Stenberg 0f23341953
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
2022-08-08 13:26:11 +02:00
Futaura a041ed8cde
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
2022-08-08 10:48:11 +02:00
opensignature dc8c859b0c
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
2022-08-08 09:49:38 +02:00
Futaura e1acfafa49
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
2022-08-08 09:16:01 +02:00
Daniel Stenberg 0ad7c8d7d5
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
2022-08-08 08:28:04 +02:00
Evgeny Grin (Karlson2k) 3fe24ea322
digest: reject broken header with session protocol but without qop
Closes #9077
2022-08-07 14:39:57 +02:00
Andrew Lambert 4641575fcd
curl_easy_header: Add CURLH_PSEUDO to sanity check
Fixes #9235
Closes #9236
2022-08-06 17:08:16 +02:00
Wyatt O'Day 8beff43559 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
2022-08-02 13:54:31 -04:00
Nao Yonashiro 2086b69b57 quiche: fix build failure
Reviewed-by: Alessandro Ghedini
Closes #9223
2022-08-02 16:49:36 +02:00
Sean McArthur 3b52a80c05
hyper: enable obs-folded multiline headers
Closes #9216
2022-07-28 00:36:18 +02:00
Daniel Stenberg 3141062c23
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
2022-07-28 00:34:23 +02:00
Jay Satiro 9bd40e2b69 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
2022-07-26 13:23:56 -04:00
Evgeny Grin (Karlson2k) 6e241bbf1d digest: fix memory leak, fix not quoted 'opaque'
Fix leak regression introduced by 3a6fe0c.

Closes https://github.com/curl/curl/pull/9199
2022-07-25 15:06:30 -04:00
Daniel Stenberg 07535a4f87
sendf: skip storing HTTP headers if HTTP disabled
Closes #9179
2022-07-23 13:39:10 +02:00
Daniel Stenberg 3be0c67379
url: enumerated type mixed with another type
Follow-up to 1c58e7ae99ce2030213f28b

Closes #9179
2022-07-23 13:39:06 +02:00
Daniel Stenberg 8cd57d6e39
urldata: change second proxytype field to unsigned char to match
To avoid "enumerated type mixed with another type"

Closes #9179
2022-07-23 13:39:03 +02:00
Daniel Stenberg 8d1da2e172
http: typecast the httpreq assignment to avoid icc compiler warning
error #188: enumerated type mixed with another type

Closes #9179
2022-07-23 13:39:00 +02:00
Daniel Stenberg dcbc9226bc
urldata: make state.httpreq an unsigned char
To match set.method used for the same purpose.

Closes #9179
2022-07-23 13:38:57 +02:00
Daniel Stenberg 32db1ed867
splay: avoid using -1 in unsigned variable
To fix icc compiler warning integer conversion resulted in a change of sign

Closes #9179
2022-07-23 13:38:54 +02:00
Daniel Stenberg 6531c0e85a
sendf: store the header type in an usigned char to avoid icc warnings
Closes #9179
2022-07-23 13:38:50 +02:00
Daniel Stenberg 4c57fdcf87
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
2022-07-23 13:38:47 +02:00
Daniel Stenberg 74d47e22aa
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
2022-07-23 13:38:43 +02:00
Daniel Stenberg f273b59144
http_chunks: remove an assign + typecast
As it caused icc to complain: "pointer cast involving 64-bit pointed-to
type"

Closes #9179
2022-07-23 13:38:36 +02:00
Daniel Stenberg 336f7cd5af
vtls: make Curl_ssl_backend() return the enum type curl_sslbackend
To fix the icc warning enumerated type mixed with another type

Closes #9179
2022-07-23 13:38:33 +02:00
Daniel Stenberg fe8f1512e5
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
2022-07-20 00:50:19 +02:00
Daniel Stenberg 6f037100eb
sendf: fix paused header writes since after the header API
Regression since d1e4a67

Reported-by: Sergey Ogryzkov
Fixes #9180
Closes #9182
2022-07-20 00:49:06 +02:00
Daniel Stenberg 7935972b37
mprintf: fix *dyn_vprintf() when out-of-memory
Follow-up to 0e48ac1f99. Torture-testing 1455 would lead to a memory
leak otherwise.

Closes #9185
2022-07-19 23:56:03 +02:00
Daniel Stenberg c61e6de7d5
file: fix icc enumerated type mixed with another type warning
Ref: #9179
Closes #9181
2022-07-19 18:10:08 +02:00
Viktor Szakats 4d73854462
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 de71e68000)
- `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
2022-07-19 15:12:19 +00:00
Daniel Stenberg 4c0ac2aa59
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
2022-07-19 11:52:54 +02:00
Patrick Monnerat c2e72c7812
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
2022-07-19 11:06:20 +02:00
Daniel Stenberg dfe5a3023b
easyoptions: fix icc warning
easyoptions.c(360): error #188: enumerated type mixed with another type

Ref: #9156
Reported-by: Matthew Thompson
Closes #9176
2022-07-19 11:01:15 +02:00
lwthiker b9b6148c45
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
2022-07-19 00:19:13 +02:00
Daniel Stenberg fe93bb4d1f
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
2022-07-18 11:55:26 +02:00
Viktor Szakats f9ff59ebe2
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] 46c92c0b80

Reviewed-by: Daniel Stenberg
Closes #9169
2022-07-17 21:46:01 +00:00
Daniel Stenberg 0e48ac1f99
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
2022-07-17 23:27:02 +02:00
Viktor Szakats a19f0601fe
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
2022-07-16 14:10:39 +00:00
Viktor Szakats 4c46c829f5
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] fbe07c6829

Co-authored-by: Jay Satiro
Closes #9110
2022-07-14 07:14:22 +00:00
Daniel Stenberg 451bcc1a91
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
2022-07-13 23:26:13 +02:00
Daniel Stenberg e0c68f0255
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
2022-07-12 23:08:35 +02:00
Even Rouault 0525614269
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
2022-07-12 17:18:39 +02:00
Even Rouault 7ac3607584
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
2022-07-12 17:17:07 +02:00
Tatsuhiro Tsujikawa e9a2eced69
ngtcp2: implement cb_h3_stop_sending and cb_h3_reset_stream callbacks
Closes #9135
2022-07-12 17:15:52 +02:00
Viktor Szakats ca73991774
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:
435f395f3f, thus retiring the
`CURL_OS_SUFFIX` CMake option.

Reviewed-by: Jay Satiro
Closes #9117
2022-07-11 19:41:31 +00:00
Viktor Szakats 1d5b7b7009
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
2022-07-10 22:28:14 +00:00
Tatsuhiro Tsujikawa 4989cd099e
ngtcp2: fix stall or busy loop on STOP_SENDING with upload data
Fixes #9122
Closes #9123
2022-07-10 23:18:00 +02:00
xkernel afdbb176f6
getinfo: return better error on NULL as first argument
Closes #9114
2022-07-10 18:22:23 +02:00
Jay Satiro eab25898b3 docs: explain curl_easy_escape/unescape curl handle is ignored
26101421 (precedes 7.82.0) removed character conversion support used by
very old legacy operating systems and since then the curl handle passed
to curl_easy_escape/unescape is always ignored.

Bug: https://github.com/curl/curl/discussions/9115
Reported-by: Ted Lyngmo

Closes https://github.com/curl/curl/pull/9121
2022-07-10 02:59:58 -04:00
Viktor Szakats 9153ba708b
openssl: add `CURL_BORINGSSL_VERSION` to identify BoringSSL
BoringSSL doesn't keep a version number, and doesn't self-identify itself
via any other revision number via its own headers. We can identify
BoringSSL revisions by their commit hash. This hash is typically known by
the builder. This patch adds a way to pass this hash to libcurl, so that
it can display in the curl version string:

For example:

`CFLAGS=-DCURL_BORINGSSL_VERSION="c239ffd0"`

```
curl 7.84.0 (x86_64-w64-mingw32) libcurl/7.84.0 BoringSSL/c239ffd0 (Schannel) zlib/1.2.12 [...]
Release-Date: 2022-06-27
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 [...]
Features: alt-svc AsynchDNS brotli gsasl HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos [...]
```

The setting is optional, and if not passed, BoringSSL will appear without
a version number, like before this patch.

Closes #9113
2022-07-08 10:12:15 +00:00
Jay Satiro 30c862513d escape: remove outdated comment
Bug: https://github.com/curl/curl/discussions/9115
Reported-by: Ted Lyngmo
2022-07-08 01:39:55 -04:00
Tatsuhiro Tsujikawa 7f5a29e689 ngtcp2: Fix missing initialization of nghttp3_nv.flags
Closes https://github.com/curl/curl/pull/9118
2022-07-08 00:12:08 -04:00
Viktor Szakats 190caa9ce2
Makefile.m32: add `NGTCP2_LIBS` option [ci skip]
Makefile.m32's ngtcp2 has its two libs hardwired for OpenSSL.
Add `NGTCP2_LIBS` envvar to override them with a custom list,
making it possible to use BoringSSL, or any other backend.

Closes #9109
2022-07-06 09:22:42 +00:00
Evgeny Grin (Karlson2k) 647ed7c78b digest: fix missing increment of 'nc' value for auth-int
- Increment nc regardless of qop type.

Prior to this change nc was only incremented for qop type auth even
though libcurl sends nc with any qop.

Closes https://github.com/curl/curl/pull/9090
2022-07-06 04:14:37 -04:00
Daniel Stenberg 1b3d59acf9
urldata: reduce size of four ftp related members
ftp_filemethod, ftpsslauth and ftp_ccc are now uchars

accepttimeout is now unsigned int - almost 50 days ought to be enough
for this value.

Closes #9106
2022-07-05 10:18:48 +02:00
Daniel Stenberg dcb7d4f904
urldata: reduce three type-members from int to uchar
- timecondition
 - proxytype
 - method

... previously used their enum type in the struct, which made them
unnecesarily large.

Closes #9105
2022-07-05 10:17:31 +02:00
Daniel Stenberg be43dd600a
CURLOPT_SERVER_RESPONSE_TIMEOUT: the new name
Starting now, CURLOPT_FTP_RESPONSE_TIMEOUT is the alias instead of the
other way around.

Since 7.20.0, CURLOPT_SERVER_RESPONSE_TIMEOUT has existed as an alias
but since the option is for more protocols than FTP the more "correct"
version of the option is the "server" one so now we switch.

Closes #9104
2022-07-05 10:16:05 +02:00
Daniel Stenberg 671cc8e110
urldata: make 'ftp_create_missing_dirs' a uchar
It only ever holds the values 0-2.

Closes #9103
2022-07-05 10:10:49 +02:00
Daniel Stenberg 3622bf4e79
urldata: change 4 timeouts to unsigned int from long
They're not used for that long times anyway, 32 bit milliseconds is long
enough.

Closes #9101
2022-07-05 00:15:54 +02:00
Daniel Stenberg fe14ff6150
urldata: make 'use_netrc' a uchar
Closes #9102
2022-07-04 23:04:24 +02:00
Daniel Stenberg 3fa343a35c
urldata: make 'buffer_size' an unsigned int
It is already capped at READBUFFER_MAX which fits easily in 32 bits.

Closes #9098
2022-07-04 23:03:44 +02:00
Daniel Stenberg cb17b12b01
urldata: remove the unused 'rtspversion' struct member
Closes #9100
2022-07-04 19:44:10 +02:00
Daniel Stenberg 1d85d2e4f9
urldata: make 'use_port' an usigned short
... instead of a long. It is already enforced to not attempt to set any
value outside of 16 bits unsigned.

Closes #9099
2022-07-04 19:42:40 +02:00
Daniel Stenberg ccc8092b05
urldata: store dns cache timeout in an int
68 years ought to be enough for most.

Closes #9097
2022-07-04 19:28:50 +02:00