Deflate problem

Deflate problem

am 07.05.2011 12:30:56 von Idel Fuschini

--00163641753300cc8c04a2ad1a90
Content-Type: text/plain; charset=ISO-8859-1

Hi people,
I've got this problem with DEFLATE.
This is my code example :

use strict;
use warnings;
use Apache2::Filter ();
use Apache2::RequestRec ();
use APR::Table ();
use Cache::FileBackend;
use Apache2::Const -compile => qw(OK);
use constant BUFF_LEN => 1024;
use vars qw($VERSION);

sub handler {
unless ($f->ctx) {
$f->r->headers_out->unset('Content-Length');
$f->ctx(1);
}

my $Hash=$f->r->subprocess_env();
my $html_page="hello";
my $content_type="text/html";
my $len_bytes=length $html_page;
$f->r->headers_out->set("Content-Length"=>$len_bytes);
$f->r->headers_out->set("Last-Modified" => time());
$f->r->content_type($content_type);
$f->print($html_page);
return Apache2::Const::OK;
}

This is my configuration on httpd.conf;

PerlSetOutputFilter DEFLATE
PerlSetOutputFilter INCLUDES
SetHandler modperl
PerlOutputFilterHandler Apache2::AMFWebService
Allow from all


I don't have any response on my browser, why ?

Thanks
Idel
=====================
Mobile: +39 349 442 2668
E-Mail: idel.fuschini@gmail.com
Web Site: http://www.idelfuschini.it
OpenSource Project: Apache Mobile Filter -
http://www.idelfuschini.it/apache-mobile-filter-v2x.html
Test Page: http://www.apachemobilefilter.org/test/php_test.php
Mobile Test Page: http://www.apachemobilefilter.org
------
La presente comunicazione ed i suoi allegati e' destinata esclusivamente
ai destinatari. Qualsiasi suo utilizzo, comunicazione o diffusione non
autorizzata
e' proibita. Se ha ricevuto questa comunicazione per errore, la preghiamo di
darne
immediata comunicazione al mittente e di cancellare tutte le informazioni
erroneamente acquisite. (Rif. D.Lgs. 196/2003). Grazie

This message and its attachments are intended only for use by the
addressees. Any use,
re-transmission or dissemination not authorized of it is prohibited. If you
received
this e-mail in error, please inform the sender immediately and delete all
the material.
(Rif. D.Lgs. 196/2003). Thank you.

--00163641753300cc8c04a2ad1a90
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi people,
I've got this problem with DEFLATE.
>This is my code example :

=A0 use strict;
iv>=A0 use warnings;=A0
=A0 use Apache2::Filter ();
=A0=
use Apache2::RequestRec ();

=A0 use APR::Table ();
=A0 use Cache::FileBackend;
>=A0 use Apache2::Const -compile =3D> qw(OK);
=A0 use constant=
BUFF_LEN =3D> 1024;
=A0 use vars qw($VERSION);

=

=A0 sub handler {
=A0 =A0 =A0 unless ($f->ctx) {
=A0=
=A0 =A0 =A0 =A0 $f->r->headers_out->unset('Content-Length'=
;);
=A0 =A0 =A0 =A0 =A0 $f->ctx(1);
=A0 =A0 =A0 } iv>
=A0 =A0   
=A0 =A0 =A0 my $Hash=3D$f->r->subpro=
cess_env();

=A0 =A0 =A0 my $html_page=3D"<b>hello</b>"; >
=A0 =A0 =A0 my $content_type=3D"text/html";
=A0 =
=A0 =A0 my $len_bytes=3Dlength $html_page;
=A0 =A0 =A0 $f->r-&=
gt;headers_out->set("Content-Length"=3D>$len_bytes);

=A0 =A0 =A0 $f->r->headers_out->set("Last-Modified"=
=3D> time());
=A0 =A0 =A0 $f->r->content_type($content_=
type);
=A0 =A0 =A0 $f->print($html_page);
=A0 =A0 =
=A0 return Apache2::Const::OK;

=A0 }

