[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [Libevent-users] https-client sample problem on libevent 2.1.7
On Fri, Nov 18, 2016 at 10:51 PM, Sanjiv <sanjiv.raj@xxxxxxxxx> wrote:
> My observations are for 2.1.5-beta (and earlier) and not for 2.1.7-rc
>
> 1) Once the connection has been closed, you need to use a new
> evhttp_connection object. There is no workaround for this which I'm aware of
> and also holds true even for the case described by Azat where the remote
> server responds with a "Connection:close"
> 2) If you're setting a timeout, it is advisable to set it on the
> evhttp_connection object just before/after evhttp_make_request() and then
> reset the timeout to a higher value in the response callback. This is the
> workaround I adopted to achieve persistent https connections.
> i.e
> evhttp_connection_set_timeout_tv(connection, short_request_timeout);
> evhttp_make_request(connection, request, EVHTTP_REQ_POST, uri);
>
> in response callback
> evhttp_connection_set_timeout_tv(connection, keep-alive-duration);
>
> If you don't reset the timeout to a higher value, the connection will be
> closed when the request timeout expires irrespective of whether the request
> succeeded or not. I haven't dug deep into the bufferevent_ssl layer to
> determine why this is happening yet.
Hi,
So this is for https only, i.e. http works fine?
Can you provide simple reproducer? Or/and check with 2.1.7?
Azat.
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.