version 1.131, 2019/01/16 23:23:45 |
version 1.132, 2019/01/23 08:01:46 |
|
|
{ |
{ |
struct bwlimit *bwlimit = (struct bwlimit *)_bwlimit; |
struct bwlimit *bwlimit = (struct bwlimit *)_bwlimit; |
|
|
bandwidth_limit(bwlimit, amount); |
refresh_progress_meter(); |
|
if (bwlimit != NULL) |
|
bandwidth_limit(bwlimit, amount); |
return 0; |
return 0; |
} |
} |
|
|
|
|
iov[1].iov_base = (u_char *)sshbuf_ptr(m); |
iov[1].iov_base = (u_char *)sshbuf_ptr(m); |
iov[1].iov_len = sshbuf_len(m); |
iov[1].iov_len = sshbuf_len(m); |
|
|
if (atomiciov6(writev, conn->fd_out, iov, 2, |
if (atomiciov6(writev, conn->fd_out, iov, 2, sftpio, |
conn->limit_kbps > 0 ? sftpio : NULL, &conn->bwlimit_out) != |
conn->limit_kbps > 0 ? &conn->bwlimit_out : NULL) != |
sshbuf_len(m) + sizeof(mlen)) |
sshbuf_len(m) + sizeof(mlen)) |
fatal("Couldn't send packet: %s", strerror(errno)); |
fatal("Couldn't send packet: %s", strerror(errno)); |
|
|
|
|
|
|
if ((r = sshbuf_reserve(m, 4, &p)) != 0) |
if ((r = sshbuf_reserve(m, 4, &p)) != 0) |
fatal("%s: buffer error: %s", __func__, ssh_err(r)); |
fatal("%s: buffer error: %s", __func__, ssh_err(r)); |
if (atomicio6(read, conn->fd_in, p, 4, |
if (atomicio6(read, conn->fd_in, p, 4, sftpio, |
conn->limit_kbps > 0 ? sftpio : NULL, &conn->bwlimit_in) != 4) { |
conn->limit_kbps > 0 ? &conn->bwlimit_in : NULL) != 4) { |
if (errno == EPIPE || errno == ECONNRESET) |
if (errno == EPIPE || errno == ECONNRESET) |
fatal("Connection closed"); |
fatal("Connection closed"); |
else |
else |
|
|
|
|
if ((r = sshbuf_reserve(m, msg_len, &p)) != 0) |
if ((r = sshbuf_reserve(m, msg_len, &p)) != 0) |
fatal("%s: buffer error: %s", __func__, ssh_err(r)); |
fatal("%s: buffer error: %s", __func__, ssh_err(r)); |
if (atomicio6(read, conn->fd_in, p, msg_len, |
if (atomicio6(read, conn->fd_in, p, msg_len, sftpio, |
conn->limit_kbps > 0 ? sftpio : NULL, &conn->bwlimit_in) |
conn->limit_kbps > 0 ? &conn->bwlimit_in : NULL) |
!= msg_len) { |
!= msg_len) { |
if (errno == EPIPE) |
if (errno == EPIPE) |
fatal("Connection closed"); |
fatal("Connection closed"); |