dovecot-2.0-sslstream: dsync: Message bodies were saved only par...

dovecot at dovecot.org dovecot at dovecot.org
Sat Feb 13 02:55:56 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0-sslstream/rev/51618f48242b
changeset: 10237:51618f48242b
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Oct 30 13:52:24 2009 -0400
description:
dsync: Message bodies were saved only partially.

diffstat:

2 files changed, 9 insertions(+), 8 deletions(-)
src/dsync/dsync-brain-msgs-new.c |    8 --------
src/dsync/dsync-proxy-client.c   |    9 +++++++++

diffs (47 lines):

diff -r 635fda7ed49c -r 51618f48242b src/dsync/dsync-brain-msgs-new.c
--- a/src/dsync/dsync-brain-msgs-new.c	Thu Oct 29 18:47:50 2009 -0400
+++ b/src/dsync/dsync-brain-msgs-new.c	Fri Oct 30 13:52:24 2009 -0400
@@ -26,19 +26,11 @@ static void msg_get_callback(enum dsync_
 {
 	struct dsync_brain_msg_save_context *ctx = context;
 	struct istream *input;
-	const unsigned char *idata;
-	size_t size;
 
 	switch (result) {
 	case DSYNC_MSG_GET_RESULT_SUCCESS:
 		input = data->input;
 		dsync_worker_msg_save(ctx->iter->worker, ctx->msg, data);
-
-		/* if input is coming from proxy, we'll need to read the input
-		   until EOF or we'll start treating the input as commands.
-		   make sure saving read everything. */
-		while ((i_stream_read_data(input, &idata, &size, 0)) > 0)
-			i_stream_skip(input, size);
 		i_stream_unref(&input);
 		break;
 	case DSYNC_MSG_GET_RESULT_EXPUNGED:
diff -r 635fda7ed49c -r 51618f48242b src/dsync/dsync-proxy-client.c
--- a/src/dsync/dsync-proxy-client.c	Thu Oct 29 18:47:50 2009 -0400
+++ b/src/dsync/dsync-proxy-client.c	Fri Oct 30 13:52:24 2009 -0400
@@ -101,11 +101,20 @@ static void
 static void
 proxy_client_worker_msg_get_done(struct proxy_client_dsync_worker *worker)
 {
+	struct istream *input = worker->msg_get_data.input;
+	const unsigned char *data;
+	size_t size;
+
 	i_assert(worker->io == NULL);
 
 	worker->msg_get_data.input = NULL;
 	worker->io = io_add(worker->fd_in, IO_READ,
 			    proxy_client_worker_input, worker);
+
+	/* we'll need to read the input until EOF or we'll start treating the
+	   input as commands. make sure saving read everything. */
+	while ((i_stream_read_data(input, &data, &size, 0)) > 0)
+		i_stream_skip(input, size);
 }
 
 static bool


More information about the dovecot-cvs mailing list