[dovecot-cvs] dovecot/src/imap client.c, 1.53, 1.54 imap-fetch-body.c, 1.22, 1.23

cras at dovecot.org cras at dovecot.org
Tue Apr 26 13:43:57 EEST 2005


Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv16222/imap

Modified Files:
	client.c imap-fetch-body.c 
Log Message:
o_stream_uncork() was previously always setting IO_WRITE handler even if
there was no reason for it. This was relied on in imap/pop3 code when a
handler could just send as much data as it can without actually buffering
anything.

So, removed the IO_WRITE handler forcing. It's only set if there's actually
data in buffer or if flush_pending is set (via o_stream_set_flush_pending()
or by returning 0 from flush callback handler).

All in all, a minor optimization.



Index: client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/client.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- client.c	5 Feb 2005 18:07:26 -0000	1.53
+++ client.c	26 Apr 2005 10:43:54 -0000	1.54
@@ -337,6 +337,10 @@
 			_client_reset_command(client);
 		} else {
 			/* unfinished */
+			if (client->command_pending) {
+				o_stream_set_flush_pending(client->output,
+							   TRUE);
+			}
 			return FALSE;
 		}
 	}

Index: imap-fetch-body.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/imap-fetch-body.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- imap-fetch-body.c	17 Apr 2005 15:42:14 -0000	1.22
+++ imap-fetch-body.c	26 Apr 2005 10:43:54 -0000	1.23
@@ -174,7 +174,7 @@
 	}
 
 	if ((uoff_t)sent != virtual_size && !blocks) {
-		/* Input stream gave less data then we expected. Two choices
+		/* Input stream gave less data than we expected. Two choices
 		   here: either we fill the missing data with spaces or we
 		   disconnect the client.
 



More information about the dovecot-cvs mailing list