Jay Satiro [Tue, 21 Feb 2023 08:38:37 +0000 (03:38 -0500)]
winbuild: fix makefile clean
- Fix and move 'clean' code that removes the output and obj directories
trees from MakefileBuild.vc to Makefile.vc.
Prior to this change the 'clean' code did not work right because the
variables containing the directory names were not fully initialized and
the rmdir syntax was sometimes incorrect (typos). DIRDIST for example
was set to ..\builds\ and not ..\builds\$(CONFIG_NAME_LIB)\ so it would
remove the former and not the latter. If WITH_PREFIX was set then that
directory was removed instead.
Also, DIRDIST (the output directory) even if initialized should not be
removed by MakefileBuild.vc because by that time it could be set to a
user directory that may contain other files if WITH_PREFIX is set (eg we
don't want rmdir /s /q C:\usr\local). Therefore we remove from
Makefile.vc before any of that happens. I added a comment in both
makefiles explaining this.
Since cbf57176 the Cirrus CI 'macOS arm64 SecureTransport http2' has
been failing due to c89 warnings mixed code/declaration. That commit is
not the cause so I assume something has changed in the CI outside of our
configuration. Anyway, we don't mix code/declaration so this is the fix
for that.
Stefan Eissing [Thu, 9 Feb 2023 15:07:34 +0000 (16:07 +0100)]
CURLOPT_PIPEWAIT: allow waited reuse also for subsequent connections
As tested in test_02_07, when firing off 200 urls with --parallel, 199
wait for the first connection to be established. if that is multiuse,
urls are added up to its capacity.
The first url over capacity opens another connection. But subsequent
urls found the same situation and open a connection too. They should
have waited for the second connection to actually connect and make its
capacity known.
This change fixes that by
- setting `connkeep()` early in the HTTP setup handler. as otherwise
a new connection is marked as closeit by default and not considered
for multiuse at all
- checking the "connected" status for a candidate always and continuing
to PIPEWAIT if no alternative is found.
pytest:
- removed "skip" from test_02_07
- added test_02_07b to check that http/1.1 continues to work as before
Daniel Stenberg [Fri, 17 Feb 2023 09:04:31 +0000 (10:04 +0100)]
parsedate: parse strings without using sscanf()
- sscanf is slow and complex, avoid it
- give up already if the string is 12 bytes or longer as no valid string
can be that long
- this can now be done without copy
Matt Jolly [Mon, 20 Feb 2023 08:29:03 +0000 (19:29 +1100)]
tests: HTTP server fixups
- httpserver.pl -> http-server.pl for consistency
- add http3-server.pl to EXTRA_DIST; alphabetise for maintainability
- nghttpx proxy invocation scripts should not use getcwd
Jay Satiro [Sat, 18 Feb 2023 21:06:11 +0000 (16:06 -0500)]
tool_operate: fix scanbuild compiler warning
Prior to this change Azure CI scanbuild warned of a potential NULL
pointer string passed to strtol when CURLDEBUG enabled, even though the
way the code was written it wouldn't have happened.
OpenSSL 3 has deprecated some of the functions libcurl uses such as
those with DES, MD5 and ENGINE prefix. We don't have replacements for
those functions so the warnings were disabled in autotools and cmake
builds, but still showed in other builds.
Jay Satiro [Fri, 17 Feb 2023 08:26:07 +0000 (03:26 -0500)]
build-openssl.bat: keep OpenSSL 3 engine binaries
Prior to this change copying the OpenSSL 3 engine binaries failed
because 'engines-1_1' (OpenSSL 1.1.x folder name) was erroneously used
instead of 'engines-3'. The OpenSSL 3 builds would complete successfully
but without the engine binaries.
Daniel Stenberg [Thu, 16 Feb 2023 23:16:39 +0000 (00:16 +0100)]
urlapi: do the port number extraction without using sscanf()
- sscanf() is rather complex and slow, strchr() much simpler
- the port number function does not need to fully verify the IPv6 address
anyway as it is done later in the hostname_check() function and doing
it twice is unnecessary.
Daniel Stenberg [Thu, 16 Feb 2023 15:34:36 +0000 (16:34 +0100)]
curl: make --silent work stand-alone
- renamed the struct field to 'silent' to match the cmdline option
- make --show-error toggle independently of --silent
- make --silent independent of ->noprogress as well
By doing this, the three options --silent, --no-progress-meter and
--show-error should work independently of each other and also work with
and without '--no-' prefix as documented.
Reported-by: u20221022 on github
Fixes #10535
Closes #10536
Daniel Stenberg [Thu, 16 Feb 2023 22:52:22 +0000 (23:52 +0100)]
socks: allow using DoH to resolve host names
For SOCKS modes where a local host resolve is done.
It was previously disabled in 12d655d4561, but a few local tests seem to
indicate that it works fine. Works now because of the SOCKS refactor of 4a4b63daaa01ef59 that made it non-blocking.
Reported-by: roughtex on github
Fixes #10537
Closes #10540
Stefan Eissing [Thu, 16 Feb 2023 13:09:16 +0000 (14:09 +0100)]
test: add test for HTTP/2 corruption as reported in #10525
- adding test_02_20 for reproducing the situation
- using recently released mod_h2 Apache module
- skipping test if an older version is installed
- adding installation of current mod_h2 to github pytest workflow
This reproduces the error reliable (for me) on the lib/http2.c version
of curl 7.88.0. And passes with the recent curl master.
Stefan Eissing [Wed, 15 Feb 2023 09:31:52 +0000 (10:31 +0100)]
connnect: fix timeout handling to use full duration
- connect timeout was used at half the configured value, if the
destination had 1 ip version 4 and other version 6 addresses
(or the other way around)
- extended test2600 to reproduce these cases
Reported-by: Michael Kaufmann
Fixes #10514
Closes #10517
Harry Sintonen [Thu, 16 Feb 2023 04:26:26 +0000 (06:26 +0200)]
http2: set drain on stream end
Ensure that on_frame_recv() stream end will trigger a read if there is
pending data. Without this it could happen that the pending data is
never consumed.
This combined with https://github.com/curl/curl/pull/10529 should fix
https://github.com/curl/curl/issues/10525
Stefan Eissing [Wed, 15 Feb 2023 21:11:13 +0000 (22:11 +0100)]
http2: buffer/pausedata and output flush fix.
* do not process pending input data when copying pausedata to the
caller
* return CURLE_AGAIN if the output buffer could not be completely
written out.
Dan Fandrich [Sat, 11 Feb 2023 19:05:42 +0000 (11:05 -0800)]
CONTRIBUTE: More formally specify the commit description
This codifies what people have actually used in git commits over the
past 6 years. I've left off some lesser-used headers that appear to
duplicate others and tried to describe a consistent use for several
others that were used more arbitrarily.
This makes it easier for new committers to find out the kinds of things
we want to acknowledge, makes it easier to perform statistical analysis
on commits, and opens the possibility of performing lint checks on
descriptions before submission.
Reviewed-by: Daniel Stenberg Reviewed-by: Jay Satiro
Closes #10478
Stefan Eissing [Mon, 13 Feb 2023 15:15:20 +0000 (16:15 +0100)]
openssl: test and fix for forward proxy handling (non-tunneling).
- adding pytest test_10 cases for proxy httpd setup tests
- fixing openssl bug in https: proxy hostname verification that
used the hostname of the request and not the proxy name.
Viktor Szakats [Sun, 12 Feb 2023 12:52:59 +0000 (12:52 +0000)]
windows: always use curl's basename() implementation
The `basename()` [1][2] implementation provided by mingw-w64 [3] makes
assumptions about input encoding and may break with non-ASCII strings.
`basename()` was auto-detected with CMake, autotools and since 68fa9bf3f5d7b4fcbb57619f70cb4aabb79a51f6 (2022-10-13), also in
`Makefile.mk` after syncing its behaviour with the mainline build
methods. A similar patch for curl-for-win broke official Windows
builds earlier, in release 7.83.1_4 (2022-06-15).
This patch forces all Windows builds to use curl's internal
`basename()` implementation to avoid such problems.