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

Re: [Libevent-users] Bug: evhttp_make_request(), introduced in git commit 0d6622e



On Tue, May 10, 2011 at 2:46 AM, Kevin Ko <kevin.s.ko@xxxxxxxxx> wrote:
> Hi,
>
> Patch in question:
>  - Fix the case when failed evhttp_make_request() leaved request in the queue.
>  - http://levent.git.sourceforge.net/git/gitweb.cgi?p=levent/libevent;a=commit;h=0d6622e
>
> The above patch introduces a failing assertion in
> evhttp_connection_fail().  This happens because the patch defers the
> assignment of the outstanding request to the evcon->requests list,
> while evhttp_connection_fail() assumes that the request lies in the
> list.
>
> One scenario in which this can happen is when the request list is
> empty and a connection is made to an unreachable host.  The assertion
> will then fail after bufferevent_socket_connect() errors out (with
> ENETUNREACH in my case).
>
> At the end of this message, I've attached a gdb backtrace of an
> instance with the failed assertion and a patch that should revise the
> original solution to have an effect only when
> evhttp_connection_connect() fails.

I ... think this is right.  I'm going to check it in, but I want to
echo Cliff's request for a test case to exercise the behavior here and
make sure that it's actually doing the right thing.
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.