isync

mailbox synchronization program
git clone https://git.code.sf.net/p/isync/isync
Log | Files | Refs | README | LICENSE

commit ef70bd4a40def77aedf73b93368d0cc8b43871af
parent f4240761f162ab9693c3bb64bca4bc22f411f911
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date:   Sun, 15 Feb 2015 11:39:38 +0100

don't try to flush if there is nothing to flush

zlib reports Z_BUF_ERROR when a flush is attempted without any activity
since the previous flush (if any). while this is harmless as such,
discerning the condition from genuine errors would be much harder than
avoiding the pointless flush in the first place.

REFMAIL: eb5681612f17be777bc8d138d31dd6d6@mpcjanssen.nl

Diffstat:
Msrc/socket.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/socket.c b/src/socket.c @@ -812,7 +812,7 @@ socket_write( conn_t *conn, conn_iovec_t *iov, int iovcnt ) for (i = 0; i < iovcnt; i++) total += iov[i].len; - if (total >= WRITE_CHUNK_SIZE) { + if (total >= WRITE_CHUNK_SIZE && pending_wakeup( &conn->fd_fake )) { /* If the new data is too big, queue the pending buffer to avoid latency. */ do_flush( conn ); }