openresty / meta-lua-nginx-module Goto Github PK
View Code? Open in Web Editor NEWMeta Lua Nginx Module supporting both Http Lua Module and Stream Lua Module
Meta Lua Nginx Module supporting both Http Lua Module and Stream Lua Module
Let's do this in meta lua module for the stream version:
diff --git a/src/ngx_stream_lua_common.h b/src/ngx_stream_lua_common.h
index f727943..8bb7503 100644
--- a/src/ngx_stream_lua_common.h
+++ b/src/ngx_stream_lua_common.h
@@ -43,8 +43,8 @@
#endif
-#if !defined(nginx_version) || (nginx_version < 1006000)
-#error at least nginx 1.6.0 is required but found an older version
+#if !defined(nginx_version) || (nginx_version < 1013006)
+#error at least nginx 1.13.6 is required but found an older version
#endif
Can we use ngx_*_lua_shdict as a third party moduel, which applies for shdict
from nginx. We can uses FFI to share memory to http module and stream module, instead of http or stream using its own memory only
See
diff --git a/src/api/ngx_stream_lua_api.h b/src/api/ngx_stream_lua_api.h
index c2a7764..9c1d08f 100644
--- a/src/api/ngx_stream_lua_api.h
+++ b/src/api/ngx_stream_lua_api.h
@@ -21,7 +21,7 @@
/* Public API for other Nginx modules */
-#define ngx_stream_lua_version 10012
+#define ngx_stream_lua_version 4
typedef struct {
The dev
branch should die and get renamed to master
.
What is the status of the meta module in respect to the http module.
A diff between the generated output of the meta module for the http subsystem and the http modules committed files shows many differences. After a few fixes to the meta module (e.g splitice@b4a3d6c) output it does compile, it does not however pass tests.
Perhaps the README should be extended with some documentation as to the current status?
Let's make mini-tt2 generate a block comment at the beginning of each output C file which states that the file was automatically generated from the path of some .tt2 file and should never be edited directly by hand and etc.
The word "subsystem" is too long and too heavy and appears so many times in all the templates and directory and file names. Let's abbreviate it to "subsys". Also, there is all-upper-case form like the SUBSYSTEM
tt2 variable.
Some compilations units like shdict.c, string.c, lex.c, regex.c, and etc, could share the object code directly between http and stream modules in the final nginx executable. We could simply make the http and stream lua module depend on this meta lua module not only at codegen time, but also at compile and link time :)
Let's make mini-tt2 emit C line control macros to the C output like below:
#line 32 "src/http/ngx_http_lua_foo.c.tt2"
So that it would be easier to debug any compilation errors or runtime C backtraces directly in the template files.
Right now, make SUBSYS=xxx
always generate code into build/src/
, this is not desired. Better make it possible to specify a DESTDIR
variable.
For now, we should have at least basic sanity checks that makes sure the templates are syntactically correct. We can also execute ngx-relang
against the generated files once we are confident they all satisfies NGINX's coding styles.
I compiled a list of commits from ngx_http_lua that are not yet ported to this module (excluding the currently opened PRs):
ngx_http_lua master branch (last updated: 2019/08/27 - ngx_http_lua HEAD: 9b22495)
ssl_session_fetch_by_lua*
)set_by_lua_file
with NGINX vars)init_worker_by_lua
mutating main confs)ngx_http_lua v0.10.15
init_worker_by*
with NGINX >= 1.15.0)ngx_stream_lua test cases to port
ngx_stream_lua features to port
ngx.pipe
API in streamngx.process
API in streamtcpsock:receiveany()
API in streamngx.get_phase()
to FFI in streamA declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.