Re: [Libevent-users] evhttp: Abort after receiving a certain number of bytes

2011-02-21 Thread Constantine Verutin
Hi, > > I just tested and the following change seems to work fine: > > if (req->body_size + req->ntoread > req->evcon->max_body_size) { > This is wrong case of chunked response and inaccurate when ntoread < 0. I'd suggest to add something like if (!req->chunked && req->ntoread > 0 && req->ntor

Re: [Libevent-users] evhttp_accept_socket_with_handle() implies LEV_CLOSE_ON_FREE on underlying evconnlistener

2011-02-15 Thread Constantine Verutin
Hi Nick, On Fri, Feb 11, 2011 at 9:13 PM, Nick Mathewson wrote: > Well, something's certainly wrong here. I'm not sure whether to call > it a bug in the documentation or a bug in the code. My inclination is > to call the code correct and change the doxygen comment from > > "This function does

[Libevent-users] evhttp_accept_socket_with_handle() implies LEV_CLOSE_ON_FREE on underlying evconnlistener

2011-02-10 Thread Constantine Verutin
Hi guys, I noticed that evhttp_accept_socket_with_handle() sets the LEV_OPT_CLOSE_ON_FREE flag on underlying evconnlistener, and in this case calling evhttp_del_accept_socket() later causes socket fd to be freed(while documentation explicitly says this function does not close). Is this a bug? Or I

[Libevent-users] [patch] Add callback for handling incoming connection errors

2009-12-13 Thread Constantine Verutin
Hi, Currently, there is no way to inform user about some type of http connection errors(like network timeout). The gencb will be still called if invalid http request was encountered, but the error kind is not exposed. Is some situatons, we need all this info(like for logging purposes). So, here's