{"author":"Viktor Szakats","author_email":"commit@vsz.me","author_time":1741194397,"commit_time":1741288165,"committer":"Viktor Szakats","committer_email":"commit@vsz.me","hash":"8537a5b0bcf4565551774c2b2375c49767e405a7","message":"windows: do not use winsock2 `inet_ntop()`/`inet_pton()`\n\nDisable these winsock2 functions on Windows to use the curl wrappers\nand preserve `WSAGetLastError()` aka `SOCKERRNO` error codes.\n\ncurl sources uses `inet_pton()` and `inet_ntop()` via its own `Curl_`\nprefixed wrappers. These wrappers promise to not overwrite\n`WSAGetLastError()` aka `SOCKERRNO` error codes when calling them.\nBut, for Windows builds with these built-in winsock2 functions detected\n(meaning all supported Windows versions, except Windows CE),\nthe wrappers were 1-to-1 mapped to the winsock2 functions, which broke\nthis promise.\n\nhttps://github.com/curl/curl/blob/b06c12b7248592cf001e621d7cd8dc78a827212b/lib/inet_ntop.c#L188-L190\nhttps://github.com/curl/curl/blob/b06c12b7248592cf001e621d7cd8dc78a827212b/lib/inet_pton.c#L66-L70\n\nThese promises are old (a1d598399146984c99baa46db148e87c75261033) and\nmay not be valid anymore. In this case, the callers would have to be\nupdated to use `SOCKERRNO` to retrieve any error, instead of using\n`errno` as they do now.\n\nhttps://learn.microsoft.com/windows/win32/api/ws2tcpip/nf-ws2tcpip-inet_ntop\nhttps://learn.microsoft.com/windows/win32/api/ws2tcpip/nf-ws2tcpip-inet_pton\n\nCloses #16577\n","parents":["ff86c1951be0d55caabd7a802b7b7de24b8f56ba"],"tree_hash":"496b01eee1fd893c8afd14e3ca968ee378285684"}