The introduction of CURL_DISABLE_MIME came with some additional bugs:
- Disabled MIME is compiled-in anyway if SMTP and/or IMAP is enabled.
- CURLOPT_MIMEPOST, CURLOPT_MIME_OPTIONS and CURLOPT_HTTPHEADER are
conditioned on HTTP, although also needed for SMTP and IMAP MIME mail
uploads.
In addition, the CURLOPT_HTTPHEADER and --header documentation does not
mention their use for MIME mail.
This commit fixes the problems above.
Closes#9610
The existing code tried but did not properly reject alternative services
using negative or too large port numbers.
With this fix, the logic now also flushes the old entries immediately
before adding a new one, making a following header with an illegal entry
not flush the already stored entry.
Report from the ongoing source code audit by Trail of Bits.
Adjusted test 356 to verify.
Closes#9607
In C89, positive integer literals that overflow an int but not an
unsigned int may be understood as a negative int.
lib517.c:129:3: warning: this decimal constant is unsigned only in ISO C90
{"Sun, 06 Nov 2044 08:49:37 GMT", 2362034977 },
^
Closes#9572
Replace bit mask protocol sets by null-terminated arrays of protocol
tokens. These are the addresses of the protocol names returned by
curl_version_info().
Protocol names are sorted case-insensitively before output to satisfy CI
tests matches consistency.
The protocol list returned by curl_version_info() is augmented with all
RTMP protocol variants.
Test 1401 adjusted for new alpha ordered output.
Closes#9546
It seems too restrictive to assume and use an external tool to verify
the JSON. This now verifies the outut byte per byte. We could consider
building a local "JSON verifyer" in a future.
Remove 'jsonlint' from the CI job.
Reported-by: Marcel Raad
Fixes#9563Closes#9564
This script now also finds all .3 man pages in docs/include and
docs/include/opts, extracts all uses of CURL* symbols and verifies that all
symbols mentioned in docs are defined in public headers.
A "global symbol" is one of those matching a known prefix and the script makes
an attempt to check all/most of them. Just using *all* symbols that match
CURL* proved matching a little too many other references as well and turned
difficult turning into something useful.
Closes#9544
Previously this test only scanned a subset of the headers, which made us
accidentally miss symbols that were provided in the others. Now, the script
iterates over all headers present in include/curl.
Closes#9544
Initializations performed in unit test 1655 use automatic variables in
aggregates and thus can only be computed at run-time. Using gcc in C89
dialect mode produces warning messages like:
unit1655.c:96:7: warning: initializer element is not computable at load time [-Wpedantic]
96 | { toolong, DOH_DNS_NAME_TOO_LONG }, /* expect early failure */
| ^~~~~~~
Fix the problem by converting these automatic pointer variables to
static arrays.
Closes#9551
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
- add websockets support to sws
- 2300: first very basic websockets test
- 2301: first libcurl test for ws (not working yet)
- 2302: use the ws callback
- 2303: test refused upgrade
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#9424Closes#9447
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#9357Closes#9387
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
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
... including the SPDX-License-Identifier.
These omissions were not detected by the RUEUSE CI job nor the copyright.pl
scanners because we have a general wildcard in .reuse/dep5 for
"tests/certs/*".
Reported-by: Samuel Henrique
Fixes#9417Closes#9420
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 #9340Closes#9376
This should make it possible to also report test failures
if our freshly build curl binary is not fully functional.
Reviewed-by: Daniel Stenberg
Closes#9360
Avoid loosing any triggered handles by first aborting and joining
the waiting threads before evaluating the individual signal state.
This removes the race condition and therefore need for a mutex.
Closes#9023
... as using a 65535 bytes host name in a URL does not fit on the
command line on some systems - like Windows.
Reported-by: Marcel Raad
Fixes#9321Closes#9322