diff common-channel.c @ 269:92b9b182c615

Check that the output circular buffer is actually empty before closing the channel (thanks to Tomas Vanek for his help).
author Matt Johnston <matt@ucc.asn.au>
date Wed, 25 Jan 2006 17:13:38 +0000
parents 82393badfa24
children e109fb08b8ee
line wrap: on
line diff
--- a/common-channel.c	Fri Dec 09 06:10:27 2005 +0000
+++ b/common-channel.c	Wed Jan 25 17:13:38 2006 +0000
@@ -377,7 +377,7 @@
 	cbuf_incrread(cbuf, len);
 	channel->recvdonelen += len;
 
-	if (fd == channel->writefd && len == maxlen && channel->recveof) { 
+	if (fd == channel->writefd && cbuf_getused(cbuf) == 0 && channel->recveof) { 
 		/* Check if we're closing up */
 		closewritefd(channel);
 		TRACE(("leave writechannel: recveof set"))