i_assert(conn->to_idle == NULL);
+ if (set->max_idle_time_msecs == 0)
+ return UINT_MAX;
+
count = array_count(&ppool->conns);
i_assert(count > 0);
max = http_client_peer_shared_max_connections(pshared);
timeout = http_client_connection_start_idle_timeout(conn);
- e_debug(conn->event,
- "Lost peer; going idle (timeout = %u msecs)",
- timeout);
+ if (timeout == UINT_MAX)
+ e_debug(conn->event, "Lost peer; going idle");
+ else {
+ e_debug(conn->event,
+ "Lost peer; going idle (timeout = %u msecs)",
+ timeout);
+ }
conn->idle = TRUE;
array_push_back(&ppool->idle_conns, &conn);
{
struct http_client_peer *peer;
struct http_client_peer_pool *ppool = conn->ppool;
- struct http_client *client;
- const struct http_client_settings *set;
peer = conn->peer;
if (peer == NULL) {
return;
}
- client = peer->client;
- set = &client->set;
-
if (conn->connected &&
array_is_created(&conn->request_wait_list) &&
array_count(&conn->request_wait_list) == 0 &&
- !conn->in_req_callback && conn->incoming_payload == NULL &&
- set->max_idle_time_msecs > 0) {
+ !conn->in_req_callback && conn->incoming_payload == NULL) {
+ struct http_client *client = peer->client;
unsigned int timeout;
- i_assert(peer != NULL);
- client = peer->client;
-
i_assert(conn->to_requests == NULL);
if (client->waiting)
timeout = http_client_connection_start_idle_timeout(conn);
- e_debug(conn->event,
- "No more requests queued; going idle "
- "(timeout = %u msecs)", timeout);
+ if (timeout == UINT_MAX) {
+ e_debug(conn->event,
+ "No more requests queued; going idle");
+ } else {
+ e_debug(conn->event,
+ "No more requests queued; going idle "
+ "(timeout = %u msecs)", timeout);
+ }
conn->idle = TRUE;
array_push_back(&ppool->idle_conns, &conn);