aboutsummaryrefslogtreecommitdiff
path: root/nginx/ngx_stream_js_module.c
diff options
context:
space:
mode:
authorDmitry Volyntsev <xeioex@nginx.com>2024-05-17 21:54:50 -0700
committerDmitry Volyntsev <xeioex@nginx.com>2024-05-17 21:54:50 -0700
commit5730d5ffe23a4965c001d873695d22005fcfa588 (patch)
tree385cac68617efbf90e073c7c82fb78f59bce385e /nginx/ngx_stream_js_module.c
parentde552ba66e2851cbe57f32f7c47a38460290a6d5 (diff)
downloadnjs-5730d5ffe23a4965c001d873695d22005fcfa588.tar.gz
njs-5730d5ffe23a4965c001d873695d22005fcfa588.zip
Change: removed byte strings API.
These functions are unsafe because they produce byte strings. Byte strings may not work as expected with the existing JS methods. The following functions were removed: - njs_vm_value_string_set() use njs_vm_value_string_create() as a drop-in replacement. - njs_vm_value_string_alloc() use njs_chb_t and njs_vm_value_string_create_chb() instead. This fixes #710 on Github.
Diffstat (limited to 'nginx/ngx_stream_js_module.c')
-rw-r--r--nginx/ngx_stream_js_module.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/nginx/ngx_stream_js_module.c b/nginx/ngx_stream_js_module.c
index b8b29a56..23c288bc 100644
--- a/nginx/ngx_stream_js_module.c
+++ b/nginx/ngx_stream_js_module.c
@@ -1241,8 +1241,8 @@ ngx_stream_js_ext_get_remote_address(njs_vm_t *vm,
c = s->connection;
- return njs_vm_value_string_set(vm, retval, c->addr_text.data,
- c->addr_text.len);
+ return njs_vm_value_string_create(vm, retval, c->addr_text.data,
+ c->addr_text.len);
}