From d062f85c74fce5e599a42ed07be73e65f35e0f81 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 11 Feb 2020 08:59:48 +0100 Subject: [PATCH] file: poke ustream after starting deferred program When we're starting a deferred request, the related input ustream might have gone into read_blocked mode because incoming client request data exhausted the ustreams internal buffer space. When this happens, edge triggered uloop read events are "lost" and never re-triggered causing the script input to never complete. In order to avoid that deadlock situation, manually poke the input ustream using ustream_poll() after invoking client_poll_post_data() which should have drained (some) of the buffered input ustream contents. Signed-off-by: Jo-Philipp Wich (cherry picked from commit 2ee323c01079248baa9465969df9e25b5fb68cdf) --- file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/file.c b/file.c index da680a0..85487f8 100644 --- a/file.c +++ b/file.c @@ -753,6 +753,7 @@ static void uh_complete_request(struct client *cl) cl->dispatch.data_blocked = false; uh_invoke_script(cl, dr->d, dr->path ? &dr->pi : NULL); client_poll_post_data(cl); + ustream_poll(cl->us); } } -- 2.25.1