Re: Expect: + Upgrade: = ...

Hi Amos,

On Sat, Sep 07, 2013 at 03:37:01PM +1200, Amos Jeffries wrote:
> It does not address the original thread starting question: What happens if 
> the new protool is used to send the 100 after the 101. Assuming that the 
> new protocol is capable of that to begin with.
>  Does the client see the 101 as a final state and start sending the payload 
>  immediately?
>  Does it wait for a 100 which the new protocol may be used to deliver 
>  slightly later?
>  Does it wait for its timeout?

Osama made a very good point to disallow this case :

  "It is legal for the client to send the entity body without waiting for the 100".

Thus if the protocol allows to switch before getting the bytes, the server
has no way to know whether it's receving an HTTP/2 stream or the HTTP/1
payload body.

> It has become clear in this thread we all disagree on the implementation of 
> that part which will cause interoperation issues.

Initially I was for allowing both cases to coexist but now for me it is
clear that we must not allow 100 to be processed after 101.

> So the text does need to 
> be clearer on that case.
> - Retaining the timeout is a no-brainer, but does impose the HTTP/1 
> blocking problem onto whatever protocol was upgraded to.
> - Retaining the payload in HTTP/1 format is agreed (I think).

So what about this :

   http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-23#section-6.2.2

   The server
   MUST generate an Upgrade header field in the response that indicates
-  which protocol(s) will be switched to immediately after the empty
-  line that terminates the 101 response.
+  which protocol(s) will be switched to. The new protocol takes effect
+  on each direction after the end of the current message, which means
+  on the request path immediately after any advertised payload body, and
+  on the response path immediately after the empty line that terminates
+  the 101 response.
+
+  When receiving a 101 status code, a client that was waiting for a 100
+  status code before emitting its payload body must immediately send it
+  in order to complete the protocol switch.
+
+  A client waiting for a 101 status code to upgrade the protocol must still
+  be prepared to handle other 1xx interim responses first before receiving
+  the 101 status code confirming the protocol upgrade.

With that, it makes it clear even for intermediaries what protocol is in
effect on each side and direction.

Comments ?

Willy

Received on Saturday, 7 September 2013 05:46:50 UTC