From patchwork Thu Oct 10 21:35:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Richard via openwrt-devel X-Patchwork-Id: 1174815 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lists.openwrt.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EnEnDhBV"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46q4LM3b7Mz9s7T for ; Fri, 11 Oct 2019 08:42:18 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Subject: List-Help:Reply-To:List-Archive:List-Unsubscribe:List-Subscribe:Cc:From: List-Post:List-Id:Message-ID:MIME-Version:Date:To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=7K8qw9vUb7hTfGboQ8Hz+xSDm3qQZZYkrIb8IP+0TKk=; b=EnEnDhBV0rULOJeTp3juSdmTUW F1QOqXzODVDtB0RhCV4bLGLw8LQZym3tHmLMMZAP3caGvvL+vsNHxyxBrnYj+RsZByx7tEWHLq3L2 Aaz+igjRWvCh/rAVe0nhJEICr88sRPzBp3qoMl5omC+SDxtMVu0UNaFpQoOr2X9d1ZsOfvn6INLdA xMEHtG8AUevzHoy0xY5XsDRaD6LoMwVZUZYFNnh4C4PBHTNyNoQkRsAeL5eKgPVDpnwcIO6iuW3Zc PsGrnaJBBNbnxcZF/1HuSZei6xImGiiagJueWu6XmEas4GFGsA7mvXi9JqGln9PvmOj3v/V6mXZ26 PWElqALQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iIgCJ-0006wS-Ml; Thu, 10 Oct 2019 21:42:11 +0000 To: openwrt-devel@lists.openwrt.org, nbd@openwrt.org, jo@mein.io Date: Thu, 10 Oct 2019 18:35:53 -0300 MIME-Version: 1.0 Message-ID: List-Id: List-Post: X-Patchwork-Original-From: Santiago Piccinini via openwrt-devel From: Thomas Richard via openwrt-devel Precedence: list Cc: Santiago Piccinini X-Mailman-Version: 2.1.29 X-BeenThere: openwrt-devel@lists.openwrt.org List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: Santiago Piccinini List-Help: Subject: [OpenWrt-Devel] [PATCH] proc: cancel script killing only if process ends Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The sender domain has a DMARC Reject/Quarantine policy which disallows sending mailing list messages using the original "From" header. To mitigate this problem, the original message has been wrapped automatically by the mailing list software. 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 --- proc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/proc.c b/proc.c index 1d63d86..2b69703 100644 --- 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),