This is my configuration on httpd.conf;=
<Location /WSDeflate/*>
=A0 =A0PerlSet=
OutputFilter DEFLATE
=A0 =A0PerlSetOutputFilter INCLUDES
v>=A0 =A0SetHandler modperl

=A0 =A0PerlOutputFilterHandler Apache2::AMFWebService
=A0 =
=A0Allow from all
</Location>

iv>
I don't have any response on my browser, why ?

div>

Thanks
Idel
===================
===3D
Mobile: +39 349 442 2668
E-Mail: chini@gmail.com">idel.fuschini@gmail.com
Web Site: /www.idelfuschini.it">http://www.idelfuschini.it

OpenSource Project: Apache Mobile Filter - ni.it/apache-mobile-filter-v2x.html">http://www.idelfuschini .it/apache-mobi=
le-filter-v2x.html

Test Page:=A0 ilter.org/test/php_test.php">http://www.apachemobilefilter.o rg/test/php_tes=
t.php


Mobile Test Page:=A0 http://w=
ww.apachemobilefilter.org

------
La presente comunicazione ed i s=
uoi allegati e' destinata esclusivamente
ai destinatari. Qualsiasi =
suo utilizzo, comunicazione o diffusione non autorizzata

e' proibita. Se ha ricevuto questa comunicazione per errore, la preghia=
mo di darne
immediata comunicazione al mittente e di cancellare tutte l=
e informazioni
erroneamente acquisite. (Rif. D.Lgs. 196/2003). Grazie >

This message and its attachments are intended only for use by the addre=
ssees. Any use,
re-transmission or dissemination not authorized of it i=
s prohibited. If you received
this e-mail in error, please inform the s=
ender immediately and delete all the material.

(Rif. D.Lgs. 196/2003). Thank you.


--00163641753300cc8c04a2ad1a90--

Re: Deflate problem

am 19.05.2011 19:52:55 von Fred Moyer

Have you tried mod_deflate?

On Sat, May 7, 2011 at 3:30 AM, Idel Fuschini wro=
te:
> Hi people,
> I've got this problem with DEFLATE.
> This is my code example :
> =A0 use strict;
> =A0 use warnings;
> =A0 use Apache2::Filter ();
> =A0 use Apache2::RequestRec ();
> =A0 use APR::Table ();
> =A0 use Cache::FileBackend;
> =A0 use Apache2::Const -compile =3D> qw(OK);
> =A0 use constant BUFF_LEN =3D> 1024;
> =A0 use vars qw($VERSION);
> =A0 sub handler {
> =A0 =A0 =A0 unless ($f->ctx) {
> =A0 =A0 =A0 =A0 =A0 $f->r->headers_out->unset('Content-Length');
> =A0 =A0 =A0 =A0 =A0 $f->ctx(1);
> =A0 =A0 =A0 }
>
> =A0 =A0 =A0 my $Hash=3D$f->r->subprocess_env();
> =A0 =A0 =A0 my $html_page=3D"hello";
> =A0 =A0 =A0 my $content_type=3D"text/html";
> =A0 =A0 =A0 my $len_bytes=3Dlength $html_page;
> =A0 =A0 =A0 $f->r->headers_out->set("Content-Length"=3D>$len_bytes);
> =A0 =A0 =A0 $f->r->headers_out->set("Last-Modified" =3D> time());
> =A0 =A0 =A0 $f->r->content_type($content_type);
> =A0 =A0 =A0 $f->print($html_page);
> =A0 =A0 =A0 return Apache2::Const::OK;
> =A0 }
> This is my configuration on httpd.conf;
>
> =A0 =A0PerlSetOutputFilter DEFLATE
> =A0 =A0PerlSetOutputFilter INCLUDES
> =A0 =A0SetHandler modperl
> =A0 =A0PerlOutputFilterHandler Apache2::AMFWebService
> =A0 =A0Allow from all
>

> I don't have any response on my browser, why ?
> Thanks
> Idel
> ==================== =3D
> Mobile: +39 349 442 2668
> E-Mail: idel.fuschini@gmail.com
> Web Site: http://www.idelfuschini.it
> OpenSource Project: Apache Mobile Filter -
> http://www.idelfuschini.it/apache-mobile-filter-v2x.html
> Test Page:=A0 http://www.apachemobilefilter.org/test/php_test.php
> Mobile Test Page:=A0 http://www.apachemobilefilter.org
> ------
> La presente comunicazione ed i suoi allegati e' destinata esclusivamente
> ai destinatari. Qualsiasi suo utilizzo, comunicazione o diffusione non
> autorizzata
> e' proibita. Se ha ricevuto questa comunicazione per errore, la preghiamo=
di
> darne
> immediata comunicazione al mittente e di cancellare tutte le informazioni
> erroneamente acquisite. (Rif. D.Lgs. 196/2003). Grazie
>
> This message and its attachments are intended only for use by the
> addressees. Any use,
> re-transmission or dissemination not authorized of it is prohibited. If y=
ou
> received
> this e-mail in error, please inform the sender immediately and delete all
> the material.
> (Rif. D.Lgs. 196/2003). Thank you.
>

Re: Deflate problem

am 19.05.2011 20:23:49 von Idel Fuschini

--000e0cd5cb624642cf04a3a51b69
Content-Type: text/plain; charset=ISO-8859-1

yes the result is the same.
Idel
=====================
Mobile: +39 349 442 2668
E-Mail: idel.fuschini@gmail.com
Web Site: http://www.idelfuschini.it
OpenSource Project: Apache Mobile Filter -
http://www.idelfuschini.it/apache-mobile-filter-v2x.html
Test Page: http://www.apachemobilefilter.org/test/php_test.php
Mobile Test Page: http://www.apachemobilefilter.org
------
La presente comunicazione ed i suoi allegati e' destinata esclusivamente
ai destinatari. Qualsiasi suo utilizzo, comunicazione o diffusione non
autorizzata
e' proibita. Se ha ricevuto questa comunicazione per errore, la preghiamo di
darne
immediata comunicazione al mittente e di cancellare tutte le informazioni
erroneamente acquisite. (Rif. D.Lgs. 196/2003). Grazie

This message and its attachments are intended only for use by the
addressees. Any use,
re-transmission or dissemination not authorized of it is prohibited. If you
received
this e-mail in error, please inform the sender immediately and delete all
the material.
(Rif. D.Lgs. 196/2003). Thank you.


On 19 May 2011 19:52, Fred Moyer wrote:

> Have you tried mod_deflate?
>
> On Sat, May 7, 2011 at 3:30 AM, Idel Fuschini
> wrote:
> > Hi people,
> > I've got this problem with DEFLATE.
> > This is my code example :
> > use strict;
> > use warnings;
> > use Apache2::Filter ();
> > use Apache2::RequestRec ();
> > use APR::Table ();
> > use Cache::FileBackend;
> > use Apache2::Const -compile => qw(OK);
> > use constant BUFF_LEN => 1024;
> > use vars qw($VERSION);
> > sub handler {
> > unless ($f->ctx) {
> > $f->r->headers_out->unset('Content-Length');
> > $f->ctx(1);
> > }
> >
> > my $Hash=$f->r->subprocess_env();
> > my $html_page="hello";
> > my $content_type="text/html";
> > my $len_bytes=length $html_page;
> > $f->r->headers_out->set("Content-Length"=>$len_bytes);
> > $f->r->headers_out->set("Last-Modified" => time());
> > $f->r->content_type($content_type);
> > $f->print($html_page);
> > return Apache2::Const::OK;
> > }
> > This is my configuration on httpd.conf;
> >
> > PerlSetOutputFilter DEFLATE
> > PerlSetOutputFilter INCLUDES
> > SetHandler modperl
> > PerlOutputFilterHandler Apache2::AMFWebService
> > Allow from all
> >

> > I don't have any response on my browser, why ?
> > Thanks
> > Idel
> > =====================
> > Mobile: +39 349 442 2668
> > E-Mail: idel.fuschini@gmail.com
> > Web Site: http://www.idelfuschini.it
> > OpenSource Project: Apache Mobile Filter -
> > http://www.idelfuschini.it/apache-mobile-filter-v2x.html
> > Test Page: http://www.apachemobilefilter.org/test/php_test.php
> > Mobile Test Page: http://www.apachemobilefilter.org
> > ------
> > La presente comunicazione ed i suoi allegati e' destinata esclusivamente
> > ai destinatari. Qualsiasi suo utilizzo, comunicazione o diffusione non
> > autorizzata
> > e' proibita. Se ha ricevuto questa comunicazione per errore, la preghiamo
> di
> > darne
> > immediata comunicazione al mittente e di cancellare tutte le informazioni
> > erroneamente acquisite. (Rif. D.Lgs. 196/2003). Grazie
> >
> > This message and its attachments are intended only for use by the
> > addressees. Any use,
> > re-transmission or dissemination not authorized of it is prohibited. If
> you
> > received
> > this e-mail in error, please inform the sender immediately and delete all
> > the material.
> > (Rif. D.Lgs. 196/2003). Thank you.
> >
>

--000e0cd5cb624642cf04a3a51b69
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

yes the result is the same.
Idel
=======3D=
==============
Mobile: +39 349 442 2668
E=
-Mail: idel.fuschini@gmail.com a>
Web Site:
http://www.idelfusch=
ini.it


OpenSource Project: Apache Mobile Filter - ni.it/apache-mobile-filter-v2x.html">http://www.idelfuschini .it/apache-mobi=
le-filter-v2x.html

Test Page:=A0 ilter.org/test/php_test.php">http://www.apachemobilefilter.o rg/test/php_tes=
t.php


Mobile Test Page:=A0 http://w=
ww.apachemobilefilter.org

------
La presente comunicazione ed i s=
uoi allegati e' destinata esclusivamente
ai destinatari. Qualsiasi =
suo utilizzo, comunicazione o diffusione non autorizzata

e' proibita. Se ha ricevuto questa comunicazione per errore, la preghia=
mo di darne
immediata comunicazione al mittente e di cancellare tutte l=
e informazioni
erroneamente acquisite. (Rif. D.Lgs. 196/2003). Grazie >

This message and its attachments are intended only for use by the addre=
ssees. Any use,
re-transmission or dissemination not authorized of it i=
s prohibited. If you received
this e-mail in error, please inform the s=
ender immediately and delete all the material.

(Rif. D.Lgs. 196/2003). Thank you.



On 19 May 2011 19:52, Fred Moyer ir=3D"ltr"><fred@redhotpenguin=
..com
>
wrote:
rgin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Have you tried mod_deflate?



On Sat, May 7, 2011 at 3:30 AM, Idel Fuschini < schini@gmail.com">idel.fuschini@gmail.com> wrote:

> Hi people,

> I've got this problem with DEFLATE.

> This is my code example :

> =A0 use strict;

> =A0 use warnings;

> =A0 use Apache2::Filter ();

> =A0 use Apache2::RequestRec ();

> =A0 use APR::Table ();

> =A0 use Cache::FileBackend;

> =A0 use Apache2::Const -compile =3D> qw(OK);

> =A0 use constant BUFF_LEN =3D> 1024;

> =A0 use vars qw($VERSION);

> =A0 sub handler {

> =A0 =A0 =A0 unless ($f->ctx) {

> =A0 =A0 =A0 =A0 =A0 $f->r->headers_out->unset('Content-Le=
ngth');

> =A0 =A0 =A0 =A0 =A0 $f->ctx(1);

> =A0 =A0 =A0 }

>

> =A0 =A0 =A0 my $Hash=3D$f->r->subprocess_env();

> =A0 =A0 =A0 my $html_page=3D"<b>hello</b>";

> =A0 =A0 =A0 my $content_type=3D"text/html";

> =A0 =A0 =A0 my $len_bytes=3Dlength $html_page;

> =A0 =A0 =A0 $f->r->headers_out->set("Content-Length"=
;=3D>$len_bytes);

> =A0 =A0 =A0 $f->r->headers_out->set("Last-Modified"=
=3D> time());

> =A0 =A0 =A0 $f->r->content_type($content_type);

> =A0 =A0 =A0 $f->print($html_page);

> =A0 =A0 =A0 return Apache2::Const::OK;

> =A0 }

> This is my configuration on httpd.conf;

> <Location /WSDeflate/*>

> =A0 =A0PerlSetOutputFilter DEFLATE

> =A0 =A0PerlSetOutputFilter INCLUDES

> =A0 =A0SetHandler modperl

> =A0 =A0PerlOutputFilterHandler Apache2::AMFWebService

> =A0 =A0Allow from all

> </Location>

> I don't have any response on my browser, why ?

> Thanks

> Idel

> ==================== =3D

> Mobile: +39 349 442 2668

> E-Mail: idel.fuschini@gmail=
..com


> Web Site: htt=
p://www.idelfuschini.it


> OpenSource Project: Apache Mobile Filter -

> arget=3D"_blank">http://www.idelfuschini.it/apache-mobile-fi lter-v2x.html a>

> Test Page:=A0
st.php" target=3D"_blank">http://www.apachemobilefilter.org/test/php _test.p=
hp


> Mobile Test Page:=A0 get=3D"_blank">http://www.apachemobilefilter.org

> ------

> La presente comunicazione ed i suoi allegati e' destinata esclusiv=
amente

> ai destinatari. Qualsiasi suo utilizzo, comunicazione o diffusione non=


> autorizzata

> e' proibita. Se ha ricevuto questa comunicazione per errore, la pr=
eghiamo di

> darne

> immediata comunicazione al mittente e di cancellare tutte le informazi=
oni

> erroneamente acquisite. (Rif. D.Lgs. 196/2003). Grazie

>

> This message and its attachments are intended only for use by the

> addressees. Any use,

> re-transmission or dissemination not authorized of it is prohibited. I=
f you

> received

> this e-mail in error, please inform the sender immediately and delete =
all

> the material.

> (Rif. D.Lgs. 196/2003). Thank you.

>




--000e0cd5cb624642cf04a3a51b69--

Re: Deflate problem

am 19.05.2011 20:46:38 von Fred Moyer

Please cc the list on your responses so that others can help answer in
the event this scratch off lottery ticket here next to me has a big
prize and I take off on vacation ;)

For what it is worth, it looks like your code example contained a
response handler and output filter in the same subroutine. You
probably want to revisit the filter documentation on perl.apache.org.
For instance, you set a content length header from $f; I don't know
too many filters that know ahead of time what the length of the
response will be until it is filtered.

On Thu, May 19, 2011 at 11:23 AM, Idel Fuschini w=
rote:
> yes the result is the same.
>
> On 19 May 2011 19:52, Fred Moyer wrote:
>>
>> Have you tried mod_deflate?
>>
>> On Sat, May 7, 2011 at 3:30 AM, Idel Fuschini
>> wrote:
>> > Hi people,
>> > I've got this problem with DEFLATE.
>> > This is my code example :
>> > =A0 use strict;
>> > =A0 use warnings;
>> > =A0 use Apache2::Filter ();
>> > =A0 use Apache2::RequestRec ();
>> > =A0 use APR::Table ();
>> > =A0 use Cache::FileBackend;
>> > =A0 use Apache2::Const -compile =3D> qw(OK);
>> > =A0 use constant BUFF_LEN =3D> 1024;
>> > =A0 use vars qw($VERSION);
>> > =A0 sub handler {
>> > =A0 =A0 =A0 unless ($f->ctx) {
>> > =A0 =A0 =A0 =A0 =A0 $f->r->headers_out->unset('Content-Length');
>> > =A0 =A0 =A0 =A0 =A0 $f->ctx(1);
>> > =A0 =A0 =A0 }
>> >
>> > =A0 =A0 =A0 my $Hash=3D$f->r->subprocess_env();
>> > =A0 =A0 =A0 my $html_page=3D"hello";
>> > =A0 =A0 =A0 my $content_type=3D"text/html";
>> > =A0 =A0 =A0 my $len_bytes=3Dlength $html_page;
>> > =A0 =A0 =A0 $f->r->headers_out->set("Content-Length"=3D>$len_bytes);
>> > =A0 =A0 =A0 $f->r->headers_out->set("Last-Modified" =3D> time());
>> > =A0 =A0 =A0 $f->r->content_type($content_type);
>> > =A0 =A0 =A0 $f->print($html_page);
>> > =A0 =A0 =A0 return Apache2::Const::OK;
>> > =A0 }
>> > This is my configuration on httpd.conf;
>> >
>> > =A0 =A0PerlSetOutputFilter DEFLATE
>> > =A0 =A0PerlSetOutputFilter INCLUDES
>> > =A0 =A0SetHandler modperl
>> > =A0 =A0PerlOutputFilterHandler Apache2::AMFWebService
>> > =A0 =A0Allow from all
>> >

>> > I don't have any response on my browser, why ?
>> > Thanks
>> > Idel
>> > ==================== =3D
>> > Mobile: +39 349 442 2668
>> > E-Mail: idel.fuschini@gmail.com
>> > Web Site: http://www.idelfuschini.it
>> > OpenSource Project: Apache Mobile Filter -
>> > http://www.idelfuschini.it/apache-mobile-filter-v2x.html
>> > Test Page:=A0 http://www.apachemobilefilter.org/test/php_test.php
>> > Mobile Test Page:=A0 http://www.apachemobilefilter.org
>> > ------
>> > La presente comunicazione ed i suoi allegati e' destinata esclusivamen=
te
>> > ai destinatari. Qualsiasi suo utilizzo, comunicazione o diffusione non
>> > autorizzata
>> > e' proibita. Se ha ricevuto questa comunicazione per errore, la
>> > preghiamo di
>> > darne
>> > immediata comunicazione al mittente e di cancellare tutte le
>> > informazioni
>> > erroneamente acquisite. (Rif. D.Lgs. 196/2003). Grazie
>> >
>> > This message and its attachments are intended only for use by the
>> > addressees. Any use,
>> > re-transmission or dissemination not authorized of it is prohibited. I=
f
>> > you
>> > received
>> > this e-mail in error, please inform the sender immediately and delete
>> > all
>> > the material.
>> > (Rif. D.Lgs. 196/2003). Thank you.
>> >
>
>

Re: Deflate problem

am 19.05.2011 21:02:10 von torsten.foertsch

On Saturday, May 07, 2011 12:30:56 Idel Fuschini wrote:
> I've got this problem with DEFLATE.

I think you either simply forgot to mention a PerlResponseHandler or you=20
should omit the "SetHandler modperl".

>
> PerlSetOutputFilter DEFLATE
> PerlSetOutputFilter INCLUDES
> SetHandler modperl
> PerlOutputFilterHandler Apache2::AMFWebService
> Allow from all
>


=46urther, the order the filters will be called is this:

INCLUDES ==> Apache2::AMFWebService ==> DEFLATE

Torsten Förtsch

=2D-=20
Need professional modperl support? Hire me! (http://foertsch.name)

Like fantasy? http://kabatinte.net