1
0
mirror of https://github.com/graygnuorg/pound.git synced 2026-10-23 22:28:53 +03:00

7 Commits

Author SHA1 Message Date
Sergey Poznyakoff
0e5d6f999c Lua support
Lua functions can be used as checks in Service section (LuaMatch
statement) as well as to implement new backends (LuaBackend
statement).  Lua is configured and its sources are loaded in the
new Lua section statement.

This commit also fixes a minor bug in SendFile implementation.

* .github/workflows/testsuite.yml: Test Lua
* NEWS: Version 4.18.90
* configure.ac: Test for Lua. New option: --with-lua.
* src/pndlua.c: New file.
* src/Makefile.am [COND_LUA] (pound_SOURCES): Add pndlua.c
* src/pound.h (http_header_list_append): Mark text as const.
(http_header_list_remove_field)
(http_request_count_query_param): New proto.
(PNDLUA_CTX_GLOBAL, PNDLUA_CTX_THREAD)
(BE_LUA, COND_LUA): New constants.
(pndlua_closure): New struct.
(struct _backend): New member v.lua.
(_service_cond): New member: clua.
(pndlua_init, pndlua_match, pndlua_backend)
(pndlua_parse_config, pndlua_parse_closure): New protos.
* src/config.c: New section: Lua.
New statements: Lua.Path, Lua.CPath, Lua.Load, Lua.LoadGlobal,
LuaMatch, LuaBackend.
(parse_config_file): Call pndlua_init.
(pound_settings): Reflect Lua support.
* src/extern.h (parser_loop): New function.
* src/http.c (file_response): Don't use request.path, call
http_request_get_path instead.  This ensures the request has been
properly parsed.
(http_header_alloc, http_header_list_append): Mark text argument as
static.
(http_header_list_remove_field): New function.
(http_request_count_query_param): New function.
(match_cond): Handle COND_LUA conditionals.
(http_process_request): Handle BE_LUA (Lua backends).
* src/pound-mode.el: Support for Lua keywords.
* src/svc.c (str_be, backend_serialize): Handle BE_LUA.

* src/cfgparser.c (input_gettkn): Improve escape sequence
handling.

* tests/Makefile.am: Add new tests.
* tests/testsuite.at: Likewise.
* tests/atlocal.in (LUA_AVAILABLE): New variable.
* tests/lua-be.at: New file.
* tests/lua-http.at: New file.
* tests/lua-load.at: New file.
* tests/lua-match.at: New file.
* tests/lua-path.at: New file.
* tests/sendfile.at: Test SendFile with unmodified path as well.
2025-11-02 13:46:38 +02:00
Sergey Poznyakoff
2a2ae3d250 Automatic tests for periodic fs changes 2025-07-18 19:58:38 +03:00
Sergey Poznyakoff
4108333a64 Disable DNS-based tests by default.
* configure.ac: New option: --enable-dns-tests
* tests/Makefile.am: Build libfakedns only if COND_BUILD_FAKEDNS is
true (i.e., --enable-dns-tests was given).
* .github/workflows/testsuite.yml: Use --enable-dns-tests for
dynamic backend job.
2024-10-22 08:13:06 +03:00
Sergey Poznyakoff
5ffb8590f3 Try libnet-dns-perl in github workflows. 2024-09-30 16:31:47 +03:00
Sergey Poznyakoff
7690cf22cd workflows: Expand run-check definition 2024-09-12 21:56:47 +03:00
Sergey Poznyakoff
1fff1d3d9d Update github workflows to build a version with dynamic backend support 2024-09-12 18:17:15 +03:00
Sergey Poznyakoff
8b515ae7cf Housekeeping: github workflows 2023-03-07 18:50:13 +02:00