]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 years agodocs: fix proselint complaints 9520/head
Daniel Stenberg [Mon, 19 Sep 2022 15:30:30 +0000 (17:30 +0200)] 
docs: fix proselint complaints

2 years agoGHA: run proselint on markdown files
Daniel Stenberg [Mon, 19 Sep 2022 15:30:05 +0000 (17:30 +0200)] 
GHA: run proselint on markdown files

Co-authored-by: Marc Hörsken
Closes #9520

2 years agolib: the number four in a sequence is the "fourth"
Daniel Stenberg [Sun, 18 Sep 2022 21:23:42 +0000 (23:23 +0200)] 
lib: the number four in a sequence is the "fourth"

Spelling is hard

Closes #9535

2 years agomisc: fix spelling in two source files
John Bampton [Sat, 17 Sep 2022 19:48:43 +0000 (05:48 +1000)] 
misc: fix spelling in two source files

Closes #9529

2 years agowindows: add .rc support to autotools builds
Viktor Szakats [Sun, 18 Sep 2022 12:05:35 +0000 (12:05 +0000)] 
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] https://github.com/curl/curl-for-win/blob/535f19060d4b708f72e75dd849409ce50baa1b84/curl-autotools.sh#L376-L382
[1] https://www.gnu.org/software/libtool/manual/html_node/Tags.html

Closes #9521

2 years agoCI/linkcheck: only run if a Markdown file is changed
Marc Hoersken [Sat, 17 Sep 2022 19:58:58 +0000 (21:58 +0200)] 
CI/linkcheck: only run if a Markdown file is changed

This saves CI resources and therefore a little energy.

Reviewed-by: Max Dymond
Closes #9531

2 years agoREADME.md: add GHA status badges for Linux and macOS builds
Marc Hoersken [Sat, 17 Sep 2022 19:53:50 +0000 (21:53 +0200)] 
README.md: add GHA status badges for Linux and macOS builds

This makes sense now that Linux builds are being consolidated.

Approved-by: Daniel Stenberg
Closes #9530

[skip ci]

2 years agomisc: null-terminate
Daniel Stenberg [Sat, 17 Sep 2022 15:32:21 +0000 (17:32 +0200)] 
misc: null-terminate

Make use of this term consistently.

Closes #9527

2 years agoCI/GHA: merge intel CC and more TLS libs into linux workflow
Marc Hoersken [Thu, 15 Sep 2022 19:20:10 +0000 (21:20 +0200)] 
CI/GHA: merge intel CC and more TLS libs into linux workflow

Continue work on merging all Linux workflows into one file.

Reviewed-by: Max Dymond
Follow up to #9501
Closes #9514

2 years agolib1597: make it C89-compliant again
Patrick Monnerat [Sat, 17 Sep 2022 12:09:07 +0000 (14:09 +0200)] 
lib1597: make it C89-compliant again

Automatic variable addresses cannot be used in an initialisation
aggregate.

Follow-up to 9d51329

Reported-by: Daniel Stenberg
Fixes: #9524
Closes #9525

2 years agotool_libinfo: silence "different 'const' qualifiers" in qsort()
Daniel Stenberg [Sat, 17 Sep 2022 09:38:59 +0000 (11:38 +0200)] 
tool_libinfo: silence "different 'const' qualifiers" in qsort()

MSVC 15.0.30729.1 warned about it

Follow-up to dd2a024323dcc

Closes #9522

2 years agodocs: tell about disabled protocols in CURLOPT_*PROTOCOLS_STR.
Patrick Monnerat [Tue, 13 Sep 2022 17:47:18 +0000 (19:47 +0200)] 
docs: tell about disabled protocols in CURLOPT_*PROTOCOLS_STR.

Disabled protocols are now handled as if they were unknown.
Also update the possible protocol list.

2 years agocli tool: do not use disabled protocols
Patrick Monnerat [Thu, 15 Sep 2022 12:31:36 +0000 (14:31 +0200)] 
cli tool: do not use disabled protocols

As they are now rejected by the library, take care of not passing
disabled protocol names to CURLOPT_PROTOCOLS_STR and
CURLOPT_REDIR_PROTOCOLS_STR.

Rather than using the CURLPROTO_* constants, dynamically assign protocol
numbers based on the order they are listed by curl_version_info().

New type proto_set_t implements prototype bit masks: it should therefore
be large enough to accomodate all library-enabled protocols. If not,
protocol numbers beyond the bit count of proto_set_t are recognized but
"inaccessible": when used, a warning is displayed and the value is
ignored. Should proto_set_t overflows, enabled protocols are reordered to
force those having a public CURLPROTO_* representation to be accessible.

Code has been added to subordinate RTMP?* protocols to the presence of
RTMP in the enabled protocol list, being returned by curl_version_info()
or not.

2 years agosetopt: use the handler table for protocol name to number conversions
Patrick Monnerat [Thu, 15 Sep 2022 11:30:09 +0000 (13:30 +0200)] 
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

2 years agoaltsvc: use 'h3' for h3
Daniel Stenberg [Fri, 16 Sep 2022 13:01:57 +0000 (15:01 +0200)] 
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

2 years agowinbuild: Use NMake batch-rules for compilation
chemodax [Thu, 15 Sep 2022 16:41:17 +0000 (19:41 +0300)] 
winbuild: Use NMake batch-rules for compilation

- Invoke cl compiler once for each group of .c files.

This is significantly improves compilation time. For example in my
environment: 40 s --> 20 s.

Prior to this change cl was invoked per .c file.

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

2 years agows: the infof() flags should be %zu
Daniel Stenberg [Fri, 16 Sep 2022 15:18:16 +0000 (17:18 +0200)] 
ws: the infof() flags should be %zu

Follow-up to e5e9e0c5e49ae0

Closes #9518

2 years agocurl: warn for --ssl use, considered insecure
Daniel Stenberg [Fri, 16 Sep 2022 17:03:49 +0000 (19:03 +0200)] 
curl: warn for --ssl use, considered insecure

Closes #9519

2 years agocurl_escape.3: fix typo
Sergey Bronnikov [Fri, 16 Sep 2022 13:32:57 +0000 (16:32 +0300)] 
curl_escape.3: fix typo

lengthf -> length

Closes #9517

2 years agomailmap: merge Philip Heiduck's two addresses into one
Daniel Stenberg [Fri, 16 Sep 2022 14:46:32 +0000 (16:46 +0200)] 
mailmap: merge Philip Heiduck's two addresses into one

2 years agotest1948: verify PUT + POST reusing the same handle
Daniel Stenberg [Thu, 15 Sep 2022 07:23:33 +0000 (09:23 +0200)] 
test1948: verify PUT + POST reusing the same handle

Reproduced #9507, verifies the fix

2 years agosetopt: when POST is set, reset the 'upload' field
Daniel Stenberg [Thu, 15 Sep 2022 07:22:45 +0000 (09:22 +0200)] 
setopt: when POST is set, reset the 'upload' field

Reported-by: RobBotic1 on github
Fixes #9507
Closes #9511

2 years agogithub: initial CODEOWNERS setup for CI configuration
Marc Hoersken [Wed, 14 Sep 2022 18:09:54 +0000 (20:09 +0200)] 
github: initial CODEOWNERS setup for CI configuration

Reviewed-by: Daniel Stenberg
Reviewed-by: Marcel Raad
Reviewed-by: Max Dymond
Closes #9505

[skip ci]

2 years agoCI: optimize some more dependencies install
Philip Heiduck [Tue, 13 Sep 2022 14:15:12 +0000 (16:15 +0200)] 
CI: optimize some more dependencies install

Signed-off-by: Philip Heiduck <pheiduck@Philips-MBP.lan>
Closes #9500

2 years agoCI/GHA: merge event-based and NSS into new linux workflow
Marc Hoersken [Wed, 14 Sep 2022 20:24:39 +0000 (22:24 +0200)] 
CI/GHA: merge event-based and NSS into new linux workflow

