# HG changeset patch # User Matt Johnston # Date 1138209218 0 # Node ID 92b9b182c615936302999515368d971f79363ff2 # Parent e37b160c414cab6466622f63b0c4dcbf6ebc47a9 Check that the output circular buffer is actually empty before closing the channel (thanks to Tomas Vanek for his help). diff -r e37b160c414c -r 92b9b182c615 common-channel.c --- 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"))