Re: Byte range PATCH

Austin William Wright <aaa@bzfx.net> Sat, 06 August 2022 02:21 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 32EF6C15AB6B for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 5 Aug 2022 19:21:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.06
X-Spam-Level:
X-Spam-Status: No, score=-5.06 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.248, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=bzfx.net
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8gtAt16VuuRk for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 5 Aug 2022 19:21:14 -0700 (PDT)
Received: from lyra.w3.org (lyra.w3.org [128.30.52.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4469BC14F75F for <httpbisa-archive-bis2Juki@lists.ietf.org>; Fri, 5 Aug 2022 19:21:13 -0700 (PDT)
Received: from lists by lyra.w3.org with local (Exim 4.94.2) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1oK9Nz-007Nds-Pk for ietf-http-wg-dist@listhub.w3.org; Sat, 06 Aug 2022 02:17:55 +0000
Resent-Date: Sat, 06 Aug 2022 02:17:55 +0000
Resent-Message-Id: <E1oK9Nz-007Nds-Pk@lyra.w3.org>
Received: from titan.w3.org ([128.30.52.76]) by lyra.w3.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <aaa@bzfx.net>) id 1oK9Ny-007Nca-U5 for ietf-http-wg@listhub.w3.org; Sat, 06 Aug 2022 02:17:53 +0000
Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by titan.w3.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from <aaa@bzfx.net>) id 1oK9Nw-00BcbR-Ba for ietf-http-wg@w3.org; Sat, 06 Aug 2022 02:17:53 +0000
Received: by mail-pj1-x1035.google.com with SMTP id pm17so4240642pjb.3 for <ietf-http-wg@w3.org>; Fri, 05 Aug 2022 19:17:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bzfx.net; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=69MaKD/Uwhz25NwM07t5ORyXuJ840kohvdDODUkv9m0=; b=U0svFSHnGBr+QWHo4N8hmu3uJe2pkHnt67hp0eRimpkeE2BHt+D46YayWq/dnwbFOU H58CLNAkn2hB7btDUgIO0MzPyUEUQEqtYbTC53lEo9T46L6jzgX3ecnaKkWP2lxbA8Uf DHexiS+yIR5R5t2XV5ar4/qJlEyV8kjKuWbMI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=69MaKD/Uwhz25NwM07t5ORyXuJ840kohvdDODUkv9m0=; b=bQugfkR9zf2zMy3yPKAAmjupUhgMgpui4xzqkP7cryYLzgwq7MBNMzOnhvBFK0bw2L dVHTiSv6h/nTcGIgdOSU8UH7d3aN73rVRqLUo8DEWyiqwFzBs0CQrKFD/pSph5cL++Jz q7QRoOBhUf5nXZrbkV97Q9NE656g2NrZoIrhjhxyEJsr1ui6+B804huF4LIkg8vg9gSX RjxPQBAGBIlChpVXNUz9vIZrcoIX0uy7rzCvLuiZbgf6SQ+oVe4toEtEhaQoyRQUfVxC iqo4kr00m9SWu9Xy0oETD99wXJyhvjaaW4XqFqDpVnaIg3GMhy/wzfBavofUDBm7meqx 8JAw==
X-Gm-Message-State: ACgBeo25C0Ahc0YwgDytboSWOh/IHA9cPYFd4tvBNd+7Jt09XoBECNa6 D5/CQwekFSMIoTTmQxs/nNTiWg==
X-Google-Smtp-Source: AA6agR5LhV6GEn1ysfe4Kbj8orTkjSdszKWjPiDjevE4kmeVJMZTkE40q/bzFbBi6PnkplH5JIcOcA==
X-Received: by 2002:a17:902:780e:b0:16d:ae4a:eed3 with SMTP id p14-20020a170902780e00b0016dae4aeed3mr9428807pll.129.1659752260766; Fri, 05 Aug 2022 19:17:40 -0700 (PDT)
Received: from smtpclient.apple (71-223-183-211.phnx.qwest.net. [71.223.183.211]) by smtp.gmail.com with ESMTPSA id t5-20020a170902e84500b0016d95380e8esm3668807plg.140.2022.08.05.19.17.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Aug 2022 19:17:39 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\))
From: Austin William Wright <aaa@bzfx.net>
In-Reply-To: <3A341B75-7088-4B8F-96CC-AB25CAC7D842@apple.com>
Date: Fri, 05 Aug 2022 19:17:38 -0700
Cc: ietf-http-wg@w3.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <20CD5B65-BF7E-4628-B36A-B2DEFFEF4CBE@bzfx.net>
References: <E511F4BD-B422-46DA-8409-EBBD684098A6@bzfx.net> <3A341B75-7088-4B8F-96CC-AB25CAC7D842@apple.com>
To: Guoye Zhang <guoye_zhang@apple.com>
X-Mailer: Apple Mail (2.3696.120.41.1.1)
Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=aaa@bzfx.net; helo=mail-pj1-x1035.google.com
X-W3C-Hub-DKIM-Status: validation passed: (address=aaa@bzfx.net domain=bzfx.net), signature is good
X-W3C-Hub-Spam-Status: No, score=-6.1
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, W3C_AA=-1, W3C_DB=-1, W3C_IRA=-1, W3C_WL=-1
X-W3C-Scan-Sig: titan.w3.org 1oK9Nw-00BcbR-Ba 4aa1b6d60cf21eb98e9937fb127c3f17
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Byte range PATCH
Archived-At: <https://www.w3.org/mid/20CD5B65-BF7E-4628-B36A-B2DEFFEF4CBE@bzfx.net>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/40306
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <https://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>


> On Aug 5, 2022, at 17:12, Guoye Zhang <guoye_zhang@apple.com> wrote:
> 
> Hi Austin,
> 
> Thanks for sharing the well-written draft. I’m glad this is being worked on. Two comments:
> 
> (1) As you have already noted, Content-Range forces us to declare an end offset, so it’s unfortunate that a continuous stream with undetermined length has to be sent using multipart encoding.

Yeah. I think the best case is Content-Range is updated to support an indefinite length form.

But a new header could also be defined, like Content-Offset.

> 
> (2) For a general purpose byte range patching mechanism, would you also want to define ways to insert or delete byte ranges?
> 
> A possible approach is to have this be a “replace byte range with” operation instead:
> 
> Replace 0-0 with 100 bytes: insert 100 bytes at the front
> Replace 0-100 with 0 bytes: remove first 100 bytes
> Replace 100-100 with 100 bytes: insert 100 bytes at offset 100


This makes sense!

The server would have to have some way to recognize that the bytes after it are shifting around (e.g. When prepending 100 bytes, byte 0 becomes byte 100), and reject if that’s too much work, or if the filesystem doesn’t support such an operation. Maybe in this situation, the Content-Length header would be required, and then the server could immediately determine if this is a simple overwrite, or if it's actually changing the file size.

Thanks,

Austin.