From a2943ca41db3c49916fa8a714ae19a052db97f24 Mon Sep 17 00:00:00 2001 From: Petar Paradzik Date: Sat, 26 Aug 2017 12:00:41 +0800 Subject: [PATCH] cgi: fix killing cgi before draining its output CGI's which don't have content-length nor they are explicitly chunked are killed immediately after being reaped even if their output has not being drained. This is fixed by deferring from killing them like those which are explicitly chunked. Signed-off-by: Petar Paradzik --- lib/libwebsockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index a3179c69..a6243d01 100755 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -3145,7 +3145,7 @@ lws_cgi_kill_terminated(struct lws_context_per_thread *pt) lwsl_debug("%s: found PID %d on cgi list\n", __func__, n); - if (!cgi->content_length && cgi->explicitly_chunked) { + if (!cgi->content_length) { /* * well, if he sends chunked... give him 5s after the * cgi terminated to send buffered