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 <petar.paradzik@sartura.hr>
This commit is contained in:
Petar Paradzik 2017-08-26 12:00:41 +08:00 committed by Andy Green
parent 04134742f9
commit a2943ca41d

View file

@ -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