apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Zhakov <i...@visualsvn.com>
Subject [PATCH] Use apr_get_netos_error() to get error code from getaddrinfo() function on Windows
Date Fri, 18 Mar 2011 15:38:31 GMT
Hi,

APR doesn't use gai_strerror() on Windows (because it's not thread
safe) and apr_streror() return "APR does not understand this code"
message for failed apr_socket_addr_get() calls. It's not user
friendly.

Please find attached patch to use apr_get_netos_error()  to get error
code from getaddrinfo() function on Windows as documented in MSDN:
http://msdn.microsoft.com/en-us/library/ms738520%28v=vs.85%29.aspx
[[[
Use the gai_strerror function to print error messages based on the EAI
codes returned by the getaddrinfo function. The gai_strerror function
is provided for compliance with IETF recommendations, but it is not
thread safe. Therefore, use of traditional Windows Sockets functions
such as WSAGetLastError is recommended.
]]]

Thanks in advance.

-- 
Ivan Zhakov

Mime
View raw message