Otherwise, a race condition between outgoing payload transmission and receiving
the response may cause connection to hang.
struct http_response response;
conn->tunneling = TRUE;
+ req->state = HTTP_REQUEST_STATE_WAITING;
i_zero(&response);
response.status = 200;
http_client_request_callback_t *callback = req->callback;
unsigned int orig_attempts = req->attempts;
+ i_assert(req->state >= HTTP_REQUEST_STATE_PAYLOAD_OUT);
+ i_assert(req->conn != NULL);
+ if (req->state == HTTP_REQUEST_STATE_PAYLOAD_OUT)
+ req->conn->output_locked = FALSE;
req->state = HTTP_REQUEST_STATE_GOT_RESPONSE;
req->last_status = response->status;