summaryrefslogtreecommitdiffstats
path: root/scp.c
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2016-03-02 23:43:52 +0100
committerDamien Miller <djm@mindrot.org>2016-03-04 05:12:20 +0100
commit8ef04d7a94bcdb8b0085fdd2a79a844b7d40792d (patch)
tree85f43c1a5cf399e8fa718f03753d504c0e73f74d /scp.c
parentupstream commit (diff)
downloadopenssh-8ef04d7a94bcdb8b0085fdd2a79a844b7d40792d.tar.xz
openssh-8ef04d7a94bcdb8b0085fdd2a79a844b7d40792d.zip
upstream commit
Improve accuracy of reported transfer speeds by waiting for the ack from the other end. Pointed out by mmcc@, ok deraadt@ markus@ Upstream-ID: 99f1cf15c9a8f161086b814d414d862795ae153d
Diffstat (limited to 'scp.c')
-rw-r--r--scp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/scp.c b/scp.c
index 0bdd7cb0b..3f0d75090 100644
--- a/scp.c
+++ b/scp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scp.c,v 1.184 2015/11/27 00:49:31 deraadt Exp $ */
+/* $OpenBSD: scp.c,v 1.185 2016/03/02 22:43:52 dtucker Exp $ */
/*
* scp - secure remote copy. This is basically patched BSD rcp which
* uses ssh to do the data transfer (instead of using rcmd).
@@ -848,8 +848,6 @@ next: if (fd != -1) {
haderr = errno;
}
unset_nonblock(remout);
- if (showprogress)
- stop_progress_meter();
if (fd != -1) {
if (close(fd) < 0 && !haderr)
@@ -861,6 +859,8 @@ next: if (fd != -1) {
else
run_err("%s: %s", name, strerror(haderr));
(void) response();
+ if (showprogress)
+ stop_progress_meter();
}
}
@@ -1145,8 +1145,6 @@ bad: run_err("%s: %s", np, strerror(errno));
}
}
unset_nonblock(remin);
- if (showprogress)
- stop_progress_meter();
if (count != 0 && wrerr == NO &&
atomicio(vwrite, ofd, bp->buf, count) != count) {
wrerr = YES;
@@ -1185,6 +1183,8 @@ bad: run_err("%s: %s", np, strerror(errno));
wrerrno = errno;
}
(void) response();
+ if (showprogress)
+ stop_progress_meter();
if (setimes && wrerr == NO) {
setimes = 0;
if (utimes(np, tv) < 0) {