Continue work on merging all Linux workflows into one file.

Follow up to #9501
Closes #9506

2 years agoinclude/curl/websockets.h: add extern "C" for C++
Daniel Stenberg [Thu, 15 Sep 2022 06:40:59 +0000 (08:40 +0200)] 
include/curl/websockets.h: add extern "C" for C++

Reported-by: n0name321 on github
Fixes #9509
Closes #9510

2 years agolib1560: extended to verify detect/reject of unknown schemes
Daniel Stenberg [Wed, 14 Sep 2022 07:21:49 +0000 (09:21 +0200)] 
lib1560: extended to verify detect/reject of unknown schemes

... when no guessing is allowed.

2 years agourlapi: detect scheme better when not guessing
Daniel Stenberg [Wed, 14 Sep 2022 07:18:30 +0000 (09:18 +0200)] 
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

2 years agostrerror: improve two URL API error messages
Daniel Stenberg [Wed, 14 Sep 2022 07:17:28 +0000 (09:17 +0200)] 
strerror: improve two URL API error messages

2 years agoCI/GHA: merge bearssl and hyper into initial linux workflow
Marc Hoersken [Tue, 13 Sep 2022 19:13:17 +0000 (21:13 +0200)] 
CI/GHA: merge bearssl and hyper into initial linux workflow

Begin work on merging all Linux workflows into one file.

Closes #9501

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 14 Sep 2022 07:58:50 +0000 (09:58 +0200)] 
RELEASE-NOTES: synced

2 years agocmake: define BUILDING_LIBCURL in lib/CMakeLists, not config.h
Daniel Stenberg [Tue, 13 Sep 2022 12:43:40 +0000 (14:43 +0200)] 
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

2 years agotool_hugehelp: make hugehelp a blank macro when disabled
Daniel Stenberg [Tue, 13 Sep 2022 08:25:26 +0000 (10:25 +0200)] 
tool_hugehelp: make hugehelp a blank macro when disabled

Closes #9485

2 years agogetparameter: return PARAM_MANUAL_REQUESTED for -M even when disabled
Daniel Stenberg [Mon, 12 Sep 2022 14:28:32 +0000 (16:28 +0200)] 
getparameter: return PARAM_MANUAL_REQUESTED for -M even when disabled

... to improve the output in this situation. Now it doesn't say "option
unknown" anymore.

Closes #9485

2 years agosetopt: fix compiler warning
Daniel Stenberg [Tue, 13 Sep 2022 20:56:31 +0000 (22:56 +0200)] 
setopt: fix compiler warning

Follow-up to cd5ca80f00d2

closes #9502

2 years agoCI: skip make, do make install at once for dependencies
Philip Heiduck [Sun, 11 Sep 2022 22:04:32 +0000 (00:04 +0200)] 
CI: skip make, do make install at once for dependencies

Signed-off-by: Philip Heiduck <pheiduck@Philips-MBP.lan>
Closes #9477

2 years agoformdata: typecast the va_arg return value
Daniel Stenberg [Tue, 13 Sep 2022 12:52:33 +0000 (14:52 +0200)] 
formdata: typecast the va_arg return value

To avoid "enumerated type mixed with another type" warnings

Follow-up from 0f52dd5fd5aa3592691a

Closes #9499

2 years agoRELEASE-PROCEDURE.md: mention patch releases
Daniel Stenberg [Tue, 13 Sep 2022 06:37:01 +0000 (08:37 +0200)] 
RELEASE-PROCEDURE.md: mention patch releases

- When to make them and how to argue for them
- Refreshed the release date list

Closes #9495

2 years agourldata: use a curl_prot_t type for storing protocol bits
Daniel Stenberg [Mon, 12 Sep 2022 07:57:01 +0000 (09:57 +0200)] 
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

2 years agoformdata: fix warning: 'CURLformoption' is promoted to 'int'
zhanghu [Thu, 22 Apr 2021 09:10:00 +0000 (17:10 +0800)] 
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

2 years agoCURLOPT_CONNECT_ONLY.3: for ws(s) as well
Daniel Stenberg [Mon, 12 Sep 2022 14:34:31 +0000 (16:34 +0200)] 
CURLOPT_CONNECT_ONLY.3: for ws(s) as well

and correct the version number for when that support comes. Even if it
is still experimental for WebSocket.

Closes #9487

2 years agotool_operate: avoid a few #ifdefs for disabled-libcurl builds
Daniel Stenberg [Mon, 12 Sep 2022 14:30:54 +0000 (16:30 +0200)] 
tool_operate: avoid a few #ifdefs for disabled-libcurl builds

By providing empty macros in the header file instead, the code gets
easier to read and yet is disabled on demand.

Closes #9486

2 years agoscripts: use `grep -E` instead of `egrep`
a1346054 [Mon, 12 Sep 2022 20:21:03 +0000 (20:21 +0000)] 
scripts: use `grep -E` instead of `egrep`

egrep is deprecated

Closes #9491

2 years agowolfSSL: fix session management bug.
Hayden Roche [Tue, 13 Sep 2022 01:14:14 +0000 (18:14 -0700)] 
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

2 years agodocs: use "WebSocket" in singular
Daniel Stenberg [Tue, 13 Sep 2022 07:17:53 +0000 (09:17 +0200)] 
docs: use "WebSocket" in singular

This is how the RFC calls the protocol. Also rename the file in docs/ to
WEBSOCKET.md in uppercase to match how we have done it for many other
protocol docs in similar fashion.

Add the WebSocket docs to the tarball.

Closes #9496

2 years agows: fix build without `USE_WEBSOCKETS`
Marcel Raad [Mon, 12 Sep 2022 08:22:42 +0000 (10:22 +0200)] 
ws: fix build without `USE_WEBSOCKETS`

The curl.h include is required unconditionally.

2 years agows: add missing curl.h include
Marcel Raad [Mon, 12 Sep 2022 08:11:56 +0000 (10:11 +0200)] 
ws: add missing curl.h include

A conflict between commits 664249d0952 and e5839f4ee70 broke the build.

2 years agows: fix an infof() call to use %uz for size_t output
Daniel Stenberg [Mon, 12 Sep 2022 07:29:16 +0000 (09:29 +0200)] 
ws: fix an infof() call to use %uz for size_t output

Detected by Coverity, CID 1514665.

Closes #9480

2 years agocurl_setup: include only system.h instead of curl.h
Marcel Raad [Wed, 7 Sep 2022 10:30:15 +0000 (12:30 +0200)] 
curl_setup: include only system.h instead of curl.h

As done before commit 9506d01ee50.

Ref: https://github.com/curl/curl/pull/9375#discussion_r957010158
Closes https://github.com/curl/curl/pull/9453

2 years agolib: add missing limits.h includes
Marcel Raad [Wed, 7 Sep 2022 14:11:42 +0000 (16:11 +0200)] 
lib: add missing limits.h includes

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

2 years agolib and tests: add missing curl.h includes
Marcel Raad [Wed, 7 Sep 2022 10:19:29 +0000 (12:19 +0200)] 
lib and tests: add missing curl.h includes

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

2 years agocurl_setup: include curl.h after platform setup headers
Marcel Raad [Wed, 7 Sep 2022 08:54:16 +0000 (10:54 +0200)] 
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

2 years agodocs: correct missing uppercase in Markdown files
Benjamin Loison [Sun, 11 Sep 2022 21:39:14 +0000 (23:39 +0200)] 
docs: correct missing uppercase in Markdown files

To detect these typos I used:

```
clear && grep -rn '\. [a-z]' . | uniq | grep -v '\. lib' | grep -v '[0-9]\. [a-z]' | grep -v '\.\. [a-z]' | grep -v '\. curl' | grep -v 'e.g. [a-z]' | grep -v 'eg. [a-z]' | grep -v '\etc. [a-z]' | grep -v 'i.e\. [a-z]' | grep --color=always '\. [a-z]' | grep '\.md'
```

Closes #9474

2 years agotool_setopt: use better English in --libcurl source comments
Daniel Stenberg [Sun, 11 Sep 2022 21:59:38 +0000 (23:59 +0200)] 
tool_setopt: use better English in --libcurl source comments

Like this:

  XYZ was set to an object pointer
  ABC was set to a function pointer

Closes #9475

2 years agosetopt: make protocol2num use a curl_off_t for the protocol bit
Daniel Stenberg [Sun, 11 Sep 2022 22:02:07 +0000 (00:02 +0200)] 
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

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 11 Sep 2022 21:46:44 +0000 (23:46 +0200)] 
RELEASE-NOTES: synced

2 years agoconfigure: polish the grep -E message a bit further
Daniel Stenberg [Sun, 11 Sep 2022 13:08:08 +0000 (15:08 +0200)] 
configure: polish the grep -E message a bit further

Suggested-by: Emanuele Torre
Closes #9473

2 years agoGHA: add a gcc-11 -O3 build using OpenSSL
Daniel Stenberg [Thu, 8 Sep 2022 09:32:34 +0000 (11:32 +0200)] 
GHA: add a gcc-11 -O3 build using OpenSSL

Since -O3 might trigger other warnings

Closes #9454

2 years agocontent_encoding: use writer struct subclasses for different encodings
Patrick Monnerat [Fri, 9 Sep 2022 11:25:02 +0000 (13:25 +0200)] 
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

2 years agoconfigure: correct the wording when checking grep -E
Daniel Stenberg [Sat, 10 Sep 2022 22:10:26 +0000 (00:10 +0200)] 
configure: correct the wording when checking grep -E

The check first checks that grep -E works, and only as a fallback tries
to find and use egrep. egrep is deprecated.

This change only corrects the output wording, not the checks themselves.

Closes #9471

2 years agowebsockets: sync prototypes in docs with implementation [ci skip]
Viktor Szakats [Sat, 10 Sep 2022 21:36:49 +0000 (21:36 +0000)] 
websockets: sync prototypes in docs with implementation [ci skip]

Docs for the new send/recv functions synced with the committed versions
of these.

Closes #9470

2 years agosetopt: make protocols2num() work with websockets
Daniel Stenberg [Sat, 10 Sep 2022 15:13:44 +0000 (17:13 +0200)] 
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

2 years agocurl/websockets.h: remove leftover bad typedef
Daniel Stenberg [Sat, 10 Sep 2022 15:10:10 +0000 (17:10 +0200)] 
curl/websockets.h: remove leftover bad typedef

Just a leftover trace of a development thing that did not stay like
that.

Reported-by: Marc Hörsken
Fixes #9465
Cloes #9466

2 years agofix Cygwin/MSYS compilation
Orgad Shaneh [Fri, 5 Aug 2022 10:45:25 +0000 (13:45 +0300)] 
fix Cygwin/MSYS compilation

_getpid is Windows API. On Cygwin variants it should remain getpid.

Fixes #8220
Closes #9255

2 years agoGHA: prepare workflow merge by aligning structure again
Marc Hoersken [Thu, 1 Sep 2022 20:44:43 +0000 (22:44 +0200)] 
GHA: prepare workflow merge by aligning structure again

Closes #9413

2 years agodocs: the websockets symbols are added in 7.86.0
Daniel Stenberg [Fri, 9 Sep 2022 13:36:06 +0000 (15:36 +0200)] 
docs: the websockets symbols are added in 7.86.0

Nothing else

Closes #9459

2 years agotests/libtest/Makefile.inc: fixup merge conflict mistake
Daniel Stenberg [Fri, 9 Sep 2022 13:13:07 +0000 (15:13 +0200)] 
tests/libtest/Makefile.inc: fixup merge conflict mistake

2 years agoEXPERIMENTAL.md: add WebSockets
Daniel Stenberg [Fri, 9 Sep 2022 13:11:15 +0000 (15:11 +0200)] 
EXPERIMENTAL.md: add WebSockets

2 years agoappveyor: enable websockets
Daniel Stenberg [Fri, 9 Sep 2022 13:11:15 +0000 (15:11 +0200)] 
appveyor: enable websockets

2 years agocirrus: enable websockets in the windows builds
Daniel Stenberg [Fri, 9 Sep 2022 13:11:14 +0000 (15:11 +0200)] 
cirrus: enable websockets in the windows builds

2 years agoGHA: add websockets to macos, openssl3 and hyper builds
Daniel Stenberg [Fri, 9 Sep 2022 13:11:14 +0000 (15:11 +0200)] 
GHA: add websockets to macos, openssl3 and hyper builds

2 years agotests: add websockets tests
Daniel Stenberg [Fri, 9 Sep 2022 13:11:14 +0000 (15:11 +0200)] 
tests: add websockets tests

 - 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

2 years agocurl_ws_meta: initial implementation
Daniel Stenberg [Fri, 9 Sep 2022 13:11:14 +0000 (15:11 +0200)] 
curl_ws_meta: initial implementation

2 years agocurl_ws_meta.3: added docs
Daniel Stenberg [Fri, 9 Sep 2022 13:11:14 +0000 (15:11 +0200)] 
curl_ws_meta.3: added docs

2 years agows: initial websockets support
Daniel Stenberg [Fri, 9 Sep 2022 13:11:14 +0000 (15:11 +0200)] 
ws: initial websockets support

Closes #8995

2 years agoversion: add ws + wss
Daniel Stenberg [Fri, 9 Sep 2022 13:11:14 +0000 (15:11 +0200)] 
version: add ws + wss

2 years agolibtest/lib1560: test basic websocket URL parsing
Daniel Stenberg [Fri, 9 Sep 2022 13:11:14 +0000 (15:11 +0200)] 
libtest/lib1560: test basic websocket URL parsing

2 years agoconfigure: add --enable-websockets
Daniel Stenberg [Fri, 9 Sep 2022 13:11:13 +0000 (15:11 +0200)] 
configure: add --enable-websockets

2 years agodocs/WebSockets.md: docs
Daniel Stenberg [Fri, 9 Sep 2022 13:11:13 +0000 (15:11 +0200)] 
docs/WebSockets.md: docs

2 years agotest415: verify Content-Length parser with control code + negative value
Daniel Stenberg [Fri, 9 Sep 2022 11:01:46 +0000 (13:01 +0200)] 
test415: verify Content-Length parser with control code + negative value

2 years agostrtoofft: after space, there cannot be a control code
Daniel Stenberg [Fri, 9 Sep 2022 10:46:01 +0000 (12:46 +0200)] 
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 6f9fb7ec2d7cb389a0da5

Detected by OSS-fuzz
Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=51140
Assisted-by: Max Dymond
Closes #9458

2 years agoheaders: reset the requests counter at transfer start
Daniel Stenberg [Wed, 7 Sep 2022 07:51:51 +0000 (09:51 +0200)] 
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

2 years agoheader: define public API functions as extern c
Jay Satiro [Wed, 7 Sep 2022 07:07:28 +0000 (03:07 -0400)] 
header: define public API functions as extern c

Prior to this change linker errors would occur if curl_easy_header or
curl_easy_nextheader was called from a C++ unit.

Bug: https://github.com/curl/curl/issues/9424#issuecomment-1238818007
Reported-by: Andrew Lambert
Closes https://github.com/curl/curl/pull/9446

2 years agohttp2: make nghttp2 less picky about field whitespace
Daniel Stenberg [Wed, 7 Sep 2022 13:41:03 +0000 (15:41 +0200)] 
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

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 7 Sep 2022 12:18:28 +0000 (14:18 +0200)] 
RELEASE-NOTES: synced

And bump to 7.86.0 for the pending next release

2 years agoftp: ignore a 550 response to MDTM
Michael Heimpold [Wed, 24 Aug 2022 16:58:02 +0000 (18:58 +0200)] 
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

