Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

Deflate problem

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


idel.fuschini at gmail

May 7, 2011, 3:30 AM

Post #1 of 5 (891 views)
Permalink
Deflate problem

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="<b>hello</b>";
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;
<Location /WSDeflate/*>
PerlSetOutputFilter DEFLATE
PerlSetOutputFilter INCLUDES
SetHandler modperl
PerlOutputFilterHandler Apache2::AMFWebService
Allow from all
</Location>

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

Thanks
Idel
=====================
Mobile: +39 349 442 2668
E-Mail: idel.fuschini [at] gmail
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.


fred at redhotpenguin

May 19, 2011, 10:52 AM

Post #2 of 5 (815 views)
Permalink
Re: Deflate problem [In reply to]

Have you tried mod_deflate?

On Sat, May 7, 2011 at 3:30 AM, Idel Fuschini <idel.fuschini [at] gmail> 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="<b>hello</b>";
>       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;
> <Location /WSDeflate/*>
>    PerlSetOutputFilter DEFLATE
>    PerlSetOutputFilter INCLUDES
>    SetHandler modperl
>    PerlOutputFilterHandler Apache2::AMFWebService
>    Allow from all
> </Location>
> I don't have any response on my browser, why ?
> Thanks
> Idel
> =====================
> Mobile: +39 349 442 2668
> E-Mail: idel.fuschini [at] gmail
> 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.
>


idel.fuschini at gmail

May 19, 2011, 11:23 AM

Post #3 of 5 (823 views)
Permalink
Re: Deflate problem [In reply to]

yes the result is the same.
Idel
=====================
Mobile: +39 349 442 2668
E-Mail: idel.fuschini [at] gmail
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 <fred [at] redhotpenguin> wrote:

> Have you tried mod_deflate?
>
> On Sat, May 7, 2011 at 3:30 AM, Idel Fuschini <idel.fuschini [at] gmail>
> 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="<b>hello</b>";
> > 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;
> > <Location /WSDeflate/*>
> > PerlSetOutputFilter DEFLATE
> > PerlSetOutputFilter INCLUDES
> > SetHandler modperl
> > PerlOutputFilterHandler Apache2::AMFWebService
> > Allow from all
> > </Location>
> > I don't have any response on my browser, why ?
> > Thanks
> > Idel
> > =====================
> > Mobile: +39 349 442 2668
> > E-Mail: idel.fuschini [at] gmail
> > 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.
> >
>


fred at redhotpenguin

May 19, 2011, 11:46 AM

Post #4 of 5 (816 views)
Permalink
Re: Deflate problem [In reply to]

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 <idel.fuschini [at] gmail> wrote:
> yes the result is the same.
>
> On 19 May 2011 19:52, Fred Moyer <fred [at] redhotpenguin> wrote:
>>
>> Have you tried mod_deflate?
>>
>> On Sat, May 7, 2011 at 3:30 AM, Idel Fuschini <idel.fuschini [at] gmail>
>> 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="<b>hello</b>";
>> >       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;
>> > <Location /WSDeflate/*>
>> >    PerlSetOutputFilter DEFLATE
>> >    PerlSetOutputFilter INCLUDES
>> >    SetHandler modperl
>> >    PerlOutputFilterHandler Apache2::AMFWebService
>> >    Allow from all
>> > </Location>
>> > I don't have any response on my browser, why ?
>> > Thanks
>> > Idel
>> > =====================
>> > Mobile: +39 349 442 2668
>> > E-Mail: idel.fuschini [at] gmail
>> > 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.
>> >
>
>


torsten.foertsch at gmx

May 19, 2011, 12:02 PM

Post #5 of 5 (817 views)
Permalink
Re: Deflate problem [In reply to]

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
should omit the "SetHandler modperl".

> <Location /WSDeflate/*>
> PerlSetOutputFilter DEFLATE
> PerlSetOutputFilter INCLUDES
> SetHandler modperl
> PerlOutputFilterHandler Apache2::AMFWebService
> Allow from all
> </Location>

Further, the order the filters will be called is this:

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

Torsten Förtsch

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

Like fantasy? http://kabatinte.net

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.