diff options
-rw-r--r-- | networking/wget.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/networking/wget.c b/networking/wget.c index 3f3d3a0c9..fa4d21afd 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -248,7 +248,7 @@ struct globals { | |||
248 | * With 512 byte buffer, it was measured to be | 248 | * With 512 byte buffer, it was measured to be |
249 | * an order of magnitude slower than with big one. | 249 | * an order of magnitude slower than with big one. |
250 | */ | 250 | */ |
251 | char wget_buf[CONFIG_FEATURE_COPYBUF_KB*1024] ALIGNED(sizeof(long)); | 251 | char wget_buf[CONFIG_FEATURE_COPYBUF_KB*1024] ALIGNED(16); |
252 | } FIX_ALIASING; | 252 | } FIX_ALIASING; |
253 | #define G (*ptr_to_globals) | 253 | #define G (*ptr_to_globals) |
254 | #define INIT_G() do { \ | 254 | #define INIT_G() do { \ |
@@ -388,9 +388,6 @@ static void set_alarm(void) | |||
388 | * is_ip_address() attempts to verify whether or not a string | 388 | * is_ip_address() attempts to verify whether or not a string |
389 | * contains an IPv4 or IPv6 address (vs. an FQDN). The result | 389 | * contains an IPv4 or IPv6 address (vs. an FQDN). The result |
390 | * of inet_pton() can be used to determine this. | 390 | * of inet_pton() can be used to determine this. |
391 | * | ||
392 | * TODO add proper error checking when inet_pton() returns -1 | ||
393 | * (some form of system error has occurred, and errno is set) | ||
394 | */ | 391 | */ |
395 | static int is_ip_address(const char *string) | 392 | static int is_ip_address(const char *string) |
396 | { | 393 | { |
@@ -1012,6 +1009,15 @@ static void NOINLINE retrieve_file_data(FILE *dfp) | |||
1012 | */ | 1009 | */ |
1013 | } | 1010 | } |
1014 | 1011 | ||
1012 | /* Draw full bar and free its resources */ | ||
1013 | G.chunked = 0; /* makes it show 100% even for chunked download */ | ||
1014 | G.got_clen = 1; /* makes it show 100% even for download of (formerly) unknown size */ | ||
1015 | progress_meter(PROGRESS_END); | ||
1016 | if (G.content_len != 0) { | ||
1017 | bb_perror_msg_and_die("connection closed prematurely"); | ||
1018 | /* GNU wget says "DATE TIME (NN MB/s) - Connection closed at byte NNN. Retrying." */ | ||
1019 | } | ||
1020 | |||
1015 | /* If -c failed, we restart from the beginning, | 1021 | /* If -c failed, we restart from the beginning, |
1016 | * but we do not truncate file then, we do it only now, at the end. | 1022 | * but we do not truncate file then, we do it only now, at the end. |
1017 | * This lets user to ^C if his 99% complete 10 GB file download | 1023 | * This lets user to ^C if his 99% complete 10 GB file download |
@@ -1023,10 +1029,6 @@ static void NOINLINE retrieve_file_data(FILE *dfp) | |||
1023 | ftruncate(G.output_fd, pos); | 1029 | ftruncate(G.output_fd, pos); |
1024 | } | 1030 | } |
1025 | 1031 | ||
1026 | /* Draw full bar and free its resources */ | ||
1027 | G.chunked = 0; /* makes it show 100% even for chunked download */ | ||
1028 | G.got_clen = 1; /* makes it show 100% even for download of (formerly) unknown size */ | ||
1029 | progress_meter(PROGRESS_END); | ||
1030 | if (!(option_mask32 & WGET_OPT_QUIET)) { | 1032 | if (!(option_mask32 & WGET_OPT_QUIET)) { |
1031 | if (G.output_fd == 1) | 1033 | if (G.output_fd == 1) |
1032 | fprintf(stderr, "written to stdout\n"); | 1034 | fprintf(stderr, "written to stdout\n"); |