From 290ff883c69ac935ee3f22733d77d2a5a932f585 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 3 Aug 2022 00:23:54 +0200 Subject: relay: trigger close if in header read state with pending data In case a relay process exits without printing at least one newline, relay_close_if_done() will not close the relay context because there's still pending data in the ustream. Extend the relevant condition to only consider pending data if the relay context is not in the header parsing state anymore. Without this fix, requests triggering such a behaviour will never conclude. Signed-off-by: Jo-Philipp Wich --- relay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relay.c b/relay.c index 7331a0a..6db58ac 100644 --- a/relay.c +++ b/relay.c @@ -155,7 +155,7 @@ static void relay_close_if_done(struct uloop_timeout *timeout) while (ustream_poll(&r->sfd.stream)); - if (!(r->process_done || s->eof) || ustream_pending_data(s, false)) + if (!(r->process_done || s->eof) || (ustream_pending_data(s, false) && !r->header_cb)) return; uh_relay_close(r, r->ret); -- cgit v1.2.1