From 2c6c2bbabcaddbeff7b6516c5cdd2e05e5f7590a Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Wed, 28 Feb 2018 19:16:25 +0300 Subject: [PATCH] Skip empty buffers in HTTP response send(). Such buffers lead to send errors and should never be sent. --- nginx/ngx_http_js_module.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c index d6d0f5b4..2a71c51b 100644 --- a/nginx/ngx_http_js_module.c +++ b/nginx/ngx_http_js_module.c @@ -891,6 +891,10 @@ ngx_http_js_ext_send(njs_vm_t *vm, njs_value_t *args, nxt_uint_t nargs, return NJS_ERROR; } + if (s.length == 0) { + continue; + } + /* TODO: njs_value_release(vm, value) in buf completion */ ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, -- 2.47.3