Would you mind filing a bug against Apache2::SOAP. Then Randy may fix his dirty hack to determine MP2-Version ;-)
http://rt.cpan.org/Public/Dist/Display.html?Name=Apache2-SOAP Tom Georg Grabler schrieb: > Well, i kicked out the old code which seemed to be buggy of > Apache2::SOAP, and used the codepiece you gave me to determine which > modperl version i'm using. > > What shall i say, except thank you very much, Tom. It works perfectly > now, and all the day searching for a mistake i did in my server > configuration now ended up in a as it seems a bugfix for a bug in a module. > > Thank you for your time, and the help you provided me, and hopefully > others, when they're reading the archives. > Georg > > On 8/2/06, *Tom Schindl* <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > 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 > >