diff src/pop3/client.c @ 2790:02c0b8d532c2 HEAD

Changed ostream's flush callback to have return value which can tell if there are more bytes to be sent even if there is none in output buffer itself. Fixes FETCH commands which used o_stream_send_istream() getting stuck.
author Timo Sirainen <tss@iki.fi>
date Wed, 20 Oct 2004 20:07:32 +0300
parents 25113dcc9705
children 6e2129a4a595
line wrap: on
line diff
--- a/src/pop3/client.c	Wed Oct 20 20:04:27 2004 +0300
+++ b/src/pop3/client.c	Wed Oct 20 20:07:32 2004 +0300
@@ -35,7 +35,7 @@
 static struct timeout *to_idle;
 
 static void client_input(void *context);
-static void client_output(void *context);
+static int client_output(void *context);
 
 static int sync_mailbox(struct mailbox *box)
 {
@@ -325,14 +325,14 @@
 		client_destroy(client);
 }
 
-static void client_output(void *context)
+static int client_output(void *context)
 {
 	struct client *client = context;
 	int ret;
 
 	if ((ret = o_stream_flush(client->output)) < 0) {
 		client_destroy(client);
-		return;
+		return 1;
 	}
 
 	client->last_output = ioloop_time;
@@ -352,6 +352,8 @@
 
 	if (client->cmd == NULL && client->io != NULL && client->waiting_input)
 		client_input(client);
+
+	return client->cmd == NULL;
 }
 
 static void idle_timeout(void *context __attr_unused__)