mirror of
https://github.com/curl/curl.git
synced 2026-04-14 00:51:42 +08:00
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
|
||
|---|---|---|
| .. | ||
| .checksrc | ||
| .gitignore | ||
| base64.pl | ||
| CMakeLists.txt | ||
| disabled.c | ||
| getpart.c | ||
| getpart.h | ||
| Makefile.am | ||
| Makefile.inc | ||
| mqttd.c | ||
| resolve.c | ||
| rtspd.c | ||
| server_setup.h | ||
| server_sockaddr.h | ||
| sockfilt.c | ||
| socksd.c | ||
| sws.c | ||
| tftp.h | ||
| tftpd.c | ||
| util.c | ||
| util.h | ||