Subject: Re: WGLC p1: proxy handling of a really bad Content-Length

From: Willy Tarreau <[email-masked]>
Date: Wed, 1 May 2013 09:26:44 +0200

On Wed, May 01, 2013 at 12:43:14AM -0600, Alex Rousskov wrote:
> Hello,
> 
>     When talking about dealing with malformed responses, HTTPbis p1
> Section 3.3.3 says:
> 
> > the proxy MUST discard the received response, send a 502 (Bad
> > Gateway) status code as its downstream response, and then close the
> > connection.
> 
> Which connection MUST the proxy close: upstream or downstream? If you
> guessed downstream because the connection must be closed only _after_
> the 502 downstream response is sent, you guessed wrong :-).
> 
> The proxy MUST close the upstream connection and it may do that
> immediately, without waiting for the 502 response to be sent on the
> downstream connection. This was discussed around 2011/11/28, and I think
> Mark agreed that a fix is needed but the text was never changed.
> 
> Also, the current wording suggests sending "status code" as a response,
> which is not the intent, of course.
> 
> 
> Suggested fix:
> 
>   the proxy MUST close the upstream connection, discard the received
>   response, and send a 502 (Bad Gateway) response downstream.

I think we should never use the terms "upstream" and "downstream" since
they're ambiguous due to the fact that connections are bidirectional.
We'd rather use "connection to the client" and "connection to the server".
So I would suggest :

   the proxy MUST close the connection to the server, discard the received
   response, and send a 502 (Bad Gateway) response to the client.

Willy

---

From: Alex Rousskov <[email-masked]>
Date: Wed, 01 May 2013 01:44:33 -0600

> they're ambiguous due to the fact that connections are bidirectional.

HTTPbis defines those terms in p1 section 2.3, but I agree that their
use in a multiple connection context is kind of ambiguous (in both the
current text and the suggested fix).

>    response, and send a 502 (Bad Gateway) response to the client.

Sounds great to me!

Thank you,

Alex.

---

From: Mark Nottingham <[email-masked]>
Date: Tue, 7 May 2013 14:44:20 +1000

Created as <http://trac.tools.ietf.org/wg/httpbis/trac/ticket/482>.

--
Mark Nottingham   http://www.mnot.net/