comparison common-channel.c @ 835:4095b6d7c9fc ecc

Merge in changes from the past couple of releases
author Matt Johnston <matt@ucc.asn.au>
date Fri, 18 Oct 2013 21:38:01 +0800
parents 35183e8a7851
children a1a97e98b0c1
comparison
equal deleted inserted replaced
807:75509065db53 835:4095b6d7c9fc
305 } 305 }
306 remove_channel(channel); 306 remove_channel(channel);
307 return; 307 return;
308 } 308 }
309 309
310 if (channel->recv_eof && !write_pending(channel)) { 310 if ((channel->recv_eof && !write_pending(channel))
311 /* have a server "session" and child has exited */
312 || (channel->type->check_close && close_allowed)) {
311 close_chan_fd(channel, channel->writefd, SHUT_WR); 313 close_chan_fd(channel, channel->writefd, SHUT_WR);
312 } 314 }
313 315
314 /* Special handling for flushing read data after an exit. We 316 /* Special handling for flushing read data after an exit. We
315 read regardless of whether the select FD was set, 317 read regardless of whether the select FD was set,
334 send_msg_channel_eof(channel); 336 send_msg_channel_eof(channel);
335 } 337 }
336 338
337 /* And if we can't receive any more data from them either, close up */ 339 /* And if we can't receive any more data from them either, close up */
338 if (channel->readfd == FD_CLOSED 340 if (channel->readfd == FD_CLOSED
341 && channel->writefd == FD_CLOSED
339 && (ERRFD_IS_WRITE(channel) || channel->errfd == FD_CLOSED) 342 && (ERRFD_IS_WRITE(channel) || channel->errfd == FD_CLOSED)
340 && !channel->sent_close 343 && !channel->sent_close
341 && close_allowed 344 && close_allowed
342 && !write_pending(channel)) { 345 && !write_pending(channel)) {
343 TRACE(("sending close, readfd is closed")) 346 TRACE(("sending close, readfd is closed"))