]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
global: Removed redundant corking in ostream flush callbacks.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 1 Jul 2016 00:08:31 +0000 (03:08 +0300)
committerGitLab <gitlab@git.dovecot.net>
Wed, 6 Jul 2016 13:01:50 +0000 (16:01 +0300)
src/director/director-connection.c
src/doveadm/dsync/dsync-ibc-stream.c
src/doveadm/server-connection.c
src/imap-urlauth/imap-urlauth-worker.c
src/imap/imap-client.c
src/lib-imap-client/imapc-connection.c
src/lib-lda/lmtp-client.c
src/login-common/login-proxy.c
src/pop3/pop3-client.c
src/stats/client.c

index 1071eeba46173c13d9d55a8fed2e6c5f006c8597..5bc65386e6e9fecc24163fb5de02d91a14090620 100644 (file)
@@ -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));
index a9824e66c724e0b684aaf8e392e82a4eceb3262a..76bd1552859ebaf40b10020bd59cff080bf82abd 100644 (file)
@@ -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;
 }
 
index 2454c743efa5134a0c6cea8deb0784a75e73f1b7..cec84fe4a2ac1e1180e0f10edf7c659490735a79 100644 (file)
@@ -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;
index 7f5553b25716611cf77520946af67cc98b29fec5..6abb273d24a629eea96e10f38c184e58bc05f20e 100644 (file)
@@ -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;
index ba9574059245f7b4c156c17504fa5b57660063af..0d47878c7727c0b2c9f7d86c287caa460ccfb27b 100644 (file)
@@ -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);
index 8ffd059d668e48747aa945d26ed83629f8ad7922..105ce3a85a06d401cadb71bde26b69a3407019af 100644 (file)
@@ -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;
 }
index 5cf53fa3c80d4126184c7cab1fa2d0b8d0dbde7b..bbb2cfff76ca3d8fc437f070bf92aca3e5c96b7b 100644 (file)
@@ -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);
index 819cb8f2420d204b8659a68b448df89d7bfb0931..fb35e8900926d6fccae1ca7f36dc80b407d395cb 100644 (file)
@@ -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) <
index 24c9c12fe0df9175096257624b06b502113a242d..c71fde246a8474bc20c4aa1448efd822f15d0e99 100644 (file)
@@ -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;
index be056a9319eb464bf310c323784d42c97165c841..98d2370b7cd7fc17ec16b4a6e474e0ad19df02bf 100644 (file)
@@ -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;