[dovecot-cvs] dovecot/src/login-common login-proxy.c,1.3,1.4

cras at dovecot.org cras at dovecot.org
Wed Oct 20 20:07:35 EEST 2004


Update of /var/lib/cvs/dovecot/src/login-common
In directory talvi:/tmp/cvs-serv4344/login-common

Modified Files:
	login-proxy.c 
Log Message:
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.



Index: login-proxy.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/login-common/login-proxy.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- login-proxy.c	20 Oct 2004 13:59:32 -0000	1.3
+++ login-proxy.c	20 Oct 2004 17:07:33 -0000	1.4
@@ -72,13 +72,13 @@
                 login_proxy_free(proxy);
 }
 
-static void proxy_output(void *context)
+static int proxy_output(void *context)
 {
 	struct login_proxy *proxy = context;
 
 	if (o_stream_flush(proxy->proxy_output) < 0) {
                 login_proxy_free(proxy);
-		return;
+		return 1;
 	}
 
 	if (proxy->client_io == NULL &&
@@ -89,15 +89,16 @@
 		proxy->client_io = io_add(proxy->client_fd, IO_READ,
 					  proxy_client_input, proxy);
 	}
+	return 1;
 }
 
-static void proxy_client_output(void *context)
+static int proxy_client_output(void *context)
 {
 	struct login_proxy *proxy = context;
 
 	if (o_stream_flush(proxy->client_output) < 0) {
                 login_proxy_free(proxy);
-		return;
+		return 1;
 	}
 
 	if (proxy->proxy_io == NULL &&
@@ -108,6 +109,7 @@
 		proxy->proxy_io =
 			io_add(proxy->proxy_fd, IO_READ, proxy_input, proxy);
 	}
+	return 1;
 }
 
 static void proxy_prelogin_input(void *context)



More information about the dovecot-cvs mailing list