diff options
Diffstat (limited to 'meta/recipes-connectivity/openssh/openssh/0001-upstream-Have-progressmeter-force-an-update-at-the-b.patch')
-rw-r--r-- | meta/recipes-connectivity/openssh/openssh/0001-upstream-Have-progressmeter-force-an-update-at-the-b.patch | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssh/openssh/0001-upstream-Have-progressmeter-force-an-update-at-the-b.patch b/meta/recipes-connectivity/openssh/openssh/0001-upstream-Have-progressmeter-force-an-update-at-the-b.patch new file mode 100644 index 0000000000..2fb57da635 --- /dev/null +++ b/meta/recipes-connectivity/openssh/openssh/0001-upstream-Have-progressmeter-force-an-update-at-the-b.patch | |||
@@ -0,0 +1,121 @@ | |||
1 | From 5df934e2279e8ed1f07b990f4b2b3baf6470f7e5 Mon Sep 17 00:00:00 2001 | ||
2 | From: "dtucker@openbsd.org" <dtucker@openbsd.org> | ||
3 | Date: Thu, 24 Jan 2019 16:52:17 +0000 | ||
4 | Subject: [PATCH] upstream: Have progressmeter force an update at the beginning | ||
5 | and | ||
6 | |||
7 | end of each transfer. Fixes the problem recently introduces where very quick | ||
8 | transfers do not display the progressmeter at all. Spotted by naddy@ | ||
9 | |||
10 | OpenBSD-Commit-ID: 68dc46c259e8fdd4f5db3ec2a130f8e4590a7a9a | ||
11 | Ustream-Status: Backport | ||
12 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
13 | --- | ||
14 | progressmeter.c | 13 +++++-------- | ||
15 | progressmeter.h | 4 ++-- | ||
16 | scp.c | 2 +- | ||
17 | sftp-client.c | 2 +- | ||
18 | 4 files changed, 9 insertions(+), 12 deletions(-) | ||
19 | |||
20 | diff --git a/progressmeter.c b/progressmeter.c | ||
21 | index add462d..e385c12 100644 | ||
22 | --- a/progressmeter.c | ||
23 | +++ b/progressmeter.c | ||
24 | @@ -1,4 +1,4 @@ | ||
25 | -/* $OpenBSD: progressmeter.c,v 1.46 2019/01/23 08:01:46 dtucker Exp $ */ | ||
26 | +/* $OpenBSD: progressmeter.c,v 1.47 2019/01/24 16:52:17 dtucker Exp $ */ | ||
27 | /* | ||
28 | * Copyright (c) 2003 Nils Nordman. All rights reserved. | ||
29 | * | ||
30 | @@ -59,9 +59,6 @@ static void format_rate(char *, int, off_t); | ||
31 | static void sig_winch(int); | ||
32 | static void setscreensize(void); | ||
33 | |||
34 | -/* updates the progressmeter to reflect the current state of the transfer */ | ||
35 | -void refresh_progress_meter(void); | ||
36 | - | ||
37 | /* signal handler for updating the progress meter */ | ||
38 | static void sig_alarm(int); | ||
39 | |||
40 | @@ -120,7 +117,7 @@ format_size(char *buf, int size, off_t bytes) | ||
41 | } | ||
42 | |||
43 | void | ||
44 | -refresh_progress_meter(void) | ||
45 | +refresh_progress_meter(int force_update) | ||
46 | { | ||
47 | char buf[MAX_WINSIZE + 1]; | ||
48 | off_t transferred; | ||
49 | @@ -131,7 +128,7 @@ refresh_progress_meter(void) | ||
50 | int hours, minutes, seconds; | ||
51 | int file_len; | ||
52 | |||
53 | - if ((!alarm_fired && !win_resized) || !can_output()) | ||
54 | + if ((!force_update && !alarm_fired && !win_resized) || !can_output()) | ||
55 | return; | ||
56 | alarm_fired = 0; | ||
57 | |||
58 | @@ -254,7 +251,7 @@ start_progress_meter(const char *f, off_t filesize, off_t *ctr) | ||
59 | bytes_per_second = 0; | ||
60 | |||
61 | setscreensize(); | ||
62 | - refresh_progress_meter(); | ||
63 | + refresh_progress_meter(1); | ||
64 | |||
65 | signal(SIGALRM, sig_alarm); | ||
66 | signal(SIGWINCH, sig_winch); | ||
67 | @@ -271,7 +268,7 @@ stop_progress_meter(void) | ||
68 | |||
69 | /* Ensure we complete the progress */ | ||
70 | if (cur_pos != end_pos) | ||
71 | - refresh_progress_meter(); | ||
72 | + refresh_progress_meter(1); | ||
73 | |||
74 | atomicio(vwrite, STDOUT_FILENO, "\n", 1); | ||
75 | } | ||
76 | diff --git a/progressmeter.h b/progressmeter.h | ||
77 | index 8f66780..1703ea7 100644 | ||
78 | --- a/progressmeter.h | ||
79 | +++ b/progressmeter.h | ||
80 | @@ -1,4 +1,4 @@ | ||
81 | -/* $OpenBSD: progressmeter.h,v 1.4 2019/01/23 08:01:46 dtucker Exp $ */ | ||
82 | +/* $OpenBSD: progressmeter.h,v 1.5 2019/01/24 16:52:17 dtucker Exp $ */ | ||
83 | /* | ||
84 | * Copyright (c) 2002 Nils Nordman. All rights reserved. | ||
85 | * | ||
86 | @@ -24,5 +24,5 @@ | ||
87 | */ | ||
88 | |||
89 | void start_progress_meter(const char *, off_t, off_t *); | ||
90 | -void refresh_progress_meter(void); | ||
91 | +void refresh_progress_meter(int); | ||
92 | void stop_progress_meter(void); | ||
93 | diff --git a/scp.c b/scp.c | ||
94 | index 4a342a6..0587cec 100644 | ||
95 | --- a/scp.c | ||
96 | +++ b/scp.c | ||
97 | @@ -585,7 +585,7 @@ scpio(void *_cnt, size_t s) | ||
98 | off_t *cnt = (off_t *)_cnt; | ||
99 | |||
100 | *cnt += s; | ||
101 | - refresh_progress_meter(); | ||
102 | + refresh_progress_meter(0); | ||
103 | if (limit_kbps > 0) | ||
104 | bandwidth_limit(&bwlimit, s); | ||
105 | return 0; | ||
106 | diff --git a/sftp-client.c b/sftp-client.c | ||
107 | index 2bc698f..cf2887a 100644 | ||
108 | --- a/sftp-client.c | ||
109 | +++ b/sftp-client.c | ||
110 | @@ -101,7 +101,7 @@ sftpio(void *_bwlimit, size_t amount) | ||
111 | { | ||
112 | struct bwlimit *bwlimit = (struct bwlimit *)_bwlimit; | ||
113 | |||
114 | - refresh_progress_meter(); | ||
115 | + refresh_progress_meter(0); | ||
116 | if (bwlimit != NULL) | ||
117 | bandwidth_limit(bwlimit, amount); | ||
118 | return 0; | ||
119 | -- | ||
120 | 2.7.4 | ||
121 | |||