summaryrefslogtreecommitdiffhomepage
path: root/src
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 /src
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>
Diffstat (limited to 'src')
-rw-r--r--src/nxt_http_js.c26
1 files changed, 14 insertions, 12 deletions
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);