summaryrefslogtreecommitdiff
path: root/lua.c
AgeCommit message (Collapse)Author
2018-08-23lua: support multiple Lua prefixesJo-Philipp Wich
Allow -l / -L arguments to be repeated to register multiple Lua prefix handlers in the same process. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-01-24lua: honour size argument in recv() functionJo-Philipp Wich
The existing implementation incorrectly attempted to read the entire stdin instead of fetching at most the given amount of bytes. While we're at it, also make the size argument optional and let it default to Luas internal buffer size. Suggested-by: Bryan Mayland <bmayland+lede@capnbry.net> Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2016-10-25lua: ensure that PATH_INFO starts with a slashJo-Philipp Wich
When calculating the matching prefix length, make sure to not take the trailing slash into account in order to ensure that the resulting PATH_INFO string always starts with a slash. This ensures that an url like "/foo" against the matching prefix "/" or "/foo/bar" against "/foo/" result in "/foo" and "/bar" respectively. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2015-01-25lua: don't make uhttpd_plugin symbol constantJo-Philipp Wich
uhttpd modifies the list_head member of the uhttpd_plugin struct when loading a plugin, therefore we cannot make it const, otherwise we trigger a security violation if uhttpd is built with RelRO support. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2014-09-03lua: fix error reporting when Lua handler cannot be compiledJo-Philipp Wich
Reported-by: Sebastian Apel <sebastian.apel@gmx.de> Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2013-11-16lua: fix lua 5.2 compatibilityFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-03-18lua: fix query string handling, the QUERY_STRING environment variable must ↵Jo-Philipp Wich
not contain the leading question mark
2013-01-19add support for deferring script requests, limit maximum number of script ↵Felix Fietkau
calls to 3, maximum number of connections to 100 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-13relicense to ISCFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-06de-constify the url parameter for the handler, it becomes invalid after the ↵Felix Fietkau
request anyway
2013-01-05add a c function for .send and .sendcFelix Fietkau
2013-01-05add header table for lua callsFelix Fietkau
2013-01-04add lua plugin supportFelix Fietkau