tool_doswin: fix to use curl socket functions#18633
Closed
vszakats wants to merge 8 commits intocurl:masterfrom
Closed
tool_doswin: fix to use curl socket functions#18633vszakats wants to merge 8 commits intocurl:masterfrom
vszakats wants to merge 8 commits intocurl:masterfrom
Conversation
Member
Author
https://github.com/curl/curl/actions/runs/17879348006/job/50845021761?pr=18633 mingw, AM x86_64 c-ares U (debug-enabled) and passes both in edit: → it appears that this error is specific to c-ares-enabled builds: |
d555df5 to
b3e6958
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace
WSASocketW()withCURL_SOCKET(). Also replace a callto
socketclose()withsclose(). According to a comment,socketclose()was chosen to silence test 1498 (and 2300) reportingMEMORY FAILURE. These reports were accurate, and were caused bycalling
WSASocketW()instead ofsocket()(nowCURL_SOCKET()).This also fixes the curl
sclose()call on an error branch, which isnow 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, matchingthe replaced
WSASocketW()call:https://learn.microsoft.com/windows/win32/api/winsock2/nf-winsock2-socket#remarks
Also:
WSASocket*()functions.SOCKERRNOinstead ofGetLastError()for socket calls,to match the rest of the codebase.
Follow-up to 9a26633 #17572
The comment says that
closesocket()is needed (insead ofsclose()to avoid failing 1498.However, in the cleanup section is calls
sclose().I found it interesting that the unpaired socket open/close call only tripped
test 1498 and 2300 in c-ares-enabled builds.