| Message ID | 20260824193812.95168-1-caleb.hensley@lvt.com |
|---|---|
| State | New |
| Headers | show
Return-Path: <swupdate+bncBDFZLJ6E2EGBBLN3WLKAMGQEHS7244I@googlegroups.com>
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@legolas.ozlabs.org
Authentication-Results: legolas.ozlabs.org;
dkim=pass (2048-bit key;
unprotected) header.d=googlegroups.com header.i=@googlegroups.com
header.a=rsa-sha256 header.s=20251104 header.b=DhOfjpqN;
dkim-atps=neutral
Authentication-Results: legolas.ozlabs.org;
spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com
(client-ip=2001:4860:4864:20::38; helo=mail-oa1-x38.google.com;
envelope-from=swupdate+bncbdfzlj6e2egbbln3wlkamgqehs7244i@googlegroups.com;
receiver=patchwork.ozlabs.org)
Received: from mail-oa1-x38.google.com (mail-oa1-x38.google.com
[IPv6:2001:4860:4864:20::38])
(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 4hTLn21t7pz1xpj
for <incoming@patchwork.ozlabs.org>; Tue, 25 Aug 2026 05:38:29 +1000 (AEST)
Received: by mail-oa1-x38.google.com with SMTP id
586e51a60fabf-448bb8bd2efsf11603981fac.0
for <incoming@patchwork.ozlabs.org>;
Mon, 24 Aug 2026 12:38:29 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1787600302; cv=pass;
d=google.com; s=arc-20260327;
b=U1eZg07prwYErF7Ocl1TLXNmpKSy/ILsrmguTVGb6Zzg+LoCpNb1qCR82gANyGX+Tx
TRsYX3c2rzyXm+KYdfYDNvLTyYNmxZ2s3SYJn31E/whdE0TRn/x4XU1Bgr3L1SzxH038
tu4mz8QVIYsgBCs3xB7Vs/621KN7pD0p00ZCwMqKhP43Hu7SEPoygJc7zKiE2fKfgLL/
8mzc3a1rzq0gGWt9XBvUxVjx5udLOJoJYW8ghTyNMJjWlPTliY+qHrwfk0wnicCOXbiW
u751M0yzDIwDxexGwE1Y9HWkiBoN+fwgc8OcmToiedyC6bpHNOiGHHHnDsGlydPfgVhW
Ri4g==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20260327;
h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
:list-id:mailing-list:precedence:reply-to:mime-version:message-id
:date:subject:cc:to:from:dkim-signature;
bh=qh3Q60QW5y0RXFQD2fQL36u7QOrY+EcjgrCYzdEzsmw=;
fh=RfkVWeniRiRHTnQIDZnM9isz4gze4/WOKcYndZ9ugXg=;
b=qHri55wkvFC2SPdRP8MIgZV0yY3s7wexelmnADRDYbL9wXg8+ANgP9pFSufBPki7c1
MWH511g70SMpM/CRj/rxGkmltapSG3vA/TFGm4BkLm9ygPRZ+B5/WZZGFmMNp0d6PwKo
6Vo2kV5W9shrJjS69QIsR4MoyO5qJ9QidejoNKwlREmGWGw071Q/tgbaWK85sDnOgn1G
MNMhT9Oy3WFJOeDr8wCc2vZSMw3241y7oceZSjedunT7RdXDlnj9dqc/61sm+7NERjhX
isBkcOQAi7fVW3jO80LJzojhyM4CA9twnGNUsmzEDKlMiZ/XvqG3DV9fu0Z65h7rzZzl
9kbg==;
darn=patchwork.ozlabs.org
ARC-Authentication-Results: i=2; gmr-mx.google.com;
dkim=pass header.i=@lvt.com header.s=google header.b=RGUd5k4n;
spf=pass (google.com: domain of caleb.hensley@lvt.com designates
2607:f8b0:4864:20::630 as permitted sender)
smtp.mailfrom=caleb.hensley@lvt.com;
dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=lvt.com;
dara=pass header.i=@googlegroups.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=googlegroups.com; s=20251104; t=1787600302; x=1788205102;
darn=patchwork.ozlabs.org;
h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
:list-id:mailing-list:precedence:content-type:reply-to
:x-original-authentication-results:x-original-sender:mime-version
:message-id:date:subject:cc:to:from:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=qh3Q60QW5y0RXFQD2fQL36u7QOrY+EcjgrCYzdEzsmw=;
b=DhOfjpqNSUSYSWw8TwBjcYWpzmSVPeawBX6ChCS1HQASp4VjfBn6Rp1gxCkEdo5hqU
ErqgMTMMT8T46hkIfROwYohSewTblEMkFDUM3vbYiEn3fluqPLpG2WpmiTVB295Bk2W5
5sVHnKzv6gq0B3L3ARQnxrrp1kCK7wKkeXrtT4MuVmt6V4A4rIFTqr+DRepwal0Fvg2R
WYXls76117dUmM2xH55UnvKiHYbKYK4wzkRhKt63ibLXRT5by8OorMeajGe3kCfa6oKP
3rwZNl4YdDIWvSeXqwFwH9mXM8qEtQyelY0udCKtqHZ6uhECfGzhg43xP9Ihmw2hVGlm
eKUQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20251104; t=1787600302; x=1788205102;
h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
:x-spam-checked-in-group:list-id:mailing-list:precedence
:content-type:reply-to:x-original-authentication-results
:x-original-sender:mime-version:message-id:date:subject:cc:to:from
:x-gm-gg:x-beenthere:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=qh3Q60QW5y0RXFQD2fQL36u7QOrY+EcjgrCYzdEzsmw=;
b=Ey3G9+J566pP4U4YYse1TelCf4au4MdrT0QjrMf3IFW1IbzBimf1iwQ0IYOyNyvAhx
7LVSk/Z/BlOfBun9KBc/nVetsFTHdy0Uwq9nYaQiNnU0XojQEarXf9L4BygyU4uTWi0i
G7e9ZaFxHzkPHrtkNJomYekAP2atSVUJIzqn3rl50JGufPywRGw6HMOtarFWizvr+Tib
Lx3ForvLD1VLiIGFZdbbSLfhN2zIkZXFtxO4qkHHWNYn+NA1/y440SM7d/c42Ny2Co53
Hj4lneqBgU7XvufFTWXizUr2Q2iINYwDUj02ma8Jh8RIMSU/Ns0ZuJfjj0d/fEEFaUct
JqOw==
X-Forwarded-Encrypted: i=2;
AHgh+Rr4bwBGQx5JnBXUSWyZff1/CxIyIjAysp5v9cytGohKAivrXAmNxlRUZnKgEW++tTj18LdG5jqk9Q==@patchwork.ozlabs.org
X-Gm-Message-State: AFuF++naQ7Sroee68tEqwXFVqjGJvW4ETj9vhIxAZcFc9eo+XJUxl2d3
a09Oms9tw0a13owXMk3sC05+htZp1LlXI+Flvr9+z+2ReA1qLYIDwYOK
X-Received: by 2002:a05:6820:4df1:b0:6ae:6484:5f40 with SMTP id
006d021491bc7-6b190448747mr1019234eaf.21.1787600302112;
Mon, 24 Aug 2026 12:38:22 -0700 (PDT)
X-BeenThere: swupdate@googlegroups.com;
h="ATskLdf/8q5da8qOXTTVRn4RRWOtEHvKUKYiK27oVoJEgtgmXA=="
Received: by 2002:a05:6820:7151:b0:6b1:4247:4a53 with SMTP id
006d021491bc7-6b183b2c6c7ls906981eaf.1.-pod-prod-07-us; Mon, 24 Aug 2026
12:38:20 -0700 (PDT)
X-Received: by 2002:a05:6830:3106:b0:7ee:38af:b195 with SMTP id
46e09a7af769-7f4af74dfe0mr1239099a34.2.1787600299784;
Mon, 24 Aug 2026 12:38:19 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1787600299; cv=none;
d=google.com; s=arc-20260327;
b=ZrowAqP0/nLo9y4LRuxoweYyQ/jysM6M5kKibfter79xook0dxbdrxKJIh0zODV42Z
+x64Vc0VCOWlV+g2qBPbWShM0EvCnX+4uewgtgfvmU977QPe2o/Y5g7/bcLSGkX3aJ+s
d4hM4FLtQnY/s8tpdN9gTOrVQeWW6ZKESV9v3z3rTaqPpv+UWbjFW+U6gjvNjjQ6ZvNP
CyoWrMQoSDmnPspDOKv1RUkXrtfRL3Qea5xD7HliZGtIWFusjC7CFyslU9F52KMplvrM
vnn/ZJ8jzTTMYS3XDIvSrRUaEPoZ5bAWQKt6k6t4sml9FNsX+iGovXBNN032tsTUj/HM
qLmg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20260327;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:dkim-signature;
bh=np880JKcfk7Q7CMgn/R5TTKpa6cV+6PlyPFhA7N+X7k=;
fh=pRSihHWgYfAbHTf77buTHtrLUw69GVexrJEoeMFGBaQ=;
b=svd2990qL74q7qrtouea63m8Ey2TPIDvUh399GVTu0UccDyNGS9UkNGXyz6LZX785t
JSqxO9l9tNCaBbobMaUYgVSt1G8ICJqExu8u6ZqmF5vFG2Af/RoRbGx6oDV0fofrAqJq
OT0BCiOhGB5J2kqLYOHHvsLW4GaBaoub9Ok3Q/uksxWe8faD2XLUi3karOMb08khCfY0
pQ+Du6Is5iMoRvzQILmgPRikBW0kZ3RIdC8gFGJKTUeM2IYoi0QMOAu2ij6ejvbHbFSu
Rj5a2fjH5EijLkVUjROYS46OtjKXAWHU7+ILAx8B9NQNvCvIOGL27uLwap1Vl1DyIorD
eYZQ==;
dara=google.com
ARC-Authentication-Results: i=1; gmr-mx.google.com;
dkim=pass header.i=@lvt.com header.s=google header.b=RGUd5k4n;
spf=pass (google.com: domain of caleb.hensley@lvt.com designates
2607:f8b0:4864:20::630 as permitted sender)
smtp.mailfrom=caleb.hensley@lvt.com;
dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=lvt.com;
dara=pass header.i=@googlegroups.com
Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com.
[2607:f8b0:4864:20::630])
by gmr-mx.google.com with ESMTPS id
46e09a7af769-7f48faec868si143968a34.2.2026.08.24.12.38.19
for <swupdate@googlegroups.com>
(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
Mon, 24 Aug 2026 12:38:19 -0700 (PDT)
Received-SPF: pass (google.com: domain of caleb.hensley@lvt.com designates
2607:f8b0:4864:20::630 as permitted sender) client-ip=2607:f8b0:4864:20::630;
Received: by mail-pl1-x630.google.com with SMTP id
d9443c01a7336-2cacb8416a1so34069695ad.1
for <swupdate@googlegroups.com>; Mon, 24 Aug 2026 12:38:19 -0700 (PDT)
X-Gm-Gg: AR+sD13/zMS/c4T+iRWbY3l6w6QQ4tMm1r/fCSg+tUREnVXPbssPT/W6avrfunJoFL7
R0112ZN00XICgI3PYEx0oy588Yaf6RDZ/3XjAD524PG2iVEMSVH71zUVlnoWAad3fmS50CWZJt9
6bX45mVRPnKT7TCqgjDDv19QN0CD5pgb5oaLNLDnZoiGbo2f8GGy0/+EIXUHh5qBIEPgDYP9NEp
lQwhXjkkCslki9KUTxZwvARwlCx/h0X87sM5ko7LyyCD3oSPrm8gAQ1baGjp//l8UQ+eLrIYqlF
TrD8EiCvbTQc23WnIZ2AU3WZPtzuNkkOkdZaBs1wG/QWCdkLpdpwQ4aCDVurgGglvJB2okRr6qz
08L6tCfanSA2i3red0EyxPPAbsgg4NNs9Hy2mgtNKmaNgT7vPrIXLfGge8joDXW/krXVyR5UYSc
YM5zTrU6v324rXjlsHFMga5CuhoS8cMM4uID4ajNB2knszSlr7gAb7FGg6OztY+ujy1roGm6WBj
SI1+APwO9Q=
X-Received: by 2002:a17:903:b0c:b0:2d3:160b:c01f with SMTP id
d9443c01a7336-2d6dcaae0dcmr30615745ad.6.1787600298756;
Mon, 24 Aug 2026 12:38:18 -0700 (PDT)
Received: from D90XGQ3969-Hensley ([4.96.101.114])
by smtp.gmail.com with ESMTPSA id
5a478bee46e88-3280782f09fsm21069072eec.20.2026.08.24.12.38.17
(version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);
Mon, 24 Aug 2026 12:38:18 -0700 (PDT)
From: "'Caleb Hensley' via swupdate" <swupdate@googlegroups.com>
To: swupdate@googlegroups.com
Cc: Caleb Hensley <caleb.hensley@lvt.com>
Subject: [swupdate][PATCH v2] fix: do not let channel_get_file resume an
interrupted range request
Date: Mon, 24 Aug 2026 13:38:12 -0600
Message-ID: <20260824193812.95168-1-caleb.hensley@lvt.com>
X-Mailer: git-send-email 2.50.1
MIME-Version: 1.0
X-Original-Sender: caleb.hensley@lvt.com
X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass
header.i=@lvt.com header.s=google header.b=RGUd5k4n; spf=pass
(google.com: domain of caleb.hensley@lvt.com designates
2607:f8b0:4864:20::630
as permitted sender) smtp.mailfrom=caleb.hensley@lvt.com; dmarc=pass
(p=REJECT sp=REJECT dis=NONE) header.from=lvt.com;
dara=pass header.i=@googlegroups.com
X-Original-From: Caleb Hensley <caleb.hensley@lvt.com>
Reply-To: Caleb Hensley <caleb.hensley@lvt.com>
Content-Type: text/plain; charset="UTF-8"
Precedence: list
Mailing-list: list swupdate@googlegroups.com;
contact swupdate+owners@googlegroups.com
List-ID: <swupdate.googlegroups.com>
X-Spam-Checked-In-Group: swupdate@googlegroups.com
X-Google-Group-Id: 605343134186
List-Post: <https://groups.google.com/group/swupdate/post>,
<mailto:swupdate@googlegroups.com>
List-Help: <https://groups.google.com/support/>,
<mailto:swupdate+help@googlegroups.com>
List-Archive: <https://groups.google.com/group/swupdate
List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>,
<mailto:swupdate+subscribe@googlegroups.com>
List-Unsubscribe:
<mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>,
<https://groups.google.com/group/swupdate/subscribe>
|
| Series |
[v2] fix: do not let channel_get_file resume an interrupted range request
|
expand
|
diff --git a/corelib/channel_curl.c b/corelib/channel_curl.c index bae44d85..34a99e81 100644 --- a/corelib/channel_curl.c +++ b/corelib/channel_curl.c @@ -1422,6 +1422,25 @@ channel_op_res_t channel_get_file(channel_t *this, void *data) */ do { if (try_count > 0) { + /* + * A range request cannot be resumed here. `total_bytes_downloaded` + * counts the body bytes of this request, multipart boundaries and + * part headers included, and is not an offset in the file. libcurl + * builds the Range header from CURLOPT_RESUME_FROM when it is set, + * dropping the CURLOPT_RANGE set in channel_set_options(). Without + * this check, that retry would ask for "bytes=<count>-" and collect + * unrelated data up to the end of the file. Pass the curl error to + * the caller and let it resconstruct a new range request. + */ + if (channel_data->range) { + ERROR("Channel range request interrupted after " + "%llu bytes (%d): '%s'", + total_bytes_downloaded, curlrc, + curl_easy_strerror(curlrc)); + result = channel_map_curl_error(curlrc); + goto cleanup_file; + } + if (channel_data->retries == 0) { ERROR( "Channel get operation failed (%d): '%s'\n",
Previously, channel_get_file() retried an interrupted transfer by setting CURLOPT_RESUME_FROM_LARGE to the number of bytes received so far. That is correct for the cached_file case it was written for, where the count is an offset in the file being downloaded, but the delta chunks downloader uses the same function with CURLOPT_RANGE set, and curl_easy_reset() only runs at the end of the call. libcurl builds the Range header from CURLOPT_RESUME_FROM when it is set, so a retry replaces the requested ranges with Range: bytes=<bytes received for this request>- which is neither the right offset nor bounded, and not correct for the delta handler. Report the error instead of resuming here. The handler can implement a range reconstruction strategy to recover from the interrupted request. Signed-off-by: Caleb Hensley <caleb.hensley@lvt.com> --- corelib/channel_curl.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)