[dovecot-cvs] dovecot/src/pop3 client.c, 1.38, 1.39 commands.c, 1.30, 1.31

cras at dovecot.org cras at dovecot.org
Sat Oct 9 00:21:14 EEST 2004


Update of /var/lib/cvs/dovecot/src/pop3
In directory talvi:/tmp/cvs-serv13833

Modified Files:
	client.c commands.c 
Log Message:
Buffer more in memory before sending RETR replies.



Index: client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3/client.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- client.c	8 Oct 2004 20:25:00 -0000	1.38
+++ client.c	8 Oct 2004 21:21:11 -0000	1.39
@@ -404,8 +404,10 @@
 
 	client->last_output = ioloop_time;
 
+	o_stream_cork(client->output);
 	if (client->cmd != NULL)
 		client->cmd(client);
+	o_stream_uncork(client->output);
 
 	if (o_stream_get_buffer_used_size(client->output) <
 	    OUTBUF_THROTTLE_SIZE/2 && client->io == NULL &&

Index: commands.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3/commands.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- commands.c	8 Oct 2004 20:25:00 -0000	1.30
+++ commands.c	8 Oct 2004 21:21:11 -0000	1.31
@@ -227,8 +227,7 @@
 	const unsigned char *data;
 	unsigned char add;
 	size_t i, size;
-
-	o_stream_uncork(client->output);
+	int ret;
 
 	while ((ctx->body_lines > 0 || !ctx->in_body) &&
 	       i_stream_read_data(ctx->stream, &data, &size, 0) > 0) {
@@ -281,12 +280,13 @@
 			i_stream_skip(ctx->stream, i);
 		}
 
-		if (o_stream_get_buffer_used_size(client->output) > 0) {
-			if (client->output->closed)
+		if (o_stream_get_buffer_used_size(client->output) >= 4096) {
+			if ((ret = o_stream_flush(client->output)) < 0)
 				break;
-
-			/* continue later */
-			return;
+			if (ret == 0) {
+				/* continue later */
+				return;
+			}
 		}
 
 		if (add != '\0') {



More information about the dovecot-cvs mailing list