aboutsummaryrefslogtreecommitdiff
path: root/docs (unfollow)
Commit message (Collapse)AuthorFilesLines
2 dayslibbb: fix regression where 'which' output duplicate slashesRon Yorston1-0/+8
If an element of $PATH had a trailing slash 'which' displayed two slashes when an executable was found in that directory. This is a regression caused by upstream commit 49d9e06fb (libbb: modify find_executable() to not temporarily write to PATH). Prior to this commit find_executable() used concat_path_file() to build the path of the executable. This avoids including duplicate slashes in its output. The new code didn't. Add a test in find_executable() to detect the problem. It still fails if there are multiple trailing slashes. Don't do that. Adds 48 bytes.
4 daysash: remove unnecessary conditional compilationRon Yorston1-4/+0
Additional support for background jobs was added in commits 010abea6f and 1403d81c4. The condition ENABLE_PLATFORM_POSIX || JOBS_WIN32 in showjob() is always true. The conditional compilation can be removed.
5 daysash: don't skip exec() if std streams are invalidRon Yorston1-1/+3
This didn't produce the expected output when run from ash: ash -c "echo abc | sed s/a/x/" <&- In general, if the last command in the pipe read from stdin the command didn't work; if it read from file descriptor 0 (e.g. cat) it did. Closing a file descriptor caused the corresponding stream to become invalid. For performance reasons the shell in busybox-w32 runs applets without an exec(), but that results in their seeing the invalid stream from their parent. Avoid the problem by calling exec() in such cases. This causes the child process to get a new stdin stream initialised from the file descriptor. The test also applies to stdout and stderr. There's no discernable affect on performance when running the test suite. Adds 64-96 bytes. (GitHub issue #558)
6 dayslibbb: code shrinkRon Yorston2-16/+30
Fix some compiler warnings and move the CNG algorithm caches into get_alg_handle(). Saves 32 bytes in the x86_64 build with CNG enabled.
6 dayslibbb: update CNG API config messagerfl8901-2/+3
7 dayslibbb: refactor CNG hashing implementationrfl8904-47/+110
The existing CNG implementation relied on multiple features only implemented in "newer" Windows versions. This new implementation does not use the aforementioned features and is therefore compatible with systems running Windows Vista or higher. function old new delta .rdata 87112 87288 +176 hmac_peek_hash 80 208 +128 get_alg_handle - 96 +96 algorithm_provider_hmac_cache - 48 +48 algorithm_provider_cache - 48 +48 alg_id_mappings - 48 +48 sha512_begin 16 48 +32 sha384_begin 16 48 +32 sha256_begin 16 48 +32 sha1_begin 16 48 +32 md5_begin 16 32 +16 hmac_hash_v 48 64 +16 hmac_end 48 64 +16 hmac_blocks.constprop.0 96 112 +16 __imp_BCryptOpenAlgorithmProvider - 8 +8 __imp_BCryptDuplicateHash - 8 +8 BCryptOpenAlgorithmProvider - 8 +8 BCryptDuplicateHash - 8 +8 ------------------------------------------------------------------------------ (add/remove: 8/0 grow/shrink: 10/0 up/down: 768/0) Total: 768 bytes
8 daysmake: bring into alignment with pdpmakeRon Yorston1-2/+3
The make applet is based on code from pdpmake. Make a few minor adjustments to bring the two into line. The only one of any significance is setting 'target' to NULL in docmds(). Adds 16 bytes.
10 dayshttpd: code shrinkbusyboxDenys Vlasenko1-18/+22
function old new delta send_file_and_exit 931 933 +2 get_line 126 120 -6 httpd_main 968 959 -9 send_headers 708 694 -14 handle_incoming_and_exit 2285 2270 -15 cgi_io_loop_and_exit 635 620 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/5 up/down: 2/-59) Total: -57 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
11 daysawk: use more understandable form of "split-globals" trickDenys Vlasenko2-39/+36
function old new delta parse_expr 986 998 +12 chain_group 633 640 +7 next_token 930 934 +4 getvar_s 102 101 -1 awk_main 891 888 -3 evaluate 3379 3355 -24 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/3 up/down: 23/-28) Total: -5 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
11 dayshttpd: code shrink via "split-globals" trickDenys Vlasenko2-3/+18
function old new delta httpd_main 957 968 +11 log_and_exit 25 26 +1 send_headers 712 708 -4 handle_incoming_and_exit 2292 2285 -7 sigalrm_handler 102 93 -9 parse_conf 1332 1323 -9 send_cgi_and_exit 803 790 -13 cgi_io_loop_and_exit 656 635 -21 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/6 up/down: 12/-63) Total: -51 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
11 dayshttpd: implement POSTDATA read timeout, and -K KILLSECS CGI lifetime controlDenys Vlasenko1-59/+110
function old new delta cgi_io_loop_and_exit 496 656 +160 sigalrm_handler 1 102 +101 .rodata 106814 106853 +39 send_cgi_and_exit 770 803 +33 packed_usage 35894 35924 +30 httpd_main 950 957 +7 handle_incoming_and_exit 2297 2292 -5 send_REQUEST_TIMEOUT_and_exit 10 - -10 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 6/1 up/down: 370/-15) Total: 355 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
11 daysjoin: add some more testsRon Yorston2-1/+31
One more from the POSIX documentation and some examples from coreutils.
11 dayshttpd: fix incorrect == comparison in last commit, must be !=Denys Vlasenko1-1/+3
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
11 dayshttpd: smarter handling of CGI's "Status: " headerDenys Vlasenko1-10/+13
Do one less write() function old new delta handle_incoming_and_exit 2290 2297 +7 cgi_io_loop_and_exit 498 500 +2 .rodata 106821 106814 -7 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 9/-7) Total: 2 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
11 dayshttpd: simplify CGI headers handling, check "HTTP/1.1" prefix, not just "HTTP"Denys Vlasenko2-28/+32
function old new delta cgi_io_loop_and_exit 477 498 +21 .rodata 106830 106821 -9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 21/-9) Total: 12 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 dayshttpd: simplify CGI code a bit, add a bunch of TODOs and FIXMEsDenys Vlasenko2-29/+37
function old new delta log_and_exit 33 25 -8 handle_incoming_and_exit 2298 2290 -8 send_cgi_and_exit 784 770 -14 cgi_io_loop_and_exit 538 477 -61 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/4 up/down: 0/-91) Total: -91 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 dayshttpd: do not force clean connection termination on write errors and timeoutsDenys Vlasenko1-24/+45
function old new delta send_file_and_exit 891 931 +40 send_EOF_and_exit - 14 +14 cgi_io_loop_and_exit 535 538 +3 log_and_exit 44 33 -11 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/1 up/down: 57/-11) Total: 46 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 dayshttpd: make timeout messages less confusingDenys Vlasenko1-6/+10
function old new delta send_file_and_exit 891 930 +39 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 dayshttpd: time out data writes after 60 seconds of no progressDenys Vlasenko1-13/+45
function old new delta prepare_write_timeout - 29 +29 static.tv - 16 +16 httpd_main 939 950 +11 send_file_and_exit 887 891 +4 handle_incoming_and_exit 2306 2298 -8 cgi_io_loop_and_exit 552 535 -17 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 2/2 up/down: 60/-25) Total: 35 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 dayshttpd: optimize header reading timeout codeDenys Vlasenko1-4/+10
Set up the signal handler once, outside of main loop. Do not reset the timer if headers are big - they still are expected to arrive quickly. function old new delta httpd_main 913 939 +26 handle_incoming_and_exit 2312 2306 -6 get_line 134 126 -8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 26/-14) Total: 12 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 dayshttpd: when reading headers, abort if they are too longDenys Vlasenko1-7/+9
function old new delta get_line 130 134 +4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 dayshttpd: reject request line and headers with control charsDenys Vlasenko1-0/+12
This removes the need to check various corner cases later. function old new delta get_line 108 130 +22 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 dayshttpd: allow http2 requests if proxying, tighten METHOD checksDenys Vlasenko1-9/+16
function old new delta handle_incoming_and_exit 2264 2312 +48 httpd_main 915 913 -2 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 48/-2) Total: 46 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 daysUpdate default configurationsRon Yorston5-6/+11
12 dayshttpd: fix compilation script of httpd_ratelimit_cgi.cDenys Vlasenko2-2/+4
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 dayshttpd: add -M MAXCONN - do not accept unlimited number of connectionsDenys Vlasenko1-19/+86
We were lacking even basic rate-limiting. function old new delta httpd_main 648 915 +267 handle_incoming_and_exit 2235 2264 +29 packed_usage 35868 35894 +26 cgi_io_loop_and_exit 537 552 +15 send_headers 704 712 +8 get_line 106 108 +2 .rodata 106829 106830 +1 send_file_and_exit 890 887 -3 mini_httpd 161 - -161 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 7/1 up/down: 348/-164) Total: 184 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 dayshttpd: stop disabling/enabling SIGHUP in every childDenys Vlasenko1-8/+13
function old new delta sighup_handler 30 47 +17 httpd_main 710 695 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 17/-15) Total: 2 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 dayshttpd: remove one close() from main loopDenys Vlasenko1-5/+6
function old new delta httpd_main 701 710 +9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 daysnetworking/httpd_ratelimit_cgi.c: new example CGI handlerDenys Vlasenko2-1/+248
text data bss dec hex filename 4003 40 352 4395 112b httpd_ratelimit_cgi Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
13 dayshttpd: expand logging: now can see what CGIs are startedDenys Vlasenko1-26/+45
function old new delta send_cgi_and_exit 711 784 +73 vmstat_main 657 708 +51 .rodata 106746 106778 +32 send_file_and_exit 877 887 +10 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/0 up/down: 166/0) Total: 166 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-20ash: don't display ^C twiceRon Yorston1-1/+1
Since commit f7bcc977c (ash: make ctrl-c trap handling closer to upstream) when ctrl-c was entered at an interactive prompt without a 'trap INT' in force, '^C' was echoed to the console twice. Detect this condition and avoid the duplication. Adds 16 bytes.
2026-01-20vmstat: fix I/O, int and ctxt rates: need to be divided by secondsDenys Vlasenko1-5/+8
function old new delta vmstat_main 657 708 +51 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-20vmstat: fixes for >4TB memory and long sampling intervalsDenys Vlasenko1-39/+75
function old new delta load_row 661 1061 +400 vmstat_main 561 657 +96 .rodata 106716 106746 +30 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 526/0) Total: 526 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-19win32: mkdtemp is available in mingw-w64 14.0.0Ron Yorston1-0/+2
mingw-w64 has introduced an implementation of mkdtemp() for its 14.0.0 release. Use this in preference to the internal code, where available. (GitHub issue #555)
2026-01-19vmstat: fix "vmstat N 0" to act compatibly (do not print infinitely)Denys Vlasenko1-5/+12
function old new delta vmstat_main 559 561 +2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-19vmstat: smarter handling of header re-printingDenys Vlasenko1-23/+30
function old new delta vmstat_main 230 559 +329 print_row 340 - -340 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/0 up/down: 329/-340) Total: -11 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-18vmstat: show shorter, human-readable accumulating counts if they grow largeDenys Vlasenko1-13/+29
function old new delta print_row 247 340 +93 .rodata 106717 106716 -1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 93/-1) Total: 92 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-18vmstat: reduce the chances of misaligned columnsDenys Vlasenko1-8/+26
function old new delta print_row 215 247 +32 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2026-01-18vmstat: code shrinkDenys Vlasenko1-28/+39
function old new delta load_row 667 661 -6 next_col 105 59 -46 coldescs 239 146 -93 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-145) Total: -145 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>