Strange condition in cache.c old code
Hello old Dillo developers ! Explain me please what is 1024 in the following code for. I read HTML and HTTP/1.1 (rfc2616) specifications but didn't find an answer. I think this condition must be wiped out because some servers (linux.org.ru for example) give too long responses. Code from cache.c revision 1.2, Tue Aug 29 00:36:27 2000 UTC, 2 years, 9 months ago by shaleh: /* * Process redirections (HTTP 30x answers) * (This is a work in progress --not finished yet) */ int Cache_redirect(CacheData_t *entry, int Flags, BrowserWindow *bw) { if ( ((entry->Flags & CA_Redirect) && entry->Location) && ((entry->Flags & CA_ForceRedirect) || !entry->ValidSize || entry->ValidSize < 1024 ) ) { Yours, Nikita
Nikita,
Hello old Dillo developers !
Hi!
Explain me please what is 1024 in the following code for. I read HTML and HTTP/1.1 (rfc2616) specifications but didn't find an answer.
FYI: Dillo uses HTTP/1.0.
I think this condition must be wiped out because some servers (linux.org.ru for example) give too long responses.
[...]
/* * Process redirections (HTTP 30x answers) * (This is a work in progress --not finished yet) */ int Cache_redirect(CacheData_t *entry, int Flags, BrowserWindow *bw) { if ( ((entry->Flags & CA_Redirect) && entry->Location) && ((entry->Flags & CA_ForceRedirect) || !entry->ValidSize || entry->ValidSize < 1024 ) ) {
IIRC this is an heuristical boundary. Some servers don't send entity content within an http redirection (Correct behaviour IMHO). Some send a short default message as entity content (something so redundant as "This page is being redirected"), and some others send a full page that can be anything! The "1024" somehow decides this: < 1024: Short redirection message.
1024: Don't know what is this large page!
I also have a vague memory in my mind about how the http redirection data stream is (or isn't) cut in order to make the redirection. The "1024" threshold may "solve" this somehow. This is where you need to start investigating. HTH Jorge.-
Hello, Jorge ! Jorge Arellano Cid wrote:
Explain me please what is 1024 in the following code for. I read HTML and HTTP/1.1 (rfc2616) specifications but didn't find an answer.
FYI: Dillo uses HTTP/1.0.
OK, I'll give citations from HTTP/1.0 (RFC1945)
I think this condition must be wiped out because some servers (linux.org.ru for example) give too long responses.
[...]
/* * Process redirections (HTTP 30x answers) * (This is a work in progress --not finished yet) */ int Cache_redirect(CacheData_t *entry, int Flags, BrowserWindow *bw) { if ( ((entry->Flags & CA_Redirect) && entry->Location) && ((entry->Flags & CA_ForceRedirect) || !entry->ValidSize || entry->ValidSize < 1024 ) ) {
IIRC this is an heuristical boundary.
Some servers don't send entity content within an http redirection (Correct behaviour IMHO). Some send a short default message as entity content (something so redundant as "This page is being redirected"), and some others send a full page that can be anything!
I don't really encountered any server that gives a _garbage_ in 3xx response. Usually it is a HTML page with short decription and in rare case it is just a redirection without entity-body. RFC says that servers _may_ send a content (entity) but may do not: 4.1 Message Types HTTP messages consist of requests from client to server and responses from server to client. HTTP-message = Simple-Request ; HTTP/0.9 messages | Simple-Response | Full-Request ; HTTP/1.0 messages | Full-Response Full-Response = Status-Line ; Section 6.1 *( General-Header ; Section 4.3 | Response-Header ; Section 6.2 | Entity-Header ) ; Section 7.1 CRLF [ Entity-Body ] ; Section 7.2 7.2 Entity Body The entity body (if any) sent with an HTTP request or response is in a format and encoding defined by the Entity-Header fields. Entity-Body = *OCTET <...> The presence of an entity body in a request is signaled by the inclusion of a Content-Length header field in the request message headers. HTTP/1.0 requests containing an entity body must include a valid Content-Length header field.
The "1024" somehow decides this:
< 1024: Short redirection message.
1024: Don't know what is this large page!
IMHO if HTTP/1.0 response has an entity body then we know its type and length and should display it if we know how regardless of its size. So for this purpose "1024 test" has not sense.
I also have a vague memory in my mind about how the http redirection data stream is (or isn't) cut in order to make the redirection. The "1024" threshold may "solve" this somehow.
??? I don't undestand this problem...
This is where you need to start investigating.
HTH Jorge.-
Yours, Nikita
On Sat, 14 Jun 2003 17:02:00 +0700 (NOVST) "Nikita V. Borodikhin" <eliterr@tkk.ru> wrote:
<...> The presence of an entity body in a request is signaled by the inclusion of a Content-Length header field in the request message headers. HTTP/1.0 requests containing an entity body must include ^^^^^^^^^ a valid Content-Length header field.
We speak about HTTP *responses* so that argument is invalid Greetings Andreas Kemnade
IMHO if HTTP/1.0 response has an entity body then we know its type and length and should display it if we know how regardless of its size. So for this purpose "1024 test" has not sense.
see above Greetings Andreas Kemnade
Hello, Andreas ! Andreas Kemnade wrote:
<...> The presence of an entity body in a request is signaled by the inclusion of a Content-Length header field in the request message headers. HTTP/1.0 requests containing an entity body must include ^^^^^^^^^ a valid Content-Length header field.
We speak about HTTP *responses* so that argument is invalid
IMHO if HTTP/1.0 response has an entity body then we know its type and length and should display it if we know how regardless of its size. So for this purpose "1024 test" has not sense.
see above
Greetings Andreas Kemnade
OK, may be I'm wrong in my opinion but please give me _argumented_ answer why the current way of redirection confirms the standard. I'll accept any answer with reference to RFC, either HTTP/1.0 or HTTP/1.1. I dig them both and found those paragraphs to prove my point of view. May be I didn't found something that concern this question so if you can do it then do it ! Yours, Nikita
participants (3)
-
Andreas Kemnade
-
Jorge Arellano Cid
-
Nikita V. Borodikhin