Re: HTTP/2 Upgrade with content?

Martin Thomson <martin.thomson@gmail.com> Fri, 13 March 2015 18:30 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ietf.org@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 (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A0DBA1A0187 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 13 Mar 2015 11:30:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.012
X-Spam-Level:
X-Spam-Status: No, score=-7.012 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TsXlOGtcn6g5 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Fri, 13 Mar 2015 11:30:14 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7FF751A009E for <httpbisa-archive-bis2Juki@lists.ietf.org>; Fri, 13 Mar 2015 11:30:14 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1YWUI1-0007Ao-BD for ietf-http-wg-dist@listhub.w3.org; Fri, 13 Mar 2015 18:26:29 +0000
Resent-Date: Fri, 13 Mar 2015 18:26:29 +0000
Resent-Message-Id: <E1YWUI1-0007Ao-BD@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtp (Exim 4.80) (envelope-from <martin.thomson@gmail.com>) id 1YWUHt-0007A3-VO for ietf-http-wg@listhub.w3.org; Fri, 13 Mar 2015 18:26:21 +0000
Received: from mail-ob0-f176.google.com ([209.85.214.176]) by lisa.w3.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.72) (envelope-from <martin.thomson@gmail.com>) id 1YWUHt-0006MA-R1 for ietf-http-wg@w3.org; Fri, 13 Mar 2015 18:26:21 +0000
Received: by obcva2 with SMTP id va2so21563875obc.3 for <ietf-http-wg@w3.org>; Fri, 13 Mar 2015 11:25:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=6PpoN7JVrp13seFYVWb+0u7V/YnBMjEyAXlutu9wYf0=; b=bH7LGngwxrGeWAsAA860AGCfYSwGqbqUmZEXlR449QNR2vgrVoUXxfJpMW8e4K7Slj 85z6Aeo5mUMhuwsy0GIyB/18Urj6jE2NXy/2m8TSDYN7hdJClU2aat2DzJ7g4lnGwFP2 +nluxnJEJjU/RWSQEbC10PZsRhctTlcFUDoH8WYFdmBFctxuGIVyhiQRd9VUoiZPBuaR dNu/gW44UbcSAOpoh6z0s0VNtTxeLT9ebi6sZoFH0xJwWJPTQP3iA+zKxS8uiiOEgu0X FUjl+KbwgUP3kbNtEthL8YGtlWKtIV43C/GFAYegQsBIFZvhFgTJDr5Z9Ifk0zBiTCl3 S1ew==
MIME-Version: 1.0
X-Received: by 10.202.64.9 with SMTP id n9mr36929057oia.20.1426271155824; Fri, 13 Mar 2015 11:25:55 -0700 (PDT)
Received: by 10.202.86.20 with HTTP; Fri, 13 Mar 2015 11:25:55 -0700 (PDT)
In-Reply-To: <CAH_y2NFjb0mx8Rs+qg6uJ=zgUzHW3ksiOSN4_GXubKG-P2QDaw@mail.gmail.com>
References: <CAH_y2NF3iwND1ttQDY98KC_u=OZj5aqEABmXHKObMgqPH1npLg@mail.gmail.com> <BL2PR03MB1323474B977B051738AD09187060@BL2PR03MB132.namprd03.prod.outlook.com> <CAH_y2NFV=Z7hqbtWTdiePRwUnhhRjiP8R_Ua7kmpZEkwXtxgEA@mail.gmail.com> <B5C01B7A-9215-4268-B189-E6281F425BF7@greenbytes.de> <alpine.DEB.2.11.1503130833190.13706@tvnag.unkk.fr> <6E036F2D-AED0-4323-ACCB-D8036168E6C1@redhat.com> <CAH_y2NFjb0mx8Rs+qg6uJ=zgUzHW3ksiOSN4_GXubKG-P2QDaw@mail.gmail.com>
Date: Fri, 13 Mar 2015 11:25:55 -0700
Message-ID: <CABkgnnWEx4+o34h70168ZYihs9MFZQ=SNQekNX1gdjq51=-k7g@mail.gmail.com>
From: Martin Thomson <martin.thomson@gmail.com>
To: Greg Wilkins <gregw@intalio.com>
Cc: "Jason T. Greene" <jason.greene@redhat.com>, Daniel Stenberg <daniel@haxx.se>, Stefan Eissing <stefan.eissing@greenbytes.de>, Mike Bishop <Michael.Bishop@microsoft.com>, HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: text/plain; charset="UTF-8"
Received-SPF: pass client-ip=209.85.214.176; envelope-from=martin.thomson@gmail.com; helo=mail-ob0-f176.google.com
X-Original-To: ietf-http-wg@w3.org
Subject: Re: HTTP/2 Upgrade with content?
Archived-At: <http://www.w3.org/mid/CABkgnnWEx4+o34h70168ZYihs9MFZQ=SNQekNX1gdjq51=-k7g@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/28966
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: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

On 13 March 2015 at 06:19, Greg Wilkins <gregw@intalio.com> wrote:
> Failing the direct PRI approach, it would be far better to try the upgrade
> on an OPTION request before commencing on the big post/put.

I'd always considered it this way:

Read the headers, notice that it is HTTP/2, proceed as though it were HTTP/1.1.
Then, when the response is written, perform a rewrite into HTTP/2.

I don't see this as impossible, and while it's ugly that the
specialized code has to exist (for numerous reasons), the specific
code doesn't have to be ugly if factored well.