You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jie Gao <J....@isu.usyd.edu.au> on 2004/05/24 06:17:38 UTC

[mp2] 1.99_14: socket problem

Hi All,

This used to work:

    $socket->recv($line, 34);

but the syntax has changed in 1.99_14, so I modified it to be:

    $line = $socket->recv(34);

But I am getting this error:

     [error] APR::Socket::recv: Resource temporarily unavailable at ...pm line 117

OBAny other obvious changes in APR::Socket that I missed here?




Jie



-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] 1.99_14: socket problem

Posted by Jie Gao <J....@isu.usyd.edu.au>.


On Fri, 28 May 2004, Stas Bekman wrote:

> Date: Fri, 28 May 2004 18:00:28 -0700
> From: Stas Bekman <st...@stason.org>
> To: Jie Gao <J....@isu.usyd.edu.au>
> Cc: modperl@perl.apache.org
> Subject: Re: [mp2] 1.99_14: socket problem
>
> Jie Gao wrote:
>
> >>Oh, wait, it was an error, not a warning. You want:
> >>
> >>   $SIG{__DIE__} = \&Carp::confess;
> >>
> >>then.
> >
> >
> > OK, I've got this after changing to use confess:
> >
> > [Sat May 29 10:53:41 2004] [error] [client 129.78.64.21] Undefined subroutine &Apache::Connection::AUTOLOAD
> > called at /usr/local/perl-5.8.4/lib/site_perl/5.8.4/Usyd/AuthCookieHandler.pm line 464.\n\teval {...} called at
> > /usr/local/perl-5.8.4/lib/site_perl/5.8.4/Usyd/AuthCookieHandler.pm line 464\n\teval {...} called at
> > /usr/local/perl-5.8.4/lib/site_perl/5.8.4/Usyd/AuthCookieHandler.pm line
> > 464\n\tUsyd::AuthCookieHandler::authz('Usyd::AuthCookieHandler', 'Apache::RequestRec=SCALAR(0x4a49ec)') called at
> > -e line 0\n\teval {...} called at -e line 0\n
> > ---------------------------------------------------------------------------
> >
> > So it's Apache::RequestRec?
>
> No, it's Usyd::AuthCookieHandler
>
> > I'll run Geoff's prog if this is still not enough.
>
>
>
> --
> __________________________________________________________________
> Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/     mod_perl Guide ---> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com
>

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] 1.99_14: socket problem

Posted by Stas Bekman <st...@stason.org>.
Jie Gao wrote:
[...]
>>[Sat May 29 21:43:08 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine main::129.xxx.xxx.xxx called at
>>-e
>>line 0\n
>>
>>Looks definitely like %ENV problem, although it only shows in the error_log.
> 
> 
> I've found what caused this. The culprit seems to be this sub in my httpd.conf:
> 
>     PerlCleanupHandler "sub { %ENV = () }"
> 
> I commented out and the error went away.

Interesting. I suppose it's because it's doing eval "sub { %ENV = () }" before 
running the code. So may be the interpolation kicks in?

> ModPerl::EazyLife actually causes segmentation fault.

It's quite possible. It was a work in progress, but wasn't quite finished. 
Feel free to improve it further and when it works, replace Apache::porting 
guts with it.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] 1.99_14: socket problem

Posted by Jie Gao <J....@isu.usyd.edu.au>.


On Sat, 29 May 2004, Jie Gao wrote:

