]> git.kaiwu.me - njs.git/commitdiff
Skip empty buffers in HTTP response send().
authorRoman Arutyunyan <arut@nginx.com>
Wed, 28 Feb 2018 16:16:25 +0000 (19:16 +0300)
committerRoman Arutyunyan <arut@nginx.com>
Wed, 28 Feb 2018 16:16:25 +0000 (19:16 +0300)
Such buffers lead to send errors and should never be sent.

nginx/ngx_http_js_module.c

index d6d0f5b4502670b42f2fb9d41304732824b9be44..2a71c51b7c74badf772abcc0f54ec12f6ebbe58f 100644 (file)
@@ -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,