summaryrefslogtreecommitdiff
path: root/evrpc.c
diff options
context:
space:
mode:
authorConstantine Verutin <cverutin@gmail.com>2011-02-22 17:52:50 -0500
committerNick Mathewson <nickm@torproject.org>2011-02-22 17:52:50 -0500
commit6350e6c4c5fab254d67e86e85a5ade70e2e32c36 (patch)
tree9e2b9aac6e345a581055671baef3a3e37e419175 /evrpc.c
parenta11c30b5feda088ad79b5fb71370616a7c3a4f30 (diff)
downloadlibevent-6350e6c4c5fab254d67e86e85a5ade70e2e32c36.tar.gz
Add new evhttp_{connection_}set_timeout_tv() functions to set finger-grained http timeouts
Diffstat (limited to 'evrpc.c')
-rw-r--r--evrpc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/evrpc.c b/evrpc.c
index 22dd57ac..694666c9 100644
--- a/evrpc.c
+++ b/evrpc.c
@@ -585,8 +585,8 @@ 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 (connection->timeout == -1)
- connection->timeout = pool->timeout;
+ if (!evutil_timerisset(&connection->timeout))
+ evhttp_connection_set_timeout(connection, pool->timeout);
/*
* if we have any requests pending, schedule them with the new
@@ -613,7 +613,7 @@ evrpc_pool_set_timeout(struct evrpc_pool *pool, int timeout_in_secs)
{
struct evhttp_connection *evcon;
TAILQ_FOREACH(evcon, &pool->connections, next) {
- evcon->timeout = timeout_in_secs;
+ evhttp_connection_set_timeout(evcon, timeout_in_secs);
}
pool->timeout = timeout_in_secs;
}