| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, when processing requests with If-Match and
If-Unmodified-Since headers worker process crashed.
For example with the following code:
try { r.return(200) }
catch (e) { r.internalRedirect() }
The fix is to disable not_modified filter as it was done in
nginx perl module nginx/nginx@d9887ee2.
|
| |
|
|
|
|
|
|
|
|
|
| |
A new optional state parameter is added for js_shared_dict_zone
directive. state parameter specifies a file that keeps the current state
of the shared dict in the JSON format and makes it persistent
across nginx restarts.
This closes #709 feature request on Github.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Implemented atom IDs for strings, symbols and small numbers, enabling
equality checks via ID comparison
- Optimized string operations for faster property lookups and comparisons
- Removed short string inlining from njs_value_t structure
Performance improvements (arewefastyet/benchmarks/v8-v7 benchmark):
- Richards: +57% (631 → 989)
- Crypto: +7% (1445 → 1551)
- RayTrace: +37% (562 → 772)
- NavierStokes: +20% (2062 → 2465)
- Overall score: +29% (1014 → 1307)
In collaboration with Dmitry Volyntsev.
|
| |
|
|
|
|
| |
Missed in cec9a1650.
|
|
|
|
| |
This fixes #872 on Github.
|
|
|
|
| |
No functional changes.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
The HTTP and Stream JS modules were performing in-place lowercasing of
variable and header names, which could inadvertently overwrite the
original data.
In the NJS engine, the problem did not manifest itself for strings up to
14 bytes long because they are inlined into the value.
|
|
|
|
|
|
| |
Previously, an exception was thrown when accessing r.requestText or
r.requestBuffer if a client request body size exceeded
client_body_buffer_size.
|
| |
|
| |
|
|
|
|
|
|
| |
Previously, when r.return(code, body) was called from a subrequest
handler with a body size larger than the sendfile_max_chunk value
connection hanging might occur.
|
| |
|
| |
|
|
|
|
| |
Found by Clang static analyzer.
|
| |
|
|
|
|
|
|
| |
The issue was introduced in a14be61c86 (0.8.5).
This fixes #783 on Github.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"js_engine" directive is introduced which sets JavaScript engine.
When the module is built with QuickJS library "js_engine qjs;" sets
QuickJS engine for the current block. By default njs engine is used.
For example,
nginx.conf:
location /a {
js_engine qjs;
# will be handled by QuickJS
js_content main.handler;
}
location /b {
# will be handled by njs
js_content main.handler;
}
QuickJS engine implements drop-in replacement for nginx/njs objects
with the following exceptions:
* nginx module API to be added later: ngx.fetch(), ngx.shared.dict.
* Built-in modules to be added later: fs, crypto, WebCrypto, xml.
* NJS specific API: njs.dump(), njs.on(), console.dump().
* js_preload_object directive.
|
|
|
|
| |
No functional changes.
|
|
|
|
|
|
|
|
|
|
| |
This commit adds support for an additional `nocache` flag in `js_set`
directives. If set, the resulting nginx variable will have no_cacheable set
to 1. This enables us to dynamically recompute a variable if the context
changed (for example, in case of an internal redirection).
In case of multiple calls in a location, users should cache the result in a
rewrite variable: `set $cached_variable $js_variable;`
|
| |
|
| |
|
|
|
|
| |
So it can be reused by QuickJS code.
|
|
|
|
| |
So it can be reused by QuickJS code.
|
|
|
|
|
| |
Moving promise callbacks from ctx->promise_callbacks to
the arguments of ngx_js_event_t.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Previously, when at least 2 subrequests were scheduled they both
succeed, but the callback for the second threw an exception
heap-use-after-free happened: a nested chain of
ngx_http_run_posted_requests() calls and terminating request in the
inner call left outer calls with already freed request pointer.
The issue was introduced in 0.8.1 (4cb8e873e8c6).
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
Since 6fb1aca4eeaf (0.8.4) the identical js_set variables introduced as
a part of an include file that is shared amongst multiple vhosts are
rejected during configuration parsing.
The patch ignores duplicate js_set variables when they refer to the same
JS function.
This fixes #705 issue on Github.
|
|
|
|
|
|
| |
Previously, only string value type was accepted.
This closes #701 issue on Github.
|
|
|
|
| |
This closes #700 issue on Github.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Previously, when js_periodic is enabled the Reading statistic
was growing each time the js_periodic handler was called.
The issue was introduced in f1bd0b1db065 (0.8.1).
This fixes #692 issue on Github.
|
|
|
|
|
|
|
|
| |
HostPromiseRejectionTracker should be implemented by host
environment according to ECMAScript specs.
The following method was removed: njs_vm_unhandled_rejection().
The following method was introduced: njs_vm_set_rejection_tracker().
|
|
|
|
| |
Found by UndefinedBehaviorSanitizer.
|
|
|
|
|
| |
Logger is not part of the JS runtime according to ECMAScript and should
be implemented by host environment.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To align njs with other JS engines, async events are removed from njs
core. The following functions were removed: njs_vm_add_event(),
njs_vm_del_event(), njs_vm_waiting(). Instead the host is expected
to manage async events by itself.
In addition, the posted events are renamed to jobs, to better align with
the ECMA specs. The following methods are removed: njs_vm_run().
Instead, the host is expected to call njs_vm_execute_pending_job() in a
loop to execute pending jobs. The following functions were added:
njs_vm_enqueue_job().
|
|
|
|
|
| |
This functions are not part of the ECMAScript and should be
implemented by host environment.
|
|
|
|
|
| |
After previous commit ngx_js_retval() is only used for getting the
exception value and should be renamed to better reflect the purpose.
|
|
|
|
|
|
|
|
|
| |
Previously, a Buffer value which contains invalid UTF-8 when returned as a
value for js_set handler was mangled because the bytes value was converted to a
string value.
The fix is to use bytes value of Buffer, TypedArray and ArrayBuffer as is,
and not convert it to a string first.
|
| |
|