Re: Output filters, data encoding

2019-11-14 Thread Damyan Ivanov
-=| p...@cpan.org, 14.11.2019 09:51:20 +0100 |=- > On Wednesday 13 November 2019 20:37:06 Damyan Ivanov wrote: > >my($buffer, $string) = ("", ""); > >while (read($fh, $buffer, 256, length($buffer))) { > >$string .= decode($encoding, $buffer, Encode::FB_QUIET)

Re: Output filters, data encoding

2019-11-14 Thread tomcat/perl
On 14.11.2019 01:09, Hua, Yong wrote: Hi on 2019/11/14 2:12, André Warnier (tomcat/perl) wrote: I'm writing a new PerlOutputFilter, stream version. Can you give a more general introduction for what is "stream version"? Thank you. You shoud read the pages which I referred to previously, they

Re: Output filters, data encoding

2019-11-14 Thread Vincent Veyron
On Wed, 13 Nov 2019 19:12:10 +0100 André Warnier (tomcat/perl) wrote: > I also found that calls to binmode in output filters generate a double encoding. Here is a paste of the code of an output filter that adds a menu, some headers and closing tags to the html pages generated by previ

Re: Output filters, data encoding

2019-11-14 Thread pali
On Wednesday 13 November 2019 20:37:06 Damyan Ivanov wrote: > -=| André Warnier (tomcat/perl), 13.11.2019 19:12:10 +0100 |=- > > while (my $sz = $f->read(my $buffer, BUFF_LEN)) { > > .. > > > > and then I need to pass this data to another module for processing > > (Template::Toolkit). > > To

Re: Output filters, data encoding

2019-11-14 Thread pali
On Wednesday 13 November 2019 20:10:07 André Warnier (tomcat/perl) wrote: > On 13.11.2019 19:53, p...@cpan.org wrote: > > On Wednesday 13 November 2019 19:52:25 André Warnier (tomcat/perl) wrote: > > > On 13.11.2019 19:17, p...@cpan.org wrote: > > > > On Wednesday 13 November 2019 19:12:10 André Wa

Re: Output filters, data encoding

2019-11-13 Thread Hua, Yong
Hi on 2019/11/14 2:12, André Warnier (tomcat/perl) wrote: I'm writing a new PerlOutputFilter, stream version. Can you give a more general introduction for what is "stream version"? Thank you.

Re: Output filters, data encoding

2019-11-13 Thread tomcat/perl
On 13.11.2019 19:37, Damyan Ivanov wrote: -=| André Warnier (tomcat/perl), 13.11.2019 19:12:10 +0100 |=- while (my $sz = $f->read(my $buffer, BUFF_LEN)) { .. and then I need to pass this data to another module for processing (Template::Toolkit). To make a long story short, Template::To

Re: Output filters, data encoding

2019-11-13 Thread tomcat/perl
On 13.11.2019 19:53, p...@cpan.org wrote: On Wednesday 13 November 2019 19:52:25 André Warnier (tomcat/perl) wrote: On 13.11.2019 19:17, p...@cpan.org wrote: On Wednesday 13 November 2019 19:12:10 André Warnier (tomcat/perl) wrote: My question is : can I - and how -, set the filehandle that co

Re: Output filters, data encoding

2019-11-13 Thread pali
On Wednesday 13 November 2019 19:52:25 André Warnier (tomcat/perl) wrote: > On 13.11.2019 19:17, p...@cpan.org wrote: > > On Wednesday 13 November 2019 19:12:10 André Warnier (tomcat/perl) wrote: > > > My question is : can I - and how -, set the filehandle that corresponds to > > > the $f->read(),

Re: Output filters, data encoding

2019-11-13 Thread tomcat/perl
On 13.11.2019 19:17, p...@cpan.org wrote: On Wednesday 13 November 2019 19:12:10 André Warnier (tomcat/perl) wrote: My question is : can I - and how -, set the filehandle that corresponds to the $f->read(), to a UTF-8 layer ? I have tried line 155: binmode($f,'encoding:(UTF-8)'); Hi André! Wh

Re: Output filters, data encoding

2019-11-13 Thread Damyan Ivanov
-=| André Warnier (tomcat/perl), 13.11.2019 19:12:10 +0100 |=- > while (my $sz = $f->read(my $buffer, BUFF_LEN)) { > .. > > and then I need to pass this data to another module for processing > (Template::Toolkit). > To make a long story short, Template::Toolkit misinterprets the data I'm >

Re: Output filters, data encoding

2019-11-13 Thread pali
On Wednesday 13 November 2019 19:12:10 André Warnier (tomcat/perl) wrote: > My question is : can I - and how -, set the filehandle that corresponds to > the $f->read(), to a UTF-8 layer ? > I have tried > > line 155: binmode($f,'encoding:(UTF-8)'); Hi André! When specifying PerlIO layer for file

Output filters, data encoding

2019-11-13 Thread tomcat/perl
Hi. I'm writing a new PerlOutputFilter, stream version. I have written several working ones before, so I know the general scheme. But in this latest filter, I have a problem with the data encoding, which I did not encounter previously. I did not find an answer in the on-line mod_perl documentatio

Re: [mp2 ] Request output filters and directories

2011-03-22 Thread Clément OUDOT
2011/3/22 Torsten Förtsch : > On Tuesday, March 22, 2011 15:43:07 Clément OUDOT wrote: >> Can this behaviour comes from the DirectoryIndex and mod_dir? > > I assume you call add_output_filter in My::Package? Hi, thanks for the answer. Indeed, My::Package call a module like the following, and the

Re: [mp2 ] Request output filters and directories

2011-03-22 Thread Torsten Förtsch
On Tuesday, March 22, 2011 15:43:07 Clément OUDOT wrote: > Can this behaviour comes from the DirectoryIndex and mod_dir? I assume you call add_output_filter in My::Package? Now, mod_dir uses subrequests for all of your DirectoryIndex documents. The first it finds, it redirects to using ap_intern

[mp2 ] Request output filters and directories

2011-03-22 Thread Clément OUDOT
Hi all, I am one of the developer of LemonLDAP::NG (http://lemonldap-ng.org), a free WebSSO using mod_perl. So to begin, thanks to the mod_perl team for this great product! In our code, we are injecting request output filters with the add_output_filter method. This works well, but we noticed

Apache output filters and mod_deflate...

2009-08-11 Thread James Smith
Has anyone had experience of Apache output filters and mod_deflate - I'm getting some strange behaviour if the apache output filter is generating multiple buckets... and am looking for someone to give me some advice - as using output filters and mod_deflate would be the perfect solution

Re: mod_perl Output Filters and mod_deflate

2009-08-06 Thread André Warnier
James Smith wrote: According to the documentation - mod_deflate should be being run after my filter as mod_deflate is a connection filter where mine is request filter! My filter is being run - and getting the right input content - observed as I was dumping the HTML coming in and going out!

Re: mod_perl Output Filters and mod_deflate

2009-08-06 Thread James Smith
André Warnier wrote: .. and sorry again for sending directly to you. I keep forgetting this list doesn't set this automatically. James Smith wrote: Has anyone had experience of using mod_perl OutputFilters with mod_deflate, I've been banging my head against a brick wall today I've learnt

Re: mod_perl Output Filters and mod_deflate

2009-08-06 Thread André Warnier
.. and sorry again for sending directly to you. I keep forgetting this list doesn't set this automatically. James Smith wrote: Has anyone had experience of using mod_perl OutputFilters with mod_deflate, I've been banging my head against a brick wall today I've learnt a lot about bucket bri

mod_perl Output Filters and mod_deflate

2009-08-05 Thread James Smith
Has anyone had experience of using mod_perl OutputFilters with mod_deflate, I've been banging my head against a brick wall today I've learnt a lot about bucket brigades - but for every two steps forward it's one step back... Scenario: static page - being wrapped with an output filter - w

Re: disable input and output filters for subfolders

2009-08-01 Thread Torsten Foertsch
On Sat 01 Aug 2009, Mike Barborak wrote: > Invalid per-directory PerlOption: InputFilter > > so it seems that while PerlOption is allowed at the directory level, > the InputFilter and OutputFilter options are not. (i actually > couldn't find a relevant section in the docs about that so i am > unsur

Re: disable input and output filters for subfolders

2009-08-01 Thread Mike Barborak
so when i tried the httpd.conf approach i ran into a problem. i added this to my conf file: PerlOptions -InputFilter -OutputFilter but when i ran "apachectl -t" on it i got this syntax error: Invalid per-directory PerlOption: InputFilter so it seems that while PerlOption is allowed at

Re: disable input and output filters for subfolders

2009-07-30 Thread Mike Barborak
excellent. thanks so much - i searched and scanned that document but obviously not well enough. rtfm. best, mike On Thu, Jul 30, 2009 at 12:26 PM, Torsten Foertsch wrote: > On Thu 30 Jul 2009, Torsten Foertsch wrote: > > Sorry, I hit return while one of my left hand fingers rested on the CTRL >

Re: disable input and output filters for subfolders

2009-07-30 Thread Torsten Foertsch
On Thu 30 Jul 2009, Torsten Foertsch wrote: Sorry, I hit return while one of my left hand fingers rested on the CTRL key and the MUA interpreted this as "send mail now". So, here comes the rest of what I wanted to say. > On Wed 29 Jul 2009, Mike Barborak wrote: > > is there magic to remove filt

Re: disable input and output filters for subfolders

2009-07-30 Thread Torsten Foertsch
On Wed 29 Jul 2009, Mike Barborak wrote: > i have filters working correctly for a directory on my website. there > is a subdirectory that i would like to not be passed through the > filters. can i do this through the apache conf file or do i need to > code this into my filters? > > here is my apach

disable input and output filters for subfolders

2009-07-29 Thread Mike Barborak
i have filters working correctly for a directory on my website. there is a subdirectory that i would like to not be passed through the filters. can i do this through the apache conf file or do i need to code this into my filters? here is my apache setup: PerlRequire "/var/www/vhosts/mydomain.com/

Re: Forcing order of perl output filters

2008-04-28 Thread Torsten Foertsch
On Mon 28 Apr 2008, woinshet abdella wrote: > $r->add_config([ > 'PerlOutputFilterHandler BI::Apache::FilterBeforeIncludes', > 'PerlSetOutputFilter INCLUDES', > 'PerlOutputFilterHandler BI::Apache::FilterAfterIncludes']); >   > I want the response to be processed by the filters in the order specifi

Forcing order of perl output filters

2008-04-28 Thread woinshet abdella
I have the following configuration in a PerlFixupHandler, $r->add_config([ 'PerlOutputFilterHandler BI::Apache::FilterBeforeIncludes', 'PerlSetOutputFilter INCLUDES', 'PerlOutputFilterHandler BI::Apache::FilterAfterIncludes']); I want the response to be processed by the filters in the order spec

RE: output filters

2008-01-31 Thread Adam Prime x443
mode=all Adam -Original Message- From: J Amuse [mailto:[EMAIL PROTECTED] Sent: Thursday, January 31, 2008 9:17 AM To: modperl@perl.apache.org Subject: output filters I'm trying to write a filter using modperl that will update parts of the server response on the fly. My first atte

output filters

2008-01-31 Thread J Amuse
I'm trying to write a filter using modperl that will update parts of the server response on the fly. My first attempt was to rewrite the path setting in the server's set cookie response to set the path to: path=/NewPath. After copying and pasting some examples I came up with the following: package

Re: Docs/User Guide: code sample incorrect in "Input and Output Filters"?

2005-06-07 Thread Philippe M. Chiasson
Matt Hahnfeld wrote: > I was going through the filters documentation for mod_perl 2.0 here: > > http://perl.apache.org/docs/2.0/user/handlers/filters.html > > Under "All-in-one" filter, there's some source code for Dump.pm. Run > on my system under mod_perl 2.0.0 and Apache 2.0.54, it returns t

Docs/User Guide: code sample incorrect in "Input and Output Filters"?

2005-06-07 Thread Matt Hahnfeld
I was going through the filters documentation for mod_perl 2.0 here: http://perl.apache.org/docs/2.0/user/handlers/filters.html Under "All-in-one" filter, there's some source code for Dump.pm. Run on my system under mod_perl 2.0.0 and Apache 2.0.54, it returns the following error: Can't locate

Re: [mp2] Dynamically pushing output filters -- Questions

2005-05-24 Thread Stas Bekman
Chris Jacobson wrote: Stas Bekman wrote: Stas Bekman wrote: $r->add_output_filter($FilterObject->handler); # This call will Seg Fault the server The fact that you get a segfault is not good, we should take care of that. Chris, mind to give us a simple case to reproduce that segfaul

Re: [mp2] Dynamically pushing output filters -- Questions

2005-05-24 Thread Chris Jacobson
Stas Bekman wrote: Stas Bekman wrote: $r->add_output_filter($FilterObject->handler); # This call will Seg Fault the server The fact that you get a segfault is not good, we should take care of that. Chris, mind to give us a simple case to reproduce that segfault? Not at all. I am und

Re: [mp2] Dynamically pushing output filters -- Questions

2005-05-23 Thread Stas Bekman
Stas Bekman wrote: $r->add_output_filter($FilterObject->handler); # This call will Seg Fault the server The fact that you get a segfault is not good, we should take care of that. Chris, mind to give us a simple case to reproduce that segfault? -- __

Re: [mp2] Dynamically pushing output filters -- Questions

2005-05-22 Thread Chris Jacobson
Tom Schindl wrote: Chris Jacobson schrieb: | Hello, | |I am attempting to write a system which allows output filters to be | dynamicaly pushed on the output filter stack at the end of a | PerlResponseHandler. These output filters are generated from a master | factory object. | | my

Re: [mp2] Dynamically pushing output filters -- Questions

2005-05-22 Thread Tom Schindl
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chris Jacobson schrieb: | Hello, | |I am attempting to write a system which allows output filters to be | dynamicaly pushed on the output filter stack at the end of a | PerlResponseHandler. These output filters are generated from a master

Re: [mp2] Dynamically pushing output filters -- Questions

2005-05-22 Thread Chris Jacobson
Stas Bekman wrote: Chris Jacobson wrote: Hello, I am attempting to write a system which allows output filters to be dynamicaly pushed on the output filter stack at the end of a PerlResponseHandler. That doesn't make any sense, Chris. By the end of the PerlResponseHandle

Re: [mp2] Dynamically pushing output filters -- Questions

2005-05-20 Thread Stas Bekman
Chris Jacobson wrote: Stas Bekman wrote: Chris Jacobson wrote: Hello, I am attempting to write a system which allows output filters to be dynamicaly pushed on the output filter stack at the end of a PerlResponseHandler. That doesn't make any sense, Chris. By the end o

Re: [mp2] Dynamically pushing output filters -- Questions

2005-05-20 Thread Stas Bekman
Chris Jacobson wrote: Hello, I am attempting to write a system which allows output filters to be dynamicaly pushed on the output filter stack at the end of a PerlResponseHandler. That doesn't make any sense, Chris. By the end of the PerlResponseHandler the response is gone and the

[mp2] Dynamically pushing output filters -- Questions

2005-05-20 Thread Chris Jacobson
Hello, I am attempting to write a system which allows output filters to be dynamicaly pushed on the output filter stack at the end of a PerlResponseHandler. These output filters are generated from a master factory object. my $FilterType = "Foo"; my $FilterObject = My::Fil

Re: MP2 output filters

2004-08-26 Thread Stas Bekman
Jared Cook wrote: I am trying to implement a stream output filter and am having a little problem. I need to have the INCLUDES filter process the output first and then send it to the mod_perl filter. I used PerlSetOutputFilter INCLUDES, and I think it is getting the data before it goes to my fi

MP2 output filters

2004-08-25 Thread Jared Cook
I am trying to implement a stream output filter and am having a little problem. I need to have the INCLUDES filter process the output first and then send it to the mod_perl filter. I used PerlSetOutputFilter INCLUDES, and I think it is getting the data before it goes to my filter. Now my pro

Re: [mp2] custom_response() in HTTP Request Output Filters?

2004-03-31 Thread John D . Lima
On Mar 31, 2004, at 11:46 AM, Geoffrey Young wrote: Under certain conditions I want to add additional html to the server's error response But John is talking about converting a non-error response into an error. Does it still apply? I don't know. it was the above quoted part that caught my atte

Re: [mp2] custom_response() in HTTP Request Output Filters?

2004-03-31 Thread Geoffrey Young
>>> Under certain conditions I want to add >>> additional >>> html to the server's error response > > But John is talking about converting a non-error response into an error. > Does it still apply? I don't know. it was the above quoted part that caught my attention, but it may not solve all of

Re: [mp2] custom_response() in HTTP Request Output Filters?

2004-03-31 Thread Stas Bekman
Geoffrey Young wrote: John D.Lima wrote: I have a proxy running with mod_proxy with a request output filter for examining the (remote) server response. Under certain conditions I want to add additional html to the server's error response, or replace a (possibly non-error) response with a dynamic

Re: [mp2] custom_response() in HTTP Request Output Filters?

2004-03-31 Thread Geoffrey Young
John D.Lima wrote: > I have a proxy running with mod_proxy with a request output filter for > examining > the (remote) server response. Under certain conditions I want to add > additional > html to the server's error response, or replace a (possibly non-error) > response > with a dynamic error d

Re: [mp2] custom_response() in HTTP Request Output Filters?

2004-03-31 Thread Stas Bekman
John D.Lima wrote: [...] I was rather hoping to avoid setting up the logic to examine bucket contents. Reading between the line [sic] I guess the answer is no, $r->custom_response doesn't work in the request output filter? Does the connection filter give me access to the $r->headers_out() as wel

Re: [mp2] custom_response() in HTTP Request Output Filters?

2004-03-31 Thread John D . Lima
On Mar 31, 2004, at 10:04 AM, Stas Bekman wrote: John D.Lima wrote: I have a proxy running with mod_proxy with a request output filter for examining the (remote) server response. Under certain conditions I want to add additional html to the server's error response, or replace a (possibly non-e

Re: [mp2] custom_response() in HTTP Request Output Filters?

2004-03-31 Thread Stas Bekman
John D.Lima wrote: I have a proxy running with mod_proxy with a request output filter for examining the (remote) server response. Under certain conditions I want to add additional html to the server's error response, or replace a (possibly non-error) response with a dynamic error document of my

[mp2] custom_response() in HTTP Request Output Filters?

2004-03-31 Thread John D . Lima
I have a proxy running with mod_proxy with a request output filter for examining the (remote) server response. Under certain conditions I want to add additional html to the server's error response, or replace a (possibly non-error) response with a dynamic error document of my construction, chan

Re: [MP2] "here" documents and UTF-8 and output filters

2004-02-25 Thread Stas Bekman
please post a proper bug report, Matthew. We don't even know which mp2 do you use. A complete *real* short example is expected as well. __ Stas BekmanJAm_pH --> Just Another mod_perl Hacker http://stason.org/ mod_

Re: [MP2] "here" documents and UTF-8 and output filters

2004-02-25 Thread Matthew Darwin
Stas Bekman wrote: Matthew Darwin wrote: Stas Bekman wrote: Ah, I suppose this is a typing error: > my $string < ... > ... > EOF > print $string; you miss '=' Sorry... writing up exmaples has inherent dangers. Also try adding utf8::encode($string); Tried that already. No help. -- Matth

Re: [MP2] "here" documents and UTF-8 and output filters

2004-02-25 Thread Stas Bekman
Matthew Darwin wrote: Stas Bekman wrote: Ah, I suppose this is a typing error: > my $string < ... > ... > EOF > print $string; you miss '=' Also try adding utf8::encode($string); Finally your bug report is missing. Please submit one, including a real example that we can try to reproduce the pro

Re: [MP2] "here" documents and UTF-8 and output filters

2004-02-25 Thread Matthew Darwin
Stas Bekman wrote: Can you reproduce this problem outside of mp2? just a plain perl program? No. Any difference if you add: use Apache::RequestIO (); binmode(STDOUT, ':utf8'); # Apache::RequestRec::BINMODE() Yes, I get different garbage. before you do the print. Or if you use $r->print() instead

Re: [MP2] "here" documents and UTF-8 and output filters

2004-02-25 Thread Stas Bekman
Matthew Darwin wrote: I'm not sure if anyone has noticed this, so I thought I'd post. If I create a string using here syntax: my $string < And $string contains UTF-8 characters they get mangled somehow when they go through the output chain. However, if I build the same document using my $strin

Re: [MP2] "here" documents and UTF-8 and output filters

2004-02-25 Thread Ged Haywood
Hello there, On Wed, 25 Feb 2004, Matthew Darwin wrote: > If I create a string using here syntax: > my $string < ... > EOF > print $string; > > And $string contains UTF-8 characters they get mangled somehow when they > go through the output chain. > > However, if I build the same document using >

[MP2] "here" documents and UTF-8 and output filters

2004-02-25 Thread Matthew Darwin
I'm not sure if anyone has noticed this, so I thought I'd post. If I create a string using here syntax: my $string < And $string contains UTF-8 characters they get mangled somehow when they go through the output chain. However, if I build the same document using my $string; $string .= "..." $s