diff options
author | Dmitry Volyntsev <xeioex@nginx.com> | 2024-05-17 21:54:50 -0700 |
---|---|---|
committer | Dmitry Volyntsev <xeioex@nginx.com> | 2024-05-17 21:54:50 -0700 |
commit | 5730d5ffe23a4965c001d873695d22005fcfa588 (patch) | |
tree | 385cac68617efbf90e073c7c82fb78f59bce385e /nginx/ngx_stream_js_module.c | |
parent | de552ba66e2851cbe57f32f7c47a38460290a6d5 (diff) | |
download | njs-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.c | 4 |
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); } |