Re: HTTP/2 Upgrade with content?

On 14 March 2015 at 05:25, Martin Thomson <martin.thomson@gmail.com> wrote:

> 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.
>


Martin,

there is no obligation for the request to be read before the response is
written and there are many apps that write the response as the request is
read.

Consider an app that performs some kind of streaming translation of the
posted content into the response.  It will be reading chunks of the
HTTP/1.1 response and sending that as frames of HTTP/2 response.
Eventually the stream/connection "window" will be consumed, but a window
update frame will not be able to be sent because the HTTP/1.1 response is
not complete.

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.
>

This is not a issue of uglyness.     It is a question of server consistency
when dealing with the DoS issues and possibility when dealing with the
deadlock issue.

cheers






-- 
Greg Wilkins <gregw@intalio.com>  @  Webtide - *an Intalio subsidiary*
http://eclipse.org/jetty HTTP, SPDY, Websocket server and client that scales
http://www.webtide.com  advice and support for jetty and cometd.

Received on Friday, 13 March 2015 22:15:44 UTC