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

2011-02-21 Thread Nick Mathewson
On Mon, Feb 21, 2011 at 10:26 AM, Constantine Verutin wrote: > 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've added a fix

[Libevent-users] Memory won't be freed in SSL connection.

2011-02-21 Thread 林宇舜 Yu-Shun Lin
Hi all, I construct SSL connection by using bev1 = bufferevent_socket_new(... fd ..., BEV_OPT_CLOSE_ON_FREE) bev2 = bufferevent_openssl_filter_new(... bev ..., BEV_OPT_CLOSE_ON_FREE) bufferevent_setcb(bev2, read_cb, ..., event_cb...) And close connection by bufferevent_free(bev) in event cal

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