dovecot-1.2: pop3: Fixed a potential hang.

dovecot at dovecot.org dovecot at dovecot.org
Sat Oct 16 20:40:41 EEST 2010


details:   http://hg.dovecot.org/dovecot-1.2/rev/b2d30a8d3fb4
changeset: 9623:b2d30a8d3fb4
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Oct 16 18:39:43 2010 +0100
description:
pop3: Fixed a potential hang.

diffstat:

 src/pop3/client.c |  10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diffs (20 lines):

diff -r 1ecf1c3f7ecf -r b2d30a8d3fb4 src/pop3/client.c
--- 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)


More information about the dovecot-cvs mailing list