aboutsummaryrefslogtreecommitdiff
path: root/nginx/ngx_http_js_module.c
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2018-02-28 19:16:25 +0300
committerRoman Arutyunyan <arut@nginx.com>2018-02-28 19:16:25 +0300
commit2c6c2bbabcaddbeff7b6516c5cdd2e05e5f7590a (patch)
tree3d49104da01698ec9e4387039025e7ba9978ec20 /nginx/ngx_http_js_module.c
parentbd21362fa0473b053514dd6e0518c3f87a0ed42e (diff)
downloadnjs-2c6c2bbabcaddbeff7b6516c5cdd2e05e5f7590a.tar.gz
njs-2c6c2bbabcaddbeff7b6516c5cdd2e05e5f7590a.zip
Skip empty buffers in HTTP response send().
Such buffers lead to send errors and should never be sent.
Diffstat (limited to 'nginx/ngx_http_js_module.c')
-rw-r--r--nginx/ngx_http_js_module.c4
1 files changed, 4 insertions, 0 deletions
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,