From: Dmitry Volyntsev Date: Thu, 23 Jun 2022 06:37:15 +0000 (-0700) Subject: Stream: throwing an exception when s.done() is used while filtering. X-Git-Tag: 0.7.6~16 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=8dfc60b505da81d1430a79b86044f6e89a2d95e8;p=njs.git Stream: throwing an exception when s.done() is used while filtering. --- diff --git a/nginx/ngx_stream_js_module.c b/nginx/ngx_stream_js_module.c index 8897b3ae..50c02acc 100644 --- a/nginx/ngx_stream_js_module.c +++ b/nginx/ngx_stream_js_module.c @@ -1114,6 +1114,11 @@ ngx_stream_js_ext_done(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, ctx = ngx_stream_get_module_ctx(s, ngx_stream_js_module); + if (ctx->filter) { + njs_vm_error(vm, "should not be called while filtering"); + return NJS_ERROR; + } + ngx_log_debug1(NGX_LOG_DEBUG_STREAM, s->connection->log, 0, "stream js set status: %i", status);