2 years agourlapi: leaner with fewer allocs
Daniel Stenberg [Thu, 1 Sep 2022 08:16:24 +0000 (10:16 +0200)] 
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

2 years agosetup-win32: no longer define UNICODE/_UNICODE implicitly
Jay Satiro [Mon, 29 Aug 2022 07:59:23 +0000 (03:59 -0400)] 
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

2 years agotests: fix tag syntax errors in test files
Dan Fandrich [Tue, 6 Sep 2022 18:27:06 +0000 (11:27 -0700)] 
tests: fix tag syntax errors in test files

2 years agolib: add required Win32 setup definitions in setup-win32.h
Marc Hoersken [Fri, 26 Aug 2022 19:16:47 +0000 (21:16 +0200)] 
lib: add required Win32 setup definitions in setup-win32.h

Assisted-by: Jay Satiro
Reviewed-by: Marcel Raad
Follow up to #9312
Closes #9375

2 years agopingpong: extend the response reading error with errno
Daniel Stenberg [Tue, 6 Sep 2022 13:51:13 +0000 (15:51 +0200)] 
pingpong: extend the response reading error with errno

To help diagnosing the cause of the problem.

See #9380
Closes #9443

2 years agocurl-compilers.m4: use -O2 as default optimize for clang
Daniel Stenberg [Tue, 6 Sep 2022 14:39:42 +0000 (16:39 +0200)] 
curl-compilers.m4: use -O2 as default optimize for clang

Not -Os

Closes #9444

2 years agotool_operate: fix msnprintfing the error message
Daniel Stenberg [Tue, 6 Sep 2022 09:05:47 +0000 (11:05 +0200)] 
tool_operate: fix msnprintfing the error message

Follow-up to 7be53774c41c59b47075fba

Coverity CID 1513717 pointed out that we cannot use sizeof() on the
error buffer anymore.

Closes #9440

2 years agocurl_ctype: add space around <= operator in ISSPACE macro
Emanuele Torre [Tue, 6 Sep 2022 10:32:49 +0000 (12:32 +0200)] 
curl_ctype: add space around <= operator in ISSPACE macro

Follow-up to f65f750

Closes #9441

2 years agoCURLOPT_PROXY_SSLCERT_BLOB.3: this is for HTTPS proxies
Daniel Stenberg [Tue, 6 Sep 2022 06:27:50 +0000 (08:27 +0200)] 
CURLOPT_PROXY_SSLCERT_BLOB.3: this is for HTTPS proxies

The 'protocols' listed were previously wrong.

Reported-by: ProceduralMan on github
Fixes #9434
Closes #9435

2 years agocurl_ctype: convert to macros-only
Daniel Stenberg [Mon, 5 Sep 2022 10:15:21 +0000 (12:15 +0200)] 
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

2 years agomisc: ISSPACE() => ISBLANK()
Daniel Stenberg [Mon, 5 Sep 2022 21:21:15 +0000 (23:21 +0200)] 
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

2 years agoctype: remove all use of <ctype.h>, use our own versions
Daniel Stenberg [Mon, 5 Sep 2022 22:17:36 +0000 (00:17 +0200)] 
ctype: remove all use of <ctype.h>, use our own versions

Except in the test servers.

Closes #9433

2 years agocmake: skip superfluous hex2dec conversion using math expr
Marc Hoersken [Thu, 1 Sep 2022 17:50:29 +0000 (19:50 +0200)] 
cmake: skip superfluous hex2dec conversion using math expr

CMake seems to be able to compare two hex values just fine.
Also make sure CURL_TARGET_WINDOWS_VERSION is respected.

Assisted-by: Marcel Raad
Reviewed-by: Viktor Szakats
Reported-by: Keitagit-kun on github
Follow up to #9312
Fixes #9406
Closes #9411

2 years agocurl_easy_pause.3: unpausing is as fast as possible
Daniel Stenberg [Mon, 5 Sep 2022 13:52:28 +0000 (15:52 +0200)] 
curl_easy_pause.3: unpausing is as fast as possible

Reported-by: ssdbest on github
Fixes #9410
Closes #9430