Check that the output circular buffer is actually empty before

closing the channel (thanks to Tomas Vanek for his help).

--HG--
extra : convert_revision : 7fb3ca52f21072127c9615a5bdbc054c24669e51
This commit is contained in:
Matt Johnston 2006-01-25 17:13:38 +00:00
parent bf045a0564
commit b05ab854ae

View File

@ -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"))