summaryrefslogtreecommitdiff
path: root/networking/wget.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-08-16 09:42:39 +0100
committerRon Yorston <rmy@pobox.com>2019-08-16 09:45:21 +0100
commit517cf74f6265ec4308b790b637b3f9778cbdc6e0 (patch)
treebe9337069b60ca1bb03565d8575bacfc71181003 /networking/wget.c
parentae65dc37bcc9b1d9cef0b111131c79dc4ba1bf51 (diff)
parentac78f2ac96b3efd6551a08e7dc609efa1fb69481 (diff)
downloadbusybox-w32-517cf74f6265ec4308b790b637b3f9778cbdc6e0.tar.gz
busybox-w32-517cf74f6265ec4308b790b637b3f9778cbdc6e0.tar.bz2
busybox-w32-517cf74f6265ec4308b790b637b3f9778cbdc6e0.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'networking/wget.c')
-rw-r--r--networking/wget.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/networking/wget.c b/networking/wget.c
index 44cec2cb5..5b85cce1f 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -368,7 +368,7 @@ static void alarm_handler(int sig UNUSED_PARAM)
368{ 368{
369 /* This is theoretically unsafe (uses stdio and malloc in signal handler) */ 369 /* This is theoretically unsafe (uses stdio and malloc in signal handler) */
370 if (G.die_if_timed_out) 370 if (G.die_if_timed_out)
371 bb_error_msg_and_die("download timed out"); 371 bb_simple_error_msg_and_die("download timed out");
372} 372}
373static void set_alarm(void) 373static void set_alarm(void)
374{ 374{
@@ -452,7 +452,7 @@ static char fgets_trim_sanitize(FILE *fp, const char *fmt)
452 452
453 set_alarm(); 453 set_alarm();
454 if (fgets(G.wget_buf, sizeof(G.wget_buf), fp) == NULL) 454 if (fgets(G.wget_buf, sizeof(G.wget_buf), fp) == NULL)
455 bb_perror_msg_and_die("error getting response"); 455 bb_simple_perror_msg_and_die("error getting response");
456 clear_alarm(); 456 clear_alarm();
457 457
458 buf_ptr = strchrnul(G.wget_buf, '\n'); 458 buf_ptr = strchrnul(G.wget_buf, '\n');
@@ -639,7 +639,7 @@ static char *get_sanitized_hdr(FILE *fp)
639 639
640static void reset_beg_range_to_zero(void) 640static void reset_beg_range_to_zero(void)
641{ 641{
642 bb_error_msg("restart failed"); 642 bb_simple_error_msg("restart failed");
643 G.beg_range = 0; 643 G.beg_range = 0;
644 xlseek(G.output_fd, 0, SEEK_SET); 644 xlseek(G.output_fd, 0, SEEK_SET);
645 /* Done at the end instead: */ 645 /* Done at the end instead: */
@@ -657,7 +657,7 @@ static int spawn_https_helper_openssl(const char *host, unsigned port)
657 657
658 if (socketpair(AF_UNIX, SOCK_STREAM, 0, sp) != 0) 658 if (socketpair(AF_UNIX, SOCK_STREAM, 0, sp) != 0)
659 /* Kernel can have AF_UNIX support disabled */ 659 /* Kernel can have AF_UNIX support disabled */
660 bb_perror_msg_and_die("socketpair"); 660 bb_simple_perror_msg_and_die("socketpair");
661 661
662 if (!strchr(host, ':')) 662 if (!strchr(host, ':'))
663 host = allocated = xasprintf("%s:%u", host, port); 663 host = allocated = xasprintf("%s:%u", host, port);
@@ -731,7 +731,7 @@ static void spawn_ssl_client(const char *host, int network_fd, int flags)
731 731
732 if (!(option_mask32 & WGET_OPT_NO_CHECK_CERT)) { 732 if (!(option_mask32 & WGET_OPT_NO_CHECK_CERT)) {
733 option_mask32 |= WGET_OPT_NO_CHECK_CERT; 733 option_mask32 |= WGET_OPT_NO_CHECK_CERT;
734 bb_error_msg("note: TLS certificate validation not implemented"); 734 bb_simple_error_msg("note: TLS certificate validation not implemented");
735 } 735 }
736 736
737 servername = xstrdup(host); 737 servername = xstrdup(host);
@@ -740,7 +740,7 @@ static void spawn_ssl_client(const char *host, int network_fd, int flags)
740 740
741 if (socketpair(AF_UNIX, SOCK_STREAM, 0, sp) != 0) 741 if (socketpair(AF_UNIX, SOCK_STREAM, 0, sp) != 0)
742 /* Kernel can have AF_UNIX support disabled */ 742 /* Kernel can have AF_UNIX support disabled */
743 bb_perror_msg_and_die("socketpair"); 743 bb_simple_perror_msg_and_die("socketpair");
744 744
745 fflush_all(); 745 fflush_all();
746 pid = BB_MMU ? xfork() : xvfork(); 746 pid = BB_MMU ? xfork() : xvfork();
@@ -818,7 +818,7 @@ static FILE* prepare_ftp_session(FILE **dfpp, struct host_info *target, len_and_
818#endif 818#endif
819 819
820 if (ftpcmd(NULL, NULL, sfp) != 220) 820 if (ftpcmd(NULL, NULL, sfp) != 220)
821 bb_error_msg_and_die("%s", G.wget_buf); 821 bb_simple_error_msg_and_die(G.wget_buf);
822 /* note: ftpcmd() sanitizes G.wget_buf, ok to print */ 822 /* note: ftpcmd() sanitizes G.wget_buf, ok to print */
823 823
824 /* Split username:password pair */ 824 /* Split username:password pair */
@@ -981,7 +981,7 @@ static void NOINLINE retrieve_file_data(FILE *dfp)
981 if (errno != EAGAIN) { 981 if (errno != EAGAIN) {
982 if (ferror(dfp)) { 982 if (ferror(dfp)) {
983 progress_meter(PROGRESS_END); 983 progress_meter(PROGRESS_END);
984 bb_perror_msg_and_die(bb_msg_read_error); 984 bb_simple_perror_msg_and_die(bb_msg_read_error);
985 } 985 }
986 break; /* EOF, not error */ 986 break; /* EOF, not error */
987 } 987 }
@@ -994,7 +994,7 @@ static void NOINLINE retrieve_file_data(FILE *dfp)
994# if ENABLE_FEATURE_WGET_TIMEOUT 994# if ENABLE_FEATURE_WGET_TIMEOUT
995 if (second_cnt != 0 && --second_cnt == 0) { 995 if (second_cnt != 0 && --second_cnt == 0) {
996 progress_meter(PROGRESS_END); 996 progress_meter(PROGRESS_END);
997 bb_error_msg_and_die("download timed out"); 997 bb_simple_error_msg_and_die("download timed out");
998 } 998 }
999# endif 999# endif
1000 /* We used to loop back to poll here, 1000 /* We used to loop back to poll here,
@@ -1047,7 +1047,7 @@ static void NOINLINE retrieve_file_data(FILE *dfp)
1047 G.got_clen = 1; /* makes it show 100% even for download of (formerly) unknown size */ 1047 G.got_clen = 1; /* makes it show 100% even for download of (formerly) unknown size */
1048 progress_meter(PROGRESS_END); 1048 progress_meter(PROGRESS_END);
1049 if (G.content_len != 0) { 1049 if (G.content_len != 0) {
1050 bb_perror_msg_and_die("connection closed prematurely"); 1050 bb_simple_perror_msg_and_die("connection closed prematurely");
1051 /* GNU wget says "DATE TIME (NN MB/s) - Connection closed at byte NNN. Retrying." */ 1051 /* GNU wget says "DATE TIME (NN MB/s) - Connection closed at byte NNN. Retrying." */
1052 } 1052 }
1053 1053
@@ -1381,7 +1381,7 @@ However, in real world it was observed that some web servers
1381 } 1381 }
1382 if (key == KEY_location && status >= 300) { 1382 if (key == KEY_location && status >= 300) {
1383 if (--redir_limit == 0) 1383 if (--redir_limit == 0)
1384 bb_error_msg_and_die("too many redirections"); 1384 bb_simple_error_msg_and_die("too many redirections");
1385 fclose(sfp); 1385 fclose(sfp);
1386 if (str[0] == '/') { 1386 if (str[0] == '/') {
1387 free(redirected_path); 1387 free(redirected_path);