changeset 9623:b2d30a8d3fb4 HEAD

pop3: Fixed a potential hang.
author Timo Sirainen <tss@iki.fi>
date Sat, 16 Oct 2010 18:39:43 +0100
parents 1ecf1c3f7ecf
children 45769d0cc39c
files src/pop3/client.c
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/pop3/client.c	Thu Oct 14 18:20:26 2010 +0100
+++ b/src/pop3/client.c	Sat Oct 16 18:39:43 2010 +0100
@@ -501,7 +501,15 @@
 			client_input(client);
 	}
 
-	return client->cmd == NULL;
+	if (client->cmd != NULL) {
+		/* command not finished yet */
+		return 0;
+	} else if (client->io == NULL) {
+		/* data still in output buffer, get back here to add IO */
+		return 0;
+	} else {
+		return 1;
+	}
 }
 
 void clients_init(void)