]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
submission: Split off corking and uncorking the relay connection in a separate function.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sun, 2 Sep 2018 13:44:33 +0000 (15:44 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 12 Feb 2019 13:40:41 +0000 (15:40 +0200)
src/submission/submission-client.c

index 4cd04612e2d3c20527941a3767bcf323735fc6e7..4ced04a4651808c84e0f0d482ba0fb386f70c406 100644 (file)
@@ -47,19 +47,28 @@ unsigned int submission_client_count;
 static const struct smtp_server_callbacks smtp_callbacks;
 
 /* try to proxy pipelined commands in a similarly pipelined fashion */
+static void client_proxy_input_pre(struct client *client)
+{
+       if (client->proxy_conn != NULL)
+               smtp_client_connection_cork(client->proxy_conn);
+}
+static void client_proxy_input_post(struct client *client)
+{
+       if (client->proxy_conn != NULL)
+               smtp_client_connection_uncork(client->proxy_conn);
+}
+
 static void client_input_pre(void *context)
 {
        struct client *client = context;
 
-       if (client->proxy_conn != NULL)
-               smtp_client_connection_cork(client->proxy_conn);
+       client_proxy_input_pre(client);
 }
 static void client_input_post(void *context)
 {
        struct client *client = context;
 
-       if (client->proxy_conn != NULL)
-               smtp_client_connection_uncork(client->proxy_conn);
+       client_proxy_input_post(client);
 }
 
 static const char *client_remote_id(struct client *client)