Re: Byte range PATCH

Austin William Wright <aaa@bzfx.net> Wed, 03 August 2022 20:39 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 B8109C15C503 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 3 Aug 2022 13:39:39 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.76
X-Spam-Level:
X-Spam-Status: No, score=-2.76 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_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 vikDUerufEkn for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 3 Aug 2022 13:39:35 -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 BEC88C14F74E for <httpbisa-archive-bis2Juki@lists.ietf.org>; Wed, 3 Aug 2022 13:39:35 -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 1oJL6t-0006bL-Vp for ietf-http-wg-dist@listhub.w3.org; Wed, 03 Aug 2022 20:36:56 +0000
Resent-Date: Wed, 03 Aug 2022 20:36:55 +0000
Resent-Message-Id: <E1oJL6t-0006bL-Vp@lyra.w3.org>
Received: from mimas.w3.org ([128.30.52.79]) 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 1oJL6t-0006aM-5e for ietf-http-wg@listhub.w3.org; Wed, 03 Aug 2022 20:36:54 +0000
Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by mimas.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 1oJL6q-008D0i-C8 for ietf-http-wg@w3.org; Wed, 03 Aug 2022 20:36:53 +0000
Received: by mail-pf1-x430.google.com with SMTP id 130so9664629pfv.13 for <ietf-http-wg@w3.org>; Wed, 03 Aug 2022 13:36: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=FObB00dP8bxokBdt05AV0LfvNRJf9KkzXUdVKzFcav0=; b=K1ZuVm11aFmuwAPr3WghezZVdpCMFcbW2VDKE9AFjzWOxVovxgI3JVyCJ7JSoaEnm+ Jctsr/aQKKRH9KiMNri7ebJt5SS9R/z9iFZiOc35rD9nQnwATYDeek62LYGVACqTC/9w on5GdwjgkMPWKMnLsR3/Cn1/mNGIWO+wfmmPE=
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=FObB00dP8bxokBdt05AV0LfvNRJf9KkzXUdVKzFcav0=; b=TSCagECm2ZjEh0VBEBWZk+4X86wQlDdz6gJpcUfJWSwRiAyjWLbaZs83nCSeV9ugHK prPW0VRM5BbOhrtj18J5jOZ5mcw7Bp5J9AZhfwxAFufcnQUEiZfnQ7HKsagfl+KU5tBt sR6JlzNVWbKvFoHWaja9E3+oe/pZNEjbiY+rKE7CBF/cqhCwqP4SNUv9mvaWg2ROjYWu y5TG1SYvhyS921gF4vmdtOpWBJXsVvB7jN7Q0zbnMuJZE7Vgk6aR/2k4zBj87bWdzfgp FROaK3GJKnvcEhiBxDTF9qjgOcsYvCLkEJ1VMsIn8do4oXM8ZH+GhGL0zA4IqEu/sO1Z w+0g==
X-Gm-Message-State: ACgBeo1Ilzc7MGiLmbyZWdvH47vFu8jh79y5/p3sUK4OG8rscxgfLW7C lXHQmknXzu2KPnsP64HbnNKwtNM/oTH7oQ==
X-Google-Smtp-Source: AA6agR6t4emNiEOfdG+W5i0uj89P07d+ZRxlCFDUzuva7PHDT0aFGyXdlOwXgqvkBkO9OSq4mGZY4Q==
X-Received: by 2002:aa7:8a4d:0:b0:52e:2a8b:46a with SMTP id n13-20020aa78a4d000000b0052e2a8b046amr4760915pfa.64.1659559000673; Wed, 03 Aug 2022 13:36: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 w24-20020a17090a529800b001f4e0c71af4sm2021314pjh.28.2022.08.03.13.36.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Aug 2022 13:36:40 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\))
From: Austin William Wright <aaa@bzfx.net>
In-Reply-To: <41c96787-7330-e9e0-da59-68c6dd197c58@gmx.de>
Date: Wed, 03 Aug 2022 13:36:38 -0700
Cc: ietf-http-wg@w3.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <98341B31-B3A9-46C9-B755-8265CC478664@bzfx.net>
References: <E511F4BD-B422-46DA-8409-EBBD684098A6@bzfx.net> <41c96787-7330-e9e0-da59-68c6dd197c58@gmx.de>
To: Julian Reschke <julian.reschke@gmx.de>
X-Mailer: Apple Mail (2.3696.100.31)
Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=aaa@bzfx.net; helo=mail-pf1-x430.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, W3C_AA=-1, W3C_DB=-1, W3C_IRA=-1, W3C_WL=-1
X-W3C-Scan-Sig: mimas.w3.org 1oJL6q-008D0i-C8 6a3f69e3457e369b49ae052e927961e4
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Byte range PATCH
Archived-At: <https://www.w3.org/mid/98341B31-B3A9-46C9-B755-8265CC478664@bzfx.net>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/40296
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 3, 2022, at 02:28, Julian Reschke <julian.reschke@gmx.de> wrote:
> 
> Am 03.08.2022 um 01:11 schrieb Austin William Wright:
>> Hello HTTP WG,
>> 
>> I’m writing to pursue standardization of a PATCH media type to perform
>> writes at specific offsets. This may be especially relevant to
>> draft-tus-httpbis-resumable-uploads-protocol-02, if adopted. It can also
>> serve as the foundation for other features, like segmented uploading,
>> finishing indexes in video files, or other operations that require
>> editing at specific positions in a file.
>> 
>> I wrote and published draft-wright-http-patch-byterange-00
>> <https://www.ietf.org/archive/id/draft-wright-http-patch-byterange-00.html> for
>> your consideration. Please let me know your thoughts.
>> 
>> Thanks,
>> 
>> Austin.
> 
> Hi Austin,
> 
> it's a good idea to work on the media type for byte range patches.
> 
> That said, adding another text-based multipart format makes me shudder
> due to all the inherent problems in parsing field names and choosing
> separator lines.
> 
> I believe a simpler, binary format would be a better choice.
> 
> Best regards, Julian

Hi Julian,

I don’t have terribly strong opinions about what the format is, but this is what I thought was obvious based on a few motivations:

1. It re-uses an existing parser (it’s an off-the-shelf HTTP-message but skipping the "start-line CRLF” beginning, and is trivially parsable with a state machine or regular expression [1]).

2. It allows segments to express HTTP semantics; for example, creating a resource relies on attaching a Content-Type field. You might even attach a Digest field indicating the expected hash of the final resource.

3. It allows for some future extensions (if you omit the “Content-Range” field, you can use a different one to specify the target range).

Would a binary format be able to accomplish this? I know there’s been some work on a binary HTTP message framing but I’m not up-to-date on this.

Thanks,

Austin.


[1] The regular expression for matching the fields a message/byterange document in draft-wright-http-patch-byterange-00 is, excluding obs- productions, is exactly:

/^([!\x23-'\x2a\x2b\x2d\x2e0-9A-Z\x5e-z\x7c~]+:[\t ]*(?:[!-~](?:[\t -~]+[!-~])?)*[\t ]*\r\n)*\r\n/