Mercurial > dropbear
comparison common-channel.c @ 302:973fccb59ea4 ucc-axis-hack
propagate from branch 'au.asn.ucc.matt.dropbear' (head 11034278bd1917bebcbdc69cf53b1891ce9db121)
to branch 'au.asn.ucc.matt.dropbear.ucc-axis-hack' (head 10a1f614fec73d0820c3f61160d9db409b9beb46)
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 25 Mar 2006 12:59:58 +0000 |
parents | baea1d43e7eb |
children | 827f87dfbc22 5488db2e9e4e |
comparison
equal
deleted
inserted
replaced
299:740e782679be | 302:973fccb59ea4 |
---|---|
179 /* Iterate through the channels, performing IO if available */ | 179 /* Iterate through the channels, performing IO if available */ |
180 void channelio(fd_set *readfds, fd_set *writefds) { | 180 void channelio(fd_set *readfds, fd_set *writefds) { |
181 | 181 |
182 struct Channel *channel; | 182 struct Channel *channel; |
183 unsigned int i; | 183 unsigned int i; |
184 int ret; | |
185 | 184 |
186 /* iterate through all the possible channels */ | 185 /* iterate through all the possible channels */ |
187 for (i = 0; i < ses.chansize; i++) { | 186 for (i = 0; i < ses.chansize; i++) { |
188 | 187 |
189 channel = ses.channels[i]; | 188 channel = ses.channels[i]; |
235 static void checkclose(struct Channel *channel) { | 234 static void checkclose(struct Channel *channel) { |
236 | 235 |
237 TRACE(("checkclose: writefd %d, readfd %d, errfd %d, sentclosed %d, recvclosed %d", | 236 TRACE(("checkclose: writefd %d, readfd %d, errfd %d, sentclosed %d, recvclosed %d", |
238 channel->writefd, channel->readfd, | 237 channel->writefd, channel->readfd, |
239 channel->errfd, channel->sentclosed, channel->recvclosed)) | 238 channel->errfd, channel->sentclosed, channel->recvclosed)) |
240 TRACE(("writebuf %d extrabuf %s extrabuf %d", | 239 TRACE(("writebuf size %d extrabuf ptr 0x%x extrabuf size %d", |
241 cbuf_getused(channel->writebuf), | 240 cbuf_getused(channel->writebuf), |
242 channel->writebuf, | 241 channel->writebuf, |
243 channel->writebuf ? 0 : cbuf_getused(channel->extrabuf))) | 242 channel->writebuf ? 0 : cbuf_getused(channel->extrabuf))) |
244 | 243 |
245 if (!channel->sentclosed) { | 244 if (!channel->sentclosed) { |
375 } | 374 } |
376 | 375 |
377 cbuf_incrread(cbuf, len); | 376 cbuf_incrread(cbuf, len); |
378 channel->recvdonelen += len; | 377 channel->recvdonelen += len; |
379 | 378 |
380 if (fd == channel->writefd && len == maxlen && channel->recveof) { | 379 if (fd == channel->writefd && cbuf_getused(cbuf) == 0 && channel->recveof) { |
381 /* Check if we're closing up */ | 380 /* Check if we're closing up */ |
382 closewritefd(channel); | 381 closewritefd(channel); |
383 TRACE(("leave writechannel: recveof set")) | 382 TRACE(("leave writechannel: recveof set")) |
384 return; | 383 return; |
385 } | 384 } |