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

[Libevent-users] Re: [PATCH] http: on connection reset, detach the closed fd from the bufferevent



[-cc: my personal email, added by mistake]

Ping. We've been seeing good results with this.

On Wed, Dec 19, 2012 at 11:05 AM, Catalin Patulea <catalinp@xxxxxxxxxx> wrote:
> From: Catalin Patulea <cat@xxxxxxxxxxxxxx>
>
> I'm curious what people think of a patch like this.. I've been seeing fds getting reused and bufferevents adding/removing events on the underlying evmap when they shouldn't be touching that fd anymore.
>
> This patch seems to fix it but I haven't fully considered the reprecussions of doing this.
>
> Any first impressions on this?
>
> Thanks,
> Catalin
> ---
>  http.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/http.c b/http.c
> index 22a46a9..8d871fd 100644
> --- a/http.c
> +++ b/http.c
> @@ -1240,6 +1240,7 @@ evhttp_connection_reset_(struct evhttp_connection *evcon)
>         tmp = bufferevent_get_input(evcon->bufev);
>         evbuffer_drain(tmp, evbuffer_get_length(tmp));
>
> +       bufferevent_setfd(evcon->bufev, -1);
>         evcon->state = EVCON_DISCONNECTED;
>  }
>
> --
> 1.7.7.3
>
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.