From: Timo Sirainen Date: Fri, 1 Jul 2016 00:08:31 +0000 (+0300) Subject: global: Removed redundant corking in ostream flush callbacks. X-Git-Tag: 2.3.0.rc1~3323 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c5924dd8f129d6d5ba77e33d25e83a3700deafb1;p=thirdparty%2Fdovecot%2Fcore.git global: Removed redundant corking in ostream flush callbacks. --- diff --git a/src/director/director-connection.c b/src/director/director-connection.c index 1071eeba46..5bc65386e6 100644 --- a/src/director/director-connection.c +++ b/src/director/director-connection.c @@ -1830,9 +1830,7 @@ static int director_connection_output(struct director_connection *conn) if (conn->user_iter != NULL) { /* still handshaking USER list */ - o_stream_cork(conn->output); ret = director_connection_send_users(conn); - o_stream_uncork(conn->output); if (ret < 0) { director_connection_disconnected(&conn, o_stream_get_error(conn->output)); diff --git a/src/doveadm/dsync/dsync-ibc-stream.c b/src/doveadm/dsync/dsync-ibc-stream.c index a9824e66c7..76bd155285 100644 --- a/src/doveadm/dsync/dsync-ibc-stream.c +++ b/src/doveadm/dsync/dsync-ibc-stream.c @@ -295,7 +295,6 @@ static int dsync_ibc_stream_output(struct dsync_ibc_stream *ibc) struct ostream *output = ibc->output; int ret; - o_stream_cork(ibc->output); if ((ret = o_stream_flush(output)) < 0) ret = 1; else if (ibc->value_output != NULL) { @@ -306,7 +305,6 @@ static int dsync_ibc_stream_output(struct dsync_ibc_stream *ibc) if (!dsync_ibc_is_send_queue_full(&ibc->ibc)) ibc->ibc.io_callback(ibc->ibc.io_context); - o_stream_uncork(ibc->output); return ret; } diff --git a/src/doveadm/server-connection.c b/src/doveadm/server-connection.c index 2454c743ef..cec84fe4a2 100644 --- a/src/doveadm/server-connection.c +++ b/src/doveadm/server-connection.c @@ -137,11 +137,9 @@ static int server_connection_output(struct server_connection *conn) { int ret; - o_stream_cork(conn->output); ret = o_stream_flush(conn->output); if (ret > 0 && conn->cmd_input != NULL && conn->delayed_cmd == NULL) ret = server_connection_send_cmd_input_more(conn); - o_stream_uncork(conn->output); if (ret < 0) server_connection_destroy(&conn); return ret; diff --git a/src/imap-urlauth/imap-urlauth-worker.c b/src/imap-urlauth/imap-urlauth-worker.c index 7f5553b257..6abb273d24 100644 --- a/src/imap-urlauth/imap-urlauth-worker.c +++ b/src/imap-urlauth/imap-urlauth-worker.c @@ -721,7 +721,6 @@ static void client_input(struct client *client) static int client_output(struct client *client) { - o_stream_cork(client->output); if (o_stream_flush(client->output) < 0) { if (client->ctrl_output != NULL) (void)o_stream_send_str(client->ctrl_output, "DISCONNECTED\n"); @@ -744,7 +743,6 @@ static int client_output(struct client *client) } } - o_stream_uncork(client->output); if (client->url != NULL) { /* url not finished yet */ return 0; diff --git a/src/imap/imap-client.c b/src/imap/imap-client.c index ba95740592..0d47878c77 100644 --- a/src/imap/imap-client.c +++ b/src/imap/imap-client.c @@ -1218,7 +1218,6 @@ int client_output(struct client *client) if (client->to_idle_output != NULL) timeout_reset(client->to_idle_output); - o_stream_cork(client->output); if ((ret = o_stream_flush(client->output)) < 0) { client_destroy(client, NULL); return 1; @@ -1227,7 +1226,6 @@ int client_output(struct client *client) client_output_commands(client); (void)cmd_sync_delayed(client); - o_stream_uncork(client->output); imap_refresh_proctitle(); if (client->output->closed) client_destroy(client, NULL); diff --git a/src/lib-imap-client/imapc-connection.c b/src/lib-imap-client/imapc-connection.c index 8ffd059d66..105ce3a85a 100644 --- a/src/lib-imap-client/imapc-connection.c +++ b/src/lib-imap-client/imapc-connection.c @@ -2122,7 +2122,6 @@ static int imapc_connection_output(struct imapc_connection *conn) if (conn->to != NULL) timeout_reset(conn->to); - o_stream_cork(conn->output); if ((ret = o_stream_flush(conn->output)) < 0) return 1; @@ -2135,7 +2134,6 @@ static int imapc_connection_output(struct imapc_connection *conn) imapc_command_send_more(conn); } } - o_stream_uncork(conn->output); imapc_connection_unref(&conn); return ret; } diff --git a/src/lib-lda/lmtp-client.c b/src/lib-lda/lmtp-client.c index 5cf53fa3c8..bbb2cfff76 100644 --- a/src/lib-lda/lmtp-client.c +++ b/src/lib-lda/lmtp-client.c @@ -649,13 +649,11 @@ static int lmtp_client_output(struct lmtp_client *client) int ret; lmtp_client_ref(client); - o_stream_cork(client->output); if ((ret = o_stream_flush(client->output)) < 0) lmtp_client_fail(client, ERRSTR_TEMP_REMOTE_FAILURE " (disconnected in output)"); else if (client->input_state == LMTP_INPUT_STATE_DATA) (void)lmtp_client_send_data(client); - o_stream_uncork(client->output); if (client->to != NULL) timeout_reset(client->to); lmtp_client_unref(&client); diff --git a/src/login-common/login-proxy.c b/src/login-common/login-proxy.c index 819cb8f242..fb35e89009 100644 --- a/src/login-common/login-proxy.c +++ b/src/login-common/login-proxy.c @@ -197,12 +197,10 @@ static void proxy_client_disconnected_input(struct login_proxy *proxy) static int server_output(struct login_proxy *proxy) { proxy->last_io = ioloop_time; - o_stream_cork(proxy->server_output); if (o_stream_flush(proxy->server_output) < 0) { login_proxy_free_ostream(&proxy, proxy->server_output, TRUE); return 1; } - o_stream_uncork(proxy->server_output); if (proxy->client_io == NULL && o_stream_get_buffer_used_size(proxy->server_output) < @@ -218,12 +216,10 @@ static int server_output(struct login_proxy *proxy) static int proxy_client_output(struct login_proxy *proxy) { proxy->last_io = ioloop_time; - o_stream_cork(proxy->client_output); if (o_stream_flush(proxy->client_output) < 0) { login_proxy_free_ostream(&proxy, proxy->client_output, FALSE); return 1; } - o_stream_uncork(proxy->client_output); if (proxy->server_io == NULL && o_stream_get_buffer_used_size(proxy->client_output) < diff --git a/src/pop3/pop3-client.c b/src/pop3/pop3-client.c index 24c9c12fe0..c71fde246a 100644 --- a/src/pop3/pop3-client.c +++ b/src/pop3/pop3-client.c @@ -805,7 +805,6 @@ static void client_input(struct client *client) static int client_output(struct client *client) { - o_stream_cork(client->output); if (o_stream_flush(client->output) < 0) { client_destroy(client, NULL); return 1; @@ -835,7 +834,6 @@ static int client_output(struct client *client) } } - o_stream_uncork(client->output); if (client->cmd != NULL) { /* command not finished yet */ return 0; diff --git a/src/stats/client.c b/src/stats/client.c index be056a9319..98d2370b7c 100644 --- a/src/stats/client.c +++ b/src/stats/client.c @@ -114,14 +114,12 @@ static int client_output(struct client *client) { int ret = 1; - o_stream_cork(client->output); if (o_stream_flush(client->output) < 0) { client_destroy(&client); return 1; } if (client->cmd_more != NULL) ret = client->cmd_more(client); - o_stream_uncork(client->output); if (ret > 0) { client->cmd_more = NULL;