Closed foutrelis closed 4 years ago
Weird. I didn't see that happening. Please do a bisect.
Bisect points to ef6ccfc4a38fc78c0c9fa18a4731dbac1f10ea49. The issue is always reproducible with axel http://speed.hetzner.de/1GB.bin
. Weirdly enough, downloading the same file over HTTPS shows properly aligned progress output.
Reverting part of the above commit seems to fix this strange issue:
diff --git a/src/text.c b/src/text.c
index 5bd36aa..861aab5 100644
--- a/src/text.c
+++ b/src/text.c
@@ -403,7 +403,7 @@ main(int argc, char *argv[])
print_alternate_output(axel);
} else {
/* The infamous wget-like 'interface'.. ;) */
- size_t done = (axel->bytes_done - prev) / 1024;
+ size_t done = (axel->bytes_done / 1024) - (prev / 1024);
if (done && conf->verbose > -1) {
for (size_t i = 0; i < done; i++) {
i += (prev / 1024);
Excellent. I see what happened now. Do you mind to do a PR?
Remeber to add a reference to this issue's URL and the commit that introduced the bug.
Thanks.
You may want to check the changes I just made. I double checked this time.
This probably should be further simplified.
It still looks good here and the code seems much cleaner. :+1:
(The current code isn't too complicated in my opinion.)
The alternate progress indicator seems to work fine, but the default one is all over the place. Attaching screenshots below but could also try a git bisect if it's not reproducible on your end.
2.17.3 vs 2.17.4: