Section 4.4. calculate transfer-length:

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
artg@cs.nyu.edu
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

Received on Friday, 25 February 2005 19:08:33 UTC