diff options
author | Jo-Philipp Wich <jo@mein.io> | 2021-11-23 19:30:30 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-02-07 11:44:36 +0100 |
commit | 881a059977166f9ef45fdcc283f763b75409b217 (patch) | |
tree | 410afbce61e0151098d06094458395df5dd014ce /package/network/services/uhttpd/files/uhttpd.init | |
parent | 2dd6777f15defc6fe343e8485d3e22325570fb2b (diff) | |
download | upstream-881a059977166f9ef45fdcc283f763b75409b217.tar.gz upstream-881a059977166f9ef45fdcc283f763b75409b217.tar.bz2 upstream-881a059977166f9ef45fdcc283f763b75409b217.zip |
uhttpd: update to latest Git HEAD
2f8b136 main: fix leaking -p/-s argument values
881fd3b ucode: adjust to latest ucode api
8b2868e file: specify UTF-8 as charset for dirlists, add option to override
3a5bd84 main: add ucode options to help text
16aa142 examples: add ucode handler example
3ceccd0 ucode: add ucode plugin support
f0f1406 examples: add example Lua handler script
9e87095 listen: avoid invalid memory access
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'package/network/services/uhttpd/files/uhttpd.init')
-rwxr-xr-x | package/network/services/uhttpd/files/uhttpd.init | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/package/network/services/uhttpd/files/uhttpd.init b/package/network/services/uhttpd/files/uhttpd.init index 30fd7b4259..8dbc23f59c 100755 --- a/package/network/services/uhttpd/files/uhttpd.init +++ b/package/network/services/uhttpd/files/uhttpd.init @@ -91,6 +91,18 @@ append_lua_prefix() { fi } +append_ucode_prefix() { + local v="$1" + local prefix="${v%%=*}" + local handler="${v#*=}" + + if [ "$prefix" != "$handler" ] && [ -n "$prefix" ] && [ -f "$handler" ]; then + procd_append_param command -o "$prefix" -O "$handler" + else + echo "Skipping invalid ucode prefix \"$v\"" >&2 + fi +} + start_instance() { UHTTPD_CERT="" @@ -142,6 +154,9 @@ start_instance() append_arg "$cfg" ubus_socket "-U" append_bool "$cfg" ubus_cors "-X" 0 } + [ -f /usr/lib/uhttpd_ucode.so ] && { + config_list_foreach "$cfg" ucode_prefix append_ucode_prefix + } append_arg "$cfg" script_timeout "-t" append_arg "$cfg" network_timeout "-T" append_arg "$cfg" http_keepalive "-k" |