Skip to content

Commit

Permalink
lib-http: client: Use the new connection_input_halt/resume() functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanbosch authored and villesavolainen committed Mar 12, 2018
1 parent c786a72 commit a0b53dc
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/lib-http/http-client-connection.c
Expand Up @@ -694,12 +694,8 @@ static void http_client_connection_destroy(struct connection *_conn)

static void http_client_payload_finished(struct http_client_connection *conn)
{
struct http_client_context *cctx = conn->ppool->peer->cctx;

timeout_remove(&conn->to_input);
conn->conn.io = io_add_istream_to(cctx->ioloop, conn->conn.input,
http_client_connection_input,
&conn->conn);
connection_input_resume(&conn->conn);
if (array_count(&conn->request_wait_list) > 0)
http_client_connection_start_request_timeout(conn);
}
Expand Down Expand Up @@ -797,7 +793,6 @@ http_client_connection_return_response(
struct http_response *response)
{
struct http_client_peer_shared *pshared = conn->ppool->peer;
struct http_client_context *cctx = pshared->cctx;
struct istream *payload;
bool retrying;

Expand All @@ -822,7 +817,7 @@ http_client_connection_return_response(
req);
/* the callback may add its own I/O, so we need to remove
our one before calling it */
io_remove(&conn->conn.io);
connection_input_halt(&conn->conn);
/* we've received the request itself, and we can't reset the
timeout during the payload reading. */
http_client_connection_stop_request_timeout(conn);
Expand All @@ -846,10 +841,7 @@ http_client_connection_return_response(
i_stream_remove_destroy_callback(conn->incoming_payload,
http_client_payload_destroyed);
i_stream_unref(&conn->incoming_payload);
conn->conn.io = io_add_istream_to(cctx->ioloop,
conn->conn.input,
http_client_connection_input,
&conn->conn);
connection_input_resume(&conn->conn);
}
http_client_connection_unref_request(conn, &req);
return http_client_connection_unref(&conn);
Expand Down

0 comments on commit a0b53dc

Please sign in to comment.