aboutsummaryrefslogtreecommitdiff
path: root/nginx/ngx_http_js_module.c
diff options
context:
space:
mode:
authorDmitry Volyntsev <xeioex@nginx.com>2024-11-25 21:43:44 -0800
committerDmitry Volyntsev <xeioexception@gmail.com>2024-11-27 14:45:07 -0800
commitb300a93311a4ffeb37ca137eecda5f4cd92b4caf (patch)
treeca69dfbacac209aab35ca0b7e85021c52f2e136e /nginx/ngx_http_js_module.c
parent283282f3656f2d710eb03e64d73dff4256479868 (diff)
downloadnjs-b300a93311a4ffeb37ca137eecda5f4cd92b4caf.tar.gz
njs-b300a93311a4ffeb37ca137eecda5f4cd92b4caf.zip
HTTP: fixed limit rated output.
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.
Diffstat (limited to 'nginx/ngx_http_js_module.c')
-rw-r--r--nginx/ngx_http_js_module.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c
index 3e43ac7d..e900b716 100644
--- a/nginx/ngx_http_js_module.c
+++ b/nginx/ngx_http_js_module.c
@@ -1230,14 +1230,17 @@ ngx_http_js_content_write_event_handler(ngx_http_request_t *r)
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http js content write event handler");
+ c = r->connection;
ctx = ngx_http_get_module_ctx(r, ngx_http_js_module);
if (!ngx_js_ctx_pending(ctx)) {
ngx_http_js_content_finalize(r, ctx);
- return;
+
+ if (!c->buffered) {
+ return;
+ }
}
- c = r->connection;
wev = c->write;
if (wev->timedout) {