diff src/pop3/commands.c @ 3663:6d485bf73429 HEAD

Don't send duplicate lines in LIST command when buffer is full.
author Timo Sirainen <tss@iki.fi>
date Sun, 16 Oct 2005 19:22:15 +0300
parents 58e3fa234ef4
children 74b27d1e17a4
line wrap: on
line diff
--- a/src/pop3/commands.c	Sun Oct 16 18:07:00 2005 +0300
+++ b/src/pop3/commands.c	Sun Oct 16 19:22:15 2005 +0300
@@ -119,9 +119,14 @@
 static void cmd_list_callback(struct client *client)
 {
 	struct cmd_list_context *ctx = client->cmd_context;
-	int ret;
+	int ret = 1;
 
 	for (; ctx->msgnum != client->messages_count; ctx->msgnum++) {
+		if (ret == 0) {
+			/* buffer full */
+			return;
+		}
+
 		if (client->deleted) {
 			if (client->deleted_bitmask[ctx->msgnum / CHAR_BIT] &
 			    (1 << (ctx->msgnum % CHAR_BIT)))
@@ -132,8 +137,6 @@
 				       client->message_sizes[ctx->msgnum]);
 		if (ret < 0)
 			break;
-		if (ret == 0)
-			return;
 	}
 
 	client_send_line(client, ".");