comparison common-channel.c @ 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 82393badfa24
children e109fb08b8ee
comparison
equal deleted inserted replaced
266:e37b160c414c 269:92b9b182c615
375 } 375 }
376 376
377 cbuf_incrread(cbuf, len); 377 cbuf_incrread(cbuf, len);
378 channel->recvdonelen += len; 378 channel->recvdonelen += len;
379 379
380 if (fd == channel->writefd && len == maxlen && channel->recveof) { 380 if (fd == channel->writefd && cbuf_getused(cbuf) == 0 && channel->recveof) {
381 /* Check if we're closing up */ 381 /* Check if we're closing up */
382 closewritefd(channel); 382 closewritefd(channel);
383 TRACE(("leave writechannel: recveof set")) 383 TRACE(("leave writechannel: recveof set"))
384 return; 384 return;
385 } 385 }