Apache 2.2 on Windows - problem with Params::Callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,
Below is a little test script, that show a strange behav. ( or may be a bug ).
============================================================
#!/usr/bin/perl
use strict;
use warnings;
if ( fork ) {
    wait;
}

# this will not work on Apache 2.2 on Windows
# gives following error into "child" thread
# "No callback found for callback key 'Download|Process_cb'"
# use App::Mason::Interp qw();
# ... but this will work
eval 'use App::Mason::Interp qw();';
my $InterpObject = App::Mason::Interp->new
    (
        comp_root => '/var/www/site',
        cb_classes   => 'ALL',
        ignore_nulls => 1,
    )
;
$InterpObject->exec( '/index.mhtml', 'Download|Process_cb' => 1 );
1;
__END__
package App::Mason::Interp;
use strict;
use warnings;
# Load order is important here!
use App::Callback qw();
use App::Callback::Download qw();
use MasonX::Interp::WithCallbacks qw();
use base qw(MasonX::Interp::WithCallbacks);
1;
__END__
package App::Callback::Download;
use strict;
use warnings;
use Params::Callback qw();
use base qw(Params::Callback);
__PACKAGE__->register_subclass;
use constant CLASS_KEY => 'Download';
sub Process : Callback
{
    my $self = shift;
    return;
}
1;
__END__
============================================================
The problem actually happens into Params::Callback package, because on load time it "search" all defined callback methods,
and stores into package variable all code references that are declared as callbacks. But these code references are different into the child process,
( which I have no idea why is this, may be a behav. from Attribute::Handlers package ) and into these case the above error occurs.
The solution in this case, is _not_ to load anything into your parent process before the child process is created ( oposite from Unix case, when
this is crutial for memory sharing ), i.e. without custom start.pl script into apache conf or custom loading of perl packages into httpd.conf.
Regards,
Andrei


      

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux