Clinton Gormley | 1 Dec 11:58 2011

SVN Snapshots not available

Hiya

Not sure where to report this, but the http://svn.apache.org/snapshots
directory linked to on
http://perl.apache.org/download/source.html#Development_mod_perl_2_0_Source_Distribution no
longer exists.

Any idea where to download SVN snapshots from now? (other than from the
svn repo itself)

thanks

Clint

Desilets, Alain | 1 Dec 23:16 2011
Picon

CGI::Utils->getSelfRefUrlWithQuery() not working inside mod_perl?

Trying to migrate a complex script from a standard CGI context to a mod_perl context, and am having a hell of a
time. The latest problem is that I have a call to GCI::Utils->getSelfRefUrlWithQuery() which causes a crash.

In an attempt to isolate the problem, I wrote this short script which does nothing more than call that method:

--------------
#!perl -w
use strict;
print "Content-type: text/plain\r\n\r\n";
use CGI::Utils;
my $self_url = '';
print "Before calling get_self_ref_url_with_query()\n";
#no strict;
my $cgi_utils = CGI::Utils->new();
$self_url = $cgi_utils->getSelfRefUrlWithQuery();
#$self_url = $cgi_utils->get_self_ref_url_with_query();
#$self_url = CGI::Utils->getSelfRefUrlWithQuery();
#$self_url = CGI::Utils->getSelfRefUrlWithQuery();
#use strict;
---------------

When I run it, I get the following error:

[Thu Dec 01 17:04:21 2011] [error] Can't use string ("HTML::Mason::Commands::m") as a SCALAR ref while
"strict refs" in use at C:/Perl/site/lib/CGI/Utils.pm line 203.\n

If I comment out the call to getSelfRefUrlWithQuery(), then the script runs fine.

I have tried calling that method in four different ways (as CGI::Utils-> or $cgi_utils->, with the
underscore or hungarian notation variants), with or without 'no strict'. All of those combinations fail.
(Continue reading)

Desilets, Alain | 1 Dec 23:36 2011
Picon

RE: CGI::Utils->getSelfRefUrlWithQuery() not working inside mod_perl?

BTW, according to the doc for CGI::Utils->new(), the constructor works in mod_perl provided that the
Apache request object is passed as argument, or can be retrieved via Apache->request or Apache2::RequestUtil->request.

So, I updated my script to verify that Apache2::RequestUtil->request does indeed return a valid request.
When I print the returned instance, it says:

   Apache2::RequestRec=SCALAR(0x485052c)

which indicates that it is indeed a scalar that is blessed into the RequestRec class.

________________________________________
From: Desilets, Alain
Sent: Thursday, December 01, 2011 5:16 PM
To: modperl <at> perl.apache.org
Subject: CGI::Utils->getSelfRefUrlWithQuery() not working inside mod_perl?

Trying to migrate a complex script from a standard CGI context to a mod_perl context, and am having a hell of a
time. The latest problem is that I have a call to GCI::Utils->getSelfRefUrlWithQuery() which causes a crash.

In an attempt to isolate the problem, I wrote this short script which does nothing more than call that method:

--------------
#!perl -w
use strict;
print "Content-type: text/plain\r\n\r\n";
use CGI::Utils;
my $self_url = '';
print "Before calling get_self_ref_url_with_query()\n";
#no strict;
my $cgi_utils = CGI::Utils->new();
(Continue reading)

André Warnier | 2 Dec 10:24 2011

Re: CGI::Utils->getSelfRefUrlWithQuery() not working inside mod_perl?

