[njs] Modules: removed non needed argument from meta handlers.
noreply at nginx.com
noreply at nginx.com
Fri Jul 26 00:56:02 UTC 2024
details: https://github.com/nginx/njs/commit/af7847fa6b5c8e6e5bdcae897dbb4f7ee9e8ef04
branches: master
commit: af7847fa6b5c8e6e5bdcae897dbb4f7ee9e8ef04
user: Dmitry Volyntsev <xeioex at nginx.com>
date: Wed, 24 Jul 2024 22:19:33 -0700
description:
Modules: removed non needed argument from meta handlers.
---
nginx/ngx_http_js_module.c | 40 ++++++++++++++++++----------------------
nginx/ngx_js.h | 37 ++++++++++++++++---------------------
nginx/ngx_stream_js_module.c | 41 ++++++++++++++++++-----------------------
3 files changed, 52 insertions(+), 66 deletions(-)
diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c
index a38d32cf..86d907df 100644
--- a/nginx/ngx_http_js_module.c
+++ b/nginx/ngx_http_js_module.c
@@ -257,18 +257,14 @@ static njs_int_t ngx_http_js_server(njs_vm_t *vm, ngx_http_request_t *r,
unsigned flags, njs_str_t *name, njs_value_t *setval,
njs_value_t *retval);
-static ngx_pool_t *ngx_http_js_pool(njs_vm_t *vm, ngx_http_request_t *r);
-static ngx_resolver_t *ngx_http_js_resolver(njs_vm_t *vm,
- ngx_http_request_t *r);
-static ngx_msec_t ngx_http_js_resolver_timeout(njs_vm_t *vm,
- ngx_http_request_t *r);
-static ngx_msec_t ngx_http_js_fetch_timeout(njs_vm_t *vm,
- ngx_http_request_t *r);
-static size_t ngx_http_js_buffer_size(njs_vm_t *vm, ngx_http_request_t *r);
-static size_t ngx_http_js_max_response_buffer_size(njs_vm_t *vm,
- ngx_http_request_t *r);
+static ngx_pool_t *ngx_http_js_pool(ngx_http_request_t *r);
+static ngx_resolver_t *ngx_http_js_resolver(ngx_http_request_t *r);
+static ngx_msec_t ngx_http_js_resolver_timeout(ngx_http_request_t *r);
+static ngx_msec_t ngx_http_js_fetch_timeout(ngx_http_request_t *r);
+static size_t ngx_http_js_buffer_size(ngx_http_request_t *r);
+static size_t ngx_http_js_max_response_buffer_size(ngx_http_request_t *r);
static void ngx_http_js_event_finalize(ngx_http_request_t *r, ngx_int_t rc);
-static ngx_js_ctx_t *ngx_http_js_ctx(njs_vm_t *vm, ngx_http_request_t *r);
+static ngx_js_ctx_t *ngx_http_js_ctx(ngx_http_request_t *r);
static void ngx_http_js_periodic_handler(ngx_event_t *ev);
static void ngx_http_js_periodic_shutdown_handler(ngx_event_t *ev);
@@ -297,8 +293,8 @@ static void *ngx_http_js_create_loc_conf(ngx_conf_t *cf);
static char *ngx_http_js_merge_loc_conf(ngx_conf_t *cf, void *parent,
void *child);
-static ngx_ssl_t *ngx_http_js_ssl(njs_vm_t *vm, ngx_http_request_t *r);
-static ngx_flag_t ngx_http_js_ssl_verify(njs_vm_t *vm, ngx_http_request_t *r);
+static ngx_ssl_t *ngx_http_js_ssl(ngx_http_request_t *r);
+static ngx_flag_t ngx_http_js_ssl_verify(ngx_http_request_t *r);
static ngx_int_t ngx_http_js_parse_unsafe_uri(ngx_http_request_t *r,
njs_str_t *uri, njs_str_t *args);
@@ -4291,14 +4287,14 @@ ngx_http_js_periodic_init(ngx_js_periodic_t *periodic)
static ngx_pool_t *
-ngx_http_js_pool(njs_vm_t *vm, ngx_http_request_t *r)
+ngx_http_js_pool(ngx_http_request_t *r)
{
return r->pool;
}
static ngx_resolver_t *
-ngx_http_js_resolver(njs_vm_t *vm, ngx_http_request_t *r)
+ngx_http_js_resolver(ngx_http_request_t *r)
{
ngx_http_core_loc_conf_t *clcf;
@@ -4309,7 +4305,7 @@ ngx_http_js_resolver(njs_vm_t *vm, ngx_http_request_t *r)
static ngx_msec_t
-ngx_http_js_resolver_timeout(njs_vm_t *vm, ngx_http_request_t *r)
+ngx_http_js_resolver_timeout(ngx_http_request_t *r)
{
ngx_http_core_loc_conf_t *clcf;
@@ -4320,7 +4316,7 @@ ngx_http_js_resolver_timeout(njs_vm_t *vm, ngx_http_request_t *r)
static ngx_msec_t
-ngx_http_js_fetch_timeout(njs_vm_t *vm, ngx_http_request_t *r)
+ngx_http_js_fetch_timeout(ngx_http_request_t *r)
{
ngx_http_js_loc_conf_t *jlcf;
@@ -4331,7 +4327,7 @@ ngx_http_js_fetch_timeout(njs_vm_t *vm, ngx_http_request_t *r)
static size_t
-ngx_http_js_buffer_size(njs_vm_t *vm, ngx_http_request_t *r)
+ngx_http_js_buffer_size(ngx_http_request_t *r)
{
ngx_http_js_loc_conf_t *jlcf;
@@ -4342,7 +4338,7 @@ ngx_http_js_buffer_size(njs_vm_t *vm, ngx_http_request_t *r)
static size_t
-ngx_http_js_max_response_buffer_size(njs_vm_t *vm, ngx_http_request_t *r)
+ngx_http_js_max_response_buffer_size(ngx_http_request_t *r)
{
ngx_http_js_loc_conf_t *jlcf;
@@ -4375,7 +4371,7 @@ ngx_http_js_event_finalize(ngx_http_request_t *r, ngx_int_t rc)
static ngx_js_ctx_t *
-ngx_http_js_ctx(njs_vm_t *vm, ngx_http_request_t *r)
+ngx_http_js_ctx(ngx_http_request_t *r)
{
return ngx_http_get_module_ctx(r, ngx_http_js_module);
}
@@ -4844,7 +4840,7 @@ ngx_http_js_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
static ngx_ssl_t *
-ngx_http_js_ssl(njs_vm_t *vm, ngx_http_request_t *r)
+ngx_http_js_ssl(ngx_http_request_t *r)
{
#if (NGX_HTTP_SSL)
ngx_http_js_loc_conf_t *jlcf;
@@ -4859,7 +4855,7 @@ ngx_http_js_ssl(njs_vm_t *vm, ngx_http_request_t *r)
static ngx_flag_t
-ngx_http_js_ssl_verify(njs_vm_t *vm, ngx_http_request_t *r)
+ngx_http_js_ssl_verify(ngx_http_request_t *r)
{
#if (NGX_HTTP_SSL)
ngx_http_js_loc_conf_t *jlcf;
diff --git a/nginx/ngx_js.h b/nginx/ngx_js.h
index 189d4878..beccbfdf 100644
--- a/nginx/ngx_js.h
+++ b/nginx/ngx_js.h
@@ -39,19 +39,14 @@ typedef struct ngx_js_dict_s ngx_js_dict_t;
typedef struct ngx_js_ctx_s ngx_js_ctx_t;
-typedef ngx_pool_t *(*ngx_external_pool_pt)(njs_vm_t *vm, njs_external_ptr_t e);
+typedef ngx_pool_t *(*ngx_external_pool_pt)(njs_external_ptr_t e);
typedef void (*ngx_js_event_finalize_pt)(njs_external_ptr_t e, ngx_int_t rc);
-typedef ngx_resolver_t *(*ngx_external_resolver_pt)(njs_vm_t *vm,
- njs_external_ptr_t e);
-typedef ngx_msec_t (*ngx_external_timeout_pt)(njs_vm_t *vm,
- njs_external_ptr_t e);
-typedef ngx_flag_t (*ngx_external_flag_pt)(njs_vm_t *vm,
- njs_external_ptr_t e);
-typedef ngx_flag_t (*ngx_external_size_pt)(njs_vm_t *vm,
- njs_external_ptr_t e);
-typedef ngx_ssl_t *(*ngx_external_ssl_pt)(njs_vm_t *vm, njs_external_ptr_t e);
-typedef ngx_js_ctx_t *(*ngx_js_external_ctx_pt)(njs_vm_t *vm,
- njs_external_ptr_t e);
+typedef ngx_resolver_t *(*ngx_external_resolver_pt)(njs_external_ptr_t e);
+typedef ngx_msec_t (*ngx_external_timeout_pt)(njs_external_ptr_t e);
+typedef ngx_flag_t (*ngx_external_flag_pt)(njs_external_ptr_t e);
+typedef ngx_flag_t (*ngx_external_size_pt)(njs_external_ptr_t e);
+typedef ngx_ssl_t *(*ngx_external_ssl_pt)(njs_external_ptr_t e);
+typedef ngx_js_ctx_t *(*ngx_js_external_ctx_pt)(njs_external_ptr_t e);
typedef struct {
@@ -150,28 +145,28 @@ struct ngx_js_ctx_s {
#define ngx_external_connection(vm, e) \
(*((ngx_connection_t **) ((u_char *) (e) + njs_vm_meta(vm, 0))))
#define ngx_external_pool(vm, e) \
- ((ngx_external_pool_pt) njs_vm_meta(vm, 1))(vm, e)
+ ((ngx_external_pool_pt) njs_vm_meta(vm, 1))(e)
#define ngx_external_resolver(vm, e) \
- ((ngx_external_resolver_pt) njs_vm_meta(vm, 2))(vm, e)
+ ((ngx_external_resolver_pt) njs_vm_meta(vm, 2))(e)
#define ngx_external_resolver_timeout(vm, e) \
- ((ngx_external_timeout_pt) njs_vm_meta(vm, 3))(vm, e)
+ ((ngx_external_timeout_pt) njs_vm_meta(vm, 3))(e)
#define ngx_external_event_finalize(vm) \
((ngx_js_event_finalize_pt) njs_vm_meta(vm, 4))
#define ngx_external_ssl(vm, e) \
- ((ngx_external_ssl_pt) njs_vm_meta(vm, 5))(vm, e)
+ ((ngx_external_ssl_pt) njs_vm_meta(vm, 5))(e)
#define ngx_external_ssl_verify(vm, e) \
- ((ngx_external_flag_pt) njs_vm_meta(vm, 6))(vm, e)
+ ((ngx_external_flag_pt) njs_vm_meta(vm, 6))(e)
#define ngx_external_fetch_timeout(vm, e) \
- ((ngx_external_timeout_pt) njs_vm_meta(vm, 7))(vm, e)
+ ((ngx_external_timeout_pt) njs_vm_meta(vm, 7))(e)
#define ngx_external_buffer_size(vm, e) \
- ((ngx_external_size_pt) njs_vm_meta(vm, 8))(vm, e)
+ ((ngx_external_size_pt) njs_vm_meta(vm, 8))(e)
#define ngx_external_max_response_buffer_size(vm, e) \
- ((ngx_external_size_pt) njs_vm_meta(vm, 9))(vm, e)
+ ((ngx_external_size_pt) njs_vm_meta(vm, 9))(e)
#define NGX_JS_MAIN_CONF_INDEX 10
#define ngx_main_conf(vm) \
((ngx_js_main_conf_t *) njs_vm_meta(vm, NGX_JS_MAIN_CONF_INDEX))
#define ngx_external_ctx(vm, e) \
- ((ngx_js_external_ctx_pt) njs_vm_meta(vm, 11))(vm, e)
+ ((ngx_js_external_ctx_pt) njs_vm_meta(vm, 11))(e)
#define ngx_js_prop(vm, type, value, start, len) \
diff --git a/nginx/ngx_stream_js_module.c b/nginx/ngx_stream_js_module.c
index 23c288bc..4de0cb4f 100644
--- a/nginx/ngx_stream_js_module.c
+++ b/nginx/ngx_stream_js_module.c
@@ -119,18 +119,14 @@ static njs_int_t ngx_stream_js_periodic_variables(njs_vm_t *vm,
njs_object_prop_t *prop, njs_value_t *value, njs_value_t *setval,
njs_value_t *retval);
-static ngx_pool_t *ngx_stream_js_pool(njs_vm_t *vm, ngx_stream_session_t *s);
-static ngx_resolver_t *ngx_stream_js_resolver(njs_vm_t *vm,
- ngx_stream_session_t *s);
-static ngx_msec_t ngx_stream_js_resolver_timeout(njs_vm_t *vm,
- ngx_stream_session_t *s);
-static ngx_msec_t ngx_stream_js_fetch_timeout(njs_vm_t *vm,
- ngx_stream_session_t *s);
-static size_t ngx_stream_js_buffer_size(njs_vm_t *vm, ngx_stream_session_t *s);
-static size_t ngx_stream_js_max_response_buffer_size(njs_vm_t *vm,
- ngx_stream_session_t *s);
+static ngx_pool_t *ngx_stream_js_pool(ngx_stream_session_t *s);
+static ngx_resolver_t *ngx_stream_js_resolver(ngx_stream_session_t *s);
+static ngx_msec_t ngx_stream_js_resolver_timeout(ngx_stream_session_t *s);
+static ngx_msec_t ngx_stream_js_fetch_timeout(ngx_stream_session_t *s);
+static size_t ngx_stream_js_buffer_size(ngx_stream_session_t *s);
+static size_t ngx_stream_js_max_response_buffer_size(ngx_stream_session_t *s);
static void ngx_stream_js_event_finalize(ngx_stream_session_t *s, ngx_int_t rc);
-static ngx_js_ctx_t *ngx_stream_js_ctx(njs_vm_t *vm, ngx_stream_session_t *s);
+static ngx_js_ctx_t *ngx_stream_js_ctx(ngx_stream_session_t *s);
static void ngx_stream_js_periodic_handler(ngx_event_t *ev);
static void ngx_stream_js_periodic_event_handler(ngx_event_t *ev);
@@ -157,9 +153,8 @@ static char *ngx_stream_js_merge_srv_conf(ngx_conf_t *cf, void *parent,
static char *ngx_stream_js_shared_dict_zone(ngx_conf_t *cf, ngx_command_t *cmd,
void *conf);
-static ngx_ssl_t *ngx_stream_js_ssl(njs_vm_t *vm, ngx_stream_session_t *s);
-static ngx_flag_t ngx_stream_js_ssl_verify(njs_vm_t *vm,
- ngx_stream_session_t *s);
+static ngx_ssl_t *ngx_stream_js_ssl(ngx_stream_session_t *s);
+static ngx_flag_t ngx_stream_js_ssl_verify(ngx_stream_session_t *s);
#if (NGX_STREAM_SSL)
@@ -1648,14 +1643,14 @@ ngx_stream_js_periodic_variables(njs_vm_t *vm, njs_object_prop_t *prop,
static ngx_pool_t *
-ngx_stream_js_pool(njs_vm_t *vm, ngx_stream_session_t *s)
+ngx_stream_js_pool(ngx_stream_session_t *s)
{
return s->connection->pool;
}
static ngx_resolver_t *
-ngx_stream_js_resolver(njs_vm_t *vm, ngx_stream_session_t *s)
+ngx_stream_js_resolver(ngx_stream_session_t *s)
{
ngx_stream_core_srv_conf_t *cscf;
@@ -1666,7 +1661,7 @@ ngx_stream_js_resolver(njs_vm_t *vm, ngx_stream_session_t *s)
static ngx_msec_t
-ngx_stream_js_resolver_timeout(njs_vm_t *vm, ngx_stream_session_t *s)
+ngx_stream_js_resolver_timeout(ngx_stream_session_t *s)
{
ngx_stream_core_srv_conf_t *cscf;
@@ -1677,7 +1672,7 @@ ngx_stream_js_resolver_timeout(njs_vm_t *vm, ngx_stream_session_t *s)
static ngx_msec_t
-ngx_stream_js_fetch_timeout(njs_vm_t *vm, ngx_stream_session_t *s)
+ngx_stream_js_fetch_timeout(ngx_stream_session_t *s)
{
ngx_stream_js_srv_conf_t *jscf;
@@ -1688,7 +1683,7 @@ ngx_stream_js_fetch_timeout(njs_vm_t *vm, ngx_stream_session_t *s)
static size_t
-ngx_stream_js_buffer_size(njs_vm_t *vm, ngx_stream_session_t *s)
+ngx_stream_js_buffer_size(ngx_stream_session_t *s)
{
ngx_stream_js_srv_conf_t *jscf;
@@ -1699,7 +1694,7 @@ ngx_stream_js_buffer_size(njs_vm_t *vm, ngx_stream_session_t *s)
static size_t
-ngx_stream_js_max_response_buffer_size(njs_vm_t *vm, ngx_stream_session_t *s)
+ngx_stream_js_max_response_buffer_size(ngx_stream_session_t *s)
{
ngx_stream_js_srv_conf_t *jscf;
@@ -1732,7 +1727,7 @@ ngx_stream_js_event_finalize(ngx_stream_session_t *s, ngx_int_t rc)
static ngx_js_ctx_t *
-ngx_stream_js_ctx(njs_vm_t *vm, ngx_stream_session_t *s)
+ngx_stream_js_ctx(ngx_stream_session_t *s)
{
return ngx_stream_get_module_ctx(s, ngx_stream_js_module);
}
@@ -2384,7 +2379,7 @@ ngx_stream_js_init(ngx_conf_t *cf)
static ngx_ssl_t *
-ngx_stream_js_ssl(njs_vm_t *vm, ngx_stream_session_t *s)
+ngx_stream_js_ssl(ngx_stream_session_t *s)
{
#if (NGX_STREAM_SSL)
ngx_stream_js_srv_conf_t *jscf;
@@ -2399,7 +2394,7 @@ ngx_stream_js_ssl(njs_vm_t *vm, ngx_stream_session_t *s)
static ngx_flag_t
-ngx_stream_js_ssl_verify(njs_vm_t *vm, ngx_stream_session_t *s)
+ngx_stream_js_ssl_verify(ngx_stream_session_t *s)
{
#if (NGX_STREAM_SSL)
ngx_stream_js_srv_conf_t *jscf;
More information about the nginx-devel
mailing list