libevent/libevent — pull request #29 by ppelleti (2012-11-14 06:01:39+00:00)
Title: preserve errno in evhttp_connection_fail_ for inspection by the callback

This addresses the issue that I brought up on the mailing list:

http://archives.seul.org/libevent/users/Nov-2012/msg00014.html

In evhttp_connection_fail_, the call to evhttp_connection_reset_ is overwriting errno, so that when the user's callback gets called at the end of evhttp_connection_fail_, it no longer has access to the original errno that caused the failure.

So, it seems to me it would be helpful if evhttp_connection_fail_ saves and restores errno. That's what this commit does.

Although I fear I still may be missing something about the big picture of how error handling in evhttp is supposed to work.