W3C home > Mailing lists > Public > ietf-http-wg@w3.org > July to September 2004

Re: Proxies, how to determine response body length

From: Jamie Lokier <jamie@shareable.org>
Date: Mon, 12 Jul 2004 12:31:54 +0100
To: Jan Novy <norff@seznam.cz>
Cc: ietf-http-wg@w3.org
Message-ID: <20040712113154.GA23018@mail.shareable.org>

Jan Novy wrote:
> After reading RFC2616 I'am not sure how HTTP1.1 proxy server can 
> determine response body length on client-proxy side connection 
> when this length was determined by the server closing the connection
> on proxy-originserver side connection.

That's correct, it can't.  The proxy does not know the body length
until the end of the body.  It is the same if the body is transmitted
with chunked encoding.

> I'am not sure that proxy server can determine it by closing the
> connection, because for some particular client-proxy connection
> proxy can have many persistent connections (to different origin
> servers) opened so determining response body length by closing
> client-proxy connection would cause loss of remaining
> proxy-originserver persistent connections I think.

If there are many persistent client-proxy connections open, that's
irrelevant.  A message is terminated by closing only the connection
for that message: the other client-proxy connections aren't affected.

That's what you need to do if the client speaks only HTTP/1.0.
Alternatively you can buffer the message until you know the length,
which is good idea for short messages where the whole message arrives
in a very short time.

If the client speaks HTTP/1.1, then you can send the body using
chunked encoding over the client-proxy connection, at the same time as
receiving it over the proxy-server (or proxy-proxy) connection.

-- Jamie
Received on Monday, 12 July 2004 07:31:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 27 April 2012 06:49:35 GMT