No runtime warning about invalid size on replies without content length.
Removed some compiletime warnings.
Changed the trace format to store checksum in hex.
New refresh algorithm. No longer set entry->lastmod == entry->timestamp
when the Last-Modified header is absent. Also, don't do ISM validations
without a Last-Modified timestamp.
From: Henrik Nordstrom <hno@hem.passagen.se>
Changed mime.conf (and related C code) to include additional options to
make it possible for the user to override mime.conf settings. Primary
use is to view a text file that mime.conf says is binary, but it also
allows the user do download a binary file that otherwise gets downloaded
as ascii (and displayed in the browser).
+download show a binary download icon in FTP listings
+view show a ascii download icon in FTP listings
+download should be set on every mimetype that may be binary files at
some locations. +view should be set when it is known that some files may
be ascii to make it easier for the users to view these files (like the
default mime type).
Had to rewrite most of the ftp listing formatting code, but now should
it be much easier to maintain.
From: Henrik Nordstrom <hno@hem.passagen.se>
Here is a small mime type patch. to properly handle the .tgz
extension as gzip application/x-tar. It's done by allowing content type
to be blank "-" if it has no meaning, as in encodings.
pretty major rewrite. Previously we wouldn't read from a socket
again until the previously read chunk had been fully written to
the other side. Now we read ahead on both sides, moving unwritten
chunks to the beginning of the copy buffers.
This also has consequences for the closing sequence. When either side
closes, we are supposed to write any pending data to the other side
and then close the other side as well. The code is now more symmetric,
but has to include all these ugly checks for valid filedescriptors.
cachability for responses from authenticated requests should depend
upon the presence of Cache-Control: Public, and not Cache-Control:
Proxy-Revalidate.
* Do not warn about size mismatch on responses without a Content-Length:
header
* Documented all the options in usage().
* Added -t to build a tracefile suitable for later input
A tracefile has the format
METHOD URL BODY-FILE SIZE CHECKSUM
Where:
METHOD Is the HTTP method to use, usually GET
URL The URL
BODY-FILE Is a file to send as request body (- for none)
SIZE The object size of the returned object (- to ignore)
CHECKSUM A simple checksum of the object (- to ignore)
tcp-banger already accepts this format as input (was in one of my
previous tcp-banger patches).
call urlCanonical() in refreshCheck() if entry->mem_obj == NULL.
Changed urlCanonical() interface and operation. Writes the URL
into a xmalloc'd buffer (request_t->canonical). Eliminated 'buf'
arg to urlCanonical(). client_side.c was the only place which used it,
so now we must xstrdup() there.
We had a sort of a race condition problem. For object data in memory
we were freeing up to the QUEUED offset instead of the DONE offset.
This resulted in a chunk of the object which was not in memory and
not yet written to disk.
fix up some confusion/bugs with http->out.offset in clientSendMoreData().
Now that wierd hacks for HEAD requests are gone, we have to change
where we increment the offset. Now its incremented in two places,
for the headers and for the body.
From: Henrik Nordstrom <hno@hem.passagen.se>
Here is a patch that fixes FTP directory listings on some FTP servers /
directories.
* Always include .. first in directory listings, regardless if the
origin server lists one or not. This fixes both servers that don't list
.., and directories that have strange files/directories that get listed
before .. (UNIX example: ".-test")
* Show a "empty" listing when the origin server returns a empty listing.
This is much more intiutive than returning a 0-bytes object (which gives
a "document contains no data" error box in most browsers). This is for
example seen on protected directories where the user is not allowed to
list the files (like bin and etc in most anon-ftp setups).