12 #if _SQUID_WINDOWS_ || _SQUID_MINGW_
14 #include <unordered_map>
17 SetErrnoFromWsaError()
20 static const auto *CodeMap =
new std::unordered_map<int, int> {
21 { WSAECONNABORTED, ECONNABORTED },
22 { WSAEINPROGRESS, EINPROGRESS },
23 { WSAEAFNOSUPPORT, EAFNOSUPPORT },
24 { WSAEINVAL, EINVAL },
25 { WSAEISCONN, EISCONN },
26 { WSAEWOULDBLOCK, EWOULDBLOCK },
28 { WSAEALREADY, EALREADY },
31 { WSAEMFILE, EMFILE },
33 { WSAECONNRESET, ECONNRESET }
36 const auto wsa = WSAGetLastError();
37 const auto itr = CodeMap->find(wsa);
38 if (itr != CodeMap->cend())