Age | Commit message (Collapse) | Author |
|
Binary string comparisons in ucode are currently unsafe, so use the
`length()` function to determine the just read data chunk size in
order to test for end of file.
Fixes: #6530
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
The variable `err` was used without initialized.
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
|
|
Ensure that `http.write()` or template rendering operations after a call
to `http.close()` do not produce additional output. This is required for
certain legacy Lua apps which invoke write and close operations in the
middle of a server side cbi rendering process.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
In case a callback is installed from Lua code, the received callback
argument is not a callable function but a resource object with a call
method. Attempts to call it will leading to a `Type error: left-hand
side is not a function` error.
To solve this issue, invoke the internally set filehandler instead
which wraps the resource if needed.
Fixes: #6067
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Move classes required for Lua runtime support into a new `luci-lua-runtime`
package. Also replace the `luci.http` and `luci.util` classes in
`luci-lib-base` with stubbed versions interacting with the ucode based
runtime environment.
Finally merge `luci-base-ucode` into the remainders of `luci-base`.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|