aboutsummaryrefslogtreecommitdiff
path: root/networking/wget.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'busybox' into mergeRon Yorston2024-09-281-3/+6
|\
| * wget: fix compile warnings when WGET_FTP is not selectedDenys Vlasenko2024-09-261-3/+6
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | wget: let user override Content-LengthRon Yorston2024-07-261-0/+21
| | | | | | | | | | | | | | | | | | The wget applet allows several common headers to be overridden by the user. Add 'Content-Length' to the list. Adds 32-64 bytes. (GitHub issue #432)
* | win32: consolidate executable handling in popen.cRon Yorston2024-07-201-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit f444dc586 (win32: only search PATH for compressor) made mingw_fork_compressor() perform a PATH lookup for the xz and lzma compression programs. This avoided relying on CreateProcess() to perform the search. Other callers of the pipe creation code should also avoid reliance on CreateProcess's executable search: - Move the applet test and PATH lookup into mingw_popen_internal(). The first argument to CreateProcess() will always be a path to an executable. - mingw_fork_compressor() uses the new "w+" mode to indicate that xz and lzma compressors should be found on PATH. - mingw_popen() no longer needs to check for an applet itself, as that's now handled in mingw_popen_internal(). - spawn_ssl_client() in 'wget' can rely on the popen code to look up the 'ssl_client' applet. - Remove unnecessary argument checks in mingw_popen_internal(). Adds 0-24 bytes.
* | Merge branch 'busybox' into mergeRon Yorston2024-07-101-1/+1
|\|
| * wget: ignore header casingSertonix2024-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HTTP headers are case insensitive and therefore the check if a default header has been overwritten needs to be case insensitive. Without this patch `--header 'user-agent: test'` results in `User-Agent: Wget` and `user-agent: test` being send. function old new delta ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0) Total: 0 bytes text data bss dec hex filename 1040876 16443 1840 1059159 102957 busybox_old 1040876 16443 1840 1059159 102957 busybox_unstripped Signed-off-by: Sertonix <sertonix@posteo.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: only search PATH for compressorRon Yorston2023-11-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mingw_fork_compressor() uses CreateProcess() to run the compressor program. This will often be an instance of BusyBox, but since the xv and lzma applets in BusyBox don't support compression it can be an external program. It was intended that the external program should be found using PATH. However, CreateProcess() looks in various other places before trying PATH. In particular, it first looks in the directory of the current executable, then in the current directory of the process. This can result in the wrong xz.exe or lzma.exe being found. Perform an explicit PATH search and force CreateProcess() to use the result. This change only affects the search for a compressor. The same problem also affects other uses of our popen(3) emulation. These may be addressed in future. Costs 64-80 bytes. (GitHub issue #376)
* | Merge branch 'busybox' into mergeRon Yorston2023-07-131-1/+1
|\|
| * Update applet size estimatesDenys Vlasenko2023-07-101-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge busybox into mergeRon Yorston2021-12-271-13/+22
|\| | | | | | | Fix merge conflict in coreutils/timeout.c.
| * wget: allow end-users to customize Content-Type for --post-data and --post-fileIldar Shaimordanov2021-12-121-13/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | More explanation in this PR: https://github.com/rmyorston/busybox-w32/pull/233 The real use-case: wget https://api.github.com/markdown/raw --header "Content-Type: text/plain" function old new delta wget_main 2560 2581 +21 wget_user_headers 62 76 +14 .rodata 104196 104197 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 36/0) Total: 36 bytes Signed-off-by: Ildar Shaimordanov <ildar.shaimordanov@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2021-10-131-3/+23
|\|
| * wget: implement --post-fileRon Yorston2021-10-011-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the --post-file option to send form data from a file. As with --post-data it's up to the user to ensure that the data is encoded as appropriate: all wget does is stuff the provided data into the request. The --post-data and --post-file options are mutually exclusive and only one instance of either may be given. Additionally: - update the usage message to include missing details of the --post-data and --header options; - free POST data if FEATURE_CLEAN_UP is enabled. function old new delta packed_usage 34158 34214 +56 wget_main 2762 2805 +43 .rodata 99225 99240 +15 static.wget_longopts 266 278 +12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/0 up/down: 126/0) Total: 126 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2021-05-141-15/+37
|\|
| * wget: allow HTTP 307/308 redirectsJeremy Lin2021-04-301-0/+2
| | | | | | | | | | | | | | | | | | This resolves failures like wget: server returned error: HTTP/1.1 307 Temporary Redirect Signed-off-by: Jeremy Lin <jeremy.lin@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * wget: new option FEATURE_WGET_FTP to enable/disable FTPSergey Ponomarev2021-03-091-15/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a separate option FTPS_SUPPORTED instead of not obvious ENABLE_FEATURE_WGET_HTTPS. function old new delta P_FTP 4 - -4 P_FTPS 5 - -5 reset_beg_range_to_zero 41 - -41 parse_url 431 366 -65 parse_pasv_epsv 154 - -154 .rodata 115566 115408 -158 ftpcmd 204 - -204 spawn_ssl_client 291 - -291 wget_main 2998 2664 -334 ------------------------------------------------------------------------------ (add/remove: 0/7 grow/shrink: 0/3 up/down: 0/-1256) Total: -1256 bytes Signed-off-by: Sergey Ponomarev <stokito@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2021-01-141-12/+14
|\|
| * help text tweaksDenys Vlasenko2020-12-181-9/+4
| | | | | | | | | | | | | | function old new delta packed_usage 33570 33502 -68 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * wget: do not ftruncate if -O- is used, closes 13351Denys Vlasenko2020-12-081-3/+10
| | | | | | | | | | | | | | | | | | | | function old new delta wget_main 2558 2571 +13 retrieve_file_data 612 621 +9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 22/0) Total: 22 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2020-07-091-4/+17
|\|
| * wget: fix openssl options for cert verificationScott Court2020-06-291-4/+17
| | | | | | | | | | | | | | | | | | | | | | function old new delta is_ip_address - 54 +54 spawn_https_helper_openssl 461 486 +25 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/0 up/down: 79/0) Total: 79 bytes Signed-off-by: Scott Court <z5t1@z5t1.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeFRP-3466-g53c09d0e1Ron Yorston2020-05-291-3/+17
|\|
| * wget: implement TLS verification with ENABLE_FEATURE_WGET_OPENSSLDimitri John Ledkov2020-05-201-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When ENABLE_FEATURE_WGET_OPENSSL is enabled, correctly implement TLS verification by default. And only ignore verification errors, if --no-check-certificate was passed. Also note, that previously OPENSSL implementation did not implement TLS verification, nor printed any warning messages that verification was not performed. Bug-Ubuntu: https://bugs.launchpad.net/bugs/1879533 CVE-2018-1000500 Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2020-01-081-1/+1
|\|
| * wget: increase redirections limitDavid Demelier2019-09-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some hosting services like sourceforge perform a lot of relocations before actually serving the file. Example of current limitation: busybox wget http://sourceforge.net/projects/fluxbox/files/fluxbox/1.3.7/fluxbox-1.3.7.tar.xz Connecting to sourceforge.net (216.105.38.13:80) Connecting to sourceforge.net (216.105.38.13:443) Connecting to sourceforge.net (216.105.38.13:443) Connecting to sourceforge.net (216.105.38.13:443) Connecting to downloads.sourceforge.net (216.105.38.13:443) wget: too many redirections Signed-off-by: David Demelier <markand@malikania.fr> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2019-08-161-11/+11
|\|
| * libbb: reduce the overhead of single parameter bb_error_msg() callsJames Byrne2019-07-021-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Back in 2007, commit 0c97c9d43707 ("'simple' error message functions by Loic Grenie") introduced bb_simple_perror_msg() to allow for a lower overhead call to bb_perror_msg() when only a string was being printed with no parameters. This saves space for some CPU architectures because it avoids the overhead of a call to a variadic function. However there has never been a simple version of bb_error_msg(), and since 2007 many new calls to bb_perror_msg() have been added that only take a single parameter and so could have been using bb_simple_perror_message(). This changeset introduces 'simple' versions of bb_info_msg(), bb_error_msg(), bb_error_msg_and_die(), bb_herror_msg() and bb_herror_msg_and_die(), and replaces all calls that only take a single parameter, or use something like ("%s", arg), with calls to the corresponding 'simple' version. Since it is likely that single parameter calls to the variadic functions may be accidentally reintroduced in the future a new debugging config option WARN_SIMPLE_MSG has been introduced. This uses some macro magic which will cause any such calls to generate a warning, but this is turned off by default to avoid use of the unpleasant macros in normal circumstances. This is a large changeset due to the number of calls that have been replaced. The only files that contain changes other than simple substitution of function calls are libbb.h, libbb/herror_msg.c, libbb/verror_msg.c and libbb/xfuncs_printf.c. In miscutils/devfsd.c, networking/udhcp/common.h and util-linux/mdev.c additonal macros have been added for logging so that single parameter and multiple parameter logging variants exist. The amount of space saved varies considerably by architecture, and was found to be as follows (for 'defconfig' using GCC 7.4): Arm: -92 bytes MIPS: -52 bytes PPC: -1836 bytes x86_64: -938 bytes Note that for the MIPS architecture only an exception had to be made disabling the 'simple' calls for 'udhcp' (in networking/udhcp/common.h) because it made these files larger on MIPS. Signed-off-by: James Byrne <james.byrne@origamienergy.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2019-05-271-1/+1
|\|
| * style fix, no code changesDenys Vlasenko2019-05-141-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | su, wget: use magic '--busybox' flagRon Yorston2019-03-081-1/+2
| | | | | | | | | | | | I've been a bit lax about ensuring the --busybox flag is passed in command lines. It's needed to avoid problems if the binary is called something like sh.exe.
* | Merge branch 'busybox' into mergeRon Yorston2019-02-121-19/+24
|\|
| * wget: detect when the length of received file is less than advertisedDenys Vlasenko2019-01-211-8/+10
| | | | | | | | | | | | | | function old new delta retrieve_file_data 579 596 +17 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * wget: remove empty if/endif preprocessor directive pairDenys Vlasenko2019-01-181-2/+0
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * wget: don't notify on download begin and end if quietMartin Lewis2019-01-171-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When printing notification on download start and end, mistakenly, it didn't respect the quiet option function old new delta retrieve_file_data 561 579 +18 wget_main 2432 2437 +5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 23/0) Total: 23 bytes Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2019-01-101-16/+48
|\|
| * wget: notify on download begin and endMartin Lewis2019-01-041-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using -o to file the progress meter is not displayed, so write that we started the download and that we finished it. function old new delta retrieve_file_data 465 561 +96 wget_main 2412 2432 +20 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 116/0) Total: 116 bytes text data bss dec hex filename 979022 485 7296 986803 f0eb3 busybox_old 979224 485 7296 987005 f0f7d busybox_unstripped Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * wget: add -o flagMartin Lewis2019-01-041-15/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta wget_main 2348 2412 +64 packed_usage 33062 33093 +31 static.wget_longopts 252 266 +14 progress_meter 158 159 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/0 up/down: 110/0) Total: 110 bytes Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * config: update size informationDenys Vlasenko2018-12-281-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2018-11-281-11/+14
|\|
| * wget: code shrinkDenys Vlasenko2018-11-241-8/+6
| | | | | | | | | | | | | | function old new delta base64enc 53 46 -7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * wget: print the final newline only for non-tty outputDenys Vlasenko2018-11-231-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | $ busybox wget URL 2>&1 | cat Connecting to .... install.iso 0% | | 2629k 0:02:05 ETA install.iso 7% |** | 25.7M 0:00:23 ETA install.iso 16% |***** | 54.1M 0:00:14 ETA install.iso 20% |****** | 67.4M 0:00:15 ETA install.iso 25% |******** | 81.0M 0:00:14 ETA install.iso 30% |********* | 97.3M 0:00:13 ETA install.iso 36% |*********** | 117M 0:00:12 ETA install.iso 41% |************* | 134M 0:00:11 ETA install.iso 47% |*************** | 152M 0:00:10 ETA install.iso 54% |***************** | 176M 0:00:08 ETA install.iso 61% |******************* | 200M 0:00:06 ETA install.iso 66% |********************* | 215M 0:00:06 ETA install.iso 71% |********************** | 231M 0:00:05 ETA install.iso 75% |************************ | 244M 0:00:04 ETA install.iso 79% |************************* | 257M 0:00:03 ETA install.iso 84% |*************************** | 275M 0:00:02 ETA install.iso 91% |***************************** | 297M 0:00:01 ETA install.iso 99% |******************************* | 321M 0:00:00 ETA install.iso 100% |********************************| 323M 0:00:00 ETA <-- no empty line here $ function old new delta bb_progress_update 622 632 +10 progress_meter 152 158 +6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 16/0) Total: 16 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tls: code shrinkDenys Vlasenko2018-11-141-1/+1
| | | | | | | | | | | | | | function old new delta spawn_ssl_client 219 218 -1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * wget: print "TLS certificate validation not implemented" only once on redirectsDenys Vlasenko2018-11-131-1/+3
| | | | | | | | | | | | | | function old new delta spawn_ssl_client 209 219 +10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox'Ron Yorston2018-07-251-2/+8
|\|
| * wget: fix fetching of https URLs without http proxyDenys Vlasenko2018-07-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The "fix fetching of https URLs with http proxy" commit broke the usual http-to-https redirect: $ wget http://busybox.net/downloads/busybox-1.29.0.tar.bz2 Connecting to busybox.net (140.211.167.122:80) Connecting to busybox.net (140.211.167.122:443) wget: server returned error: HTTP/1.1 400 Bad Request Fixing... Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * wget: emit a message that certificate verification is not implementedDenys Vlasenko2018-05-281-2/+7
| | | | | | | | | | | | | | function old new delta spawn_ssl_client 185 209 +24 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2018-05-131-11/+11
|\|
| * wget: handle URLs with @ or hash differentlyDenys Vlasenko2018-04-241-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If server replied with 302 and Location: ?foo we used to underflow the allocated space while trying to form the "@foo" filename. Switch to forming "foo" filename. function old new delta packed_usage 32795 32799 +4 parse_url 387 352 -35 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 4/-35) Total: -31 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: new option FEATURE_ETC_SERVICES: if off, /etc/services reads often ↵Denys Vlasenko2018-04-171-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | avoided In practice, "wget http://host.com/" always uses port 80. People explicitly set non-standard ports via options or parameters ("telnet 1.2.3.4 567" or "telnet 1.2.3.4 ftp") instead of modifying /etc/services. function old new delta telnet_main 1466 1464 -2 rdate_main 215 198 -17 fakeidentd_main 269 252 -17 parse_url 459 392 -67 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/4 up/down: 0/-103) Total: -103 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2018-04-091-22/+25
|\|