Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Does plaintext HTTP/2 support request body?


Simone,

With an upgrade from h1 to h2, the h1 request is still sent to the servlet container, only that it's response is not delivered over h1 rather over stream 1 of the h2 connection.   This allows the request in the upgrade to always be handled in a single round trip.

So theoretically we could:
  1. receive the upgrade request
  2. buffer the entire content
  3. accept the upgrade to h2
  4. dispatch the request to the handlers
  5. feed in the buffered request body to the request input stream
  6. feed the response output stream to the h2 stream 1
But as I said, we would have to put a limit on the size of the request body.

cheers






On 2 May 2016 at 19:55, Simone Bordet <sbordet@xxxxxxxxxxx> wrote:
Hi,

On Mon, May 2, 2016 at 4:47 AM, Greg Wilkins <gregw@xxxxxxxxxxx> wrote:
> John,
>
> It is a difficult case as the issue is how do you handle a large body that
> needs to be processed as a stream?

But I fail to see how an Upgrade request body can be processed by an
application.
We handle upgrades at the container level, and we never invoke the
application, so even if there is an Upgrade request body, those bytes
will never be passed or otherwise interpreted by an application, so
they are as good as discarded.

Even Servlet 3.1's HttpUpgradeHandler is not meant to handle Upgrade
request content, but only handle *after* upgrade scenarios.

--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users



--

Back to the top