summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2024-05-27 16:41:55 +0100
committerandrey-zelenkov <xim.andrew@gmail.com>2024-07-02 17:48:00 +0100
commitd62a5e2c3749a927e1f5283c1ad2178d665cd399 (patch)
tree118f4bb866da8b7868ee61a486c94e832e35a7e1
parent8e254a4d6762da22bc1967140ef85cf8fedfa02d (diff)
downloadunit-d62a5e2c3749a927e1f5283c1ad2178d665cd399.tar.gz
unit-d62a5e2c3749a927e1f5283c1ad2178d665cd399.tar.bz2
contrib: updated njs to 0.8.5
njs changed strings API so now instead of njs_vm_value_string_set() used njs_vm_value_string_create() as a drop-in replacement. Link: <https://github.com/nginx/njs/commit/5730d5ffe23a4965c001d873695d22005fcfa588>
-rw-r--r--pkg/contrib/src/njs/SHA512SUMS2
-rw-r--r--pkg/contrib/src/njs/version2
-rw-r--r--src/nxt_http_js.c26
3 files changed, 16 insertions, 14 deletions
diff --git a/pkg/contrib/src/njs/SHA512SUMS b/pkg/contrib/src/njs/SHA512SUMS
index fb49aa98..175c46ee 100644
--- a/pkg/contrib/src/njs/SHA512SUMS
+++ b/pkg/contrib/src/njs/SHA512SUMS
@@ -1 +1 @@
-450f6866141f6f370767149c8749e84c4373f401d6d2237ca85365a851ebe7bdbd8a3c25e85a55747673e8bef2238a979dd237d5fc5c641b2f3f2cf7f26dffc8 njs-0.8.4.tar.gz
+09fb37d609f5cb97b0af5eb097a017233af2eacb2d38071346b49f5e03b5e37280eebb360fc824acba0c600c44d234e2d11fa55f4bc913319491d7789a94171c njs-0.8.5.tar.gz
diff --git a/pkg/contrib/src/njs/version b/pkg/contrib/src/njs/version
index 54ff4620..ebfb5987 100644
--- a/pkg/contrib/src/njs/version
+++ b/pkg/contrib/src/njs/version
@@ -1 +1 @@
-NJS_VERSION := 0.8.4
+NJS_VERSION := 0.8.5
diff --git a/src/nxt_http_js.c b/src/nxt_http_js.c
index 3dbf7970..34689fba 100644
--- a/src/nxt_http_js.c
+++ b/src/nxt_http_js.c
@@ -120,7 +120,8 @@ nxt_http_js_ext_uri(njs_vm_t *vm, njs_object_prop_t *prop,
return NJS_DECLINED;
}
- return njs_vm_value_string_set(vm, retval, r->path->start, r->path->length);
+ return njs_vm_value_string_create(vm, retval, r->path->start,
+ r->path->length);
}
@@ -136,7 +137,8 @@ nxt_http_js_ext_host(njs_vm_t *vm, njs_object_prop_t *prop,
return NJS_DECLINED;
}
- return njs_vm_value_string_set(vm, retval, r->host.start, r->host.length);
+ return njs_vm_value_string_create(vm, retval, r->host.start,
+ r->host.length);
}
@@ -152,9 +154,9 @@ nxt_http_js_ext_remote_addr(njs_vm_t *vm, njs_object_prop_t *prop,
return NJS_DECLINED;
}
- return njs_vm_value_string_set(vm, retval,
- nxt_sockaddr_address(r->remote),
- r->remote->address_length);
+ return njs_vm_value_string_create(vm, retval,
+ nxt_sockaddr_address(r->remote),
+ r->remote->address_length);
}
@@ -215,8 +217,8 @@ nxt_http_js_ext_get_header(njs_vm_t *vm, njs_object_prop_t *prop,
if (key.length == f->name_length
&& memcmp(key.start, f->name, f->name_length) == 0)
{
- return njs_vm_value_string_set(vm, retval, f->value,
- f->value_length);
+ return njs_vm_value_string_create(vm, retval, f->value,
+ f->value_length);
}
} nxt_list_loop;
@@ -251,7 +253,7 @@ nxt_http_js_ext_keys_header(njs_vm_t *vm, njs_value_t *value, njs_value_t *keys)
return NJS_ERROR;
}
- rc = njs_vm_value_string_set(vm, value, f->name, f->name_length);
+ rc = njs_vm_value_string_create(vm, value, f->name, f->name_length);
if (rc != NJS_OK) {
return NJS_ERROR;
}
@@ -297,8 +299,8 @@ nxt_http_js_ext_get_cookie(njs_vm_t *vm, njs_object_prop_t *prop,
if (key.length == nv->name_length
&& memcmp(key.start, nv->name, nv->name_length) == 0)
{
- return njs_vm_value_string_set(vm, retval, nv->value,
- nv->value_length);
+ return njs_vm_value_string_create(vm, retval, nv->value,
+ nv->value_length);
}
}
@@ -341,7 +343,7 @@ nxt_http_js_ext_keys_cookie(njs_vm_t *vm, njs_value_t *value, njs_value_t *keys)
return NJS_ERROR;
}
- rc = njs_vm_value_string_set(vm, value, nv->name, nv->name_length);
+ rc = njs_vm_value_string_create(vm, value, nv->name, nv->name_length);
if (rc != NJS_OK) {
return NJS_ERROR;
}
@@ -381,7 +383,7 @@ nxt_http_js_ext_get_var(njs_vm_t *vm, njs_object_prop_t *prop,
vv = nxt_var_get(&r->task, rtcf->tstr_state, &r->tstr_cache.var, &name, r);
if (vv != NULL) {
- return njs_vm_value_string_set(vm, retval, vv->start, vv->length);
+ return njs_vm_value_string_create(vm, retval, vv->start, vv->length);
}
njs_value_undefined_set(retval);