| Message ID | 20250706230854.1148377-1-hauke@hauke-m.de |
|---|---|
| State | Accepted |
| Delegated to: | Hauke Mehrtens |
| Headers | show
Return-Path:
<openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org>
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@legolas.ozlabs.org
Authentication-Results: legolas.ozlabs.org;
dkim=pass (2048-bit key;
secure) header.d=lists.infradead.org header.i=@lists.infradead.org
header.a=rsa-sha256 header.s=bombadil.20210309 header.b=hVf1SsqT;
dkim=fail reason="signature verification failed" (2048-bit key;
unprotected) header.d=hauke-m.de header.i=@hauke-m.de header.a=rsa-sha256
header.s=MBO0001 header.b=OLp7i8uD;
dkim-atps=neutral
Authentication-Results: legolas.ozlabs.org;
spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org
(client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;
envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org;
receiver=patchwork.ozlabs.org)
Received: from bombadil.infradead.org (bombadil.infradead.org
[IPv6:2607:7c80:54:3::133])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384)
(No client certificate requested)
by legolas.ozlabs.org (Postfix) with ESMTPS id 4bb35L55Wdz1xqg
for <incoming@patchwork.ozlabs.org>; Mon, 7 Jul 2025 09:11:00 +1000 (AEST)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=lists.infradead.org; s=bombadil.20210309; h=Sender:
Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:
List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc
:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:
Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:
List-Owner; bh=slHAyUuIvlREwourNpSMuf4eQKobbiIBzafxpT3hbO0=; b=hVf1SsqTLOTOGG
GF877QYs66LsKLgpEhwbbqkECuLobcunFogfrd1DkgU2LS8Ina2ke6vi4lAAVtc5SDfYuZ+5LFdbG
jBcsw6KcokfdVLmm3WTp6hwmVLtwcG1Z+I0ABgXb4I2eCllqCgKONEvvmuYC7R4OhvOwTfZ/rXh4J
f1aXLJ5nmkJTnabn6EdGh3i8+i0PhxPgq5lW544VPs40dJcIqjn6jxvIvJ0j5Hn9N5z+Nenqdtu26
ZeWhbXbYSkdRYYXmnTljdPz8kzdRPk35HZb0pzF0h+xmWel9O+zZ68fr4/468Jizxfo1/X7upLZDp
d93Ol42e9x3G0YMGqC3g==;
Received: from localhost ([::1] helo=bombadil.infradead.org)
by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))
id 1uYYU9-00000000vX7-3vVV;
Sun, 06 Jul 2025 23:09:25 +0000
Received: from mout-p-202.mailbox.org ([2001:67c:2050:0:465::202])
by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))
id 1uYYU6-00000000vWJ-2Bnj
for openwrt-devel@lists.openwrt.org;
Sun, 06 Jul 2025 23:09:23 +0000
Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202])
(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 mout-p-202.mailbox.org (Postfix) with ESMTPS id 4bb33C1f22z9scC;
Mon, 7 Jul 2025 01:09:11 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hauke-m.de; s=MBO0001;
t=1751843351;
h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
to:to:cc:cc:mime-version:mime-version:
content-transfer-encoding:content-transfer-encoding;
bh=jRtfDK8n52piLUYaNMhYILumCONwPMedmtkIq1O8g10=;
b=OLp7i8uDMKsGwiMkaHDeH9LT+GzFgBwofxbBVVYHqKZ8uSajJNzE2eT05ffROAC0NEk7RD
ZrTKF+LnCwersSoerGqpwUZBkgW9fENW9f+V0W0fZPBZR0j0NXJPCiQ9obUpHZINJ5HlGx
hxAp//z/7EGumzimBMrayE1AVHqOk+kthM07vs9+K+yuICXEEothIB4t1fOKUEIsYrDFlj
KXof9sT4nquw+jHtYPj3JfgW1VeBnk3udZJLr/ewBtdGejx23h5nzIlQnnSX1X3ftPrAFo
0RHqQgPzXFEYLYrG7+UvtCAqC9emgbB9Y5BNQu/3N4NM34ocBDf7Pg3tCeP94w==
From: Hauke Mehrtens <hauke@hauke-m.de>
To: jo@mein.io
Cc: openwrt-devel@lists.openwrt.org,
Hauke Mehrtens <hauke@hauke-m.de>
Subject: [PATCH] client: Allow sending content in DONE state
Date: Mon, 7 Jul 2025 01:08:54 +0200
Message-ID: <20250706230854.1148377-1-hauke@hauke-m.de>
MIME-Version: 1.0
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
X-CRM114-CacheID: sfid-20250706_160922_704254_5C32F7A8
X-CRM114-Status: UNSURE ( 7.94 )
X-CRM114-Notice: Please train this message.
X-Spam-Score: -2.8 (--)
X-Spam-Report: Spam detection software,
running on the system "bombadil.infradead.org",
has NOT identified this incoming email as spam. The original
message has been attached to this so you can view it or label
similar future email. If you have any questions, see
the administrator of that system for details.
Content preview: Allow sending content even when the connection is in done
state. When we run into an error we will be in CLIENT_STATE_DONE state and
have to write some content to the client. Allow writing in normal D [...]
Content analysis details: (-2.8 points, 5.0 required)
pts rule name description
---- ----------------------
--------------------------------------------------
-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low
trust
[2001:67c:2050:0:465:0:0:202 listed in]
[list.dnswl.org]
0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
-0.0 SPF_PASS SPF: sender matches SPF record
0.1 DKIM_SIGNED Message has a DKIM or DK signature,
not necessarily valid
-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from
author's
domain
-0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from
envelope-from domain
-0.1 DKIM_VALID Message has at least one valid DKIM or DK
signature
-1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
[score: 0.0000]
X-BeenThere: openwrt-devel@lists.openwrt.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: OpenWrt Development List <openwrt-devel.lists.openwrt.org>
List-Unsubscribe: <https://lists.openwrt.org/mailman/options/openwrt-devel>,
<mailto:openwrt-devel-request@lists.openwrt.org?subject=unsubscribe>
List-Archive: <http://lists.openwrt.org/pipermail/openwrt-devel/>
List-Post: <mailto:openwrt-devel@lists.openwrt.org>
List-Help: <mailto:openwrt-devel-request@lists.openwrt.org?subject=help>
List-Subscribe: <https://lists.openwrt.org/mailman/listinfo/openwrt-devel>,
<mailto:openwrt-devel-request@lists.openwrt.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: "openwrt-devel" <openwrt-devel-bounces@lists.openwrt.org>
Errors-To:
openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org
|
| Series |
client: Allow sending content in DONE state
|
expand
|
diff --git a/utils.c b/utils.c index 5304c2a..e10d1dc 100644 --- a/utils.c +++ b/utils.c @@ -56,7 +56,8 @@ void uh_chunk_vprintf(struct client *cl, const char *format, va_list arg) va_list arg2; int len; - if (cl->state != CLIENT_STATE_DATA) + if (cl->state != CLIENT_STATE_DATA && + cl->state != CLIENT_STATE_DONE) return; uloop_timeout_set(&cl->timeout, conf.network_timeout * 1000); @@ -91,7 +92,8 @@ void uh_chunk_eof(struct client *cl) if (!uh_use_chunked(cl)) return; - if (cl->state != CLIENT_STATE_DATA) + if (cl->state != CLIENT_STATE_DATA && + cl->state != CLIENT_STATE_DONE) return; ustream_printf(cl->us, "0\r\n\r\n");
Allow sending content even when the connection is in done state. When we run into an error we will be in CLIENT_STATE_DONE state and have to write some content to the client. Allow writing in normal DATA and in DONE state. This fixes http error 403 in LuCI. Fixes: b3e3c05d6781 ("client: don't send stray EOF chunk on connection timeout") Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> --- utils.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)