[ee122] No content length or transfer encoding in http reply

Daniel Killebrew dank at eecs.berkeley.edu
Sun Oct 21 14:14:01 PDT 2007


Important change to what I said earlier, read on:

Daniel Killebrew wrote:
> A persistent connection has nothing to do with the reply coming in 
> chunked or not. Persistent connection means the server won't close the 
> connection after the file is sent.
>
> But if you don't get a content length or chunked header line, you're 
> free to gracefully close the connection and indicate the error to the user.
>   
Actually, if the server does not include a content length or chunked 
header line, the client should assume that the server will send the file 
and close the connection after sending the last byte of the file. So the 
client will take everything after the HTTP header and save it as the file.

Professor Paxson pointed out:
The reasoning behind this is, if the client says it wants a persistent 
connection,
the server can *decline*. In that case, it can return an item with no
content-length and no chunking and it's not an error, so the client in
that case shouldn't close the connection when it sees the absence of either
of those headers; it should read the item up to an end-of-file.

Daniel
> Daniel
>
> Eric Cheung wrote:
>   
>> If the client specifies a persistent connection and gets a reply without 
>> a content length or "transfer-encoding: chunking" in it, should it just 
>> close the connection?  Otherwise, the client wouldn't know when to stop 
>> reading.
>>
>> Thanks
>> - Eric
>> _______________________________________________
>> ee122 mailing list
>> ee122 at mailman.ICSI.Berkeley.EDU
>> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/ee122
>>
>>   
>>     
> _______________________________________________
> ee122 mailing list
> ee122 at mailman.ICSI.Berkeley.EDU
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/ee122
>
>   


More information about the ee122 mailing list