Subject: Section 4.4. calculate transfer-length:

From: Arthur Goldberg <[email-masked]>
Date: Fri, 25 Feb 2005 14:07:14 +0000

I'm confused by Section 4.4. Ignoring length calculation methods 1 and 
4, I derive this code to calculate transfer-length:
switch
case “Transfer-Encoding header is present”:
if( the connection was closed ) then
transfer-length = 'number of OCTETs read from start of
message-body to EOF'
// but this produces the wrong length (it is too long) if
// the message is a response that is not the last response
// in a sequence of pipelined responses
else
transfer-length = 'length determined by decoding chunking'
endif
case “Content-Length header is present”:
transfer-length = 'Content-Length's decimal value'
default:
if( the connection was closed ) then
transfer-length = 'number of OCTETs read from start of
message-body to EOF'
else
error
endif

Note my thinking that there might be a problem. I think the code should be:
calculate transfer-length:
switch
case “Transfer-Encoding header is present”:
transfer-length = 'length determined by decoding chunking'
case “Content-Length header is present”:
transfer-length = 'Content-Length's decimal value'
default:
if( the connection was closed ) then
transfer-length = 'number of OCTETs read from start of
message-body to EOF'
else
error
endif

In this case, the phrase “unless the message is terminated by closing 
the connection” is unnecessary. What am I missing?

BR
A

-- 
Arthur P. Goldberg
www.cs.nyu.edu/artg
[email-masked]
212 998-3014 fax 212 995-4124

Clinical Associate Professor of Computer Science
Computer Science Department
Courant Institute of Mathematical Sciences
Director, Master of Science in Information Systems

Warren Weaver Hall
251 Mercer, Room 409
New York University
New York, NY 10012

---

From: Joe Orton <[email-masked]>
Date: Sat, 26 Feb 2005 11:24:15 +0000

> the connection” is unnecessary. What am I missing?

I was wondering the same thing the other day.  The only thing I could
imagine is that it's to allow a new transfer-coding to be defined in the
future which uses EOF as the message-length delimiter, or something like
that. 

Section 3.6 uses the same phrase; it is a little confusing.  In 4.4 you
could almost read it to mean that presence of "Connection: close" would
mean that a T-E header should be ignored, which is presumably not the 
intent (and certainly not the practice).

joe