curl-curl/tests/server
Viktor Szakats abf80aae38
tests/server: fix to check against winsock2 error codes on Windows
Windows's winsock2 returns socket errors via `WSAGetLastError()` and
not via `errno` like most systems out there. This was covered by
switching to the `SOCKERRNO` curl macro earlier. But, on Windows the
returned socket error codes have different values than the standard
POSIX errno values. Existing code was using the POSIX values for all
these checks. Meaning they never actually matched on Windows.

This patch defines a set of `SOCKERRNO` constants that map to the
correct socket error values for Windows and other platforms.

The reverse issue exists in core curl code, which redefines POSIX errno
values to winsock2 ones, breaking non-socket uses on Windows.

Cherry-picked from #15000
Follow-up to adcfd4fb3e #16553
Bug: https://github.com/curl/curl/pull/16553#issuecomment-2704679377

Closes #16612
2025-03-08 01:53:48 +01:00
..
.checksrc checksrc: use 'banfunc' proper in more places 2025-01-13 09:10:58 +01:00
.gitignore build: drop unused getpart tool 2025-02-25 01:52:13 +01:00
base64.pl copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
CMakeLists.txt addrinfo: add curl macro to avoid redefining foreign symbols 2025-02-13 12:46:39 +01:00
disabled.c asyn-thread: use c-ares to resolve HTTPS RR 2025-01-25 23:46:14 +01:00
getpart.c build: set -O3 and tune WinCE in CI, fix getpart, vtls_scache fallouts 2025-02-26 21:23:11 +01:00
getpart.h copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
Makefile.am tests: fix enum/int confusion (Intel C), fix autotools CFLAGS for servers 2025-02-13 12:46:40 +01:00
Makefile.inc build: tidy-ups around inet_pton 2025-03-05 03:10:45 +01:00
mqttd.c tests/server: fix to check against winsock2 error codes on Windows 2025-03-08 01:53:48 +01:00
resolve.c tests/server: round of tidy-ups (part 2) 2025-03-07 13:48:07 +01:00
rtspd.c tests/server: round of tidy-ups (part 2) 2025-03-07 13:48:07 +01:00
server_setup.h copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
server_sockaddr.h build: prefer USE_IPV6 macro internally (was: ENABLE_IPV6) 2024-04-13 08:33:26 +00:00
sockfilt.c tests/server: fix to check against winsock2 error codes on Windows 2025-03-08 01:53:48 +01:00
socksd.c tests/server: fix to check against winsock2 error codes on Windows 2025-03-08 01:53:48 +01:00
sws.c tests/server: fix to check against winsock2 error codes on Windows 2025-03-08 01:53:48 +01:00
tftp.h tests: tidy up types in server code 2024-05-13 11:16:26 +02:00
tftpd.c tests/server: round of tidy-ups (part 2) 2025-03-07 13:48:07 +01:00
util.c tests/server: fix to check against winsock2 error codes on Windows 2025-03-08 01:53:48 +01:00
util.h tests/server: fix to check against winsock2 error codes on Windows 2025-03-08 01:53:48 +01:00