Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Apr 2003 08:15:10 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        freebsd-ports@FreeBSD.ORG
Subject:   Re: bento tbz files decompressed on the fly when downloading ?
Message-ID:  <Pine.BSF.4.53.0304060745190.81802@e0-0.zab2.int.zabbadoz.net>
In-Reply-To: <20030406053332.GA49653@rot13.obsecurity.org>
References:  <Pine.BSF.4.53.0303231733100.87276@e0-0.zab2.int.zabbadoz.net> <20030323224757.GA27897@rot13.obsecurity.org> <Pine.BSF.4.53.0304041932340.72648@e0-0.zab2.int.zabbadoz.net> <20030406053332.GA49653@rot13.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 5 Apr 2003, Kris Kennaway wrote:

Hi,

> > > > Is there some transparent decompression on bento ?
> > >
> > > Oops..yes :)  I'll have to try and exclude the package directories.
> >
> > Could you solve this ?
>
> I took a look at this but couldn't work out how to solve it.  apache
> on bento is using mod_bunzip2 with the following config:
>
> # Added kk 010203
> LoadModule bunzip2_module libexec/apache/mod_bunzip2.so
> AddModule mod_bunzip2.c
> AddHandler send-bunzip2 .html .log
> RewriteEngine on
> RewriteCond   /usr/local/www/data/%{REQUEST_FILENAME} !-f
> RewriteRule   ^(.+)\.log$ $1.log.bz2
>
> It appears there is an implicit "decompress all .bz2 and .tbz files"
> that needs to be selectively disabled for files in the package trees.
> I don't know how to do this.

Is there some AddHandler for *.tbz ? If not there seems to be a hard
coded handler */* in the module (not being an expert but had a look at
it for a minute).

Can you try following either in a <Directory> section or in a
.htaccess for those directories:

	RemoveHandler .tbz


I also had seen another possible solution/workaround for the archives:
the client needs to send an

	Accept-Encoding: bzip2

header.

Verified to work (sorry for no line wrapping). Took some short files:

--- my orig httpget ---
bz@accu:~/lab/httpget-orig> ./httpget http://bento.freebsd.org/errorlogs/i386-packages-5-latest/russian/ru-d1489-1.5.tbz
Fetching http://bento.freebsd.org/errorlogs/i386-packages-5-latest/russian/ru-d1489-1.5.tbz
Connecting to proxy proxy-in.int.zabbadoz.net:8080... connected
        ---> 'ru-d1489-1.5.tbz'
Sent request, awaiting response: 200 OK
[text/plain]

Received: 40960
bz@accu:~/lab/httpget-orig> file ru-d1489-1.5.tbz
ru-d1489-1.5.tbz: GNU tar archive
--- end ---

--- my httpget patched with Accept-Encoding: bzip2 ---
bz@accu:~/lab/httpget> ./httpget http://bento.freebsd.org/errorlogs/i386-packages-5-latest/russian/ru-d1489-1.5.tbz
Fetching http://bento.freebsd.org/errorlogs/i386-packages-5-latest/russian/ru-d1489-1.5.tbz
Connecting to proxy proxy-in.int.zabbadoz.net:8080... connected
        ---> 'ru-d1489-1.5.tbz.0'
Sent request, awaiting response: 200 OK
Length: 9146

Received: 9146
bz@accu:~/lab/httpget> file ru-d1489-1.5.tbz.0
ru-d1489-1.5.tbz.0: bzip2 compressed data, block size = 900k
--- end ---


I think neither fetch/libfetch nor wget lets me set Accept-Encoding
parameter...


-- 
Bjoern A. Zeeb				bzeeb at Zabbadoz dot NeT
56 69 73 69 74				http://www.zabbadoz.net/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.53.0304060745190.81802>