summaryrefslogtreecommitdiff
path: root/ngx_lua-0.10.28/src/ngx_http_lua_phase.c
diff options
context:
space:
mode:
authorkaiwu <kaiwu2004@gmail.com>2025-03-01 12:42:23 +0800
committerkaiwu <kaiwu2004@gmail.com>2025-03-01 12:42:23 +0800
commit3f33461e4948bf05e60bdff35ec6c57a649c7860 (patch)
tree284c2ba95a41536ae1bff6bea710db0709a64739 /ngx_lua-0.10.28/src/ngx_http_lua_phase.c
downloadopenresty-3f33461e4948bf05e60bdff35ec6c57a649c7860.tar.gz
openresty-3f33461e4948bf05e60bdff35ec6c57a649c7860.zip
openresty bundle
Diffstat (limited to 'ngx_lua-0.10.28/src/ngx_http_lua_phase.c')
-rw-r--r--ngx_lua-0.10.28/src/ngx_http_lua_phase.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/ngx_lua-0.10.28/src/ngx_http_lua_phase.c b/ngx_lua-0.10.28/src/ngx_http_lua_phase.c
new file mode 100644
index 0000000..85f1e7a
--- /dev/null
+++ b/ngx_lua-0.10.28/src/ngx_http_lua_phase.c
@@ -0,0 +1,31 @@
+
+/*
+ * Copyright (C) Yichun Zhang (agentzh)
+ */
+
+
+#ifndef DDEBUG
+#define DDEBUG 0
+#endif
+#include "ddebug.h"
+
+
+#include "ngx_http_lua_common.h"
+
+
+int
+ngx_http_lua_ffi_get_phase(ngx_http_request_t *r, char **err)
+{
+ ngx_http_lua_ctx_t *ctx;
+
+ ctx = ngx_http_get_module_ctx(r, ngx_http_lua_module);
+ if (ctx == NULL) {
+ *err = "no request context";
+ return NGX_ERROR;
+ }
+
+ return ctx->context;
+}
+
+
+/* vi:set ft=c ts=4 sw=4 et fdm=marker: */