dovecot-2.2: imap: URLFETCH's tagged reply wasn't sent while TCP...

dovecot at dovecot.org dovecot at dovecot.org
Thu May 30 22:45:15 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/04b325dbb7bc
changeset: 16431:04b325dbb7bc
user:      Timo Sirainen <tss at iki.fi>
date:      Thu May 30 22:44:54 2013 +0300
description:
imap: URLFETCH's tagged reply wasn't sent while TCP corked.

diffstat:

 src/imap/cmd-urlfetch.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (40 lines):

diff -r 1cf6ce033a25 -r 04b325dbb7bc src/imap/cmd-urlfetch.c
--- a/src/imap/cmd-urlfetch.c	Thu May 30 22:27:57 2013 +0300
+++ b/src/imap/cmd-urlfetch.c	Thu May 30 22:44:54 2013 +0300
@@ -255,10 +255,11 @@
 			  bool last, void *context)
 {
 	struct client_command_context *cmd = context;
+	struct client *client = cmd->client;
 	struct cmd_urlfetch_context *ctx = cmd->context;
 	int ret;
 
-	o_stream_cork(cmd->client->output);
+	o_stream_cork(client->output);
 	if (reply == NULL) {
 		/* fatal failure */
 		ctx->failed = TRUE;
@@ -273,20 +274,20 @@
 		str_append(response, "* URLFETCH ");
 		imap_append_astring(response, reply->url);
 		str_append(response, " NIL");
-		client_send_line(cmd->client, str_c(response));
+		client_send_line(client, str_c(response));
 		if (reply->error != NULL) {
-			client_send_line(cmd->client, t_strdup_printf(
+			client_send_line(client, t_strdup_printf(
 				"* NO %s.", reply->error));
 		}
 		ret = 1;
 	}
-	o_stream_uncork(cmd->client->output);
 
 	if ((last && cmd->state == CLIENT_COMMAND_STATE_WAIT_EXTERNAL) ||
 	    ret < 0) {
 		cmd_urlfetch_finish(cmd);
 		client_command_free(&cmd);
 	}
+	o_stream_uncork(client->output);
 	return ret;
 }
 


More information about the dovecot-cvs mailing list