Welcome! Log In Create A New Profile

Advanced

[njs] Added ngx.conf_prefix.

Dmitry Volyntsev
August 31, 2022 07:54PM
details: https://hg.nginx.org/njs/rev/26b8f0c2ef94
branches:
changeset: 1943:26b8f0c2ef94
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Wed Aug 31 16:52:16 2022 -0700
description:
Added ngx.conf_prefix.

diffstat:

nginx/ngx_js.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)

diffs (45 lines):

diff -r dfbd55660d40 -r 26b8f0c2ef94 nginx/ngx_js.c
--- a/nginx/ngx_js.c Wed Aug 31 16:52:10 2022 -0700
+++ b/nginx/ngx_js.c Wed Aug 31 16:52:16 2022 -0700
@@ -12,6 +12,10 @@
#include "ngx_js_fetch.h"


+njs_int_t ngx_js_ext_conf_prefix(njs_vm_t *vm, njs_object_prop_t *prop,
+ njs_value_t *value, njs_value_t *setval, njs_value_t *retval);
+
+
extern njs_module_t njs_webcrypto_module;


@@ -19,6 +23,14 @@ static njs_external_t ngx_js_ext_core[]

{
.flags = NJS_EXTERN_PROPERTY,
+ .name.string = njs_str("conf_prefix"),
+ .u.property = {
+ .handler = ngx_js_ext_conf_prefix,
+ }
+ },
+
+ {
+ .flags = NJS_EXTERN_PROPERTY,
.name.string = njs_str("ERR"),
.u.property = {
.handler = ngx_js_ext_constant,
@@ -305,6 +317,15 @@ ngx_js_ext_flags(njs_vm_t *vm, njs_objec


njs_int_t
+ngx_js_ext_conf_prefix(njs_vm_t *vm, njs_object_prop_t *prop,
+ njs_value_t *value, njs_value_t *setval, njs_value_t *retval)
+{
+ return njs_vm_value_string_set(vm, retval, ngx_cycle->conf_prefix.data,
+ ngx_cycle->conf_prefix.len);
+}
+
+
+njs_int_t
ngx_js_ext_log(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,
njs_index_t level)
{
_______________________________________________
nginx-devel mailing list -- nginx-devel@nginx.org
To unsubscribe send an email to nginx-devel-leave@nginx.org
Subject Author Views Posted

[njs] Added ngx.conf_prefix.

Dmitry Volyntsev 199 August 31, 2022 07:54PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 198
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready