changeset 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 e37b160c414c
children 50da8d4b5acd
files common-channel.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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"))