summaryrefslogtreecommitdiff
path: root/evrpc.c
diff options
context:
space:
mode:
authorAzat Khuzhin <azat@libevent.org>2019-03-04 06:53:42 +0300
committerAzat Khuzhin <azat@libevent.org>2019-03-05 00:33:46 +0300
commit5ee507c889b019e9296f48e4f133c439e3040c9e (patch)
treed48a22fa5a3a78c051f25e0221aab9caad0d0831 /evrpc.c
parent62df1301ca943011fa9c398323049bcddca2694d (diff)
downloadlibevent-5ee507c889b019e9296f48e4f133c439e3040c9e.tar.gz
http: implement separate timeouts for read/write/connect phase
This patch allows to change timeout for next events read/write/connect separatelly, using new API: - client: evhttp_connection_set_connect_timeout_tv() -- for connect evhttp_connection_set_read_timeout_tv() -- for read evhttp_connection_set_write_timeout_tv() -- for write - server: evhttp_set_read_timeout_tv() -- for read evhttp_set_write_timeout_tv() -- for write It also changes a logic a little, before there was next fallbacks which does not handled in new API: - HTTP_CONNECT_TIMEOUT - HTTP_WRITE_TIMEOUT - HTTP_READ_TIMEOUT And introduce another internal flag (EVHTTP_CON_TIMEOUT_ADJUSTED) that will be used in evrpc, which adjust evhttp_connection timeout only if it is not default. Fixes: #692 Fixes: #715
Diffstat (limited to 'evrpc.c')
-rw-r--r--evrpc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/evrpc.c b/evrpc.c
index 68fa1b90..3b5260fc 100644
--- a/evrpc.c
+++ b/evrpc.c
@@ -593,7 +593,7 @@ evrpc_pool_add_connection(struct evrpc_pool *pool,
* unless a timeout was specifically set for a connection,
* the connection inherits the timeout from the pool.
*/
- if (!evutil_timerisset(&connection->timeout))
+ if (!(connection->flags & EVHTTP_CON_TIMEOUT_ADJUSTED))
evhttp_connection_set_timeout(connection, pool->timeout);
/*