Mercurial > dropbear
comparison common-channel.c @ 1072:686cd3e8e13e
avoid malloc for iovec
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 20 Mar 2015 22:53:32 +0800 |
parents | c71df09bc610 |
children | 10f198d4a308 |
comparison
equal
deleted
inserted
replaced
1067:ce21d0bfaf98 | 1072:686cd3e8e13e |
---|---|
480 | 480 |
481 written = writev(fd, iov, io_count); | 481 written = writev(fd, iov, io_count); |
482 | 482 |
483 if (written < 0) { | 483 if (written < 0) { |
484 if (errno != EINTR && errno != EAGAIN) { | 484 if (errno != EINTR && errno != EAGAIN) { |
485 TRACE(("errno %d len %d", errno, len)) | 485 TRACE(("errno %d", errno)) |
486 close_chan_fd(channel, fd, SHUT_WR); | 486 close_chan_fd(channel, fd, SHUT_WR); |
487 } | 487 } |
488 } else { | 488 } else { |
489 int cbuf_written = MIN(circ_len1+circ_len2, (unsigned int)written); | 489 int cbuf_written = MIN(circ_len1+circ_len2, (unsigned int)written); |
490 cbuf_incrread(cbuf, cbuf_written); | 490 cbuf_incrread(cbuf, cbuf_written); |