Desilets, Alain wrote:
> Trying to migrate a complex script from a standard CGI context to a mod_perl context, and am having a hell of
a time. The latest problem is that I have a call to GCI::Utils->getSelfRefUrlWithQuery() which causes a crash.
> 
> In an attempt to isolate the problem, I wrote this short script which does nothing more than call that method:
> 
> --------------
> #!perl -w
> use strict;
> print "Content-type: text/plain\r\n\r\n";
> use CGI::Utils;
> my $self_url = '';
> print "Before calling get_self_ref_url_with_query()\n";
> #no strict;
> my $cgi_utils = CGI::Utils->new();
> $self_url = $cgi_utils->getSelfRefUrlWithQuery();
> #$self_url = $cgi_utils->get_self_ref_url_with_query();
> #$self_url = CGI::Utils->getSelfRefUrlWithQuery();
> #$self_url = CGI::Utils->getSelfRefUrlWithQuery();
> #use strict;
> ---------------
> 
> When I run it, I get the following error:
> 
> [Thu Dec 01 17:04:21 2011] [error] Can't use string ("HTML::Mason::Commands::m") as a SCALAR ref while
"strict refs" in use at C:/Perl/site/lib/CGI/Utils.pm line 203.\n
> 
> If I comment out the call to getSelfRefUrlWithQuery(), then the script runs fine.
> 
> I have tried calling that method in four different ways (as CGI::Utils-> or $cgi_utils->, with the
(Continue reading)

Desilets, Alain | 2 Dec 14:49 2011
Picon

RE: CGI::Utils->getSelfRefUrlWithQuery() not working inside mod_perl?

Thx André! All your suggestions worked. 

I decided to go with cgi->url(-path_info=>1,-query=>1);

Alain

-----Original Message-----
From: André Warnier [mailto:aw <at> ice-sa.com] 
Sent: Friday, December 02, 2011 4:24 AM
To: mod_perl list
Subject: Re: CGI::Utils->getSelfRefUrlWithQuery() not working inside mod_perl?

Desilets, Alain wrote:
> Trying to migrate a complex script from a standard CGI context to a mod_perl context, and am having a hell of
a time. The latest problem is that I have a call to GCI::Utils->getSelfRefUrlWithQuery() which causes a crash.
> 
> In an attempt to isolate the problem, I wrote this short script which does nothing more than call that method:
> 
> --------------
> #!perl -w
> use strict;
> print "Content-type: text/plain\r\n\r\n";
> use CGI::Utils;
> my $self_url = '';
> print "Before calling get_self_ref_url_with_query()\n";
> #no strict;
> my $cgi_utils = CGI::Utils->new();
> $self_url = $cgi_utils->getSelfRefUrlWithQuery();
> #$self_url = $cgi_utils->get_self_ref_url_with_query();
> #$self_url = CGI::Utils->getSelfRefUrlWithQuery();
(Continue reading)

Denis Spichkin | 5 Dec 08:19 2011
Picon

PIPE and mod_perl2

Hello.

Trying to write a program for mod_perl2  that gradually display its
output such as output from "ping" (output during PIPE execution).

For example
http://www.websitepulse.com/help/testreq.php?host=www.ya.ru&location=9&type=1&singletestpage=ping-test&pass=&ttref=http%3A%2F%2Fwww.websitepulse.com%2F&__=1323068838832

At the moment I was able display all output at once.  That completely
unacceptable for this type of program

        my $ping = '/bin/ping';
        my $count = '-c 10';
        open (PIPE, "$ping $count $param |");
        if (!<PIPE>) {
                $r->print("Error: can't open the pipe $!");
                return OK;
                };

        while (<PIPE>) {
            $r->write($_); # tried $r->print and $r->puts......with
the same result
            $r->write('<br />');
            };

        close (PIPE);

Please if anyone know how possible gradually display output in
mod_perl2 help me........

(Continue reading)

Torsten Förtsch | 5 Dec 10:26 2011
Picon
Picon

Re: PIPE and mod_perl2

On Monday, 05 December 2011 11:19:51 Denis Spichkin wrote:
> Trying to write a program for mod_perl2  that gradually display its
> output such as output from "ping" (output during PIPE execution).
> 
> For example
> http://www.websitepulse.com/help/testreq.php?host=www.ya.ru&location=9&type=
> 1&singletestpage=ping-test&pass=&ttref=http%3A%2F%2Fwww.websitepulse.com%2F&
> __=1323068838832
> 
> At the moment I was able display all output at once.  That completely
> unacceptable for this type of program
> 
>         my $ping = '/bin/ping';
>         my $count = '-c 10';
>         open (PIPE, "$ping $count $param |");
>         if (!<PIPE>) {
>                 $r->print("Error: can't open the pipe $!");
>                 return OK;
>                 };
> 
>         while (<PIPE>) {
>             $r->write($_); # tried $r->print and $r->puts......with
> the same result
>             $r->write('<br />');
>             };
> 
>         close (PIPE);
> 
> 
> Please if anyone know how possible gradually display output in
(Continue reading)

Denis Spichkin | 5 Dec 14:39 2011
Picon

Re: PIPE and mod_perl2

Thank you for your replay

I think I have find the way of solution of my problem
the difference between situation when output is shown gradually and
when output is shown at once
is:
when: Transfer-Encoding	chunked
and unset Content-Length
the output show immediately without delay

and when:
 Transfer-Encoding: is absent
and Content-Length is set for axample Content-Length	280
 output will be show only after load all page (size 280 )

so now I need find out how generate page with out Content-Length in mod_perl

2011/12/5 Torsten Förtsch <torsten.foertsch <at> gmx.net>:
> On Monday, 05 December 2011 11:19:51 Denis Spichkin wrote:
>> Trying to write a program for mod_perl2  that gradually display its
>> output such as output from "ping" (output during PIPE execution).
>>
>> For example
>> http://www.websitepulse.com/help/testreq.php?host=www.ya.ru&location=9&type=
>> 1&singletestpage=ping-test&pass=&ttref=http%3A%2F%2Fwww.websitepulse.com%2F&
>> __=1323068838832
>>
>> At the moment I was able display all output at once.  That completely
>> unacceptable for this type of program
>>
(Continue reading)

David Booth | 5 Dec 15:54 2011

Re: PIPE and mod_perl2

On Mon, 2011-12-05 at 17:39 +0400, Denis Spichkin wrote:
[ . . . ]
> so now I need find out how generate page with out Content-Length in mod_perl

I believe you need to force Apache to flush the headers.  Otherwise it
will try to compute and add the Content-Length header for you.  See
http://perl.apache.org/docs/2.0/user/handlers/http.html#item_The_special_case_of__code_Content_Length__0__code_

--

-- 
David Booth, Ph.D.
http://dbooth.org/

Opinions expressed herein are those of the author and do not necessarily
reflect those of his employer.

Denis Spichkin | 5 Dec 20:23 2011
Picon

Re: PIPE and mod_perl2

Thank you for your replay
yes,  flush the headers is really work but only in IE (in Firefox it
doesn't work)
and its work only in cycle

        while (<PIPE>) {
            $r->rflush;
                $r->print( $_ );
           };

when i use $r->rflush only one time (before cycle ) it doesn't work.
(it set Transfer-Encoding chunked but the page is show entirely at
once)

rflush help me set follow header

Date	Mon, 05 Dec 2011 19:07:48 GMT
Server	Apache/2.2.16 (Ubuntu)
Vary	Accept-Encoding
Content-Encoding	gzip
Connection	close
Transfer-Encoding	chunked
Content-Type	text/html

but I completely don't undestand what difference between IE and
Firefox in this case.

2011/12/5 David Booth <david <at> dbooth.org>:
> On Mon, 2011-12-05 at 17:39 +0400, Denis Spichkin wrote:
> [ . . . ]
(Continue reading)


Gmane