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

Re: [Libevent-users] http client code memory leak



Hi

On Fri, Mar 20, 2015 at 2:55 PM, Nate Rosenblum <nater@xxxxxxxxxxxxxx> wrote:
> evhttp_request_get_connection is intended for the server side; for
> client side requests generated by evhttp_request_new there is no

I take that back; from code reading it does seem like you should be
able to extract it via evhttp_request_get_connection.

Well, that is what I expected as well. I tried to useÂevhttp_request_get_connection() in the client callback but *always* returns NULL.

I also expected thatÂevhttp_request_get_connection() works with client requests but it does not free evcon memory completely....

My apologies,
though I think that in your case passing via the ctx parameter would
be fine.

Passing connection via context parameter and freeing it inside the callback makes valgrind happy! Thanks.