Search the web
Sign In
New User? Sign Up
http-compliance · discussion about HTTP compliance testing and tests
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
How do browsers detect end of response when no Content-Length hea d   Message List  
Reply | Forward Message #45 of 117 |
Re: [http-compliance] How do browsers detect end of response when no Content-Length hea der is present?

On Thu, 4 Oct 2001, Karr, David wrote:

> How do browsers figure out a response is "Complete" if the origin server
> doesn't send a "Content-Length" header? What is the normal strategy for
> that? The response could be sent in more than one packet, correct?

RFC 2616 defines browsers behavior in this case. There are several
scenarios like Chunked Encoding and end-of-file/connection detection.
See a lengthy discussion in Section 4.4 of the RFC.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4

Alex.




Thu Oct 4, 2001 7:01 pm

rousskov@...
Send Email Send Email

Forward
Message #45 of 117 |
Expand Messages Author Sort by Date

How do browsers figure out a response is "Complete" if the origin server doesn't send a "Content-Length" header? What is the normal strategy for that? The...
Karr, David
david.karr@...
Send Email
Oct 4, 2001
6:40 pm

... RFC 2616 defines browsers behavior in this case. There are several scenarios like Chunked Encoding and end-of-file/connection detection. See a lengthy...
Alex Rousskov
rousskov@...
Send Email
Oct 4, 2001
7:01 pm

I started to read that earlier, but I missed the short "closing the connection" point. So, how exactly do you detect the closing of the connection? If you're ...
Karr, David
david.karr@...
Send Email
Oct 4, 2001
7:48 pm

... You wait for the read(2) call on a socket to return zero bytes, indicating an end-of-file condition. Unfortunately, the situation is complicated by...
Alex Rousskov
rousskov@...
Send Email
Oct 4, 2001
8:06 pm

Typically, your select() will return that the socket is readable, and when you read, you will get back 0 bytes. This signals to you that the connection has...
Hu, James
jxh@...
Send Email
Oct 4, 2001
7:52 pm

... ... but only if the error number tells you so. Negative read size may simply mean that select(2) lied and no data is really available yet. This has very...
Alex Rousskov
rousskov@...
Send Email
Oct 4, 2001
8:10 pm

... So after you've finished reading the last real block of data and get back to the "select" loop, the server will have closed the connection. At the ...
Karr, David
david.karr@...
Send Email
Oct 4, 2001
8:10 pm

... Right. There may be some negative-size reads in-between, of course. Select(2) indicates a change in fd "condition", not necessarily a "ready" state. If you...
Alex Rousskov
rousskov@...
Send Email
Oct 4, 2001
8:16 pm

Of course, always check the error number. -- James ... http://docs.yahoo.com/info/terms/ ... To unsubscribe from this group, send an email to: ...
Hu, James
jxh@...
Send Email
Oct 4, 2001
8:31 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help