summaryrefslogtreecommitdiffhomepage
path: root/common-channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'common-channel.c')
-rw-r--r--common-channel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common-channel.c b/common-channel.c
index e5d8c27..68d2b48 100644
--- a/common-channel.c
+++ b/common-channel.c
@@ -376,7 +376,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"))