Skip to content

Commit

Permalink
lib-http: client: Simplified initiation of connection setup upon requ…
Browse files Browse the repository at this point in the history
…est submission.
  • Loading branch information
stephanbosch authored and cmouse committed Dec 7, 2017
1 parent 8149ed5 commit 3ad0a46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
13 changes: 0 additions & 13 deletions src/lib-http/http-client-host.c
Expand Up @@ -256,19 +256,6 @@ void http_client_host_submit_request(struct http_client_host *host,

/* cancel host idle timeout */
timeout_remove(&host->to_idle);

if (host->unix_local) {
http_client_queue_connection_setup(queue);
return;
}

/* start DNS lookup if necessary */
if (host->ips_count == 0 && host->dns_lookup == NULL)
http_client_host_lookup(host);

/* make a connection if we have an IP already */
if (host->ips_count > 0)
http_client_queue_connection_setup(queue);
}

void http_client_host_free(struct http_client_host **_host)
Expand Down
7 changes: 4 additions & 3 deletions src/lib-http/http-client-queue.c
Expand Up @@ -838,7 +838,8 @@ static void http_client_queue_submit_now(struct http_client_queue *queue,

} else if (timeval_diff_msecs(&req->timeout_time, &ioloop_timeval) <= 1) {
/* pretty much already timed out; don't bother */

return;

} else {
unsigned int insert_idx;

Expand All @@ -847,6 +848,8 @@ static void http_client_queue_submit_now(struct http_client_queue *queue,
&req, http_client_queue_request_timeout_cmp, &insert_idx);
array_insert(req_queue, insert_idx, &req, 1);
}

http_client_queue_connection_setup(queue);
}

/*
Expand Down Expand Up @@ -881,8 +884,6 @@ http_client_queue_delay_timeout(struct http_client_queue *queue)
http_client_queue_set_delay_timer(queue, reqs[i]->release_time);
}
array_delete(&queue->delayed_requests, 0, finished);

http_client_queue_connection_setup(queue);
}

static void
Expand Down

0 comments on commit 3ad0a46

Please sign in to comment.