mirror of
https://github.com/curl/curl.git
synced 2026-07-12 17:57:18 +03:00
tool_doswin: fix to use curl socket functions
Replace `WSASocketW()` with `CURL_SOCKET()`. Also replace a call
to `socketclose()` with `sclose()`. According to a comment,
`socketclose()` was chosen to silence test 1498 (and 2300) reporting
`MEMORY FAILURE`. These reports were accurate, and were caused by
calling `WSASocketW()` instead of `socket()` (now `CURL_SOCKET()`).
This also fixes the curl `sclose()` call on an error branch, which is
now correctly paired with a curl socket open. The mismatched open/close
calls caused an issue in TrackMemory-enabled (aka `CURLDEBUG`) builds.
Docs confirm that `socket()` is defaulting to overlapped I/O, matching
the replaced `WSASocketW()` call:
https://learn.microsoft.com/windows/win32/api/winsock2/nf-winsock2-socket#remarks
Also:
- checksrc: ban `WSASocket*()` functions.
- report `SOCKERRNO` instead of `GetLastError()` for socket calls,
to match the rest of the codebase.
Follow-up to 9a2663322c #17572
Closes #18633
This commit is contained in:
parent
1f0f0bdb19
commit
c9eff26c17
2 changed files with 14 additions and 13 deletions
|
|
@ -74,6 +74,9 @@ my %banfunc = (
|
|||
"LoadLibraryEx" => 1,
|
||||
"LoadLibraryExA" => 1,
|
||||
"LoadLibraryExW" => 1,
|
||||
"WSASocket" => 1,
|
||||
"WSASocketA" => 1,
|
||||
"WSASocketW" => 1,
|
||||
"_waccess" => 1,
|
||||
"_access" => 1,
|
||||
"access" => 1,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue