summaryrefslogtreecommitdiff
path: root/sftp-client.c
diff options
context:
space:
mode:
Diffstat (limited to 'sftp-client.c')
-rw-r--r--sftp-client.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sftp-client.c b/sftp-client.c
index 4986d6d8d..cf2887a40 100644
--- a/sftp-client.c
+++ b/sftp-client.c
@@ -101,7 +101,9 @@ sftpio(void *_bwlimit, size_t amount)
101{ 101{
102 struct bwlimit *bwlimit = (struct bwlimit *)_bwlimit; 102 struct bwlimit *bwlimit = (struct bwlimit *)_bwlimit;
103 103
104 bandwidth_limit(bwlimit, amount); 104 refresh_progress_meter(0);
105 if (bwlimit != NULL)
106 bandwidth_limit(bwlimit, amount);
105 return 0; 107 return 0;
106} 108}
107 109
@@ -121,8 +123,8 @@ send_msg(struct sftp_conn *conn, struct sshbuf *m)
121 iov[1].iov_base = (u_char *)sshbuf_ptr(m); 123 iov[1].iov_base = (u_char *)sshbuf_ptr(m);
122 iov[1].iov_len = sshbuf_len(m); 124 iov[1].iov_len = sshbuf_len(m);
123 125
124 if (atomiciov6(writev, conn->fd_out, iov, 2, 126 if (atomiciov6(writev, conn->fd_out, iov, 2, sftpio,
125 conn->limit_kbps > 0 ? sftpio : NULL, &conn->bwlimit_out) != 127 conn->limit_kbps > 0 ? &conn->bwlimit_out : NULL) !=
126 sshbuf_len(m) + sizeof(mlen)) 128 sshbuf_len(m) + sizeof(mlen))
127 fatal("Couldn't send packet: %s", strerror(errno)); 129 fatal("Couldn't send packet: %s", strerror(errno));
128 130
@@ -138,8 +140,8 @@ get_msg_extended(struct sftp_conn *conn, struct sshbuf *m, int initial)
138 140
139 if ((r = sshbuf_reserve(m, 4, &p)) != 0) 141 if ((r = sshbuf_reserve(m, 4, &p)) != 0)
140 fatal("%s: buffer error: %s", __func__, ssh_err(r)); 142 fatal("%s: buffer error: %s", __func__, ssh_err(r));
141 if (atomicio6(read, conn->fd_in, p, 4, 143 if (atomicio6(read, conn->fd_in, p, 4, sftpio,
142 conn->limit_kbps > 0 ? sftpio : NULL, &conn->bwlimit_in) != 4) { 144 conn->limit_kbps > 0 ? &conn->bwlimit_in : NULL) != 4) {
143 if (errno == EPIPE || errno == ECONNRESET) 145 if (errno == EPIPE || errno == ECONNRESET)
144 fatal("Connection closed"); 146 fatal("Connection closed");
145 else 147 else
@@ -157,8 +159,8 @@ get_msg_extended(struct sftp_conn *conn, struct sshbuf *m, int initial)
157 159
158 if ((r = sshbuf_reserve(m, msg_len, &p)) != 0) 160 if ((r = sshbuf_reserve(m, msg_len, &p)) != 0)
159 fatal("%s: buffer error: %s", __func__, ssh_err(r)); 161 fatal("%s: buffer error: %s", __func__, ssh_err(r));
160 if (atomicio6(read, conn->fd_in, p, msg_len, 162 if (atomicio6(read, conn->fd_in, p, msg_len, sftpio,
161 conn->limit_kbps > 0 ? sftpio : NULL, &conn->bwlimit_in) 163 conn->limit_kbps > 0 ? &conn->bwlimit_in : NULL)
162 != msg_len) { 164 != msg_len) {
163 if (errno == EPIPE) 165 if (errno == EPIPE)
164 fatal("Connection closed"); 166 fatal("Connection closed");