Only unlock connection output when no more requests are pending. Before, the
next request header could be sent while outgoing payload for current request was
still pending.
return -1;
}
+ i_assert(conn->output_locked);
if (conn->conn.output != NULL)
o_stream_set_flush_pending(conn->conn.output, TRUE);
return -1;
timeval_diff_msecs(&req->sent_time, &req->submit_time));
/* Make sure connection output is unlocked if 100-continue failed */
- if (req->payload_sync && !req->payload_sync_continue) {
+ if (req->payload_sync && !req->payload_sync_continue &&
+ array_count(&conn->request_wait_list) == 1) {
e_debug(req->event, "Unlocked output");
conn->output_locked = FALSE;
}