www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcin Cieslak <sa...@system.pl>
Subject Re: mod_mime/4097: mod_mime_magic unable to handle compressed content larger than 4k
Date Tue, 20 Apr 1999 21:02:42 GMT
On 20 Apr 1999 dgaudet@apache.org wrote:

> 
> Synopsis: mod_mime_magic unable to handle compressed content larger than 4k
> 
> I get a 403 when I try to access the URLs you listed.

My apologies. Now this is (hopefully) fixed.

> 
> We deliberately limit the amount sent to unzip/uncompress --
> because we don't want to use lots of memory or CPU time
> to do it.  The first 4k should be enough to identify all
> files...

It seems that we have to sacrifice CPU and memory.
I haven't found any way to force gzip to uncompress
a fragment of the file.
It fails with exit code 1 when the compressed file/
data stream is not complete.
Yes, it would be enough to supply first 4k of uncompressed contents.
Perhaps we should integrate mod_mime_magic with zlib.

Consider this:

Script started on Tue Apr 20 22:51:53 1999
tricord:/u/saper % gzip tf
tricord:/u/saper % ls -l tf.gz
-rwxr-xr-x   1 saper    staff      43276 Apr 20 22:50 tf.gz
tricord:/u/saper % dd if=tf.gz of=tf-first4k.gz count=8
8+0 records in
8+0 records out
tricord:/u/saper % ls -l tf*gz
-rw-r--r--   1 saper    staff       4096 Apr 20 22:52 tf-first4k.gz
-rwxr-xr-x   1 saper    staff      43276 Apr 20 22:50 tf.gz
tricord:/u/saper % gzip -d -c tf.gz > /dev/null
tricord:/u/saper % echo $status
0
tricord:/u/saper % gzip -d -c tf-first4k.gz > /dev/null

gzip: tf-first4k.gz: unexpected end of file
tricord:/u/saper % echo $status
1
script done on Tue Apr 20 22:52:50 1999
> Also it uses "uncompress -c" and passes it the compressed
> data on stdin -- so uncompress never deals with a filename,
> so I don't see how it can complain about a lack of .Z.

Yes, this is the "bug" introduced with my modification --
it uses the file on disk directly, and it doesn't have to
have a ".Z" or ".gz" extension. 

However, my patch allows me to browse Cisco Documentation CD
without any problems and with now need for proprietary
software supplied by Cisco for Windows and some commercial
UNIX platforms.

-- 
                 << Marcin Cieslak // saper@system.pl >>

-----------------------------------------------------------------
SYSTEM Internet Provider                     http://www.system.pl


Mime
View raw message