comparing to raw EWOULDBLOCK may not be working as expected on Windows.
Based on this:
https://doc.rust-lang.org/std/io/struct.Error.html#method.last_os_error
Rust doesn't seem to be returning the socket error on Windows, but
a GetLastError() which does not return EWOULDBLOCK or SOCKEWOULDBLOCK.
```
/Users/runner/work/curl/curl/lib/socketpair.c:329:15: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
if((err == SOCKEWOULDBLOCK)
~~~~^~~~~~~~~~~~~~~~~~
/Users/runner/work/curl/curl/lib/socketpair.c:329:15: note: remove extraneous parentheses around the comparison to silence this warning
if((err == SOCKEWOULDBLOCK)
~ ^ ~
/Users/runner/work/curl/curl/lib/socketpair.c:329:15: note: use '=' to turn this equality comparison into an assignment
if((err == SOCKEWOULDBLOCK)
^~
=
/Users/runner/work/curl/curl/lib/socketpair.c:359:21: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
if((SOCKERRNO == SOCKEWOULDBLOCK)
~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/Users/runner/work/curl/curl/lib/socketpair.c:359:21: note: remove extraneous parentheses around the comparison to silence this warning
if((SOCKERRNO == SOCKEWOULDBLOCK)
~ ^ ~
/Users/runner/work/curl/curl/lib/socketpair.c:359:21: note: use '=' to turn this equality comparison into an assignment
if((SOCKERRNO == SOCKEWOULDBLOCK)
^~
=
2 errors generated.
```
https://github.com/curl/curl/actions/runs/27107980068/job/80000462156?pr=21893
This code lacks tests, though we agreed it looks plausible enough to
merge it based on surrounding code. Even though this line has been
present for a long time. If you use this code, please report any results
or issues.
Reported by GitHub Code Quality
Follow-up to ae1912cb0dCloses#21979
clib2 defines __NEWLIB__ after its system headers are included, but it
does not provide explicit_bzero().
curl therefore selects the explicit_bzero() path and fails to build with
m68k-amigaos-gcc:
```
../lib/curl_setup.h:1650:35: error: implicit declaration of function 'explicit_bzero' [-Werror=implicit-function-declaration]
1650 | #define curlx_memzero(buf, size) explicit_bzero(buf, size)
| ^~~~~~~~~~~~~~
curlx/strdup.c:115:5: note: in expansion of macro 'curlx_memzero'
115 | curlx_memzero(buf, size);
| ^~~~~~~~~~~~~
```
Excluding __CLIB2__ from the generic __NEWLIB__ branch makes curl use
its existing portable curlx_memzero() fallback. The full AmigaOS build
then completes successfully.
I've tested the following on Amiga OS 3.2.3 with this patch and latest
build.
- HTTP and HTTPS transfers
- AmiSSL certificate handling
- redirects
- downloads and file output
- timeout handling with the expected exit code 28
- repeated execution with clean exits
- no crashes or regressions observed
Follow-up to 066478f634#21598Closes#21989
This is an implementation of a CURLOPT_WRITEFUNCTION callback that just
throws away the content and returns success. Saves us from having to
reimplement it many times in different tests.
Closes#21971
... even though they use the curl option "--resolve".
This makes it more convenient to choose or skip the tests.
For example Privoxy's cts test framework relies on the "--resolve"
keyword when executing the "upstream-tests" scenario to skip curl
tests that aren't expected to work when the requests are made through
Privoxy. While some of the modified tests are already skipped for
other reasons through other means when testing Privoxy, it's good to
be consistent.
Closes#21930
It seems that the usual '#ifdef USE_IPV6' guards have been overlooked in
lib/asyn-thrdd.c.
This commit makes sure that the code compiles if IPv6 is not available.
Closes#21881
It seems the commit hash behind the v6.1 tag is changing, and the latest
version is actually v6.0.2, which is currently mapped to the v6.1 hash.
Fixing:
```
warning[ref-version-mismatch]: action's hash pin has mismatched or missing version comment
--> .github/workflows/windows.yml:98:87
|
98 | - uses: cygwin/cygwin-install-action@711d29f3da # v6.1
| --------------------------------------------------------------------------- ^^^^ points to commit 3f0a3f9f988f
| |
| is pointed to by tag v6.0.1
```
Ref: https://github.com/cygwin/cygwin-install-action/issues/59Closes#21974
Even when two 'chunked' are listed and neither is the last encoding the
transfer is rejected.
Verified by test 1722 and 1723
Reported-by: violet12331 on hackerone
Closes#21966