proc: do not cancel script killing after writing headers master
authorSantiago Piccinini <spiccinini@altermundi.net>
Thu, 10 Oct 2019 20:26:48 +0000 (17:26 -0300)
committerDaniel Golle <daniel@makrotopia.org>
Wed, 3 Jun 2020 09:42:58 +0000 (10:42 +0100)
Before this change if the cgi script hangs after writing headers
then the process will never be killed. Let's only cancel the timeout
if the process ends.

Signed-off-by: Santiago Piccinini <spiccinini@altermundi.net>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
proc.c

diff --git a/proc.c b/proc.c
index 1d63d869135f7520d6485e0bff769652ad06d638..2b69703a07106066fccfa71a3f01363454398e93 100644 (file)
--- a/proc.c
+++ b/proc.c
@@ -225,11 +225,9 @@ static void proc_handle_header(struct relay *r, const char *name, const char *va
 static void proc_handle_header_end(struct relay *r)
 {
        struct client *cl = r->cl;
-       struct dispatch_proc *p = &cl->dispatch.proc;
        struct blob_attr *cur;
        int rem;
 
-       uloop_timeout_cancel(&p->timeout);
        uh_http_header(cl, cl->dispatch.proc.status_code, cl->dispatch.proc.status_msg);
        blob_for_each_attr(cur, cl->dispatch.proc.hdr.head, rem)
                ustream_printf(cl->us, "%s: %s\r\n", blobmsg_name(cur),