>Number: 4097 >Category: mod_mime >Synopsis: mod_mime_magic unable to handle compressed content larger than >4k >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: open >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Mon Mar 22 03:10:00 PST 1999 >Last-Modified: >Originator: [EMAIL PROTECTED] >Organization: apache >Release: 1.3.4 >Environment: FreeBSD 2.2.8-STABLE >Description: Due to the limit imposed by HOWMANY symbol, the zmagic() function in mod_mime_magic.c attempts to uncompress first 4k of the file only, and mod_mime_magic module is unable to detect the type of uncompressed contents.
The following entry appears in the error_log: httpd: [Sun Mar 21 18:17:04 1999] [error] [client 127.0.0.1] mod_mime_magic: read failed /home/WWW/Home/cdrom/cc/td/doc/product/software/ssr91/rn_9_14/78116.htm This error is generated in mod_mime_magic.c:2198, since ap_bread() was unable to read any data from gzip process pipe. >How-To-Repeat: Discovered when browsing Cisco Documentation CD (it contains compressed HTML files) -- some file (smaller) were properly displayed by Netscape and lynx, while others were not. I guess that the module's primary objective is to allow browsing of Cisco CD, since it was submitted to you by Cisco:) Sample files can be downloaded from http://www.system.pl/internal/mod_mime_magic/ (Note this server has mod_mime_magic disabled). The file small_gzipped.htm should work ok with a standard module. >Fix: In http://www.system.pl/internal/mod_mime_magic/patch I enclose a patch which allows to read large compressed files and fixes another bug (files without ending ".Z" cannot be verified by module due to the way "uncompress" utility works). I have modified the options given to gzip utility - now they include a file name. I have tried to fix it loading the whole compressed file into memory, but this failed on large files (>100k) - like max_gzipped.htm on my site. There may be another bug in the way apache handles pipes to- and from- process. E-mail me for further details. >Audit-Trail: >Unformatted: [In order for any reply to be added to the PR database, ] [you need to include <[EMAIL PROTECTED]> in the Cc line ] [and leave the subject line UNCHANGED. This is not done] [automatically because of the potential for mail loops. ] [If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request ] [from a developer. ] [Reply only with text; DO NOT SEND ATTACHMENTS! ]