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