Georg Grabler schrieb:
> A the logfile says, i execute the method using Apache2.
> 
> For a better understanding:
> 
>   my $cl = ($self->{'MOD_PERL_VERSION'} == 1) ?
>     $r->header_in('Content-length') : $r->headers_in->{'Content-length'};
> 
> This is the code Apache2::SOAP module uses for determining the version
> of modperl.
> The $self->{'MOD_PERL_VERSION'} gets set in the new method, where the
> code seems to fail at all.. so the version is never set to two.
> 
> codepiece cut from Apache2::SOAP:
> sub new {
>   my $self = shift;
>   unless (ref $self) {
>     my $class = ref($self) || $self;
>     $self = $class->SUPER::new(@_);
>     SOAP::Trace::objects('()');
>   }
>  MOD_PERL: {
>     (eval { require Apache;} ) and do {
>        require Apache::Constants;
>        Apache::Constants->import('OK');
>        $self->{'MOD_PERL_VERSION'} = 1;
>        last MOD_PERL;
>      };
>     (eval { require Apache2::RequestRec;} ) and do {
>       require Apache2::RequestUtil;
>       require Apache2::RequestIO;
>       require Apache2::Const;
>       require APR::Table;
>       Apache2::Const->import(-compile => 'OK');
>       $self->{'MOD_PERL_VERSION'} = 2;
>       print "!!MOD PERL VERSION DEFINED!!";
>       last MOD_PERL;
>     };
>     die "Unsupported version of mod_perl";
>   }
>   return $self;
> }

Do you have mp1 and mp2 installed in the same perl-tree.

If yes then it's clear why you always get to
"$self->{'MOD_PERL_VERSION'} = 1;". To distinguish if running in mp1 or
mp2 a module should use totally different code.

if (exists $ENV{MOD_PERL_API_VERSION} && $ENV{MOD_PERL_API_VERSION} == 2) {
require Apache2::Response;
require Apache2::RequestRec;
require Apache2::RequestUtil;
require Apache2::RequestIO;
// ...
} else {
require Apache;
// ...
}

I'd advice the Apache2::SOAP maintainer that he will get into trouble
when mp1 and mp2 are installed in the same tree.

Tom

Reply via email to