summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--common-channel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common-channel.c b/common-channel.c
index 7e8d428..4bed78d 100644
--- a/common-channel.c
+++ b/common-channel.c
@@ -377,7 +377,7 @@ static void writechannel(struct Channel* channel, int fd, circbuffer *cbuf) {
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"))