[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] winsock error strings: evutil_socket_error_to_string versus FormatMessage



On Thu, Feb 7, 2013 at 8:38 PM, Patrick Pelletier <ppelletier@xxxxxxxxxx> wrote:
> I noticed the following comment in evutil_socket_error_to_string in
> evutil.c:
>
> /* XXXX Is there really no built-in function to do this? */
>
> The answer is yes, the built-in function FormatMessage will do this for you.
> I'm happy to submit a patch that will change evutil_socket_error_to_string
> to call FormatMessage, if you like.  The only potential downside is that the
> messages evutil_socket_error_to_string currently returns are short and
> sweet, while the messages from FormatMessage are quite a bit longer.  Not
> sure if that's a disadvantage or not.

Hm.  I hadn't known that FormatMessage worked on winsock errors too.
Interesting!

Sure, I'll take a patch for 2.1.  We use the system error messages
elsewhere regardless of verbosity; might as well do that here too.

-- 
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.