You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Ivan Zhakov <iv...@visualsvn.com> on 2011/03/18 16:38:31 UTC
[PATCH] Use apr_get_netos_error() to get error code from
getaddrinfo() function on Windows
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
Re: [PATCH] Use apr_get_netos_error() to get error code from
getaddrinfo() function on Windows
Posted by Jeff Trawick <tr...@gmail.com>.
On Fri, Mar 18, 2011 at 11:38 AM, Ivan Zhakov <iv...@visualsvn.com> wrote:
> 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.
> ]]]
>
I have a similar change to a less important network_io function. I'll
try to address both of these (using our existing patches) before apr
1.4.3 is rolled.
Re: [PATCH] Use apr_get_netos_error() to get error code from
getaddrinfo() function on Windows
Posted by Ivan Zhakov <iv...@visualsvn.com>.
On Mon, Mar 21, 2011 at 23:50, Jeff Trawick <tr...@gmail.com> wrote:
> On Fri, Mar 18, 2011 at 11:38 AM, Ivan Zhakov <iv...@visualsvn.com> wrote:
>> Hi,
>> Thanks in advance.
>
> 1.4.x branch: http://svn.apache.org/viewvc?rev=1083949&view=rev
>
> also committed to trunk and 1.5.x; thanks!
>
Thanks a lot!
--
Ivan Zhakov
Re: [PATCH] Use apr_get_netos_error() to get error code from
getaddrinfo() function on Windows
Posted by Jeff Trawick <tr...@gmail.com>.
On Fri, Mar 18, 2011 at 11:38 AM, Ivan Zhakov <iv...@visualsvn.com> wrote:
> 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.
1.4.x branch: http://svn.apache.org/viewvc?rev=1083949&view=rev
also committed to trunk and 1.5.x; thanks!