> Date: Sat, 29 May 2004 22:38:05 +1000 (EST)
> From: Jie Gao <J....@isu.usyd.edu.au>
> To: Stas Bekman <st...@stason.org>
> Cc: modperl@perl.apache.org
> Subject: Re: [mp2] 1.99_14: socket problem
>
>
>
>
> On Fri, 28 May 2004, Stas Bekman wrote:
>
> > Date: Fri, 28 May 2004 18:00:28 -0700
> > From: Stas Bekman <st...@stason.org>
> > To: Jie Gao <J....@isu.usyd.edu.au>
> > Cc: modperl@perl.apache.org
> > Subject: Re: [mp2] 1.99_14: socket problem
> >
> > Jie Gao wrote:
> >
> > >>Oh, wait, it was an error, not a warning. You want:
> > >>
> > >>   $SIG{__DIE__} = \&Carp::confess;
> > >>
> > >>then.
> > >
> > >
> > > OK, I've got this after changing to use confess:
> > >
> > > [Sat May 29 10:53:41 2004] [error] [client 129.78.64.21] Undefined subroutine &Apache::Connection::AUTOLOAD
> > > called at /usr/local/perl-5.8.4/lib/site_perl/5.8.4/Usyd/AuthCookieHandler.pm line 464.\n\teval {...} called at
> > > /usr/local/perl-5.8.4/lib/site_perl/5.8.4/Usyd/AuthCookieHandler.pm line 464\n\teval {...} called at
> > > /usr/local/perl-5.8.4/lib/site_perl/5.8.4/Usyd/AuthCookieHandler.pm line
> > > 464\n\tUsyd::AuthCookieHandler::authz('Usyd::AuthCookieHandler', 'Apache::RequestRec=SCALAR(0x4a49ec)') called at
> > > -e line 0\n\teval {...} called at -e line 0\n
> > > ---------------------------------------------------------------------------
> > >
> > > So it's Apache::RequestRec?
> >
> > No, it's Usyd::AuthCookieHandler
>
>
>
> I find I get this kind of error message with almost all accesses.
>
> I get this when accessing server-status:
>
> [Sat May 29 21:41:07 2004] [error] [client 129.xxx.xxx.100] Undefined subroutine main:: called at -e line
> 0\n\tApache::porting::__ANON__('Apache::RequestRec=SCALAR(0x83b32c)') called at -e line 0\n\teval {...} called at
> -e line 0\n
> [Sat May 29 21:41:07 2004] [error] [client 129.xxx.xxx.100] Undefined subroutine main:: called at -e line
> 0\n\tApache::porting::__ANON__('Apache::RequestRec=SCALAR(0x83b32c)') called at -e line 0\n\teval {...} called at
> -e line 0\n
> [Sat May 29 21:41:07 2004] [error] [client 129.xxx.xxx.100] Undefined subroutine main:: called at -e line
> 0\n\tApache::porting::__ANON__('Apache::RequestRec=SCALAR(0x83b32c)') called at -e line 0\n\teval {...} called at
> -e line 0\n
>
> and this while accessing perl-status:
>
> [Sat May 29 21:42:23 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine main::129.xxx.xxx.xxx called at
> -e
> line 0\n, referer: http://wasm-test.auth.usyd.edu.au/perl-status?inc
> [Sat May 29 21:42:30 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine main::gzip,deflate called at -e
> line 0\n, referer: http://wasm-test.auth.usyd.edu.au/perl-status?inc
> [Sat May 29 21:42:35 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine main::129.xxx.xxx.xxxxx called
> at -e
> line 0\n, referer: http://wasm-test.auth.usyd.edu.au/perl-status?inc
>
> [Sat May 29 21:42:56 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine main::129.xxx.xxx.21 called at
> -e
> line 0\n
> [Sat May 29 21:43:00 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine
> main::text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,image/jpeg,image/gif;q=
> 0.2,*/*;q=0.1 called at -e line 0\n
> [Sat May 29 21:43:08 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine main::129.xxx.xxx.xxx called at
> -e
> line 0\n
>
> Looks definitely like %ENV problem, although it only shows in the error_log.

I've found what caused this. The culprit seems to be this sub in my httpd.conf:

    PerlCleanupHandler "sub { %ENV = () }"

I commented out and the error went away.

ModPerl::EazyLife actually causes segmentation fault.

Regards,



Jie

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] 1.99_14: socket problem

Posted by Jie Gao <J....@isu.usyd.edu.au>.


On Sat, 29 May 2004, Stas Bekman wrote:

> Date: Sat, 29 May 2004 12:50:46 -0700
> From: Stas Bekman <st...@stason.org>
> To: Jie Gao <J....@isu.usyd.edu.au>
> Cc: modperl@perl.apache.org
> Subject: Re: [mp2] 1.99_14: socket problem
>
> Jie Gao wrote:
> [...]
> > I find I get this kind of error message with almost all accesses.
> >
> > I get this when accessing server-status:
> >
> > [Sat May 29 21:41:07 2004] [error] [client 129.xxx.xxx.100] Undefined subroutine main:: called at -e line
> > 0\n\tApache::porting::__ANON__('Apache::RequestRec=SCALAR(0x83b32c)') called at -e line 0\n\teval {...} called at
> > -e line 0\n
> > [Sat May 29 21:41:07 2004] [error] [client 129.xxx.xxx.100] Undefined subroutine main:: called at -e line
> > 0\n\tApache::porting::__ANON__('Apache::RequestRec=SCALAR(0x83b32c)') called at -e line 0\n\teval {...} called at
> > -e line 0\n
> > [Sat May 29 21:41:07 2004] [error] [client 129.xxx.xxx.100] Undefined subroutine main:: called at -e line
> > 0\n\tApache::porting::__ANON__('Apache::RequestRec=SCALAR(0x83b32c)') called at -e line 0\n\teval {...} called at
> > -e line 0\n
> >
> > and this while accessing perl-status:
> >
> > [Sat May 29 21:42:23 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine main::129.xxx.xxx.xxx called at
> > -e
> > line 0\n, referer: http://wasm-test.auth.usyd.edu.au/perl-status?inc
> > [Sat May 29 21:42:30 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine main::gzip,deflate called at -e
> > line 0\n, referer: http://wasm-test.auth.usyd.edu.au/perl-status?inc
> > [Sat May 29 21:42:35 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine main::129.xxx.xxx.xxxxx called
> > at -e
> > line 0\n, referer: http://wasm-test.auth.usyd.edu.au/perl-status?inc
> >
> > [Sat May 29 21:42:56 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine main::129.xxx.xxx.21 called at
> > -e
> > line 0\n
> > [Sat May 29 21:43:00 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine
> > main::text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,image/jpeg,image/gif;q=
> > 0.2,*/*;q=0.1 called at -e line 0\n
> > [Sat May 29 21:43:08 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine main::129.xxx.xxx.xxx called at
> > -e
> > line 0\n
> >
> > Looks definitely like %ENV problem, although it only shows in the error_log.
>
> Most likely it's a problem with UNIVERSAL::AUTOLOAD. Using the $SIG{__DIE__}
> trick you should be able to see who called those non-existing functions.
>
> I think you are using mp2 enough time to start porting the applications for
> real, and drop any helper tools which aren't perfect. As the Apache::porting
> manpage mentions we have discussed and worked on developing a better AUTOLOAD
> technique (which doesn't use UNIVERSAL), but even that one wasn't perfect. If
> you are interested to try it, search the archives for EazyLife:

All my applications are mp2 native. I was just putting in Apache::porting
to see what it does.

> http://marc.theaimsgroup.com/?l=apache-modperl-dev&w=2&r=1&s=eazylife&q=b
>
> I think the latest version was:
>
> package ModPerl::EazyLife;
>
> use ModPerl::MethodLookup ();
> use Carp;
>
> my @avail_modules = ModPerl::MethodLookup::avail_modules();
> push @avail_modules, 'Apache'; # XXX: may go away
> my $skip = qr|(::)?DESTROY$|;
> for my $module (@avail_modules) {
>      *{"$module\::AUTOLOAD"} = sub {
>          my($hint, @modules) =
>              ModPerl::MethodLookup::lookup_method($AUTOLOAD, @_);
>
>          # there should be only one match
>          if (my($module) = @modules) {
>              eval "require $module";
>              # use the function from the module that we have just loaded
>              $AUTOLOAD =~ s/.*::/${module}::/;
>              goto &$AUTOLOAD;
>          }
>          else {
>              return if $AUTOLOAD =~ /$skip/;
>              croak $hint || "Can't find $AUTOLOAD";
>          }
>      };
> }
>
> 1;

$AUTOLOAD needs to be pre-defined here, I find.

Running this, I got error:

No 'method' argument was passed
 at /usr/local/perl-5.8.4/lib/site_perl/5.8.4/sun4-solaris/ModPerl/RegistryCooker.pm line 202

Regards,



Jie

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] 1.99_14: socket problem

Posted by Stas Bekman <st...@stason.org>.
Jie Gao wrote:
[...]
> I find I get this kind of error message with almost all accesses.
> 
> I get this when accessing server-status:
> 
> [Sat May 29 21:41:07 2004] [error] [client 129.xxx.xxx.100] Undefined subroutine main:: called at -e line
> 0\n\tApache::porting::__ANON__('Apache::RequestRec=SCALAR(0x83b32c)') called at -e line 0\n\teval {...} called at
> -e line 0\n
> [Sat May 29 21:41:07 2004] [error] [client 129.xxx.xxx.100] Undefined subroutine main:: called at -e line
> 0\n\tApache::porting::__ANON__('Apache::RequestRec=SCALAR(0x83b32c)') called at -e line 0\n\teval {...} called at
> -e line 0\n
> [Sat May 29 21:41:07 2004] [error] [client 129.xxx.xxx.100] Undefined subroutine main:: called at -e line
> 0\n\tApache::porting::__ANON__('Apache::RequestRec=SCALAR(0x83b32c)') called at -e line 0\n\teval {...} called at
> -e line 0\n
> 
> and this while accessing perl-status:
> 
> [Sat May 29 21:42:23 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine main::129.xxx.xxx.xxx called at
> -e
> line 0\n, referer: http://wasm-test.auth.usyd.edu.au/perl-status?inc
> [Sat May 29 21:42:30 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine main::gzip,deflate called at -e
> line 0\n, referer: http://wasm-test.auth.usyd.edu.au/perl-status?inc
> [Sat May 29 21:42:35 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine main::129.xxx.xxx.xxxxx called
> at -e
> line 0\n, referer: http://wasm-test.auth.usyd.edu.au/perl-status?inc
> 
> [Sat May 29 21:42:56 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine main::129.xxx.xxx.21 called at
> -e
> line 0\n
> [Sat May 29 21:43:00 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine
> main::text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,image/jpeg,image/gif;q=
> 0.2,*/*;q=0.1 called at -e line 0\n
> [Sat May 29 21:43:08 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine main::129.xxx.xxx.xxx called at
> -e
> line 0\n
> 
> Looks definitely like %ENV problem, although it only shows in the error_log.

Most likely it's a problem with UNIVERSAL::AUTOLOAD. Using the $SIG{__DIE__} 
trick you should be able to see who called those non-existing functions.

I think you are using mp2 enough time to start porting the applications for 
real, and drop any helper tools which aren't perfect. As the Apache::porting 
manpage mentions we have discussed and worked on developing a better AUTOLOAD 
technique (which doesn't use UNIVERSAL), but even that one wasn't perfect. If 
you are interested to try it, search the archives for EazyLife:
http://marc.theaimsgroup.com/?l=apache-modperl-dev&w=2&r=1&s=eazylife&q=b

I think the latest version was:

package ModPerl::EazyLife;

use ModPerl::MethodLookup ();
use Carp;

my @avail_modules = ModPerl::MethodLookup::avail_modules();
push @avail_modules, 'Apache'; # XXX: may go away
my $skip = qr|(::)?DESTROY$|;
for my $module (@avail_modules) {
     *{"$module\::AUTOLOAD"} = sub {
         my($hint, @modules) =
             ModPerl::MethodLookup::lookup_method($AUTOLOAD, @_);

         # there should be only one match
         if (my($module) = @modules) {
             eval "require $module";
             # use the function from the module that we have just loaded
             $AUTOLOAD =~ s/.*::/${module}::/;
             goto &$AUTOLOAD;
         }
         else {
             return if $AUTOLOAD =~ /$skip/;
             croak $hint || "Can't find $AUTOLOAD";
         }
     };
}

1;

You just need to load this module at the server startup, instead of 
Apache::porting. The quoted thread discusses some limitations. But it wasn't 
finished. Give it a try.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: hello world

Posted by Andy Armstrong <an...@hexten.net>.
Bob Smith wrote:

> hello
> My name is Greger, I'm new here...
> could some person please gimme a hello world application written with
> mod_perl

Google broken? :)

http://www.google.com/search?q=mod_perl+Hello+World



-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


hello world

Posted by Bob Smith <bo...@hotmail.com>.
hello
My name is Greger, I'm new here...
could some person please gimme a hello world application written with
mod_perl
TIA
Greger
----- Original Message -----
From: "Jie Gao" <J....@isu.usyd.edu.au>
To: "Stas Bekman" <st...@stason.org>
Cc: <mo...@perl.apache.org>
Sent: Saturday, May 29, 2004 3:38 PM
Subject: Re: [mp2] 1.99_14: socket problem


>
>
>
> On Fri, 28 May 2004, Stas Bekman wrote:
>
> > Date: Fri, 28 May 2004 18:00:28 -0700
> > From: Stas Bekman <st...@stason.org>
> > To: Jie Gao <J....@isu.usyd.edu.au>
> > Cc: modperl@perl.apache.org
> > Subject: Re: [mp2] 1.99_14: socket problem
> >
> > Jie Gao wrote:
> >
> > >>Oh, wait, it was an error, not a warning. You want:
> > >>
> > >>   $SIG{__DIE__} = \&Carp::confess;
> > >>
> > >>then.
> > >
> > >
> > > OK, I've got this after changing to use confess:
> > >
> > > [Sat May 29 10:53:41 2004] [error] [client 129.78.64.21] Undefined
subroutine &Apache::Connection::AUTOLOAD
> > > called at
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/Usyd/AuthCookieHandler.pm line
464.\n\teval {...} called at
> > > /usr/local/perl-5.8.4/lib/site_perl/5.8.4/Usyd/AuthCookieHandler.pm
line 464\n\teval {...} called at
> > > /usr/local/perl-5.8.4/lib/site_perl/5.8.4/Usyd/AuthCookieHandler.pm
line
> > > 464\n\tUsyd::AuthCookieHandler::authz('Usyd::AuthCookieHandler',
'Apache::RequestRec=SCALAR(0x4a49ec)') called at
> > > -e line 0\n\teval {...} called at -e line 0\n
> >
> --------------------------------------------------------------------------
-
> > >
> > > So it's Apache::RequestRec?
> >
> > No, it's Usyd::AuthCookieHandler
>
>
>
> I find I get this kind of error message with almost all accesses.
>
> I get this when accessing server-status:
>
> [Sat May 29 21:41:07 2004] [error] [client 129.xxx.xxx.100] Undefined
subroutine main:: called at -e line
> 0\n\tApache::porting::__ANON__('Apache::RequestRec=SCALAR(0x83b32c)')
called at -e line 0\n\teval {...} called at
> -e line 0\n
> [Sat May 29 21:41:07 2004] [error] [client 129.xxx.xxx.100] Undefined
subroutine main:: called at -e line
> 0\n\tApache::porting::__ANON__('Apache::RequestRec=SCALAR(0x83b32c)')
called at -e line 0\n\teval {...} called at
> -e line 0\n
> [Sat May 29 21:41:07 2004] [error] [client 129.xxx.xxx.100] Undefined
subroutine main:: called at -e line
> 0\n\tApache::porting::__ANON__('Apache::RequestRec=SCALAR(0x83b32c)')
called at -e line 0\n\teval {...} called at
> -e line 0\n
>
> and this while accessing perl-status:
>
> [Sat May 29 21:42:23 2004] [error] [client 129.xxx.xxx.xxx] Undefined
subroutine main::129.xxx.xxx.xxx called at
> -e
> line 0\n, referer: http://wasm-test.auth.usyd.edu.au/perl-status?inc
> [Sat May 29 21:42:30 2004] [error] [client 129.xxx.xxx.xxx] Undefined
subroutine main::gzip,deflate called at -e
> line 0\n, referer: http://wasm-test.auth.usyd.edu.au/perl-status?inc
> [Sat May 29 21:42:35 2004] [error] [client 129.xxx.xxx.xxx] Undefined
subroutine main::129.xxx.xxx.xxxxx called
> at -e
> line 0\n, referer: http://wasm-test.auth.usyd.edu.au/perl-status?inc
>
> [Sat May 29 21:42:56 2004] [error] [client 129.xxx.xxx.xxx] Undefined
subroutine main::129.xxx.xxx.21 called at
> -e
> line 0\n
> [Sat May 29 21:43:00 2004] [error] [client 129.xxx.xxx.xxx] Undefined
subroutine
>
main::text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/pl
ain;q=0.8,image/png,image/jpeg,image/gif;q=
> 0.2,*/*;q=0.1 called at -e line 0\n
> [Sat May 29 21:43:08 2004] [error] [client 129.xxx.xxx.xxx] Undefined
subroutine main::129.xxx.xxx.xxx called at
> -e
> line 0\n
>
> Looks definitely like %ENV problem, although it only shows in the
error_log.
>
> Regards,
>
>
>
> Jie
>
>
> --
> Report problems: http://perl.apache.org/bugs/
> Mail list info: http://perl.apache.org/maillist/modperl.html
> List etiquette: http://perl.apache.org/maillist/email-etiquette.html
>

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] 1.99_14: socket problem

Posted by Jie Gao <J....@isu.usyd.edu.au>.


On Fri, 28 May 2004, Stas Bekman wrote:

> Date: Fri, 28 May 2004 18:00:28 -0700
> From: Stas Bekman <st...@stason.org>
> To: Jie Gao <J....@isu.usyd.edu.au>
> Cc: modperl@perl.apache.org
> Subject: Re: [mp2] 1.99_14: socket problem
>
> Jie Gao wrote:
>
> >>Oh, wait, it was an error, not a warning. You want:
> >>
> >>   $SIG{__DIE__} = \&Carp::confess;
> >>
> >>then.
> >
> >
> > OK, I've got this after changing to use confess:
> >
> > [Sat May 29 10:53:41 2004] [error] [client 129.78.64.21] Undefined subroutine &Apache::Connection::AUTOLOAD
> > called at /usr/local/perl-5.8.4/lib/site_perl/5.8.4/Usyd/AuthCookieHandler.pm line 464.\n\teval {...} called at
> > /usr/local/perl-5.8.4/lib/site_perl/5.8.4/Usyd/AuthCookieHandler.pm line 464\n\teval {...} called at
> > /usr/local/perl-5.8.4/lib/site_perl/5.8.4/Usyd/AuthCookieHandler.pm line
> > 464\n\tUsyd::AuthCookieHandler::authz('Usyd::AuthCookieHandler', 'Apache::RequestRec=SCALAR(0x4a49ec)') called at
> > -e line 0\n\teval {...} called at -e line 0\n
> > ---------------------------------------------------------------------------
> >
> > So it's Apache::RequestRec?
>
> No, it's Usyd::AuthCookieHandler



I find I get this kind of error message with almost all accesses.

I get this when accessing server-status:

[Sat May 29 21:41:07 2004] [error] [client 129.xxx.xxx.100] Undefined subroutine main:: called at -e line
0\n\tApache::porting::__ANON__('Apache::RequestRec=SCALAR(0x83b32c)') called at -e line 0\n\teval {...} called at
-e line 0\n
[Sat May 29 21:41:07 2004] [error] [client 129.xxx.xxx.100] Undefined subroutine main:: called at -e line
0\n\tApache::porting::__ANON__('Apache::RequestRec=SCALAR(0x83b32c)') called at -e line 0\n\teval {...} called at
-e line 0\n
[Sat May 29 21:41:07 2004] [error] [client 129.xxx.xxx.100] Undefined subroutine main:: called at -e line
0\n\tApache::porting::__ANON__('Apache::RequestRec=SCALAR(0x83b32c)') called at -e line 0\n\teval {...} called at
-e line 0\n

and this while accessing perl-status:

[Sat May 29 21:42:23 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine main::129.xxx.xxx.xxx called at
-e
line 0\n, referer: http://wasm-test.auth.usyd.edu.au/perl-status?inc
[Sat May 29 21:42:30 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine main::gzip,deflate called at -e
line 0\n, referer: http://wasm-test.auth.usyd.edu.au/perl-status?inc
[Sat May 29 21:42:35 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine main::129.xxx.xxx.xxxxx called
at -e
line 0\n, referer: http://wasm-test.auth.usyd.edu.au/perl-status?inc

[Sat May 29 21:42:56 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine main::129.xxx.xxx.21 called at
-e
line 0\n
[Sat May 29 21:43:00 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine
main::text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,image/jpeg,image/gif;q=
0.2,*/*;q=0.1 called at -e line 0\n
[Sat May 29 21:43:08 2004] [error] [client 129.xxx.xxx.xxx] Undefined subroutine main::129.xxx.xxx.xxx called at
-e
line 0\n

Looks definitely like %ENV problem, although it only shows in the error_log.

Regards,



Jie


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] 1.99_14: socket problem

Posted by Stas Bekman <st...@stason.org>.
Jie Gao wrote:

>>Oh, wait, it was an error, not a warning. You want:
>>
>>   $SIG{__DIE__} = \&Carp::confess;
>>
>>then.
> 
> 
> OK, I've got this after changing to use confess:
> 
> [Sat May 29 10:53:41 2004] [error] [client 129.78.64.21] Undefined subroutine &Apache::Connection::AUTOLOAD
> called at /usr/local/perl-5.8.4/lib/site_perl/5.8.4/Usyd/AuthCookieHandler.pm line 464.\n\teval {...} called at
> /usr/local/perl-5.8.4/lib/site_perl/5.8.4/Usyd/AuthCookieHandler.pm line 464\n\teval {...} called at
> /usr/local/perl-5.8.4/lib/site_perl/5.8.4/Usyd/AuthCookieHandler.pm line
> 464\n\tUsyd::AuthCookieHandler::authz('Usyd::AuthCookieHandler', 'Apache::RequestRec=SCALAR(0x4a49ec)') called at
> -e line 0\n\teval {...} called at -e line 0\n
> ---------------------------------------------------------------------------
> 
> So it's Apache::RequestRec?

No, it's Usyd::AuthCookieHandler

> I'll run Geoff's prog if this is still not enough.



-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] 1.99_14: socket problem

Posted by Jie Gao <J....@isu.usyd.edu.au>.


On Fri, 28 May 2004, Stas Bekman wrote:

> Date: Fri, 28 May 2004 17:36:44 -0700
> From: Stas Bekman <st...@stason.org>
> To: Jie Gao <J....@isu.usyd.edu.au>
> Cc: modperl@perl.apache.org
> Subject: Re: [mp2] 1.99_14: socket problem
>
> Jie Gao wrote:
> [...]
> > Thanks very much. I'll do when I find some time for it. Right now I'm getting
> > segmentation faults and am going to debug it today.
>
> Sure, please take your time.
>
> >>>BTW, I am getting this in the log:
> >>>
> >>> Undefined subroutine &Apache::Connection::AUTOLOAD called.\n,
> >>>
> >>>It seems that some mod_perl module is trying to do autoload a sub that
> >>>does not exist.
> >>
> >>I don't think the mod_perl 2.0 core does. Set:
> >>
> >>use Carp;
> >>$SIG{__WARN__} = \&Carp::cluck;
> >>
> >>at the server startup and it'll tell you who called that.
> >
> >
> > No, it doesn't give me more info. The lines concerned are:
>
> Oh, wait, it was an error, not a warning. You want:
>
>    $SIG{__DIE__} = \&Carp::confess;
>
> then.

OK, I've got this after changing to use confess:

[Sat May 29 10:53:41 2004] [error] [client 129.78.64.21] Undefined subroutine &Apache::Connection::AUTOLOAD
called at /usr/local/perl-5.8.4/lib/site_perl/5.8.4/Usyd/AuthCookieHandler.pm line 464.\n\teval {...} called at
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/Usyd/AuthCookieHandler.pm line 464\n\teval {...} called at
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/Usyd/AuthCookieHandler.pm line
464\n\tUsyd::AuthCookieHandler::authz('Usyd::AuthCookieHandler', 'Apache::RequestRec=SCALAR(0x4a49ec)') called at
-e line 0\n\teval {...} called at -e line 0\n
---------------------------------------------------------------------------

So it's Apache::RequestRec?

I'll run Geoff's prog if this is still not enough.

Regards,


Jie

>
> >         my $content_type = $r->lookup_uri($r->uri)->content_type;
> >         if (defined $content_type) {
> >             print STDERR "content-type is: $content_type\n";
> >             return Apache::OK if $content_type =~ m:^$content_type_to_ignore/:i;
> >         }
> >
> > But I don't see anything involves autoload here.
>
> Yes, but you load other modules. The best way to isolate the faulty modules is
> to use Geoff's Apache-Test skeleton tarball, linked from here:
> http://perl.apache.org/docs/2.0/user/help/help.html#Problem_Description
>
>
> --
> __________________________________________________________________
> Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/     mod_perl Guide ---> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com
>

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] 1.99_14: socket problem

Posted by Stas Bekman <st...@stason.org>.
Jie Gao wrote:
[...]
> Thanks very much. I'll do when I find some time for it. Right now I'm getting
> segmentation faults and am going to debug it today.

Sure, please take your time.

>>>BTW, I am getting this in the log:
>>>
>>> Undefined subroutine &Apache::Connection::AUTOLOAD called.\n,
>>>
>>>It seems that some mod_perl module is trying to do autoload a sub that
>>>does not exist.
>>
>>I don't think the mod_perl 2.0 core does. Set:
>>
>>use Carp;
>>$SIG{__WARN__} = \&Carp::cluck;
>>
>>at the server startup and it'll tell you who called that.
> 
> 
> No, it doesn't give me more info. The lines concerned are:

Oh, wait, it was an error, not a warning. You want:

   $SIG{__DIE__} = \&Carp::confess;

then.

>         my $content_type = $r->lookup_uri($r->uri)->content_type;
>         if (defined $content_type) {
>             print STDERR "content-type is: $content_type\n";
>             return Apache::OK if $content_type =~ m:^$content_type_to_ignore/:i;
>         }
> 
> But I don't see anything involves autoload here.

Yes, but you load other modules. The best way to isolate the faulty modules is 
to use Geoff's Apache-Test skeleton tarball, linked from here:
http://perl.apache.org/docs/2.0/user/help/help.html#Problem_Description


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] 1.99_14: socket problem

Posted by Jie Gao <J....@isu.usyd.edu.au>.


On Fri, 28 May 2004, Stas Bekman wrote:

> Date: Fri, 28 May 2004 11:27:46 -0700
> From: Stas Bekman <st...@stason.org>
> To: Jie Gao <J....@isu.usyd.edu.au>
> Cc: modperl@perl.apache.org
> Subject: Re: [mp2] 1.99_14: socket problem
>
> Jie Gao wrote:
> >
> >
> > On Wed, 26 May 2004, Stas Bekman wrote:
> >
> >
> >>Date: Wed, 26 May 2004 19:08:40 -0700
> >>From: Stas Bekman <st...@stason.org>
> >>To: Jie Gao <J....@isu.usyd.edu.au>
> >>Cc: modperl@perl.apache.org
> >>Subject: Re: [mp2] 1.99_14: socket problem
> >>
> >>Jie Gao wrote:
> >>[...]
> >>
> >>>>>>If you've moved to Apache 2.0.49, it now gives you a non-blocking socket. So
> >>>>>>all protocol handlers now must start with:
> >>>>>>
> >>>>>>use APR::Const    -compile => 'SO_NONBLOCK';
> >>>>>>$sock->opt_set(APR::SO_NONBLOCK => 0);
> >>>
> >>>
> >>>Is this supported?
> >>>
> >>>    $socket->opt_set(APR::SO_KEEPALIVE, 1);
> >>
> >>I haven't tried, but if it's a valid option, why not? Have you tried doing
> >>that and it didn't work? Though I won't advise on doing that for HTTP stuff. I
> >>guess it's OK for your own protocols.
> >
> >
> > That's what I am doing. It's just that the doco did not specify any valid
> > values but "xxxx'.
>
> You mean here, right?
> http://perl.apache.org/docs/2.0/api/APR/Const.html#C__socket_
>
> I haven't used any other constants, but APR::SO_NONBLOCK so I didn't document
> them? Care to send a patch fixing that? It'd be also good to test those before
> documenting. e.g. to figure out how APR::SO_KEEPALIVE behaves just grep the
> apr source include dir for APR_SO_KEEPALIVE, like so:
>
> % cd httpd-2.0/
> % grep -Ir APR_SO_KEEPALIVE srclib/apr/include
> srclib/apr/include/apr_network_io.h:#define APR_SO_KEEPALIVE     2    /**<
> Keepalive */
> srclib/apr/include/apr_network_io.h: *            APR_SO_KEEPALIVE  --  keep
> connections active
> srclib/apr/include/apr_network_io.h: *            APR_SO_KEEPALIVE  --  keep
> connections active
>
> looking in that file gives us:
>
>   * <PRE>
>   *            APR_SO_DEBUG      --  turn on debugging information
>   *            APR_SO_KEEPALIVE  --  keep connections active
>   *            APR_SO_LINGER     --  lingers on close if data is present
>   *            APR_SO_NONBLOCK   --  Turns blocking on/off for socket
>   *            APR_SO_REUSEADDR  --  The rules used in validating addresses
>   *                                  supplied to bind should allow reuse
>   *                                  of local addresses.
>   *            APR_SO_SNDBUF     --  Set the SendBufferSize
>   *            APR_SO_RCVBUF     --  Set the ReceiveBufferSize
>   * </PRE>
>
> it doesn't document what the possible values are :( But you can guess that
> most accept 0/1 to turn the option off/on, the last two are the size of the
> buffer in bytes and I'm not sure about APR_SO_REUSEADDR.
>
> So now you have almost all the information to at least submit a doc patch

Thanks very much. I'll do when I find some time for it. Right now I'm getting
segmentation faults and am going to debug it today.

>
> > BTW, I am getting this in the log:
> >
> >  Undefined subroutine &Apache::Connection::AUTOLOAD called.\n,
> >
> > It seems that some mod_perl module is trying to do autoload a sub that
> > does not exist.
>
> I don't think the mod_perl 2.0 core does. Set:
>
> use Carp;
> $SIG{__WARN__} = \&Carp::cluck;
>
> at the server startup and it'll tell you who called that.

No, it doesn't give me more info. The lines concerned are:

        my $content_type = $r->lookup_uri($r->uri)->content_type;
        if (defined $content_type) {
            print STDERR "content-type is: $content_type\n";
            return Apache::OK if $content_type =~ m:^$content_type_to_ignore/:i;
        }

But I don't see anything involves autoload here.

Regards,



Jie

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] 1.99_14: socket problem

Posted by Stas Bekman <st...@stason.org>.
Jie Gao wrote:
> 
> 
> On Wed, 26 May 2004, Stas Bekman wrote:
> 
> 
>>Date: Wed, 26 May 2004 19:08:40 -0700
>>From: Stas Bekman <st...@stason.org>
>>To: Jie Gao <J....@isu.usyd.edu.au>
>>Cc: modperl@perl.apache.org
>>Subject: Re: [mp2] 1.99_14: socket problem
>>
>>Jie Gao wrote:
>>[...]
>>
>>>>>>If you've moved to Apache 2.0.49, it now gives you a non-blocking socket. So
>>>>>>all protocol handlers now must start with:
>>>>>>
>>>>>>use APR::Const    -compile => 'SO_NONBLOCK';
>>>>>>$sock->opt_set(APR::SO_NONBLOCK => 0);
>>>
>>>
>>>Is this supported?
>>>
>>>    $socket->opt_set(APR::SO_KEEPALIVE, 1);
>>
>>I haven't tried, but if it's a valid option, why not? Have you tried doing
>>that and it didn't work? Though I won't advise on doing that for HTTP stuff. I
>>guess it's OK for your own protocols.
> 
> 
> That's what I am doing. It's just that the doco did not specify any valid
> values but "xxxx'.

You mean here, right?
http://perl.apache.org/docs/2.0/api/APR/Const.html#C__socket_

I haven't used any other constants, but APR::SO_NONBLOCK so I didn't document 
them? Care to send a patch fixing that? It'd be also good to test those before 
documenting. e.g. to figure out how APR::SO_KEEPALIVE behaves just grep the 
apr source include dir for APR_SO_KEEPALIVE, like so:

% cd httpd-2.0/
% grep -Ir APR_SO_KEEPALIVE srclib/apr/include
srclib/apr/include/apr_network_io.h:#define APR_SO_KEEPALIVE     2    /**< 
Keepalive */
srclib/apr/include/apr_network_io.h: *            APR_SO_KEEPALIVE  --  keep 
connections active
srclib/apr/include/apr_network_io.h: *            APR_SO_KEEPALIVE  --  keep 
connections active

looking in that file gives us:

  * <PRE>
  *            APR_SO_DEBUG      --  turn on debugging information
  *            APR_SO_KEEPALIVE  --  keep connections active
  *            APR_SO_LINGER     --  lingers on close if data is present
  *            APR_SO_NONBLOCK   --  Turns blocking on/off for socket
  *            APR_SO_REUSEADDR  --  The rules used in validating addresses
  *                                  supplied to bind should allow reuse
  *                                  of local addresses.
  *            APR_SO_SNDBUF     --  Set the SendBufferSize
  *            APR_SO_RCVBUF     --  Set the ReceiveBufferSize
  * </PRE>

it doesn't document what the possible values are :( But you can guess that 
most accept 0/1 to turn the option off/on, the last two are the size of the 
buffer in bytes and I'm not sure about APR_SO_REUSEADDR.

So now you have almost all the information to at least submit a doc patch


> BTW, I am getting this in the log:
> 
>  Undefined subroutine &Apache::Connection::AUTOLOAD called.\n,
> 
> It seems that some mod_perl module is trying to do autoload a sub that
> does not exist.

I don't think the mod_perl 2.0 core does. Set:

use Carp;
$SIG{__WARN__} = \&Carp::cluck;

at the server startup and it'll tell you who called that.


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] 1.99_14: socket problem

Posted by Jie Gao <J....@isu.usyd.edu.au>.


On Wed, 26 May 2004, Stas Bekman wrote:

> Date: Wed, 26 May 2004 19:08:40 -0700
> From: Stas Bekman <st...@stason.org>
> To: Jie Gao <J....@isu.usyd.edu.au>
> Cc: modperl@perl.apache.org
> Subject: Re: [mp2] 1.99_14: socket problem
>
> Jie Gao wrote:
> [...]
> >>>>If you've moved to Apache 2.0.49, it now gives you a non-blocking socket. So
> >>>>all protocol handlers now must start with:
> >>>>
> >>>>use APR::Const    -compile => 'SO_NONBLOCK';
> >>>>$sock->opt_set(APR::SO_NONBLOCK => 0);
> >
> >
> > Is this supported?
> >
> >     $socket->opt_set(APR::SO_KEEPALIVE, 1);
>
> I haven't tried, but if it's a valid option, why not? Have you tried doing
> that and it didn't work? Though I won't advise on doing that for HTTP stuff. I
> guess it's OK for your own protocols.

That's what I am doing. It's just that the doco did not specify any valid
values but "xxxx'.

BTW, I am getting this in the log:

 Undefined subroutine &Apache::Connection::AUTOLOAD called.\n,

It seems that some mod_perl module is trying to do autoload a sub that
does not exist.

Regards,



Jie

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] 1.99_14: socket problem

Posted by Stas Bekman <st...@stason.org>.
Jie Gao wrote:
[...]
>>>>If you've moved to Apache 2.0.49, it now gives you a non-blocking socket. So
>>>>all protocol handlers now must start with:
>>>>
>>>>use APR::Const    -compile => 'SO_NONBLOCK';
>>>>$sock->opt_set(APR::SO_NONBLOCK => 0);
> 
> 
> Is this supported?
> 
>     $socket->opt_set(APR::SO_KEEPALIVE, 1);

I haven't tried, but if it's a valid option, why not? Have you tried doing 
that and it didn't work? Though I won't advise on doing that for HTTP stuff. I 
guess it's OK for your own protocols.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] 1.99_14: socket problem

Posted by Jie Gao <J....@isu.usyd.edu.au>.


On Mon, 24 May 2004, Stas Bekman wrote:

> Date: Mon, 24 May 2004 14:53:31 -0700
> From: Stas Bekman <st...@stason.org>
> To: Jie Gao <J....@isu.usyd.edu.au>
> Cc: modperl@perl.apache.org
> Subject: Re: [mp2] 1.99_14: socket problem
>
> Jie Gao wrote:
> >
> >
> > On Mon, 24 May 2004, Stas Bekman wrote:
> >
> >
> >>Date: Mon, 24 May 2004 10:18:22 -0700
> >>From: Stas Bekman <st...@stason.org>
> >>To: Jie Gao <J....@isu.usyd.edu.au>
> >>Cc: modperl@perl.apache.org
> >>Subject: Re: [mp2] 1.99_14: socket problem
> >>
> >>Jie Gao wrote:
> >>
> >>>Hi All,
> >>>
> >>>This used to work:
> >>>
> >>>    $socket->recv($line, 34);
> >>>
> >>>but the syntax has changed in 1.99_14, so I modified it to be:
> >>>
> >>>    $line = $socket->recv(34);
> >>>
> >>>But I am getting this error:
> >>>
> >>>     [error] APR::Socket::recv: Resource temporarily unavailable at ...pm line 117
> >>>
> >>>OBAny other obvious changes in APR::Socket that I missed here?
> >>
> >>The syntax has changes, yes. And you've adjusted it correctly. The problem
> >>might be coming from Apache I think. If you don't send complete reports it's
> >>hard to guess. Please *always* submit proper bug reports:
> >>See http://perl.apache.org/bugs/
> >>
> >>If you've moved to Apache 2.0.49, it now gives you a non-blocking socket. So
> >>all protocol handlers now must start with:
> >>
> >>use APR::Const    -compile => 'SO_NONBLOCK';
> >>$sock->opt_set(APR::SO_NONBLOCK => 0);

Is this supported?

    $socket->opt_set(APR::SO_KEEPALIVE, 1);

Regards,


Jie

> >
> > Yes, I got your latest doco and put this line in yesterday and it worked!
>
> Excellent. It's really a problem in Apache 2.0.49, not mod_perl. But before
> 1.99_14 it was silently failing, with 1.99_14 it doesn't. I'll add a xref to
> that information from the recv entry in the APR::Socket manpage.
>
> > BTW, shouldn't it be:
> >
> > $sock->opt_set(APR::SO_NONBLOCK,0);
>
> If you prefer. But both are exactly the same. Please observe:
>
> % perl -MO=Deparse -e '@a = (a => 1)'
> @a = ('a', 1);
> -e syntax OK
>
> It's just a synctatic sugar to show you that these two arguments are connected.
> --
> __________________________________________________________________
> Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/     mod_perl Guide ---> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com
>
> --
> Report problems: http://perl.apache.org/bugs/
> Mail list info: http://perl.apache.org/maillist/modperl.html
> List etiquette: http://perl.apache.org/maillist/email-etiquette.html
>
>

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] 1.99_14: socket problem

Posted by Stas Bekman <st...@stason.org>.
Jie Gao wrote:
> 
> 
> On Mon, 24 May 2004, Stas Bekman wrote:
> 
> 
>>Date: Mon, 24 May 2004 10:18:22 -0700
>>From: Stas Bekman <st...@stason.org>
>>To: Jie Gao <J....@isu.usyd.edu.au>
>>Cc: modperl@perl.apache.org
>>Subject: Re: [mp2] 1.99_14: socket problem
>>
>>Jie Gao wrote:
>>
>>>Hi All,
>>>
>>>This used to work:
>>>
>>>    $socket->recv($line, 34);
>>>
>>>but the syntax has changed in 1.99_14, so I modified it to be:
>>>
>>>    $line = $socket->recv(34);
>>>
>>>But I am getting this error:
>>>
>>>     [error] APR::Socket::recv: Resource temporarily unavailable at ...pm line 117
>>>
>>>OBAny other obvious changes in APR::Socket that I missed here?
>>
>>The syntax has changes, yes. And you've adjusted it correctly. The problem
>>might be coming from Apache I think. If you don't send complete reports it's
>>hard to guess. Please *always* submit proper bug reports:
>>See http://perl.apache.org/bugs/
>>
>>If you've moved to Apache 2.0.49, it now gives you a non-blocking socket. So
>>all protocol handlers now must start with:
>>
>>use APR::Const    -compile => 'SO_NONBLOCK';
>>$sock->opt_set(APR::SO_NONBLOCK => 0);
> 
> 
> Yes, I got your latest doco and put this line in yesterday and it worked!

Excellent. It's really a problem in Apache 2.0.49, not mod_perl. But before 
1.99_14 it was silently failing, with 1.99_14 it doesn't. I'll add a xref to 
that information from the recv entry in the APR::Socket manpage.

> BTW, shouldn't it be:
> 
> $sock->opt_set(APR::SO_NONBLOCK,0);

If you prefer. But both are exactly the same. Please observe:

% perl -MO=Deparse -e '@a = (a => 1)'
@a = ('a', 1);
-e syntax OK

It's just a synctatic sugar to show you that these two arguments are connected.
-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] 1.99_14: socket problem

Posted by Jie Gao <J....@isu.usyd.edu.au>.


On Mon, 24 May 2004, Stas Bekman wrote:

> Date: Mon, 24 May 2004 10:18:22 -0700
> From: Stas Bekman <st...@stason.org>
> To: Jie Gao <J....@isu.usyd.edu.au>
> Cc: modperl@perl.apache.org
> Subject: Re: [mp2] 1.99_14: socket problem
>
> Jie Gao wrote:
> > Hi All,
> >
> > This used to work:
> >
> >     $socket->recv($line, 34);
> >
> > but the syntax has changed in 1.99_14, so I modified it to be:
> >
> >     $line = $socket->recv(34);
> >
> > But I am getting this error:
> >
> >      [error] APR::Socket::recv: Resource temporarily unavailable at ...pm line 117
> >
> > OBAny other obvious changes in APR::Socket that I missed here?
>
> The syntax has changes, yes. And you've adjusted it correctly. The problem
> might be coming from Apache I think. If you don't send complete reports it's
> hard to guess. Please *always* submit proper bug reports:
> See http://perl.apache.org/bugs/
>
> If you've moved to Apache 2.0.49, it now gives you a non-blocking socket. So
> all protocol handlers now must start with:
>
> use APR::Const    -compile => 'SO_NONBLOCK';
> $sock->opt_set(APR::SO_NONBLOCK => 0);

Yes, I got your latest doco and put this line in yesterday and it worked!
BTW, shouldn't it be:

$sock->opt_set(APR::SO_NONBLOCK,0);


Thanks very much,

Regards,




Jie

> See:
> http://perl.apache.org/docs/2.0/user/handlers/protocols.html#Socket_based_Protocol_Module
>
> --
> __________________________________________________________________
> Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/     mod_perl Guide ---> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com
>

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] 1.99_14: socket problem

Posted by Stas Bekman <st...@stason.org>.
Jie Gao wrote:
> Hi All,
> 
> This used to work:
> 
>     $socket->recv($line, 34);
> 
> but the syntax has changed in 1.99_14, so I modified it to be:
> 
>     $line = $socket->recv(34);
> 
> But I am getting this error:
> 
>      [error] APR::Socket::recv: Resource temporarily unavailable at ...pm line 117
> 
> OBAny other obvious changes in APR::Socket that I missed here?

The syntax has changes, yes. And you've adjusted it correctly. The problem 
might be coming from Apache I think. If you don't send complete reports it's 
hard to guess. Please *always* submit proper bug reports:
See http://perl.apache.org/bugs/

If you've moved to Apache 2.0.49, it now gives you a non-blocking socket. So 
all protocol handlers now must start with:

use APR::Const    -compile => 'SO_NONBLOCK';
$sock->opt_set(APR::SO_NONBLOCK => 0);

See:
http://perl.apache.org/docs/2.0/user/handlers/protocols.html#Socket_based_Protocol_Module

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html